diff --git a/build/ccxt.browser.js b/build/ccxt.browser.js index 0e6684a67117..a22ab77b291b 100644 --- a/build/ccxt.browser.js +++ b/build/ccxt.browser.js @@ -45,7 +45,7 @@ const Exchange = require ('./js/base/Exchange') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.13.142' +const version = '1.13.143' Exchange.ccxtVersion = version @@ -16473,7 +16473,7 @@ module.exports = class chilebit extends foxbit { // --------------------------------------------------------------------------- const Exchange = require ('./base/Exchange'); -const { ExchangeError } = require ('./base/errors'); +const { ExchangeError, InsufficientFunds } = require ('./base/errors'); // --------------------------------------------------------------------------- @@ -16596,6 +16596,9 @@ module.exports = class cobinhood extends Exchange { 'amount': 8, 'price': 8, }, + 'exceptions': { + 'insufficient_balance': InsufficientFunds, + }, }); } @@ -17029,8 +17032,13 @@ module.exports = class cobinhood extends Exchange { throw new ExchangeError (this.id + ' ' + body); } let response = JSON.parse (body); - let message = this.safeValue (response['error'], 'error_code'); - throw new ExchangeError (this.id + ' ' + message); + let error_code = this.safeValue (response['error'], 'error_code'); + const feedback = this.id + ' ' + this.json (response); + const exceptions = this.exceptions; + if (error_code in exceptions) { + throw new exceptions[code] (feedback); + } + throw new ExchangeError (feedback); } }; @@ -17532,7 +17540,7 @@ module.exports = class coinegg extends Exchange { async fetchTickers (symbols = undefined, params = {}) { await this.loadMarkets (); - let quoteIds = [ 'btc', 'usc' ]; + let quoteIds = this.options['quoteIds']; let result = {}; for (let b = 0; b < quoteIds.length; b++) { let quoteId = quoteIds[b]; @@ -33931,7 +33939,7 @@ module.exports = class lbank extends Exchange { 'percentage': undefined, 'average': undefined, 'baseVolume': this.safeFloat (ticker, 'vol'), - 'quoteVolume': undefined, + 'quoteVolume': this.safeFloat (ticker, 'turnover'), 'info': info, }; } @@ -51613,4 +51621,4 @@ exports.isBuffer = function isBuffer(obj) { }; },{}]},{},[1]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbI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m94JzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmlib3guanMnKSxcbiAgICAnYmluYW5jZSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaW5hbmNlLmpzJyksXG4gICAgJ2JpdDJjJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0MmMuanMnKSxcbiAgICAnYml0YmFuayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRiYW5rLmpzJyksXG4gICAgJ2JpdGJheSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0YmF5LmpzJyksXG4gICAgJ2JpdGZpbmV4JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0ZmluZXguanMnKSxcbiAgICAnYml0ZmluZXgyJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRmaW5leDIuanMnKSxcbiAgICAnYml0Zmx5ZXInOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRmbHllci5qcycpLFxuICAgICdiaXRodW1iJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGh1bWIuanMnKSxcbiAgICAnYml0a2snOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRray5qcycpLFxuICAgICdiaXRsaXNoJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGxpc2guanMnKSxcbiAgICAnYml0bWFya2V0JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtYXJrZXQuanMnKSxcbiAgICAnYml0bWV4JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtZXguanMnKSxcbiAgICAnYml0c28nOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzby5qcycpLFxuICAgICdiaXRzdGFtcCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wLmpzJyksXG4gICAgJ2JpdHN0YW1wMSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c3RhbXAxLmpzJyksXG4gICAgJ2JpdHRyZXgnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0dHJleC5qcycpLFxuICAgICdiaXR6JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHouanMnKSxcbiAgICAnYmwzcCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ibDNwLmpzJyksXG4gICAgJ2JsZXV0cmFkZSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmxldXRyYWRlLmpzJyksXG4gICAgJ2JyYXppbGlleCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnJhemlsaWV4LmpzJyksXG4gICAgJ2J0Y2JveCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjYm94LmpzJyksXG4gICAgJ2J0Y2NoaW5hJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjY2hpbmEuanMnKSxcbiAgICAnYnRjZXhjaGFuZ2UnOiAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNleGNoYW5nZS5qcycpLFxuICAgICdidGNtYXJrZXRzJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y21hcmtldHMuanMnKSxcbiAgICAnYnRjdHJhZGVpbSc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0cmFkZWltLmpzJyksXG4gICAgJ2J0Y3RyYWRldWEnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjdHJhZGV1YS5qcycpLFxuICAgICdidGN0dXJrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3R1cmsuanMnKSxcbiAgICAnYnRjeCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN4LmpzJyksXG4gICAgJ2J4aW50aCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnhpbnRoLmpzJyksXG4gICAgJ2NjZXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2NleC5qcycpLFxuICAgICdjZXgnOiAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NleC5qcycpLFxuICAgICdjaGJ0Yyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NoYnRjLmpzJyksXG4gICAgJ2NoaWxlYml0JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2hpbGViaXQuanMnKSxcbiAgICAnY29iaW5ob29kJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2Jpbmhvb2QuanMnKSxcbiAgICAnY29pbmNoZWNrJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luY2hlY2suanMnKSxcbiAgICAnY29pbmVnZyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luZWdnLmpzJyksXG4gICAgJ2NvaW5leCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmV4LmpzJyksXG4gICAgJ2NvaW5leGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmV4Y2hhbmdlLmpzJyksXG4gICAgJ2NvaW5mbG9vcic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmZsb29yLmpzJyksXG4gICAgJ2NvaW5naSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmdpLmpzJyksXG4gICAgJ2NvaW5tYXJrZXRjYXAnOiAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbm1hcmtldGNhcC5qcycpLFxuICAgICdjb2lubWF0ZSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXRlLmpzJyksXG4gICAgJ2NvaW5uZXN0JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbm5lc3QuanMnKSxcbiAgICAnY29pbm9uZSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lub25lLmpzJyksXG4gICAgJ2NvaW5zZWN1cmUnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbnNlY3VyZS5qcycpLFxuICAgICdjb2luc3BvdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zcG90LmpzJyksXG4gICAgJ2NvaW50aWdlcic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbnRpZ2VyLmpzJyksXG4gICAgJ2Nvb2xjb2luJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29vbGNvaW4uanMnKSxcbiAgICAnY3J5cHRvcGlhJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jcnlwdG9waWEuanMnKSxcbiAgICAnZHN4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9kc3guanMnKSxcbiAgICAnZXRoZmluZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ldGhmaW5leC5qcycpLFxuICAgICdleG1vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2V4bW8uanMnKSxcbiAgICAnZXh4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9leHguanMnKSxcbiAgICAnZmxvd2J0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9mbG93YnRjLmpzJyksXG4gICAgJ2ZveGJpdCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZm94Yml0LmpzJyksXG4gICAgJ2Z5YnNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2UuanMnKSxcbiAgICAnZnlic2cnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9meWJzZy5qcycpLFxuICAgICdnYXRlY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVjb2luLmpzJyksXG4gICAgJ2dhdGVpbyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2F0ZWlvLmpzJyksXG4gICAgJ2dkYXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2RheC5qcycpLFxuICAgICdnZW1pbmknOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dlbWluaS5qcycpLFxuICAgICdnZXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dldGJ0Yy5qcycpLFxuICAgICdoYWRheCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hhZGF4LmpzJyksXG4gICAgJ2hpdGJ0Yyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaGl0YnRjLmpzJyksXG4gICAgJ2hpdGJ0YzInOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaGl0YnRjMi5qcycpLFxuICAgICdodW9iaSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpLmpzJyksXG4gICAgJ2h1b2JpY255JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmljbnkuanMnKSxcbiAgICAnaHVvYmlwcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaXByby5qcycpLFxuICAgICdpY2UzeCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2ljZTN4LmpzJyksXG4gICAgJ2luZGVwZW5kZW50cmVzZXJ2ZSc6ICAgICAgcmVxdWlyZSAoJy4vanMvaW5kZXBlbmRlbnRyZXNlcnZlLmpzJyksXG4gICAgJ2luZG9kYXgnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaW5kb2RheC5qcycpLFxuICAgICdpdGJpdCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2l0Yml0LmpzJyksXG4gICAgJ2p1YmknOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvanViaS5qcycpLFxuICAgICdrcmFrZW4nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2tyYWtlbi5qcycpLFxuICAgICdrdWNvaW4nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2t1Y29pbi5qcycpLFxuICAgICdrdW5hJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2t1bmEuanMnKSxcbiAgICAnbGFrZWJ0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9sYWtlYnRjLmpzJyksXG4gICAgJ2xiYW5rJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGJhbmsuanMnKSxcbiAgICAnbGlxdWknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9saXF1aS5qcycpLFxuICAgICdsaXZlY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xpdmVjb2luLmpzJyksXG4gICAgJ2x1bm8nOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbHVuby5qcycpLFxuICAgICdseWtrZSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2x5a2tlLmpzJyksXG4gICAgJ21lcmNhZG8nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbWVyY2Fkby5qcycpLFxuICAgICdtaXhjb2lucyc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL21peGNvaW5zLmpzJyksXG4gICAgJ25lZ29jaWVjb2lucyc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbmVnb2NpZWNvaW5zLmpzJyksXG4gICAgJ25vdmEnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbm92YS5qcycpLFxuICAgICdva2NvaW5jbnknOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rY29pbmNueS5qcycpLFxuICAgICdva2NvaW51c2QnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rY29pbnVzZC5qcycpLFxuICAgICdva2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rZXguanMnKSxcbiAgICAncGF5bWl1bSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9wYXltaXVtLmpzJyksXG4gICAgJ3BvbG9uaWV4JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcG9sb25pZXguanMnKSxcbiAgICAncXJ5cHRvcyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xcnlwdG9zLmpzJyksXG4gICAgJ3F1YWRyaWdhY3gnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXVhZHJpZ2FjeC5qcycpLFxuICAgICdxdW9pbmV4JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3F1b2luZXguanMnKSxcbiAgICAnc291dGh4Y2hhbmdlJzogICAgICAgICAgICByZXF1aXJlICgnLi9qcy9zb3V0aHhjaGFuZ2UuanMnKSxcbiAgICAnc3VyYml0Y29pbic6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9zdXJiaXRjb2luLmpzJyksXG4gICAgJ3RoZXJvY2snOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdGhlcm9jay5qcycpLFxuICAgICd0aWRlYml0JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RpZGViaXQuanMnKSxcbiAgICAndGlkZXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRleC5qcycpLFxuICAgICd1cmR1Yml0JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3VyZHViaXQuanMnKSxcbiAgICAndmF1bHRvcm8nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YXVsdG9yby5qcycpLFxuICAgICd2YnRjJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3ZidGMuanMnKSxcbiAgICAndmlyd294JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92aXJ3b3guanMnKSxcbiAgICAnd2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy93ZXguanMnKSxcbiAgICAneGJ0Y2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy94YnRjZS5qcycpLFxuICAgICd5b2JpdCc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3lvYml0LmpzJyksXG4gICAgJ3l1bmJpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMveXVuYmkuanMnKSxcbiAgICAnemFpZic6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy96YWlmLmpzJyksXG4gICAgJ3piJzogICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvemIuanMnKSwgICAgXG59XG5cbi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuYXNzaWduICh7IHZlcnNpb24sIEV4Y2hhbmdlLCBleGNoYW5nZXM6IE9iamVjdC5rZXlzIChleGNoYW5nZXMpIH0sIGV4Y2hhbmdlcywgZnVuY3Rpb25zLCBlcnJvcnMpXG5cbi8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9iYXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvY2F0ZWdvcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvcXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2VfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9zaGFyZWQvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzb2NpYWwvcHJvZmlsZV9zdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzb2NpYWwvcHJvZmlsZV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vdmVydmlldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9xdW90YV9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvdHJhbnNhY3Rpb25fbG9nJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDYXRlZ29yaWVzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWFya2V0Q2F0ZWdvcmllcyAoKTtcbiAgICAgICAgLy8gdGhleSByZXR1cm4gYW4gZW1wdHkgc3RyaW5nIGFtb25nIHRoZWlyIGNhdGVnb3JpZXMsIHd0Zj9cbiAgICAgICAgbGV0IGNhdGVnb3JpZXMgPSByZXNwb25zZVsncmVzcG9uc2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNhdGVnb3JpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmIChjYXRlZ29yaWVzW2ldKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoIChjYXRlZ29yaWVzW2ldKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCB0aGlzXyA9IHRoaXM7IC8vIHdvcmthcm91bmQgZm9yIEJhYmVsIGJ1ZyAobm90IHBhc3NpbmcgYHRoaXNgIHRvIF9yZWN1cnNpdmUoKSBjYWxsKVxuICAgICAgICBsZXQgY2F0ZWdvcmllcyA9IGF3YWl0IHRoaXMuZmV0Y2hDYXRlZ29yaWVzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY2F0ZWdvcmllcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGNhdGVnb3J5ID0gY2F0ZWdvcmllc1tjXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpc18ucHJpdmF0ZUdldE1hcmtldExpc3QgKHtcbiAgICAgICAgICAgICAgICAnY2F0ZWdvcnknOiBjYXRlZ29yeS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXNwb25zZSddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3BvbnNlJ11bcF07XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAoKGNhdGVnb3J5ID09PSAnRk9SRVgnKSB8fCAoY2F0ZWdvcnkgPT09ICdDUllQVE8nKSkge1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgICAgICAgICBiYXNlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMV07XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IGlkO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdVU0QnO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzXy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJPdmVydmlldyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYmFsYW5jZVsncmVzcG9uc2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSA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ICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ18xYnRjeGUnLFxuICAgICAgICAgICAgJ25hbWUnOiAnMUJUQ1hFJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnUEEnLCAvLyBQYW5hbWFcbiAgICAgICAgICAgICdjb21tZW50JzogJ0NyeXB0byBDYXBpdGFsIEFQSScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxZCc6ICcxeWVhcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjA0OS0yYjI5NDQwOC01ZWNjLTExZTctODVjYy1hZGFmZjAxM2RjMWEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly8xYnRjeGUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbS9hcGktZG9jcy5waHAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yaWNhbC1wcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMtYW5kLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4tb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyLXRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnRjLWRlcG9zaXQtYWRkcmVzcy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2dldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2VkaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL25ldycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICB7ICdpZCc6ICdVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYm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Zm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsndXVpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHRoaXMuaWQgPT09ICdjcnlwdG9jYXBpdGFsJylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBpcyBhbiBhYnN0cmFjdCBiYXNlIEFQSSBmb3IgXzFidGN4ZScpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIHF1ZXJ5WydzaWduYXR1cmUnXSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5z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gICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICcyaCc6ICcxMjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnNzIwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzQzMjAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDI0NzYxNC0xZmU2MWM3NC05NjIxLTExZTctOWU4Yy1mMWE2MjdhZmEyNzkuanBnJyxcbiAgICAgICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5qc29uJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYWN4LmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2FjeC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2FjeC5pby9kb2N1bWVudHMvYXBpX3YyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyBHZXQgZGVwdGggb3Igc3BlY2lmaWVkIG1hcmtldCBCb3RoIGFza3MgYW5kIGJpZHMgYXJlIHNvcnRlZCBmcm9tI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hZGVzIGFyZSBzb3J0ZWQgaW4gcmV2ZXJzZSBjcmVhdGlvbiBvcmRlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVtYmVycy9tZScsIC8vIEdldCB5b3VyIHByb2ZpbGUgYW5kIGFjY291bnRzIGluZm9cbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cycsIC8vIEdldCB5b3VyIGRlcG9zaXRzIGhpc3RvcnlcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JywgLy8gR2V0IGRldGFpbHMgb2Ygc3BlY2lmaWMgZGVwb3NpdFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsIC8vIFdoZXJlIHRvIGRlcG9zaXQgVGhlIGFkZHJlc3MgZmllbGQgY291bGQgYmUgZW1wdHkgd2hlbiBhIG5ldyBhZGRyZXNzIGlzIGdlbmVyYXRpbmcgKGUuZy4gZm9yIGJpdGNvaW4pLCB5b3Ugc2hvdWxkIHRyeSBhZ2FpbiBsYXRlciBpbiB0aGF0IGNhc2UuXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJywgLy8gR2V0IHlvdXIgb3JkZXJzLCByZXN1bHRzIGlzIHBhZ2luYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gR2V0IGluZm9ybWF0aW9uIG9mIHNwZWNpZmllZCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsIC8vIEdldCB5b3VyIGV4ZWN1dGVkIHRyYWRlcyBUcmFkZXMgYXJlIHNvcnRlZCBpbiByZXZlcnNlIGNyZWF0aW9uIG9yZGVyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cycsIC8vIEdldCB5b3VyIGNyeXB0b2N1cnJlbmN5IHdpdGhkcmF3c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JywgLy8gR2V0IHlvdXIgY3J5cHRvY3VycmVuY3kgd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJywgLy8gQ3JlYXRlIGEgU2VsbC9CdXkgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvbXVsdGknLCAvLyBDcmVhdGUgbXVsdGlwbGUgc2VsbC9idXkgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2NsZWFyJywgLy8gQ2FuY2VsIGFsbCBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWxldGUnLCAvLyBDYW5jZWwgYW4gb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsIC8vIENyZWF0ZSBhIHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSwgLy8gVGhlcmUgaXMgb25seSAxJSBmZWUgb24gd2l0aGRyYXdhbHMgdG8geW91ciBiYW5rIGFjY291bnQuXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnMjAwMic6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcyMDAzJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWVtYmVyc01lICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291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gKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlz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iAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIG9obGN2WzBdICogMTAwMCxcbiAgICAgICAgICAgIG9obGN2WzFdLFxuICAgICAgICAgICAgb2hsY3ZbMl0sXG4gICAgICAgICAgICBvaGxjdlszXSxcbiAgICAgICAgICAgIG9obGN2WzRdLFxuICAgICAgICAgICAgb2hsY3ZbNV0sXG4gICAgICAgIF07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPSExDViAoc3ltYm9sLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgaWYgKCFsaW1pdClcbiAgICAgICAgICAgIGxpbWl0ID0gNTAwOyAvLyBkZWZhdWx0IGlzIDMwXG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdwZXJpb2QnOiB0aGlzLnRpbWVmcmFtZXNbdGltZWZyYW1lXSxcbiAgICAgICAgICAgICdsaW1pdCc6IGxpbWl0LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ3RpbWVzdGFtcCddID0gc2luY2U7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG9yZGVyWydtYXJrZXQnXTtcbiAgICAgICAgICAgIHN5bWJvbCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF1bJ3N5bWJvbCddO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ2NyZWF0ZWRfYXQnXSk7XG4gICAgICAgIGxldCBzdGF0ZSA9IG9yZGVyWydzdGF0ZSddO1xuICAgICAgICBsZXQgc3RhdHVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoc3RhdGUgPT09ICdkb25lJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdGUgPT09ICd3YWl0Jykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09PSAnY2FuY2VsJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMs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GZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG9yZGVyKTtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGtleSA9IGtleXNba107XG4gICAgICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9IG9yZGVyW2tleV07XG4gICAgICAgICAgICAgICAgICAgIHF1ZXJ5ICs9ICcmb3JkZXJzJTVCJTVEJTVCJyArIGtleSArICclNUQ9JyArIHZhbHVlLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBxdWVyeTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAocGFyYW1zKSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9ICcvYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgaWYgKCdleHRlbnNpb24nIGluIHRoaXMudXJscylcbiAgICAgICAgICAgIHJlcXVlc3QgKz0gdGhpcy51cmxzWydleHRlbnNpb24nXTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZW5jb2RlUGFyYW1zICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhY2Nlc3Nfa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgJ3wnICsgcmVxdWVzdCArICd8JyArIHF1ZXJ5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBzdWZmaXggPSBxdWVyeSArICcmc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBzdWZmaXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZ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AgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYWxsY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYWxsY29pbi5jb20vQWJvdXQvQVBJUmVmZXJlbmNlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnSG9tZS9NYXJrZXRPdmVyVmlld0RldGFpbC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB1bmRlZmluZWQsXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy53ZWJHZXRIb21lTWFya2V0T3ZlclZpZXdEZXRhaWwgKCk7XG4gICAgICAgIGxldCBjb2lucyA9IHJlc3BvbnNlWydtYXJrZXRDb2lucyddO1xuICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGNvaW5zLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0cyA9IGNvaW5zW2pdWydNYXJrZXRzJ107XG4gICAgICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IG1hcmtldHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trXVsnTWFya2V0J107XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ1ByaW1hcnknXTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ1NlY29uZGFyeSddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlSWQgPSBiYXNlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZUlkICsgJ18nICsgcXVvdGVJZDtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ1RyYWRlRW5hYmxlZCddICYmIG1hcmtldFsnQnV5RW5hYmxlZCddICYmIG1hcmtldFsnU2VsbEVuYWJsZWQnXTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICAgICAndHlwZSc6ICdzcG90JyxcbiAgICAgICAgICAgICAgICAgICAgJ3Nwb3QnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IG1hcmtldFsnQXNrRmVlUmF0ZSddLCAvLyBCaWRGZWVSYXRlIDAsIEFza0ZlZVJhdGUgMC4wMDIsIHdlIHVzZSBqdXN0IHRoZSBBc2tGZWVSYXRlIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogbWFya2V0WydBc2tGZWVSYXRlJ10sIC8vIEJpZEZlZVJhdGUgMCwgQXNrRmVlUmF0ZSAwLjAwMiwgd2UgdXNlIGp1c3QgdGhlIEFza0ZlZVJhdGUgaGVyZVxuICAgICAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnUHJpbWFyeURpZ2l0cyddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydTZWNvbmRhcnlEaWdpdHMnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhUcmFkZUFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5PcmRlclByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4T3JkZXJQcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGlmIChzdGF0dXMgPT09IC0xKVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT09IDApXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICBpZiAoc3RhdHVz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lIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYW54cHJvJyxcbiAgICAgICAgICAgICduYW1lJzogJ0FOWFBybycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnSlAnLCAnU0cnLCAnSEsnLCAnTlonIF0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY1OTgzLWZkODU5NWRhLTVlYzktMTFlNy04MmUzLWFkYjNhYjhjMjYxMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hbnhwcm8uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2FueHByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vZG9jcy5hbnh2Mi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hbnhwcm8uY29tL3BhZ2VzL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L2RlcHRoL2Z1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90cmFkZS9mZXRjaCcsIC8vIGRpc2FibGVkIGJ5IEFOWFByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9xdW90ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS97Y3VycmVuY3l9L3NlbmRfc2ltcGxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS90cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25le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ycsICdiYXNlJzogJ0RPR0UnLCAncXVvdGUnOiAnQlRDJywgJ211bHRpcGxpZXInOiAxMDAwMDAwMDAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjYgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1vbmV5SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlWydXYWxsZXRzJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnV2FsbGV0cyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IHdhbGxldCA9IGJhbGFuY2VbJ1dhbGxldHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAod2FsbGV0WydBdmFpbGFibGVfQmFsYW5jZSddWyd2YWx1ZSddKTtcb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ICAgICAgJ25hbWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2VuYWJsZVJhdGVMaW1pdCc6IGZhbHNlLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsIC8vIG1pbGxpc2Vjb25kcyA9IHNlY29uZHMgKiAxMDAwXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3B1YmxpY0FQSSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGVBUEknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTGltaXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZWRpdE9yZGVyJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hCYWxhbmNlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hCaWRzQXNrcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEZ1bmRpbmdGZWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTDJPcmRlckJvb2snOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE1hcmtldHMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyQm9vayc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJCb29rcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnYXBpJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICd3d3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6ICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogICB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiAgICAgIGZhbHNlLFxuICAgICAgICAgICAgICAgICdsb2dpbic6ICAgIGZhbHNlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd0d29mYSc6ICAgIGZhbHNlLCAvLyAyLWZhY3RvciBhdXRoZW50aWNhdGlvbiAob25lLXRpbWUgcGFzc3dvcmQga2V5KVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzogdW5kZWZpbmVkLCAvLyB0byBiZSBmaWxsZWQgbWFudWFsbHkgb3IgYnkgZmV0Y2hNYXJrZXRzXG4gICAgICAgICAgICAnY3VycmVuY2llcyc6IHt9LCAvLyB0byBiZSBmaWxsZWQgbWFudWFsbHkgb3IgYnkgZmV0Y2hNYXJrZXRzXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHVuZGVmaW5lZCwgLy8gcmVkZWZpbmUgaWYgdGhlIGV4Y2hhbmdlIGhhcy5mZXRjaE9ITENWXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB1bmRl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Ghpcy5kZWJ1ZyAgICAgICAgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5qb3VybmFsICAgICAgICAgID0gJ2RlYnVnLmpzb24nXG4gICAgICAgIHRoaXMudXNlckFnZW50ICAgICAgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnR3b2ZhICAgICAgICAgICAgPSBmYWxzZSAvLyB0d28tZmFjdG9yIGF1dGhlbnRpY2F0aW9uICgyRkEpXG5cbiAgICAgICAgdGhpcy5hcGlLZXkgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnNlY3JldCAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMudWlkICAgICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5sb2dpbiAgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnBhc3N3b3JkID0gdW5kZWZpbmVkXG5cbiAgICAgICAgdGhpcy5iYWxhbmNlICAgID0ge31cbiAgICAgICAgdGhpcy5vcmRlcmJvb2tzID0ge31cbiAgICAgICAgdGhpcy50aWNrZXJzICAgID0ge31cbiAgICAgICAgdGhpcy5vcmRlcnMgICAgID0ge31cbiAgICAgICAgdGhpcy50cmFkZXMgICAgID0ge31cblxuICAgICAgICB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLmxhc3RfanNvbl9yZXNwb25zZSA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLmxhc3RfcmVzcG9uc2VfaGVhZGVycyA9IHVuZGVmaW5lZFxuXG4gICAgICAgIHRoaXMuYXJyYXlDb25jYXQgPSAoYSwgYikgPT4gYS5jb25jYXQgKGIpXG5cbiAgICAgICAgY29uc3QgdW5DYW1lbENhc2VQcm9wZXJ0aWVzID0gKG9iaiA9IHRoaXMpID0+IHtcbiAgICAgICAgICAgIGlmIChvYmogIT09IG51bGwpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IGsgb2YgT2JqZWN0Lmdld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Q29zdDogMSxcbiAgICAgICAgICAgIG1heENhcGFjaXR5OiAxMDAwLFxuICAgICAgICB9LCB0aGlzLnRva2VuQnVja2V0KVxuXG4gICAgICAgIHRoaXMudGhyb3R0bGUgPSB0aHJvdHRsZSAodGhpcy50b2tlbkJ1Y2tldClcblxuICAgICAgICB0aGlzLmV4ZWN1dGVSZXN0UmVxdWVzdCA9IGZ1bmN0aW9uICh1cmwsIG1ldGhvZCA9ICdHRVQnLCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgICAgIGxldCBwcm9taXNlID1cbiAgICAgICAgICAgICAgICBmZXRjaEltcGxlbWVudGF0aW9uICh1cmwsIHsgbWV0aG9kLCBoZWFkZXJzLCBib2R5LCAnYWdlbnQnOiB0aGlzLmFnZW50IHx8IG51bGwsIHRpbWVvdXQ6IHRoaXMudGltZW91dCB9KVxuICAgICAgICAgICAgICAgICAgICAuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzTm9kZSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKFsgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIGUudHlwZSwgZS5tZXNzYWdlIF0uam9pbiAoJyAnKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IGUgLy8gcmV0aHJvdyBhbGwgdW5rbm93biBlcnJvcnNcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4gKHJlc3BvbnNlID0+IHRoaXMuaGFuZGxlUmVzdFJlc3BvbnNlIChyZXNwb25zZSwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpKVxuXG4gICAgICAgICAgICByZXR1cm4gdGltZW91dCAodGhpcy50aW1lb3V0LCBwcm9taXNlKS5jYXRjaCAoZSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKGUgaW5zdGFuY2VvZiBUaW1lZE91dClcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJlcXVlc3RUaW1lb3V0ICh0aGlzLmlkICsgJyAnICsgbWV0aG9kICsgJyAnICsgdXJsICsgJyByZXF1ZXN0IHRpbWVkIG91dCAoJyArIHRoaXMudGltZW91dCArICcgbXMpJylcbiAgICAgICAgICAgICAgICB0aHJvdyBlXG4gICAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmaW5lUmVzdEFwaSAoYXBpLCBtZXRob2ROYW1lLCBvcHRpb25zID0ge30pIHtcblxuICAgICAgICBmb3IgKGNvbnN0IHR5cGUgb2YgT2JqZWN0LmtleXMgKGFwaSkpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3QgaHR0cE1ldGhvZCBvZiBPYmplY3Qua2V5cyAoYXBpW3R5cGVdKSkge1xuXG4gICAgICAgICAgICAgICAgbGV0IHBhdGhzID0gYXBpW3R5cGVdW2h0dHBNZXRob2RdXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBwYXRocy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IHBhdGhzW2ldLnRyaW0gKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNwbGl0UGF0aCA9IHBhdGguc3BsaXQgKC9bXmEtekEtWjAtOV0vKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2VNZXRob2QgID0gaHR0cE1ldGhvZC50b1VwcGVyQ2FzZSAoKVxuICAgICAgICAgICAgICAgICAgICBsZXQgbG93ZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9Mb3dlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZU1ldGhvZCAgPSB0aGlzLmNhcGl0YWxpemUgKGxvd2VyY2FzZU1ldGhvZClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZVN1ZmZpeCAgPSBzcGxpdFBhdGgubWFwICh0aGlzLmNhcGl0YWxpemUpLmpvaW4gKCcnKVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZVN1ZmZpeCA9IHNwbGl0UGF0aC5tYXAgKHggPT4geC50cmltICgpLnRvTG93ZXJDYXNlICgpKS5maWx0ZXIgKHggPT4geC5sZW5ndGggPiAwKS5qb2luICgnXycpXG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZSAgPSB0eXBlICsgY2FtZWxjYXNlTWV0aG9kICsgdGhpcy5jYXBpdGFsaXplIChjYW1lbGNhc2VTdWZmaXgpXG4gICAgICAgICAgICAgICAgICAgIGxldCB1bmRlcnNjb3JlID0gdHlwZSArICdfJyArIGxvd2VyY2FzZU1ldGhvZCArICdfJyArIHVuZGVyc2NvcmVTdWZmaXhcblxuICAgICAgICAgICAgICAgICAgICBpZiAoJ3N1ZmZpeGVzJyBpbiBvcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ2NhbWVsY2FzZScgaW4gb3B0aW9uc1snc3VmZml4ZXMnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW1lbGNhc2UgKz0gb3B0aW9uc1snc3VmZml4ZXMnXVsnY2FtZWxjYXNlJ11cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZScgaW4gb3B0aW9ucy5zdWZmaXhlcylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ3VuZGVyc2NvcmUnXVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCd1bmRlcnNjb3JlX3N1ZmZpeCcgaW4gb3B0aW9ucylcbiAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyc2NvcmUgKz0gb3B0aW9ucy51bmR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Byb3h5ID09PSAnZnVuY3Rpb24nKSB7XG5cbiAgICAgICAgICAgIHVybCA9IHRoaXMucHJveHkgKHVybClcbiAgICAgICAgICAgIGlmIChpc05vZGUpXG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAoeyAnT3JpZ2luJzogdGhpcy5vcmlnaW4gfSwgaGVhZGVycylcblxuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiB0aGlzLnByb3h5ID09PSAnc3RyaW5nJykge1xuXG4gICAgICAgICAgICBpZiAodGhpcy5wcm94eS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgaWYgKGlzTm9kZSlcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAoeyAnT3JpZ2luJzogdGhpcy5vcmlnaW4gfSwgaGVhZGVycylcblxuICAgICAgICAgICAgdXJsID0gdGhpcy5wcm94eSArIHVybFxuICAgICAgICB9XG5cbiAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAodGhpcy5oZWFkZXJzLCBoZWFkZXJzKVxuXG4gICAgICAgIGlmICh0aGlzLnZlcmJvc2UpXG4gICAgICAgICAgICBjb25zb2xlLmxvZyAoXCJmZXRjaDpcXG5cIiwgdGhpcy5pZCwgbWV0aG9kLCB1cmwsIFwiXFxuUmVxdWVzdDpcXG5cIiwgaGVhZGVycywgXCJcXG5cIiwgYm9keSwgXCJcXG5cIilcblxuICAgICAgICByZXR1cm4gdGhpcy5leGVjdXRlUmVzdFJlcXVlc3QgKHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KVxuICAgIH1cblxuICAgIGFzeW5jIGZldGNoMiAocGF0aCwgdHlwZSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcblxuICAgICAgICBpZiAodGhpcy5lbmFibGVSYXRlTGltaXQpXG4gICAgICAgICAgICBhd2FpdCB0a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MywgNDA1LCA1MDMsIDUzMCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgbGV0IGRkb3NQcm90ZWN0aW9uID0gcmVzcG9uc2VCb2R5Lm1hdGNoICgvY2xvdWRmbGFyZXxpbmNhcHN1bGEvaSlcbiAgICAgICAgICAgIGlmIChkZG9zUHJvdGVjdGlvbikge1xuICAgICAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICAgICAgICAgIGRldGFpbHMgKz0gJyAocG9zc2libGUgcmVhc29uczogJyArIFtcbiAgICAgICAgICAgICAgICAgICAgJ2ludmFsaWQgQVBJIGtleXMnLFxuICAgICAgICAgICAgICAgICAgICAnYmFkIG9yIG9sZCBub25jZScsXG4gICAgICAgICAgICAgICAgICAgICdleGNoYW5nZSBpcyBkb3duIG9yIG9mZmxpbmUnLFxuICAgICAgICAgICAgICAgICAgICAnb24gbWFpbnRlbmFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAnRERvUyBwcm90ZWN0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUtbGltaXRpbmcnLFxuICAgICAgICAgICAgICAgIF0uam9pbiAoJywgJykgKyAnKSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChbIDQwOCwgNTA0IF0uaW5jbHVkZXMgKGNvZGUpKSB7XG4gICAgICAgICAgICBlcnJvciA9IFJlcXVlc3RUaW1lb3V0XG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDEsIDUxMSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBBdXRoZW50aWNhdGlvbkVycm9yXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBlcnJvciA9IEV4Y2hhbmdlRXJyb3JcbiAgICAgICAgfVxu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VzIChtYXJrZXRzKS5tYXAgKG1hcmtldCA9PiBkZWVwRXh0ZW5kICh7XG4gICAgICAgICAgICAnbGltaXRzJzogdGhpcy5saW1pdHMsXG4gICAgICAgICAgICAncHJlY2lzaW9uJzogdGhpcy5wcmVjaXNpb24sXG4gICAgICAgIH0sIHRoaXMuZmVlc1sndHJhZGluZyddLCBtYXJrZXQpKVxuICAgICAgICB0aGlzLm1hcmtldHMgPSBkZWVwRXh0ZW5kICh0aGlzLm1hcmtldHMsIGluZGV4QnkgKHZhbHVlcywgJ3N5bWJvbCcpKVxuICAgICAgICB0aGlzLm1hcmtldHNCeUlkID0gaW5kZXhCeSAobWFya2V0cywgJ2lkJylcbiAgICAgICAgdGhpcy5tYXJrZXRzX2J5X2lkID0gdGhpcy5tYXJrZXRzQnlJZFxuICAgICAgICB0aGlzLnN5bWJvbHMgPSBPYmplY3Qua2V5cyAodGhpcy5tYXJrZXRzKS5zb3J0ICgpXG4gICAgICAgIHRoaXMuaWRzID0gT2JqZWN0LmtleXMgKHRoaXMubWFya2V0c19ieV9pZCkuc29ydCAoKVxuICAgICAgICBpZiAoY3VycmVuY2llcykge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW5jaWVzID0gZGVlcEV4dGVuZCAoY3VycmVuY2llcywgdGhpcy5jdXJyZW5jaWVzKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgYmFzZUN1cnJlbmNpZXMgPVxuICAgICAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAnYmFzZScgaW4gbWFya2V0KVxuICAgICAgICAgICAgICAgICAgICAubWFwIChtYXJrZXQgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBtYXJrZXQuYmFzZUlkIHx8IG1hcmtldC5iYXNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVtZXJpY0lkOiAodHlwZW9mIG1hcmtldC5iYXNlTnVtZXJpY0lkICE9PSAndW5kZWZpbmVkJykgPyBtYXJrZXQuYmFzZU51bWVyaWNJZCA6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IG1hcmtldC5iYXNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24uYmFzZSB8fCBtYXJrZXQucHJlY2lzaW9uLmFtb3VudCkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IHF1b3RlQ3VycmVuY2llcyA9XG4gICAgICAgICAgICAgICAgdmFsdWVzLmZpbHRlciAobWFya2V0ID0+ICdxdW90ZScgaW4gbWFya2V0KVxuICAgICAgICAgICAgICAgICAgICAubWFwIChtYXJrZXQgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBtYXJrZXQucXVvdGVJZCB8fCBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBudW1lcmljSWQ6ICh0eXBlb2YgbWFya2V0LnF1b3RlTnVtZXJpY0lkICE9PSAndW5kZWZpbmVkJykgPyBtYXJrZXQucXVvdGVOdW1lcmljSWQgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb246IG1hcmtldC5wcmVjaXNpb24gPyAobWFya2V0LnByZWNpc2lvbi5xdW90ZSB8fCBtYXJrZXQucHJlY2lzaW9uLnByaWNlKSA6IDgsXG4gICAgICAgICAgICAgICAgICAgIH0pKVxuICAgICAgICAgICAgY29uc3QgYWxsQ3VycmVuY2llcyA9IGJhc2VDdXJyZW5jaWVzLmNvbmNhdCAocXVvdGVDdXJyZW5jaWVzKVxuICAgICAgICAgICAgY29uc3QgZ3JvdXBlZEN1cnJlbmNpZXMgPSBncm91cEJ5IChhbGxDdXJyZW5jaWVzLCAnY29kZScpXG4gICAgICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGdyb3VwZWRDdXJyZW5jaWVzKS5tYXAgKGNvZGUgPT5cbiAgICAgICAgICAgICAgICBncm91cGVkQ3VycmVuY2llc1tjb2RlXS5yZWR1Y2UgKChwcmV2aW91cywgY3VycmVudCkgPT5cbiAgICAgICAgICAgICAgICAgICAgKChwcmV2aW91cy5wcmVjaXNpb24gPiBjdXJyZW50LnByZWNpc2lvbikgPyBwcmV2aW91cyA6IGN1cnJlbnQpLCBncm91cGVkQ3VycmVuY2llc1tjb2RlXVswXSkpXG4gICAgICAgICAgICBjb25zdCBzb3J0ZWRDdXJyZW5jaWVzID0gc29ydEJ5IChmbGF0dGVuIChjdXJyZW5jaWVzKSwgJ2NvZGUnKVxuICAgICAgICAgICAgdGhpcy5jdXJyZW5jaWVzID0gZGVlcEV4dGVuZCAoaW5kZXhCeSAoc29ydGVkQ3VycmVuY2llcywgJ2NvZGUnKSwgdGhpcy5jdXJyZW5jaWVzKVxuICAgICAgICB9XG4gICAgICAgIHRoaXMuY3VycmVuY2llc19ieV9pZCA9IGluZGV4QnkgKHRoaXMuY3VycmVuY2llcywgJ2lkJylcbiAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c1xuICAgIH1cblxuICAgIGFzeW5jIGxvYWRNYXJrZXRzIChyZWxvYWQgPSBmYWxzZSkge1xuICAgICAgICBpZiAoIXJlbG9hZCAmJiB0aGlzLm1hcmtldHMpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc2V0TWFya2V0cyAodGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c1xuICAgICAgICB9XG4gICAgICAgIGNvbnN0IG1hcmtldHMgPSBhd2FpdCB0aGlzLmZldGNoTWFya2V0cyAoKVxuICAgICAgIC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uICAgIH1cblxuICAgIGNvbnZlcnRPSExDVlRvVHJhZGluZ1ZpZXcgKG9obGN2cykge1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ3QnOiBbXSxcbiAgICAgICAgICAgICdvJzogW10sXG4gICAgICAgICAgICAnaCc6IFtdLFxuICAgICAgICAgICAgJ2wnOiBbXSxcbiAgICAgICAgICAgICdjJzogW10sXG4gICAgICAgICAgICAndic6IFtdLFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9obGN2cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgcmVzdWx0Wyd0J10ucHVzaCAocGFyc2VJbnQgKG9obGN2c1tpXVswXSAvIDEwMDApKTtcbiAgICAgICAgICAgIHJlc3VsdFsnbyddLnB1c2ggKG9obGN2c1tpXVsxXSk7XG4gICAgICAgICAgICByZXN1bHRbJ2gnXS5wdXNoIChvaGxjdnNbaV1bMl0pO1xuICAgICAgICAgICAgcmVzdWx0WydsJ10ucHVzaCAob2hsY3ZzW2ldWzNdKTtcbiAgICAgICAgICAgIHJlc3VsdFsnYyddLnB1c2ggKG9obGN2c1tpXVs0XSk7XG4gICAgICAgICAgICByZXN1bHRbJ3YnXS5wdXNoIChvaGxjdnNbaV1bNV0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aHJvdyBuZXcgTm90U3VwcG9ydGVkICh0aGlzLmlkICsgJyBmZXRjaFRpY2tlcnMgbm90IHN1cHBvcnRlZCB5ZXQnKVxuICAgIH1cblxuICAgIHB1cmdlQ2FjaGVkT3JkZXJzIChiZWZvcmUpIHtcbiAgICAgICAgY29uc3Qgb3JkZXJzID0gT2JqZWN0XG4gICAgICAgICAgICAudmFsdWVzICh0aGlzLm9yZGVycylcbiA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WQgKyAnIGRvZXMgbm90IGhhdmUgY3VycmVuY3kgY29kZSAnICsgY29kZSlcbiAgICB9XG5cbiAgICBmaW5kTWFya2V0IChzdHJpbmcpIHtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMubWFya2V0cyA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFya2V0cyBub3QgbG9hZGVkJylcblxuICAgICAgICBpZiAodHlwZW9mIHN0cmluZyA9PT0gJ3N0cmluZycpIHtcblxuICAgICAgICAgICAgaWYgKHN0cmluZyBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c19ieV9pZFtzdHJpbmddXG5cbiAgICAgICAgICAgIGlmIChzdHJpbmcgaW4gdGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNbc3RyaW5nXVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIHN0cmluZ1xuICAgIH1cblxuICAgIGZpbmRTeW1ib2wgKHN0cmluZywgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG5cbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5maW5kTWFya2V0IChzdHJpbmcpXG5cbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICdvYmplY3QnKVxuICAgICAgICAgICAgcmV0dXJuIG1hcmtldFsnc3ltYm9sJ11cblxuICAgICAgICByZXR1cm4gc3RyaW5nXG4gICAgfVxuXG4gICAgbWFya2V0IChzeW1ib2wpIHtcblxuICAgICAgICBpZiAodHlwZW9mIHRoaXMubWFya2V0cyA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpc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9PSAndW5kZWZpbmVkJykgPyB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCkgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbm9uY2UnOiB1bmRlZmluZWQsXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBnZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KSB7XG4gICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzICh0aGlzLm9yZGVycykuZmlsdGVyIChvcmRlciA9PiAob3JkZXJbJ3N0YXR1cyddID09PSAnb3BlbicpKS5yZWR1Y2UgKCh0b3RhbCwgb3JkZXIpID0+IHtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBvcmRlclsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICBsZXQgcmVtYWluaW5nID0gb3JkZXJbJ3JlbWFpbmluZyddXG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT09IG1hcmtldFsnYmFzZSddICYmIG9yZGVyWydzaWRlJ10gPT09ICdzZWxsJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIHJlbWFpbmluZ1xuICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PT0gbWFya2V0WydxdW90ZSddICYmIG9yZGVyWydzaWRlJ10gPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRvdGFsICsgKG9yZGVyWydwcmljZSddICogcmVtYWluaW5nKVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdG90YWxcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSwgMClcbiAgICB9XG5cbiAgICBwYXJzZUJhbGFuY2UgKGJhbGFuY2UpIHtcblxuICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMub21pdCAoYmFsYW5jZSw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8vIHNpbmdsZS1wYXNzIGZpbHRlciBmb3IgYm90aCBzeW1ib2wgYW5kIHNpbmNlXG4gICAgICAgIGlmIChzeW1ib2xJc0RlZmluZWQgfHwgc2luY2VJc0RlZmluZWQpXG4gICAgICAgICAgICBhcnJheSA9IE9iamVjdC52YWx1ZXMgKGFycmF5KS5maWx0ZXIgKGVudHJ5ID0+XG4gICAgICAgICAgICAgICAgKChzeW1ib2xJc0RlZmluZWQgPyAoZW50cnkuc3ltYm9sID09PSBzeW1ib2wpICA6IHRydWUpICYmXG4gICAgICAgICAgICAgICAgIChzaW5jZUlzRGVmaW5lZCAgPyAoZW50cnkudGltZXN0YW1wID49IHNpbmNlKSA6IHRydWUpKSlcblxuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGFycmF5ID0gT2JqZWN0LnZhbHVlcyAoYXJyYXkpLnNsaWNlICgwLCBsaW1pdClcblxuICAgICAgICByZXR1cm4gYXJyYXlcbiAgICB9XG5cbiAgICBmaWx0ZXJCeUFycmF5IChvYmplY3RzLCBrZXksIHZhbHVlcyA9IHVuZGVmaW5lZCwgaW5kZXhlZCA9IHRydWUpIHtcblxuICAgICAgICBvYmplY3RzID0gT2JqZWN0LnZhbHVlcyAob2JqZWN0cylcblxuICAgICAgICAvLyByZXR1cm4gYWxsIG9mIHRoZW0gaWYgbm8gdmFsdWVzIHdlcmUgcGFzc2VkXG4gICAgICAgIGlmICh0eXBlb2YgdmFsdWVzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJldHVybiBpbmRleGVkID8gaW5kZXhCeSAob2JqZWN0cywga2V5KSA6IG9iamVjdHNcblxuICAgICAgICBsZXQgcmVzdWx0ID0gW11cbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvYmplY3RzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAodmFsdWVzLmluY2x1ZGVzIChvYmplY3RzW2ldW2tleV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V0VVRDTW9udGggKCkgKyAxXG4gICAgICAgIGxldCBkID0gZGF0ZS5nZXRVVENEYXRlICgpXG4gICAgICAgIGxldCBIID0gZGF0ZS5nZXRVVENIb3VycyAoKVxuICAgICAgICBsZXQgTSA9IGRhdGUuZ2V0VVRDTWludXRlcyAoKVxuICAgICAgICBsZXQgUyA9IGRhdGUuZ2V0VVRDU2Vjb25kcyAoKVxuICAgICAgICBtID0gbSA8IDEwID8gKCcwJyArIG0pIDogbVxuICAgICAgICBkID0gZCA8IDEwID8gKCcwJyArIGQpIDogZFxuICAgICAgICBIID0gSCA8IDEwID8gKCcwJyArIEgpIDogSFxuICAgICAgICBNID0gTSA8IDEwID8gKCcwJyArIE0pIDogTVxuICAgICAgICBTID0gUyA8IDEwID8gKCcwJyArIFMpIDogU1xuICAgICAgICByZXR1cm4gWSArICctJyArIG0gKyAnLScgKyBkICsgaW5maXggKyBIICsgJzonICsgTSArICc6JyArIFNcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBNYXJrZXQge1xuXG4gICAgY29uc3RydWN0b3IgKGV4Y2hhbmdlLCBzeW1ib2wpIHtcbiAgICAgICAgdGhpcy5leGNoYW5nZSA9IGV4Y2hhbmdlO1xuICAgICAgICB0aGlzLnN5bWJvbCA9IHN5bWJvbDtcbiAgICAgICAgdGhpcy5tYXJrZXQgPSBleGNoYW5nZS5tYXJrZXRzW3N5bWJvbF07XG4gICAgfVxuXG4gICAgYW1vdW50VG9QcmVjaXNpb24gKGFtb3VudCkge1xuICAgICAgICByZXR1cm4gdGhpcy5leGNoYW5nZS5hbW91bnRUb1ByZWNpc2lvbiAodGhpcy5zeW1ib2wsIGFtb3VudClcbiAgICB9XG5cbiAgICBjcmVhdGVMaW1pdEJ1eU9yZGVyKGFtb3VudCwgcHJpY2UpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXhjaGFuZ2UuY3JlYXRlTGltaXRCdXlPcmRlciAodGhpcy5zeW1ib2wsIGFtb3VudCwgcHJpY2UpXG4gICAgfVxuXG4gICAgY3JlYXRlTGltaXRTZWxsT3JkZXIoYW1vdW50LCBwcmljZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5leGNoYW5nZS5jcmVhdGVMaW1pdFNlbGxPcmRlciAodGhpcy5zeW1ib2wsIGFtb3VudCwgcHJpY2UpXG4gICAgfVxufVxuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vKiAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovXG5cbm1vZHVsZS5leHBvcnRzID0gc3ViY2xhc3MgKFxuXG4vKiAgUm9vdCBjbGFzcyAgICAgICAgICAgICAgICAgICovXG5cbiAgICBFcnJvcixcblxuLyogIERlcml2ZWQgY2xhc3MgaGllcmFyY2h5ICAgICAqL1xuXG4gICAgeyAnQmFzZUVycm9yJzpcbiAgICAgICAgeyAnRXhjaGFuZ2VFcnJvcic6XG4gICAgICAgICAgICB7ICdOb3RTdXBwb3J0ZWQnOiAgICAgICAgICAgICAgIHt9XG4gICAgICAgICAgICAsICdBdXRoZW50aWNhdGlvbkVycm9yJzpcbiAgICAgICAgICAgICAgICB7ICdQZXJtaXNzaW9uRGVuaWVkJzogICAgICAge31cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAsICdJbnN1ZmZpY2llbnRGdW5kcyc6ICAgICAgICAgIHt9XG4gICAgICAgICAgICAsICdJbnZhbGlkQWRkcmVzcyc6ICAgICAgICAgICAgIHt9XG4gICAgICAgICAgICAsICdJbnZhbGlkT3JkZXInOlxuICAgICAgICAgICAgICAgIHsgJ09yZGVyTm90Rm91bmQnOiAgICAgICAgICB7fVxuICAgICAgICAgICAgICAgICwgJ09yZGVyTm90Q2FjaGVkJzogICAgICAgICB7fVxuICAgICAgICAgICAgICAgICwgJ0NhbmNlbFBlbmR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BtYWdpYyB3b3VsZG4ndCB3b3JrIOKAlCB3ZSB0aGVuIHdvdWxkIGhhdmUgbm8gY2hhbmNlIHRvXG4gICAgICAgICAgICBvYnRhaW4gYSBlcnJvciB0eXBlIHN0cmluZyBmcm9tIGFuIGVycm9yIGluc3RhbmNlIHByb2dyYW1tYXRpY2FsbHkhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovXG5cbiAgICAgICAgICAgIFskY2xhc3NdOiBjbGFzcyBleHRlbmRzIEJhc2VDbGFzcyB7XG5cbiAgICAgICAgICAgICAgICBjb25zdHJ1Y3RvciAobWVzc2FnZSkge1xuXG4gICAgICAgICAgICAgICAgICAgIHN1cGVyIChtZXNzYWdlKVxuXG4gICAgICAgICAgICAgICAgLyogIEEgd29ya2Fyb3VuZCB0byBtYWtlIGBpbnN0YW5jZW9mYCB3b3JrIG9uIGN1c3RvbSBFcnJvciBjbGFzc2VzIGluIHRyYW5zcGlsZWQgRVM1LlxuICAgICAgICAgICAgICAgICAgICBTZWUgbXkgYmxvZyBwb3N0IGZvciB0aGUgZXhwbGFuYXRpb24gb2YgdGhpcyBoYWNrOlxuXG4gICAgICAgICAgICAgICAgICAgIGh0dHBzOi8vbWVkaXVtLmNvbS9AeHBsL2phdmFzY3JpcHQtZGVyaXZpbmctZnJvbS1lcnJvci1wcm9wZXJseS04ZDJmOGYzMTU4MDEgICAgICAgICovXG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jb25zdHJ1Y3RvciA9IENsYXNzXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX19wcm90b19fICAgPSBDbGFzcy5wcm90b3R5cGVcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5tZXNzYWdlICAgICA9IG1lc3NhZ2VcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgfSlbJGNsYXNzXVxuXG4gICAgICAgIHN1YmNsYXNzIChDbGFzcywgc3ViY2xhc3NlcywgbmFtZXNwYWNlKVxuICA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bHRlckJ5ICh4LCBrLCB2YWx1ZSA9IHVuZGVmaW5lZCwgb3V0ID0gW10pIHtcblxuICAgICAgICBmb3IgKGNvbnN0IHYgb2YgdmFsdWVzICh4KSlcbiAgICAgICAgICAgIGlmICh2W2tdID09PSB2YWx1ZSlcbiAgICAgICAgICAgICAgICBvdXQucHVzaCAodilcblxuICAgICAgICByZXR1cm4gb3V0XG4gICAgfVxuXG4vKiAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgKi9cblxuICAgICwgc29ydEJ5OiAoYXJyYXksIC8vIE5COiBNVVRBVEVTIEFSUkFZIVxuICAgICAgICAgICAgICAga2V5LFxuICAgICAgICAgICAgICAgZGVzY2VuZGluZyA9IGZhbHNlLFxuICAgICAgICAgICAgICAgZGlyZWN0aW9uICA9IGRlc2NlbmRpbmcgPyAtMSA6IDEpID0+IGFycmF5LnNvcnQgKChhLCBiKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYVtrZXldIDwgYltrZXldKSA/IC1kaXJlY3Rpb24gOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoYVtrZXldID4gYltrZXldKSA/ICBkaXJlY3Rpb24gOiAwKSkpXG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLCBmbGF0dGVuOiBmdW5jdGlvbiBmbGF0dGVuICh4LCBvdXQgPSBbXSkge1xuXG4gICAgICAgIGZvciAoY29uc3QgdiBvZiB4KSB7XG4gICAgICAgICAgICBpZiAoaXNBcnJheSAodikpIGZsYXR0ZW4gKHYsIG91dClcbiAgICAgICAgICAgIGVsc2Ugb3V0LnB1c2ggKHYpXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gb3V0XG4gICAgfVxuXG4vKiAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgKi9cblxuICAgICwgcGx1Y2s6ICh4LCBrKSA9PiB2YWx1ZXMgKHgpXG4gICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyICh2ID0+IGsgaW4gdilcbiAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAgKHYgPT4gdltrXSlcblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIG9taXQgKHgsIC4uLmFyZ3MpIHtcblxuICAgICAgICBjb25zdCBvdXQgPSBjbG9uZSAoeClcblxuICAgICAgICBmb3IgKGNvbnN0IGsgb2YgYXJncykge1xuXG4gICAgICAgICAgICBpZiAoaXNBcnJheSAoaykpIC8vIG9taXQgKHgsIFsnYScsICdiJ10pXG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBrayBvZiBrKVxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgb3V0W2trXVxuXG4gICAgICAgICAgICBlbHNlIGRlbGV0ZSBvdXRba10gLy8gb21pdCAoeCwgJ2EnLCAnYicpXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gb3V0XG4gICAgfVxuXG4vKiAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgKi9cblxuICAgICwgc3VtICguLi54cykge1xuXG4gICAgICAgIGNvbnN0IG5zID0geHMuZmlsdGVyIChpc051bWJlcikgLy8gbGVhdmUgb25seSBudW1iZXJzXG5cbiAgICAgICAgcmV0dXJuIChucy5sZW5ndGggPiAwKVxuICAgICAgICAgICAgICAgICAgICA/IG5zLnJlZHVjZSAoKGEsIGIpID0+IGEgKyBiLCAwKVxuICAgICAgICAgICAgICAgICAgICA6IHVuZGVmaW5lZFxuICAgIH1cblxuLyogIC4uLi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ldO1xuICAgICAgICBpZiAodHJhZGUudGltZXN0YW1wIDwgc2luY2UpXG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgbGV0IG9wZW5pbmdUaW1lID0gTWF0aC5mbG9vciAodHJhZGUudGltZXN0YW1wIC8gbXMpICogbXM7IC8vIHNoaWZ0IHRvIHRoZSBlZGdlIG9mIG0vaC9kIChidXQgbm90IE0pXG4gICAgICAgIGxldCBjYW5kbGUgPSBvaGxjdnMubGVuZ3RoIC0gMTtcblxuICAgICAgICBpZiAoY2FuZGxlID09PSAtMSB8fCBvcGVuaW5nVGltZSA+PSBvaGxjdnNbY2FuZGxlXVt0aW1lc3RhbXBdICsgbXMpIHtcbiAgICAgICAgICAgIC8vIG1vdmVkIHRvIGEgbmV3IHRpbWVmcmFtZSAtPiBjcmVhdGUgYSBuZXcgY2FuZGxlIGZyb20gb3BlbmluZyB0cmFkZVxuICAgICAgICAgICAgb2hsY3ZzLnB1c2ggKFtcbiAgICAgICAgICAgICAgICBvcGVuaW5nVGltZSwgIC8vIHRpbWVzdGFtcFxuICAgICAgICAgICAgICAgIHRyYWRlLnByaWNlLCAgLy8gT1xuICAgICAgICAgICAgICAgIHRyYWRlLnByaWNlLCAgLy8gSFxuICAgICAgICAgICAgICAgIHRyYWRlLnByaWNlLCAgLy8gTFxuICAgICAgICAgICAgICAgIHRyYWRlLnByaWNlLCAgLy8gQ1xuICAgICAgICAgICAgICAgIHRyYWRlLmFtb3VudCwgLy8gVlxuICAgICAgICAgICAgICAgIDEsICAgICAgICAgICAgLy8gY291bnRcbiAgICAgICAgICAgIF0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gc3RpbGwgcHJvY2Vzc2luZyB0aGUgc2FtZSB0aW1lZnJhbWUgLT4gdXBkYXRlIG9wZW5pbmcgdHJhZGVcbiAgICAgICAgICAgIG9obGN2c1tjYW5kbGVdW2hpZ2hdID0gTWF0aC5tYXggKG9obGN2c1tjYW5kbGVdW2hpZ2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DsgaS0tKSB7XG5cbiAgICAgICAgbGV0IGMgPSBjaGFyc1tpXVxuXG4gICAgICAgIGlmIChpICE9PSAwKSB7XG4gICAgICAgICAgICBjICs9IG1lbW9cblxuICAgICAgICAgICAgaWYgKGkgPj0gKHByZWNpc2lvblN0YXJ0ICsgbnVtUHJlY2lzaW9uRGlnaXRzKSkge1xuXG4gICAgICAgICAgICAgICAgY29uc3QgY2VpbCA9IChyb3VuZGluZ01vZGUgPT09IFJPVU5EKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYyA+PSBGSVZFKSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICEoKGMgPT09IEZJVkUpICYmIG1lbW8pIC8vIHByZXZlbnRzIHJvdW5kaW5nIG9mIDEuNDUgdG8gMlxuXG4gICAgICAgICAgICAgICAgYyA9IGNlaWwgPyAoTklORSArIDEpIDogWkVST1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGMgPiBOSU5FKSB7IGMgPSBaRVJPOyBtZW1vID0gMTsgfVxuICAgICAgICAgICAgZWxzZSBtZW1vID0gMFxuXG4gICAgICAgIH0gZWxzZSBpZiAobWVtbykgYyA9IE9ORSAvLyBsZWFkaW5nIGV4dHJhIGRpZ2l0ICgwOTAwIOKGkiAxMDAwKVxuXG4gICAgICAgIGNoYXJzW2ldID0gY1xuXG4gICAgICAgIGlmIChjICE9PSBaRVJPKSB7XG4gICAgICAgICAgICBkaWdpdHNTdGFydCA9IGlcbiAgICAgICAgICAgIGRpZ2l0c0VuZCAgID0gKGRpZ2l0c0VuZCA8IDApID8gKGkgKyAxKSA6IGRpZ2l0c0VuZFxuICAgICAgICB9XG4gICAgfVxuXG4vKiAgVXBkYXRlIHRoZSBwcmVjaXNpb24gcmFuZ2UsIGFzIGBkaWdpdHNTdGFydGAgbWF5IGhhdmUgY2hhbmdlZC4uLiAgICAgKi9cblxuICAgIGlmIChjb3VudGluZ01vZGUgPT09IFNJR05JRklDQU5UX0RJR0l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ICAgICAgICAgICAgICAgICAgICAgICAgICAgPyAoYWN0dWFsTGVuZ3RoKSAgICAgICAgICAgICAgLy8gLSgxMjMuNDU2KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAocHJlY2lzaW9uRW5kIC0gcmVhZFN0YXJ0KSAgLy8gLSgxMjMuNDU2ICAgIClcblxuICAgICAgICAsIHBhZCAgICAgICAgICAgPSBtYXggKGRlc2lyZWRMZW5ndGggLSBhY3R1YWxMZW5ndGgsIDApICAgLy8gIC0xMjMuNDU2KCAgICApXG4gICAgICAgICwgcGFkU3RhcnQgICAgICA9ICAgICAobkJlZm9yZURvdCArIDEgKyBuQWZ0ZXJEb3QpICAgICAgICAvLyAgLTEyMy40NTYoIClcbiAgICAgICAgLCBwYWRFbmQgICAgICAgID0gICAgIChwYWRTdGFydCArIHBhZCkgICAgICAgICAgICAgICAgICAgIC8vICAtMTIzLjQ1NiAgICAgKCApXG4gICAgICAgICwgaXNJbnRlZ2VyICAgICA9ICAgICAobkFmdGVyRG90ICsgcGFkKSA9PT0gMCAgICAgICAgICAgICAvLyAgLTEyM1xuXG4vKiAgRmlsbCB0aGUgb3V0cHV0IGJ1ZmZlciB3aXRoIGNoYXJhY3RlcnMgICAgKi9cblxuICAgIGNvbnN0IG91dCA9IG5ldyBVaW50OEFycmF5IChuQmVmb3JlRG90ICsgKGlzSW50ZWdlciA/IDAgOiAxKSArIG5BZnRlckRvdCArIHBhZClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG4gICAgaWYgIChpc05lZ2F0aXZlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0WzBdICAgICAgICAgID0gTUlOVVMgICAgIC8vIC0gICAgIG1pbnVzIHNpZ25cbiAgICB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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovXG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICAgIFxuICAgIHRocm90dGxlOiBmdW5jdGlvbiB0aHJvdHRsZSAoY2ZnKSB7XG5cbiAgICAgICAgbGV0ICAgbGFzdFRpbWVzdGFtcCA9IG5vdyAoKVxuICAgICAgICAgICAgLCBudW1Ub2tlbnMgICAgID0gKHR5cGVvZiBjZmcubnVtVG9rZW5zICE9PSAndW5kZWZpbmVkJykgPyBjZmcubnVtVG9rZW5zIDogY2ZnLmNhcGFjaXR5XG4gICAgICAgICAgICAsIHJ1bm5pbmcgICAgICAgPSBmYWxzZVxuICAgICAgICAgICAgLCBjb3VudGVyICAgICAgID0gMFxuXG4gICAgICAgIGNvbnN0IHF1ZXVlID0gW11cblxuICAgICAgICByZXR1cm4gT2JqZWN0LmFzc2lnbiAoY29zdCA9PiB7XG5cbiAgICAgICAgICAgIGlmIChxdWV1ZS5sZW5ndGggPiBjZmcubWF4Q2FwYWNpdHkpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yICgnQmFja2xvZyBpcyBvdmVyIG1heCBjYXBhY2l0eSBvZiAnICsgY2ZnLm1heENhcGFjaXR5KVxuXG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UgKGFzeW5jIChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2ggKHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0pXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCFydW5uaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBydW5uaW5nID0gdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBoYXNFbm91Z2hUb2tlbnMgPSBjZmcuY2FwYWNpdHkgPyAobnVtVG9rZW5zID4gMCkgOiAobnVtVG9rZW5zID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhc0Vub3VnaFRva2Vucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocXVldWUubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0gPSBxdWV1ZVswXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29zdCA9IChjb3N0IHx8IGNmZy5kZWZhdWx0Q29zdClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChudW1Ub2tlbnMgPj0gTWF0aC5taW4gKGNvc3QsIGNmZy5jYXBhY2l0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgLT0gY29zdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHF1ZXVlLnNoaWZ0ICgpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHQgPSBub3cgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCBlbGFwc2VkID0gdCAtIGxhc3RUaW1lc3RhbXBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0VGltZXN0YW1wID0gdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVRva2VucyA9IE1hdGgubWluIChjZmcuY2FwYWNpdHksIG51bVRva2VucyArIGVsYXBz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ZXInOiBmYWxzZSwgLy8gb3IgdGhleSB3aWxsIHJldHVybiBodHRwczovL2dpdGh1Yi5jb20vY2N4dC9jY3h0L2lzc3Vlcy8yMzM4XG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzhoJzogJzEyaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJ2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJ3dlZWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzQ5MDI2MTEtMmJlOGJmMWEtZjgzMC0xMWU3LTkxYTItMTFiMmYyOTJlNzUwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaWJveC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYmlib3guY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpYm94Y29tL2FwaV9yZWZlcmVuY2Uvd2lraS9ob21lX2VuJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaWJveGNvbS9hcGlfcmVmZXJlbmNlL3dpa2kvYXBpX3JlZmVyZW5jZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2JpYm94LnplbmRlc2suY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwNDQxNzAxMy1GZWUtU3RydWN0dXJlLW9uLUJpYm94JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ETzogcmV3b3JrIGZvciBmdWxsIGVuZHBvaW50L2NtZCBwYXRocyBoZXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWRhdGEnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21kYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnBlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHt9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHt9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzIwMjEnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gSW5zdWZmaWNpZW50IGJhbGFuY2UgYXZhaWxhYmxlIGZvciB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgJzIwMTUnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBHb29nbGUgYXV0aGVudGljYXRvciBpcyB3cm9uZ1xuICAgICAgICAgICAgICAgICcyMDMzJzogT3JkZXJOb3RGb3VuZCwgLy8gb3BlcmF0aW9uIGZhaWxlZCEgT3JkZXJzIGhhdmUgYmVlbiBjb21wbGV0ZWQgb3IgcmV2b2tlZFxuICAgICAgICAgICAgICAgICcyMDY3JzogSW52YWxpZE9yZGVyLCAvLyBEb2VzIG5vdCBzdXBwb3J0IG1hcmtldCBvcmRlcnNcbiAgICAgICAgICAgICAgICAnMjA2OCc6IEludmFsaWRPcmRlciwgLy8gVGhlIG51bWJlciBvZiBvcmRlcnMgY2FuIG5vdCBiZSBsZXNzIHRoYW5cbiAgICAgICAgICAgICAgICAnMzAxMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIGludmFsaWQgYXBpS2V5XG4gICAgICAgICAgICAgICAgJzMwMjQnOiBQZXJtaXNzaW9uRGVuaWVkLCAvLyB3cm9uZyBhcGlrZXkgcGVybWlzc2lvbnNcbiAgICAgICAgICAgICAgICAnMzAyNSc6IEF1dGhlbnRpY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Db2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgaWQgPSBiYXNlICsgJ18nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAg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AgICdvcGVuJzogb3BlbixcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBjaGFuZ2UsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHRoaXMuc2FmZVN0cmluZyAodGlja2VyLCAncGVyY2VudCcpLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYW1vdW50JyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWRhdGEgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY21kJzogJ3RpY2tlcicsXG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyIChyZXNwb25zZVsncmVzdWx0J10sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXJzIChyYXdUaWNrZXJzLCBzeW1ib2xzID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aWNrZXJzID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOy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W5lZCcpXG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSA/IG1hcmtldFsnc3ltYm9sJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ2lkJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2Ftb3VudCcpLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgIC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ICAgICAgJ3NpemUnOiBsaW1pdCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT0hMQ1ZzIChyZXNwb25zZVsncmVzdWx0J10sIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL2NvaW5MaXN0JyxcbiAgICAgICAgICAgICdib2R5Jzoge30sXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gODtcbiAgICAgICAgICAgIGxldCBkZXBvc2l0ID0gY3VycmVuY3lbJ2VuYWJsZV9kZXBvc2l0J107XG4gICAgICAgICAgICBsZXQgd2l0aGRyYXcgPSBjdXJyZW5jeVsnZW5hYmxlX3dpdGhkcmF3J107XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gKGRlcG9zaXQgJiYgd2l0aGRyYXcpID8gdHJ1ZSA6IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhbnNmZXIgKHtcbiAgICAgICAgICAgICdjbWQnOiAndHJhbnNmZXIvYXNzZXRzJyxcbiAgICAgICAgICAgICdib2R5JzogdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnc2VsZWN0JzogMSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyksXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGluZGV4ZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnYXNzZXRzX2xpc3QnIGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICBpbmRleGVkID0gdGhpcy5pbmRleEJ5IChiYWxhbmNlc1snYXNzZXRzX2xpc3QnXSwgJ2NvaW5fc3ltYm9sJyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpbmRleGVkID0gYmFsYW5jZXM7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoaW5kZXhlZCk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoY29kZS5pbmRleE9mICgnVE9UQUxfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlLnNsaWNlICg2KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjb2RlIGluIHRoaXMuY3VycmVuY2llc19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGNvZGUgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbY29kZV1bJ2NvZGUnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBpbmRleGVkW2lkXTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYmFsYW5jZSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYmFsYW5jZSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSAwLjA7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2U7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnZnJlZXplJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZnJlZSddLCBhY2NvdW50Wyd1c2VkJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gKHR5cGUgPT09ICdsaW1pdCcpID8gMiA6IDE7XG4gICAgICAgIGxldCBvcmRlclNpZGUgPSAoc2lkZSA9PT0gJ2J1eScpID8gMSA6IDI7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnBlbmRpbmcgKHtcbiAgICAgICAgICAgICdjbWQnOiAnb3JkZXJwZW5kaW5nL3RyYWRlJyxcbiAgICAgICAgICAgICdib2R5JzogdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICAgICAnYWNjb3VudF90eXBlJzogMCxcbiAgICAgICAgICAgICAgICAnb3JkZXJfdHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICAgICAnb3JkZXJfc2lkZSc6IG9yZGVyU2lkZSxcbiAgICAgICAgICAgICAgICAncGF5X2JpeCc6IDAsXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyksXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdyZXN1bHQnKSxcbi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1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTXlUcmFkZXMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAoIXN5bWJvbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE15VHJhZGVzIHJlcXVpcmVzIGEgc3ltYm9sIGFyZ3VtZW50Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHNpemUgPSAobGltaXQpID8gbGltaXQgOiAyMDA7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnBlbmRpbmcgKHtcbiAgICAgICAgICAgICdjbWQnOiAnb3JkZXJwZW5kaW5nL29yZGVySGlzdG9yeUxpc3QnLFxuICAgICAgICAgICAgJ2JvZHknOiB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgICAgICdhY2NvdW50X3R5cGUnOiAwLCAvLyAwIC0gcmVndWxhciwgMSAtIG1hcmdpblxuICAgICAgICAgICAgICAgICdwYWdlJzogMSxcbiAgICAgICAgICAgICAgICAnc2l6ZSc6IHNpemUsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZVsncmVzdWx0J10sICdpdGVtcycsIFtdKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlcnMgKHRyYWRlcywgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuIC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Y29kZV0gPSByZXNwb25zZTtcbiAgICAgICAgICAgIHdpdGhkcmF3RmVlc1tjb2RlXSA9IHJlc3BvbnNlWydyZXN1bHQnXVsnd2l0aGRyYXdfZmVlJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogaW5mbyxcbiAgICAgICAgICAgICd3aXRoZHJhdyc6IHdpdGhkcmF3RmVlcyxcbiAgICAgICAgICAgICdkZXBvc2l0Jzoge30sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGxldCBjbWRzID0gdGhpcy5qc29uIChbIHBhcmFtcyBdKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChtZXRob2QgIT09ICdHRVQnKVxuICAgICAgICAgICAgICAgIGJvZHkgPSB7ICdjbWRzJzogY21kcyB9O1xuICAgICAgICAgICAgZWxzZSBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHtcbiAgICAgICAgICAgICAgICAnY21kcyc6IGNtZHMsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoY21kcyksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdtZDUnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKGJvZHksIHsgJ2NvbnZlcnRBcnJheXNUb09iamVjdHMnOiB0cnVlIH0pO1xuICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2NvZGUnIGluIHJlc3BvbnNlWydlcnJvciddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2VbJ2Vycm9yJ10sICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgYm9keTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZSBpbiBleGNlcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4Y2VwdGlvbnNbY29kZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICc6IFwiZXJyb3JcIiBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoISgncmVzdWx0JyBpbiByZXNwb25zZSkpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZVsncmVzdWx0J11bMF07XG4gICAgICAgIH1cbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY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zJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM20nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICcyaCc6ICcyaCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzRoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICc4aCc6ICc4aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzNkJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXcnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yOTYwNDAyMC1kNTQ4M2NkYy04N2VlLTExZTctOTRjNy1kMWE4ZDkxNjkyOTMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmJpbmFuY2UuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ3dhcGknOiAnaHR0cHM6Ly9hcGkuYmluYW5jZS5jb20vd2FwaS92MycsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYmluYW5jZS5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYmluYW5jZS5jb20vYXBpL3YzJyxcbiAgICAgICAgICAgICAgICAgICAgJ3YzJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgICAgICd2MSc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vYmluYW5jZS1leGNoYW5nZS9iaW5hbmNlLW9mZmljaWFsLWFwaS1kb2NzL2Jsb2IvbWFzdGVyL3Jlc3QtYXBpLm1kJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmluYW5jZS56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA0MjkzMzInLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmJpbmFuY2UuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMDU4MzMxMScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvcHVibGljL3Byb2R1Y3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3dhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudFN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYm9va1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FnZ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvMjRocicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbEJvb2tUaWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvcHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9ib29rVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZUluZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogWyAndXNlckRhdGFTdHJlYW0nIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogWyAndXNlckRhdGFTdHJlYW0nIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbICd1c2VyRGF0YVN0cmVhbScgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gc2hvdWxkIGJlIGRlbGV0ZWQsIHRoZXNlIGFyZSBvdXRkYXRlZCBhbmQgaW5hY2N1cmF0ZVxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBREEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJT04nOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1CJzogMTEuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUFBDJzogNi41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAzLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVNUJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiAxOC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDRCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1BUJzogMTAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1gnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5CJzogMC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAxLjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJEJzogNi40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogNjcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVQnOiAzNy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDQ3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogNS40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0QnOiAwLjA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RMVCc6IDExLjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogNTEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAyLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxGJzogNi41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VORyc6IDIuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiA0Mi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VURic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDIuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogNDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiA4NS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1RPJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAwLjUzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dYUyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQ0MnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDMuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ1gnOiAxLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5TJzogMS41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS01EJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFTkQnOiA1NC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJTksnOiAxMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xMVCc6IDU0LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogOS4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAuMjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDc0LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMC44NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdNREEnOiA0LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9EJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDM0LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRMJzogMS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05BVic6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlVMUyc6IDIuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiA4LjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPU1QnOiAxNy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDg4LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9XUic6IDguNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLjI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FTUCc6IDIxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkNOJzogMzUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRE4nOiAyLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMTguMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSTEMnOiA0LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FMVCc6IDEuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQlRDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMjkuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAzMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JKJzogNS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDcuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTkInOiA4Mi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROVCc6IDQ3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJJRyc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMjkuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMjMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxLjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogMjguMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogNy4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBQkknOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FWRVMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDkuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWExNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFZHJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1haQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAzOS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdZT1lPJzogJ1lPWU9XJyxcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JDSCcsXG4gICAgICAgICAgICAgICAgJ05BTk8nOiAnWFJCJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBleGNoYW5nZS1zcGVjaWZpYyBvcHRpb25zXG4gICAgICAgICAgICAnb3B0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnZGVmYXVsdExpbWl0T3JkZXJUeXBlJzogJ2xpbWl0JywgLy8gb3IgJ2xpbWl0X21ha2VyJ1xuICAgICAgICAgICAgICAgICdoYXNBbHJlYWR5QXV0aGVudGljYXRlZFN1Y2Nlc3NmdWxseSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3YXJuT25GZXRjaE9wZW5PcmRlcnNXaXRob3V0U3ltYm9sJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncmVjdldpbmRvdyc6IDUgKiAxMDAwLCAvLyA1IHNlYywgYmluYW5jZSBkZWZhdWx0XG4gICAg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CB0aGlzLmxvYWRUaW1lRGlmZmVyZW5jZSAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnc3ltYm9scyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgLy8gXCIxMjM0NTZcIiBpcyBhIFwidGVzdCBzeW1ib2wvbWFya2V0XCJcbiAgICAgICAgICAgIGlmIChpZCA9PT0gJzEyMzQ1NicpXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlQXNzZXQnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUFzc2V0J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBmaWx0ZXJzID0gdGhpcy5pbmRleEJ5IChtYXJrZXRbJ2ZpbHRlcnMnXSwgJ2ZpbHRlclR5cGUnKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBtYXJrZXRbJ2Jhc2VBc3NldFByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IG1hcmtldFsncXVvdGVQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ3N0YXR1cyddID09PSAnVFJBRElORycpO1xuICAgICAgICAgICAgLy8gbG90IHNpemUgaXMgZGVwcmVjYXRlZCBhcyBvZiAyMDE4LjAyLjA2XG4gICAgICAgICAgICBsZXQgbG90ID0gLTEgKiBNYXRoLmxvZzEwIChwcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIGxldCBlbnRyeSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LCAvLyBsb3Qgc2l6ZSBpcyBkZXByZWNhdGVkIGFzIG9mIDIwMTguMDIuMDZcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICgnUFJJQ0VfRklMVEVSJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IGZpbHRlcnNbJ1BSSUNFX0ZJTFRFUiddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsncHJpY2UnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoZmlsdGVyWyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ3ByaWNlJ10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWluUHJpY2UnKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChmaWx0ZXIsICdtYXhQcmljZScpLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ0xPVF9TSVpFJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IGZpbHRlcnNbJ0xPVF9TSVpFJ107XG4gICAgICAgICAgICAgICAgZW50cnlbJ3ByZWNpc2lvbiddWydhbW91bnQnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoZmlsdGVyWydzdGVwU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbG90J10gPSB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnc3RlcFNpemUnKTsgLy8gbG90IHNpemUgaXMgZGVwcmVjYXRlZCBhcyBvZiAyMDE4LjAyLjA2XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xpbWl0cyddWydhbW91bnQnXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChmaWx0ZXIsICdtaW5RdHknKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChmaWx0ZXIsICdtYXhRdHknKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdNSU5fTk9USU9OQUwnIGluIGZpbHRlcnMpIHtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Nvc3QnXVsnbWluJ10gPSBwYXJzZUZsb2F0IChmaWx0ZXJzWydNSU5fTk9USU9OQUwnXVsnbWluTm90aW9uYWwnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoZW50cnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxld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MuY3VycmVuY2llc19ieV9pZFtjdXJyZW5jeV1bJ2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnZnJlZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ2xpbWl0J10gPSBsaW1pdDsgLy8gZGVmYXVsdCA9IG1heGltdW0gPSAxMDBcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0g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GxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgb3JkZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnb3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlciA9IHRyYWRlWydvcmRlcklkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGlmICgnbScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIHNpZGUgPSB0cmFkZVsnbSddID8gJ3NlbGwnIDogJ2J1eSc7IC8vIHRoaXMgaXMgcmV2ZXJzZWQgaW50ZW50aW9uYWxseVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc2lkZSA9ICh0cmFkZVsnaXNCdXllciddKSA/ICdidXknIDogJ3NlbGwnOyAvLyB0aGlzIGlzIGEgdHJ1ZSBzaWRlXG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdjb21taXNzaW9uJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnY29tbWlzc2lvbicpLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh0cmFkZVsnY29tbWlzc2lvbkFzc2V0J10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdGFrZXJPck1ha2VyID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2lzTWFrZXInIGluIHRyYWRlKVxuICAgICAgICAgICAgdGFrZXJPck1ha2VyID0gdHJhZGVbJ2lzTWFrZXInXSA/ICdtYWtlcicgOiAndGFrZXInO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0YWtlck9yTWFrZXInOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnRUaW1lJ10gPSBzaW5jZTtcbiAgICAgICAgICAgIHJlcXVlc3RbJ2VuZFRpbWUnXSA9IHNpbmNlICsgMzYwMDAwMDtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ2xpbWl0J10gPSBsaW1p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vZiBmaWxsZWQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gTWF0aC5tYXggKGFtb3VudCAtIGZpbGxlZCwgMC4wKTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgaWQgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnb3JkZXJJZCcpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICd0eXBlJyk7XG4gICAgICAgIGlmICh0eXBlb2YgdHlwZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICB0eXBlID0gdHlwZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgbGV0IHNpZGUgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnc2lkZScpO1xuICAgICAgICBpZiAodHlwZW9mIHNpZGUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc2lkZSA9IHNpZGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgIC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cnKTtcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjb2RlLFxuICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcyc6IHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKSxcbiAgICAgICAgICAgICAgICAgICAgJ3RhZyc6IHRhZyxcbiAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRnVuZGluZ0ZlZXMgKGNvZGVzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICAvLyAgYnkgZGVmYXVsdCBpdCB3aWxsIHRyeSBsb2FkIHdpdGhkcmF3YWwgZmVlcyBvZiBhbGwgY3VycmVuY2llcyAod2l0aCBzZXBhcmF0ZSByZXF1ZXN0cylcbiAgICAgICAgLy8gIGhvd2V2ZXIgaWYgeW91IGRlZmluZSBjb2RlcyA9IFsgJ0VUSCcsICdCVEMnIF0gaW4gYXJncyBpdCB3aWxsIG9ubHkgbG9hZCB0aG9zZVxuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgd2l0aGRyYXdGZWVzID0ge307XG4gICAgICAgIGxldCBpbmZvID0ge307XG4gICAgICAgIGlmICh0eXBlb2YgY29kZXMgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgY29kZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjb2Rlc1tpXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9I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AgICAgICByZXF1ZXN0WydhZGRyZXNzVGFnJ10gPSB0YWc7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2FwaVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdpZCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgdXJsICs9ICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICd3YXBpJylcbiAgICAgICAgICAgIHVybCArPSAnLmh0bWwnO1xuICAgICAgICAvLyB2MSBzcGVjaWFsIGNhc2UgZm9yIHVzZXJEYXRhU3RyZWFtXG4gICAgICAgIGlmIChwYXRoID09PSAndXNlckRhdGFTdHJlYW0nKSB7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdYLU1CWC1BUElLRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKChhcGkgPT09ICdwcml2YXRlJykgfHwgKGFwaSA9PT0gJ3dhcGknKSkge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAndGltZXN0YW1wJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgICAgICAncmVjdldpbmRvdyc6IHRoaXMub3B0aW9uc1sncmVjdldpbmRvdyddLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIHF1ZXJ5ICs9ICcmJyArICdzaWduYXR1cmU9JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtTUJYLUFQSUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmICgobWV0aG9kID09PSAnR0VUJykgfHwgKGFwaSA9PT0gJ3dhcGknKSkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHF1ZXJ5O1xuICAgICAgICAgICAgICAgIGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kL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91bGQgYmUgZXZlbmx5IGRpdmlzaWJsZSBieSBsb3Qgc2l6ZSwgdXNlIHRoaXMuYW1vdW50VG9Mb3RzIChzeW1ib2wsIGFtb3VudCkgJyArIGJvZHkpO1xuICAgICAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ1BSSUNFX0ZJTFRFUicpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgcHJpY2UgZXhjZWVkcyBhbGxvd2VkIHByaWNlIHByZWNpc2lvbiBvciBpbnZhbGlkLCB1c2UgdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCkgJyArIGJvZHkpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICAvLyBjaGVjayBzdWNjZXNzIHZhbHVlIGZvciB3YXBpIGVuZHBvaW50c1xuICAgICAgICAgICAgICAgIC8vIHJlc3BvbnNlIGluIGZvcm1hdCB7J21zZyc6ICdUaGUgY29pbiBkb2VzIG5vdCBleGlzdC4nLCAnc3VjY2Vzcyc6IHRydWUvZmFsc2V9XG4gICAgICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdzdWNjZXNzJywgdHJ1ZSk7XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbXNnJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChyZXNwb25zZVsnbXNnJ10pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0ge307XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIC8vIGNoZWNrcyBhZ2FpbnN0IGVycm9yIGNvZGVzXG4gICAgICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGVycm9yICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gYSB3b3JrYXJvdW5kIGZvciB7XCJjb2RlXCI6LTIwMTUsXCJtc2dcIjpcIkludmFsaWQgQVBJLWtleSwgSVAsIG9yIHBlcm1pc3Npb25zIGZvciBhY3Rpb24uXCJ9XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBkZXNwaXRlIHRoYXQgdGhlaXIgbWVzc2FnZSBpcyB2ZXJ5IGNvbmZ1c2luZywgaXQgaXMgcmFpc2VkIGJ5IEJpbmFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uIGEgdGVtcG9yYXJ5IGJhbiAodGhlIEFQSSBrZXkgaXMgdmFsaWQsIGJ1dCBkaXNhYmxlZCBmb3IgYSB3aGlsZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoZXJyb3IgPT09ICctMjAxNScpICYmIHRoaXMub3B0aW9uc1snaGFzQWxyZWFkeUF1dGhlbnRpY2F0ZWRTdWNjZXNzZnVsbHknXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgdGVtcG9yYXJ5IGJhbm5lZDogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4Y2VwdGlvbnNbZXJyb3JdICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICc6IHVua25vd24gZXJyb3IgY29kZTogJyArIGJvZHkgKyAnICcgKyBlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJzogc3VjY2VzcyB2YWx1ZSBmYWxzZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICAvLyBhIHdvcmthcm91bmQgZm9yIHtcImNvZGVcIjotMjAxNSxcIm1zZ1wiOlwiSW52YWxpZCBBUEkta2V5LCBJUCwgb3IgcGVybWlzc2lvbnMgZm9yIGFjdGlvbi5cIn1cbiAgICAgICAgaWYgKChhcGkgPT09ICdwcml2YXRlJykgfHwgKGFw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zogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYxMTktMzU5MzIyMGUtNWVjZS0xMWU3LThiM2EtNWEwNDFmNmJjYzNmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2JpdDJjLmNvLmlsJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdDJjLmNvLmlsJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0MmMuY28uaWwvaG9tZS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL09mZXJFL2JpdDJjJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L2xhc3R0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ01lcmNoYW50L0NyZWF0ZUNoZWNrb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRDb2luRnVuZHNSZXF1ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRGdW5kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkT3JkZXJNYXJrZXRQcmljZUJ1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkT3JkZXJNYXJrZXRQcmljZVNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRDb2luRnVuZHNSZXF1ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvR2V0TXlJZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGF5bWVudC9TZW5kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L1BheScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0JhbGFuY2UvdjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL015T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9HZXRCeUlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BY2NvdW50SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvT3JkZXJIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAg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mxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZSkge1xuICAgICAgICAgICAgICAgIGxldCBhdmFpbGFibGUgPSAnQVZBSUxBQkxFXycgKyBjdXJyZW5jeTtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBiYWxhbmNlW2F2YWlsYWJsZV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VbY3VycmVuY3ldO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlc1BhaXJPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYX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AgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZVByaWNlLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cm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AnMWhvdXInLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aG91cicsXG4gICAgICAgICAgICAgICAgJzhoJzogJzhob3VyJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxd2VlaycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNzgwODA4MS1iODdmMmQ5Yy0yZTU5LTExZTgtODk0ZC1jMTkwMGI3NTg0ZmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vcHVibGljLmJpdGJhbmsuY2MnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5iaXRiYW5rLmNjJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRiYW5rLmNjLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RvY3MuYml0YmFuay5jYy8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYml0YmFuay5jYy9kb2NzL2ZlZXMvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vdHJhbnNhY3Rpb25zL3tZWVlZTU1ERH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9jYW5kbGVzdGljay97Y2FuZGxlLXR5cGV9L3tZWVlZTU1ERH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hc3NldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9zcG90L2FjdGl2ZV9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC90cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dpdGhkcmF3YWxfYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9zcG90L2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9zcG90L2NhbmNlbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9vcmRlcnNfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9yZXF1ZXN0X3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JDSC9CVEMnOiB7ICdpZ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zogeyAnaWQnOiAneHJwX2pweScsICdzeW1ib2wnOiAnWFJQL0pQWScsICdiYXNlJzogJ1hSUCcsICdxdW90ZSc6ICdKUFknLCAnYmFzZUlkJzogJ3hycCcsICdxdW90ZUlkJzogJ2pweScgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0pQWSc6IHsgJ2lkJzogJ2J0Y19qcHknLCAnc3ltYm9sJzogJ0JUQy9KUFknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSlBZJywgJ2Jhc2VJZCc6ICdidGMnLCAncXVvdGVJZCc6ICdqcHknIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgdGVtcG9yYXJpbHlcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ0pQWSc6IGFtb3VudCA9PiBhbW91bnQgPiAzMDAwMCA/IDc1NiA6IDU0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT05BJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzIwMDAxJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMjAwMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDAwMyc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzIwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMjAwMDQnOiBJbnZhbGlkTm9uY2UsXG4gICAgICAgICAgICAgICAgJzQwMDIwJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICc0MDAyMSc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnNDAwMjUnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICc0MDAxMyc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzQwMDE0JzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNTAwMDgnOiBQZXJtaXNzaW9uRGVuaWVkLFxuICAgICAgICAgICAgICAgICc1MDAwOSc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzUwMDEwJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNjAwMDEnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZXN0YW1wJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAg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IH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckFzc2V0cyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddWydhc3NldHMnXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhbGFuY2VbJ2Fzc2V0J107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuY3VycmVuY2llc19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGNvZGUgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbaWRdWydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2ZyZWVfYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnbG9ja2VkX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydvbmhhbmRfYW1vdW50J10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1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TEVEXG4gICAgICAgIC8vIEZVTExZX0ZJTExFRFxuICAgICAgICAvLyBDQU5DRUxFRF9VTkZJTExFRFxuICAgICAgICAvLyBDQU5DRUxFRF9QQVJUSUFMTFlfRklMTEVEXG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdGVUxMWV9GSUxMRUQnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdDQU5DRUxFRF9VTkZJTExFRCcgfHwgc3RhdHVzID09PSAnQ0FOQ0VMRURfUEFSVElBTExZX0ZJTExFRCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdvcmRlcl9pZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzog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G4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnZGF0YSddWyd0eGlkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhdXRoICs9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBQ0NFU1MtTk9OQ0UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLVNJR05BVFVSRSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ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bnQgdG8gYmUgd2l0aGRyYXduJyxcbiAgICAgICAgICAgICAgICAnNDAwMDEnOiAnVGhlIG9yZGVyIHF1YW50aXR5IGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0MDAwNic6ICdDb3VudCB2YWx1ZSBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMDcnOiAnRW5kIHRpbWUgaXMgaW52YWxpZCcsXG4gICAgICAgICAgICAgICAgJzQwMDA4JzogJ2VuZF9pZCBWYWx1ZSBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMDknOiAnVGhlIGZyb21faWQgdmFsdWUgaXMgaW52YWxpZCcsXG4gICAgICAgICAgICAgICAgJzQwMDEzJzogJ1RoZSBvcmRlciBJRCBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMTQnOiAnVGhlIG9yZGVyIElEIGFycmF5IGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0MDAxNSc6ICdUb28gbWFueSBzcGVjaWZpZWQgb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAnNDAwMTcnOiAnSW5jb3JyZWN0IGlzc3VlIG5hbWUnLFxuICAgICAgICAgICAgICAgICc0MDAyMCc6ICdUaGUgb3JkZXIgcHJpY2UgaXMgaW52YWxpZCcsXG4gICAgICAgICAgICAgICAgJzQwMDIxJzogJ1RoZSB0cmFkaW5nIGNsYXNzaWZpY2F0aW9uIGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0MDAyMic6ICdTdGFydCBkYXRlIGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0MDAyNCc6ICdUaGUgb3JkZXIgdHlwZSBpcyBpbnZhbGlkJyxcbiAgICAgICAgICAgICAgICAnNDAwMjUnOiAnSW5jb3JyZWN0IGFzc2V0IG5hbWUnLFxuICAgICAgICAgICAgICAgICc0MDAyOCc6ICd1dWlkIGlzIGludmFsaWQnLFxuICAgICAgICAgICAgICAgICc0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kaW5nQXBpLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRiYXkubmV0L3B1YmxpYy1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRiYXkubmV0L2FjY291bnQvdGFiLWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQml0QmF5TmV0L0FQSScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2JpdGJheS5uZXQvZW4vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZ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zeW1ib2wnOiAnWFJQL0JUQycsICdiYXNlJzogJ1hSUCcsICdxdW90ZSc6ICdCVEMnLCAnYmFzZUlkJzogJ1hSUCcsICdxdW90ZUlkJzogJ0JUQycgfSxcbiAgICAgICAgICAgICAgICAvLyAnWElOL1VTRCc6IHsgJ2lkJzogJ1hJTlVTRCcsICdzeW1ib2wnOiAnWElOL1VTRCcsICdiYXNlJzogJ1hJTicsICdxdW90ZSc6ICdVU0QnLCAnYmFzZUlkJzogJ1hJTicsICdxdW90ZUlkJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAvLyAnWElOL0VVUic6IHsgJ2lkJzogJ1hJTkVVUicsICdzeW1ib2wnOiAnWElOL0VVUicsICdiYXNlJzogJ1hJTicsICdxdW90ZSc6ICdFVVInLCAnYmFzZUlkJzogJ1hJTicsICdxdW90ZUlkJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAvLyAnWElOL1BMTic6IHsgJ2lkJzogJ1hJTlBMTicsICdzeW1ib2wnOiAnWElOL1BMTicsICdiYXNlJzogJ1hJTicsICdxdW90ZSc6ICdQTE4nLCAnYmFzZUlkJzogJ1hJTicsICdxdW90ZUlkJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnWElOL0JUQyc6IHsgJ2lkJzogJ1hJTkJUQycsICdzeW1ib2wnOiAnWElOL0JUQycsICdiYXNlJzogJ1hJTicsICdxdW90ZSc6ICdCVEMnLCAnYmFzZUlkJzogJ1hJTicsICdxdW90ZUlkJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNDMsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMTI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FNRSc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnNDAwJzogRXhjaGFuZ2VFcnJvciwgLy8gQXQgbGVhc3Qgb25lIHBhcmFtZXRlciB3YXNuJ3Qgc2V0XG4gICAgICAgICAgICAgICAgJzQwMSc6IEludmFsaWRPcmRlciwgLy8gSW52YWxpZCBvcmRlciB0eXBlXG4gICAgICAgICAgICAgICAgJzQwMic6IEludmFsaWRPcmRlciwgLy8gTm8gb3JkZXJzIHdpdGggc3BlY2lmaWVkIGN1cnJlbmNpZXNcbiAgICAgICAgICAgICAgICAnNDAzJzogSW52YWxpZE9yZGVyLCAvLyBJbnZhbGlkIHBheW1lbnQgY3VycmVuY3kgbmFtZVxuICAgICAgICAgICAgICAgICc0MDQnOiBJbnZhbGlkT3JkZXIsIC8vIEVycm9yLiBXcm9uZyB0cmFuc2FjdGlvbiB0eXBlXG4gICAgICAgICAgICAgICAgJzQwNSc6IE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xuICAgICAgICBsZXQgZmlhdEN1cnJlbmNpZXMgPSB7XG4gICAgICAgICAgICAnVVNEJzogdHJ1ZSxcbiAgICAgICAgICAgICdFVVInOiB0cnVlLFxuICAgICAgICAgICAgJ1BMTic6IHRydWUsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjdXJyZW5jeSBpbiBmaWF0Q3VycmVuY2llcylcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGNvZGUsIGFtb3VudCwgYWRkcmVzcywgdGFnID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY3kgKGNvZGUpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodGhpcy5pc0ZpYXQgKGNvZGUpKSB7XG4gICAgICAgICAgICBtZXRob2QgPSAncHJpdmF0ZVBvc3RXaXRoZHJhdyc7XG4gICAgICAgICAgICAvLyByZXF1ZXN0WydhY2NvdW50J10gPSBwYXJhbXNbJ2FjY291bnQnXTsgLy8gdGhleSBkZW1hbmQgYW4gYWNjb3VudCBudW1iZXJcbiAgICAgICAgICAgIC8vIHJlcXVlc3RbJ2V4cHJlc3MnXSA9IHBhcmFtc1snZXhwcmVzcyddOyAvLyB3aGF0ZXZlciBpdCBtZWFucywgdGhleSBkb24ndCBleHBsYWluXG4gICAgICAgICAgICAvLyByZXF1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O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdtb21lbnQnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnQVBJLUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBUEktSGFzaCc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vIGJpdGJheSByZXR1cm5zIHRoZSBpbnRlZ2VyICdzdWNjZXNzJzogMSBrZXkgZnJvbSB0aGVpciBwcml2YXRlIEFQSVxuICAgICAgICAgICAgICAgIC8vIG9yIGFuIGludGVnZXIgJ2NvZGUnIHZhbHVlIGZyb20gMCB0byA1MTAgYW5kIGFuIGVycm9yIG1lc3NhZ2VcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICAgeyAnc3VjY2Vzcyc6IDEsIC4uLiB9XG4gICAgICAgICAgICAgICAgLy8gICAgICB7ICdjb2RlJzogNTAyLCAnbWVzc2FnZSc6ICdJbnZhbGlkIHNpZ24nIH1cbiAgICAgICAgICAgICAgICAvLyAgICAgIHsgJ2NvZGUnOiAwLCAnbWVzc2FnZSc6ICdvZmZlciBmdW5kcyBub3QgZXhjZWVkaW5nIG1pbmltdW1zJyB9XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwMCBBdCBsZWFzdCBvbmUgcGFyYW1ldGVyIHdhc24ndCBzZXRcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwMSBJbnZhbGlkIG9yZGVyIHR5cGVcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwMiBObyBvcmRlcnMgd2l0aCBzcGVjaWZpZWQgY3VycmVuY2llc1xuICAgICAgICAgICAgICAgIC8vICAgICAgNDAzIEludmFsaWQgcGF5bWVudCBjdXJyZW5jeSBuYW1lXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDQgRXJyb3IuIFdyb25nIHRyYW5zYWN0aW9uIHR5cGVcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwNSBPcmRlciB3aXRoIHRoaXMgaWQgZG9lc24ndCBleGlzdFxuICAgICAgICAgICAgICAgIC8vICAgICAgNDA2IE5vIGVub3VnaCBtb25leSBvciBjcnlwdG9cbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwOCBJbnZhbGlkIGN1cnJlbmN5IG5hbWVcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwMSBJbnZhbGlkIHB1YmxpYyBrZXlcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwMiBJbnZhbGlkIHNpZ25cbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwMyBJbnZhbGlkIG1vbWVudCBwYXJhbWV0ZXIuIFJlcXVlc3QgdGltZSBkb2Vzbid0IG1hdGNoIGN1cnJlbnQgc2VydmVyIHRpbWVcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwNCBJbnZhbGlkIG1ldGhvZFxuICAgICAgICAgICAgICAgIC8vICAgICAgNTA1IEtleSBoYXMgbm8gcGVybWlzc2lvbiBmb3IgdGhpcyBhY3Rpb25cbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwNiBBY2NvdW50IGxvY2tlZC4gUGxlYXNlIGNvbnRhY3Qgd2l0aCBjdXN0b21lciBzZXJ2aWNlXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDkgVGhlIEJJQy9TV0lGVCBpcyByZXF1aXJlZCBmb3IgdGhpcyBjdXJyZW5jeVxuICAgICAgICAgICAgICAgIC8vICAgICAgNTEwIEludmFsaWQgbWFya2V0IG5hbWVcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gcmVzcG9uc2VbJ2NvZGUnXTsgLy8gYWx3YXlzIGFuIGludGVnZXJcbiAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIHRoaXMuZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXhjZXB0aW9uc1tjb2RlXSAoZmVl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iAgICAgICAgICAgICduYW1lJzogJ0JpdGZpbmV4JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVkcnLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZURlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEZ1bmRpbmdGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MjQ0LWUzMjhhNTBjLTVlZDItMTFlNy05NDdiLTA0MTQxNjU3OWJiMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0ZmluZXgucmVhZG1lLmlvL3YxL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2JpdGZpbmV4Y29tL2JpdGZpbmV4LWFwaS1ub2RlJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ2NhbmRsZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YnRpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFza2V0X21hbmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlZGl0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvbW92ZW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrZXlfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luX2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXNfZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9yZXBsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldy9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbGFpbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvdGFsX3Rha2VuX2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW51c2VkX3Rha2VuX2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0aWVycyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs3NTAwMDAwLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMC4xOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE1MDAwMDAwLCAwLjE2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwLCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4xIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjA4IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4wNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuMDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjAyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNzUwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTUwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMzAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsIC8vIHRydWUgZm9yIHRpZXItYmFzZWQvcHJvZ3Jlc3NpdmVcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSwgLy8gZml4ZWQgY29tbWlzc2lvblxuICAgICAgICAgICAgICAgICAgICAvLyBBY3R1YWxseSBkZXBvc2l0IGZlZXMgYXJlIGZyZWUgZm9yIGxhcmdlciBkZXBvc2l0cyAoPiAkMTAwMCBVU0QgZXF1aXZhbGVudClcbiAgICAgICAgICAgICAgICAgICAgLy8gdGhlc2UgdmFsdWVzIGJlbG93IGFyZSBkZXByZWNhdGVkLCB3ZSBzaG91bGQgbm90IGhhcmRjb2RlIGZlZXMgYW5kIGxpbWl0cyBhbnltb3JlXG4gICAgICAgICAgICAgICAgICAgIC8vIHRvIGJlIHJlaW1wbGVtZW50ZWQgd2l0aCBiaXRmaW5leCBmdW5kaW5nIGZlZXMgZnJvbSB0aGVpciBBUEkgb3Igd2ViIGVuZHBvaW50c1xuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuMjQyNzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjk5MjY5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdZWVcnOiAxNi45MTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMTQwMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUQSc6IDIwLjc3MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMS45ODU4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMC45NTAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjMwNDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMjguMTg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDEuOTk0NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSQ04nOiAxMC43OTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5CJzogMzEuOTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDE0Ljk3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdSTEMnOiAxLjQxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTlQnOiA1Ljg5NTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1BLJzogMTAuODkzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDQxMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBVCc6IDYuMTU0NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEYnOiAxLjg3NTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogMzIuMzM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NORyc6IDE4LjYyMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSUQnOiA4LjA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01OQSc6IDE2LjYxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUMnOiAxLjY1MDQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UQSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuMjQyNzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjk5MjY5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdZWVcnOiAxNi45MTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMTQwMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUQSc6IDIwLjc3MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMS45ODU4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMC45NTAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjMwNDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDI4LjE4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAxLjk5NDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkNOJzogMTAuNzkzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROQic6IDMxLjkxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAxNC45NzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogMS40MTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05UJzogNS44OTUyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQSyc6IDEwLjg5MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLjA0MTE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiA2LjE1NDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxGJzogMS44NzUzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDMyLjMzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkcnOiAxOC42MjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlEJzogOC4wOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkEnOiAxNi42MTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVDJzogMS42NTA0LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdDU1RfQkNDJyxcbiAgICAgICAgICAgICAgICAnQkNVJzogJ0NTVF9CQ1UnLFxuICAgICAgICAgICAgICAgICdEQVQnOiAnREFUQScsXG4gICAgICAgICAgICAgICAgJ0RTSCc6ICdEQVNIJywgLy8gQml0ZmluZXggbmFtZXMgRGFzaCBhcyBEU0gsIGluc3RlYWQgb2YgREFTSFxuICAgICAgICAgICAgICAgICdJT1MnOiAnSU9TVCcsXG4gICAgICAgICAgICAgICAgJ0lPVCc6ICdJT1RBJyxcbiAgICAgICAgICAgICAgICAnTU5BJzogJ01BTkEnLFxuICAgICAgICAgICAgICAgICdRU0gnOiAnUUFTSCcsXG4gICAgICAgICAgICAgICAgJ1FUTSc6ICdRVFVNJyxcbiAgICAgICAgICAgICAgICAnU05HJzogJ1NOR0xTJyxcbiAgICAgICAgICAgICAgICAnU1BLJzogJ1NQQU5LJyxcbiAgICAgICAgICAgICAgICAnWVlXJzogJ1lPWU9XJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnZXhhY3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0ZW1wb3JhcmlseV91bmF2YWls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bGltaXQgb3JkZXJzIG9yIHJlZHVjZS9jbG9zZSB5b3VyIHBvc2l0aW9ucy5cIixcIndpdGhkcmF3YWxfaWRcIjowLFwiZmVlc1wiOlwiMC4wMDI3XCJ9XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uTW9kZSc6IFNJR05JRklDQU5UX0RJR0lUUyxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hGdW5kaW5nRmVlcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgY29uc3QgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QWNjb3VudEZlZXMgKHBhcmFtcyk7XG4gICAgICAgIGNvbnN0IGZlZXMgPSByZXNwb25zZVsnd2l0aGRyYXcnXTtcbiAgICAgICAgY29uc3Qgd2l0aGRyYXcgPSB7fTtcbiAgICAgICAgY29uc3QgaWRzID0gT2JqZWN0LmtleXMgKGZlZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgY29uc3QgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuY3VycmVuY2llc19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgY29kZSA9IGN1cnJlbmN5Wydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB3aXRoZHJhd1tjb2RlXSA9IHRoaXMuc2FmZUZsb2F0IChmZWVzLCBpZCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc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A9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4aW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGltaXRzWydjb3N0J10gPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGxpbWl0c1snYW1vdW50J11bJ21pbiddICogbGltaXRzWydwcmljZSddWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWNpbWFsVG9QcmVjaXNpb24gKGNvc3QsIFJPVU5ELCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10sIHRoaXMucHJlY2lzaW9uTW9kZSk7XG4gICAgfVxuXG4gICAgcHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWNpbWFsVG9QcmVjaXNpb24gKHByaWNlLCBST1VORCwgdGhpcy5tYXJrZXRzW3N5bWJvbF1bJ3ByZWNpc2lvbiddWydwcmljZSddLCB0aGlzLnByZWNpc2lvbk1vZGUpO1xuICAgIH1cblxuICAgIGFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWNpbWFsVG9QcmVjaXNpb24gKGFtb3VudCwgVFJV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gIH0gZWxzZSBpZiAoJ3BhaXInIGluIHRpY2tlcikge1xuICAgICAgICAgICAgbGV0IGlkID0gdGlja2VyWydwYWlyJ107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0X3ByaWNlJyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pZCcpLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAocGFyc2VGbG9hdCAodHJhZGVbJ3RpbWVzdGFtcCddKSkgKiAxMDAwO1xuICAgICAgICBsZXQgc2lkZSA9IHRyYWRlWyd0eXBlJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCBvcmRlcklkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSw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Ftb3VudCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudC50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ29jb29yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAnYnV5X3ByaWNlX29jbyc6IDAsXG4gICAgICAgICAgICAnc2VsbF9wcmljZV9vY28nOiAwLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIHByaWNlID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2UudG9TdHJpbmcgKCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlck5ldyAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlckNhbmNlbCAoeyAnb3JkZXJfaWQnOiBwYXJzZUludCAoaWQpIH0pO1xuICAgIH1cblx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cmRlclsndHlwZSddLnNwbGl0ICgnICcpO1xuICAgICAgICAgICAgb3JkZXJUeXBlID0gcGFydHNbMV07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChwYXJzZUZsb2F0IChvcmRlclsndGltZXN0YW1wJ10pICogMTAwMCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2F2Z19leGVjdXRpb25fcHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcmlnaW5hbF9hbW91bnQnKSxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5pbmdfYW1vdW50JyksXG4gICAgICAgICAgICAnZmlsbGVkJzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZXhlY3V0ZWRfYW1vdW50JyksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW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lPJzogJ2FpbycsXG4gICAgICAgICAgICAnQU5UJzogJ2FudCcsXG4gICAgICAgICAgICAnQVZUJzogJ2F2ZW50dXMnLCAvLyAjMTgxMVxuICAgICAgICAgICAgJ0JBVCc6ICdiYXQnLFxuICAgICAgICAgICAgJ0JDSCc6ICdiY2FzaCcsIC8vIHVuZG9jdW1lbnRlZFxuICAgICAgICAgICAgJ0JDSSc6ICdiY2knLFxuICAgICAgICAgICAgJ0JGVCc6ICdiZnQnLFxuICAgICAgICAgICAgJ0JUQyc6ICdiaXRjb2luJyxcbiAgICAgICAgICAgICdCVEcnOiAnYmdvbGQnLFxuICAgICAgICAgICAgJ0NGSSc6ICdjZmknLFxuICAgICAgICAgICAgJ0RBSSc6ICdkYWknLFxuICAgICAgICAgICAgJ0RBU0gnOiAnZGFzaCcsXG4gICAgICAgICAgICAnREFUQSc6ICdkYXRhY29pbicsXG4gICAgICAgICAgICAnRFRIJzogJ2R0aCcsXG4gICAgICAgICAgICAnRURPJzogJ2VpZG9vJywgLy8gIzE4MTFcbiAgICAgICAgICAgICdFTEYnOiAnZWxmJyxcbiAgICAgICAgICAgICdFT1MnOiAnZW9zJyxcbiAgICAgICAgICAgICdFVEMnOiAnZXRoZXJldW1jJyxcbiAgICAgICAgICAgICdFVEgnOiAnZXRoZXJldW0nLFxuICAgICAgICAgICAgJ0VUUCc6ICdtZXRhdmVyc2UnLFxuICAgICAgICAgICAgJ0ZVTic6ICdmdW4nLFxuICAgICAgICAgICAgJ0dOVCc6ICdnb2xlbScsXG4gICAgICAgICAgICAnSU9TVCc6ICdpb3MnLFxuICAgICAgICAgICAgJ0lPVEEnOiAnaW90YScsXG4gICAgICAgICAgICAnTFJDJzogJ2xyYycsXG4gICAgICAgICAgICAnTFRDJzogJ2xpdGVjb2luJyxcbiAgICAgICAgICAgICdNQU5BJzogJ21uYScsXG4gICAgICAgICAgICAnTUlUJzogJ21pdCcsXG4gICAgICAgICAgICAnTVROJzogJ210bicsXG4gICAgICAgICAgICAnTkVPJzogJ25lbycsXG4gICAgICAgICAgICAnT0RFJzogJ29kZScsXG4gICAgICAgICAgICAnT01HJzogJ29taXNlZ28nLFxuICAgICAgICAgICAgJ09NTkknOiAnbWFzdGVyY29pbicsXG4gICAgICAgICAgICAnUUFTSCc6ICdxYXNoJyxcbiAgICAgICAgICAgICdRVFVNJzogJ3F0dW0nLCAvLyAjMTgxMVxuICAgICAgICAgICAgJ1JDTic6ICdyY24nLFxuICAgICAgICAgICAgJ1JETic6ICdyZG4nLFxuICAgICAgICAgICAgJ1JFUCc6ICdyZXAnLFxuICAgICAgICAgICAgJ1JFUSc6ICdyZXEnLFxuICAgICAgICAgICAgJ1JMQyc6ICdybGMnLFxuICAgICAgICAgICAgJ1NBTic6ICdzYW50aW1lbnQnLFxuICAgICAgICAgICAgJ1NOR0xTJzogJ3NuZycsXG4gICAgICAgICAgICAnU05UJzogJ3N0YXR1cycsXG4gICAgICAgICAgICAnU1BBTksnOiAnc3BrJyxcbiAgICAgICAgICAgICdTVEonOiAnc3RqJyxcbiAgICAgICAgICAgICdUTkInOiAndG5iJyxcbiAgICAgICAgICAgICdUUlgnOiAndHJ4JyxcbiAgICAgICAgICAgICdVU0QnOiAnd2lyZScsXG4gICAgICAgICAgICAnVVNEVCc6ICd0ZXRoZXJ1c28nLCAvLyB1bmRvY3VtZW50ZWRcbiAgICAgICAgICAgICdXQVgnOiAnd2F4JyxcbiAgICAgICAgICAgICdYTE0nOiAneGxtJyxcbiAgICAgICAgICAgICdYTVInOiAnbW9uZXJvJyxcbiAgICAgICAgICAgICdYUlAnOiAncmlwcGxlJyxcbiAgICAgICAgICAgICdYVkcnOiAneHZnJyxcbiAgICAgICAgICAgICdZT1lPVyc6ICd5b3lvdycsXG4gICAgICAgICAgICAnWkVDJzogJ3pjYXNoJyxcbiAgICAgICAgICAgICdaUlgnOiAnenJ4JyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGN1cnJlbmN5IGluIG5hbWVzKVxuICAgICAgICAgIC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uICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGlmIChhcGkgPT09ICd2MicpIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSAnLycgKyBhcGkgKyByZXF1ZXN0O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmVxdWVzdCA9ICcvJyArIHRoaXMudmVyc2lvbiArIHJlcXVlc3Q7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmICgoYXBpID09PSAncHVibGljJykgfHwgKHBhdGguaW5kZXhPZiAoJy9oaXN0JykgPj0gMCkpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGxldCBzdWZmaXggPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIHVybCArPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSBzdWZmaXg7XG4gICAgICAgICAgICB9XG4g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RjaGVkS2V5IChtYXAsIGJyb2FkU3RyaW5nKSB7XG4gICAgICAgIGNvbnN0IHBhcnRpYWxLZXlzID0gT2JqZWN0LmtleXMgKG1hcCk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGFydGlhbEtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGNvbnN0IHBhcnRpYWxLZXkgPSBwYXJ0aWFsS2V5c1tpXTtcbiAgICAgICAgICAgIGlmIChicm9hZFN0cmluZy5pbmRleE9mIChwYXJ0aWFsS2V5KSA+PSAwKVxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJ0aWFsS2V5O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmIChjb2RlID49IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgICAgICAgICAgZWxzZSBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgICAgICAgICAgbWVzc2FnZSA9IHJlc3BvbnNlWydlcn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SxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkaW5nRmVlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92Mi9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAndjEnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sc19kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhdGZvcm0vc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9L3twcmVjaXNpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9L1AwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9L1AxJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9L1AyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9L1AzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9L1IwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3tzaWRlfS97c2VjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vbG9uZy9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L3Nob3J0L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbGMvdHJhZGUvYXZnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVycy97c3ltYm9sfS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL29yZGVyL3tzeW1ib2x9OntpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvdHJhZGVzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvb2ZmZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL2xvYW5zL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9jcmVkaXRzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9tYXJnaW4ve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9pbmZvL2Z1bmRpbmcve2tleX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9tb3ZlbWVudHMve2N1cnJlbmN5fS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivc3RhdHMvcGVyZjp7dGltZWZyYW1lfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvYWxlcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3cvYWxlcnQvc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3cvYWxlcnQve3R5cGV9OntzeW1ib2x9OntwcmljZX0vZGVsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL2NhbGMvb3JkZXIvYXZhaWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9sZWRnZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1QnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1BLJzogOS4yNzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBVCc6IDkuMDg4MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTlQnOiA4LjI4ODEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMTQuMzAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBU0gnOiAzLjI0MjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVlXJzogMTguMDU1LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBpc0ZpYXQgKGNvZGUpIHtcbiAgICAgICAgbGV0IGZpYXQgPSB7XG4gICAgICAgICAgICAnVVNEJzogJ1VTRCcsXG4gICAgICAgICAgICAnRVVSJzogJ0VVUicsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiAoY29kZSBpbiBmaWF0KTtcbiAgICB9XG5cbiAgICBnZXRDdXJyZW5jeUlkIChjb2RlKSB7XG4gICAgICAgIGxldCBpc0ZpYXQgPSB0aGlzLmlzRmlhdCAoY29kZSk7XG4gICAgICAgIGxldCBwcmVmaXggPSBpc0ZpYXQgPyAnZicgOiAndCc7XG4gICAgICAgIHJldHVybiBwcmVmaXggKyBjb2RlO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy52MUdldFN5bWJvbHNEZXRhaWxzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3BhaXInXS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgaWQgPSAndCcgKyBpZDtcbiAgICAgICAgICAgIGJhc2VJZCA9IHRoaXMuZ2V0Q3VycmVuY3lJZCAoYmFzZUlkKTtcbiAgICAgICAgICAgIHF1b3RlSWQgPSB0aGlzLmdldEN1cnJlbmN5SWQgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlX3ByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ3ByaWNlX3ByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5pbXVtX29yZGVyX3NpemUnKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhpbXVtX29yZGVyX3NpemUnKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsaW1pdHNbJ2Nvc3QnXSA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbGltaXRzWydhbW91bnQnXVsnbWluJ10gKiBsaW1pdHNbJ3ByaWNlJ11bJ21pbiddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RBdXRoUldhbGxldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlVHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICdleGNoYW5nZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgYWNjb3VudFR5cGUgPSBiYWxhbmNlWzBdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsxXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbMl07XG4gICAgICAgICAgICBsZXQgYXZhaWxhYmxlID0gYmFsYW5jZVs0XTtcbiAgICAgICAgICAgIGlmIChhY2NvdW50VHlwZSA9PT0gYmFsYW5jZVR5cGUpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3lbMF0gPT09ICd0JylcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS5zbGljZSAoMSk7XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGF2YWlsYWJsZTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdG90YWw7XG4gICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ2ZyZWUnXSlcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRCb29rU3ltYm9sUHJlY2lzaW9uICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAncHJlY2lzaW9uJzogJ1IwJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdiaWRzJzogW10sXG4gICAgICAgICAgICAnYXNrcyc6IFtdLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdub25jZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvcmRlcmJvb2subGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBvcmRlciA9IG9yZGVyYm9va1tpXTtcbiAgICAgICAgICAgIGxldCBwcmljZSA9IG9yZGVyWzFdO1xuICAgICAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWzJdO1xuICAgICAgICAgICAgbGV0IHNpZGUgPSAoYW1vdW50ID4gMCkgPyAnYmlkcycgOiAnYXNrcyc7XG4gICAgICAgICAgICBhbW91bnQgPSBNYXRoLmFicyAoYW1vdW50KTtcbiAgICAgICAgICAgIHJlc3VsdFtzaWRlXS5wdXNoIChbIHByaWNlLCBhbW91bnQgXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmVzdWx0WydiaWRzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0WydiaWRzJ10sIDAsIHRydWUpO1xuICAgICAgICByZXN1bHRbJ2Fza3MnXSA9IHRoaXMuc29ydEJ5IChyZXN1bHRbJ2Fza3MnXSwgMCk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsZW5ndGggPSB0aWNrZXIubGVuZ3RoO1xuICAgICAgICBsZXQgbGFzdCA9IHRpY2tlcltsZW5ndGggLSA0XTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aWNrZXJbbGVuZ3RoIC0gMl0sXG4gICAgICAgICAgICAnbG93JzogdGlja2VyW2xlbmd0aCAtIDFdLFxuICAgICAgICAgICAgJ2JpZCc6IHRpY2tlcltsZW5ndGggLSAxMF0sXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlcltsZW5ndGggLSA4XSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJ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VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IFsgaWQsIHRpbWVzdGFtcCwgYW1vdW50LCBwcmljZSBdID0gdHJhZGU7XG4gICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA8IDApID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgIGlmIChhbW91bnQgPCAwKSB7XG4gICAgICAgICAgICBhbW91bnQgPSAtYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZC50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ft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SAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9ICcvYXBpJyArICcvJyArIHJlcXVlc3QgKyBub25jZSArIGJvZHk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEzODQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ2JmeC1ub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdiZngtYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ2JmeC1zaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBh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odHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MDUxNjQyLTU2MTU0MTgyLTY2MGUtMTFlNy05YjBkLTYwNDJkMWU2ZWRkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRmbHllci5qcCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdGZseWVyLmpwL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMvdXNhJywgLy8gbmV3ICh3aXApXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0cy9ldScsICAvLyBuZXcgKHdpcClcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzJywgICAgIC8vIG9yICdtYXJrZXRzJ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJvYXJkJywgICAgICAgLy8gLi4uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0dGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRleGVjdXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRoZWFsdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJvYXJkc3RhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNoYXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlcm1pc3Npb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjb2xsYXRlcmFsYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbmlucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29pbm91dHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbmthY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHdpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR0cmFkaW5nY29tbWlzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGNoaWxkb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRwYXJlbnRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbGFsbGNoaWxkb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQganBfbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0bWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHVzX21hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldG1hcmtldHNVc2EgKCk7XG4gICAgICAgIGxldCBldV9tYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRtYXJrZXRzRXUgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gdGhpcy5hcnJheUNvbmNhdCAoanBfbWFya2V0cywgdXNfbWFya2V0cyk7XG4gICAgICAgIG1hcmtldHMgPSB0aGlzLmFycmF5Q29uY2F0IChtYXJrZXRzLCBldV9tYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydwcm9kdWN0X2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGxldCBudW1DdXJyZW5jaWVzID0gY3VycmVuY2llcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ3VycmVuY2llcyA9PT0gMSkge1xuICAgICAgICAgICAgICAgIGJhc2UgPSBzeW1ib2wuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gc3ltYm9sLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtQ3VycmVuY2llcyA9PT0gMikge1xuICAgICAgICAgICAgICAgIGJhc2UgPSBjdXJyZW5jaWVzWzBdO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJhc2UgPSBjdXJyZW5jaWVzWzFdO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gY3VycmVuY2llc1syXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgI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G4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmVzdF9iaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2Jlc3RfYXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lX2J5X3Byb2R1Y3QnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBvcmRlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdzaWRlJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIGlmICh0cmFkZVsnc2lkZSddKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9IHRyYWRlWydzaWRlJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gc2lkZSArICdfY2hpbGRfb3JkZXJfYWNjZXB0YW5jZV9pZCc7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRyYWRlKVxuICAgICAgICAgICAgICAgICAgICBvcmRlciA9IHRyYWRlW2lkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBvcmRlciA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBvcmRlciA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdjaGlsZF9vcmRlcl9hY2NlcHRhbmNlX2lkJyk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ2V4ZWNfZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZ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XNlICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdwcm9kdWN0X2NvZGUnKTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWFya2V0SWQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3RvdGFsX2NvbW1pc3Npb24nKTtcbiAgICAgICAgaWYgKHR5cGVvZiBmZWVDb3N0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3JhdGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnY2hpbGRfb3JkZXJfYWNjZXB0YW5jZV9pZCddLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0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BvbnNlWydtZXNzYWdlX2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKVxuICAgICAgICAgICAgcmVxdWVzdCArPSAnbWUvJztcbiAgICAgICAgcmVxdWVzdCArPSBwYXRoO1xuICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICByZXF1ZXN0ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFsgbm9uY2UsIG1ldGhvZCwgcmVxdWVzdCBdLmpvaW4gKCcnKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBpZiAobWV0aG9kICE9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAg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gICAgJ2lkJzogJ2JpdGh1bWInLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0aHVtYicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0tSJywgLy8gU291dGggS29yZWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiA1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA1OTcxNzctZWE4MDAxNzItOWQ1ZS0xMWU3LTgwNGMtYjlkNGZhOWI1NmIwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5iaXRodW1iLmNvbS9wdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5iaXRodW1iLmNvbScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGh1bWIuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJpdGh1bWIuY29tL3UxL1VTMTI3JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2svYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWNlbnRfdHJhbnNhY3Rpb25zL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY2VudF90cmFuc2FjdGlvbnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby93YWxsZXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3VzZXJfdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9wbGFjZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9vcmRlcl9kZXRhaWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvYnRjX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2tyd19kZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9rcndfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvbWFya2V0X2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvbWFya2V0X3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMTUgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJBbGwgKCk7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ2RhdGEnXSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgaWYgKGlkICE9PSAnZGF0ZScpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddW2lkXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9ICdLUlcnO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZCArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ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G1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAndW5pdHMnOiBhbW91bnQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiAoc2lkZSA9PT0gJ2J1eScpID8gJ2JpZCcgOiAnYXNrJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBtZXRob2QgKz0gJ1BsYWNlJztcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlID09PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ3VuaXRzJzogYW1vdW50LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl9pZCcgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnb3JkZXJfaWQnXSlcbiAgICAgICAgICAgICAgICBpZCA9IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBzaWRlX2luX3BhcmF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cyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2VuZHBvaW50JzogZW5kcG9pbnQsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gZW5kcG9pbnQgKyAnXFwwJyArIGJvZHkgKyAnXFwwJyArIG5vbmNlO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlNjQgPSB0aGlzLmRlY29kZSAodGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKHNpZ25hdHVyZSkpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FjY2VwdCc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0FwaS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQXBpLVNpZ24nOiBzaWduYXR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ly9iaXRsaXNoLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXRsaXNoLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdGxpc2guY29tL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4zIC8gMTAwLCAvLyBhbm9ueW1vdXMgMC4zJSwgdmVyaWZpZWQgMC4yJVxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogNTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50c19vcGVyYXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF90cmFkZXNfYnlfaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX2Jjb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfdGVtcGxhdGVfd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfYWNjb3VudHNfb3BlcmF0aW9uc19mcm9tX3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjdGl2ZV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfYmNvZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X21hdGNoZXNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZHNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9wYXltZW50X21ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZGVlbV9jb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXNpZ24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbm91dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfb3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2J5X2lkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsXG4gICAgICAgICAgICAgICAgJ1hERyc6ICdET0dFJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtc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0bGlzaCBuYW1lcyBEYXNoIGFzIERTSCwgaW5zdGVhZCBvZiBEQVNIXG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT09ICdEU0gnKVxuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gJ0RBU0gnO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSAnWERHJylcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9ICdET0dFJztcbiAgICAgICAgICAgIGJhbGFuY2VbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsnZnVuZHMnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2hvbGRlZCddKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBzaWduSW4gKCkge1xuICAgICAg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TSc6ICczbScsXG4gICAgICAgICAgICAgICAgJzZNJzogJzZtJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnMXknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjcyNTYtYTg1NTUyMDAtNWVmOS0xMWU3LTk2ZmQtNDY5YTY1ZTJiMGJkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0LnBsL2FwaTIvJywgLy8gbGFzdCBzbGFzaCBpcyBjcml0aWNhbFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3B1YmxpYy5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5uZXQvZG9jcy5waHA/ZmlsZT1hcGlfcHJpdmF0ZS5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRtYXJrZXQtbmV0L2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi9jdHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS85MG0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS82aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzFkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vN2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzNtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2tTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrQ29uZmlybScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3UExOUFAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3RmlhdEZhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbk9wZW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkNsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbk1vZGlmeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQmFsYW5jZUFkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQmFsYW5jZVJlbW92ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBPcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwQ2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JDSC9QTE4nOiB7ICdpZCc6ICdCQ0NQTE4nLCAnc3ltYm9sJzogJ0JDSC9QTE4nLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCVEcvUExOJzogeyAnaWQnOiAnQlRHUExOJywgJ3N5bWJvbCc6ICdCVEcvUExOJywgJ2Jhc2UnOiAnQlRHJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1BMTic6IHsgJ2lkJzogJ0JUQ1BMTicsICdzeW1ib2wnOiAnQlRDL1BMTicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdCVENFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvUExOJzogeyAnaWQnOiAnTFRDUExOJywgJ3N5bWJvbCc6ICdMVEMvUExOJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0JUQyc6IHsgJ2lkJzogJ0xUQ0JUQycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnIH0sXG4gICAgICAgICAgICAgICAgJ0xpdGVNaW5lWC9CVEMnOiB7ICdpZCc6ICdMaXRlTWluZVhCVEMnLCAnc3ltYm9sJzogJ0xpdGVNaW5lWC9CVEMnLCAnYmFzZSc6ICdMaXRlTWluZVgnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjQ1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuNDUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OS45OSwgMC40NCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OS45OSwgMC40MyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OS45OSwgMC40MiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzk5OS45OSwgMC40MSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTkuOTksIDAuNDAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5Ljk5LCAwLjM5IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC4zOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzk5OTkuOTksIDAuMzcgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OS45OSwgMC4zNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjM1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OTkuOTksIDAuMzQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5OS45OSwgMC4zMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4zMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5OS45OSwgMC4zMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5OS45OSwgMC4wIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OS45OSwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OS45OSwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OS45OSwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzk5OS45OSwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTkuOTksIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5Ljk5LCAwLjkgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5Ljk5LCAwLjggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjcgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OS45OSwgMC42IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTkuOTksIDAuNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5OS45OSwgMC4zIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTk5Ljk5LCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5OS45OSwgMC4wIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTE4nOiAyLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAyLCAvLyBTRVBBLiBUcmFuc2ZlciBJTlQgKFNIQSk6IDUgRVVSXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0SW5mbyAoKTtcbiAgICAgICAgbGV0IGRhdGEgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IGRhdGFbJ2JhbGFuY2VzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogZGF0YSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlWydhdmFpbGFibGUnXSlcbiAgICA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W5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ3R5cGUnXSA9PT0gJ2JpZCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPS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lkICsgJyByZXF1aXJlcyBhY2NvdW50IHBhcmFtZXRlciB0byB3aXRoZHJhdyBmaWF0IGN1cnJlbmN5Jyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ2FjY291bnQyJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgICAgICByZXF1ZXN0WydhY2NvdW50MiddID0gcGFyYW1zWydhY2NvdW50MiddOyAvLyBiYW5rIFNXSUZUIGNvZGUgKEVVUiBvbmx5KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgPT09ICdFVVInKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYWNjb3VudDIgcGFyYW1ldGVyIHRvIHdpdGhkcmF3IEVVUicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCd3aXRoZHJhd2FsX25vdGUnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ3dpdGhkcmF3YWxfbm90ZSddID0gcGFyYW1zWyd3aXRoZHJhd2FsX25vdGUnXTsgLy8gYSAxMC1jaGFyYWN0ZXIgdXNlci1zcGVjaWZpZWQgd2l0aGRyYXdhbCBub3RlIChQTE4gb25seSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSAnUExOJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJlcXVpcmVzIHdpdGhkcmF3YWxfbm90ZSBwYXJhbWV0ZXIgdG8gd2l0aGRyYXcgUExOJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgPSAncHJpdmF0ZVBvc3RXaXRoZHJhdyc7XG4gICAgICAgICAgICByZXF1ZXN0WydhZGRyZXNzJ10gPSBhZGRyZXNzO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGggKyAnLmpzb24nLCBwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJLUhhc2gnOiB0aGlzLmhtYWMgKHRoaX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AgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vdGVzdG5ldC5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzE5LWY2NTNjNmU2LTVlZDQtMTFlNy05MzNkLWYwYmMzNjk5YWU4Zi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbS9hcHAvYXBpT3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdE1FWC9hcGktY29ubmVjdG9ycy90cmVlL21hc3Rlci9vZmZpY2lhbC1odHRwJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20vYXBwL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fubm91bmNlbWVudC91cmdlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUFuZEluZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlSW50ZXJ2YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2NvbXBvc2l0ZUluZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2luZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3VyYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVhZGVyYm9hcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vay9MMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NjaGVtYS93ZWJzb2NrZXRIZWxwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZXR0bGVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jaGFubmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jb25uZWN0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9uL3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWZmaWxpYXRlU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoZWNrUmVmZXJyYWxDb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21pbldpdGhkcmF3YWxGZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXBpS2V5L2Rpc2FibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWxBbGxBZnRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2xvc2VQb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaXNvbGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3Jpc2tMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vdHJhbnNmZXJNYXJnaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2FuY2VsV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtRW1haWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kaXNhYmxlVEZBJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXRBbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJlZmVyZW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdEVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9yZXF1ZXN0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2J1bGsnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0p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ICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChpZC5pbmRleE9mICgnQl8nKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgcHJlZGljdGlvbiA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdwcmVkaWN0aW9uJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgZnV0dXJlID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ2Z1dHVyZSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRbJ2xvdFNpemUnXSlcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ2Ftb3VudCddID0gdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nICh0aGlzLnRydW5jYXRlX3RvX3N0cmluZyAobWFya2V0Wydsb3RTaXplJ10sIDE2KSk7XG4gICAgICAgICAgICBpZiAobWFya2V0Wyd0aWNrU2l6ZSddKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsncHJpY2UnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAodGhpcy50cnVuY2F0ZV90b19zdHJpbmcgKG1hcmtldFsndGlja1NpemUnXSwgMTYpKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0Wydsb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhPcmRlclF0eSddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0Wyd0aWNrU2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnbWF4UHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsndGFrZXJGZWUnXSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYXJrZXRbJ21ha2VyRmVlJ10sXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgICAgICdzcG90JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3N3YXAnOiBzd2FwLFxuICAgICAgICAgICAgICAgICdmdXR1cmUnOiBmdXR1cmUsXG4gICAgICAgICAgICAgICAgJ3ByZWRpY3Rpb24nOiBwcmVkaWN0aW9uLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJNYXJnaW4gKHsgJ2N1cnJlbmN5JzogJ2FsbCcgfSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCByZXNwb25zZS5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVtiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZU1hcmdpbiddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ21hcmdpbkJhbGFuY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT09ICdCVEMnKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYWNjb3VudFsnZnJlZSddICogMC4wMDAwMDAwMTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYWNjb3VudFsndG90YWwnXSAqIDAuMDAwMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3J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AgICAgIC8vIGlmIHNpbmNlIGlzIG5vdCBzZXQsIHRoZXkgd2lsbCByZXR1cm4gY2FuZGxlcyBzdGFydGluZyBmcm9tIDIwMTctMDEtMDFcbiAgICAgICAgaWYgKHR5cGVvZiBzaW5jZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCB5bWRobXMgPSB0aGlzLnltZGhtcyAoc2luY2UpO1xuICAgICAgICAgICAgbGV0IHltZGhtID0geW1kaG1zLnNsaWNlICgwLCAxNik7XG4gICAgICAgICAgICByZXF1ZXN0WydzdGFydFRpbWUnXSA9IHltZGhtOyAvLyBzdGFydGluZyBkYXRlIGZpbHRlciBmb3IgcmVzdWx0c1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVCdWNrZXRlZCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIHRyYWRlKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnc3ltYm9sJ11dO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgIC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vcmRTdGF0dXMnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBzdGF0dXMgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGlkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgZGF0ZXRpbWVfdmFsdWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBpc284NjAxID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3RpbWVzdGFtcCcgaW4gb3JkZXIpXG4gICAgICAgICAgICBkYXRldGltZV92YWx1ZSA9IG9yZGVyWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgZWxzZSBpZiAoJ3RyYW5zYWN0VGltZScgaW4gb3JkZXIpXG4gICAgICAgICAgICBkYXRldGltZV92YWx1ZSA9IG9yZGVyWyd0cmFuc2FjdFRpbWUnXTtcbiAgICAgICAgaWYgKHR5cGVvZiBkYXRldGltZV92YWx1ZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChkYXRldGltZV92YWx1ZSk7XG4gICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICB9XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcmRlclF0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnY3VtUXR5JywgMC4wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IE1hdGgubWF4IChhbW91bnQgLSBmaWxsZWQsIDAuMCk7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlmICh0eXBlb2YgZmlsbGVkICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVySUQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiBpc284NjAxLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWydvcmRUeXBlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG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AgICAgICAvLyAnb3RwVG9rZW4nOiAnMTIzNDU2JywgLy8gcmVxdWlyZXMgaWYgdHdvLWZhY3RvciBhdXRoIChPVFApIGlzIGVuYWJsZWRcbiAgICAgICAgICAgIC8vICdmZWUnOiAwLjAwMSwgLy8gYml0Y29pbiBuZXR3b3JrIGZlZVxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VXNlclJlcXVlc3RXaXRoZHJhd2FsICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ3RyYW5zYWN0SUQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT09IDQyOSlcbiAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5KSB7XG4gICAgICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZVsnZXJyb3InXSwgJ21lc3NhZ2UnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG1lc3NhZ2UgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnSW52YWxpZCBBUEkgS2V5LicpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc3R1YiBjb2RlLCBuZWVkIHByb3BlciBoYW5kbGluZ1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcXVlcnkgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAobWV0aG9kICE9PSAnUFVUJylcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcXVlcnkgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcXVlcnk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBtZXRob2QgKyBxdWVyeSArIG5vbmNlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnIHx8IG1ldGhvZCA9PT0gJ1BVVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaS1ub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdhcGkta2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ2FwaS1zaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxufTtcbiIsIid1c2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HR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjMzNS03MTVjZTdhYS01ZWQ1LTExZTctODhhOC0xNzNhMjdiYjMwZmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdHNvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHNvLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JpdHNvLmNvbS9hcGlfaW5mbycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9iaXRzby5jb20vZmVlcz9sPWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXZhaWxhYmxlX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzL3tmaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nX2Rlc3RpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdreWNfZG9jdW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZnVuZGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci93aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXhfYmFua19jb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMve3RpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve3dpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYml0X2NhcmRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV9udW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3ZlcmlmaWNhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3BlaV93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzAyMDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBJbnZhbGlkIE5vbmNlIG9yIEludmFsaWQgQ3JlZGVudGlhbHNcbiAgICAgICAgICAgICAgICAnMTA0JzogSW52YWxpZE5vbmNlLCAvLyBDYW5ub3QgcGVyZm9ybSByZXF1ZXN0IC0gbm9uY2UgbXVzdCBiZSBoaWdoZXIgdGhhbiAxNTIwMzA3MjAzNzI0MjM3XG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QXZhaWxhYmxlQm9va3MgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzWydwYXlsb2FkJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydwYXlsb2FkJ11baV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Jvb2snXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC50b1VwcGVyQ2FzZSAoKS5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbmltdW1fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4aW11bV9hbW91bnQnKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5pbXVtX3ByaWNlJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4aW11bV9wcmljZScpLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV92YWx1ZScpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fdmFsdWUnKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5pbXVtX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9wcmljZSddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gbGltaXRzWydhbW91bnQnXVsnbWluJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydwYXlsb2FkJ11bJ2JhbGFuY2VzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgIC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AgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydjcmVhdGVkX2F0J10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdib29rJyk7XG4gICAgICAgICAgICBpZiAobWFya2V0SWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3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XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ21pbm9yJyk7XG4gICAgICAgIGlmICh0eXBlb2YgY29zdCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBjb3N0ID0gTWF0aC5hYnMgKGNvc3QpO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgb3JkZXJJZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdvaWQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0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ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVEZWxldGVPcmRlcnNPaWQgKHsgJ29pZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBsZXQgc3RhdHVzZXMgPSB7XG4gICAgICAgICAgICAncGFydGlhbC1maWxsJzogJ29wZW4nLCAvLyB0aGlzIGlzIGEgY29tbW9uIHN1YnN0aXR1dGlvbiBpbiBjY3h0XG4gICAgICAgIH07XG4gICAgICAgIGlmIChzdGF0dXMgaW4gc3RhdHVzZXMpXG4gICAgICAgICAgICByZXR1cm4gc3RhdHVzZXNbJ3N0YXR1cyddO1xuICAgICAgICByZXR1cm4gc3RhdHVzO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSBvcmRlclsnc2lkZSddO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG9yZGVyWydib29rJ107XG4gICAgICAgICAgICBpZiAobWFya2V0SWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydjcmVhdGVkX2F0J10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JpZ2luYWxfYW1vdW50Jyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd1bmZpbGxlZF9hbW91bnQnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnb2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1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0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBlbmRwb2ludCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIGVuZHBvaW50ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBlbmRwb2ludDtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IFsgbm9uY2UsIG1ldGhvZCwgZW5kcG9pbnQgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QgKz0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArICc6JyArIG5vbmNlICsgJzonICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6ICdCaXRzbyAnICsgYXV0aCxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHtcInN1Y2Nlc3NcIjpmYWxzZSxcImVycm9yXCI6e1wiY29kZVwiOjEwNCxcIm1lc3NhZ2VcIjpcIkNhbm5vdCBwZXJmb3JtIHJlcXVlc3QgLSBub25jZSBtdXN0IGJlIGhpZ2hlciB0aGFuIDE1MjAzMDcyMDM3MjQyMzdcIn19XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICBsZXQgc3VjY2VzcyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ3N1Y2Nlc3MnLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzdWNjZXNzID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHN1Y2Nlc3MgPT09ICd0cnVlJykgfHwgKHN1Y2Nlc3MgPT09ICcxJykpXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlcnJvciA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChlcnJvciwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgIC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5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91ci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmctcGFpcnMtaW5mby8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjaF93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmNoX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL2FsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkvbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC9tYXJrZXQve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbHRjX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsdGNfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aF93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4cnBfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3hycF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXItdG8tbWFpbi8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLWZyb20tbWFpbi8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwtcmVxdWVzdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL29wZW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwvY2FuY2VsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9uZXcvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbl9hZGRyZXNzL2luZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd2MSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZF9idGMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JpcHBsZV9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMCwgMC4yNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMCwgMC4yMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMCwgMC4yMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzYwMDAwMCwgMC4xNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwLCAwLjEzIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjExIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDEsIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMC45MCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkaW5nUGFpcnNJbmZvICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2UudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbElkID0gYmFzZUlkICsgJ18nICsgcXVvdGVJZDtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsndXJsX3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydiYXNlX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0Wydjb3VudGVyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHBhcnRzID0gbWFya2V0WydtaW5pbXVtX29yZGVyJ10uc3BsaXQgKCcgJyk7XG4gICAgICAgICAgICBsZXQgY29zdCA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgLy8gbGV0IFsgY29zdCwgY3VycmVuY3kgXSA9IG1hcmtldFsnbWluaW11bV9vcmRlciddLnNwbGl0ICgnICcpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ3RyYWRpbmcnXSA9PT0gJ0VuYWJsZWQnKTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbElkJzogc3ltYm9sSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKGNvc3QpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJib29rWyd0aW1lc3RhbXAnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V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0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZ2V0TWFya2V0RnJvbVRyYWRlICh0cmFkZSkge1xuICAgICAgICB0cmFkZSA9IHRoaXMub21pdCAodHJhZGUsIFtcbiAgICAgICAgICAgICdmZWUnLFxuICAgICAgICAgICAgJ3ByaWNlJyxcbiAgICAgICAgICAgICdkYXRldGltZScsXG4gICAgICAgICAgICAndGlkJyxcbiAgICAgICAgICAgICd0eXBlJyxcbiAgICAgICAgICAgICdvcmRlcl9pZCcsXG4gICAgICAgICAgICAnc2lkZScsXG4gICAgICAgIF0pO1xuICAgICAgICBsZXQgY3VycmVuY3lJZHMgPSBPYmplY3Qua2V5cyAodHJhZGUpO1xuICAgICAgICBsZXQgbnVtQ3VycmVuY3lJZHMgPSBjdXJyZW5jeUlkcy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1DdXJyZW5jeUlkcyA+IDIpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZ2V0TWFya2V0RnJvbVRyYWRlIHRvbyBtYW55IGtleXM6ICcgKyB0aGlzLmpzb24gKGN1cnJlbmN5SWRzKSArICcgaW4gdGhlIHRyYWRlOiAnICsgdGhpcy5qc29uICh0cmFkZSkpO1xuICAgICAgICBpZiAobnVtQ3VycmVuY3lJZHMgPT09IDIpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IGN1cnJlbmN5SWRzWzBdICsgY3VycmVuY3lJZHNbMV07XG4gICAgICAgICAgICBpZiAobWFya2V0SWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgbWFya2V0SWQgPSBjdXJyZW5jeUlkc1sxXSArIGN1cnJlbmN5SWRzWzBdO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGdldE1hcmtldEZyb21UcmFkZXMgKHRyYWRlcykge1xuICAgICAgICBsZXQgdHJhZGVzQnlTeW1ib2wgPSB0aGlzLmluZGV4QnkgKHRyYWRlcywgJ3N5bWJvbCcpO1xuICAgICAgICBsZXQgc3ltYm9scyA9IE9iamVjdC5rZXlzICh0cmFkZXNCeVN5bWJvbCk7XG4gICAgICAgIGxldCBudW1TeW1ib2xzID0gc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1TeW1ib2xzID09PSAxKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c1tzeW1ib2xzWzBdXTtcbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZGF0ZScgaW4gdHJhZGUpIHtcbiAgICAg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ZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzICh0cmFkZSk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBpZiAoa2V5c1tpXS5pbmRleE9mICgnXycpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0ga2V5c1tpXS5yZXBsYWNlICgnXycsICcnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gaWYgdGhlIG1hcmtldCBpcyBzdGlsbCBub3QgZGVmaW5lZFxuICAgICAgICAgICAgLy8gdHJ5IHRvIGRlZHVjZSBpdCBmcm9tIHVzZWQga2V5c1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMuZ2V0TWFya2V0RnJvbVRyYWRlICh0cmFkZSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZUNvc3QgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKTtcbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCBtYXJrZXRbJ3N5bWJvbElkJ10sIHByaWNlKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgbWFya2V0WydiYXNlSWQnXSwgYW1vdW50KTtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLC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bWFya2V0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKCdjdXJyZW5jeV9wYWlyJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG9yZGVyWydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSAwLjA7XG4gICAgICAgIGxldCB0cmFkZXMgPSBbXTtcbiAgICAgICAgbGV0IHRyYW5zYWN0aW9ucyA9IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ3RyYW5zYWN0aW9ucycpO1xuICAgICAgICBsZXQgZmVlQ29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgdHJhbnNhY3Rpb25zICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHRyYW5zYWN0aW9ucykpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRyYW5zYWN0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGUgPSB0aGlzLnBhcnNlVHJhZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICAgICAgICAgfSwgdHJhbnNhY3Rpb25zW2ldKSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkICs9IHRyYWRlWydhbW91bnQnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVDb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgIGZlZUNvc3QgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgIGZlZUNvc3QgKz0gdHJhZGVbJ2ZlZSddWydjb3N0J107XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICBjb3N0ICs9IHRyYWRlWydjb3N0J107XG4gICAgICAgICAgICAgICAgICAgIHRyYWRlcy5wdXNoICh0cmFkZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnc3RhdHVzJyk7XG4gICAgICAgIGlmICgoc3RhdHVzID09PSAnSW4gUXVldWUnKSB8fCAoc3RhdHVzID09PSAnT3BlbicpKVxuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBlbHNlIGlmIChzdGF0dXMgPT09ICdGaW5pc2hlZCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGFtb3VudCA9IGZpbGxlZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVtYWluaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMuZ2V0TWFya2V0RnJvbVRyYWRlcyAodHJhZGVzKTtcbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBmZWVDdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGZpbGxlZCA+IDApXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHRyYWRlcyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3Blbk9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2Ygc3ltYm9sICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcmRlcnMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3Blbk9yZGVyc0FsbCAoKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlcnMgKG9yZGVycywgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGdldEN1cnJlbmN5TmFtZSAoY29kZSkge1xuICAgICAgICBpZiAoY29kZSA9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ArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuZW5jb2RlICh0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSkpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnc3RhdHVzJyk7XG4gICAgICAgICAgICBpZiAoc3RhdHVzID09PSAnZXJyb3InKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY29kZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgPT09ICdBUEkwMDA1JylcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyBpbnZhbGlkIHNpZ25hdHVyZSwgdXNlIHRoZSB1aWQgZm9yIHRoZSBtYWluIGFjY291bnQg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ICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc4NjM3Ny04YzhhYjU3ZS01ZmU5LTExZTctOGVhNC0yYjA1YjZiY2NlZWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldC9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V1cl91c2QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9hbGxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZF9idGMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JpcHBsZV93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbF9yZXF1ZXN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjdXNkJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcsICdtYWtlcic6IDAuMDAyNSwgJ3Rha2VyJzogMC4wMDI1IH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdidGNldXInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVv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T1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnb25lTWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnZml2ZU1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICd0aGlydHlNaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICdob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnZGF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzUyLWNmMGIzYzI2LTVlZDUtMTFlNy04MmI3LWYzODI2YjdhOTdkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JpdHRyZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndjInOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGkvdjIuMC9wdWInLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHRyZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9Ib21lL0FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5vcmcvcGFja2FnZS9ub2RlLmJpdHRyZXguYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9GZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaXR0cmV4LmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDAxOTk2NTEtV2hhdC1mZWVzLWRvZXMtQml0dHJleC1jaGFyZ2UtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvR2V0QlRDUHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRUaWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01hcmtldHMvR2V0TWFya2V0U3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0TGF0ZXN0VGljaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2FjY291bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRhZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ21hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbG1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZUQyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdSREQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPVCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAvLyAnQ2FsbCB0byBDYW5jZWwgd2FzIHRocm90dGxlZC4gVHJ5IGFnYWluIGluIDYwIHNlY29uZHMuJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgLy8gJ0NhbGwgdG8gR2V0QmFsYW5jZXMgd2FzIHRocm90dGxlZC4gVHJ5IGFnYWluIGluIDYwIHNlY29uZHMuJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJ0FQSVNJR05fTk9UX1BST1ZJREVEJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnSU5WQUxJRF9TSUdOQVRVUkUnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICdJTlZBTElEX0NVUlJFTkNZJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnSU5WQUxJRF9QRVJNSVNTSU9OJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnSU5TVUZGSUNJRU5UX0ZVTkRTJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJ1FVQU5USVRZX05PVF9QUk9WSURFRCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnTUlOX1RSQURFX1JFUVVJUkVNRU5UX05PVF9NRVQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJ09SREVSX05PVF9PUEVOJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICdVVUlEX0lOVkFMSUQnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICdSQVRFX05PVF9QUk9WSURFRCc6IEludmFsaWRPcmRlciwgLy8gY3JlYXRlTGltaXRCdXlPcmRlciAoJ0VUSC9CVEMnLCAxLCAwKVxuICAgICAgICAgICAgICAgICdXSElURUxJU1RfVklPTEFUSU9OX0lQJzogUGVybWlzc2lvbkRlbmllZCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnb3B0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAncGFyc2VPcmRlclN0YXR1cyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdoYXNBbHJlYWR5QXV0aGVudGljYXRlZFN1Y2Nlc3NmdWxseSc6IGZhbHNlLCAvLyBh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nJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ0lzQWN0aXZlJ10gfHwgbWFya2V0WydJc0FjdGl2ZSddID09PSAndHJ1ZSc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRCYWxhbmNlcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdGhpcy5pbmRleEJ5IChiYWxhbmNlcywgJ0N1cnJlbmN5Jyk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGluZGV4ZWRbaWRdO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydBdmFpbGFibGUnXSk7XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydCYWxhbmNlJ10pO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSB0b3RhbCAtIGZyZWU7XG4gICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBmcmVlO1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gdXNlZDtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0b3RhbDtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICd0eXBlJzogJ2JvdGgnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgaWYgKCd0eXBlJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgIGlmIChwYXJhbXNbJ3R5cGUnXSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogW10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1zWyd0eXBlJ10gPT09ICdzZWxsJykge1xuICAgICAgICAgICAgICAgIG9yZGVyYm9vayA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2J1eSc6IFt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ZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbGFzdCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIHByZXZpb3VzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGNoYW5nZSA9IGxhc3QgLSBwcmV2aW91cztcbiAgICAgICAgICAgICAgICBpZiAocHJldmlvdXMgPiAwKVxuICAgICAgICAgICAgICAgICAgICBwZXJjZW50YWdlID0gKGNoYW5nZSAvIHByZXZpb3VzKSAqIDEwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnTG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZCcpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnQXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBjaGFuZ2UsXG4gICAg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Y2lzaW9uID0gODsgLy8gZGVmYXVsdCBwcmVjaXNpb24sIHRvZG86IGZpeCBcIm1hZ2ljIGNvbnN0YW50c1wiXG4gICAgICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVZhbHVlIChjdXJyZW5jeSwgJ0Jhc2VBZGRyZXNzJyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICd0eXBlJzogY3VycmVuY3lbJ0NvaW5UeXBlJ10sXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnQ3VycmVuY3lMb25nJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGN1cnJlbmN5WydJc0FjdGl2ZSddLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICdUeEZlZScpLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ1R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHN1bW1hcmllcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1t0XTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0I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gICAgICAgIH1cbiAgICAgICAgaWYgKGNvbW1pc3Npb24pIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKG9yZGVyW2NvbW1pc3Npb25dKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdMaW1pdCcpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdRdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHlSZW1haW5pbmcnLCAwLjApO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBpZiAoIWNvc3QpIHtcbiAgICAgICAgICAgIGlmIChwcmljZSAmJiBhbW91bnQpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICghcHJpY2UpIHtcbiAgICAgICAgICAgIGlmIChjb3N0ICYmIGZpbGxlZClcbiAgICAgICAgICAgICAgICBwcmljZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZVBlclVuaXQnKTtcbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ09yZGVyVXVpZCcpO1xuICAgICAgICBpZiAodHlwZW9mIGlkID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ09yZGVySWQnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiBpc284NjAxLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IGxhc3RUcmFkZVRpbWVzdGFtcCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGxldCBvcmRlcklkRmllbGQgPSB0aGlzLmdldE9yZGVySWRGaWVsZCAoKTtcbiAg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VORVJBVElORycpXG4gICAgICAgICAgICBzdGF0dXMgPSAncGVuZGluZyc7XG4gICAgICAgIGxldCB0YWcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgoY29kZSA9PT0gJ1hSUCcpIHx8IChjb2RlID09PSAnWExNJykpIHtcbiAgICAgICAgICAgIHRhZyA9IGFkZHJlc3M7XG4gICAgICAgICAgICBhZGRyZXNzID0gY3VycmVuY3lbJ2FkZHJlc3MnXTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjb2RlLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3RhZyc6IHRhZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjb2RlLCBhbW91bnQsIGFkZHJlc3MsIHRhZyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmN5IChjb2RlKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgICAgICdxdWFudGl0eSc6IGFtb3VudCxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHRhZylcbiAgICAgICAgICAgIHJlcXVlc3RbJ3BheW1lbnRpZCddID0gdGFnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRXaXRoZHJhdyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCd1dWlkJyBpbiByZXNwb25zZVsncmVzdWx0J10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJztcbiAgICAgICAgaWYgKGFwaSAhPT0gJ3YyJylcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gYXBpICsgJy8nICsgbWV0aG9kLnRvTG93ZXJDYXNlICgpICsgcGF0aDtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3YyJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBhcGkgKyAnLyc7XG4gICAgICAgICAgICBpZiAoKChhcGkgPT09ICdhY2NvdW50JykgJiYgKHBhdGggIT09ICd3aXRoZHJhdycpKSB8fCAocGF0aCA9PT0gJ29wZW5vcmRlcnMnKSlcbiAgICAgICAgICAgICAgICB1cmwgKz0gbWV0aG9kLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnYXBpc2lnbic6IHNpZ25hdHVyZSB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgLy8geyBzdWNjZXNzOiBmYWxzZSwgbWVzc2FnZTogXCJtZXNzYWdlXCIgfVxuICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdzdWNjZXNzJyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHN1Y2Nlc3MgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJzogbWFsZm9ybWVkIHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBzdWNjZXNzID09PSAnc3RyaW5nJylcbiAgICAgICAgICAgICAgICAvLyBibGV1dHJhZGUgdXNlcyBzdHJpbmcgaW5zdGVhZCBvZiBib29sZWFuXG4gICAgICAgICAgICAgICAgc3VjY2VzcyA9IChzdWNjZXNzID09PSAndHJ1ZScpID8gdHJ1ZSA6IGZhbHNlO1xuICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSBpbiBleGNlcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXhjZXB0aW9uc1ttZXNzYWdlXSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIG1lc3NhZ2UgIT09ICd1bmRlZmluZWQnKSAmJiAobWVzc2FnZS5pbmRleE9mICgndGhyb3R0bGVkLiBUcnkgYWdhaW4nKSA+PSAwKSlcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT09ICdBUElLRVlfSU5WQUxJRCcpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9uc1snaGFzQWxyZWFkeUF1dGhlbnRpY2F0ZWRTdWNjZXNzZnVsbHknXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnRFVTVF9UUkFERV9ESVNBTExPV0VEX01JTl9WQUxVRV81MEtfU0FUJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgY29zdCBzaG91bGQgYmUgb3ZlciA1MGsgc2F0b3NoaSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9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AgICAgICAgICAnaWQnOiAnYml0eicsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXQtWicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3VzZXJBZ2VudCc6IHRoaXMudXNlckFnZW50c1snY2hyb21lJ10sXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNTg2MjYwNi00ZjU1NGYxNC0wYjVkLTExZTgtOTU3ZC0zNTA1OGM1MDRiNmYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbS9hcGlfdjEnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0LXouY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbS9hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYml0LXouY29tL2Fib3V0L2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlQWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUNhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREtLVCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZDVCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFhJJzogJzAuOCUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01aQyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1hTJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hQTSc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBUyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIU1InOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlVMUyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDM1MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWUJDVCc6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFgnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBTUUnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOVCc6IDkuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTU1MnOiAxNTAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJLJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBUlQnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEVPJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSVUnOiAzNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVEMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDIwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hXQyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTklUJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09YWSc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjM1MDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JUQyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1gnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRGJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BZTE5UJzogMC40MDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSQic6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2xhc3ROb25jZVRpbWVzdGFtcCc6IDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ1BYQyc6ICdQaXhpZWNvaW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJhbGwgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gdGhpcy5vbWl0IChkYXRhLCAndWlkJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgaWRIYXNVbmRlcnNjb3JlID0gKGlkLmluZGV4T2YgKCdfJykgPj0gMCk7XG4gICAgICAgICAgICBpZiAoIWlkSGFzVW5kZXJzY29yZSkge1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuY3VycmVuY2llc19ieV9pZCkge1xuICAgICAgICAgICAgICAgICAgICBjb2RlID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2lkXVsnY29kZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICBsZXQgdXNlZEZpZWxkID0gaWQgKyAnX2xvY2snO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlcywgdXNlZEZpZWxkKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zYWZlRmxvYXQgKGJhbGFuY2VzLCBpZCk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ3VzZWQnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6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zLmlzbzg2MDEgKGhrdCk7XG4gICAgICAgIHV0Y0RhdGUgPSB1dGNEYXRlLnNwbGl0ICgnVCcpO1xuICAgICAgICB1dGNEYXRlID0gdXRjRGF0ZVswXSArICcgJyArIHRyYWRlWyd0J10gKyAnKzA4JztcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh1dGNEYXRlKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncCcpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnbicpO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnByaWNlVG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcHJpY2UpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGV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luaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgaXNvODYwMSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdkYXRldGltZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnZGF0ZXRpbWUnXSk7XG4gICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnY29zdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBvcmRlclsnbnVtYmVyJ10sXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLC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1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdibDNwJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JMM1AnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ05MJywgJ0VVJyBdLCAvLyBOZXRoZXJsYW5kcywgRVVcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMScsXG4gICAgICAgICAgICAnY29tbWVudCc6ICdBbiBleGNoYW5nZSBtYXJrZXQgYnkgQml0b25pY05MJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NTAxNzUyLTYwYzIxYjgyLTZmZWItMTFlNy04MThiLTA1NWVlNmQwZTc1NC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYmwzcC5ldScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmwzcC5ldScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdG9uaWMubmwnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaXRvbmljTkwvYmwzcC1hcGkvdHJlZS9tYXN0ZXIvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JsM3AuZXUvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0b25pYy5ubC9lbi9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L2RlcHRoL2Z1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL2FkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXJzL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L3RyYWRlcy9mZXRjaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS9uZXdfZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvd2FsbGV0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAnbWFrZXInOiAwLjAwMjUsICd0YWtlcic6IDAuMDAyNSB9LFxuICAgICAgICAgICAgICAgICdMVEMvRVVSJzogeyAnaWQnOiAnTFRDRVVSJywgJ3N5bWJvbCc6ICdMVEMvRVVSJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0VVUicsICdtYWtlcic6IDAuMDAyNSwgJ3Rha2VyJzogMC4wMDI1IH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHRU5NS1RNb25leUluZm8gKCk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBkYXRhWyd3YWxsZXRzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogZGF0YSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdhdmFpbGFibGUnIGluIGJhbGFuY2VbY3VycmVuY3ldKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydhdmFpbGFibGUnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoJ2JhbGFuY2UnIGluIGJhbGFuY2VbY3VycmVuY3ldKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsnYmFsYW5jZSddWyd2YWx1ZSddKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoYWNjb3VudFsndG90YWwnXSkge1xuICAgICAgICAgICAgICAgIGlmIChhY2NvdW50WydmcmVlJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2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2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ2RhdGUnXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbJ2RhdGUnXSksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2VfaW50J10gLyAxMDAwMDAuMCxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50X2ludCddIC8gMTAwMDAwMDAwLjAsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ2RhdGEnXVsndHJhZGVzJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnYW1vdW50X2ludCc6IHBhcnNlSW50IChhbW91bnQgKiAxMDAwMDAwMDApLFxuICAgICAgICAgICAgJ2ZlZV9jdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICd0eXBlJzogKHNpZGUgPT09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlX2ludCddID0gcGFyc2VJbnQgKHByaWNlICogMTAwMDAwLjApO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0TWFya2V0TW9uZXlPcmRlckFkZCAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnZGF0YSddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1hcmtldE1vbmV5T3JkZXJDYW5jZWw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W5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2JsZXV0cmFkZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdCbGV1dHJhZGUnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdCUicsIC8vIEJyYXppbFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDMwMzAwMC1iNjAyZGJlNi05NzZkLTExZTctOTU2ZC0zNmM1MDQ5YzAxZTcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ21hcmtldCc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL0FQSScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2hlbHAvZmVlc19hbmRfZGVhZGxpbmVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEEnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQklUQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0MnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVENEJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NETic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEFNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENSJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VGTCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGSkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlNUWSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05MRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVE1MJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PTkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PT04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMC4wMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPUyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVkMnOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09LJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBNJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSREQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0xSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUQVJUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NMRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUk9MTCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZSQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFZQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dEQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdJbnN1ZmZpY2llbnQgZnVuZHMhJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJ0ludmFsaWQgT3JkZXIgSUQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJ0ludmFsaWQgYXBpa2V5IG9yIGFwaXNlY3JldCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ3BhcnNlT3JkZXJTdGF0dXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydJc0FjdGl2ZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgbGV0IHN0YXR1c2VzID0ge1xuICAgICAgICAgICAgJ09LJzogJ2Nsb3NlZCcsXG4gICAgICAgICAgICAnT1BFTic6ICdvcGVuJyxcbiAgICAgICAgICAgICdDQU5DRUxFRCc6ICdjYW5jZWxlZCcsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChzdGF0dXMgaW4gc3RhdHVzZXMpIHtcbiAgICAgICAgICAgIHJldHVybiBzdGF0dXNlc1tzdGF0dXNdO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgcmV0dXJuIHN0YXR1cztcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgLy8gUG9zc2libGUgcGFyYW1zXG4gICAgICAgIC8vIG9yZGVyc3RhdHVzIChBTEwsIE9LLCBPUEVOLCBDQU5DRUxFRClcbiAgICAgICAgLy8gb3JkZXJ0eXBlIChBTEwsIEJVWSwgU0VMTClcbiAgICAgICAgLy8gZGVwdGggKG9wdGlvbmFsLCBkZWZhdWx0IGlzIDUwMCwgbWF4IGlzIDIwMDAwKVxuICAgICA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aWV4LmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JyYXppbGlleC5jb20vZXhjaGFuZ2UvYXBpLnBocCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tL2V4Y2hhbmdlL2ZlZXMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5L3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21wbGV0ZV9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChjdXJyZW5jaWVzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpZF07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gdGhpcy5zYWZlSW50ZWdlciAoY3VycmVuY3ksICdkZWNpbWFsJyk7XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHRoaXMuc2FmZUludGVnZXIgKGN1cnJlbmN5LCAnYWN0aXZlJykgPT09IDE7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgICAgIGxldCBtYWludGVuYW5jZSA9IHRoaXMuc2FmZUludGVnZXIgKGN1cnJlbmN5LCAndW5kZXJfbWFpbnRlbmFuY2UnKTtcbiAgICAgICAgICAgIGlmIChtYWludGVuYW5jZSAhPT0gMCkge1xuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdtYWludGVuYW5jZSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgY2FuV2l0aGRyYXcgPSB0aGlzLnNhZmVJbnRlZ2VyIChjdXJyZW5jeSwgJ2lzX3dpdGhkcmF3YWxfYWN0aXZlJykgPT09IDE7XG4gICAgICAgICAgICBsZXQgY2FuRGVwb3NpdCA9IHRoaXMuc2FmZUludGVnZXIgKGN1cnJlbmN5LCAnaXNfZGVwb3NpdF9hY3RpdmUnKSA9PT0gMTtcbiAgICAgICAgICAgIGlmICghY2FuV2l0aGRyYXcgfHwgIWNhbkRlcG9zaXQpXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbldpdGhkcmF3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd0eFdpdGhkcmF3YWxGZWUnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogY2FuRGVwb3NpdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsndHhEZXBvc2l0RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5BbW91bnRUcmFkZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ01pbldpdGhkcmF3YWwnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5EZXBvc2l0J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICgpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBxdW90ZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnYWN0aXZlJykgPT09IDE7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRlJ107XG4gICAgICAgIHRpY2tlciA9IHRpY2tlclsndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaGVzdEJpZDI0JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd2VzdEFzazI0Jyks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pdCB0aGlzLnB1YmxpY0dldFRpY2tlck1hcmtldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB0aWNrZXIgPSB7XG4gICAgICAgICAgICAnZGF0ZSc6IHRoaXMubWlsbGlzZWNvbmRzICgpLFxuICAgICAgICAgICAgJ3RpY2tlcic6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB7XG4gICAgICAgICAgICAgICAgJ2RhdGUnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAgICAgJ3RpY2tlcic6IHRpY2tlcnNbaWRdLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICA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tcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnbWFya2V0Jyk7XG4gICAgICAgICAgICBpZiAobWFya2V0SWQpXG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ3RpbWVzdGFtcCcpO1xuICAgICAgICBpZiAoIXRpbWVzdGFtcClcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0b3RhbCcsIDAuMCk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgbGV0IGZpbGxlZFBlcmNlbnRhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcm9ncmVzcycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50ICogZmlsbGVkUGVyY2VudGFnZTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuYW1vdW50VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50IC0gZmlsbGVkKTtcbiAgICAgICAgbGV0IGluZm8gPSBvcmRlcjtcbiAgICAgICAgaWYgKCdpbmZvJyBpbiBpbmZvKVxuICAgICAgICAgICAgaW5mbyA9IG9yZGVyWydpbmZvJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnb3JkZXJfbnVtYmVyJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2ZlZScpLFxuICAgICAgICAgICAgJ2luZm8nOiBpbmZvLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5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V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlSW50ZWdlciAocmVzcG9uc2UsICdzdWNjZXNzJyk7XG4gICAgICAgICAgICBpZiAoc3VjY2VzcyA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ21lc3NhZ2UnKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgQVBJS2V5JylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChtZXNzYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tL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ICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzEyNzU4MDMtNGRmNzU1YTgtYWFhMS0xMWU3LTlhYmItMTFlYzJmYWQ5ZjJkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGNib3guY28uanAvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYnRjYm94LmNvLmpwL2hlbHAvYXNtJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbGx0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2FkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV92aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9KUFknOiB7ICdpZCc6ICdCVEMvSlBZJywgJ3N5bWJvbCc6ICdCVEMvSlBZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0pQWScgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnMTA0JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTA1JzogUGVybWlzc2lvbkRlbmllZCxcbiAgICAgICAgICAgICAgICAnMTA2JzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICcxMDcnOiBJbnZhbGlkT3JkZXIsIC8vIHByaWNlIHNob3VsZCBiZSBhbiBpbnRlZ2VyXG4gICAgICAgICAgICAgICAgJzIwMCc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcyMDEnOiBJbnZhbGlkT3JkZXIsIC8vIGFtb3VudCB0b28gc21hbGxcbiAgICAgICAgICAgICAgICAnMjAyJzogSW52YWxpZE9yZGVyLCAvLyBwcmljZSBzaG91bGQgYmUgWzAgOiAxMDAwMDAwXVxuICAgICAgICAgICAgICAgICcyMDMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICc0MDEnOiBPcmRlck5vdEZvdW5kLCAvLyBjYW5jZWwgY2FuY2VsZWQsIGNsb3NlZCBvciBub24tZXhpc3RlbnQgb3JkZXJcbiAgICAgICAgICAgICAgICAnNDAyJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZ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CB1c2UgaGV1cmlzdGljXG4gICAgICAgIGlmICh0eXBlb2Ygc3RhdHVzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nICE9PSAndW5kZWZpbmVkJyAmJiByZW1haW5pbmcgPT09IDApXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIGxldCB0cmFkZXMgPSB1bmRlZmluZWQ7IC8vIHRvZG86IHRoaXMucGFyc2VUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6ICdCVEMvSlBZJyxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHRyYWRlcyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2w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vbS9hcGlfdHJhZGVfdjEucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjY2hpbmEuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbS9hcGlkb2NzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwbHVzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnlkYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eVN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEljZWJlcmdPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0U3RvcE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbE9yZGVyMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y2NueScsICdzeW1ib2wnOiAnQlRDL0NOWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3B1YmxpYycsICdwbHVzJzogZmFsc2UgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0NOWSc6IHsgJ2lkJzogJ2x0Y2NueScsICdzeW1ib2wnOiAnTFRDL0NOWScsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3B1YmxpYycsICdwbHVzJzogZmFsc2UgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0JUQyc6IHsgJ2lkJzogJ2x0Y2J0YycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAnYXBpJzogJ3B1YmxpYycsICdwbHVzJzogZmFsc2UgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0NOWSc6IHsgJ2lkJzogJ2JjY2NueScsICdzeW1ib2wnOiAnQkNIL0NOWScsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3BsdXMnLCAncGx1cyc6IHRydWUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0NOWSc6IHsgJ2lkJzogJ2V0aGNueScsICdzeW1ib2wnOiAnRVRIL0NOWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3BsdXMnLCAncGx1cyc6IHRydWUgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiAnYWxsJyxcbiAgICAgICAgfSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXldO1xuICAgICAgICAgICAgbGV0IHBhcnRzID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGlkID0gcGFydHNbMV07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAg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XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFyYW1zJzogWyBpZCwgbWFya2V0IF0sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWljcm9zZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcCA9IFtdO1xuICAgICAgICAgICAgaWYgKCdwYXJhbXMnIGluIHBhcmFtcylcbiAgICAgICAgICAgICAgICBwID0gcGFyYW1zWydwYXJhbXMnXTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBwID0gcC5qb2luICgnLCcpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSAoXG4gICAgICAgICAgICAgICAgJ3RvbmNlPScgKyBub25jZSArXG4gICAgICAgICAgICAgICAgJyZhY2Nlc3NrZXk9JyArIHRoaXMuYXBpS2V5ICtcbiAgICAgICAgICAgICAgICAnJnJlcXVlc3RtZXRob2Q9JyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArXG4gICAgICAgICAgICAgICAgJyZpZD0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmbWV0aG9kPScgKyBwYXRoICtcbiAgICAgICAgICAgICAgICAnJnBhcmFtcz0nICsgcFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGExJyk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogJ0Jhc2ljICcgKyB0aGlzLnN0cmluZ1RvQmFzZTY0IChhdXRoKSxcbiAgICAgICAgICAgICAgICAnSnNvbi1ScGMtVG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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ICh0cmFkZXMgY2FjaGVkIGZvciAyIHNlY29uZHMpXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjkxNDI5MTEtMGUxYWNmYzItN2Q1Yy0xMWU3LTk4YzQtMDdkOTUzMmIyOWQ3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5idGNtYXJrZXRzLm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJ0Y21hcmtldHMubmV0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL2J0Y21hcmtldHMubmV0L2RhdGEnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Y21hcmtldHMubmV0LycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQlRDTWFya2V0cy9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2lkfS90cmFkaW5nZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3Q3J5cHRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kdHJhbnNmZXIvd2l0aGRyYXdFRlQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci90cmFkZS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGVCYXRjaCcsIC8vIHRoZXkgcHJvbWlzZSBpdCdzIGNvbWluZyBzb29uLi4uXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0JUQ01hcmtldHMve2lkfS90aWNrQnlUaW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDL0FVRCcsICdzeW1ib2wnOiAnQlRDL0FVRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdBVUQnLCAnbWFrZXInOiAwLjAwODUsICd0YWtlcic6IDAuMDA4NSwgJ2xpbWl0cyc6IHsgJ2Ftb3VudCc6IHsgJ21pbic6IDAuMDAxLCAnbWF4JzogdW5kZWZpbmVkIH19LCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdMVEMvQVVEJzogeyAnaWQnOiAnTFRDL0FVRCcsICdzeW1ib2wnOiAnTFRDL0FVRCcsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdBVUQnLCAnbWFrZXInOiAwLjAwODUsICd0YWtlcic6IDAuMDA4NSwgJ2xpbWl0cyc6IHsgJ2Ftb3VudCc6IHsgJ21pbic6IDAuMDAxLCAnbWF4JzogdW5kZWZpbmVkIH19LCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdFVEgvQVVEJzogeyAnaWQnOiAnRVRIL0FVRCcsICdzeW1ib2wnOiAnRVRIL0FVRCcsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdBVUQnLCAnbWFrZXInOi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gnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJzogMC4wMDIyLCAndGFrZXInOiAwLjAwMjIsICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMSwgJ21heCc6IHVuZGVmaW5lZCB9fX0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ21pbnV0ZScsXG4gICAgICAgICAgICAgICAgJzFoJzogJ2hvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICczJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICc2JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IG11bHRpcGxpZXIgPSAxMDAwMDAwMDA7XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10gLyBtdWx0aXBsaWVyKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsncGVuZGluZ0Z1bmRzJ10gLyBtdWx0aXBsaWVyKTtcbiAgICAgICAgICAgIGxldCBmcmVlID0gdG90YWwgLSB1c2VkO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBtdWx0aXBsaWVyID0gMTAwMDAwMDAwOyAvLyBmb3IgcHJpY2UgYW5kIHZvbHVtZVxuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgb2hsY3ZbMF0sXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdlsxXSkgLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgcGFyc2VGbG9hdCAob2hsY3ZbMl0pIC8gbXVsdGlwbGllcixcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WzNdKSAvIG11bHRpcGxpZXIsXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdls0XSkgLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgcGFyc2VGbG9hdCAob2hsY3ZbNV0pIC8gbXVsdGlwbGllcixcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsI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9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddIC8gbXVsdGlwbGllcixcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0cmFkZVsnZmVlJ10gLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsndm9sdW1lJ10gLyBtdWx0aXBsaWVyLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVySWQnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU15VHJhZGVzICh0cmFkZXMsIG1hcmtldCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0cmFkZSA9IHRoaXMucGFyc2VNeVRyYWRlICh0cmFkZXNbaV0sIG1hcmtldCk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodHJhZGUpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVu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XIsICd2b2x1bWUnKSAvIG11bHRpcGxpZXI7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcGVuVm9sdW1lJywgMC4wKSAvIG11bHRpcGxpZXI7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLnBhcnNlTXlUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSwgbWFya2V0KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgcm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NlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIHF1b3Rlc1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmkgKyBcIlxcblwiICsgbm9uY2UgKyBcIlxcblwiO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdhcGlrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAndGltZXN0YW1wJzogbm9uY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzWydzaWduYXR1cmUnXSA9IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JDb2RlJyk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgaW4gdGhpcy5leGNlcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgRXhjZXB0aW9uQ2xhc3MgPSB0aGlzLmV4Y2VwdGlvbnNbZXJyb3JdO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbkNsYXNzIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsa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S1jMjE0MjQ0NC0xYzViLTExZTgtOTFlMi1hNGQ5MGRjODVmZTguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vYXBpLmJ0Y3RyYWRlLmltL2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAncmVzdCc6ICdodHRwczovL2FwaS5idGN0cmFkZS5pbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGN0cmFkZS5pbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGN0cmFkZS5pbS9oZWxwLmFwaS5odG1sJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5idGN0cmFkZS5pbS9zcGVuZC5wcmljZS5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIG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BpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVhbHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9zZWxsL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqYXBhbl9zdGF0L2hpZ2gve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215X29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbW92ZS9vcmRlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvVUFIJzogeyAnaWQnOiAnYmNoX3VhaCcsICdzeW1ib2wnOiAnQkNIL1VBSCcsICdiYXNlJzogJ0JDS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ogJ1VBSCcgfSxcbiAgICAgICAgICAgICAgICAnWkVDL1VBSCc6IHsgJ2lkJzogJ3plY191YWgnLCAnc3ltYm9sJzogJ1pFQy9VQUgnLCAnYmFzZSc6ICdaRUMnLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlZDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNpZ25JbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByaXZhdGVQb3N0QXV0aCAoKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGlmICgnYWNjb3VudHMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudHMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYWNjb3VudHMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IGFjY291bnRzW2JdO1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGFjY291bnRbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChhY2NvdW50WydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IGJpZHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc0J1eVN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYXNrcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzU2VsbFN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChiaWRzKSB7XG4gICAgICAgICAgICBpZiAoJ2xpc3QnIGluIGJpZHMpXG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydiaWRzJ10gPSBiaWRzWydsaXN0J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFza3MpIHtcbiAgICAgICAgICAgIGlmICgnbGlzdCcgaW4gYXNrcylcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2Fza3MnXSA9IGFza3NbJ2xpc3QnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnY3VycmVuY3lfdHJhZGUnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEphcGFuU3RhdEhpZ2hTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsndHJhZGVzJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdGlja2VyTGVuZ3RoID0gdGlja2VyLmxlbmd0aDtcbiAgICAgICAgaWYgKHRpY2tlckxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGxldCBzdGFydCA9IE1hdGgubWF4ICh0aWNrZXJMZW5ndGggLSA0OCwgMCk7XG4gICAgICAgICAgICBmb3IgKGxldCB0ID0gc3RhcnQ7IHQgPCB0aWNrZXIubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FuZGxlID0gdGlja2VyW3RdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydvcGVuJ10gPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ29wZW4nXSA9IGNhbmRsZVsxXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2hpZ2gnXSA9PT0gJ3VuZGVmaW5lZCcpIHx8IChyZXN1bHRbJ2hpZ2gnXSA8IGNhbmRsZVsyXSkpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnaGlnaCddID0gY2FuZGxlWzJdO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHJlc3VsdFsnbG93J10gPT09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0Wydsb3cnXSA+IGNhbmRsZVszXSkpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnbG93J10gPSBjYW5kbGVbM107XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddID0gLWNhbmRsZVs1XTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnYmFzZVZvbHVtZSddIC09IGNhbmRsZVs1XTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBsYXN0ID0gdGlja2VyTGVuZ3RoIC0gMTtcbiAgICAgICAgICAgIHJlc3VsdFsnbGFzdCddID0gdGlja2VyW2xhc3RdWzRdO1xuICAgICAgICAgICAgcmVzdWx0WydjbG9zZSddID0gcmVzdWx0WydsYXN0J107XG4gICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9IC0xICogcmVzdWx0WydiYXNlVm9sdW1lJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb252ZXJ0Q3lyaWxsaWNNb250aE5hbWVUb1N0cmluZyAoY3lyaWxsaWMpIHtcbiAgICAgICAgbGV0IG1vbnRocyA9IHtcbiAgICAgICAgICAgICfRj9C90LLQsNGA0Y8nOiAnMDEnLFxuICAgICAgICAgICAgJ9GE0LXQstGA0LDQu9GPJzogJzAyJyxcbiAgICAgICAgICAgICfQvNCw0YDRgtCwJzogJzAzJyxcbiAgICAgICAgICAgICfQsNC/0YDQtdC70Y8nOiAnMDQnLFxuICAgICAgICAgICAgJ9C80LDRjyc6ICcwNScsXG4gICAgICAgICAgICAn0LjRjtC90Y8nOiAnMDYnLFxuICAgICAgICAgICAgJ9C40Y7Qu9GPJzogJzA3JyxcbiAgICAgICAgICAgICfQsNCy0LPRg9GB0YLQsCc6ICcwOCcsXG4gICAgICAgICAgICAn0YHQtdC90YLRj9Cx0YDRjyc6ICcwOScsXG4gICAgICAgICAgICAn0L7QutGC0Y/QsdGA0Y8nOiAnMTAnLFxuICAgICAgICAgICAgJ9C90L7Rj9Cx0YDRjyc6ICcxMScsXG4gICAgICAgICAgICAn0LTQtdC60LDQsdGA0Y8nOiAnMTInLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgbW9udGggPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChjeXJpbGxpYyBpbiBtb250aHMpXG4gICAgICAgICAgICBtb250aCA9IG1vbnRoc1tjeXJpbGxpY107XG4gICAgICAgIHJldHVybiBtb250aDtcbiAgICB9XG5cbiAgICBwYXJzZUN5cmlsbGljRGF0ZXRpbWUgKGN5cmlsbGljKSB7XG4gICAgICAgIGxldCBwYXJ0cyA9IGN5cmlsbGljLnNwbGl0ICgnICcpO1xuICAgICAgICBsZXQgZGF5ID0gcGFydHNbMF07XG4gICAgICAgIGxldCBtb250aCA9IHRoaXMuY29udmVydEN5cmlsbGljTW9udGhOYW1lVG9TdHJpbmcgKHBhcnRzWzFdKTtcbiAgICAgICAgaWYgKCFtb250aClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBwYXJzZVRyYWRlKCkgdW5kZWZpbmVkIG1vbnRoIG5hbWU6ICcgKyBjeXJpbGxpYyk7XG4gICAgICAgIGxldCB5ZWFyID0gcGFydHNbMl07XG4gICAgICAgIGxldCBobXMgPSBwYXJ0c1s0XTtcbiAgICAgICAgbGV0IGhtc0xlbmd0aCA9IGhtcy5sZW5ndGg7XG4gICAgICAgIGlmIChobXNMZW5ndGggPT09IDcpIHtcbiAgICAgICAgICAgIGhtcyA9ICcwJyArIGhtcztcbiAgICAgICAgfVxuICAgICAgICBpZiAoZGF5Lmxlbmd0aCA9PT0gMSkge1xuICAgICAgICAgICAgZGF5ID0gJzAnICsgZGF5O1xuICAgICAgICB9XG4gICAgICAgIGxldCB5bWQgPSBbIHllYXIsIG1vbnRoLCBkYXkgXS5qb2luICgnLScpO1xuICAgICAgICBsZXQgeW1kaG1zID0geW1kICsgJ1QnICsgaG1zO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHltZGhtcyk7XG4gICAgICAgIC8vIHNlcnZlciByZXBvcnRzIGxvY2FsIHRpbWUsIGFkanVzdCB0byBVVENcbiAgICAgICAgbGV0IG1kID0gWyBtb250aCwgZGF5IF0uam9pbiAoJycpO1xuICAgICAgICBtZCA9IHBhcnNlSW50IChtZCk7XG4gICAgICAgIC8vIGEgc3BlY2lhbCBjYXNlIGZvciBEU1RcbiAgICAgICAgLy8gc3VidHJhY3QgMiBob3VycyBkdXJpbmcgd2ludGVyXG4gICAgICAgIGlmIChtZCA8IDMyNSB8fCBtZCA+IDEwMjgpXG4gICAgICAgICAgICByZXR1cm4gdGltZXN0YW1wIC0gNzIwMDAwMDtcbiAgICAgICAgLy8gc3VidHJhY3QgMyBob3VycyBkdXJpbmcgc3VtbWVyXG4gICAgICAgIHJldHVybiB0aW1lc3RhbXAgLSAxMDgwMDAwMDtcbiAgICB9XG5cbiAgICBwYXJzZVR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GUgdHdvIHNpZGVzIG9mIHRoZSBmaWxsKVxuICAgICAgICAvLyBkZWR1cGxpY2F0ZSB0cmFkZXMgZm9yIHRoYXQgcmVhc29uXG4gICAgICAgIGxldCB0cmFkZXMgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByZXNwb25zZS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlW2ldWydpZCddICUgMikge1xuICAgICAgICAgICAgICAgIHRyYWRlcy5wdXNoIChyZXNwb25zZVtpXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHRyYWRlcywgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSkgKyAnSWQnO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnY291bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY3VycmVuY3kxJzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXNbbWV0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VyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ291dF9vcmRlcl9pZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gYm9keSArIHRoaXMuc2VjcmV0O1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAncHVibGljLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdhcGktc2lnbic6IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKGF1dGgpLCAnc2hhMjU2JyksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tL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zI3OTkyNzA5LTE4ZTE1NjQ2LTY0YTMtMTFlNy05ZmEyLWIwOTUwZWM3NzEyZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYnRjdHVyay5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y3R1cmsuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9CVENUcmFkZXIvYnJva2VyLWFwaS1kb2NzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY2RhdGEnLCAvLyA/bGFzdD1DT1VOVFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLCAgIC8vID9sYXN0PUNPVU5UIChtYXggNTApXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyVHJhbnNhY3Rpb25zJywgLy8gP29mZnNldD0wJmxpbWl0PTI1JnNvcnQ9YXNjXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgIC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G4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZXJhZ2UnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGlja2Vycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydwYWlyJ107XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbc3ltYm9sXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMuZmV0Y2hUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoc3ltYm9sIGluIHRpY2tlcnMpXG4gICAgICAgICAgICByZXN1bHQgPSB0aWNrZXJzW3N5bWJvbF07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc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UlMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2Mzg1LTlmZGNjOThjLTVlZDYtMTFlNy04ZjE0LTY2ZDVlNWNkNDdlNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9idGMteC5pcy9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGMteC5pcycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2J0Yy14LmlzL2N1c3RvbS9hcGktZG9jdW1lbnQuaHRtbCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3tpZH0ve2xpbWl0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3tpZH0ve2xpbWl0fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdidGMvdXNkJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ2J0Yy9ldXInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZXNbY3VycmVuY3ldLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnbGltaXQnXSA9IGxpbWl0OyAvLyAxMDAwXG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoSWRMaW1pdCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbCcpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSAod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W5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlciddWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbCAoeyAnb3JkZXInOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBhcGk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ01ldGhvZCc6IHBhdGgudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ05vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbi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lcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0MTItNTY3YjFlYjQtNWVkNy0xMWU3LTk0YTgtZmY2YTM4ODRmNmM1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2J4LmluLnRoL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J4LmluLnRoJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnguaW4udGgvaW5mby9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLCAvLyB0aWNrZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbGdyb3VwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxscGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15aXNzdWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15b3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWV4ZXJjaXNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24taGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwtaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdEQVMnOiAnREFTSCcsXG4gICAgICAgICAgICAgICAgJ0RPRyc6ICdET0dFJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyaW5nICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyaW5nX2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnc2Vjb25kYXJ5X2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3ByaW1hcnlfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsndG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcmluZyc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF9wcmljZScpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydvcmRlcmJvb2snXVsnYmlkcyddWydoaWdoYmlkJ10pLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ29yZGVyYm9vayddWydhc2tzJ11bJ2hpZ2hiaWQnXSksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnY2hhbmdlJyksXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lXzI0aG91cnMnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldCAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRp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uc2FmZVN0cmluZyAob3JkZXIsICdwYWlyaW5nX2lkJyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIG1hcmtldElkICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAobWFya2V0SWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ2RhdGUnXSk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JhdGUnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcGVuT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID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ncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5hcGlLZXkgKyBub25jZS50b1N0cmluZyAoKSArIHRoaXMuc2VjcmV0O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKGF1dGgpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICAgICAgLy8gdHdvZmE6IHRoaXMudHdvZmEsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGF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aW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJCb29rcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQzMy0xNjg4MWY5MC01ZWQ4LTExZTctOTJmOC0zZDkyY2M3NDdhNmMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vYy1jZXguY29tL3QnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpX3B1Yi5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9jLWNleC5jb20vdC9hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYy1jZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYy1jZXguY29tLz9pZD1hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb2lubmFtZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd2b2x1bWVfe2NvaW59JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZWRpc3RyaWJ1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bGxvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9wZW5vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcmhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0lPVCc6ICdJb1Rjb2luJyxcbiAgICAgICAgICAgICAgICAnQkxDJzogJ0NyeXB0b2J1bGxjb2luJyxcbiAgICAgICAgICAgICAgICAnWElEJzogJ0ludGVybmF0aW9uYWxEaWFtb25kJyxcbiAgICAgICAgICAgICAgICAnTFVYJzogJ0x1eG1pJyxcbiAgICAgICAgICAgICAgICAnQ1JDJzogJ0NvcmVDb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy53ZWJHZXRQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncGFpcnMnXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJy0nKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBpZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgLy8gYW4gYWx0ZXJuYXRpdmUgZG9jdW1lbnRlZCBwYXJzZXJcbiAgICAgICAgLy8gICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICAvLyAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAvLyAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtwXTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAvLyAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgIC8vICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAvLyAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgIC8vICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgLy8gICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIC8vICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgIC8vICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgIC8vICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAvLyAgICAgICAgIH0pO1xuICAgICAgICAvLyAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0R2V0YmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBiYWxhbmNlWydDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICA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IGZldGNoT3JkZXJCb29rcyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9va3MgPSB7fTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdWxsb3JkZXJib29rICgpO1xuICAgICAgICBsZXQgdHlwZXMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2VbJ3Jlc3VsdCddKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0eXBlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHR5cGUgPSB0eXBlc1tpXTtcbiAgICAgICAgICAgIGxldCBiaWRhc2tzID0gcmVzcG9uc2VbJ3Jlc3VsdCddW3R5cGVdO1xuICAgICAgICAgICAgbGV0IGJpZGFza3NCeU1hcmtldElkID0gdGhpcy5ncm91cEJ5IChiaWRhc2tzLCAnTWFya2V0Jyk7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWRzID0gT2JqZWN0LmtleXMgKGJpZGFza3NCeU1hcmtldElkKTtcbiAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgbWFya2V0SWRzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gbWFya2V0SWRzW2pdO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgc2lkZSA9IHR5cGU7XG4gICAgICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtzeW1ib2xdO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBpbnZlcnRlZElkID0gcXVvdGUgKyAnLScgKyBiYXNlO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaW52ZXJ0ZWRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaW52ZXJ0ZWRJZF07XG4gICAgICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghKHN5bWJvbCBpbiBvcmRlcmJvb2tzKSlcbiAgICAgICAgICAgICAgICAgICAgb3JkZXJib29rc1tzeW1ib2xdID0ge307XG4gICAgICAgICAgICAgICAgb3JkZXJib29rc1tzeW1ib2xdW3NpZGVdID0gYmlkYXNrc0J5TWFya2V0SWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAob3JkZXJib29rcyk7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNba107XG4gICAgICAgICAgICByZXN1bHRba2V5XSA9IHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9va3Nba2V5XSwgdW5kZWZpbmVkLCAnYnV5JywgJ3NlbGwnLCAnUmF0ZScsICdRdWFudGl0eScpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybi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c3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlcmNhc2Uuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0TWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsndGlja2VyJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnSWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ09yZGVyVHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ1ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ1F1YW50aXR5J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0aGlzdG9yeSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgICAgICdkZXB0aCc6IDEwMCxcbiAgICAgICAgfSwgcG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kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJykgfTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2EnOiAnZ2V0JyArIHBhdGgsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcykgKyAnLmpzb24nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsIC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uXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGNleCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY2V4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0NFWC5JTycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnR0InLCAnRVUnLCAnQ1knLCAnUlUnIF0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDQyLThkZGMzM2IwLTVlZDgtMTFlNy04Yjk4LWY3ODZhZWYwZjNjOS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9jZXguaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY2V4LmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY2V4LmlvL2NleC1hcGknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jZXguaW8vZmVlLXNjaGVkdWxlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY2V4LmlvL2xpbWl0cy1jb21taXNzaW9ucycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfbGltaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlcy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdi9oZC97eXl5eW1tZGR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb252ZXJ0L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Vfc3RhdHMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfb3JkZXJzX3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyY2hpdmVkX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfcmVwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbG9zZV9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9teWZlZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl90eC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX3Bvc2l0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE2IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdVU0QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnRVVSJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1JVQic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdHQlAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdVU0QnOiBhbW91bnQgPT4gYW1vdW50ICogMC4wMzUgKyAwLjI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ0VVUic6IGFtb3VudCA9PiBhbW91bnQgKiAwLjAzNSArIDAuMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnUlVCJzogYW1vdW50ID0+IGFtb3VudCAqIDAuMDUgKyAxNS41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdHQlAnOiBhbW91bnQgPT4gYW1vdW50ICogMC4wMzUgKyAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTE0nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeUxpbWl0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sMSddICsgJy8nICsgbWFya2V0WydzeW1ib2wyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbWFya2V0WydtaW5Mb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogLTEgKiBNYXRoLmxvZzEwIChtYXJrZXRbJ21pbkxvdFNpemUnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluTG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnbWF4TG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pblByaWNlJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heFByaWNlJyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluTG90U2l6ZVMyJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IG9tbWl0ZWQgPSBbICd1c2VybmFtZScsICd0aW1lc3RhbXAnIF07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2UsIG9tbWl0ZWQpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdhdmFpbGFibGUnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdvcmRlcnMnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9va1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWyd0aW1lc3RhbXAnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHRpbWVzdGFtcCk7XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBvaGxjdlswXSAqIDEwMDAsXG4gICAgICAgICAgICBvaGxjdlsxXSxcbiAgICAgICAgICAgIG9obGN2WzJdLFxuICAgICAgICAgICAgb2hsY3ZbM10sXG4gICAgICAgICAgICBvaGxjdls0XSxcbiAgICAgICAgICAgIG9obGN2WzVdLFxuICAgICAgICBdO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT0hMQ1YgKHN5bWJvbCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGlmICghc2luY2UpXG4gICAgICAgICAgICBzaW5jZSA9IHRoaXMubWlsbGlzZWNvbmRzICgpIC0gODY0MDAwMDA7IC8vIHllc3RlcmRheVxuICAgICAgICBsZXQgeW1kID0gdGhpcy55bWQgKHNpbmNlKTtcbiAgICAgICAgeW1kID0geW1kLnNwbGl0ICgnLScpO1xuICAgICAgICB5bWQgPSB5bWQuam9pbiAoJycpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3l5eXltbWRkJzogeW1kLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9obGN2SGRZeXl5bW1kZFBhaXIgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGtleSA9ICdkYXRhJyArIHRoaXMudGltZWZyYW1lc1t0aW1lZnJhbWVdO1xuICAgICAgICBsZXQgb2hsY3ZzID0gSlNPTi5wYXJzZSAocmVzcG9uc2Vba2V5XSk7XG4gICAgICAgIHJldHVybiB0aGlzLnB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ICAgICAgICAgICdjdXJyZW5jaWVzJzogY3VycmVuY2llcy5qb2luICgnLycpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydwYWlyJ10ucmVwbGFjZSAoJzonLCAnLycpO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRl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1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBmb3IgbWFya2V0IGJ1eSBDRVguaW8gcmVxdWlyZXMgdGhlIGFtb3VudCBvZiBxdW90ZSBjdXJyZW5jeSB0byBzcGVuZFxuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFwcmljZSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICgnRm9yIG1hcmtldCBidXkgb3JkZXJzICcgKyB0aGlzLmlkICsgXCIgcmVxdWlyZXMgdGhlIGFtb3VudCBvZiBxdW90ZSBjdXJyZW5jeSB0byBzcGVuZCwgdG8gY2FsY3VsYXRlIHByb3BlciBjb3N0cyBjYWxsIGNyZWF0ZU9yZGVyIChzeW1ib2wsICdtYXJrZXQnLCAnYnV5JywgYW1vdW50LCBwcmljZSlcIik7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudCAqIHByaWNlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb3JkZXJbJ29yZGVyX3R5cGUnXSA9IHR5cGU7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml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tb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndGE6JyArIG1hcmtldFsncXVvdGUnXSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0dGE6JyArIG1hcmtldFsncXVvdGUnXSk7XG4gICAgICAgICAgICBsZXQgYmFzZUZlZSA9ICdmYTonICsgbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICBsZXQgYmFzZVRha2VyRmVlID0gJ3RmYTonICsgbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICBsZXQgcXVvdGVGZWUgPSAnZmE6JyArIG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZVRha2VyRmVlID0gJ3RmYTonICsgbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgbGV0IGZlZVJhdGUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0cmFkaW5nRmVlTWFrZXInKTtcbiAgICAgICAgICAgIGlmICghZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndHJhZGluZ0ZlZVRha2VyJywgZmVlUmF0ZSk7XG4gICAgICAgICAgICBpZiAoZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlIC89IDEwMC4wOyAvLyBjb252ZXJ0IHRvIG1hdGhlbWF0aWNhbGx5LWNvcnJlY3QgcGVyY2VudGFnZSBjb2VmZmljaWVudHM6IDEuMCA9IDEwMCVcbiAgICAgICAgICAgIGlmICgoYmFzZUZlZSBpbiBvcmRlcikgfHwgKGJhc2VUYWtlckZlZSBpbiBvcmRlcikpIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZUZlZUNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsIGJhc2VGZWUpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgYmFzZUZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBiYXNlRmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgYmFzZVRha2VyRmVlKTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnYmFzZSddLFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IGZlZVJhdGUsXG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogYmFzZUZlZUNvc3QsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoKHF1b3RlRmVlIGluIG9yZGVyKSB8fCAocXVvdGVUYWtlckZlZSBpbiBvcmRlcikpIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVGZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCBxdW90ZUZlZSk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBxdW90ZUZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBxdW90ZUZlZUNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsIHF1b3RlVGFrZXJGZWUpO1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IGZlZVJhdGUsXG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogcXVvdGVGZWVDb3N0LFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb3N0KVxuICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgc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ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblx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0cyA9IGNsYXNzIGNvYmluaG9vZCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29iaW5ob29kJyxcbiAgICAgICAgICAgICduYW1lJzogJ0NPQklOSE9PRCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1RXJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwIC8gMTAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZURlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAvLyB0aGUgZmlyc3QgdHdvIGRvbid0IHNlZW0gdG8gd29yayBhdCBhbGxcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICczaCc6ICczaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFEJyxcbiAgICAgICAgICAgICAgICAnN2QnOiAnN0QnLFxuICAgICAgICAgICAgICAgICcxNGQnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzU3NTU1NzYtZGVlMDJlNWMtMDg3OC0xMWU4LTk4OWYtMTU5NWQ4MGJhNDdmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL2FwaS5jb2Jpbmhvb2QuY29tL3YxJyxcbiAgICAgICAgICAgICAgICAgICAgJ3dzJzogJ3dzczovL2ZlZWQuY29iaW5ob29kLmNvbScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29iaW5ob29kLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvYmluaG9vZC5naXRodWIuaW8vYXBpLXB1YmxpYycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnc3lzdGVtJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZXNzYWdlcy97bWVzc2FnZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2FkbWluJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtL21lc3NhZ2VzL3ttZXNzYWdlX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwYXRjaCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeXN0ZW0vbWVzc2FnZXMve21lc3NhZ2VfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeXN0ZW0vbWVzc2FnZXMve21lc3NhZ2VfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdHJhZGluZ19wYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyYm9va3Mve3RyYWRpbmdfcGFpcl9pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RpY2tlcnMve3RyYWRpbmdfcGFpcl9pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90cmFkZXMve3RyYWRpbmdfcGFpcl9pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXJ0L2NhbmRsZXMve3RyYWRpbmdfcGFpcl9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMve29yZGVyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMve29yZGVyX2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvdHJhZGVzL3t0cmFkZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2RlcG9zaXRfYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvd2l0aGRyYXdhbF9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2Fscy97d2l0aGRyYXdhbF9pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2RlcG9zaXRzL3tkZXBvc2l0X2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9kZXBvc2l0X2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L3dpdGhkcmF3YWxfYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvb3JkZXJzL3tvcmRlcl9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldEN1cnJlbmNpZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWydjdXJyZW5jaWVzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgbWluVW5pdCA9IHRoaXMuc2FmZUZsb2F0IChjdXJyZW5jeSwgJ21pbl91bml0Jyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmlhdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGN1cnJlbmN5WydtaW5fdW5pdCddKSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1pblVuaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1pblVuaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZSc6IHRoaXMuc2FmZUZsb2F0IChjdXJyZW5jeSwgJ3dpdGhkcmF3YWxfZmVlJyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZSc6IHRoaXMuc2FmZUZsb2F0IChjdXJyZW5jeSwgJ2RlcG9zaXRfZmVlJyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0VHJhZGluZ1BhaXJzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydyZXN1bHQnXVsndHJhZGluZ19wYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydxdW90ZV9pbmNyZW1lbnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHRoaXMuc2FmZVZhbHVlIChtYXJrZXQsICdpc19hY3RpdmUnLCB0cnVlKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2Jhc2VfbWluX3NpemUnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYmFzZV9tYXhfc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5c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gICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bJ3dlYiddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGhlYWRlcnMgPSB7fTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIC8vIGhlYWRlcnNbJ2RldmljZV9pZCddID0gdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBoZWFkZXJzWydub25jZSddID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGhlYWRlcnNbJ0F1dGhvcml6YXRpb24nXSA9IHRoaXMuYXBpS2V5O1xuICAgICAgICB9XG4gICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBpZiAocXVlcnkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGhlYWRlcnNbJ0NvbnRlbnQtdHlwZSddID0gJ2FwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9VVRGLTgnO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVyb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ZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb2luY2hlY2snLFxuICAgICAgICAgICAgJ25hbWUnOiAnY29pbmNoZWNrJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdKUCcsICdJRCcgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0NjQtM2I1YzNjNzQtNWVkOS0xMWU3LTg0MGUtMzFiMzI5NjhlMWRhLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NvaW5jaGVjay5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5jaGVjay5jb20vZG9jdW1lbnRzL2V4Y2hhbmdlL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9yYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmF0ZS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9sZXZlcmFnZV9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcnMvb3BlbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy90cmFuc2FjdGlvbnNfcGFnaW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGV2ZXJhZ2UvcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MvbWF0Y2hlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZF9tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFua19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9tb25leS97aWR9L2Zhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhbnNmZXJzL3RvX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvZnJvbV9sZXZlcmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVuZGluZy9ib3Jyb3dzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3Mve2lkfS9yZXBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZF9tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3Mve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0pQWSc6IHsgJ2lkJzogJ2J0Y19qcHknLCAnc3ltYm9sJzogJ0JUQy9KUFknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSlBZJyB9LCAvLyB0aGUgb25seSByZWFsIHBhaXJcbiAgICAgICAgICAgICAgICAvLyAnRVRIL0pQWSc6IHsgJ2lkJzogJ2V0aF9qcHknLCAnc3ltYm9sJzogJ0VUSC9KUFknLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnSlBZJyB9LFxuICAgICAgICAgICAgICAgIC8vICdFVEMvSlBZJzogeyAnaWQnOiAnZXRjX2pweScsICdzeW1ib2wnOiAnRVRDL0pQWScsICdiYXNlJzogJ0VUQycsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICAgICAgLy8g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VuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydjcmVhdGVkX2F0J10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3JhdGUnKSxcb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BpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnlTdHJpbmcgPSAnJztcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAocXVlcnkpKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChxdWVyeSkp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9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM2NzcwMzEwLWFkZmE3NjRlLTFjNWEtMTFlOC04ZTA5LTQ0OWRhYWMzZDJmYi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20vY29pbicsXG4gICAgICAgICAgICAgICAgICAgICdyZXN0JzogJ2h0dHBzOi8vYXBpLmNvaW5lZ2cuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5lZ2cuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmNvaW5lZ2cuY29tL2V4cGxhaW4uYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvaW5lZ2cuY29tL2ZlZS5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3F1b3RlfS9hbGxjb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L3RyZW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3F1b3RlfS97YmFzZX0vb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3txdW90ZX0ve2Jhc2V9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3F1b3RlfS97YmFzZX0vZGVwdGguanMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2FkZC97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9jYW5jZWwve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfdmlldy97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9saXN0L3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFTJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBTUUnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPT0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUZDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMSyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlJDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUE0nOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VBQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWic6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSU1MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BHQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKQkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JJTyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEtDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQ0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUVDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNRVQnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lUQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSExCJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNUllDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnMTAzJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTA0JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTA2JzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICcyMDAnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMjAxJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcyMDInOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzIwMyc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzQwMic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdlcnJvck1lc3NhZ2VzJzoge1xuICAgICAgICAgICAgICAgICcxMDAnOiAnUmVxdWlyZWQgcGFyYW1ldGVycyBjYW4gbm90IGJlIGVtcHR5JyxcbiAgICAgICAgICAgICAgICAnMTAxJzogJ0lsbGVnYWwgcGFyYW1ldGVyJyxcbiAgICAgICAgICAgICAgICAnMTAyJzogJ2NvaW4gZG9lcyBub3QgZXhpc3QnLFxuICAgICAgICAgICAgICAgICcxMDMnOiAnS2V5IGRvZXMgbm90IGV4aXN0JyxcbiAgICAgICAgICAgICAgICAnMTA0JzogJ1NpZ25hdHVyZSBkb2VzIG5vdCBtYXRjaCcsXG4gICAgICAgICAgICAgICAgJzEwNSc6ICdJbnN1ZmZpY2llbnQgcGVybWlzc2lvbnMnLFxuICAgICAgICAgICAgICAgICcxMDYnOiAnUmVxdWVzdCBleHBpcmVkKG5vbmNlIGVycm9yKScsXG4gICAgICAgICAgICAgICAgJzIwMCc6ICdMYWNrIG9mIGJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICcyMDEnOiAnVG9vIHNtYWxsIGZvciB0aGUgbnVtYmVyIG9mIHRyYWRpbmcnLFxuICAgICAgICAgICAgICAgICcyMDInOiAnUHJpY2UgbXVzdCBiZSBpbiAwIC0gMTAwMDAwMCcsXG4gICAgICAgICAgICAgICAgJzIwMyc6ICdPcmRlciBkb2VzIG5vdCBleGlzdCcsXG4gICAgICAgICAgICAgICAgJzIwNCc6ICdQZW5kaW5nIG9yZGVyIGFtb3VudCBtdXN0IGJlIGFib3ZlIDAuMDAxIEJUQycsXG4gICAgICAgICAgICAgICAgJzIwNSc6ICdSZXN0cmljdCBwZW5kaW5nIG9yZGVyIHByaWNlcycsXG4gICAgICAgICAgICAgICAgJzIwNic6ICdEZWNpbWFsIHBsYWNlIGVycm9yJyxcbiAgICAgICAgICAgICAgICAnNDAxJzogJ1N5c3RlbSBlcnJvcicsXG4gICAgICAgICAgICAgICAgJzQwMic6ICdSZXF1ZXN0cyBhcmUgdG9vIGZyZXF1ZW50JyxcbiAgICAgICAgICAgICAgICAnNDAzJzogJ05vbi1vcGVuIEFQSScsXG4gICAgICAgICAgICAgICAgJzQwNCc6ICdJUCByZXN0cmljdGlvbiBkb2VzIG5vdCByZXF1ZXN0IHRoZSByZXNvdXJjZScsXG4gICAgICAgICAgICAgICAgJzQwNSc6ICdDdXJyZW5jeSB0cmFuc2FjdGlvbnMgYXJlIHRlbXBvcmFyaWx5IGNsb3NlZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ3F1b3RlSWRzJzogWyAnYnRjJywgJ2V0aCcsICd1c2MnIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcXVvdGVJZHMgPSB0aGlzLm9wdGlvbnNbJ3F1b3RlSWRzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBxdW90ZUlkcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZUlkc1tiXTtcbiAgICAgICAgICAgIGxldCBiYXNlcyA9IGF3YWl0IHRoaXMud2ViR2V0UXVvdGVBbGxjb2luICh7XG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGVJZCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBiYXNlcyA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlICh0aGlzLmlkICsgJyBmZXRjaE1hcmtldHMoKSBmb3IgXCInICsgcXVvdGVJZCArICdcIiByZXR1cm5lZDogXCInICsgdGhpcy5qc29uIChiYXNlcykgKyAnXCInKTtcbiAgICAgICAgICAgIGxldCBiYXNlSWRzID0gT2JqZWN0LmtleXMgKGJhc2VzKTtcbiAgICAgICAgICAgIGxldCBudW1CYXNlSWRzID0gYmFzZUlkcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQmFzZUlkcyA8IDEpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlICh0aGlzLmlkICsgJyBmZXRjaE1hcmtldHMoKSBmb3IgXCInICsgcXVvdGVJZCArICdcIiByZXR1cm5lZDogXCInICsgdGhpcy5qc29uIChiYXNlcykgKyAnXCInKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFzZUlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBiYXNlSWQgPSBiYXNlSWRzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSBiYXNlc1tiYXNlSWRdO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZUlkICsgcXVvdGVJZDtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnY2hhbmdlJyksXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAncXVvdGVWb2wnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcm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ICAgICAgICAgICBsZXQgYmFzZUlkID0gYmFzZUlkc1tpXTtcbiAgICAgICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tiYXNlSWRdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzQnlJZFtpZF07XG4gICAgICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaWdoJzogdGlja2VyWzRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvdyc6IHRpY2tlcls1XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknOiB0aWNrZXJbMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCc6IHRpY2tlclszXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0JzogdGlja2VyWzFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZSc6IHRpY2tlcls4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICd2b2wnOiB0aWNrZXJbNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVWb2wnOiB0aWNrZXJbN10sXG4gICAgICAgICAgICAgICAgICAgIH0sIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAg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xcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdHJhZGVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcnNRdW90ZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgICAgICdxdW90ZSc6IG1hcmtldFsncXVvdGVJZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHRyYWRlcywgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gdGhpcy5vbWl0IChyZXNwb25zZVsnZGF0YSddLCAndWlkJyk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBbIGN1cnJlbmN5SWQsIGFjY291bnRUeXBlIF0gPSBrZXkuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgY29kZSA9IGN1cnJlbmN5SWQ7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3lJZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2N1cnJlbmN5SWRdWydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoIShjb2RlIGluIHJlc3VsdCkpIHtcbiAgICAgICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICdmcmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3RvdGFsJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50VHlwZSA9IChhY2NvdW50VHlwZSA9PT0gJ2xvY2snKSA/ICd1c2VkJyA6ICdmcmVlJztcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXVthY2NvdW50VHlwZV0gPSBwYXJzZUZsb2F0IChiYWxhbmNlc1trZXldKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChyZXN1bHQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubG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djbG9zZWQnO1xuICAgICAgICB9XG4gICAgICAgIGxldCBpbmZvID0gdGhpcy5zYWZlVmFsdWUgKG9yZGVyLCAnaW5mbycsIG9yZGVyKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdpZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogaW5mbyxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZUFkZFF1b3RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW4nOiBtYXJrZXRbJ2Jhc2VJZCddLFxuICAgICAgICAgICAgJ3F1b3RlJzogbWFya2V0WydxdW90ZUlkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSByZXNwb25zZVsnaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMueW1kaG1zICh0aGlzLm1pbGxpc2Vjb25kcyAoKSksXG4gICAgICAgICAgICAnYW1vdW50X29yaWdpbmFsJzogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudF9vdXRzdGFuZGluZyc6IGFtb3VudCxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgfSwgbWFya2V0KTtcbiAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgIHJldHVybiBvcmRlcjtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVz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uICAgICAgICBpZiAoYXBpID09PSAnd2ViJykge1xuICAgICAgICAgICAgYXBpVHlwZSA9IGFwaTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGlUeXBlXSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJyB8fCBhcGkgPT09ICd3ZWInKSB7XG4gICAgICAgICAgICBpZiAoYXBpID09PSAnd2ViJylcbiAgICAgICAgICAgICAgICBxdWVyeVsndCddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KSk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlIChzZWNyZXQpKTtcbiAgICAgICAgICAgIHF1ZXJ5ICs9ICcmJyArICdzaWduY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V4JyxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICczbSc6ICczbWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW1pbicsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG1pbicsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFob3VyJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmhvdXInLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aG91cicsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZob3VyJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICczZCc6ICczZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzgwNDYzMTItMGI0NTBhYWMtMzJjOC0xMWU4LTk5YWItYmM2YjEzNmI2Y2M3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5jb2luZXguY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuY29pbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cuY29pbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2NvaW5leGNvbS9jb2luZXhfZXhjaGFuZ2VfYXBpL3dpa2knLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvaW5leC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Jlcy9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RpY2tlci9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2RlYWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQva2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2ZpbmlzaGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9maW5pc2hlZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci91c2VyL2RlYWxzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldFJlc01hcmtldCAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddWydtYXJrZXRfaW5mbyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5XTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbWFya2V0J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsnYnV5X2Fzc2V0X3R5cGUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ3NlbGxfYXNzZXRfdHlwZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ3NlbGxfYXNzZXRfdHlwZV9wbGFjZXMnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ2J1eV9hc3NldF90eXBlX3BsYWNlcyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBudW1NZXJnZUxldmVscyA9IG1hcmtldFsnbWVyZ2UnXS5sZW5ndGg7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICd0YWtlcl9mZWVfcmF0ZScpLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYWtlcl9mZWVfcmF0ZScpLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbGVhc3RfYW1vdW50JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWFya2V0WydtZXJnZSddW251bU1lcmdlTGV2ZWxzIC0gMV0pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsnZGF0ZSddO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgdGlja2VyID0gdGlja2VyWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICA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CBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHtcbiAgICAgICAgICAgICAgICAnZGF0ZSc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICAgICAndGlja2VyJzogdGlja2Vyc1tpZF0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldERlcHRoICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnbWVyZ2UnOiAnMC4wMDAwMDAwMScsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAocmVzcG9uc2VbJ2RhdGEnXSk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5zYWZlSW50ZWdlciAodHJhZGUsICdjcmVhdGVfdGltZScpO1xuICAgICAgICBsZXQgdHJhZGVJZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBsZXQgb3JkZXJJZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBpZiAoIXRpbWVzdGFtcCkge1xuICAgICAgICAgICAgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXTtcbiAgICAgICAgICAgIG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0cmFkZUlkID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICAgIHRpbWVzdGFtcCAqPSAxMDAwO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2RlYWxfbW9uZXknKTtcbiAgICAgICAgaWYgKCFjb3N0KVxuICAgICAgICAgICAgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlICogYW1vdW50KSk7XG4gICAgICAgIGxldCBmZWUgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlSWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW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NhZmVGbG9hdCAob3JkZXIsICdkZWFsX2Ftb3VudCcpO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuYW1vdW50VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50IC0gZmlsbGVkKTtcbiAgICAgICAgbGV0IHN0YXR1cyA9IG9yZGVyWydzdGF0dXMnXTtcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gJ2RvbmUnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIC8vIG5vdF9kZWFsXG4gICAgICAgICAgICAvLyBwYXJ0X2RlYWxcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ2lkJyksXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsnb3JkZXJfdHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmc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ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBwYXRoID0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3dlYicpIHtcbiAgICAgICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FjY2Vzc19pZCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgcXVlcnkgPS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iYXNlL2Vycm9ycycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbmV4Y2hhbmdlIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb2luZXhjaGFuZ2UnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ29pbkV4Y2hhbmdlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdJTicsICdKUCcsICdLUicsICdWTicsICdVUycgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAncHJpdmF0ZUFQSSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVMaW1pdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNDg0MjMwMy0yOWM5OWZjYS1mNzFjLTExZTctODNjMS0wOWQ5MDBjYjIzMzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pby9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbmV4Y2hhbmdlLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmV4Y2hhbmdlaW8uZ2l0aHViLmlvL3NsYXRlLycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuY29pbmV4Y2hhbmdlLmlvL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0c3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDE1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICcxMzM3JzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICc0MjBHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICc2MTEnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBQ0VTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBQ08nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURDTic6IDUwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEU1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURaJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FHUkknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FLWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUxJUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTEwnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1DJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNTU8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5ZJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkdVUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJHVVNPTEQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRPTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQjJCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0IzJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQUtFRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ00nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JETCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVFUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVMQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVOSkknOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkZJJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JJR1VQJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JJUkRTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVRCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JJWEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JJWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxBUyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTEFaUic6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTEsnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTFVFJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPQVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk9OJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCT05QQVknOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk9QUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlBPSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUkFUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUkMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJJVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlNOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JTUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRCYyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDUkVEJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQ1JGJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVERYJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFBMJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVUxMUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVaWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlhUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDNDcnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FDSCc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUxDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQU5OJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQkFOSyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hFQVAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NIRVNTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDSElMSSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hJUFMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0onOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NNUENPJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NNWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05OQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05UJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTzInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09PQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09VUEUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NRU1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JBQ0tFUlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSRE5DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUkVBJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUkVBSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFVkEyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUk1TTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUlcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUSUMyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVUJFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDWFQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NZQ0xPTkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NZREVSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQUcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBTEMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFSSSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFWJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RGUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESU1FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETUInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RNQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETkNWMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5FJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFSic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJHTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RUQ1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFVUQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQ0MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRFJDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRUNOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFR0MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxDTyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTElYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1JUkcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOVFJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOWk8nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVFMJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VRVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUlNPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUlQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJZJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFU1AnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRHJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIT1MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVROJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUk9QJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYQ0wnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVhUTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkFJUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkFQJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZBWlonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZDSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkdaJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZMQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGTElLJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZSVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGU1gnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWEUnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FJTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dEQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRUVSVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRkMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0xTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTFQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dNQic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR01YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0tVT0xEJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPTEQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPTEYnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR09PRCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHUkVFTkYnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dSTUQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHUlgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1RDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHV0MnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFMTE8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hCQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hFQUxUSFknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hJR0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hNQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSE5DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hPREwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hPTExZJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hPTkVZJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT1BFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hVQic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIWVAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hZUEVSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQkMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNFJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUZUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lMQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU1YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5GTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5TTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5YVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lRVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0pBUEFOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKRURJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKRVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSklOJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tBWUknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCMyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0dCJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLTEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS01EJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLT0JPJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tPSSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS09SVU5BJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tSQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS1VCTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS1VSVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFNQk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xDVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMREMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFVk8nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5EQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElOWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMTUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTE5LJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEcnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVDSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFZQUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFDJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BRyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFMQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFSUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFSUzInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BWEknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUJDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQklUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0InOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUVDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FTlRBTCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNRVInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUVUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNR00nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01HVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlMTyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSU5FWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSU5UJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0lOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PT04nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNDTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVVFJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01VWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01YVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkJJVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOQlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FT0cnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkxDMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkxHJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05STic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVEMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VQSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVU1VUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09HTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVJJUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZVSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQ04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUENTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQREcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BFQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEdMJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BITic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSUNPJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElHR1knOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElWWCc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEtUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQUNPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xPQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9TVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1NXJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSSU1VJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkwnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVUkEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFVSRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFVUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BXQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFdSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FVQU5UJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSQUlOJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JCTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFR0EnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JITyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSSVlBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JNQyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSTlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JPQyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdST09GUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVCJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVU5FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVU5ORVJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVVAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCSVQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ09SRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NPUkVPTEQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTRkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NGRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0dSJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NISVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0hNJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NITkQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0hPVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lMSzInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJTVAnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLT0lOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS1VMTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0xFVklOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTFInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTVMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk9XJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTT0xBUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1BSVFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1JDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTU1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RBUlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VQRVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUEVSTUFOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVJHRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NZTlEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NZTlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQ09JTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEVMTCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURVInOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUR1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElHRVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJUFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RMRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE9QQVonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RPUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFBDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUEcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RQSSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUkFOQ0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJVWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFNFJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RTVFInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RVUkJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVRk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VLJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTEEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VOSUZZJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VOSVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVU5PJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VRQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0EnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWR1MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJRFonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJU0lPJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWTFRDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPTkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlNYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVUxDQU5PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQVNIJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dDTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5LJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXT01FTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV09STSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV09XJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dSUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1lWJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hCTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQlUnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWENIRSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQ1MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hDVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWENYVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWERFMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVWJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hHT1gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hHVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMUic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTUNDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUEFTQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFFOJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYU0EnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFNUQyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVEQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFhYJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hZT0MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFlaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYWkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFpDRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWUhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQ0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pDRyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQ0wnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUlUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFTkknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFUk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pNQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaT0knOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlVSTU8nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlpDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQk9OJzogJ0JvblBlS2FPJyxcbiAgICAgICAgICAgICAgICAnRVROJzogJ0V0aGVybmV4JyxcbiAgICAgICAgICAgICAgICAnR0RDJzogJ0dvbGRlbkNyeXB0b0NvaW4nLFxuICAgICAgICAgICAgICAgICdHVEMnOiAnR2xvYmFsVG91ckNvaW4nLFxuICAgICAgICAgICAgICAgICdITkMnOiAnSHVuY29pbicsXG4gICAgICAgICAgICAgICAgJ01BUlMnOiAnTWFyc0J1eCcsXG4gICAgICAgICAgICAgICAgJ01FUic6ICdUaGVNZXJtYWlkQ29pbicsXG4gICAgICAgICAgICAgICAgJ1JVQic6ICdSdWJibGVDb2luJyxcbiAgICAgICAgICAgICAgICAnVVAnOiAnVXBzY2FsZVRva2VuJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRjdXJyZW5jaWVzIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHByZWNpc2lvbiA9IHRoaXMucHJlY2lzaW9uWydhbW91bnQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnQ3VycmVuY3lJRCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ1RpY2tlckNvZGUnXSk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gY3VycmVuY3lbJ1dhbGxldFN0YXR1cyddID09PSAnb25saW5lJztcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSAnb2snO1xuICAgICAgICAgICAgaWYgKCFhY3RpdmUpXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Rpc2FibGVkJztcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRtYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXRJRCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydNYXJrZXRBc3NldENvZGUnXSk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAobWFya2V0WydCYXNlQ3VycmVuY3lDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IG1hcmtldFsnTWFya2V0QXNzZXRJRCddLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogbWFya2V0WydCYXNlQ3VycmVuY3lJRCddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBtYXJrZXRbJ0FjdGl2ZSddLFxuICAgICAgICAgICAgICAgICdsb3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGlja2VyWydNYXJrZXRJRCddO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldElkO1xuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xhc3RQcmljZScpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdIaWdoUHJpY2UnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnTG93UHJpY2UnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnQmlkUHJpY2UnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0Fza1ByaWNlJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHV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2UnKTtcbmNvbnN0IHsgRXhjaGFuZ2VFcnJvciwgTm90U3VwcG9ydGVkIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbmZsb29yIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb2luZmxvb3InLFxuICAgICAgICAgICAgJ25hbWUnOiAnY29pbmZsb29yJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVSycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODI0NjA4MS02MjNmYzE2NC02YTFjLTExZTctOTEzZi1iYWMwZDU1NzZjOTAuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd2ViYXBpLmNvaW5mbG9vci5jby51azo4MDkwL2Jpc3QnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbmZsb29yLmNvLnVrJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2NvaW5mbG9vci9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY29pbmZsb29yLmNvLnVrL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3Bhc3N3b3JkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L29yZGVyX2Jvb2svJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RyYW5zYWN0aW9ucy8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdXNlcl90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L29wZW5fb3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9jYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vc2VsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vYnV5X21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vc2VsbF9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2VzdGltYXRlX3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9lc3RpbWF0ZV9idXlfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0dCUCc6IHsgJ2lkJzogJ1hCVC9HQlAnLCAnc3ltYm9sJzogJ0JUQy9HQlAnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnR0JQJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnWEJUL0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdYQlQvVVNEJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1BMTic6IHsgJ2lkJzogJ1hCVC9QTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCQ0gvR0JQJzogeyAnaWQnOiAnQkNIL0dCUCcsICdzeW1ib2wnOiAnQkNIL0dCUCcsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdHQlAnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBmZXRjaEJhb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tldElkIChzeW1ib2wpIH07XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RJZCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydxdWFudGl0eSddID0gYW1vdW50O1xuICAgICAgICAgICAgbWV0aG9kICs9ICdNYXJrZXQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdElkQ2FuY2VsT3JkZXIgKHsgJ2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZURhdGUgKG9yZGVyWydkYXRldGltZSddKTtcbiAgICAgICAgbGV0IGRhdGV0aW1lID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAob3JkZXJbJ3R5cGUnXSA9PT0gMClcbiAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgZWxzZSBpZiAob3JkZXJbJ3R5cGUnXSA9PT0gMSlcbiAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogZGF0ZXRpbWUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxu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ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NjE5NzA3LTVjOTIzMmE4LTcyMTItMTFlNy04NmQ2LTk4ZmU1ZDE1Y2M2ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbnQnOiAnaHR0cHM6Ly9hcGkuY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd1c2VyJzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cDovL2RvY3MuY29pbmdpLmFwaWFyeS5pby8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3d3dyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2N1cnJlbnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXItYm9vay97cGFpcn0ve2Fza0NvdW50fS97YmlkQ291bnR9L3tkZXB0aH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0ve21heENvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjRob3VyLXJvbGxpbmctYWdncmVnYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZXInOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsLW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlLWNyeXB0by13aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTUMnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgdGhpcy5wYXJzZUpzb25SZXNwb25zZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnd3d0dldCAoKTtcbiAgICAgICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9uc2UgPSB0cnVlO1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3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBpZCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcm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nLCAnYmFzZUFtb3VudCcpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydoaWdoZXN0QmlkJ10sXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlclsnbG93ZXN0QXNrJ10sXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGlja2VyWydiYXNlVm9sdW1lJ10sXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aWNrZXJbJ2NvdW50ZXJWb2x1bWUnXSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5jdXJyZW50R2V0MjRob3VyUm9sbGluZ0FnZ3JlZ2F0aW9uIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgcmVzcG9uc2UubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVt0XTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGlja2VyWydjdXJyZW5jeVBhaXInXVsnYmFzZSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGlja2VyWydjdXJyZW5jeVBhaXInXVsnY291bnRlciddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0cykge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMuZmV0Y2hUaWNrZXJzICh1bmRlZmluZWQsIHBhcmFtcyk7XG4gICAgICAgIGlmIChzeW1ib2wgaW4gdGlja2VycylcbiAgICAgICAgICAgIHJldHVybiB0aWNrZXJzW3N5bWJvbF07XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm4gZGlkIG5vdCBjb250YWluICcgKyBzeW1ib2wpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2N1cnJlbmN5UGFpciddXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0cmFkZVsndGltZXN0YW1wJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRyYWRlWyd0aW1lc3RhbXAnXSksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsIC8vIHR5cGVcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2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kZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3Rva2VuJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlLnRvU3RyaW5nICgpICsgJyQnICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICByZXF1ZXN0WydzaWduYXR1cmUnXSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdjdXJyZW50JywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKHR5cGVvZiByZXNwb25zZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIG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JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZUxpbWl0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZWRpdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQmFsYW5jZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyQm9vayc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODI0NDI0NC05YmU2MzEyYS02OWVkLTExZTctOTljMS03YzE3OTcyNzUyNjUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2ZpbGVzJzogJ2h0dHBzOi8vZmlsZXMuY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnY2hhcnRzJzogJ2h0dHBzOi8vZ3JhcGguY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbm1hcmtldGNhcC5jb20vYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ2ZpbGVzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlZC9zdGF0cy9nbG9iYWwuanNvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZ3JhcGhzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMve25hbWV9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2xvYmFsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY3VycmVuY3lDb2Rlcyc6IFtcbiAgICAgICAgICAgICAgICAnQVVEJyxcbiAgICAgICAgICAgICAgICAnQlJMJyxcbiAgICAgICAgICAgICAgICAnQ0FEJyxcbiAgICAgICAgICAgICAgICAnQ0hGJyxcbiAgICAgICAgICAgICAgICAnQ05ZJyxcbiAgICAgICAgICAgICAgICAnRVVSJyxcbiAgICAgICAgICAgICAgICAnR0JQJyxcbiAgICAgICAgICAgICAgICAnSEtEJyxcbiAgICAgICAgICAgICAgICAnSURSJyxcbiAgICAgICAgICAgICAgICAnSU5SJyxcbiAgICAgICAgICAgICAgICAnSlBZJyxcbiAgICAgICAgICAgICAgICAnS1JXJyxcbiAgICAgICAgICAgICAgICAnTVhOJyxcbiAgICAgICAgICAgICAgICAnUlVCJyxcbiAgICAgICAgICAgICAgICAnVVNEJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoJ0ZldGNoaW5nIG9yZGVyIGJvb2tzIGlzIG5vdCBzdXBwb3J0ZWQgYnkgdGhlIEFQSSBvZiAnICsgdGhpcy5pZCk7XG4gICAgfVxuXG4gICAgY3VycmVuY3lDb2RlIChiYXNlLCBuYW1lKSB7XG4gICAgICAgIGNvbnN0IGN1cnJlbmNpZXMgPSB7XG4gICAgICAgICAgICAnQUNDaGFpbic6ICdBQ0NoYWluJyxcbiAgICAgICAgICAgICdBZENvaW4nOiAnQWRDb2luJyxcbiAgICAgICAgICAgICdCYXRDb2luJzogJ0JhdENvaW4nLFxuICAgICAgICAgICAgJ0JpdGdlbSc6ICdCaXRnZW0nLFxuICAgICAgICAgICAgJ0JsYXplQ29pbic6ICdCbGF6ZUNvaW4nLFxuICAgICAgICAgICAgJ0Jsb2NrQ0FUJzogJ0Jsb2NrQ0FUJyxcbiAgICAgICAgICAgICdDYXRjb2luJzogJ0NhdGNvaW4nLFxuICAgICAgICAgICAgJ0hpIE11dHVhbCBTb2NpZXR5JzogJ0hpIE11dHVhbCBTb2NpZXR5JyxcbiAgICAgICAgICAgICdpQ29pbic6ICdpQ29pbicsXG4gICAgICAgICAgICAnTWFnZ2llJzogJ01hZ2dpZScsXG4gICAgICAgICAgICAnTUlPVEEnOiAnSU9UQScsIC8vIGEgc3BlY2lhbCBjYXNlLCBtb3N0IGV4Y2hhbmdlcyBsaXN0IGl0IGFzIElPVEEsIHRoZXJlZm9yZSB3ZSBjaGFuZ2UganVzdCB0aGUgQ29pbm1hcmtldGNhcCBpbnN0ZWFkIG9mIGNoYW5naW5nIHRoZW0gYWxsXG4gICAgICAgICAgICAnTmV0Q29pbic6ICdOZXRDb2luJyxcbiAgICAgICAgICAgICdQb2xjb2luJzogJ1BvbGNvaW4nLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobmFtZSBpbiBjdXJyZW5jaWVzKVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbmNpZXNbbmFtZV07XG4gICAgICAgIHJldHVybiBiYXNlO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHtcbiAgICAgICAgICAgICdsaW1pdCc6IDAsXG4gICAgICAgIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IHRoaXMuY3VycmVuY3lDb2RlcztcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jdXJyZW5jeUNvZGUgKG1hcmtldFsnc3ltYm9sJ10sIG1hcmtldFsnbmFtZSddKTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArICcvJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEdsb2JhbCAoY3VycmVuY3kgPSAnVVNEJykge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBpZiAoY3VycmVuY3kpXG4gICAgICAgICAgICByZXF1ZXN0Wydjb252ZXJ0J10gPSBjdXJyZW5jeTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHVibGljR2V0R2xvYmFsIChyZXF1ZXN0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBpZiAoJ2xhc3RfdXBkYXRlZCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgaWYgKHRpY2tlclsnbGFzdF91cGRhdGVkJ10pXG4gICAgICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsnbGFzdF91cGRhdGVkJ10pICogMTAwMDtcbiAgICAgICAgbGV0IGNoYW5nZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdwZXJjZW50X2NoYW5nZV8yNGgnIGluIHRpY2tlcilcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ3BlcmNlbnRfY2hhbmdlXzI0aCddKVxuICAgICAgICAgICAgICAgIGNoYW5nZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdwZXJjZW50X2NoYW5nZV8yNGgnKTtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCB2b2x1bWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIGxldCBwcmljZUtleSA9ICdwcmljZV8nICsgbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBpZiAocHJpY2VLZXkgaW4gdGlja2VyKVxuICAgICAgICAgICAgICAgIGlmICh0aWNrZXJbcHJpY2VLZXldKVxuICAgICAgICAgICAgICAgICAgICBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgcHJpY2VLZXkpO1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB2b2x1bWVLZXkgPSAnMjRoX3ZvbHVtZV8nICsgbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBpZiAodm9sdW1lS2V5IGluIHRpY2tlcilcbiAgICAgICAgICAgICAgICBpZiAodGlja2VyW3ZvbHVtZUtleV0pXG4gICAgICAgICAgICAgICAgICAgIHZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsIHZvbHVtZUtleSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogY2hhbmdlLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdm9sdW1lLFxuICAgICAgICAgICAgJ2luZm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4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgbmFtZSA9IGN1cnJlbmN5WyduYW1lJ107XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7IC8vIGRlZmF1bHQgcHJlY2lzaW9uLCB0b2RvOiBmaXggXCJtYWdpYyBjb25zdGFudHNcIlxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmN1cnJlbmN5Q29kZSAoaWQsIG5hbWUpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogbmFtZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0a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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbm1hdGUgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5tYXRlJyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5NYXRlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdHQicsICdDWicsICdFVScgXSwgLy8gVUssIEN6ZWNoIFJlcHVibGljXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MTEyMjktYzFlZmI1MTAtNjA2Yy0xMWU3LTlhMzYtODRiYTJjZTQxMmQ4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NvaW5tYXRlLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5tYXRlLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL2RvY3MuY29pbm1hdGUuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29pbm1hdGUuaW8vZGV2ZWxvcGVycycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5XaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5SW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5TGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcldpdGhJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVWb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1Wb3VjaGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsSW5zdGFudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbExpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbkhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VuY29uZmlybWVkQml0Y29pbkRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDX0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogMiB9fSxcbiAgICAgICAgICAgICAgICAnQlRDL0NaSyc6IHsgJ2lkJzogJ0JUQ19DWksnLCAnc3ltYm9sJzogJ0JUQy9DWksnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ1pLJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENfQlRDJywgJ3N5bWJvbCc6ICdMVEMvQlRDJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JUQycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiA1IH19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4g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ZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYW1vdW50JyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeVBhaXInXV07XG4gICAgICA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ge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlcklkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnY2xpZW50SWQnOiB0aGlzLnVpZCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAncHVibGljS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoK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gICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2lubmVzdC5jby5rcicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5jb2lubmVzdC5jby5rci9kb2MvaW50cm8uaHRtbCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5uZXN0aGVscC56ZW5kZXNrLmNvbS9oYy9rby9hcnRpY2xlcy8xMTUwMDIxMTAyNTItJUVBJUIxJUIwJUVCJTlFJTk4LSVFQyU4OCU5OCVFQyU4OCU5OCVFQiVBMyU4QyVFQiU4QSU5NC0lRUMlOTYlQkMlRUIlQTclODglRUMlOUQlQjglRUElQjAlODAlRUMlOUElOTQtJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY29pbm5lc3RoZWxwLnplbmRlc2suY29tL2hjL2tvL2FydGljbGVzLzExNTAwMjExMDI3Mi0lRUIlQjklODQlRUQlOEElQjglRUMlQkQlOTQlRUMlOUQlQjgtJUVDJTg4JTk4JUVDJTg4JTk4JUVCJUEzJThDJUVCJUE1JUJDLSVFQyU4NCVBMCVFRCU4MyU5RCVFRCU5NSU5OCVFQiU4QSU5NC0lRUMlOUQlQjQlRUMlOUMlQTAlRUElQjAlODAtJUVCJUFDJUI0JUVDJTk3JTg3JUVDJTlEJUI4JUVBJUIwJTgwJUVDJTlBJTk0LScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbi9hbGxjb2luJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncHViL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHViL2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWIvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2FkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9mZXRjaHRydXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS90cnVzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6ICcwLjAwMicsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgLy8gdG9kbzogcmV3cml0ZSB0aGlzIGZvciB3ZWIgZW5kcG9pbnRcbiAgICAgICAgbGV0IGNvaW5zID0gW1xuICAgICAgICAgICAgJ2J0YycsXG4gICAgICAgICAgICAnYmNoJyxcbiAgICAgICAgICAgICdidGcnLFxuICAgICAgICAgICAgJ2JjZCcsXG4gICAgICAgICAgICAndWJ0YycsXG4gICAgICAgICAgICAnYnRuJyxcbiAgICAgICAgICAgICdrc3QnLFxuICAgICAgICAgICAgJ2x0YycsXG4gICAgICAgICAgICAnYWN0JyxcbiAgICAgICAgICAgICdldGgnLFxuICAgICAgICAgICAgJ2V0YycsXG4gICAgICAgICAgICAnYWRhJyxcbiAgICAgICAgICAgICdxdHVtJyxcbiAgICAgICAgICAgICd4bG0nLFxuICAgICAgICAgICAgJ25lbycsXG4gICAgICAgICAgICAnZ2FzJyxcbiAgICAgICAgICAgICdycHgnLFxuICAgICAgICAgICAgJ2hzcicsXG4gICAgICAgICAgICAna25jJyxcbiAgICAgICAgICAgICd0c2wnLFxuICAgICAgICAgICAgJ3Ryb24nLFxuICAgICAgICAgICAgJ29tZycsXG4gICAgICAgICAgICAnd3RjJyxcbiAgICAgICAgICAgICdtY28nLFxuICAgICAgICAgICAgJ3N0b3JtJyxcbiAgICAgICAgICAgICdndG8nLFxuICAgICAgICAgICAgJ3B4cycsXG4gICAgICAgICAgICAnY2hhdCcsXG4gICAgICAgICAgICAnaW5rJyxcbiAgICAgICAgICAgICdvYycsXG4gICAgICAgICAgICAnaGxjJyxcbiAgICAgICAgICAgICdlbnQnLFxuICAgICAgICAgICAgJ3FidCcsXG4gICAgICAgICAgICAnc3BjJyxcbiAgICAgICAgICAgICdwdXQnLFxuICAgICAgICBdO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29pbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBjb2luc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArICcvJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1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mtldFsnYmFzZUlkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAodHJhZGVzLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QWNjb3VudEJhbGFuY2UgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGJhbGFuY0tleXMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY0tleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBrZXkgPSBiYWxhbmNLZXlzW2ldO1xuICAgICAgICAgICAgbGV0IHBhcnRzID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgaWYgKHBhcnRzLmxlbmd0aCAhPT0gMilcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgIGxldCB0eXBlID0gcGFydHNbMV07XG4gICAgICAgICAgICBpZiAodHlwZSAhPT0gJ3Jlc2VydmVkJyAmJiB0eXBlICE9PSAnYmFsYW5jZScpXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBwYXJ0c1swXS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KTtcbiAgICAgICAgICAgIGlmICghKGN1cnJlbmN5IGluIHJlc3VsdCkpIHtcbiAgICAgICAgICAgICAgICByZ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ddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlciksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGVBZGQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY29pbic6IG1hcmtldFsnYmFzZUlkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAnbnVtYmVyJzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lJzogdGhpcy5zZWNvbmRzICgpLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAg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ICAgICAgICAndHlwZSc6ICcxJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nICsgcGF0aDtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChxdWVyeS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kIChwYXJhbXMsIHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmhhc2ggKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGJvZHkgKz0gJyZzaWduYXR1cmU9JyArIHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAoc2VjcmV0KSk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcgfTtcbiAgICAgICAgfVxuICAgIC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AgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDAzMzAwLWFkYzEyZmJhLTMyM2YtMTFlOC04NTI1LTcyNWY1M2M0YTY1OS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuY29pbm9uZS5jby5rcicsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5vbmUuY28ua3InLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2MuY29pbm9uZS5jby5rcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYnRjX2RlcG9zaXRfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvZGFpbHlfYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdXNlcl9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC92aXJ0dWFsX2FjY291bnQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWxfYWxsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbGltaXRfYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbGltaXRfc2VsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NvbXBsZXRlX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0X29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVyX2luZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9hdXRoX251bWJlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9uL2hpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9rcncvaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9uL2J0Yy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9uL2NvaW4vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvS1JXJzogeyAnaWQnOiAnYmNoJywgJ3N5bWJvbCc6ICdCQ0gvS1JXJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ0tSVycsICdiYXNlSWQnOiAnYmNoJywgJ3F1b3RlSWQnOiAna3J3JyB9LFxuICAgICAgICAgICAgICAgICdCVEMvS1J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ZCc6ICdvbWcnLCAnc3ltYm9sJzogJ09NRy9LUlcnLCAnYmFzZSc6ICdPTUcnLCAncXVvdGUnOiAnS1JXJywgJ2Jhc2VJZCc6ICdvbWcnLCAncXVvdGVJZCc6ICdrcncnIH0sXG4gICAgICAgICAgICAgICAgJ1FUVU0vS1JXJzogeyAnaWQnOiAncXR1bScsICdzeW1ib2wnOiAnUVRVTS9LUlcnLCAnYmFzZSc6ICdRVFVNJywgJ3F1b3RlJzogJ0tSVycsICdiYXNlSWQnOiAncXR1bScsICdxdW90ZUlkJzogJ2tydycgfSxcbiAgICAgICAgICAgICAgICAnWFJQL0tSVyc6IHsgJ2lkJzogJ3hycCcsICdzeW1ib2wnOiAnWFJQL0tSVycsICdiYXNlJzogJ1hSUCcsICdxdW90ZSc6ICdLUlcnLCAnYmFzZUlkJzogJ3hycCcsICdxdW90ZUlkJzogJ2tydycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMDAxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwLCAwLjAwMDldLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMDAwLCAwLjAwMDhdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwMDAwLCAwLjAwMDddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMDAwMCwgMC4wMDA2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAwMDAsIDAuMDAwNV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwMDAwLCAwLjAwMDRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAwMDAwMCwgMC4wMDAzXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMDAwMDAsIDAuMDAwMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMCwgMC4wMDA4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMCwgMC4wMDA2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMDAwMCwgMC4wMDA0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMDAsIDAuMDAwMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMzAwMDAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnNDA1JzogRXhjaGFuZ2VOb3R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IH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2Zvcm1hdCc6ICdqc29uJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChyZXNwb25zZSwgdW5kZWZpbmVkLCAnYmlkJywgJ2FzaycsICdwcmljZScsICdxdHknKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogJ2FsbCcsXG4gICAgICAgICAgICAnZm9ybWF0JzogJ2pzb24nLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQgdGlja2VycyA9IHJlc3BvbnNlO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGl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FtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHJlcXVlc3Q7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJyArIHJlcXVlc3Q7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGpzb24gPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX3Rva2VuJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKGpzb24pKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmRlY29kZSAocGF5bG9hZCk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5zZWNyZXQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjIChwYXlsb2FkLCB0aGlzLmVuY29kZSAoc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdYLUNPSU5PTkUtUEFZTE9BRCc6IHBheWxvYWQsXG4gICAgICAgICAgICAgICAgJ1gtQ09JTk9ORS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3Jlc3VsdCcgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT09ICdzdWNjZXNzJykge1xuICAgICAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgICAgICAvLyAgICB7ICBcImVycm9yQ29kZVwiOiBcIjQwNVwiLCAgXCJzdGF0dXNcIjogXCJtYWludGVuYW5jZVwiLCAgXCJyZXN1bHRcIjogXCJlcnJvclwifVxuICAgICAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yQ29kZScpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICA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XIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb2luc2VjdXJlJyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5zZWN1cmUnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdJTicsIC8vIEluZGlhXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0NzItOWNiZDIwMGEtNWVkOS0xMWU3LTk1NTEtMjI2N2FkN2JhYzA4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLmNvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2NvaW5zZWN1cmUvcGx1Z2lucycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW4vc2VhcmNoL2NvbmZpcm1hdGlvbi97dHhpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2Fzay9sb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2Fzay9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2JpZC9oaWdoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9iaWQvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sYXN0VHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21heDI0SHInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21pbjI0SHInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9jYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvc21zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICduZXRraS9zZWFyY2gve25ldGtpTmFtZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYmFuay9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIva3ljL290cC97bnVtYmVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL290cC97bnVtYmVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9hZGRyZXNzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC9jb25maXJtZWQvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvY29uZmlybWVkL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC91bmNvbmZpcm1lZC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC91bmNvbmZpcm1lZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9iYWxhbmNlL2F2YWlsYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9iYWxhbmNlL3RvdGFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9iYWxhbmNlL2F2YWlsYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9iYWxhbmNlL3RvdGFsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9kZXBvc2l0L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9kZXBvc2l0L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2NvaW4vZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2ZpYXQvZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2t5Y3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvY29pbi9wYWlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2NvaW4vc3VjY2Vzc2Z1bCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9maWF0L3BhaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3RyYWRlL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9naW4vdG9rZW4ve3Rva2VufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4vaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luL3Bhc3N3b3JkL2ZvcmdvdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvZ2EvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ251cCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9uZXRraS91cGRhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9pbWFnZS91cGRhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXNzd29yZC9jaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGFzc3dvcmQvcmVzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ251cC92ZXJpZnkve3Rva2VufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9reWMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9pbnN0YW50L2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9pbnN0YW50L3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3ZlcmlmeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYWNjb3VudC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3ZlcmlmeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvYXV0aHkvaW5pdGlhdGUvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9nYS9pbml0aWF0ZS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbmV0a2kvY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvcGhvbmUvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2FkZHJlc3MvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy9zZW5kVG9FeGNoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZ2NtL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQvY2FuY2VsL3t3aXRoZHJhd0lEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9jYW5jZWwve2RlcG9zaXRJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NhbmNlbC97b3JkZXJJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL2NhbmNlbC97b3JkZXJJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3VudmVyaWZpZWQvY2FuY2VsL3t3aXRoZHJhd0lEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvYXV0aHkvZGlzYWJsZS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2dhL2Rpc2FibGUve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvcGhvbmUvZGVsZXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvaW1hZ2UvZGVsZXRlL3tuZXRraU5hbWV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQvY2FuY2VsL3t3aXRoZHJhd0lEfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0lOUic6IHsgJ2lkJzogJ0JUQy9JTlInLCAnc3ltYm9sJzogJ0JUQy9JTlInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSU5SJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjQgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuNCAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyRXhjaGFuZ2VCYW5rU3VtbWFyeSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICBsZXQgY29pbiA9IHtcbiAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlQ29pbkJhbGFuY2UnXSxcbiAgICAgICAgICAgICd1c2VkJzogYmFsYW5jZVsncGVuZGluZ0NvaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWyd0b3RhbENvaW5CYWxhbmNlJ10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCBmaWF0ID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVGaWF0QmFsYW5jZSddLFxuICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydwZW5kaW5nRmlhdEJhbGFuY2UnXSxcbiAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ3RvdGFsRmlhdEJhbGFuY2UnXSxcbiAgICAgICAgfTtc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xuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSAvIDEwMCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgc3ltYm9sID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZSddO1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnb3JkVHlwZSddID09PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gIC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lRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSAyMDApIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSByZXNwb25zZVsnc3VjY2VzcyddO1xuICAgICAgICAgICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBlcnJvciByZXR1cm5lZDogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICghKCdtZXNzYWdlJyBpbiByZXNwb25zZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYWxmb3JtZWQgcmVzcG9uc2U6IG5vIFwibWVzc2FnZVwiIGluIHJlc3BvbnNlOiAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFsZm9ybWVkIHJlc3BvbnNlOiBubyBcInN1Y2Nlc3NcIiBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGEgSlNPTiByZXNwb25zZVxuICAgICA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gICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODIwODQyOS0zY2FjZGY5YS02ODk2LTExZTctODU0ZS00Yzc5YTc3MmEzMGYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdS9wdWJhcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXRlc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2NvaW4vZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvY29pbi9zZW5kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYnV5L2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvc2VsbC9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9BVUQnOiB7ICdpZCc6ICdCVEMnLCAnc3ltYm9sJzogJ0JUQy9BVUQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQVVEJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQVVEJzogeyAnaWQnOiAnTFRDJywgJ3N5bWJvbCc6ICdMVEMvQVVEJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgICAgICAnRE9HRS9BVUQnOiB7ICdpZCc6ICdET0dFJywgJ3N5bWJvbCc6ICdET0dFL0FVRCcsICdiYXNlJzogJ0RPR0UnLCAncXVvdGUnOiAnQVVEJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0TXlCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBpZiAoJ2JhbGFuY2UnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZXNbY3VycmVuY3ldLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZXNbY3VycmVuY3ldLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKHVwcGVyY2FzZSA9PT0gJ0RSSycpXG4gICAgICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJzICh0aGlzLmV4dGVuZCA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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjb2ludGlnZXIgZXh0ZW5kcyBodW9iaXBybyB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW50aWdlcicsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luVGlnZXInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAnaG9zdG5hbWUnOiAnYXBpLmNvaW50aWdlci5jb20nLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaGVhZGVycyc6IHtcbiAgICAgICAgICAgICAgICAnTGFuZ3VhZ2UnOiAnZW5fVVMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzk3OTcyNjEtZDU4ZGYxOTYtNTM2My0xMWU4LTk4ODAtMmVjNzhlYzViZDI1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5jb2ludGlnZXIuY29tL2V4Y2hhbmdlL3RyYWRpbmcvYXBpL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmNvaW50aWdlci5jb20vZXhjaGFuZ2UvdHJhZGluZy9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UnOiAnaHR0cHM6Ly93d3cuY29pbnRpZ2VyLmNvbS9leGNoYW5nZScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW50aWdlci5jb20vZXhjaGFuZ2UvcmVnaXN0ZXIuaHRtbD9yZWZDb2RlPUZmdkR0dCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vY29pbnRpZ2VyL2FwaS1kb2NzLWVuL3dpa2knLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L2tsaW5lJywgLy8g6I635Y+WS+e6v+aVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RldGFpbC9tZXJnZWQnLCAvLyDojrflj5bogZrlkIjooYzmg4UoVGlja2VyKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJywgLy8g6I635Y+WIE1hcmtldCBEZXB0aCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsIC8vIOiOt+WPliBUcmFkZSBEZXRhaWwg5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS90cmFkZScsIC8vIOaJuemHj+iOt+WPluacgOi/keeahOS6pOaYk+iusOW9lVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RldGFpbCcsIC8vIOiOt+WPliBNYXJrZXQgRGV0YWlsIDI05bCP5pe25oiQ5Lqk6YeP5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZXhjaGFuZ2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZm9vdGVyL3RyYWRpbmdydWxlLmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaS9wdWJsaWMvbWFya2V0L2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMic6IEV4Y2hhbmdlRXJyb3IsXG4gICAgICAgICAgICAgICAgJzUnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzE2JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gZnVuZGluZyBwYXNzd29yZCBub3Qgc2V0XG4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BsZXQgaWQgPSBwYXJ0c1sxXS5zcGxpdCAoJzwvc3Bhbj4nKVswXTtcbiAgICAgICAgICAgIGxldCBtaW5BbW91bnQgPSBwYXJ0c1syXS5zcGxpdCAoJzwvc3Bhbj4nKVswXTtcbiAgICAgICAgICAgIGxldCBtaW5QcmljZSA9IHBhcnRzWzRdLnNwbGl0ICgnPC9zcGFuPicpWzBdO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtaW5BbW91bnQpLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWluUHJpY2UpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlkID0gaWQuc3BsaXQgKCcmbmJzcCcpWzBdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBiYXNlSWQgPSBiYXNlSWQudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZUlkID0gcXVvdGVJZC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGlkID0gYmFzZUlkICsgcXVvdGVJZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICd1cHBlcmNhc2VJZCc6IGlkLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtaW5BbW91bnQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1pblByaWNlKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLm9wdGlvbnNbJ21hcmtldHNCeVVwcGVyY2FzZU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F0YSA9IHJlc3BvbnNlWydkYXRhJ11bJ2RlcHRoX2RhdGEnXTtcbiAgICAgICAgaWYgKCd0aWNrJyBpbiBkYXRhKSB7XG4gICAgICAgICAgICBpZiAoIWRhdGFbJ3RpY2snXSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyYm9vayA9IGRhdGFbJ3RpY2snXTtcbiAgICAgICAgICAgIGxldCB0aW1lc3RhbXAgPSBkYXRhWyd0cyddO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wLCAnYnV5cycpO1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIHVucmVjb2duaXplZCByZXNwb25zZTogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtYXJrZXRJZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5leGNoYW5nZUdldEFwaVB1YmxpY01hcmtldERldGFpbCAocGFyYW1zKTtcbiAgICAgICAgaWYgKCEobWFya2V0SWQgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y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IH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIC8vXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgXCJ2b2x1bWVcIjoge1xuICAgICAgICAvLyAgICAgICAgICAgICBcImFtb3VudFwiOiBcIjEuMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiaWNvblwiOiBcIlwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcInRpdGxlXCI6IFwi5oiQ5Lqk6YePXCJcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgLy8gICAgICAgICBcInByaWNlXCI6IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJhbW91bnRcIjogXCIwLjA0OTc4ODgzXCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiaWNvblwiOiBcIlwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcInRpdGxlXCI6IFwi5aeU5omY5Lu35qC8XCJcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAvLyAgICAgICAgIFwiY3JlYXRlZF9hdFwiOiAxNTEzMjQ1MTM0MDAwLFxuICAgICAgICAvLyAgICAgICAgIFwiZGVhbF9wcmljZVwiOiB7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwiYW1vdW50XCI6IDAuMDQ5Nzg4ODMwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiaWNvblwiOiBcIlwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcInRpdGxlXCI6IFwi5oiQ5Lqk5Lu35qC8XCJcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgIC8vICAgICAgICAgXCJpZFwiOiAxMzhcbiAgICAgICAgLy8gICAgIH1cbiAg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gICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5zYWZlVmFsdWUgKHRyYWRlLCAndHMnKTtcbiAgICAgICAgbGV0IGlzbzg2MDEgPSAodHlwZW9mIHRpbWVzdGFtcCAhPT0gJ3VuZGVmaW5lZCcpID8gdGhpcy5pc284NjAxICh0aW1lc3RhbXApIDogdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IDEwMDAsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHM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hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyQmFsYW5jZSAocGFyYW1zKTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBcImNvZGVcIjogXCIwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJtc2dcIjogXCJzdWNcIixcbiAgICAgICAgLy8gICAgICAgICBcImRhdGFcIjogW3tcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJub3JtYWxcIjogXCIxODEzLjAxMTQ0MTc5XCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwibG9ja1wiOiBcIjEzMjUuNDIwMzY3ODVcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJjb2luXCI6IFwiYnRjXCJcbiAgICAgICAgLy8gICAgICAgICB9LCB7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwibm9ybWFsXCI6IFwiOTU1MS45NjY5MjI0NFwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImxvY2tcIjogXCI1NDcuMDY1MDY3MTdcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJjb2luXCI6IFwiZXRoXCJcbiAgICAgICAgLy8gICAgICAgICB9XVxuICAgICAgICAvLyAgICAgfVxuICAgICAgICAvL1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBiYWxhbmNlWydjb2luJ107XG4gICAgICA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ylcbiAgICAgICAgICAgIHByaWNlID0gKCdwcmljZScgaW4gb3JkZXIpID8gdGhpcy5zYWZlRmxvYXQgKG9yZGVyWydwcmljZSddLCAnYW1vdW50JykgOiB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgYXZlcmFnZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgICAgICAgICAgYXZlcmFnZSA9IHBhcnNlRmxvYXQgKGNvc3QgLyBmaWxsZWQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICgodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpICYmIChyZW1haW5pbmcgPiAwKSlcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICA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zeW1ib2wsIHByaWNlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICAvL1xuICAgICAgICAvLyAgICAge1wib3JkZXJfaWRcIjozNDM0M31cbiAgICAgICAgLy9cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5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cykpO1xuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnJztcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGF1dGggKz0ga2V5c1tpXSArIHF1ZXJ5W2tleXNbaV1dO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXV0aCArPSB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgbGV0IGlzQ3JlYXRlT3JkZXJNZXRob2QgPSAocGF0aCA9PT0gJ29yZGVyJykgJiYgKG1ldGhvZCA9PT0gJ1BPU1QnKTtcbiAgICAgICAgICAgIGxldCB1cmxQYXJhbXMgPSBpc0NyZWF0ZU9yZGVyTWV0aG9kID8ge30gOiBxdWVyeTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlfa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3RpbWUnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICB9LCB1cmxQYXJhbXMpKSk7XG4gICAgICAgICAgICB1cmwgKz0gJyZzaWduPScgKyB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHtcImNvZGVcIjpcIjEwMDAwNVwiLFwibXNnXCI6XCJyZXF1ZXN0IHNpZ24gaWxsZWdhbFwiLFwiZGF0YVwiOm51bGx9XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgY29kZSAhPT0gJ3VuZGVmaW5lZCcpICYmIChjb2RlICE9PSAnMCcpKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnbXNnJyk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY29kZSBpbiBleGNlcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29kZSA9PT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnb2Zmc2V0Tm90IE51bGwnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUGFyYW1ldGVyIGVycm9yJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgIC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b20vMTI5NDQ1NC8zNjc3MDUyOS1iZTdiMWEwNC0xYzViLTExZTgtOTYwMC1kMTFmMTk5NmI1MzkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbS9jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Jlc3QnOiAnaHR0cHM6Ly93d3cuY29vbGNvaW4uY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5jb29sY29pbi5jb20vaGVscC5hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuY29vbGNvaW4uY29tL3NwZW5kLnByaWNlLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NEQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQUsnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dDUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSENDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRUMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUZDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BHQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS1RDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTlQnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS1QnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NTUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlQxJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVDInOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAg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cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyQm9va3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yOTQ4NDM5NC03YjRlYTZlMi04NGM2LTExZTctODNlNS0xZmNjZjRiMmRjODEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L1JlZ2lzdGVyP3JlZmVycmVyPWtyb2l0b3InLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5jcnlwdG9waWEuY28ubnovRm9ydW0vQ2F0ZWdvcnkvNDUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL1RocmVhZC8yNTUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL1RocmVhZC8yNTYnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlUGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0ve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0SGlzdG9yeS97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfS97Y291bnR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlckdyb3Vwcy97aWRzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJHcm91cHMve2lkc30ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VGlwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdBQ0MnOiAnQWRDb2luJyxcbiAgICAgICAgICAgICAgICAnQkFUJzogJ0JhdENvaW4nLFxuICAgICAgICAgICAgICAgICdCTFonOiAnQmxhemVDb2luJyxcbiAgICAgICAgICAgICAgICAnQlRHJzogJ0JpdGdlbScsXG4gICAgICAgICAgICAgICAgJ0NDJzogJ0NDWCcsXG4gICAgICAgICAgICAgICAgJ0NNVCc6ICdDb21ldCcsXG4gICAgICAgICAgICAgICAgJ0ZDTic6ICdGYWNpbGVjb2luJyxcbiAgICAgICAgICAgICAgICAnRlVFTCc6ICdGQzInLCAvLyBGdWVsQ29pbiAhPSBGVUVMXG4gICAgICAgICAgICAgICAgJ0hBVic6ICdIYXZlY29pbicsXG4gICAgICAgICAgICAgICAgJ0xEQyc6ICdMQURBQ29pbicsXG4gICAgICAgICAgICAgICAgJ01BUktTJzogJ0JpdG1hcmsnLFxuICAgICAgICAgICAgICAgICdORVQnOiAnTmV0Q29pbicsXG4gICAgICAgICAgICAgICAgJ1FCVCc6ICdDdWJpdHMnLFxuICAgICAgICAgICAgICAgICdXUkMnOiAnV2FyQ29pbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vyc0Vycm9ycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldFRyYWRlUGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydJZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ1N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ0Jhc2VTeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IG1hcmtldFsnTWluaW11bVRyYWRlJ107XG4gICAgICAgICAgICBsZXQgcHJpY2VMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bVByaWNlJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4aW11bVByaWNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ01heGltdW1UcmFkZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bUJhc2VUcmFkZSddLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnU3RhdHVzJ10gPT09ICdPSyc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2xhYmVsJzogbWFya2V0WydMYWJlbCddLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYXJrZXRbJ1RyYWRlRmVlJ10gLyAxMDAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogbWFya2V0WydUcmFkZUZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMub3B0aW9uc1snbWFya2V0c0J5TGFiZWwnXSA9IHRoaXMuaW5kZXhCeSAocmVzdWx0LCAnbGFiZWwnKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRNYXJrZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAg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CB0byBzcGVjaWZ5IGEgbGlzdCBvZiBzeW1ib2xzIGluIHRoZSBmaXJzdCBhcmd1bWVudCB0byBmZXRjaE9yZGVyQm9va3MnKTtcbiAgICAgICAgICAgIGlkcyA9IHRoaXMuam9pbk1hcmtldElkcyAodGhpcy5pZHMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWRzID0gdGhpcy5qb2luTWFya2V0SWRzICh0aGlzLm1hcmtldElkcyAoc3ltYm9scykpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0TWFya2V0T3JkZXJHcm91cHNJZHMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWRzJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9va3MgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJib29rcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyYm9vayA9IG9yZGVyYm9va3NbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aGlzLnNhZmVJbnRlZ2VyIChvcmRlcmJvb2ssICdUcmFkZVBhaXJJZCcpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnQnV5JywgJ1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dhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldE1hcmtldElkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldE1hcmtldHMgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gdGlja2VyWydUcmFkZVBhaXJJZCddO1xuICAgICAgICAgICAgbGV0IHJlY29nbml6ZWQgPSAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKTtcbiAgICAgICAgICAgIGlmICghcmVjb2duaXplZCkge1xuICAgICAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbnNbJ2ZldGNoVGlja2Vyc0Vycm9ycyddKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ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hZGUsICdUb3RhbCcpO1xuICAgICAgICBsZXQgaWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnVHJhZGVJZCcpO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdUcmFkZVBhaXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICAgICAgaWYgKHRyYWRlWydUcmFkZVBhaXJJZCddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydUcmFkZVBhaXJJZCddXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKCdGZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogdHJhZGVbJ0ZlZSddLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICA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NlWydEYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ1N5bWJvbCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ0xpc3RpbmdTdGF0dXMnXSA9PT0gJ0FjdGl2ZScpO1xuICAgICAgICAgICAgbGV0IHN0YXR1cyA9IGN1cnJlbmN5WydTdGF0dXMnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGlmIChzdGF0dXMgIT09ICdvaycpXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ1dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5CYXNlVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluV2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBjdXJyZW5jeVsnTWF4V2l0aGRyYXcnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEJhbGFuY2UgKHBhcmFtcyk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0F2YWlsYWJsZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ1RvdGFsJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmV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R1cm5lZCB1bmtub3duIGVycm9yOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBmaWxsZWQgPSAwLjA7XG4gICAgICAgIGxldCBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGlmICgnRGF0YScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICgnT3JkZXJJZCcgaW4gcmVzcG9uc2VbJ0RhdGEnXSkge1xuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnRGF0YSddWydPcmRlcklkJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsnRGF0YSddWydPcmRlcklkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50O1xuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAg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nNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlLCAnRXJyb3InKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnZG9lcyBub3QgZXhpc3QnKSA+PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgZXJyb3I6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2UgaWYgKCdNYXJrZXQnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBvcmRlclsnTWFya2V0J107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcHRpb25zWydtYXJrZXRzQnlMYWJlbCddKSB7XG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMub3B0aW9uc1snbWFya2V0c0J5TGFiZWwnXVtpZF07XG4gICAgICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ1RpbWVTdGFtcCddKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ0Ftb3VudCcpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUmVtYWluaW5nJyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnT3JkZXJJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aGlzLm9taXQgKG9yZGVyLCAnc3RhdHVzJyksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnVHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUmF0ZScpLFxuICAgICAgICAgICAgJ2Nvc3QnOi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G4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMub3JkZXJzW2lkXTtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N0YXR1cyddID09PSAnb3BlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh0eXBlb2Ygc3ltYm9sID09PSAndW5kZWZpbmVkJykgfHwgKG9yZGVyWydzeW1ib2wnXSA9PT0gc3ltYm9sKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0Jzogb3JkZXJbJ2Ftb3VudCddICogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IG9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAoKHR5cGVvZiBzeW1ib2wgPT09ICd1bmRlZmluZWQnKSB8fCAob3JkZXJbJ3N5bWJvbCddID09PSBzeW1ib2wpKVxuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoIChvcmRlcik7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuZmlsdGVyQnlTaW5jZUxpbWl0IChyZXN1bHQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IH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ZXNzJyk7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGNvZGUsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGNvZGUsIGFtb3VudCwgYWRkcmVzcywgdGFnID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmN5IChjb2RlKTtcbiAgICAgICAgdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdDdXJyZW5jeSc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICAgICAgJ0Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdBZGRyZXNzJzogYWRkcmVzcywgLy8gQWRkcmVzcyBtdXN0IGV4aXN0IGluIHlvdSBBZGRyZXNzQm9vayBpbiBzZWN1cml0eSBzZXR0aW5nc1xuICAgICAgICB9O1xuICAgICAgICBpZiAodGFnKVxuICAgICAgICAgICAgcmVxdWVzdFsnUGF5bWVudElkJ10gPSB0YWc7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RTdWJtaXRXaXRoZHJhdyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydEYXRhJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0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gICAgJ2lkJzogJ2RzeCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdEU1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVSycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTkwMjc1LTE0MTMxNThhLTY0NWEtMTFlNy05MzFjLTk0NzE3Zjc1MTBlMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kc3gudWsvbWFwaScsIC8vIG1hcmtldCBkYXRhXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vZHN4LnVrL3RhcGknLCAvLyB0cmFkaW5nXG4gICAgICAgICAgICAgICAgICAgICdkd2FwaSc6ICdodHRwczovL2RzeC51ay9kd2FwaScsIC8vIGRlcG9zaXQvd2l0aGRyYXdcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9kc3gudWsnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5kc3gudWsnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kc3gudWsvYXBpX2RvY3MvcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3ByaXZhdGUnLFxuICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgLy8gbWFya2V0IGRhdGEgKHB1YmxpYylcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhcnNGcm9tTW9tZW50L3tpZH0ve3BlcmlvZH0ve3N0YXJ0fScsIC8vIGVtcHR5IHJlcGx5IDpcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdEJhcnMve2lkfS97cGVyaW9kfS97YW1vdW50fScsIC8vIHBlcmlvZCBpcyAobSwgaCBvciBkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BlcmlvZEJhcnMve2lkfS97cGVyaW9kfS97c3RhcnR9L3tlbmR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIHRyYWRpbmcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIGRlcG9zaXQgLyB3aXRoZHJhdyAocHJpdmF0ZSlcbiAgICAgICAgICAgICAgICAnZHdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENyeXB0b0RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9XaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvblN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZ2V0QmFzZVF1b3RlRnJvbU1hcmtldElkIChpZCkge1xuICAgICAgICBsZXQgdXBwZXJjYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgbGV0IHF1b3R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XQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sX2N1cicpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZ2V0T3JkZXJJZEtleSAoKSB7XG4gICAgICAgIHJldHVybiAnb3JkZXJJZCc7XG4gICAgfVxuXG4gICAgc2lnbkJvZHlXaXRoU2VjcmV0IChib2R5KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlY29kZSAodGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0JykpO1xuICAgIH1cblxu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lLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEZ1bmRpbmdGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICczaCc6ICczaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnN0QnLFxuICAgICAgICAgICAgICAgICcydyc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3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6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDkxLTFiMGVhOTU2LTVlZGEtMTFlNy05MjI1LTQwZDY3YjQ4MWI4ZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZXhtby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9leG1vLm1lLz9yZWY9MTMxNjg1JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9leG1vLm1lL2VuL2FwaV9kb2M/cmVmPTEzMTY4NScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vZXhtby1kZXYvZXhtb19hcGlfbGliL3RyZWUvbWFzdGVyL25vZGVqcycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2V4bW8uY29tL2VuL2RvY3MvZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlyX3NldHRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl9vcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfY2FuY2VsbGVkX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXF1aXJlZF9hbW91bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfY3J5cHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2dldF90eGlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNvZGVfY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNvZGVfbG9hZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FWRVMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiAzNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiA1MCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICc0MDAwNSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIEF1dGhvcml6YXRpb24gZXJyb3IsIGluY29ycmVjdCBzaWduYXR1cmVcbiAgICAgICAgICAgICAgICAnNDAwMDknOiBJbnZhbGlkTm9uY2UsIC8vXG4g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uICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyU2V0dGluZ3MgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fcXVhbnRpdHknKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X3F1YW50aXR5JyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3ByaWNlJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9wcmljZScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfYW1vdW50JyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VySW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlb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GV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5X3ByaWNlJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsX3ByaWNlJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZycpLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sX2N1cnInKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1z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m90aWNlZCBieSBcInVzXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvcmRlclsnY29zdCddID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBvcmRlclsnZmlsbGVkJ10gIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9yZGVyWydjb3N0J10gPSBvcmRlclsnZmlsbGVkJ10gKiBvcmRlclsncHJpY2UnXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMudG9BcnJheSAodGhpcy5vcmRlcnMpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFVzZXJPcGVuT3JkZXJzIChwYXJhbXMpO1xuICAgICAgICBsZXQgbWFya2V0SWRzID0gT2JqZWN0LmtleXMgKHJlc3BvbnNlKTtcbiAgICAgICAgbGV0IG9yZGVycyA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hc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ICAgICAgICBtYXJrZXRJZCA9IG9yZGVyWydwYWlyJ107XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCgnaW5fY3VycmVuY3knIGluIG9yZGVyKSAmJiAoJ291dF9jdXJyZW5jeScgaW4gb3JkZXIpKSB7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXRJZCA9IG9yZGVyWydpbl9jdXJyZW5jeSddICsgJ18nICsgb3JkZXJbJ291dF9jdXJyZW5jeSddO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0SWQgPSBvcmRlclsnb3V0X2N1cnJlbmN5J10gKyAnXycgKyBvcmRlclsnaW5fY3VycmVuY3knXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgodHlwZW9mIG1hcmtldElkICE9PSAndW5kZWZpbmVkJykgJiYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZCkpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncXVhbnRpdHknKTtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBsZXQgYW1vdW50RmllbGQgPSAoc2lkZSA9PT0gJ2J1eScpID8gJ2luX2Ftb3VudCcgOiAnb3V0X2Ftb3VudCc7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsIGFtb3VudEZpZWxkKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgdHJhZGVzID0gW107XG4gICAgICAgIGxldCB0cmFuc2FjdGlvbnMgPSB0aGlzLnNhZmVWYWx1ZSAob3JkZXIsICd0cmFkZXMnKTtcbiAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgdHJhbnNhY3Rpb25zICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHRyYW5zYWN0aW9ucykpIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRyYW5zYWN0aW9ucy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGUgPSB0aGlzLnBhcnNlVHJhZGUgKHRyYW5zYWN0aW9uc1tpXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBpZCA9IHRyYWRlWydvcmRlciddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRpbWVzdGFtcCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0cmFkZVsndGltZXN0YW1wJ107XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aW1lc3RhbXAgPiB0cmFkZVsndGltZXN0YW1wJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0cmFkZVsndGltZXN0YW1wJ107XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCArPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAvLyBmZWVDb3N0ICs9IHRyYWRlWydmZWUnXVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgY29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICB0cmFkZXMucHVzaCAodHJhZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIHRpbWVzdGFtcCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnc3RhdHVzJyk7IC8vIGluIGNhc2Ugd2UgbmVlZCB0byByZWRlZmluZSBpdCBmb3IgY2FuY2VsZWQgb3JkZXJzXG4gICAgICAgIGlmIChmaWxsZWQgPj0gYW1vdW50KVxuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIGVsc2VcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5nZXRNYXJrZXRGcm9tVHJhZGVzICh0cmFkZXMpO1xuICAgICAgICBsZXQgZmVlQ3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgY29zdCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAoZmlsbGVkID4gMClcbiAgICAgICAgICAgICAgICBwcmljZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHtcbiAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiBpc284NjAxLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICA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CA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHsgJ25vbmNlJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAge1wicmVzdWx0XCI6ZmFsc2UsXCJlcnJvclwiOlwiRXJyb3IgNTAwNTI6IEluc3VmZmljaWVudCBmdW5kc1wifVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdyZXN1bHQnLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzdWNjZXNzID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoKHN1Y2Nlc3MgPT09ICd0cnVlJykgfHwgKHN1Y2Nlc3MgPT09ICcxJykpXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IGZhbHNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JQYXJ0cyA9IG1lc3NhZ2Uuc3BsaXQgKCc6Jyk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBudW1QYXJ0cyA9IGVycm9yUGFydHMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBpZiAobnVtUGFydHMgPiAxKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvclN1YlBhcnRzID0gZXJyb3JQYXJ0c1swXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBudW1TdWJQYXJ0cyA9IGVycm9yU3ViUGFydHMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29kZSA9IChudW1TdWJQYXJ0cyA+IDEpID8gZXJyb3JTdWJQYXJ0c1sxXSA6IGVycm9yU3ViUGFydHNbMF07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvd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ICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM3NzcwMjkyLWZiZjYxM2QwLTJkZTQtMTFlOC05Zjc5LWYyZGM0NTFiOGNjYi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuZXh4LmNvbS9kYXRhL3YxJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly90cmFkZS5leHguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmV4eC5jb20vJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmV4eC5jb20vaGVscC9yZXN0QXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5leHguY29tL2hlbHAvcmF0ZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0QnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk9UJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMjUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUFknOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5LJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9OQSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ0FTSCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCB1cHBlciA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHVwcGVyLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0Wydpc09wZW4nXSA9PT0gdHJ1ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlSW50IChtYXJrZXRbJ2Ftb3VudFNjYWxlJ10pLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHBhcnNlSW50IChtYXJrZXRbJ3ByaWNlU2NhbGUnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgdGlja2VyID0gdGlja2VyWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0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XdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlcnMgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgaWYgKCEoaWQgaW4gdGhpcy5tYXJrZXRzQnlJZCkpXG4gICAgICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzQnlJZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB7XG4gICAgICAgICAgICAgICAgJ2RhdGUnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAgICAgJ3RpY2tlcic6IHRpY2tlcnNbaWRdLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAod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GFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfSwgcGFyYW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ogJ2Zsb3didGMnLFxuICAgICAgICAgICAgJ25hbWUnOiAnZmxvd0JUQycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0JSJywgLy8gQnJhemlsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgxNjI0NjUtY2Q4MTVkNGMtNjdjZi0xMWU3LThlNTctNDM4YmVhMDUyM2EyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5mbG93YnRjLmNvbTo4NDA1L2FqYXgnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90cmFkZXIuZmxvd2J0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cDovL3d3dy5mbG93YnRjLmNvbS5ici9hcGkvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXNCeURhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRQcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VXNlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNb2RpZnlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyRmVlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldFByb2R1Y3RQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncHJvZHVjdFBhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3Byb2R1Y3QxTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJvZHVjdDJMYWJlbCddO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAncHJvZHVjdDFEZWNpbWFsUGxhY2VzJyksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAncHJvZHVjdDJEZWNpbWFsUGxhY2VzJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnY3VycmVuY2llcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWyduYW1lJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ2hvbGQnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwcm9kdWN0UGFpc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ICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2x1bWUyNGhyJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lMjRoclByb2R1Y3QyJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndW5peHRpbWUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWydpbmNvbWluZ09yZGVyU2lkZSddID09PSAwKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3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4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyVHlwZSA9ICh0eXBlID09PSAnbWFya2V0JykgPyAxIDogMDtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lucyc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAnb3JkZXJUeXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ3F0eSc6IGFtb3VudCxcbiAgICAgICAgICAgICdweCc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDcmVhdGVPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnc2VydmVyT3JkZXJJZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAoJ2lucycgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdzZXJ2ZXJPcmRlcklkJzogaWQsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYGluc2Agc3ltYm9sIHBhcmFtZXRlciBmb3IgY2FuY2VsbGluZyBhbiBvcmRlcicpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlLnRvU3RyaW5nICgpICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnYXBpTm9uY2UnOiBub25jZSxc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ICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZm94Yml0LmV4Y2hhbmdlJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxpbmt0cmFkZS5jb20vZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1lbnQnOiAnQmxpbmt0cmFkZSBBUEknLFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdGlja2VyJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVENcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L29yZGVyYm9vaycsIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS90cmFkZXMnLCAgICAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQyZzaW5jZT08VElNRVNUQU1QPiZsaW1pdD08TlVNQkVSPlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0QnLCAgIC8vIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnRicsICAgLy8gY2FuY2VsIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTInLCAgLy8gYmFsYW5jZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1U0JywgIC8vIG15IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1U2JywgIC8vIHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgICAgICAnVTE4JywgLy8gZGVwb3NpdFxuICAgICAgICAgICAgIC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ICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2N1cnJlbmN5SWRdO1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3lbJ2NvZGUnXTtcbiAgICAgICAgICAgICAgICAvLyB3ZSBvbmx5IHNldCB0aGUgYmFsYW5jZSBmb3IgdGhlIGN1cnJlbmN5IGlmIHRoYXQgY3VycmVuY3kgaXMgcHJlc2VudCBpbiByZXNwb25zZVxuICAgICAgICAgICAgICAgIC8vIG90aGVyd2lzZSB3ZSB3aWxsIGxvc2UgdGhlIGluZm8gaWYgdGhlIGN1cnJlbmN5IGJhbGFuY2UgaGFzIGJlZW4gZnVuZGVkIG9yIHRyYWRlZCBvciBub3RcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3lJZCBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbY3VycmVuY3lJZCArICdfbG9ja2VkJ10pICogMWUtODtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2N1cnJlbmN5SWRdKSAqIDFlLTg7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50Wyd1c2VkJ107XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW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biAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbcXVvdGVWb2x1bWVdKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcn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4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChyZXF1ZXN0KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdTaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChub25jZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnU3RhdHVzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnU3RhdHVzJ10gIT09IDIwMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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gICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmZ5Yi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcmRldGFpbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YWNjaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGVuZGluZ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxwZW5kaW5nb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvU0VLJzogeyAnaWQnOiAnU0VLJywgJ3N5bWJvbCc6ICdCVEMvU0VLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1NFSycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICA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NrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB2b2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNh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gICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbHBlbmRpbmdvcmRlciAoeyAnb3JkZXJObyc6IGlkIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcuanNvbic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICd0aW1lc3RhbXAnOiBub25jZSB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGExJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBp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TVtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzI0aCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODY0NjgxNy01MDg0NTdmMi03MjZjLTExZTctOWVlYi0zNTI4ZDI0MTNhNTguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2F0ZWNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vR2F0ZWNvaW4vUkVTVGZ1bC1BUEktSW1wbGVtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZ2F0ZWNvaW4uY29tL3N3YWdnZXItdWkvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0V4Y2hhbmdlUmF0ZScsIC8vIEdldCB0aGUgZXhjaGFuZ2UgcmF0ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlcicsIC8vIEdldCBsaXZlIHRpY2tlciBmb3IgYWxsIGN1cnJlbmN5XG4gICAgIC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0IHRoZSBwdWJsaWMgcHVibnViIGNoYW5uZWwgbGlzdFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeHBvcnQvVHJhbnNhY3Rpb25zJywgLy8gUmVxdWVzdCBhIGV4cG9ydCBvZiBhbGwgdHJhZGVzIGZyb20gYmFzZWQgb24gY3VycmVuY3lwYWlyLCBzdGFydCBkYXRlIGFuZCBlbmQgZGF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BpbmcnLCAvLyBQb3N0IGEgc3RyaW5nLCB0aGVuIGdldCBpdCBiYWNrLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9VbnN1YnNjcmliZS97RW1haWxDb2RlfScsIC8vIExldHMgdGhlIHVzZXIgdW5zdWJzY3JpYmUgZnJvbSBlbWFpbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWdpc3RlclVzZXInLCAvLyBJbml0aWFsIHRyYWRlciByZWdpc3RyYXRpb24uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBHZXQgY29ycG9yYXRlIGFjY291bnQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRBZGRyZXNzJywgLy8gQ2hlY2sgaWYgcmVzaWRlbmNlIHByb29mIHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gQ2hlY2sgaWYgcmVnaXN0ZXJlZCBkb2N1bWVudCB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJRCcsIC8vIENoZWNrIGlmIElEIGRvY3VtZW50IGNvcHkgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDMgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwnLCAvLyBHZXQgdXNlciBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRmVlUmF0ZScsIC8vIEdldCBmZWUgcmF0ZSBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBHZXQgdmVyaWYgbGV2ZWwgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1BlcnNvbmFsSW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDEgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGhvbmUnLCAvLyBHZXQgdXNlciBwaG9uZSBudW1iZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Byb2ZpbGUnLCAvLyBHZXQgdHJhZGVyIHByb2ZpbGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyBGaWxsIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbCcsIC8vIEdldCByZWZlcnJhbCBpbmZvcm1hdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxDb2RlJywgLy8gR2V0IHRoZSByZWZlcnJhbCBjb2RlIG9mIHRoZSBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxOYW1lcycsIC8vIEdldCBuYW1lcyBvZiByZWZlcnJlZCB0cmFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbFJld2FyZCcsIC8vIEdldCByZWZlcnJhbCByZXdhcmQgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmVkQ29kZScsIC8vIEdldCByZWZlcnJhbCBjb2RlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZXNpZGVudEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAyIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1NlY3VyaXR5U2V0dGluZ3MnLCAvLyBHZXQgdmVyaWYgZGV0YWlscyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvVXNlcicsIC8vIEdldCBhbGwgdXNlciBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBJS2V5L0FQSUtleScsIC8vIEdldCBBUEkgS2V5IGZvciBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvQ29ubmVjdGlvbkhpc3RvcnknLCAvLyBHZXRzIGNvbm5lY3Rpb24gaGlzdG9yeSBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbGFuY2UvQmFsYW5jZXMnLCAvLyBHZXRzIHRoZSBhdmFpbGFibGUgYmFsYW5jZSBmb3IgZWFjaCBjdXJyZW5jeSBmb3IgdGhlIGxvZ2dlZCBpbiBhY2NvdW50LlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbGFuY2UvQmFsYW5jZXMve0N1cnJlbmN5fScsIC8vIEdldHMgdGhlIGF2YWlsYWJsZSBiYWxhbmNlIGZvciBzIGN1cnJlbmN5IGZvciB0aGUgbG9nZ2VkIGluIGFjY291bnQuXG4gICAgICAgICAgICAgICAgICAgICAg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L0RvY3VtZW50QWRkcmVzcycsIC8vIFVwbG9hZCBhZGRyZXNzIHByb29mIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gVXBsb2FkIHJlZ2lzdGVyZWQgZG9jdW1lbnQgZG9jdW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGxvYWQgSUQgZG9jdW1lbnQgY29weVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvUmVxdWVzdFZlcmlmeScsIC8vIFJlcXVlc3QgZm9yIHZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvVmVyaWZ5JywgLy8gVmVyaWZpY2F0aW9uIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Hb29nbGVBdXRoJywgLy8gRW5hYmxlIGdvb2dsZSBhdXRoXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9MZXZlbCcsIC8vIFJlcXVlc3QgdmVyaWYgbGV2ZWwgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyBGaWxsIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbCcsIC8vIFBvc3QgYSByZWZlcnJhbCBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FQSUtleS9BUElLZXknLCAvLyBDcmVhdGUgYSBuZXcgQVBJIGtleSBmb3IgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0NoYW5nZVBhc3N3b3JkJywgLy8gQ2hhbmdlIHBhc3N3b3JkLlxuICAgICAgICAgICAgICAgIC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gICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnMnLCAvLyBQbGFjZSBhIHN0b3Agb3JkZXIgYXQgdGhlIGV4Y2hhbmdlLlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQ29ycG9yYXRlRGF0YScsIC8vIFVwZGF0ZSB1c2VyIGNvbXBhbnkgZGF0YSBmb3IgY29ycG9yYXRlIGFjY291bnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGRhdGUgSUQgZG9jdW1lbnQgbWV0YSBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsJywgLy8gVXBkYXRlIHVzZXIgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1BlcnNvbmFsSW5mb3JtYXRpb24nLCAvLyBVcGRhdGUgU3RlcDEgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGhvbmUnLCAvLyBVcGRhdGUgdXNlciBwaG9uZSBudW1iZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyB1cGRhdGUgdGhlIHF1ZXN0aW9ubmFpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmVkQ29kZScsIC8vIFVwZGF0ZSByZWZlcnJhbCBjb2RlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZXNpZGVudEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAyIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1NlY3Vya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gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQkNQJzogJ0JDUFQnLFxuICAgICAgICAgICAgICAgICdGTEknOiAnRkxJWFgnLFxuICAgICAgICAgICAgICAgICdNQU4nOiAnTUFOQScsXG4gICAgICAgICAgICAgICAgJ1NMVCc6ICdTQUxUJyxcbiAgICAgICAgICAgICAgICAnVFJBJzogJ1RSQUMnLFxuICAgICAgICAgICAgICAgICdXR1MnOiAnV0lOR1MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRSZWZlcmVuY2VDdXJyZW5jeVBhaXJzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydjdXJyZW5jeVBhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsndHJhZGluZ0NvZGUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ3F1b3RlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlRGVjaW1hbFBsYWNlcyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2VCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeUlkID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3lJZDtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeUlkIGluIHRoaXMuY3VycmVuY2llc19ieV9pZClcbiAgICAgICAgICAgICAgICBjb2RlID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2N1cnJlbmN5SWRdWydjb2RlJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUJhbGFuY2UnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc3VtIChcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsncGVuZGluZ0luY29taW5nJ10sXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ3BlbmRpbmdPdXRnb2luZyddLFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydvcGVuT3JkZXInXVxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsnYmFsYW5jZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFB1YmxpY01hcmtldERlcHRoQ3VycmVuY3lQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ0N1cnJlbmN5UGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICd2b2x1bWUnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRj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eSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBmZWVDb3N0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAncmF0ZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZVJhdGUnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndHJhbnNhY3Rpb25JZCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuIC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heSc6IChzaWRlID09PSAnYnV5JykgPyAnQmlkJyA6ICdBc2snLFxuICAgICAgICAgICAgJ0Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsnUHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBpZiAodGhpcy50d29mYSkge1xuICAgICAgICAgICAgaWYgKCdWYWxpZGF0aW9uQ29kZScgaW4gcGFyYW1zKVxuICAgICAgICAgICAgICAgIG9yZGVyWydWYWxpZGF0aW9uQ29kZSddID0gcGFyYW1zWydWYWxpZGF0aW9uQ29kZSddO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyB0d28tZmFjdG9yIGF1dGhlbnRpY2F0aW9uIHJlcXVpcmVzIGEgbWlzc2luZyBWYWxpZGF0aW9uQ29kZSBwYXJhbWV0ZXInKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGVPcmRlcnMgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2NsT3JkZXJJZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlRGVsZXRlVHJhZGVPcmRlcnNPcmRlcklEICh7ICdPcmRlcklEJzogaWQgfSk7XG4gICAgfVxuXG4gIC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ICAgICAgICAgICAgICAgICAgICAgIGxldCB0cmFkZSA9IHRoaXMucGFyc2VUcmFkZSAodHJhbnNhY3Rpb25zW2ldKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzRmlsbGVkID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFkZXNGaWxsZWQgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlc0Nvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWRlc0Nvc3QgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFkZXNGaWxsZWQgKz0gdHJhZGVbJ2Ftb3VudCddO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzQ29zdCArPSB0cmFkZVsnYW1vdW50J10gKiB0cmFkZVsncHJpY2UnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVbJ2ZlZSddWydjb3N0J10gIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ICs9IHRyYWRlWydmZWUnXVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZWVDdXJyZW5jeSA9IHRyYWRlWydmZWUnXVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlWydmZWUnXVsncmF0ZSddICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZVJhdGUgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlUmF0ZSA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlUmF0ZSArPSB0cmFkZVsnZmVlJ11bJ3JhdGUnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0cmFkZXMucHVzaCAodHJhZGUpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHRyYWRlc0ZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpICYmICh0cmFkZXNGaWxsZWQgPiAwKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHByaWNlID0gdHJhZGVzQ29zdCAvIHRyYWRlc0ZpbGxlZDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVSYXRlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG51bVRyYWRlcyA9IHRyYWRlcy5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVHJhZGVzID4gMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZWVSYXRlID0gZmVlUmF0ZSAvIG51bVRyYWRlcztcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZUNvc3QgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlJzogZmVlUmF0ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHRyYWRlcyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3Blbk9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgI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KCk7XG4gICAgICAgICAgICBsZXQgY29udGVudFR5cGUgPSAobWV0aG9kID09PSAnR0VUJykgPyAnJyA6ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgdXJsICsgY29udGVudFR5cGUgKyBub25jZVN0cmluZztcbiAgICAgICAgICAgIGF1dGggPSBhdXRoLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQVBJX1BVQkxJQ19LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJX1JFUVVFU1RfU0lHTkFUVVJFJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICAgICAgJ0FQSV9SRVFVRVNUX0RBVEUnOiBub25jZVN0cmluZyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gY29udGVudFR5cGU7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAodGhpcy5leHRlbmQgKHsgJ25vbmNlJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcm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zJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzE3ODQwMjktMDMxM2M3MDItYjUwOS0xMWU3LTljY2MtYmMwZGE2YTBlNDM1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuZ2F0ZS5pby9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2RhdGEuZ2F0ZS5pby9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dhdGUuaW8vJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2F0ZS5pby9hcGkyJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2F0ZS5pby9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmdhdGUuaW8vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAzNTc3NjczJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0aW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0bGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vay97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUhpc3Rvcnkve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0ve3RpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHNXaXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsQWxsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldGluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncGFpcnMnKTtcbiAgICAgICAgaWYgKCFtYXJrZXRzKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cyBnb3QgYW4gdW5yZWNvZ25pemVkIHJlc3BvbnNlJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzWzBdO1xuICAgICAgICAgICAgbGV0IGRldGFpbHMgPSBtYXJrZXRbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IGRldGFpbHNbJ2RlY2ltYWxfcGxhY2VzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGV0YWlsc1snbWluX2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1kZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddKSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBjb3N0TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBhbW91bnRMaW1pdHNbJ21pbiddICogcHJpY2VMaW1pdHNbJ21pbiddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdExpbWl0cyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdtYWtlcic6IGRldGFpbHNbJ2ZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IGRldGFpbHNbJ2ZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKCdhdmFpbGFibGUnIGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnYXZhaWxhYmxlJ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sZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByZXN1bHQgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChtZXNzYWdlKTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT09ICd0cnVlJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKG1lc3NhZ2UpO1xuICAgICAgICAgICAgfSBlbHNlIGlmICghcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKG1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNw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AgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6IDYwLFxuICAgICAgICAgICAgICAgICc1bSc6IDMwMCxcbiAgICAgICAgICAgICAgICAnMTVtJzogOTAwLFxuICAgICAgICAgICAgICAgICcxaCc6IDM2MDAsXG4gICAgICAgICAgICAgICAgJzZoJzogMjE2MDAsXG4gICAgICAgICAgICAgICAgJzFkJzogODY0MDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ3Rlc3QnOiAnaHR0cHM6Ly9hcGktcHVibGljLnNhbmRib3guZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1MjctYjFiZTQxYzYtNWVkYi0xMWU3LTk1ZjYtNWI0OTZjNDY5ZTJjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RvY3MuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuZ2RheC5jb20vZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuZ2RheC5jb20vY3VzdG9tZXIvZW4vcG9ydGFsL3RvcGljcy85Mzk0MDItZGVwb3NpdGluZy1hbmQtd2l0aGRyYXdpbmctZnVuZHMvYXJ0aWNsZXMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3Bhc3N3b3JkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9jYW5kbGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3N0YXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vaG9sZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3RyYW5zZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbmJhc2UtYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50LW1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJzL3NlbGYvdHJhaWxpbmctdm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvY29pbmJhc2UtYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5iYXNlLWFjY291bnRzL3tpZH0vYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nL3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9maWxlcy9tYXJnaW4tdHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcG9ydHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2NvaW5iYXNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9jcnlwdG8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3BheW1lbnQtbWV0aG9kJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSwgLy8gY29tcGxpY2F0ZWQgdGllciBzeXN0ZW0gcGVyIGNvaW5cbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gdGllcmVkIGZlZSBzdGFydHMgYXQgMC4zJVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAyNSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDEwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJvZHVjdHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydiYXNlX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAncXVvdGVfaW5jcmVtZW50JyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAodGhpcy5zYWZlU3RyaW5nIChtYXJrZXQsICdxdW90ZV9pbmNyZW1lbnQnKSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3Rha2VyJ107ICAvLyBkb2VzIG5vdCBzZWVtIHJpZ2h0XG4gICAgICAgICAgICBpZiAoKGJhc2UgPT09ICdFVEgnKSB8fCAoYmFzZSA9PT0gJ0xUQycpKSB7XG4gICAgICAgICAgICAgICAgdGFrZXIgPSAwLjAwMztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ3N0YXR1cyddID09PSAnb25saW5lJztcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2Jhc2VfbWluX3NpemUnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYmFzZV9tYXhfc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9tYXJrZXRfZnVuZHMnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X21hcmtldF9mdW5kcycpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm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mlkJzogYmlkLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndGltZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZSddKTtcbiAgICAgICAgfSBlbHNlIGlmICgnY3JlYXRlZF9hdCcgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnY3JlYXRlZF9hdCddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgaXNvODYwMSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaXNvODYwMSA9IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgncHJvZHVjdF9pZCcgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB0cmFkZVsncHJvZHVjdF9pZCddO1xuICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBmZWVSYXRlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmVlQ3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgaWYgKCdsaXF1aWRpdHknIGluIHRyYWRlKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJhdGVUeXBlID0gKHRyYWRlWydsaXF1aWRpdHknXSA9PT0gJ1QnKSA/ICd0YWtlcicgOiAnbWFrZXInO1xuICAgICAgICAgICAgICAgIGZlZVJhdGUgPSBtYXJrZXRbcmF0ZVR5cGVdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmlsbF9mZWVzJyk7XG4gICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBmZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyk7XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgICdyYXRlJzogZmVlUmF0ZSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFkZV9pZCcpO1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnc2lkZSddID09PSAnYnV5JykgPyAnc2VsbCcgOiAnYnV5JztcbiAgICAgICAgbGV0IG9yZGVySWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnb3JkZXJfaWQnKTtcbiAgICAgICAgLy8gR0RBWCByZXR1cm5zIGludmVydGVkIHNpZGUgdG8gZmV0Y2hNeVRyYWRlcyB2cyBmZXRjaFRyYWRlc1xuICAgICAgICBpZiAodHlwZW9mIG9yZGVySWQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc2lkZSA9ICh0cmFkZVsnc2lkZSddID09PSAnYnV5JykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4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50aW1lZnJhbWVzW3RpbWVmcmFtZV07XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2dyYW51bGFyaXR5JzogZ3JhbnVsYXJpdHksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2Ygc2luY2UgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICByZXF1ZXN0WydzdGFydCddID0gdGhpcy55bWRobXMgKHNpbmNlKTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbGltaXQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgLy8gaHR0cHM6Ly9kb2NzLmdkYXguY29tLyNnZXQtaGlzdG9yaWMtcmF0ZXNcbiAgICAgICAgICAgICAgICBsaW1pdCA9IDMwMDsgLy8gbWF4ID0gMzAwXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXF1ZXN0WydlbmQnXSA9IHRoaXMueW1kaG1zICh0aGlzLnN1bSAobGltaXQgKiBncmFudWxhcml0eSAqIDEwMDAsIHNpbmNlKSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0c0lkQ2FuZGxlcyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGltZSAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGltZSAoKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2U4NjAxIChyZXNwb25zZVsnaXNvJ10pO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0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5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzdGF0dXMnOiAnZG9uZScsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wpIHtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsncHJvZHVjdF9pZCddID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVycyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVycyAocmVzcG9uc2UsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICAvLyBsZXQgb2lkID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3Byb2R1Y3RfaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3NpemUnOiBhbW91bnQsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGlta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uIHtcbiAgICAgICAgICAgICd0eXBlJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAncmF0ZSc6IHJhdGUsXG4gICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRoaXMuZmVlVG9QcmVjaXNpb24gKGN1cnJlbmN5LCByYXRlICogY29zdCkpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGdldFBheW1lbnRNZXRob2RzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0UGF5bWVudE1ldGhvZHMgKCk7XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBhc3luYyBkZXBvc2l0IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdERlcG9zaXRzJztcbiAgICAgICAgaWYgKCdwYXltZW50X21ldGhvZF9pZCcgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAvLyBkZXBvc2l0IGZyb20gYSBwYXltZW50X21ldGhvZCwgbGlrZSBhIGJhbmsgYWNjb3VudFxuICAgICAgICAgICAgbWV0aG9kICs9ICdQYXltZW50TWV0aG9kJztcbiAgICAgICAgfSBlbHNlIGlmICgnY29pbmJhc2VfYWNjb3VudF9pZCcgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAvLyBkZXBvc2l0IGludG8gR0RBWCBhY2NvdW50IGZyb20gYSBDb2luYmFzZSBhY2Nvd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hpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RXaXRoZHJhd2Fscyc7XG4gICAgICAgIGlmICgncGF5bWVudF9tZXRob2RfaWQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdQYXltZW50TWV0aG9kJztcbiAgICAgICAgfSBlbHNlIGlmICgnY29pbmJhc2VfYWNjb3VudF9pZCcgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0NvaW5iYXNlQWNjb3VudCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0NyeXB0byc7XG4gICAgICAgICAgICByZXF1ZXN0WydjcnlwdG9fYWRkcmVzcyddID0gYWRkcmVzcztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCFyZXNwb25zZSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyB3aXRoZHJhdygpIGVycm9yOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICByZXF1ZXN0ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gJyc7XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIHBheWxvYWQgPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGxldCBwYXlsb2FkID0gKGJvZHkpID8gYm9keSA6ICcnO1xuICAgICAgICAgICAgbGV0IHdoYXQgPSBub25jZSArIG1ldGhvZCArIHJlcXVlc3QgKyBwYXlsb2FkO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh3aGF0KSwgc2VjcmV0LCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ0ItQUNDRVNTLUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdDQi1BQ0NFU1MtU0lHTic6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgICAgICdDQi1BQ0NFU1MtVElNRVNUQU1QJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0NCLUFDQ0VTUy1QQVNTUEhSQVNFJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoKGNvZGUgPT09IDQwMCkgfHwgKGNvZGUgPT09IDQwNCkpIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5pZCArICcgJyArIG1lc3NhZ2U7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ3ByaWNlIHRvbyBzbWFsbCcpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgncHJpY2UgdG9vIHByZWNpc2UnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdJbnN1ZmZpY2llbnQgZnVuZHMnKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ05vdEZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAoZXJyb3IpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgQVBJIEtleScpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5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ml2YXRlIEFQSVxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hCaWRzQXNrcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODE2ODU3LWNlN2JlNjQ0LTYwOTYtMTFlNy04MmQ2LTNjMjU3MjYzMjI5Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RvY3MuZ2VtaW5pLmNvbS9yZXN0LWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RvY3Muc2FuZGJveC5nZW1pbmkuY29tJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vYXBpLnNhbmRib3guZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dlbWluaS5jb20vZmVlLXNjaGVkdWxlLycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dlbWluaS5jb20vdHJhbnNmZXItZmVlcy8nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YnRpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdWN0aW9uL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdWN0aW9uL3tzeW1ib2x9L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvc2Vzc2lvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQve2N1cnJlbmN5fS9uZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoZWFydGJlYXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9scyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gaWQ7XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gbWFya2V0LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB1cHBlcmNhc2Uuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdXBwZXJjYXNlLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ2Ftb3VudCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJ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gICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbY3VycmVuY3ldWydjb2RlJ107XG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG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lbmFkaW5lcywgUnVzc2lhLCBDSVNcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMzgwMTkwMi0wM2M0MzQ2Mi1kZDdiLTExZTctOTkyZS0wNzdlNGNkMDE1YjkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vZ2V0YnRjLm9yZy9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nZXRidGMub3JnJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2V0YnRjLm9yZy9hcGktZG9jcy5waHAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yMCAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yMCAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnbG90JzogMWUtMDgsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdxdW90ZSc6ICdVU0QnLCAnYmFzZSc6ICdCVEMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogOCwgJ3ByaWNlJzogOCB9LCAnaWQnOiAnVVNEJywgJ2xpbWl0cyc6I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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgaGFkYXggZXh0ZW5kcyBodW9iaXBybyB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2hhZGF4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0hBREFYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ2hvc3RuYW1lJzogJ2FwaS5oYWRheC5jb20nLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zODA1OTk1Mi00NzU2YzQ5ZS0zMmYxLTExZTgtOTBiOS00NWMxZWNjYmE5Y2QuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmhhZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5oYWRheC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzL3dpa2knLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoYWRheC9jb21tb24vc3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5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2hpdGJ0YycsXG4gICAgICAgICAgICAnbmFtZSc6ICdIaXRCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdISycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTU1LThlYWVjMjBlLTVlZGMtMTFlNy05YzViLTZkYzY5ZmM0MmY1ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cDovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaGl0YnRjLWNvbS9oaXRidGMtYXBpL2Jsb2IvbWFzdGVyL0FQSXYxLm1kJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGl0YnRjLmNvbS9mZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmhpdGJ0Yy5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDA1MTQ4NjA1LUZlZXMtYW5kLWxpbWl0cycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdHJhZGVzL3JlY2VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hY3RpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnkvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwYXltZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3RyYW5zYWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX3RyYWRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5b3V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGhhcmRjb2RlZCBmZWVzIGFyZSBkZXByZWNhdGVkIGFuZCBzaG91bGQgb25seSBiZSB1c2VkIHdoZW4gdGhlcmUncyBubyBvdGhlciB3YXkgdG8gZ2V0IGZlZSBpbmZvXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAxIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAyMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAxOC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAuMDAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAyNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiA1MDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogODYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAxMTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDEyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiA0NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMi41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiA0LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAxMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAuODgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogNTc0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDEyMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNjI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAuMDAxNzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMTYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogNS40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDQ1NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMTIzLjAwMTA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDIwMi45NTk4MzA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDEuODQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDY2LjEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAuMDAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDEuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAxNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAxMDgyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAxMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMC4zNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiA3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogNTkxMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMTMwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAuMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogNS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMS4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAxMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogOTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMy45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDE2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAzLjk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDk5OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAxMy4zOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMzM1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAyLjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMC41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAzLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMTE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAuODcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogNzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAzOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiA2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogNjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiA4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDEzOTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLjAzNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiA1MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMTQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogNjE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDIuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAzLjIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMC45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMTQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDE5MSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1NOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RJQ0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RMVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET1YnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQ0FUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVhOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVRUwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0JSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJTUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdCQ0MnOiAnQkNDJyxcbiAgICAgICAgICAgICAgICAnWEJUJzogJ0JUQycsXG4gICAgICAgICAgICAgICAgJ0RSSyc6ICdEQVNIJyxcbiAgICAgICAgICAgICAgICAnQ0FUJzogJ0JpdENsYXZlJyxcbiAgICAgICAgICAgICAgICAnVVNEJzogJ1VTRFQnLFxuICAgICAgICAgICAgICAgICdFTUdPJzogJ01HTycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9scyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3N5bWJvbHMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3N5bWJvbHMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0Wydjb21tb2RpdHknXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGxvdCA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdsb3QnKTtcbiAgICAgICAgICAgIGxldCBzdGVwID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3N0ZXAnKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdzdGVwJzogc3RlcCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAncHJvdmlkZUxpcXVpZGl0eVJhdGUnKSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZUxpcXVpZGl0eVJhdGUnKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ2xvdCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3N0ZXAnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSB0aGlzLnNhZmVTdHJpbmcgKHBhcmFtcywgJ3R5cGUnLCAndHJhZGluZycpO1xuICAgICAgICBtZXRob2QgKz0gJ0dldEJhbGFuY2UnO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgJ3R5cGUnKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdIChxdWVyeSk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSB0aGlzLnNhZmVGbG9hdC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ICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbNF0sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsxXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbMl0pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2V4ZWNRdWFudGl0eScpO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgYW1vdW50ICo9IG1hcmtldFsnbG90J107XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2V4ZWNQcmljZScpO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICBsZXQgZmVlID0ge1xuICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKSxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyYXRlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWVzdGFtcCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0cmFkZUlkJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB0cmFkZVsnY2xpZW50T3JkZXJJZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9sVHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgIC8vICdmcm9tJzogMCxcbiAgICAgICAgICAgIC8vICd0aWxsJzogMTAwLFxuICAgICAgICAgICAgLy8gJ2J5JzogJ3RzJywgLy8gb3IgYnkgdHJhZGVfaWRcbiAgICAgICAgICAgIC8vICdzb3J0JzogJ2Rlc2MnLCAvLyBvciBhc2NcbiAgICAgICAgICAgIC8vICdzdGFydF9pbmRleCc6IDAsXG4gICAgICAgICAgICAvLyAnbWF4X3Jlc3VsdHMnOiAxMDAwLFxuICAgICAgICAgICA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LmFicyAoZGlmZmVyZW5jZSkgPiBtYXJrZXRbJ3N0ZXAnXSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBvcmRlciBhbW91bnQgc2hvdWxkIGJlIGV2ZW5seSBkaXZpc2libGUgYnkgbG90IHVuaXQgc2l6ZSBvZiAnICsgbWFya2V0Wydsb3QnXS50b1N0cmluZyAoKSk7XG4gICAgICAgIGxldCBjbGllbnRPcmRlcklkID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjbGllbnRPcmRlcklkJzogY2xpZW50T3JkZXJJZC50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncXVhbnRpdHknOiB3aG9sZUxvdHMudG9TdHJpbmcgKCksIC8vIHF1YW50aXR5IGluIGludGVnZXIgbG90IHVuaXRzXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsndGltZUluRm9yY2UnXSA9ICdGT0snO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudHJhZGluZ1Bvc3ROZXdPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2VbJ0V4ZWN1dGlvblJlcG9ydCddLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlb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sZXQgYW1vdW50RGVmaW5lZCA9ICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJyk7XG4gICAgICAgIGxldCByZW1haW5pbmdEZWZpbmVkID0gKHR5cGVvZiByZW1haW5pbmcgIT09ICd1bmRlZmluZWQnKTtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmIChhbW91bnREZWZpbmVkKVxuICAgICAgICAgICAgICAgIGFtb3VudCAqPSBtYXJrZXRbJ2xvdCddO1xuICAgICAgICAgICAgaWYgKHJlbWFpbmluZ0RlZmluZWQpXG4gICAgICAgICAgICAgICAgcmVtYWluaW5nICo9IG1hcmtldFsnbG90J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFtb3VudERlZmluZWQpIHtcbiAgICAgICAgICAgIGlmIChyZW1haW5pbmdEZWZpbmVkKSB7XG4gICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgICAgIGNvc3QgPSBhdmVyYWdlUHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydjbGllbnRPcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5c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gcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB7ICdub25jZSc6IG5vbmNlLCAnYXBpa2V5JzogdGhpcy5hcGlLZXkgfTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHBheWxvYWQsIHF1ZXJ5KTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGF5bG9hZCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHVybDtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICA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zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICdNMScsXG4gICAgICAgICAgICAgICAgJzNtJzogJ00zJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnTTUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnTTE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJ00zMCcsIC8vIGRlZmF1bHRcbiAgICAgICAgICAgICAgICAnMWgnOiAnSDEnLFxuICAgICAgICAgICAgICAgICc0aCc6ICdINCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJ0QxJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnRDcnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU1NS04ZWFlYzIwZS01ZWRjLTExZTctOWM1Yi02ZGM2OWZjNDJmNWUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmhpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9oaXRidGMuY29tLz9yZWZfaWQ9NWE1ZDM5YTY1ZDQ2NicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGl0YnRjLmNvbS9mZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmhpdGJ0Yy5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDA1MTQ4NjA1LUZlZXMtYW5kLWxpbWl0cycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJywgLy8gQXZhaWxhYmxlIEN1cnJlbmN5IFN5bWJvbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wve3N5bWJvbH0nLCAvLyBHZXQgc3ltYm9sIGluZm9cbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsIC8vIEF2YWlsYWJsZSBDdXJyZW5jaWVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2N1cnJlbmN5fScsIC8vIEdldCBjdXJyZW5jeSBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJywgLy8gVGlja2VyIGxpc3QgZm9yIGFsbCBzeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JywgLy8gVGlja2VyIGZvciBzeW1ib2xcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLCAvLyBUcmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve3N5bWJvbH0nLCAvLyBPcmRlcmJvb2tcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3tzeW1ib2x9JywgLy8gQ2FuZGxlc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBMaXN0IHlvdXIgY3VycmVudCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIEdldCBhIHNpbmdsZSBvcmRlciBieSBjbGllbnRPcmRlcklkXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9iYWxhbmNlJywgLy8gR2V0IHRyYWRpbmcgYmFsYW5jZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvZmVlL3tzeW1ib2x9JywgLy8gR2V0IHRyYWRpbmcgZmVlIHJhdGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkvb3JkZXInLCAvLyBHZXQgaGlzdG9yaWNhbCBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyL3tpZH0vdHJhZGVzJywgLy8gR2V0IGhpc3RvcmljYWwgdHJhZGVzIGJ5IHNwZWNpZmllZCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYmFsYW5jZScsIC8vIEdldCBtYWluIGFjY2NvdW50IGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucycsIC8vIEdldCBhY2NvdW50IHRyYW5zYWN0aW9uc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNhY3Rpb25zL3tpZH0nLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbiBieSBpZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIEdldCBkZXBvc2l0IGNyeXBybyBhZGRyZXNzXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ3JlYXRlIG5ldyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3JywgLy8gV2l0aGRyYXcgY3J5cHJvXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vYWRkcmVzcy97Y3VycmVuY3l9JywgLy8gQ3JlYXRlIG5ldyBkZXBvc2l0IGNyeXBybyBhZGRyZXNzXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2ZlcicsIC8vIFRyYW5zZmVyIGFtb3VudCB0byB0cmFkaW5nXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gQ3JlYXRlIG5ldyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBDb21taXQgd2l0aGRyYXcgY3J5cHJvXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLCAvLyBDYW5jZWwgYWxsIG9wZW4gb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gQ2FuY2VsIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9jcnlwdG8vd2l0aGRyYXcve2lkfScsIC8vIFJvbGxiYWNrIHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncGF0Y2gnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIve2NsaWVudE9yZGVySWR9JywgLy8gQ2FuY2VsIFJlcGxhY2Ugb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogLTAuMDEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0MnOiAwLjAwMTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDk1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC41MDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnMVNUJzogMC44NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiA1LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUUnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUVPTic6IDAuMDEwMDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlSJzogNTY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNTSc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUCc6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQ0EnOiAzNTEuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQVBQJzogOTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMzAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZJJzogNjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0wnOiAxMy44NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUEFZJzogNS40ODcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1NOTyc6IDE2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUWCc6IDE0NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiA4LjQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVEEnOiAxMi45NDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDVCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRERGJzogMzQyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiAxMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RJQ0UnOiAwLjMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RMVCc6IDAuMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMC4yMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdET1YnOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlBVJzogMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJUJzogMjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTSCc6IDAuMDE3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCRVQnOiA4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDJzogMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQ09MRCc6IDYuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQ0FUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAyLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUtPJzogMTEzNi4zNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUdPJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMTYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogNS40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDQ1NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQ04nOiAwLjAwMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMTIzLjAwMTA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDIwMi45NTk4MzA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDEuODQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDY2LjEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBTUUnOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAxNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAxMDgyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAxMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMC4zNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiA3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogNzkwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lUUyc6IDE1LjAwMTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhUJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0JSJzogMTQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiAxMTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS01EJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFTkQnOiAzODgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMTMwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xPQyc6IDExLjA3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuMzU3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkdDJzogMi4zNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogMS4yMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQyc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDIuMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JEJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAyLjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDE2NDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tJTic6IDQwNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV0ZUQyc6IDM1Mi45NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTVMnOiAwLjAzNzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05DJzogMzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDQ4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDIzMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEFSJzogMC4xNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RPUk0nOiAxNTMuMTksXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTUEYnOiAxNC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUVSc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDE3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUic6IDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dUJzogMC41MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMC45MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQlQnOiAyLjM3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RGTCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJTUUnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJWCc6IDcuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS04nOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RHVCc6IDE3MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiA4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDI3MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVRVQnOiA0ODAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUdUJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVRUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXUkMnOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlBVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQ09MRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNR08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hWTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tJTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGZlZSkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAoZmVlLCA4KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9sICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBsb3QgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAncXVhbnRpdHlJbmNyZW1lbnQnKTtcbiAgICAgICAgICAgIGxldCBzdGVwID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3RpY2tTaXplJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0Wyd0aWNrU2l6ZSddKSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3F1YW50aXR5SW5jcmVtZW50J10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICd0YWtlTGlxdWlkaXR5UmF0ZScpO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Byb3ZpZGVMaXF1aWRpdHlSYXRlJyk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90ICogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5IChwYXJhbX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gICAgICAgICAgaWYgKGN1cnJlbmN5WydkaXNhYmxlZCddKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnZGlzYWJsZWQnO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSAnZmlhdCc7XG4gICAgICAgICAgICBpZiAoKCdjcnlwdG8nIGluIGN1cnJlbmN5KSAmJiBjdXJyZW5jeVsnY3J5cHRvJ10pXG4gICAgICAgICAgICAgICAgdHlwZSA9ICdjcnlwdG8nO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAgICAgJ3BheWluJzogcGF5aW4sXG4gICAgICAgICAgICAgICAgJ3BheW91dCc6IHBheW91dCxcbiAgICAgICAgICAgICAgICAndHJhbnNmZXInOiB0cmFuc2ZlcixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ2Z1bGxOYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICdwYXlvdXRGZWUnKSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0eXBlID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ3RyYWRpbmcnKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlR2V0JyArIHRoaXMuY2FwaXRhbGl6ZSAodHlwZSkgKyAnQmFsYW5jZSc7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXNbbWV0aG9kXSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydyZXNlcnZlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzFkJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob2hsY3ZbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIHRpbWVzdGFtcCxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WydvcGVuJ10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HtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgaWQgPSB0cmFkZVsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IG1hcmtldCA/IG1hcmtldFsncXVvdGUnXSA6IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgb3JkZXJJZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdjbGllbnRPcmRlcklkJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIG9yZGVySWQgPSB0cmFkZVsnY2xpZW50T3JkZXJJZCddO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncXVhbnRpdHknKTtcbiAgICAgICAgbGV0IGNvc3QgPSBwcmljZSAq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3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAvLyB0aGVpciBtYXggYWNjZXB0ZWQgbGVuZ3RoIGlzIDMyIGNoYXJhY3RlcnNcbiAgICAgICAgbGV0IHV1aWQgPSB0aGlzLnV1aWQgKCk7XG4gICAgICAgIGxldCBwYXJ0cyA9IHV1aWQuc3BsaXQgKCctJyk7XG4gICAgICAgIGxldCBjbGllbnRPcmRlcklkID0gcGFydHMuam9pbiAoJycpO1xuICAgICAgICBjbGllbnRPcmRlcklkID0gY2xpZW50T3JkZXJJZC5zbGljZSAoMCwgMzIpO1xuICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0IChhbW91bnQpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjbGllbnRPcmRlcklkJzogY2xpZW50T3JkZXJJZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncXVhbnRpdHknOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKSB7XG4gICAgICAgICAgICByZXF1ZXN0WydwcmljZSddID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3RpbWVJbkZvcmNlJ10gPSAnRk9LJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVz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ICAgICAgICBwcmljZSA9IHRoaXMub3JkZXJzW2lkXVsncHJpY2UnXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVtYWluaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29zdCA9IGZpbGxlZCAqIHByaWNlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogY3JlYXRlZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAoY3JlYXRlZCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdXBkYXRlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4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KHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5lbmNvZGUgKHRoaXMuYXBpS2V5ICsgJzonICsgdGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLnN0cmluZ1RvQmFzZTY0IChwYXlsb2FkKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiAnQmFzaWMgJyArIHRoaXMuZGVjb2RlIChhdXRoKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIGJvZHk7XG4gICAgICAgICAgICAvLyB7XCJjb2RlXCI6NTA0LFwibWVzc2FnZVwiOlwiR2F0ZXdheSBUaW1lb3V0XCIsXCJkZXNjcmlwdGlvblwiOlwiXCJ9XG4gICAgICAgICAgICBpZiAoKGNvZGUgPT09IDUwMykgfHwgKGNvZGUgPT09IDUwNCkpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChmZWVkYmFjayk7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnZXJyb3InXVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT09ICdPcmRlciBub3QgZm91bmQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIG9yZGVyIG5vdCBmb3VuZCBpbiBhY3RpdmUgb3JkZXJzJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdRdWFudGl0eSBub3QgYSB2YWxpZCBudW1iZXInKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnRHVwbGljYXRlIGNsaWVudE9yZGVySWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAg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G4gICAgICAgICAgICAgICAgJzFtJzogJzAwMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzAwNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcwMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMDMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMDYwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTAwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMjAwJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMzAwJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnNDAwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTY5LTE1YWE3YjlhLTVlZGQtMTFlNy05ZTdmLTQ0NzkxZjRlZTQ5Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cDovL2FwaS5odW9iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaHVvYmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jc19lbi93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdzdGF0aWNtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfV9rbGluZV97cGVyaW9kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH1fe2xlbmd0aH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RldGFpbF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2RtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfV9rbGluZV97cGVyaW9kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoX3tpZH1fe2xlbmd0aH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RldGFpbF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FjY291bnRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlfbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsX21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbmV3X2RlYWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJfaWRfYnlfdHJhZGVfaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF93aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfd2l0aGRyYXdfY29pbl9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9sb2FuX2F2YWlsYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQ05ZJzogeyAnaWQnOiAnYnRjJywgJ3N5bWJvbCc6ICdCVEMvQ05ZJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NOWScsICd0eXBlJzogJ3N0YXRpY21hcmtldCcsICdjb2luVHlwZSc6IDEgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0NOWSc6IHsgJ2lkJzogJ2x0YycsICdzeW1ib2wnOiAnTFRDL0NOWScsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdDTlknLCAndHlwZSc6ICdzdGF0aWNtYXJrZXQnLCAnY29pblR5cGUnOiAyIH0sXG4gICAgICAgICAgICAgICAgLy8gJ0JUQy9VU0QnOiB7ICdpZCc6ICdidGMnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ3R5cGUnOiAndXNkbWFya2V0JywgICAgJ2NvaW5UeXBlJzogMSB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnRyYWRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGF2YWlsYWJsZSA9ICdhdmFpbGFibGVfJyArIGxvd2VyY2FzZSArICdfZGlzcGxheSc7XG4gICAgICAgICAgICBsZXQgZnJvemVuID0gJ2Zyb3plbl8nICsgbG93ZXJjYXNlICsgJ19kaXNwbGF5JztcbiAgICAgICAgICAgIGxldCBsb2FuID0gJ2xvYW5fJyArIGxvd2VyY2FzZSArICdfZGlzcGxheSc7XG4gICAgICAgICAgICBpZiAoYXZhaWxhYmxlIGluIGJhbGFuY2VzKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2F2YWlsYWJsZV0pO1xuICAgICAgICAgICAgaWYgKGZyb3plbiBpbiBiYWxhbmNlcylcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlc1tmcm96ZW5dKTtcbiAgICAgICAgICAgIGlmIChsb2FuIGluIGJhbGFuY2VzKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA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WNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWyd0cyddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydkaXJlY3Rpb24nXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IG1hcmtldFsndHlwZSddICsgJ0dldERldGFpbElkJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJ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ZXJBZ2VudCc6IHRoaXMudXNlckFnZW50c1snY2hyb21lMzknXSxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdhY2NvdW50cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhY2NvdW50c0J5SWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaG9zdG5hbWUnOiAnYXBpLmh1b2JpcHJvLmNvbScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9IQ0xWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkaW5nTGltaXRzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW1pbicsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG1pbicsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwbWluJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWRheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMW1vbicsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5ZWFyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTY5LTE1YWE3YjlhLTVlZGQtMTFlNy05ZTdmLTQ0NzkxZjRlZTQ5Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuaHVvYmlwcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmh1b2JpcHJvLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaHVvYmlhcGkvQVBJX0RvY3Mvd2lraS9SRVNUX2FwaV9yZWZlcmVuY2UnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3Lmh1b2JpcHJvLmNvbS9hYm91dC9mZWUvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9rbGluZScsIC8vIOiOt+WPlkvnur/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwvbWVyZ2VkJywgLy8g6I635Y+W6IGa5ZCI6KGM5oOFKFRpY2tlcilcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsIC8vIOiOt+WPliBNYXJrZXQgRGVwdGgg5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLCAvLyDojrflj5YgVHJhZGUgRGV0YWlsIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvdHJhZGUnLCAvLyDmibnph4/ojrflj5bmnIDov5HnmoTkuqTmmJPorrDlvZVcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwnLCAvLyDojrflj5YgTWFya2V0IERldGFpbCAyNOWwj+aXtuaIkOS6pOmHj+aVsOaNrlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vc3ltYm9scycsIC8vIOafpeivouezu+e7n+aUr+aMgeeahOaJgOacieS6pOaYk+WvuVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbW1vbi9jdXJyZW5jeXMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInluIHnp41cbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vdGltZXN0YW1wJywgLy8g5p+l6K+i57O757uf5b2T5YmN5pe26Ze0XG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL2V4Y2hhbmdlJywgLy8gb3JkZXIgbGltaXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2V0dGluZ3MvY3VycmVuY3lzJywgLy8gP2xhbmd1YWdlPWVuLVVTXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2FjY291bnRzJywgLy8g5p+l6K+i5b2T5YmN55So5oi355qE5omA5pyJ6LSm5oi3KOWNs2FjY291bnQtaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cy97aWR9L2JhbGFuY2UnLCAvLyDmn6Xor6LmjIflrprotKbmiLfnmoTkvZnpop1cbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfScsIC8vIOafpeivouafkOS4quiuouWNleivpuaDhVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L21hdGNocmVzdWx0cycsIC8vIOafpeivouafkOS4quiuouWNleeahOaIkOS6pOaYjue7hlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycycsIC8vIOafpeivouW9k+WJjeWnlOaJmOOAgeWOhuWPsuWnlOaJmFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL21hdGNocmVzdWx0cycsIC8vIOafpeivouW9k+WJjeaIkOS6pOOAgeWOhuWPsuaIkOS6pFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwvYWRkcmVzc2VzJywgLy8g5p+l6K+i6Jma5ouf5biB5o+Q546w5Zyw5Z2AXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvZGVwb3NpdC12aXJ0dWFsL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVlcnkvZGVwb3NpdC13aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luL2xvYW4tb3JkZXJzJywgLy8g5YCf6LS36K6i5Y2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luL2FjY291bnRzL2JhbGFuY2UnLCAvLyDlgJ/otLfotKbmiLfor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3BsYWNlJywgLy8g5Yib5bu65bm25omn6KGM5LiA5Liq5paw6K6i5Y2VICjkuIDmraXkuIvljZXvvIwg5o6o6I2Q5L2/55SoKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycycsIC8vIOWIm+W7uuS4gOS4quaWsOeahOiuouWNleivt+axgiDvvIjku4XliJvlu7rorqLljZXvvIzkuI3miafooYzkuIvljZXvvIlcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9wbGFjZScsIC8vIOaJp+ihjOS4gOS4quiuouWNlSDvvIjku4XmiafooYzlt7LliJvlu7rnmoTorqLljZXvvIlcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9zdWJtaXRjYW5jZWwnLCAvLyDnlLPor7fmkqTplIDkuIDkuKrorqLljZXor7fmsYJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMvYmF0Y2hjYW5jZWwnLCAvLyDmibnph4/mkqTplIDorqLljZVcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy9iYWxhbmNlL3RyYW5zZmVyJywgLy8g6LWE5Lqn5YiS6L2sXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvd2l0aGRyYXcvYXBpL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwvY3JlYXRlJywgLy8g55Sz6K+35o+Q546w6Jma5ouf5biBXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvd2l0aGRyYXctdmlydHVhbC97aWR9L3BsYWNlJywgLy8g56Gu6K6k55Sz6K+36Jma5ouf5biB5o+Q546wXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvd2l0aGRyYXctdmlydHVhbC97aWR9L2NhbmNlbCcsIC8vIOeUs+ivt+WPlua2iOaPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3RyYW5zZmVyLWluL21hcmdpbicsIC8vIOeOsOi0p+i0puaIt+WIkuWFpeiHs+WAn+i0t+i0puaIt1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3RyYW5zZmVyLW91dC9tYXJnaW4nLCAvLyDlgJ/otLfotKbmiLfliJLlh7roh7PnjrDotKfotKbmiLdcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW4vb3JkZXJzJywgLy8g55Sz6K+35YCf6LS3XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luL29yZGVycy97aWR9L3JlcGF5JywgLy8g5b2S6L+Y5YCf6LS3XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdhY2NvdW50LWZyb3plbi1iYWxhbmNlLWluc3VmZmljaWVudC1lcnJvcic6IEluc3VmZmljaWVudEZ1bmRzLCAvLyB7XCJzdGF0dXNcIjpcImVycm9yXCIsXCJlcnItY29kZVwiOlwiYWNjb3VudC1mcm96ZW4tYmFsYW5jZS1pbnN1ZmZpY2llbnQtZXJyb3JcIixcImVyci1tc2dcIjpcInRyYWRlIGFjY291bnQgYmFsYW5jZSBpcyBub3QgZW5vdWdoLCBsZWZ0OiBgMC4wMDI3YFwiLFwiZGF0YVwiOm51bGx9XG4gICAgICAgICAgICAgICAgJ29yZGVyLWxpbWl0b3JkZXItYW1vdW50LW1pbi1lcnJvcic6IEludmFsaWRPcmRlciwgLy8gbGltaXQgb3JkZXIgYW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krKykge1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIHRoaXMubWFya2V0c1tzeW1ib2xdID0gdGhpcy5kZWVwRXh0ZW5kICh0aGlzLm1hcmtldHNbc3ltYm9sXSwge1xuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzW3N5bWJvbF0sXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0cztcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRpbmdMaW1pdHMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIC8vICBieSBkZWZhdWx0IGl0IHdpbGwgdHJ5IGxvYWQgd2l0aGRyYXdhbCBmZWVzIG9mIGFsbCBjdXJyZW5jaWVzICh3aXRoIHNlcGFyYXRlIHJlcXVlc3RzKVxuICAgICAgICAvLyAgaG93ZXZlciBpZiB5b3UgZGVmaW5lIGNvZGVzID0gWyAnRVRIJywgJ0JUQycgXSBpbiBhcmdzIGl0IHdpbGwgb25seSBsb2FkIHRob3NlXG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBpbmZvID0ge307XG4gICAgICAgIGxldCBsaW1pdHMgPSB7fTtcbiAgICAgICAgaWYgKHR5cGVvZiBzeW1ib2xzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN5bWJvbHMgPSB0aGlzLnN5bWJvbHM7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc3ltYm9scy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHN5bWJvbHNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldENvbW1vbkV4Y2hhbmdlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICBsZXQgbGltaXQgPSB0aGlzLnBhcnNlVHJhZGluZ0xpbWl0cyAocmVzcG9uc2UpO1xuICAgICAgICAgICAgaW5mb1tzeW1ib2xdID0gcmVzcG9uc2U7XG4gICAgICAgICAgICBsaW1pdHNbc3ltYm9sXSA9IGxpbWl0O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgJ2luZm8nOiBpbmZvLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGluZ0xpbWl0cyAocmVzcG9uc2UsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGRhdGEgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBpZiAodHlwZW9mIGRhdGEgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICdtaW4nOiBkYXRhWydsaW1pdC1vcmRlci1tdXN0LWdyZWF0ZXItdGhhbiddLFxuICAgICAgICAgICAgICAgICdtYXgnOiBkYXRhWydsaW1pdC1vcmRlci1tdXN0LWxlc3MtdGhhbiddLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWV0aG9kID0gdGhpcy5vcHRpb25zWydmZXRjaE1hcmtldHNNZXRob2QnXTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBudW1NYXJrZXRzID0gbWFya2V0cy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1NYXJrZXRzIDwgMSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBwdWJsaWNHZXRDb21tb25TeW1ib2xzIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChtYXJrZXRzKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2Jhc2UtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZS1jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBxdW90ZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGlkID0gYmFzZUlkICsgcXVvdGVJZDtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydhbW91bnQtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZS1wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSAoYmFzZSA9PT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IChiYXNlID09PSAnT01HJykgPyAwIDogMC4yIC8gMTAwO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgaWYgKCd0cycgaW4gdGlja2VyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGlja2VyWyd0cyddO1xuICAgICAgICBsZXQgYmlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgYXNrID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgYmlkVm9sdW1lID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgYXNrVm9sdW1lID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2JpZCcgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSAodGlja2VyWydiaWQnXSkpIHtcbiAgICAgICAgICAgICAgICBiaWQgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydiaWQnXSwgMCk7XG4gICAgICAgICAgICAgICAgYmlkVm9sdW1lID0gdGhpcy5zYWZ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0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3NpemUnXSA9IGxpbWl0O1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMubWFya2V0R2V0SGlzdG9yeUtsaW5lICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT0hMQ1ZzIChyZXNwb25zZVsnZGF0YSddLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBsb2FkQWNjb3VudHMgKHJlbG9hZCA9IGZhbHNlKSB7XG4gICAgICAgIGlmIChyZWxvYWQpIHtcbiAgICAgICAgICAgIHRoaXMuYWNjb3VudHMgPSBhd2FpdCB0aGlzLmZldGNoQWNjb3VudHMgKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAodGhpcy5hY2NvdW50cykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmFjY291bnRzO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLmFjY291bnRzID0gYXdhaXQgdGhpcy5mZXRjaEFjY291bnRzICgpO1xuICAgICAgICAgICAgICAgIHRoaXMuYWNjb3VudHNCeUlkID0gdGhpcy5pbmRleEJ5ICh0aGlzLmFjY291bnRzLCAnaWQnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5hY2NvdW50cztcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEFjY291bnRzICgpIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEFjY291bnRzICgpO1xuICAgICAgICByZXR1cm4gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0U2V0dGluZ3NDdXJyZW5jeXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbGFuZ3VhZ2UnOiB0aGlzLm9wdGlvbnNbJ2xhbmd1YWdlJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgLy9cbiAgICAgICAgICAgIC8vICB7ICAgICAgICAgICAgICAgICAgICAgbmFtZTogXCJjdHhjXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAgJ2Rpc3BsYXktbmFtZSc6IFwiQ1RYQ1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICd3aXRoZHJhdy1wcmVjaXNpb24nOiAgOCxcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICdjdXJyZW5jeS10eXBlJzogXCJldGhcIixcbiAgICAgICAgICAgIC8vICAgICAgICAnY3VycmVuY3ktcGFydGl0aW9uJzogXCJwcm9cIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICdzdXBwb3J0LXNpdGVzJzogIG51bGwsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAnb3RjLWVuYWJsZSc6ICAwLFxuICAgICAgICAgICAgLy8gICAgICAgICdkZXBvc2l0LW1pbi1hbW91bnQnOiBcIjJcIixcbiAgICAgICAgICAgIC8vICAgICAgICd3aXRoZHJhdy1taW4tYW1vdW50JzogXCI0XCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICdzaG93LXByZWNpc2lvbic6IFwiOFwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0OiBcIjI5ODhcIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgdmlzaWJsZTogIHRydWUsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAgJ2RlcG9zaXQtZGVzYyc6IFwiUGxlYXNlIGRvbuKAmXQgZGVwb3NpdCBhbnkgb3RoZXIgZGlnaXRhbCBhc3NldHMgZXhjZXB0IENUWEMgdOKAplwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgJ3dpdGhkcmF3LWRlc2MnOiBcIk1pbmltdW0gd2l0aGRyYXdhbCBhbW91bnQ6IDQgQ1RYQy4gIT5fPCFGb3Igc2VjdXJpdHkgcmVhc29u4oCmXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgJ2RlcG9zaXQtZW5hYmxlZCc6ICB0cnVlLFxuICAgICAgICAgICAgLy8gICAgICAgICAgJ3dpdGhkcmF3LWVuYWJsZWQnOiAgdHJ1ZSxcbiAgICAgICAgICAgIC8vICAgICdjdXJyZW5jeS1hZGRyLXdpdGgtdGFnJzogIGZhbHNlLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgJ2Zhc3QtY29uZmlybXMnOiAgMTUsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAnc2FmZS1jb25maXJtcyc6ICAzMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAvL1xuICAgICAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlVmFsdWUgKGN1cnJlbmN5LCAnbmFtZScpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHRoaXMuc2FmZUludGVnZXIgKGN1cnJlbmN5LCAnd2l0aGRyYXctcHJlY2lzaW9uJyk7XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZC50b1VwcGVyQ2FzZSAoKSk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gY3VycmVuY3lbJ3Zpc2libGUnXSAmJiBjdXJyZW5jeVsnZGVwb3NpdC1lbmFibGVkJ10gJiYgY3VycmVuY3lbJ3dpdGhkcmF3LWVuYWJsZWQnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiAnY3J5cHRvJyxcbiAgICAgICAgICAgICAgICAvLyAncGF5aW4nOiBjdXJyZW5jeVsnZGVwb3NpdC1lbmFibGVkJ10sXG4gICAgICAgICAgICAgICAgLy8gJ3BheW91dCc6IGN1cnJlbmN5Wyd3aXRoZHJhdy1lbmFibGVkJ10sXG4gICAgICAgICAgICAgICAgLy8gJ3RyYW5zZmVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ2Rpc3BsYXktbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IGFjdGl2ZSA/ICdvaycgOiAnZGlzYWJsZWQnLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG8gbmVlZCB0byBmZXRjaCBmcm9tIGZlZSBlbmRwb2ludFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICdkZXBvc2l0LW1pbi1hbW91bnQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICd3aXRoZHJhdy1taW4tYW1vdW50JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QWNjb3VudHNJZEJhbGFuY2UgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLmFjY291bnRzWzBdWydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXVsnbGlzdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gYmFsYW5jZVsnY3VycmVuY3knXS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KVxuICAgICAgICAgICAgICAgIGFjY291bnQgPSByZXN1bHRbY3VycmVuY3ldO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoYmFsYW5jZVsndHlwZSddID09PSAndHJhZGUnKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IH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HN0YXR1cyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCd0eXBlJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgbGV0IG9yZGVyVHlwZSA9IG9yZGVyWyd0eXBlJ10uc3BsaXQgKCctJyk7XG4gICAgICAgICAgICBzaWRlID0gb3JkZXJUeXBlWzBdO1xuICAgICAgICAgICAgdHlwZSA9IG9yZGVyVHlwZVsxXTtcbiAgICAgICAgICAgIHN0YXR1cyA9IHRoaXMucGFyc2VPcmRlclN0YXR1cyAob3JkZXJbJ3N0YXRlJ10pO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBpZiAoJ3N5bWJvbCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0SWQgPSBvcmRlclsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJbJ2NyZWF0ZWQtYXQnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWFtb3VudCddKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IHByaWNlID0gdG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gICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICB1cmwgKz0gYXBpO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uO1xuICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy55bWRobXMgKHRoaXMubWlsbGlzZWNvbmRzICgpLCAnVCcpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ1NpZ25hdHVyZU1ldGhvZCc6ICdIbWFjU0hBMjU2JyxcbiAgICAgICAgICAgICAgICAnU2lnbmF0dXJlVmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICAgICAnQWNjZXNzS2V5SWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnVGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy51cmxlbmNvZGUgKHJlcXVlc3QpO1xuICAgICAgICAgICAgLy8gdW5mb3J0dW5hdGVseSwgUEhQIGRlbWFuZHMgZG91YmxlIHF1b3RlcyBmb3IgdGhlIGVzY2FwZWQgbmV3bGluZSBzeW1ib2xcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBxdW90ZXNcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gWyBtZXRob2QsIHRoaXMuaG9zdG5hbWUsIHVybCwgYXV0aCBdLmpvaW4gKFwiXFxuXCIpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHBheWxvYWQpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgYXV0aCArPSAnJicgKyB0aGlzLnVybGVuY29kZSAoeyAnU2lnbmF0dXJlJzogc2lnbmF0dXJlIH0pO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIGF1dGg7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N0YXR1cycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICB7XCJzdGF0dXNcIjpcImVycm9yXCIsXCJlcnItY29kZVwiOlwib3JkZXItbGltaXRvcmRlci1hbW91bnQtbWluLWVycm9yXCIsXCJlcnItbXNnXCI6XCJsaW1pdCBvcmRlciBhbW91bnQgZXJyb3IsIG1pbjogYDAuMDAxYFwiLFwiZGF0YVwiOm51bGx9XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAg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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBpY2UzeCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnaWNlM3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnSUNFM1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdaQScsIC8vIFNvdXRoIEFmcmljYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzgwMTIxNzYtMTE2MTZjMzItMzI2OS0xMWU4LTlmMDUtZTY1Y2Y4ODViYjE1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2ljZTN4LmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2ljZTN4LmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2ljZTN4LmNvLnphJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9pY2UzeC5jby56YS9pY2UtY3ViZWQtYml0Y29pbi1leGNoYW5nZS1hcGktZG9jdW1lbnRhdGlvbi0xLWp1bmUtMjAxNycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hlbHAuaWNlMy5jb20vc3VwcG9ydC9zb2x1dGlvbnMvYXJ0aWNsZXMvMTEwMDAwMzMyOTMtdHJhZGluZy1mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGVscC5pY2UzLmNvbS9zdXBwb3J0L3NvbHV0aW9ucy9hcnRpY2xlcy8xMTAwMDAzMzI4OC1mZWVzLWV4cGxhaW5lZCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hlbHAuaWNlMy5jb20vc3VwcG9ydC9zb2x1dGlvbnMvYXJ0aWNsZXMvMTEwMDAwMDgxMzEtd2hhdC1hcmUteW91ci1maWF0LWRlcG9zaXQtYW5kLXdpdGhkcmF3YWwtZmVlcy0nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oZWxwLmljZTMuY29tL3N1cHBvcnQvc29sdXRpb25zL2FydGljbGVzLzExMDAwMDMzMjg5LWRlcG9zaXQtZmVlcycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpci9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL21hcmtldGRlcHRoZnVsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvbWFya2V0ZGVwdGhidGNhdicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvbWFya2V0ZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlL2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9uL2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9uL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ludm9pY2UvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW52b2ljZS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnZvaWNlL3BkZicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeUxpc3QgKHBhcmFtcyk7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gcmVzcG9uc2VbJ3Jlc3BvbnNlJ11bJ2VudGl0aWVzJ107XG4gICAgICAgIGxldCBwcmVjaXNpb24gPSB0aGlzLnByZWNpc2lvblsnYW1vdW50J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ2N1cnJlbmN5X2lkJ107XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeVsnaXNvJ10udG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgaWYgKCFPYmplY3Qua2V5cyAodGhpcy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VuY3lbJ2NvZGUnXSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF9wcmljZScpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdtYXgnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWluJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21heF9iaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbl9hc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXZnJyksXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRTdGF0c01hcmtldGRlcHRoZnVsbCAodGhpcy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GlzLnB1YmxpY0dldE9yZGVyYm9va0luZm8gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcl9pZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gcmVzcG9uc2VbJ3Jlc3BvbnNlJ11bJ2VudGl0aWVzJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICdhbW91bnQnKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2NyZWF0ZWQnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAndm9sdW1lJyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlICogYW1vdW50KSk7XG4gICAgICAgIGxldCBmZWUgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKTtcbiAgICAgICAgaWYgKGZlZSkge1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0aW1lc3Rh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ICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VMaXN0IChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXNwb25zZSddWydlbnRpdGllcyddO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gYmFsYW5jZVsnY3VycmVuY3lfaWQnXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gY3VycmVuY3lbJ2NvZGUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICdmcmVlJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAg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AgICAgICAgICBmZWUgPSB7ICdjb3N0JzogZmVlIH07XG4gICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ29yZGVyX2lkJyksXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlck5ldyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyX2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh7XG4gICAgICAgICAgICAnb3JkZXJfaWQnOiByZXNwb25zZVsncmVzcG9uc2UnXVsnZW50aXR5J11bJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAnY3JlYXRlZCc6IHRoaXMuc2Vjb25kcyAoKSxcbiAgICAgICAgICAgICdhY3RpdmUnOiAxLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAndm9sdW1lJzogYW1vdW50LFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IGFtb3VudCxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH0sIG1hcmtldCk7XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIG9yZGVyO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJDYW5jZWwgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnb3J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GxldCBhZGRyZXNzID0gdGhpcy5zYWZlU3RyaW5nIChiYWxhbmNlLCAnYWRkcmVzcycpO1xuICAgICAgICBsZXQgc3RhdHVzID0gYWRkcmVzcyA/ICdvaycgOiAnbm9uZSc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjb2RlLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3RhZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgcGFyYW1zID0gdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAocGFyYW1zLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcGFyYW1zO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd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duYW1lJzogJ0luZGVwZW5kZW50IFJlc2VydmUnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0FVJywgJ05aJyBdLCAvLyBBdXN0cmFsaWEsIE5ldyBaZWFsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNTIxNjYyLWNmM2Y0NzdjLTliY2ItMTFlNy04OWJjLWQxYWM4NTAxMmVkYS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbS9QdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5pbmRlcGVuZGVudHJlc2VydmUuY29tL1ByaXZhdGUnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmluZGVwZW5kZW50cmVzZXJ2ZS5jb20vQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRQcmltYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRTZWNvbmRhcnlDdXJyZW5jeUNvZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZExpbWl0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRNYXJrZXRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkVHJhbnNhY3Rpb25UeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZUhpc3RvcnlTdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRSZWNlbnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEZ4UmF0ZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTGltaXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGxhY2VNYXJrZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0Q2xvc2VkRmlsbGVkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckRldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERpZ2l0YWxDdXJyZW5jeURlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTeW5jaERpZ2l0YWxDdXJyZW5jeURlcG9zaXRBZGRyZXNzV2l0aEJsb2NrY2hhaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3RGlnaXRhbEN1cnJlbmN5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZXF1ZXN0RmlhdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgYmFzZUN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMgKCk7XG4gICAgICAgIGxldCBxdW90ZUN1cnJlbmNp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4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBpZCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3lDb2RlID0gYmFsYW5jZVsnQ3VycmVuY3lDb2RlJ107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3lDb2RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGJhbGFuY2VbJ0F2YWlsYWJsZUJhbGFuY2UnXTtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlWydUb3RhbEJhbGFuY2UnXTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ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k7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGxldCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICdPcGVuJzogJ29wZW4nLFxuICAgICAgICAgICAgJ1BhcnRpYWxseUZpbGxlZCc6ICdvcGVuJyxcbiAgICAgICAgICAgICdGaWxsZWQnOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICdQYXJ0aWFsbHlGaWxsZWRBbmRDYW5jZWxsZWQnOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJ0NhbmNlbGxlZCc6ICdjYW5jZWxlZCcsXG4gICAgICAgICAgICAnUGFydGlhbGx5RmlsbGVkQW5kRXhw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lzLnNhZmVGbG9hdCAodHJhZGUsICdWb2x1bWVUcmFkZWQnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdQcmltYXJ5Q3VycmVuY3lBbW91bnQnKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgc2lkZSA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdPcmRlclR5cGUnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBzaWRlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHNpZGUuaW5kZXhPZiAoJ0JpZCcpID49IDApXG4gICAgICAgICAgICAgICAgc2lkZSA9ICdidXknO1xuICAgICAgICAgICAgZWxzZSBpZiAoc2lkZS5pbmRleE9mICgnT2ZmZXInKSA+PSAwKVxuICAgICAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3Bya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T3JkZXIgKHsgJ29yZGVyR3VpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gW1xuICAgICAgICAgICAgICAgIHVybCxcbiAgICAgICAgICAgICAgICAnYXBpS2V5PScgKyB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2U9JyArIG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIC8vIHJlbW92ZSB0aGlzIGNyYXBcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IFtdO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICAgICAgcGF5bG9hZC5wdXNoIChrZXkgKyAnPScgKyBwYXJhbXNba2V5XSk7XG4gICAgICAgICAgIC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ltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNzQ0MzI4My0yZmRkZDBlNC0yODFjLTExZTgtOTc0MS1iNGYxNDE5MDAxYjUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaW5kb2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9pbmRvZGF4LmNvbS9kb3dubG9hZHMvQklUQ09JTkNPSUQtQVBJLURPQ1VNRU5UQVRJT04ucGRmJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUhpc3RvcnknLFxuICAg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G4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsncmV0dXJuJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY29kZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjb2Rlc1tpXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc1tjb2RlXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeVsnaWQnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gdGhpcy5zYWZlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSwgbG93ZXJjYXNlLCAwLjApO1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID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gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmlsbGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ3F1b3RlSWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2Jhc2VJZCddO1xuICAgICAgICAgICAgaWYgKChtYXJrZXRbJ3F1b3RlSWQnXSA9PT0gJ2lkcicpICYmICgnb3JkZXJfcnAnIGluIG9yZGVyKSlcbiAgICAgICAgICAgICAgICBxdW90ZUlkID0gJ3JwJztcbiAgICAgICAgICAgIGlmICgobWFya2V0WydiYXNlSWQnXSA9PT0gJ2lkcicpICYmICgncmVtYWluX3JwJyBpbiBvcmRlcikpXG4gICAgICAgICAgICAgICAgYmFzZUlkID0gJ3JwJztcbiAgICAgICAgICAgIGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcmRlcl8nICsgcXVvdGVJZCk7XG4gICAgICAgICAgICBpZiAoY29zdCkge1xuICAgICAgICAgICAgICAgIGFtb3VudCA9IGNvc3QgLyBwcmljZTtcbiAgICAgICAgICAgICAgICBsZXQgcmVtYWluaW5nQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JlbWFpbl8nICsgcXVvdGVJZCk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZW1haW5pbmdDb3N0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICByZW1haW5pbmcgPSByZW1haW5pbmdDb3N0IC8gcHJpY2U7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyXycgKyBiYXNlSWQpO1xuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5fJyArIGJhc2VJZCk7XG4gICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBhdmVyYWdlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoZmlsbGVkKVxuICAgICAgICAgICAgYXZlcmFnZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJbJ3N1Ym1pdF90aW1lJ10pO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2UsXG4gICAgICAgICAgICAnYW1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yAoKTtcbiAgICAgICAgLy8gYWx0ZXJuYXRpdmVseTpcbiAgICAgICAgLy8gbGV0IHJlcXVlc3RJZCA9IHRoaXMudXVpZCAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgICAgICd3aXRoZHJhd19hbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnd2l0aGRyYXdfYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAncmVxdWVzdF9pZCc6IHJlcXVlc3RJZC50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHRhZylcbiAgICAgICAgICAgIHJlcXVlc3RbJ3dpdGhkcmF3X21lbW8nXSA9IHRhZztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3Q29pbiAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICAvL1xuICAgICAgICAvLyAgICAge1xuICAgICAgICAvLyAgICAgICAgIFwic3VjY2Vzc1wiOiAxLFxuICAgICAgICAvLyAgICAgICAgIFwic3RhdHVzXCI6IFwiYXBwcm92ZWRcIixcbiAgICAgICAgLy8gICAgICAgICBcIndpdGhkcmF3X2N1cnJlbmN5XCI6IFwieHJwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19hZGRyZXNzXCI6IFwicndXcjdLVVozWkZ3emdhREdqS0J5c0FEQnl6eHZvaFEzQ1wiLFxuICAgICAgICAvLyAgICAgICAgIFwid2l0aGRyYXdfYW1vdW50XCI6IFwiMTAwMDAuMDAwMDAwMDBcIixcbiAgICAgICAgLy8gICAgICAgICBcImZlZVwiOiBcIjIuMDAwMDAwMDBcIixcbiAgICAgICAgLy8gICAgICAgICBcImFtb3VudF9hZnRlcl9mZWVcIjogXCI5OTk4LjAwMDAwMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJzdWJtaXRfdGltZVwiOiBcIjE1MDk0NjkyMDBcIixcbiAgICAgICAgLy8gICAgICAgICBcIndpdGhkcmF3X2lkXCI6IFwieHJwLTEyMzQ1XCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ0eGlkXCI6IFwiXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19tZW1vXCI6IFwiMTIzMTIzXCJcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy9cbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoKCd0eGlkJyBpbiByZXNwb25zZSkgJiYgKHJlc3BvbnNlWyd0eGlkJ10ubGVuZ3RoID4gMCkpXG4gICAgICAgICAgICBpZCA9IHJlc3BvbnNlWyd0eGlkJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5LCByZXNwb25zZSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAvLyB7IHN1Y2Nlc3M6IDAsIGVycm9yOiBcImludmFsaWQgb3JkZXIuXCIgfVxuICAgICAgICAvLyBvclxuICAgICAgICAvLyBbeyBkYXRhLCAuLi4gfSwgeyAuLi4gfSwgLi4uIF1cbiAgICAgICAgaWYgKHR5cGVvZiByZXNwb25zZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snIHx8IGJvZHlbMF0gPT09ICdbJylcbiAgICAgICAgICAgICAgICByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSAocmVzcG9uc2UpKVxuICAgICAgICAgIC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XBpLml0Yml0LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5pdGJpdC5jb20vZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5pdGJpdC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9iYWxhbmNlcy97Y3VycmVuY3lDb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2Z1bmRpbmdfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0X3RyYW5zZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vY3J5cHRvY3VycmVuY3lfd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpcmVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUVVNEJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1NHRCc6IHsgJ2lkJzogJ1hCVFNHRCcsICdzeW1ib2wnOiAnQlRDL1NHRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdTR0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdYQlRFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzU3ltYm9sT3JkZXJCb29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzU3ltYm9sVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgc2VydmVyVGltZVVUQyA9ICgnc2VydmVyVGltZVVUQycgaW4gdGlja2VyKTtcbiAgICAgICAgaWYgKCFzZXJ2ZXJUaW1lVVRDKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4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ZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdvcGVuVG9kYXknKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgbGV0IGlkID0gdHJhZGVbJ21hdGNoTnVtYmVyJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICA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cbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGVCYWxhbmNlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3RvdGFsQmFsYW5jZSddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoV2FsbGV0cyAoKSB7XG4gICAgICAgIGlmICghdGhpcy51c2VySWQpXG4gICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgZmV0Y2hXYWxsZXRzIHJlcXVpcmVzIHVzZXJJZCBpbiBBUEkgc2V0dGluZ3MnKTtcbiAgICAgICAgbGV0IHBhcmFtcyA9IHtcbiAgICAgICAgICAgICd1c2VySWQnOiB0aGlzLnVzZXJJZCxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZUdldFdhbGxldHMgKHBhcmFtcyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hXYWxsZXQgKHdhbGxldElkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgd2FsbGV0ID0ge1xuICAgICAgICAgICAgJ3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IsICdwcmljZScpO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndm9sdW1lV2VpZ2h0ZWRBdmVyYWdlUHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IG9yZGVyWydzdGF0dXMnXSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IHdhbGxldElkSW5QYXJhbXMgPSAoJ3dhbGxldElkJyBpbiBwYXJhbXMpO1xuICAgICAgICBpZiAoIXdhbGxldElkSW5QYXJhbXMpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmVxdWlyZXMgYSB3YWxsZXRJZCBwYXJhbWV0ZXInKTtcbiAgICAgICAgYW1vdW50ID0gYW1vdW50LnRvU3RyaW5nICgpO1xuICAgICAgICBwcmljZSA9IHByaWNlLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXS5yZXBsYWNlIChtYXJrZXRbJ3F1b3RlJ10sICcnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZGlzcGxheSc6IGFtb3VudCxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2luc3RydW1lbnQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXYWxsZXRzV2FsbGV0SWRPcmRlcnMgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3Bvbn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4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5qdWJpLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuanViaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuanViaS5jb20vaGVscC9hcGkuaHRtbCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QWxsdGlja2VyICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gJ0NOWSc7IC8vIHRvZG9cbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgfSk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ICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHNCeUFsdG5hbWUnOiB7fSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMjE2MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1OTktMjI3MDkzMDQtNWVkZS0xMWU3LTlkZTEtOWYzMzczMmUxNTA5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5rcmFrZW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd6ZW5kZXNrJzogJ2h0dHBzOi8vc3VwcG9ydC5rcmFrZW4uY29tL2hjL2VuLXVzL2FydGljbGVzJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20vZW4tdXMvaGVscC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL25vdGhpbmdpc2RlYWQvbnBtLWtyYWtlbi1hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbS9lbi11cy9oZWxwL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI2IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE2IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMDAyNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwLCAwLjAwMjRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMDAyMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMCwgMC4wMDIwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjAwMThdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjAwMTZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjAwMTRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjAwMTJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMC4wMDAxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMDAxNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwLCAwLjAwMTRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMDAxMl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMCwgMC4wMDEwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjAwMDhdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjAwMDZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjAwMDRdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjAwMDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMC4wXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyB0aGlzIGlzIGEgYmFkIHdheSBvZiBoYXJkY29kaW5nIGZlZXMgdGhhdCBjaGFuZ2Ugb24gZGFpbHkgYmFzaXNcbiAgICAgICAgICAgICAgICAvLyBoYXJkY29kaW5nIGlzIG5vdyBjb25zaWRlcmVkIG9ic29sZXRlLCB3ZSB3aWxsIHJlbW92ZSBhbGwgb2YgaXQgZXZlbnR1YWxseVxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDAwMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTE4nOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRCc6IDEwLCAvLyBDQUQgRUZUIFdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKUFknOiAzMDAsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWExNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLCAvLyBmcmVlIGRlcG9zaXQgaWYgRVVSIFNFUEEgRGVwb3NpdFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRCc6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdKUFknOiAwLCAvLyBEb21lc3RpYyBEZXBvc2l0IChGcmVlLCDCpTUsMDAwIGRlcG9zaXQgbWluaW11bSlcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3plbmRlc2snOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSBzaG91bGQgcmVhbGx5IHJlZnJhaW4gZnJvbSBwdXR0aW5nIGZpeGVkIGZlZSBudW1iZXJzIGFuZCBzdG9wIGhhcmRjb2RpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHdpbGwgYmUgdXNpbmcgdGhlaXIgd2ViIEFQSXMgdG8gc2NyYXBlIGFsbCBudW1iZXJzIGZyb20gdGhlc2UgYXJ0aWNsZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICcyMDU4OTM3MDgtV2hhdC1pcy10aGUtbWluaW11bS1vcmRlci1zaXplLScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjAxMzk2Nzc3LVdoYXQtYXJlLXRoZS1kZXBvc2l0LWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICcyMDE4OTM2MDgtV2hhdC1hcmUtdGhlLXdpdGhkcmF3YWwtZmVlcy0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Fzc2V0UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPSExDJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTcHJlYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBZGRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0Nsb3NlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRGVwb3NpdE1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09wZW5Qb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5TGVkZ2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUXVlcnlPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2NhY2hlRGVwb3NpdE1ldGhvZHNPbkZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLCAvLyB3aWxsIGlzc3VlIHVwIHRvIHR3byBjYWxscyBpbiBmZXRjaERlcG9zaXRBZGRyZXNzXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXRNZXRob2RzJzoge30sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ0VGdW5kaW5nOlVua25vd24gd2l0aGRyYXcga2V5JzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnRUZ1bmRpbmc6SW52YWxpZCBhbW91bnQnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgIC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ICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QXNzZXRQYWlycyAoKTtcbiAgICAgICAgbGV0IGxpbWl0cyA9IGF3YWl0IHRoaXMuZmV0Y2hNaW5PcmRlclNpemVzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzWydyZXN1bHQnXSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW2lkXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICBpZiAoKGJhc2VbMF0gPT09ICdYJykgfHwgKGJhc2VbMF0gPT09ICdaJykpXG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2Uuc2xpY2UgKDEpO1xuICAgICAgICAgICAgaWYgKChxdW90ZVswXSA9PT0gJ1gnKSB8fCAocXVvdGVbMF0gPT09ICdaJykpXG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS5zbGljZSAoMSk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IGRhcmtwb29sID0gaWQuaW5kZXhPZiAoJy5kJykgPj0gMDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBkYXJrcG9vbCA/IG1hcmtldFsnYWx0bmFtZSddIDogKGJhc2UgKyAnLycgKyBxdW90ZSk7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoJ2ZlZXNfbWFrZXInIGluIG1hcmtldCkge1xuICAgICAgICAgICAgICAgIG1ha2VyID0gcGFyc2VGbG9hdCAobWFya2V0WydmZWVzX21ha2VyJ11bMF1bMV0pIC8gMTAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0Wydsb3RfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3BhaXJfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbWluQW1vdW50ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBpZiAoYmFzZSBpbiBsaW1pdHMpXG4gICAgICAgICAgICAgICAgbWluQW1vdW50ID0gbGltaXRzW2Jhc2VdO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnZGFya3Bvb2wnOiBkYXJrcG9vbCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnYWx0bmFtZSc6IG1hcmtldFsnYWx0bmFtZSddLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlcyddWzBdWzFdKSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluQW1vdW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdCA9IHRoaXMuYXBwZW5kSW5hY3RpdmVNYXJrZXRzIChyZXN1bHQpO1xuICAgICAgICB0aGlzLm1hcmtldHNCeUFsdG5hbWUgPSB0aGlzLmluZGV4QnkgKHJlc3VsdCwgJ2FsdG5hbWUnKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhcHBlbmRJbmFjdGl2ZU1hcmtldHMgKHJlc3VsdCA9IFtdKSB7XG4gICAgICAgIGxldCBwcmVjaXNpb24gPSB7ICdhbW91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ICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRpbmdGZWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlVm9sdW1lIChwYXJhbXMpO1xuICAgICAgICBsZXQgdHJhZGVkVm9sdW1lID0gdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlWydyZXN1bHQnXSwgJ3ZvbHVtZScpO1xuICAgICAgICBsZXQgdGllcnMgPSB0aGlzLmZlZXNbJ3RyYWRpbmcnXVsndGllcnMnXTtcbiAgICAgICAgbGV0IHRha2VyID0gdGllcnNbJ3Rha2VyJ11bMV07XG4gICAgICAgIGxldCBtYWtlciA9IHRpZXJzWydtYWtlciddWzFdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRpZXJzWyd0YWtlciddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAodHJhZGVkVm9sdW1lID49IHRpZXJzWyd0YWtlciddW2ldWzBdKVxuICAgICAgICAgICAgICAgIHRha2VyID0gdGllcnNbJ3Rha2VyJ11baV1bMV07XG4gICAgICAgIH1cbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWVyc1snbWFrZXInXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKHRyYWRlZFZvbHVtZSA+PSB0aWVyc1snbWFrZXInXVtpXVswXSlcbiAgICAgICAgICAgICAgICBtYWtlciA9IHRpZXJzWydtYWtlciddW2ldWzFdO1xuICAgICAgICB9XG4gICAgICAg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dGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGJhc2VWb2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3YnXVsxXSk7XG4gICAgICAgIGxldCB2d2FwID0gcGFyc2VGbG9hdCAodGlja2VyWydwJ11bMV0pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgbGV0IGxhc3QgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ2MnXVswXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoJ11bMV0pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbCddWzFdKSxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2InXVswXSksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYSddWzBdKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdvJyksXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ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IHBhcnNlSW50ICh0cmFkZVsndGltZSddICogMTAwMCk7XG4gICAgICAgICAgICBzaWRlID0gdHJhZGVbJ3R5cGUnXTtcbiAgICAgICAgICAgIHR5cGUgPSB0cmFkZVsnb3JkZXJ0eXBlJ107XG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ByaWNlJyk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICd2b2wnKTtcbiAgICAgICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyksXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbMl0gKiAxMDAwKTtcbiAgICAgICAgICAgIHNpZGUgPSAodHJhZGVbM10gPT09ICdzJykgPyAnc2VsbCcgOiAnYnV5JztcbiAgICAgICAgICAgIHR5cGUgPSAodHJhZGVbNF0gPT09ICdsJykgPyAnbGltaXQnIDogJ21hcmtldCc7XG4gICAgICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHRyYWRlWzBdKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWzFdKTtcbiAgICAgICAgICAgIGxldCB0cmFkZUxlbmd0aCA9IHRyYWRlLmxlbmd0aDtcb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mluZWQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlICh0aGlzLmlkICsgJyBmZXRjaEJhbGFuY2UgZmFpbGVkIGR1ZSB0byBhIG1hbGZvcm1lZCByZXNwb25zZSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjdXJyZW5jeTtcbiAgICAgICAgICAgIC8vIFgtSVNPNDIxNy1BMyBzdGFuZGFyZCBjdXJyZW5jeSBjb2Rlc1xuICAgICAgICAgICAgaWYgKGNvZGVbMF0gPT09ICdYJykge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29kZVswXSA9PT0gJ1onKSB7XG4gICAgICAgICAgICAgICAgY29kZSA9IGNvZGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbY3VycmVuY3ldKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgfTtcb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pcy5zYWZlRmxvYXQgKG9yZGVyLCAndm9sJyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd2b2xfZXhlYycpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Nvc3QnKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKGRlc2NyaXB0aW9uLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKCFwcmljZSlcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKCdmZWUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZsYWdzID0gb3JkZXJbJ29mbGFncyddO1xuICAgICAgICAgICAgICAgIGxldCBmZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmVlJyk7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgICAgICdyYXRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgaWYgKGZsYWdzLmluZGV4T2YgKCdmY2lxJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmbGFncy5pbmRleE9mICgnZmNpYicpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgLy8gJ3RyYWRlcyc6IHRoaXMucGFyc2VUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSwgbWFya2V0KSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVycyAob3JkZXJzLCBtYXJrZXQgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAob3Jk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2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICdub25jZSc6IG5vbmNlIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAobm9uY2UgKyBib2R5KTtcbiAgICAgICAgICAgIGxldCBoYXNoID0gdGhpcy5oYXNoIChhdXRoLCAnc2hhMjU2JywgJ2JpbmFyeScpO1xuICAgICAgICAgICAgbGV0IGJpbmFyeSA9IHRoaXMuc3RyaW5nVG9CaW5hcnkgKHRoaXMuZW5jb2RlICh1cmwpKTtcbiAgICAgICAgICAgIGxldCBiaW5oYXNoID0gdGhpcy5iaW5hcnlDb25jYXQgKGJpbmFyeSwgaGFzaCk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAoYmluaGFzaCwgc2VjcmV0LCAnc2hhNTEyJywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQVBJLUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBUEktU2lnbic6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgPSAnLycgKyBwYXRoO1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgb3JkZXInKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW52YWxpZCBub25jZScpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE5vbmNlICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdJbnN1ZmZpY2llbnQgZnVuZHMnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdDYW5jZWwgcGVuZGluZycpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgQ2FuY2VsUGVuZGluZyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW52YWxpZCBhcmd1bWVudHM6dm9sdW1lJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlc3BvbnNlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBudW1FcnJvcnMgPSByZXNwb25zZVsnZXJyb3InXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChudW1FcnJvcnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByZXNwb25zZVsnZXJyb3InXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXVtpXSBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IHRoaXMuZXhjZXB0aW9uc1tyZXNwb25zZVsnZXJyb3InXVtpXV0gKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsIC8vIHNlZSB0aGUgbWV0aG9kIGltcGxlbWVudGF0aW9uIGJlbG93XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiAnZW11bGF0ZWQnLCAvLyB0aGlzIG1ldGhvZCBpcyB0byBiZSBkZWxldGVkLCBzZWUgaW1wbGVtZW50YXRpb24gYW5kIGNvbW1lbnRzIGJlbG93XG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAxLFxuICAgICAgICAgICAgICAgICc1bSc6IDUsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDE1LFxuICAgICAgICAgICAgICAgICczMG0nOiAzMCxcbiAgICAgICAgICAgICAgICAnMWgnOiA2MCxcbiAgICAgICAgICAgICAgICAnOGgnOiA0ODAsXG4gICAgICAgICAgICAgICAgJzFkJzogJ0QnLFxuICAgICAgICAgICAgICAgICcxdyc6ICdXJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMzNzk1NjU1LWIzYzQ2ZTQ4LWRjZjYtMTFlNy04YWJlLWRjNDU4OGJhNzkwMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkua3Vjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAna2l0Y2hlbic6ICdodHRwczovL2tpdGNoZW4ua3Vjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdraXRjaGVuLTInOiAnaHR0cHM6Ly9raXRjaGVuLTIua3Vjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmt1Y29pbi5jb20vP3I9RTV3a3FlJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8va3Vjb2luYXBpZG9jcy5kb2NzLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9uZXdzLmt1Y29pbi5jb20vZW4vZmVlJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdraXRjaGVuJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vY2hhcnQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vY2hhcnQvY29uZmlnJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vY2hhcnQvc3ltYm9sJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vZGVhbC1vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4va2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vbGFuZy1saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMtYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL29yZGVycy1zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL3RpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL2NvaW4taW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vY29pbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL2NvaW5zLXRyZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9zeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2FsbGV0L2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dhbGxldC9yZWNvcmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3Byb21vdGlvbi9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3Byb21vdGlvbi9zdW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYWwtb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hY3RpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FjdGl2ZS1tYXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlYWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZXRhaWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVycmVyL2Rlc2NlbmRhbnQvY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dpdGhkcmF3L2FwcGx5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93aXRoZHJhdy9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvcHJvbW90aW9uL2RyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC1hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2hhbmdlLWxhbmcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQ1MnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBUyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLTkMnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkhDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JQWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVEnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT0QnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FHJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGRCc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRE4nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUtHJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDUFQnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlVMUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNUJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVUkEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FTUCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1dSJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZMSVhYJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRU5EJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTUInOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkhPQyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiA1MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSR04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHt9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZXhjaGFuZ2Utc3BlY2lmaWMgb3B0aW9uc1xuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ3RpbWVEaWZmZXJlbmNlJzogMCwgLy8gdGhlIGRpZmZlcmVuY2UgYmV0d2VlbiBzeXN0ZW0gY2xvY2sgYW5kIEt1Y29pbiBjbG9ja1xuICAgICAgICAgICAgICAgICdhZGp1c3RGb3JUaW1lRGlmZmVyZW5jZSc6IGZhbHNlLCAvLyBjb250cm9scyB0aGUgYWRqdXN0bWVudCBsb2dpYyB1cG9uIGluc3RhbnRpYXRpb25cbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpIC0gdGhpcy5vcHRpb25zWyd0aW1lRGlmZmVyZW5jZSddO1xuICAgIH1cblxuICAgIGFzeW5jIGxvYWRUaW1lRGlmZmVyZW5jZSAoKSB7XG4gICAgICAgIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcGVuVGljayAoKTtcbiAgICAgICAgY29uc3QgYWZ0ZXIgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgdGhpcy5vcHRpb25zWyd0aW1lRGlmZmVyZW5jZSddID0gcGFyc2VJbnQgKGFmdGVyIC0gcmVzcG9uc2VbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMub3B0aW9uc1sndGltZURpZmZlcmVuY2UnXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldE9wZW5TeW1ib2xzICgpO1xuICAgICAgICBpZiAodGhpcy5vcHRpb25zWydhZGp1c3RGb3JUaW1lRGlmZmVyZW5jZSddKVxuICAgICAgICAgICAgYXdhaXQgdGhpcy5sb2FkVGltZURpZmZlcmVuY2UgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydjb2luVHlwZSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0Wydjb2luVHlwZVBhaXInXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ3RyYWRpbmcnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnZmVlUmF0ZScpLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdmZWVSYXRlJyksXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgI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V0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5Wydjb2luJ107XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IGN1cnJlbmN5Wyd0cmFkZVByZWNpc2lvbiddO1xuICAgICAgICAgICAgbGV0IGRlcG9zaXQgPSBjdXJyZW5jeVsnZW5hYmxlRGVwb3NpdCddO1xuICAgICAgICAgICAgbGV0IHdpdGhkcmF3ID0gY3VycmVuY3lbJ2VuYWJsZVdpdGhkcmF3J107XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gKGRlcG9zaXQgJiYgd2l0aGRyYXcpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5GZWUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5Wyd3aXRoZHJhd01pbkFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgIC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dGF0dXMgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT09ICdjbG9zZWQnKVxuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIGlmIChmaWxsZWQgPT09IDAuMCkge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmFkZXMgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgY29zdCA9IDA7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkICs9IHRyYWRlc1tpXVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGNvc3QgKz0gdHJhZGVzW2ldWydjb3N0J107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIC8vIGt1Y29pbiBwcmljZSBhbmQgYW1vdW50IGZpZWxkcyBoYXZlIHZhcnlpbmcgbmFtZXNcbiAgICAgICAgLy8gdGh1cyB0aGUgY29udm9sdXRlZCBzcGFnaGV0dGkgY29kZSBiZWxvd1xuICAgICAgICBsZXQgcHJpY2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgZmlsbGVkICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgLy8gaWYgdGhlIG9yZGVyIHdhcyBmaWxsZWQgYXQgbGVhc3QgZm9yIHNvbWUgcGFydFxuICAgICAgICAgICAgaWYgKGZpbGxlZCA+IDAuMCkge1xuICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdkZWFsUHJpY2UnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdkZWFsUHJpY2VBdmVyYWdlJyk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8vIGl0J3MgYW4gb3BlbiBvcmRlciwgbm90IGZpbGxlZCB5ZXQsIHVzZSB0aGUgaW5pdGlhbCBwcmljZVxuICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJQcmljZScpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgY29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zdW0gKGZpbGxlZCwgcmVtYWluaW5nKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHJlbWFpbmluZyA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICA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dXJyZW5jeV1bJ2NvZGUnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpO1xuICAgICAgICBsZXQgZmVlID0ge1xuICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWVUb3RhbCcsIGZlZUNvc3QpLFxuICAgICAgICAgICAgJ3JhdGUnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWVSYXRlJyksXG4gICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgIH07XG4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1xuICAgICAgICBsZXQgb3JkZXJzID0gdGhpcy5hcnJheUNvbmNhdCAoc2VsbCwgYnV5KTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gdGhlIGNhY2hpbmcgcGFydCB0byBiZSByZW1vdmVkXG4gICAgICAgIC8vXG4gICAgICAgIC8vICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAvLyAgICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyc1tpXSwge1xuICAgICAgICAvLyAgICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAvLyAgICAgICAgIH0pLCBtYXJrZXQpO1xuICAgICAgICAvLyAgICAgICAgIGxldCBvcmRlcklkID0gb3JkZXJbJ2lkJ107XG4gICAgICAgIC8vICAgICAgICAgaWYgKG9yZGVySWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgIC8vICAgICAgICAgICAgIGlmICh0aGlzLm9yZGVyc1tvcmRlcklkXVsnc3RhdHVzJ10gIT09ICdvcGVuJylcbiAgICAgICAgLy8gICAgICAgICAgICAgICAgIG9yZGVyWydzdGF0dXMnXSA9IHRoaXMub3JkZXJzW29yZGVySWRdWydzdGF0dXMnXTtcbiAgICAgICAgLy8gICAgICAgICB0aGlzLm9yZGVyc1tvcmRlclsnaWQnXV0gPSBvcmRlcjtcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy8gICAgIGxldCBvcGVuT3JkZXJzID0gdGhpcy5maWx0ZXJCeSAodGhpcy5vcmRlcnMsICdzdGF0dXMnLCAnb3BlbicpO1xuICAgICAgICAvLyAgICAgcmV0dXJuIHRoaXMuZmlsdGVyQnlTeW1ib2xTaW5jZUxpbWl0IChvcGVuT3JkZXJzLCBzeW1ib2wsIHNpbmNlLCBsaW1pdCk7XG4gICAgICAgIC8vXG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT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W1wID0gdGhpcy5zYWZlSW50ZWdlciAocmVzcG9uc2UsICd0aW1lc3RhbXAnKTtcbiAgICAgICAgbGV0IGlzbzg2MDEgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgdGltZXN0YW1wICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlzbzg2MDEgPSB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5vcmRlcnNbb3JkZXJJZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIG9yZGVyO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVycyAoc3ltYm9sID0gdW5kZWZpbm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nZSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogY2hhbmdlUGVyY2VudGFnZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sVmFsdWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVuU3ltYm9scyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlcnNbdF0pO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHRpY2tlclsnc3ltYm9sJ107XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRpY2tlcjtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdha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wZSc7XG4gICAgICAgICAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgZmVlQ3VycmVuY3lGaWVsZCk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVDdXJyZW5jeSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZlZUN1cnJlbmN5IGluIHRoaXMuY3VycmVuY2llc19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2ZlZUN1cnJlbmN5XVsnY29kZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogaW5mbyxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiB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11bYXBpXSArIGVuZHBvaW50O1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICAvLyB0aGVpciBub25jZSBpcyBhbHdheXMgYSBjYWxpYnJhdGVkIHN5bmNoZWQgbWlsbGlzZWNvbmRzLXRpbWVzdGFtcFxuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0cmluZyA9ICcnO1xuICAgICAgICAgICAgbm9uY2UgPSBub25jZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHF1ZXJ5U3RyaW5nID0gdGhpcy5yYXdlbmNvZGUgKHRoaXMua2V5c29ydCAocXVlcnkpKTtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHF1ZXJ5U3RyaW5nO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhdXRoID0gZW5kcG9pbnQgKyAnLycgKyBub25jZSArICcvJyArIHF1ZXJ5U3RyaW5nO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLnN0cmluZ1RvQmFzZTY0ICh0aGlzLmVuY29kZSAoYXV0aCkpO1xuICAgICAgICAgICAgLy8gcGF5bG9hZCBzaG91bGQgYmUgXCJlbmNvZGVkXCIgYXMgcmV0dXJuZWQgZnJvbSBzdHJpbm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7IHM6IFwib2tcIiwgbzogW10sIGg6IFtdLCBsOiBbXSwgYzogW10sIHY6IFtdIH1cbiAgICAgICAgLy9cbiAgICAgICAgLy8gVGhpcyBwYXJ0aWN1bGFyIG1ldGhvZCBoYW5kbGVzIEFQSSByZXNwb25zZXMgb25seVxuICAgICAgICAvL1xuICAgICAgICBpZiAoISgnc3VjY2VzcycgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAocmVzcG9uc2VbJ3N1Y2Nlc3MnXSA9PT0gdHJ1ZSlcbiAgICAgICAgICAgIHJldHVybjsgLy8gbm90IGFuIGVycm9yXG4gICAgICAgIGlmICghKCdjb2RlJyBpbiByZXNwb25zZSkgfHwgISgnbXNnJyBpbiByZXNwb25zZSkpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICc6IG1hbGZvcm1lZCByZXNwb25zZTogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgY29uc3QgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgIGNvbnN0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnbXNnJyk7XG4gICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICBpZiAoY29kZSA9PT0gJ1VOQVVUSCcpIHtcbiAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnSW52YWxpZCBub25jZScpXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWROb25jZSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09PSAnRVJST1InKSB7XG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnVGhlIHByZWNpc2lvbiBvZiBhbW91bnQnKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTsgLy8gYW1vdW50IHZpb2xhdGVzIHByZWNpc2lvbi5hbW91bnRcbiAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdNaW4gYW1vdW50IGVhY2ggb3JkZXInKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTsgLy8gYW1vdW50IDwgbGltaXRzLmFtb3VudC5taW5cbiAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdNaW4gcHJpY2U6JykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIHByaWNlIDwgbGltaXRzLnByaWNlLm1pblxuICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ01heCBwcmljZTonKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTsgLy8gcHJpY2UgPiBsaW1pdHMucHJpY2UubWF4XG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnVGhlIHByZWNpc2lvbiBvZiBwcmljZScpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZmVlZGJhY2spOyAvLyBwcmljZSB2aW9sYXRlcyBwcmVjaXNpb24ucHJpY2VcbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09PSAnTk9fQkFMQU5DRScpIHtcbiAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdJbnN1ZmZpY2llbnQgYmFsYW5jZScpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3Mga3VuYSBleHRlbmRzIGFjeCB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2t1bmEnLFxuICAgICAgICAgICAgJ25hbWUnOiAnS3VuYScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VBJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNjk3NjM4LTkxMjgyNGZhLWIzYzEtMTFlNy04YzM2LWNmOTYwNmViOTRhYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9rdW5hLmlvJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2t1bmEuaW8vZG9jdW1lbnRzL2FwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9rdW5hLmlvL2RvY3VtZW50cy9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQUgnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FWRVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPTCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQkcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnUk1DJzogMC4wMDEgQlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnQVJOJzogMC4wMSBFVEhcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdSJzogMC4wMSBFVEhcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdFVlInOiAwLjAxIEVUSFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdVQUgnOiAoYW1vdW50KSA9PiBhbW91bnQgKiAwLjAwMSArIDVcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAg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AgICBmb3IgKGxldCBpID0gMDsgaSA8IHByZWRlZmluZWRNYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gcHJlZGVmaW5lZE1hcmtldHNbaV07XG4gICAgICAgICAgICBpZiAobWFya2V0WydpZCddIGluIHRpY2tlcnMpXG4gICAgICAgICAgICAgICAgbWFya2V0cy5wdXNoIChtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBtYXJrZXRzQnlJZCA9IHRoaXMuaW5kZXhCeSAobWFya2V0cywgJ2lkJyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBpZiAoIShpZCBpbiBtYXJrZXRzQnlJZCkpIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQucmVwbGFjZSAoJ2J0YycsICcnKTtcbiAgICAgICAgICAgICAgICBiYXNlSWQgPSBiYXNlSWQucmVwbGFjZSAoJ3VhaCcsICcnKTtcbiAgICAgICAgICAgICAgICBiYXNlSWQgPSBiYXNlSWQucmVwbGFjZSAoJ2diZycsICcnKTtcbiAgICAgICAgICAgICAgICBpZiAoYmFzZUlkLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJhc2VJZExlbmd0aCA9IGJhc2VJZC5sZW5ndGggLSAwOyAvLyBhIHRyYW5zcGlsZXIgd29ya2Fyb3VuZFxuICAgICAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IGlkLnNsaWNlIChiYXNlSWRMZW5ndGgpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXRzLnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBtYXJrZXRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlckJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1x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G4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MDc0MTIwLTcyYjdjMzhhLTY2NjAtMTFlNy05MmQ5LWQ5MDI3NTAyMjgxZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaV92MicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5sYWtlYnRjLmNvbS9zL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmNvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRFeHRlcm5hbEFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1trXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBjb2RlID0gY3VycmVuY3lbJ2NvZGUnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbaWRdKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRCY29yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya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lVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbc3ltYm9sXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtzeW1ib2xdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm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iAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYWNjZXNza2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3JlcXVlc3RtZXRob2QnOiBtZXRob2QudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHBhcmFtcyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGExJyk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdKc29uLVJwYy1Ub25jZSc6IG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogJ0Jhc2ljICcgKyB0aGlzLmRlY29kZSAodGhpcy5zdHJpbmdUb0Jhc2U2NCAoYXV0aCkpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYW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ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2xiYW5rJyxcbiAgICAgICAgICAgICduYW1lJzogJ0xCYW5rJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnbWludXRlMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJ21pbnV0ZTUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnbWludXRlMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnbWludXRlMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICdob3VyMScsXG4gICAgICAgICAgICAgICAgJzJoJzogJ2hvdXIyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnaG91cjQnLFxuICAgICAgICAgICAgICAgICc2aCc6ICdob3VyNicsXG4gICAgICAgICAgICAgICAgJzhoJzogJ2hvdXI4JyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJ2hvdXIxMicsXG4gICAgICAgICAgICAgICAgJzFkJzogJ2RheTEnLFxuICAgICAgICAgICAgICAgICcxdyc6ICd3ZWVrMScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zODA2MzYwMi05NjA1ZTI4YS0zMzAyLTExZTgtODFiZS02NGIxZTUzYzRjZmIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxiYW5rLmluZm8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubGJhbmsuaW5mbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5sYmFuay5pbmZvL2FwaS9hcGktb3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vbGJhbmtpbmZvLnplbmRlc2suY29tL2hjL3poLWNuL2FydGljbGVzLzExNTAwMjI5NTExNC0tJUU4JUI0JUI5JUU3JThFJTg3JUU4JUFGJUI0JUU2JTk4JThFJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnUVRVTSc6IGFtb3VudCA9PiBNYXRoLm1heCAoMC4wMSwgYW1vdW50ICogKDAuMSAvIDEwMCkpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05BUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFdDJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTksnOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPVCc6IDMuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEdDJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ01UJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTRUVSJzogMjAwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZJTCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeVBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IFtiYXNlLCBxdW90ZV0uam9pbiAoJy8nKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZXN0YW1wJ107XG4gICAgICAgIGxldCBpbmZvID0gdGlja2VyO1xuICAgICAgICB0aWNrZXIgPSBpbmZvWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGF0ZXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB1bm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HJlc3BvbnNlKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlX21zJ10pO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgcHJpY2UgKiBhbW91bnQpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndGlkJyksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aGlzLnNhZmVWYWx1ZSAodHJhZGUsICdpbmZvJywgdHJhZGUpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW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ICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlciksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdtYXJrZXQnKSB7XG4gICAgICAgICAgICBvcmRlclsndHlwZSddICs9ICdfbWFya2V0JztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENyZWF0ZU9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBvcmRlciA9IHRoaXMub21pdCA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AwMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA0JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzEwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTAwMDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDAwNyc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA5JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDEyJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMyc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDE1JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxNic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgIH0sIGVycm9yQ29kZSwgRXhjaGFuZ2VFcnJvcik7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3JDbGFzcyAobWVzc2FnZSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpO1xuY29uc3QgeyBFeGNoYW5nZUVycm9yLCBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgSW5zdWZmaWNpZW50RnVuZHMsIE9yZGVyTm90Rm91bmQsIEREb1NQcm90ZWN0aW9uLCBJbnZhbGlkT3JkZXIsIEF1dGhlbnRpY2F0aW9uRXJyb3IgfSA9IHJlcXVpcmUgKCcuL2Jhc2UvZXJyb3JzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgbGlxdWkgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2xpcXVpJyxcbiAgICAgICAgICAgICduYW1lJzogJ0xpcXVpJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVUEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDMwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICczJyxcbiAgICAgICAgICAgICd1c2VyQWdlbnQnOiB0aGlzLnVzZXJBZ2VudHNbJ2Nocm9tZSddLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyQm9va3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb2luRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWRlZW1Db3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzgwMyc6IEludmFsaWRPcmRlciwgLy8gXCJDb3VudCBjb3VsZCBub3QgYmUgbGVzcy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ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgcmV0dXJuIFsgYmFzZSwgcXVvdGUgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3BhaXJzJ107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB0aGlzLmdldEJhc2VRdW90ZUZyb21NYXJrZXRJZCAoaWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2RlY2ltYWxfcGxhY2VzJyksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fdG90YWwnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0TGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBoaWRkZW4gPSB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdoaWRkZW4nKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoaGlkZGVuID09PSAwKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ2ZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgIC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ICBpZHMgPSBpZHMuam9pbiAoJy0nKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VPcmRlckJvb2sgKHJlc3BvbnNlW2lkXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcm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wYXJzZUZsb2F0IChhbW91bnQpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50O1xuICAgICAgICBpZiAoJ3JldHVybicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sIHRoaXMuZ2V0T3JkZXJJZEtleSAoKSk7XG4gICAgICAgICAgICBpZiAoaWQgPT09ICcwJykge1xuICAgICAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sICdpbml0X29yZGVyX2lkJyk7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAocmVzcG9uc2VbJ3JldHVybiddLCAncmVjZWl2ZWQnLCAwLjApO1xuICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlWydyZXR1cm4nXSwgJ3JlbWFpbnMnLCBhbW91bnQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogZmlsbGVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAgfVxuXG4gICAgZ2V0T3JkZXJJZEtleSAoKSB7XG4gICAgICAgIHJldHVybiAnb3JkZXJfaWQnO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGxldCBpZEtleSA9IHRoaXMuZ2V0T3JkZXJJZEtleSAoKTtcbiAgICAgICAgcmVxdWVzdFtpZEtleV0gPSBpZDtcbiAgICA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HBhcnNlSW50IChvcmRlclsndGltZXN0YW1wX2NyZWF0ZWQnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsncGFpciddXTtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBhbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JhdGUnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc3RhcnRfYW1vdW50JyBpbiBvcmRlcikge1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnc3RhcnRfYW1vdW50Jyk7XG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMub3JkZXJzW2lkXVsnYW1vdW50J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzIChvcmRlcnMsIG1hcmtldCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAob3JkZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKG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biAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IGNhY2hlZE9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1haW5pbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydjb3N0J10gPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydmaWxsZWQnXSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVkT3JkZXJbJ2Nvc3QnXSA9IGNhY2hlZE9yZGVyWydmaWxsZWQnXSAqIGNhY2hlZE9yZGVyWydwcmljZSddO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2NhY2hlZE9yZGVySWRdID0gY2FjaGVkT3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnRvQXJyYXkgKHRoaXMub3JkZXJzKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICgnZmV0Y2hPcmRlcnNSZXF1aXJlc1N5bWJvbCcgaW4gdGhpcy5vcHRpb25zKVxuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9uc1snZmV0Y2hPcmRlcnNSZXF1aXJlc1N5bWJvbCddKVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3ltYm9sID09PSAndW5kZWZpb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AgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmV0dXJuJ11bJ3RJZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSkge1xuICAgICAgICByZXR1cm4gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICB9XG5cbiAgICBnZXRWZXJzaW9uU3RyaW5nICgpIHtcbiAgICAgICAgcmV0dXJuICcvJyArIHRoaXMudmVyc2lvbjtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuc2lnbkJvZHlXaXRoU2VjcmV0IChib2R5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuZ2V0VmVyc2lvblN0cmluZyAoKSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAxIC0gTGlxdWkgb25seSByZXR1cm5zIHRoZSBpbnRlZ2VyICdzdWNjZXNzJyBrZXkgZnJvbSB0aGVpciBwcml2YXRlIEFQSVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IDEsIC4uLiB9IGh0dHBDb2RlID09PSAyMDBcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogMCwgLi4uIH0gaHR0cENvZGUgPT09IDIwMFxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gMiAtIEhvd2V2ZXIsIGV4Y2hhbmdlcyBkZXJpdmVkIGZyb20gTGlxdWksIGNhbiByZXR1cm4gbm9uLWludGVnZXJzXG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAgSXQgY2FuIGJlIGEgbnVtZXJpYyBzdHJpbmdcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Vzc3NcIjogXCIxXCIsIC4uLiB9XG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNlc3NzXCI6IFwiMFwiLCAuLi4gfSwgaHR0cENvZGUgPj0gMjAwIChjYW4gYmUgNDAzLCA1MDIsIGV0YylcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICBPciBqdXN0IGEgc3RyaW5nXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IFwidHJ1ZVwiLCAuLi4gfVxuICAgICAgICAgICAgICAgIC8vICAgICB7IFwic3VjY2Vzc1wiOiBcImZhbHNlXCIsIC4uLiB9LCBodHRwQ29kZSA+PSAyMDBcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICBPciBhIGJvb2xlYW5cbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogdHJ1ZSwgLi4uIH1cbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogZmFsc2UsIC4uLiB9LCBodHRwQ29kZSA+PSAyMDBcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vIDMgLSBPdmVyc2ltcGxpZmllZCwgUHl0aG9uIFBFUDggZm9yYmlkcyBjb21wYXJpc29uIG9wZXJhdG9yICg9PT0pIG9mIGRpZmZlcmVudCB0eXBlc1xuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gNCAtIFdlIGRvIG5vdCB3YW50IHRvIGNvcHktcGFzdGUgYW5kIGR1cGxpY2F0ZSB0aGUgY29kZSBvZiB0aGlzIGhhbmRsZXIgdG8gb3RoZXIgZXhjaGFuZ2VzIGRlcml2ZWQgZnJvbSBMaXF1aVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gVG8gY292ZXIgcG9pbnRzIDEsIDIsIDMgYW5kIDQgY29tYmluZWQgdGhpcyBoYW5kbGVyIHNob3VsZCB3b3JrIGxpa2UgdGhpczpcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnc3VjY2VzcycsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHN1Y2Nlc3MgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgoc3VjY2VzcyA9PT0gJ3RydWUnKSB8fCAoc3VjY2VzcyA9PT0gJzEnKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdlcnJvcicpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4Y2VwdGlvbnNbY29kZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBuZWVkIGEgc2Vjb25kIGVycm9yIG1hcCBmb3IgdGhlc2UgbWVzc2FnZXMsIGFwcGFyZW50bHkuLi5cbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gZmFjdCwgd2UgY2FuIHVzZSB0aGUgc2FtZSAuZXhjZXB0aW9ucyB3aXRoIHN0cmluZy1rZXlzIHRvIHNhdmUgc29tZSBsb2MgaGVyZVxuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgYXBpIGtleScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgc2lnbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2FwaSBrZXkgZG9udCBoYXZlIHRyYWRlIHBlcm1pc3Npb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ2ludmFsaWQgcGFyYW1ldGVyJykgPj0gMCkgeyAvLyBlcnJvckNvZGUgMCwgcmV0dXJuZWQgb24gYnV5KHN5bWJvbCwgMCwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnaW52YWxpZCBvcmRlcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUmVxdWVzdHMgdG9vIG9mdGVuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ25vdCBhdmFpbGFibGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnZGF0YSB1bmF2YWlsYWJsZScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZU5vdEF2YWlsYWJsZSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgdW5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ICAgICAgICd1c2VyQWdlbnQnOiB0aGlzLnVzZXJBZ2VudHNbJ2Nocm9tZSddLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MDc2OC1mMjJmYzQyNC02MzhhLTExZTctODljOS02MDEwYTU0ZmY5YmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGl2ZWNvaW4ubmV0L2FwaT9sYW5nPWVuJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYWxsL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXhiaWRfbWluYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9yZXN0cmljdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RpY2tlcicsIC8vIG9taXQgcGFyYW1zIHRvIGdldCBhbGwgdGlja2VycyBhdCBvbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9jb2luSW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jbGllbnRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uQ29tbW9uSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2dldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3Rvcnkvc2l6ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9oaXN0b3J5L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9idXltYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NhbmNlbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9zZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcGl0YWxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L29rcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9wYXllZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BlcmZlY3Rtb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL21ha2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvdm91Y2hlci9yZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NQQyc6ICdDYXByaWNvaW4nLFxuICAgICAgICAgICAgICAgICdDUkMnOiAnQ3J5Q2FzaCcsXG4gICAgICAgICAgICAgICAgJ09SRSc6ICdPcmVjdGljJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hCVCc6ICdCcmlja3RveCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICcxMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIGludmFsaWQgcGFyYW1ldGVyc1xuICAgICAgICAgICAgICAgICcxMDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDMnOiBJbnZhbGlkT3JkZXIsIC8vIGludmFsaWQgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAnMTA0JzogSW52YWxpZE9yZGVyLCAvLyBpbnZhbGlkIGFtb3VudFxuICAgICAgICAgICAgICAgICcxMDUnOiBJbnZhbGlkT3JkZXIsIC8vIHVuYWJsZSB0byBibG9jayBmdW5kc1xuICAgICAgICAgICAgICAgICcxMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEyJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIFwiVXNlciBub3QgZm91bmRcIlxuICAgICAgICAgICAgICAgICcyMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzMwJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMzEnOiBOb3RTdXBwb3J0ZWQsXG4gICAgICAgICAgICAgICAgJzMyJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnNDI5JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzUwMyc6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEV4Y2hhbmdlVGlja2VyICgpO1xuICAgICAgICBsZXQgcmVzdHJpY3Rpb25zID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZVJlc3RyaWN0aW9ucyAoKTtcbiAgICAgICAgbGV0IHJlc3RyaWN0aW9uc0J5SWQgPSB0aGlzLmluZGV4QnkgKHJlc3RyaWN0aW9uc1sncmVzdHJpY3Rpb25zJ10sICdjdXJyZW5jeVBhaXInKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBjb2luUmVzdHJpY3Rpb25zID0gdGhpcy5zYWZlVmFsdWUgKHJlc3RyaWN0aW9uc0J5SWQsIHN5bWJvbCk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IDUsXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChjb2luUmVzdHJpY3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgcHJlY2lzaW9uWydwcmljZSddID0gdGhpcy5zYWZlSW50ZWdlciAoY29pblJlc3RyaWN0aW9ucywgJ3ByaWNlU2NhbGUnLCA1KTtcbiAgICAgICAgICAgICAgICBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSA9IHRoaXMuc2FmZUZsb2F0IChjb2luUmVzdHJpY3Rpb25zLCAnbWluTGltaXRRdWFudGl0eScsIGxpbWl0c1snYW1vdW50J11bJ21pbiddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpbWl0c1sncHJpY2UnXSA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5mb0NvaW5JbmZvIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydpbmZvJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ3N5bWJvbCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ3dhbGxldFN0YXR1cyddID09PSAnbm9ybWFsJyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd3aXRoZHJhd0ZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluT3JkZXJBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbldpdGhkcmF3QW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluRGVwb3NpdEFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0gODtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAg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9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3VsdClcbiAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R5cGUnXSA9PT0gJ3RvdGFsJylcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICBpZiAoYmFsYW5jZVsndHlwZSddID09PSAnYXZhaWxhYmxlJylcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWyd2YWx1ZSddKTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT09ICd0cmFkZScpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkaW5nRmVlcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyA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AgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBxdW90ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIHN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsnY3VycmVuY3lQYWlyJ10gPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBzaW5jZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICByZXF1ZXN0Wydpc3N1ZWRGcm9tJ10gPSBwYXJzZUludCAoc2luY2UpO1xuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJylcbiAgICAg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sZXQnKTtcbiAgICAgICAgbGV0IHRhZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKGFkZHJlc3MuaW5kZXhPZiAoJzonKSA+PSAwKSB7XG4gICAgICAgICAgICBsZXQgcGFydHMgPSBhZGRyZXNzLnNwbGl0ICgnOicpO1xuICAgICAgICAgICAgYWRkcmVzcyA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgdGFnID0gcGFydHNbMl07XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAndGFnJzogdGFnLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmIChjb2RlID49IDMwMCkge1xuICAgICAgICAgICAgICAgIGxldCBlcnJvckNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JDb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yQ29kZSBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgIC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UuZXhwb3J0cyA9IGNsYXNzIGx1bm8gZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2x1bm8nLFxuICAgICAgICAgICAgJ25hbWUnOiAnbHVubycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnR0InLCAnU0cnLCAnWkEnIF0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjYwNy04YzFhNjlkOC01ZWRlLTExZTctOTMwYy01NDBiNWViOWJlMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLm15Yml0eC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx1bm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHVuby5jb20vZW4vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vbnBtanMub3JnL3BhY2thZ2UvYml0eCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYmF1c21laWVyL25vZGUtYml0eCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3RvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0b3BvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvYXV0aDIvZ3JhbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q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pZGUnXSA9ICdiYXNlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gYmFzZUZlZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VP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GUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpXG4gICAgICAgICAgICAgICAgb3JkZXJbJ2NvdW50ZXJfdm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgb3JkZXJbJ2Jhc2Vfdm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ1Bvc3RvcmRlcic7XG4gICAgICAgICAgICBvcmRlclsndm9sdW1lJ10gPSBhbW91bnQ7XG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gPSAnQklEJztcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsndHlwZSddID0gJ0FTSyc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFN0b3BvcmRlciAoeyAnb3JkZXJfaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsI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ZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNDQ4NzYyMC0zMTM5YTdiMC1lZmU2LTExZTctOTBmNS1lNTIwY2VmNzQ0NTEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5seWtrZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL3N3YWdnZXIvdWkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmx5a2tlLmNvbS9seWtrZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cubHlra2UuY29tL3RyYWRpbmctY29uZGl0aW9ucycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbW9iaWxlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FsbEFzc2V0UGFpclJhdGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJc0FsaXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzL3tBc3NldFBhaXJJZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVycy9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL3tpZH0vQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLCAvLyBhcyBvZiA3IEZlYiAyMDE4LCBzZWUgaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTg2M1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsIC8vIGh0dHBzOi8vd3d3Lmx5a2tlLmNvbS9jcC93YWxsZXQtZmVlcy1hbmQtbGltaXRzXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0V2FsbGV0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gYmFsYW5jZVsnQmFsYW5jZSddO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBiYWxhbmNlWydSZXNlcnZlZCddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSB0b3RhbCAtIHVzZWQ7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSA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XR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydCYXNlQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydRdW90aW5nQXNzZXRJZCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ05hbWUnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnQWNjdXJhY3knXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ0ludmVydGVkQWNjdXJhY3knXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ1Jlc3VsdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0JpZCddKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0FzayddKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLm1vYmlsZUdldEFsbEFzc2V0UGFpclJhdGVzTWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdQZW5kaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdJbk9yZGVyQm9vaycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnUHJvY2Vzc2luZycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnTWF0Y2hlZCcpIHtcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdDYW5jZWxsZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdOb3RFbm91Z2hGdW5kcycpIHtcbiAgICAgICAgICAgIHJldHVybiAnTm90RW5vdWdoRnVuZHMnO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gJ05vTGlxdWlkaXR5Jykge1xuICAgICAgICAgICAgcmV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wb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rc0Fzc2V0UGFpcklkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ0Fzc2V0UGFpcklkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2UubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBzaWRlID0gcmVzcG9uc2VbaV07XG4gICAgICAgICAgICBpZiAoc2lkZVsnSXNCdXknXSkge1xuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYmlkcyddID0gdGhpcy5hcnJheUNvbmNhdCAob3JkZXJib29rWydiaWRzJ10sIHNpZGVbJ1ByaWNlcyddKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydhc2tzJ10gPSB0aGlzLmFycmF5Q29uY2F0IChvcmRlcmJvb2tbJ2Fza3MnXSwgc2lkZVsnUHJpY2VzJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNpZGVUaW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAoc2lkZVsnVGltZXN0YW1wJ10pO1xuICAgICAgICAgICAgdGltZXN0YW1wID0gKHR5cGVvZiB0aW1lc3RhbXAgPT09ICd1bmRlZmluZWQnKSA/IHNpZGVUaW1lc3RhbXAgOiBNYXRoLm1heCAodGltZXN0YW1wLCBzaWRlVGltZXN0YW1wKTtcbiAgICAgICAgfVxuICAgICAgIC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S0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBtZXJjYWRvIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdtZXJjYWRvJyxcbiAgICAgICAgICAgICduYW1lJzogJ01lcmNhZG8gQml0Y29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0JSJywgLy8gQnJhemlsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MzcwNjAtZTdjNTg3MTQtNjBlYS0xMWU3LTkxOTItZjA1ZTg2YWRiODNmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnInLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvYXBpLWRvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvdHJhZGUtYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vb3JkZXJib29rLycsIC8vIGxhc3Qgc2xhc2ggY3JpdGljYWxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy97ZnJvbX0ve3RvfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L2RheS1zdW1tYXJ5L3t5ZWFyfS97bW9udGh9L3tkYXl9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3N5c3RlbV9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9idXlfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX3NlbGxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdCUkxCVEMnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCaXRjb2luJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlJMJzogeyAnaWQnOiAnQlJMTFRDJywgJ3N5bWJvbCc6ICdMVEMvQlJMJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JSTCcsICdzdWZmaXgnOiAnTGl0ZWNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9CUkwnOiB7ICdpZCc6ICdCUkxCQ0gnLCAnc3ltYm9sJzogJ0JDSC9CUkwnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCQ2FzaCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuIC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2VdWydhdmFpbGFibGUnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2xvd2VyY2FzZV1bJ3RvdGFsJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdtYXJrZXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGFsbG93cyBsaW1pdCBvcmRlcnMgb25seScpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0UGxhY2UnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKSArICdPcmRlcic7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICAgICAgJ2xpbWl0X3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIC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AgICAgICAgICAgICBpZiAob3JkZXJbJ2NvaW5fcGFpciddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjb2luX3BhaXInXV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY3JlYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWydjcmVhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICgndXBkYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWyd1cGRhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdsaW1pdF9wcmljZScpO1xuICAgICAgICAvLyBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2V4ZWN1dGVkX3ByaWNlX2F2ZycsIHByaWNlKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZF9wcmljZV9hdmcnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZF9xdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgY29zdCA9IGFtb3VudCAqIGF2ZXJhZ2U7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICghc3ltYm9sKVxuICAgICAgICAg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ICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd0YXBpX21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3RhcGlfbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL3RhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArICc/JyArIGJvZHk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnVEFQSS1JRCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdUQVBJLU1BQyc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICd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LCB7XG4gICAgICAgICAgICAnaWQnOiAnbWl4Y29pbnMnLFxuICAgICAgICAgICAgJ25hbWUnOiAnTWl4Q29pbnMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0dCJywgJ0hLJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDIzNzIxMi1lZDI5MzAzYy05NTM1LTExZTctOGFmOC1mY2QzODFjZmEyMGMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vbWl4Y29pbnMuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL21peGNvaW5zLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL21peGNvaW5zLmNvbS9oZWxwL2FwaS8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y191c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDE1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUSC9CVEMnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJzogMC4wMDEsICd0YWtlcic6IDAuMDAxNSB9LFxuICAgICAgICAgICAgICAgICdCQ0gvQlRDJzogeyAnaWQnOiAnYmNoX2J0YycsICdzeW1ib2wnOiAnQkNIL0JUQycsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdCVEMnLCAnbWFrZXInOiAwLjAwMSwgJ3Rha2VyJzogMC4wMDE1IH0sXG4gICAgICAgICAgICAgICAgJ0xTSy9CVEMnOiB7ICdpZCc6ICdsc2tfYnRjJywgJ3N5bWJvbCc6ICdMU0svQlRDJywgJ2Jhc2UnOiAnTFNLJywgJ3F1b3RlJzogJ0JUQycsICdtYWtlcic6IDAuMDAxNSwgJ3Rha2VyJzogMC4wMDI1IH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9VU0QnOiB7ICdpZCc6ICdiY2h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hbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuc2VjcmV0LCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnL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JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDA4NTcxLTI1YTYyNDZlLTMyNTgtMTFlOC05NjliLWFlYjY5MTA0OTI0NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9icm9rZXIubmVnb2NpZWNvaW5zLmNvbS5ici9hcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2Jyb2tlci5uZWdvY2llY29pbnMuY29tLmJyL3RyYWRlYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubmVnb2NpZWNvaW5zLmNvbS5icicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLXRyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5uZWdvY2llY29pbnMuY29tLmJyL2NvbWlzc29lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne1BBUn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RyYWRlcy97dGltZXN0YW1wX2luaWNpYWx9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMve3RpbWVzdGFtcF9pbmljaWFsfS97dGltZXN0YW1wX2ZpbmFsfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgIC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G4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSA/IG1hcmtldFsnc3ltYm9sJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5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lzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSAqIGFtb3VudCkpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndGlkJyksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWyd0eXBlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgaWYgKHR5cGVvZiBzaW5jZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzaW5jZSA9IDA7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ1BBUic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXBfaW5pY2lhbCc6IHBhcnNlS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GxlZCwgZmlsbGVkLCBwYXJ0aWFsbHkgZmlsbGVkLCBwZW5kaW5nLCByZWplY3RlZFxuICAgICAgICBpZiAoc3RhdHVzID09PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnY2FuY2VsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgdHJhZGVzID0gdW5kZWZpbmVkO1xuICAgICAgICAvLyBpZiAob3JkZXJbJ29wZXJhdGlvbnMnXSlcbiAgICAgICAgLy8gICAgIHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKG9yZGVyWydvcGVyYXRpb25zJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW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bXAgPSB0aGlzLnNlY29uZHMgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSAnJztcbiAgICAgICAgICAgIGlmIChxdWVyeVN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgY29udGVudCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKGJvZHkpLCAnbWQ1JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdXJpID0gdGhpcy5lbmNvZGVVUklDb21wb25lbnQgKHVybCkudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IFsgdGhpcy5hcGlLZXksIG1ldGhvZCwgdXJpLCB0aW1lc3RhbXAsIG5vbmNlLCBjb250ZW50IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBzaWduYXR1cmUgPSB0aGlzLmJpbmFyeVRvU3RyaW5nIChzaWduYXR1cmUpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIHRoaXMuYXBpS2V5LCBzaWduYXR1cmUsIG5vbmNlLCB0aW1lc3RhbXAgXS5qb2luICgnOicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICA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tcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdub3ZhJyxcbiAgICAgICAgICAgICduYW1lJzogJ05vdmFleGNoYW5nZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1RaJywgLy8gVGFuemFuaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA1MTg1NzEtNzhjYTBiY2EtOWI4YS0xMWU3LTg4NDAtNjRiODNhNGE5NGIyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbm92YWV4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlL2ZhcScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tiYXNlY3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2luZm8ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYm90aC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS97b3JkZXJ0eXBlfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZS97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG5ld2RlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzX21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxvcmRlci97b3JkZXJpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FsaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnbWFya2V0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldG5hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRbJ2Rpc2FibGVkJ10pXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVub3JkZXJzUGFpckJvdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXlvcmRlcnMnLCAnc2VsbG9yZGVycycsICdwcmljZScsICdhbW91bnQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldEluZm9QYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wp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V0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAobG9ja2JveCwgdHJhZGVzKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYW1vdW50ID0gYW1vdW50LnRvU3RyaW5nICgpO1xuICAgICAgICBwcmljZSA9IHByaWNlLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0cmFkZXR5cGUnOiBzaWRlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3RyYWRlYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3RyYWRlcHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0cmFkZWJhc2UnOiAxLFxuICAgICAgICAgICAgJ3BhaXInOiB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AgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh7ICdub25jZSc6IG5vbmNlIH0pO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHVybCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLm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NzIG9rY29pbnVzZCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnb2tjb2ludXNkJyxcbiAgICAgICAgICAgICduYW1lJzogJ09LQ29pbiBVU0QnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0NOJywgJ1VTJyBdLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsIC8vIHVwIHRvIDMwMDAgcmVxdWVzdHMgcGVyIDUgbWludXRlcyDiiYggNjAwIHJlcXVlc3RzIHBlciBtaW51dGUg4omIIDEwIHJlcXVlc3RzIHBlciBzZWNvbmQg4omIIDEwMCBtc1xuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmdXR1cmVzJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuZG8nLCAvLyBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlX3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2VzdGltYXRlZF9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2hvbGRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaW5kZXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3ByaWNlX2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd3NfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2JvcnJvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9iYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2Rldm9sdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9leHBsb3NpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mb180Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3VibWl0X290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VucmVwYXltZW50c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NzkxLTg5ZmZiNTAyLTVlZTUtMTFlNy04YTViLWM1OTUwYjY4YWM2NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5va2NvaW4uY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL29rY29pbi5jb20nLFxuICAgICAgICAgICAgICAg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RpdmUgPSAobWFya2V0c1tpXVsnb25saW5lJ10gIT09IDApO1xuICAgICAgICAgICAgbGV0IGJhc2VOdW1lcmljSWQgPSBtYXJrZXRzW2ldWydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZU51bWVyaWNJZCA9IG1hcmtldHNbaV1bJ3F1b3RlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYmFzZU51bWVyaWNJZCc6IGJhc2VOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlTnVtZXJpY0lkJzogcXVvdGVOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXRzW2ldLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluUHJpY2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQgKiBtaW5QcmljZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgZnV0dXJlUXVvdGUgPSAobWFya2V0WydxdW90ZSddID09PSAnVVNEVCcpID8gJ1VTRCcgOiBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICBsZXQgZnV0dXJlU3ltYm9sID0gbWFya2V0WydiYXNlJ10gKyAnLycgKyBmdXR1cmVRdW90ZTtcbiAgICAgICAgICAgIGlmICgodGhpcy5oYXNbJ2Z1dHVyZXMnXSkgJiYgKGZ1dHVyZVN5bWJvbCBpbiBmdXR1cmVNYXJrZXRzKSkge1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAobWFya2V0LCB7XG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6ICdVU0QnLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydiYXNlJ10gKyAnL1VTRCcsXG4gICAgICAgICAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXS5yZXBsYWNlICgndXNkdCcsICd1c2QnKSxcbiAgICAgICAgICA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1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRpY2tlclsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwdWJsaWNHZXQnO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0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21hcmtldCc7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5zYWZlRmxvYXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcmRlclsncHJpY2UnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYXJrZXQgYnV5IG9yZGVycyByZXF1aXJlIGFuIGFkZGl0aW9uYWwgY29zdCBwYXJhbWV0ZXIsIGNvc3QgPSBwcmljZSAqIGFtb3VudCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyYW1zID0gdGhpcy5vbWl0IChwYXJhbXMsICdjb3N0Jyk7XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGUnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkL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c7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ10gPSAndGhpc193ZWVrJzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0NhbmNlbE9yZGVyJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBpZiAoc3RhdHVzID09PSAtMSlcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAgICAgICBpZiAoc3RhdHVzID09PSAwKVxuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMSlcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIGlmIChzdGF0dXMgPT09IDIpXG4gICAgICAgICAgICByZXR1cm4gJ2Nsb3NlZCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICBpZiAoc3RhdHVzID09PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclNpZGUgKHNpZGUpIHtcbiAgICAgICAgaWYgKHNpZGUgPT09IDEpXG4gICAgICAgICAgICByZXR1cm4gJ2J1eSc7IC8vIG9wZW4gbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gMilcbiAgICAgICAgICAgIHJldHVybiAnc2VsbCc7IC8vIG9wZW4gc2hvcnQgcG9zaXRpb25cbiAgICAgICAgaWYgKHNpZGUgPT09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ3NlbGwnOyAvLyBsaXF1aWRhdGUgbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gNClcbiAgICAgICAgICAgIHJldHVybiAnYnV5JzsgLy8gbGlxdWlkYXRlIHNob3J0IHBvc2l0aW9uXG4gICAgICAgIHJldHVybiBzaWRlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCB0eXBlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3R5cGUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBpZiAoKG9yZGVyWyd0eXBlJ10gPT09ICdidXknKSB8fCAob3JkZXJbJ3R5cGUnXSA9PT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnYnV5X21hcmtldCcpIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdtYXJrZXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnc2VsbF9tYXJrZXQnKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgICAgICAgICB0eXBlID0gJ21hcmtldCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNpZGUgPSB0aGlzLnBhcnNlT3JkZXJTaWRlIChvcmRlclsndHlwZSddKTtcbiAgICAgICAgICAgICAgICBpZiAoKCdjb250cmFjdF9uYW1lJyBpbiBvcmRlcikgfHwgKCdsZXZlc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wO1xuICAgICAgICB9XG4gICAgICAgIGxldCBhdmVyYWdlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYXZnX3ByaWNlJyk7XG4gICAgICAgIC8vIGh0dHBzOi8vZ2l0aHViLmNvbS9jY3h0L2NjeHQvaXNzdWVzLzI0NTJcbiAgICAgICAgYXZlcmFnZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlX2F2ZycsIGF2ZXJhZ2UpO1xuICAgICAgICBsZXQgY29zdCA9IGF2ZXJhZ2UgKiBmaWxsZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICA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G4gICAgICAgICAgICB9IGVsc2UgaWYgKCdzdGF0dXMnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBhcmFtc1snc3RhdHVzJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBuYW1lID0gb3JkZXJfaWRfaW5fcGFyYW1zID8gJ3R5cGUnIDogJ3N0YXR1cyc7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoT3JkZXJzKCkgcmVxdWlyZXMgJyArIG5hbWUgKyAnIHBhcmFtIGZvciBzcG90IG1hcmtldCAnICsgc3ltYm9sICsgJyAoMCAtIGZvciB1bmZpbGxlZCBvcmRlcnMsIDEgLSBmb3IgZmlsbGVkL2NhbmNlbGVkIG9yZGVycyknKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChvcmRlcl9pZF9pbl9wYXJhbXMpIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVyc0luZm8nO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2lkJzogcGFyYW1zWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVySGlzdG9yeSc7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCB7XG4gICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50X3BhZ2UnOiAxLCAvLyBjdXJyZW50IHBhZ2UgbnVtYmVyXG4gICAgICAgICA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c2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnZXJyb3JfY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JfY29kZScpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yXTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbkNsYXNzIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3Jlc3VsdCddKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBva2NvaW51c2QgPSByZXF1aXJlICgnLi9va2NvaW51c2QuanMnKTtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3Mgb2tleCBleHRlbmRzIG9rY29pbnVzZCB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ29rZXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnT0tFWCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnQ04nLCAnVVMnIF0sXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2Z1dHVyZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzI1NTI3NjgtMGQ2ZGQzYzYtYzRhNi0xMWU3LTkwZjgtYzA0M2I2NDc1NmE3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5va2V4LmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cub2tleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL29rY29pbi1va2V4L0FQSS1kb2NzLU9LRXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5va2V4LmNvbS9mZWVzLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdGQUlSJzogJ0ZhaXJHYW1lJyxcbiAgICAgICAgICAgICAgICAnSE1DJzogJ0hpIE11dHVhbCBTb2NpZXR5JyxcbiAgICAgICAgICAgICAgICAnTUFHJzogJ01hZ2dpZScsXG4gICAgICAgICAgICAgICAgJ05BTk8nOiAnWFJCJyxcbiAgICAgICAgICAgICAgICAnWU9ZTyc6ICdZT1lPVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgbGV0IHJhdGUgPSBtYXJrZXRbdGFrZXJPck1ha2VyXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiByYXRlKSk7XG4gICAgICAgIGlmIChzaWRlID09PSAnc2VsbCcpIHtcbiAgICAgICAgICAgIGNvc3QgKj0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSAnYmFzZSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0eXBlJzogdGFrZXJPck1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ICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vcGF5bWl1bS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnBheW1pdW0uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL1BheW1pdW0vYXBpLWRvY3VtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cucGF5bWl1bS5jb20vcGFnZS9kZXZlbG9wZXJzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3VudHJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fY2hhcnRzL3tpZH0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvZ2V0X3BheW1lbnQve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMve2J0Y19hZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGF5bWVudF9yZXF1ZXN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lcmNoYW50L2NyZWF0ZV9wYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycy97VVVJRH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDU5LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gJ2JhbGFuY2VfJyArIGxvd2VyY2FzZTtcbiAgICAgICAgICAgIGxldCBsb2NrZWQgPSAnbG9ja2VkXycgKyBsb3dlcmNhc2U7XG4gICAgICAgICAgICBpZiAoYmFsYW5jZSBpbiBiYWxhbmNlcylcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBiYWxhbmNlc1tiYWxhbmNlXTtcbiAgICAgICAgICAgIGlmIChsb2NrZWQgaW4gYmFsYW5jZXMpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYmFsYW5jZXNbbG9ja2VkXTtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZnJlZSddLCBhY2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3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydjcmVhdGVkX2F0X2ludCddKSAqIDEwMDA7XG4gICAgICAgIGxldCB2b2x1bWUgPSAndHJhZGVkXycgKyBtYXJrZXRbJ2Jhc2UnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndXVpZCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVt2b2x1bWVdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERhdGFJZFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5jYXBpdGFsaXplICh0eXBlKSArICdPcmRlcicsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2RpcmVjdGlvbic6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VXNlck9yZGVycyAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsndXVpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyTnVtYmVyJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXBpLUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICA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ZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODE3LWU5NDU2MzEyLTVlZTYtMTFlNy05YjNjLWI2MjhjYTU2MjZhNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vdHJhZGluZ0FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcG9sb25pZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9wb2xvbmlleC5jb20vc3VwcG9ydC9hcGkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9wYXN0ZWJpbi5jb20vZE1YN21aRTAnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybjI0aFZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ2hhcnREYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Mb2FuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbExvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlTWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUxvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVOZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5TZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3ZlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkFjdGl2ZUxvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BdmFpbGFibGVBY2NvdW50QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Db21wbGV0ZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5GZWVJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5MZW5kaW5nSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTWFyZ2luQWNjb3VudFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5Mb2FuT2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlclRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGFibGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b2dnbGVBdXRvUmVuZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQlRNJzogJ0JpdG1hcmsnLFxuICAgICAgICAgICAgICAgICdTVFInOiAnWExNJyxcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JUQ3RhbGtjb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb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gICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVybkNvbXBsZXRlQmFsYW5jZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnYWNjb3VudCc6ICdhbGwnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnb25PcmRlcnMnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogMC4wLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzLnN1bSAoYWNjb3VudFsnZnJlZSddLCBhY2NvdW50Wyd1c2VkJ10pO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRmVlcyAocGFyYW1zID0ge30pIH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dCB0aGlzLnB1YmxpY0dldFJldHVyblRpY2tlciAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0UmV0dXJuQ3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChjdXJyZW5jaWVzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpZF07XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7IC8vIGRlZmF1bHQgcHJlY2lzaW9uLCB0b2RvOiBmaXggXCJtYWdpYyBjb25zdGFudHNcIlxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChjdXJyZW5jeVsnZGVsaXN0ZWQnXSA9PT0gMCk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gKGN1cnJlbmN5WydkaXNhYmxlZCddKSA/ICdkaXNhYmxlZCcgOiAnb2snO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyAhPT0gJ29rJylcbiAgICAgICAgICAgICAgICBhY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICd0eEZlZScpLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ3R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0UmV0dXJuVGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgdG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gcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3RvdGFsJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKTtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgcmF0ZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpO1xuICAgICAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGJhc2U7XG4gICAgICAgICAgICAgICAgZmVlQ29zdCA9IGFtb3VudCAqIHJhdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gcXVvdGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IGNvc3QgKiByYXRlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndHJhZGVJRCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyTnVtYmVyJyksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdyYXRlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnY3VycmVuY3lQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnQnXSA9IHBhcnNlSW50IChzaW5jZSAvIDEwMDApO1xuICAgICAgICAgICAgcmVxdWVzdFsn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XN0WydsaW1pdCddID0gcGFyc2VJbnQgKGxpbWl0KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVyblRyYWRlSGlzdG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZ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ICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBmaWxsZWQgKiBwcmljZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IDA7XG4gICAgICAgICAgICAgICAgY29zdCA9IDA7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdHJhZGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGVBbW91bnQgPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGxldCB0cmFkZVByaWNlID0gdHJhZGVbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHRoaXMuc3VtIChmaWxsZWQsIHRyYWRlQW1vdW50KTtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVByaWNlICogdHJhZGVBbW91bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9wZW5PcmRlcnMgKG9yZGVycywgbWFya2V0LCByZXN1bHQgPSBbXSkge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGV4dGVuZGVkID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydyYXRlJ10sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLnBhcnNlT3JkZXIgKGV4dGVuZGVkLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN5bWJvbClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcGFpciA9IG1hcmtldCA/IG1hcmtldFsnaWQnXSA6ICdhbGwnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UmV0dXJuT3Blbk9yZGVycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBwYWlyLFxuICAgICAgICB9KSk7XG4gICAgICAgIGxldCBvcGVuT3JkZXJzID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIG9wZW5PcmRlcnMgPSB0aGlzLnBhcnNlT3Blbk9yZGVycyAocmVzcG9uc2UsIG1hcmtldCwgb3Blbk9yZGVycyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWRzID0gT2JqZWN0LmtleXMgKHJlc3BvbnNlKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0SWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gbWFya2V0SWRzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBvcmRlcnMgPSByZXNwb25zZVttYXJrZXRJZF07XG4gICAgICAgICAgICAgICAgbGV0IG0gPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1x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ICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2Nvc3QnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2ZpbGxlZCddICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlclsnY29zdCddID0gb3JkZXJbJ2ZpbGxlZCddICogb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gPT09IHN5bWJvbClcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXJCeVNpbmNlTGltaXQgKHJlc3VsdCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICA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vYXQgKHByaWNlKTtcbiAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAoYW1vdW50KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdyYXRlJzogdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9LCByZXNwb25zZSksIG1hcmtldCk7XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXh0ZW5kICh7ICdpbmZvJzogcmVzcG9uc2UgfSwgb3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGVkaXRPcmRlciAoaWQsIHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0IChwcmljZSk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ29yZGVyTnVtYmVyJzogaWQsXG4gICAgICAgICAgICAncmF0ZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAoYW1vdW50KTtcbiAgICAgICAgICAgIHJlcXVlc3RbJ2Ftb3VudCddID0gdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RNb3ZlT3JkZXIgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKSB7XG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF1bJ3N0YXR1cyddID0gJ2NhbmNlbGVkJztcbiAgICAgICAgICAgIGxldCBuZXdpZCA9IHJlc3BvbnNlWydvcmRlck51bWJlciddO1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbbmV3aWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IG5ld2lkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbm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kLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7ICdjb21tYW5kJzogcGF0aCB9LCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHF1ZXJ5Wydub25jZSddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBK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vdW5kIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09PSAnSW52YWxpZCBBUEkga2V5L3NlY3JldCBwYWlyLicpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PT0gJ1BsZWFzZSBkbyBub3QgbWFrZSBtb3JlIHRoYW4gOCBBUEkgY2FsbHMgcGVyIHNlY29uZC4nKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yLmluZGV4T2YgKCdUb3RhbCBtdXN0IGJlIGF0IGxlYXN0JykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IuaW5kZXhPZiAoJ05vdCBlbm91Z2gnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yLmluZGV4T2YgKCdOb25jZSBtdXN0IGJlIGdyZWF0ZXInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWROb25jZSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvci5pbmRleE9mICgnWW91IGhhdmUgYWxyZWFkeSBjYWxsZWQgY2FuY2VsT3JkZXIgb3IgbW92ZU9yZGVyIG9uIHRoaXMgb3JkZXIuJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBDYW5jZWxQZW5kaW5nIChmZWVkYmFjayk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuIC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LFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA5NTM5MTUtYjE2MTFkYzAtYTQzNi0xMWU3LTg5NDctYzk1YmQ1YTQyMDg2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tL3YyJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vcXJ5cHRvcy56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDc4NTgxNjctRmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3ByaWNlX2xldmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaXJfbGFkZGVycy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL21haW5fYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucy9tZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9leGVjdXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9L2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWF0X2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuX2JpZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2Nsb3NlX2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdza2lwSnNvbk9uU3RhdHVzQ29kZXMnOiBbNDAxXSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ0FQSSBBdXRoZW50aWNhdGlvbiBmYWlsZWQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICAgICAnTm9uY2UgaXMgdG9vIHNtYWxsJzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgbm90IGZvdW5kJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZXInOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90X2Vub3VnaF9mcmVlX2JhbGFuY2UnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ211c3RfYmVfcG9zaXRpdmUnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdxdWFudGl0eSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXNzX3RoYW5fb3JkZXJfc2l6ZSc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZWRfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gIW1hcmtldFsnZGlzYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBtaW5BbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgbWluUHJpY2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoYmFzZSA9PT0gJ0JUQycpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYmFzZSA9PT0gJ0VUSCcpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHF1b3RlID09PSAnQlRDJykge1xuICAgICAgICAgICAgICAgIG1pblByaWNlID0gMC4wMDAwMDAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGUgPT09ICdFVEgnIHx8IHF1b3RlID09PSAnVVNEJyB8fCBxdW90ZSA9PT0gJ0pQWScpIHtcbiAgICAgICAgICAgICAgICBtaW5QcmljZSA9IDAuMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7ICdtaW4nOiBtaW5BbW91bnQgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7ICdtaW4nOiBtaW5QcmljZSB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5QcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBsaW1pdHNbJ2Nvc3QnXVsnbWluJ10gPSBtaW5QcmljZSAqIG1pbkFtb3VudDtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsnYW1vdW50J10gPSAtTWF0aC5sb2cxMCAobWluQW1vdW50KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWluUHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsncHJpY2UnXSA9IC1NYXRoLmxvZzEwIChtaW5QcmljZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1c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ZWxzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2J1eV9wcmljZV9sZXZlbHMnLCAnc2VsbF9wcmljZV9sZXZlbHMnKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgbGFzdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdsYXN0X3RyYWRlZF9wcmljZScgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBpZiAodGlja2VyWydsYXN0X3RyYWRlZF9wcmljZSddKSB7XG4gICAgICAgICAgICAgICAgbGV0IGxlbmd0aCA9IHRpY2tlclsnbGFzdF90cmFkZWRfcHJpY2UnXS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWYgKGxlbmd0aCA+IDApXG4gICAgICAgICAgICAgICAgICAgIGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF90cmFkZWRfcHJpY2UnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuIC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cbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50IC0gZmlsbGVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJfZmVlJyksXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb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Bub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAncGF0aCc6IHVybCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAndG9rZW5faWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnaWF0JzogTWF0aC5mbG9vciAobm9uY2UgLyAxMDAwKSwgLy8gaXNzdWVkIGF0XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaGVhZGVyc1snWC1RdW9pbmUtQXV0aCddID0gdGhpcy5qd3QgKHJlcXVlc3QsIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSwgcmVzcG9uc2UgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKGNvZGUgPj0gMjAwICYmIGNvZGUgPD0gMjk5KVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBjb25zdCBtZXNzYWdlcyA9IHRoaXMuZXhjZXB0aW9uc1snbWVzc2FnZXMnXTtcbiAgICAgICAgaWYgKGNvZGUgPT09IDQwMSkge1xuICAgICAgICAgICAgLy8gZXhwZWN0ZWQgbm9uLWpzb24gcmVzcG9uc2VcbiAgICAgICAgICAgIGlmIChib2R5IGluIG1lc3NhZ2VzKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBtZXNzYWdlc1tib2R5XSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIHJlc3BvbnNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSlcbiAgICAgICAgICAgICAgICByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDQpIHtcbiAgICAgICAgICAgIC8vIHsgXCJtZXNzYWdlXCI6IFwiT3JkZXIgbm90IGZvdW5kXCIgfVxuICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICBpZiAobWVzc2FnZSBpbiBtZXNzYWdlcylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgbWVzc2FnZXNbbWVzc2FnZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09PSA0MjIpIHtcbiAgICAgICAgICAgIC8vIGFycmF5IG9mIGVycm9yIG1lc3NhZ2VzIGlzIHJldHVybmVkIGluICd1c2VyJyBvciAncXVhbnRpdHknIHByb3BlcnR5IG9mICdlcnJvcnMnIG9iamVjdCwgZS5nLjpcbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInVzZXJcIjogW1wibm90X2Vub3VnaF9mcmVlX2JhbGFuY2VcIl0gfX1cbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInF1YW50aXR5XCI6IFtcImxlc3NfdGhhbl9vcmRlcl9zaXplXCJdIH19XG4gICAgICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnJvcnMgPSByZXNwb25zZVsnZXJyb3JzJ107XG4gICAgICAgICAgICAgICAgY29uc3QgZXJyb3JUeXBlcyA9IFsndXNlcicsICdxdWFudGl0eScsICdwcmljZSddO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZXJyb3JUeXBlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvclR5cGUgPSBlcnJvclR5cGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JUeXBlIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JNZXNzYWdlcyA9IGVycm9yc1tlcnJvclR5cGVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBlcnJvck1lc3NhZ2VzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IGVycm9yTWVzc2FnZXNbal07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgaW4gbWVzc2FnZXNbZXJyb3JUeXBlXSlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IG1lc3NhZ2VzW2Vycm9yVHlwZV1bbWVzc2FnZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2U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FkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbS9hcGlfaW5mbycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luY2FzaF9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5jYXNoX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5nb2xkX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbmdvbGRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGl0ZWNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXRlY29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb29rdXBfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NBRCc6IHsgJ2lkJzogJ2J0Y19jYWQnLCAnc3ltYm9sJzogJ0JUQy9DQUQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ0FEJywgJ21ha2VyJzogMC4wMDUsICd0YWtlcic6IDAuMDA1IH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdidGNfdXNkJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcsICdtYWtlcic6IDAuMDA1LCAndGFrZXInOiAwLjAwNSB9LFxuICAgICAgICAgICAgICAgICdFVEgvQlRDJzogeyAnaWQnOi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NoJyxcbiAgICAgICAgICAgICdCVEcnOiAnQml0Y29pbmdvbGQnLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gY3VycmVuY2llc1tjdXJyZW5jeV07XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGN1cnJlbmN5LCBhbW91bnQsIGFkZHJlc3MsIHRhZyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5nZXRDdXJyZW5jeU5hbWUgKGN1cnJlbmN5KSArICdXaXRoZHJhd2FsJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSBbIG5vbmNlLnRvU3RyaW5nICgpLCB0aGlzLnVpZCwgdGhpcy5hcGlLZXkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChzdGF0dXNDb2RlLCBzdGF0dXNUZXh0LCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyB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GhYY2hhbmdlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQVInLCAvLyBBcmdlbnRpbmFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZURlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4Mzg5MTItNGY5NGVjOGEtNjBmNi0xMWU3LTllNWQtYmJmOWJkNTBhNTU5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnNvdXRoeGNoYW5nZS5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE1hcmtldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlbmV3YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ1NNVCc6ICdTbWFydE5vZGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbMF07XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsxXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gc3ltYm9sO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWR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hc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJpY2VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgdGlja2VycyA9IHRoaXMuaW5kZXhCeSAocmVzcG9uc2UsICdNYXJrZXQnKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltY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0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHN1cmJpdGNvaW4gZXh0ZW5kcyBmb3hiaXQge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdzdXJiaXRjb2luJyxcbiAgICAgICAgICAgICduYW1lJzogJ1N1ckJpdGNvaW4nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdWRScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MTUxMS1mMGE1MDE5NC02NDgxLTExZTctOTliNS04ZjAyOTMyNDI0Y2MuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3N1cmJpdGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxpbmt0cmFkZS5jb20vZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2Jyb2tlcklkJzogJzEnLCAvLyBodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MvI2Jy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Q1NC8yNzc2Njg2OS03NTA1N2ZhMi01ZWU5LTExZTctOWE2Zi0xM2U2NDFmYTQ3MDcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbS9kb2MvdjEvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20vZG9jLycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbl9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXRtcy93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3JlbW92ZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAyLjUsICAvLyB3b3JzdC1jYXNlIHNjZW5hcmlvOiBodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbS9lbi9wYWdlcy9mZWVzXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc1RpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Z1bmRfaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFz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9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHVybDtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtVFJULUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdYLVRSVC1OT05DRSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdYLVRSVC1TSUdOJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgc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3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3RpZGViaXQnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVGlkZUJpdCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzkwMzQ5MjEtZTNhY2YwMTYtNDQ4MC0xMWU4LTk5NDUtYTYwODZhMTA4MmZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy50aWRlYml0LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21hcmtldHMnLCAvLyBWMk1hcmtldHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvdGlja2VycycsIC8vIFYyVGlja2Vyc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi90aWNrZXJzL3ttYXJrZXR9JywgLy8gVjJUaWNrZXJzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcycsIC8vIFYyVHJhZGVzSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcy97bWFya2V0fScsIC8vIFYyVHJhZGVzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyX2Jvb2snLCAvLyBWMk9yZGVyQm9va0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlcicsIC8vIFYyT3JkZXJKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIva193aXRoX3BlbmRpbmdfdHJhZGVzJywgLy8gVjJLV2l0aFBlbmRpbmdUcmFkZXNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvaycsIC8vIFYyS0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXB0aCcsIC8vIFYyRGVwdGhKc29uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW10sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0cycsIC8vIFYyRGVwb3NpdHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvZGVwb3NpdF9hZGRyZXNzJywgLy8gVjJEZXBvc2l0QWRkcmVzc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0JywgLy8gVjJEZXBvc2l0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21lbWJlcnMvbWUnLCAvLyBWMk1lbWJlcnNNZUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9hZGRyZXNzZXMve2FkZHJlc3N9JywgLy8gVjJBZGRyZXNzZXNBZGRyZXNzSnNvblxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9kZWxldGUnLCAvLyBWMk9yZGVyRGVsZXRlSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyJywgLy8gVjJPcmRlckpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9tdWx0aScsIC8vIFYyT3JkZXJNdWx0aUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9jbGVhcicsIC8vIFYyT3JkZXJDbGVhckpzb25cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHt9LCAvLyBUaGVyZSBpcyBvbmx5IDElIGZlZSBvbiB3aXRoZHJhd2FscyB0byB5b3VyIGJhbmsgYWNjb3VudC5cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDAyJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJzIwMDMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY29kZSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFYyRGVwb3NpdEFkZHJlc3MgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzcycpO1xuICAgICAgICAgICAgICAgIGxldCB0YWcgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzc1RhZycpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgICAgICdhZGRyZXNzJzogdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpLFxuICAgICAgICAgICAgICAgICAgICAndGFnJzogdGFnLFxuICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFYyTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRWMkRlcG9zaXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5SWQgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAg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gICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJ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5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBlbmNvZGVQYXJhbXMgKHBhcmFtcykge1xuICAgICAgICByZXR1cm4gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAocGFyYW1zKSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKSArICcuanNvbic7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgc3VmZml4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gc3VmZml4O1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDApIHtcbiAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBjb25zdCBlcnJvciA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICBjb25zdCBlcnJvckNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKGVycm9yLCAnY29kZScpO1xuICAgICAgICAgIC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nQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgIC8vICdmZXRjaFRpY2tlcnMnOiB0cnVlXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDc4MTc4MC0wMzE0OWRjNC1hMTJlLTExZTctODJiYi0zMTNiMjY5ZDI0ZDQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd2ViLnRpZGV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS9hcGkvMycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90aWRleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly90aWRleC5jb20vZXhjaGFuZ2UvcHVibGljLWFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9hc3NldHMtc3BlYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9wYWlycy1zcGVjJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnTUdPJzogJ1dNR08nLFxuICAgICAgICAgICAgICAgICdFTUdPJzogJ01HTycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gYXdhaXQgdGhpcy53ZWJHZXRDdXJyZW5jeSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ2Ftb3VudFBvaW50J107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBjdXJyZW5jeVsndmlzaWJsZSddID09PSB0cnVlO1xuICAgICAgICAgICAgbGV0IHN0YXR1cyA9ICdvayc7XG4gICAgICAgICAgICBpZiAoIWFjdGl2ZSkge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdkaXNhYmxlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgY2FuV2l0aGRyYXcgPSBjdXJyZW5jeVsnd2l0aGRyYXdFbmFibGUnXSA9PT0gdHJ1ZTtcbiAgICAgICAgICAgIGxldCBjYW5EZXBvc2l0ID0gY3VycmVuY3lbJ2RlcG9zaXRFbmFibGUnXSA9PT0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICghY2FuV2l0aGRyYXcgfHwgIWNhbkRlcG9zaXQpIHtcbiAgICAgICAgICAgICAgICBhY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogY2FuV2l0aGRyYXcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbkRlcG9zaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91dCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ2RlcG9zaXRNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGdldFZlcnNpb25TdHJpbmcgKCkge1xuICAgICAgICByZXR1cm4gJyc7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLnNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmdldFZlcnNpb25TdHJpbmcgKCkgKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V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0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgdmF1bHRvcm8gZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3ZhdWx0b3JvJyxcbiAgICAgICAgICAgICduYW1lJzogJ1ZhdWx0b3JvJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ0gnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4ODAtZjIwNWU4NzAtNWVlOS0xMWU3LThmZTItMGQ1YjE1ODgwNzUyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0dMRCc6ICdHb2xkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgfSk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgIC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sICdMYXN0UHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnMjRoSGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICcyNGhMb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiBiaWRbMF0sXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IGFza1swXSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICcyNGhWb2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpI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Bib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSkpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ1gtU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0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AgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODk0LTZkYTlkMzYwLTVlZWEtMTFlNy05MGFhLTQxZjI3MTFiNzQwNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS52aXJ3b3guY29tL2FwaS9qc29uLnBocCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20vYXBpL3RyYWRpbmcucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2RldmVsb3BlcnMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvZ2luJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0SW5zdHJ1bWVudHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtrZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaW5zdHJ1bWVudElEJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydsb25nQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnc2hvcnRDdXJyZW5jeSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXVsnYWNjb3VudExpc3QnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogdG90YWwsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0UHJpY2UgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0QmVzdFByaWNlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2xzJzogWyBzeW1ib2wgXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHJlc3VsdFswXSwgJ2Jlc3RCdXlQcmljZScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0IChyZXN1bHRbMF0sICdiZXN0U2VsbFByaWNlJyksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1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xuICAgICAgICAgICAgJ2xhc3QnOiBjbG9zZSxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb25nVm9sdW1lJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2hvcnRWb2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBzeW1ib2wgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNlYyA9IHRoaXMuc2FmZUludGVnZXIgKHRyYWRlLCAndGltZScpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gc2VjICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogdGhpcy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AgICAgICAgYXV0aFsndXNlciddID0gdGhpcy5sb2dpbjtcbiAgICAgICAgICAgIGF1dGhbJ3Bhc3MnXSA9IHRoaXMucGFzc3dvcmQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0sIGF1dGgsIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiB0aGlzLmV4dGVuZCAoYXV0aCwgcGFyYW1zKSxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSAyMDApIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yQ29kZScgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3JDb2RlID0gcmVzdWx0WydlcnJvckNvZGUnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvckNvZGUgIT09ICdPSycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYWxmb3JtZWQgcmVzcG9uc2U6IG5vIHJlc3VsdCBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgLy8gaWYgbm90IGEgSlNPTiByZXNwb25zZVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG5vbi1KU09OIHJlcGx5OiAnICsgYm9keSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY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HR0cHM6Ly93ZXgubnovYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93ZXgubnovdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd2V4Lm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovYXBpLzMvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei90YXBpL2RvY3MnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93ZXgubnovZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBzdGF0dXMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdHMgdG9vIG9mdGVuJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdub3QgYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2Vy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sZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q29pbkRlcG9zaXRBZGRyZXNzICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjb2RlLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiByZXNwb25zZVsncmV0dXJuJ11bJ2FkZHJlc3MnXSxcbiAgICAgICAgICAgICd0YWcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSAyMDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdICE9PSAneycpIHtcbiAgICAgICAgICAgICAgICAvLyByZXNwb25zZSBpcyBub3QgSlNPTiAtPiByZXNvcnQgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG1hbGZvcm1lZCBlcnJvcjogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciA9PT0gJ25vIG9yZGVycycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybmVkIGJ5IGZldGNoT3Blbk9yZGVycyBpZiBubyBvcGVuIG9yZGVycyAoZml4IGZvciAjNDg5KSAtPiBub3QgYW4gZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZXMgPSB0aGlzLmV4Y2VwdGlvbnNbJ21lc3NhZ2VzJ107XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiBtZXNzYWdlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IG1lc3NhZ2VzW2Vycm9yXSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvci5pbmRleE9mICgnSXQgaXMgbm90IGVub3VnaCcpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vIC0tLS0tLS0tLS0tLS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dsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgwNTk0MTQtZTIzNTk3MGMtNjYyYy0xMWU3LThjM2EtMDhlMzFmNzg2ODRiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NyeXB0b3R0bGl2ZXdlYmFwaS54YnRjZS5uZXQ6ODQ0My9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tL3RyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC54YnRjZS5pbmZvL0tub3dsZWRnZWJhc2UvQXJ0aWNsZS9WaWV3LzUyLzI1L3hidGNlLWV4Y2hhbmdlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2VydmVyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZC9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9wZXJpb2RpY2l0aWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcy9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS92ZXJzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFyZ2luQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnUHJvZml0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICBiYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnSXNUcmFkZUFsbG93ZWQnXSA/IHN5bWJvbCA6IGlkO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBh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BsYXN0ID0gdGlja2VyWydMYXN0U2VsbFByaWNlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnRGFpbHlCZXN0QnV5UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RhaWx5QmVzdFNlbGxQcmljZSddLFxuICAgICAgICAgICAgJ2JpZCc6IHRpY2tlclsnQmVzdEJpZCddLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aWNrZXJbJ0Jlc3RBc2snXSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRpY2tlclsnRGFpbHlUcmFkZWRUb3RhbFZvbHVtZSddLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICB0aWNrZXJzID0gdGhpcy5pbmRleEJ5ICh0aWNrZXJzLCAnU3ltYm9sJyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBpZiAocXVvdGUgPT09ICdEU0gnKVxuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckZpbHRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdmaWx0ZXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgbGVuZ3RoID0gdGlja2Vycy5sZW5ndGg7XG4gICAgICAgIGlmIChsZW5ndGggPCAxKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoVGlja2VyIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlLCB4QlRDZSBwdWJsaWMgQVBJIGVycm9yJyk7XG4gICAgICAgIHRpY2tlcnMgPSB0aGlzLmluZGV4QnkgKHRpY2tlcnMsICdTeW1ib2wnKTtcbiAg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gICAgICAgICAgaGVhZGVycyA9IHsgJ0FjY2VwdC1FbmNvZGluZyc6ICdnemlwLCBkZWZsYXRlJyB9O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5ICsgbWV0aG9kICsgdXJsO1xuICAgICAgICAgICAgaWYgKGJvZHkpXG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgbGV0IGNyZWRlbnRpYWxzID0gdGhpcy51aWQgKyAnOicgKyB0aGlzLmFwaUtleSArICc6JyArIG5vbmNlICsgJzonICsgdGhpcy5iaW5hcnlUb1N0cmluZyAoc2lnbmF0dXJlKTtcbiAgICAgICAgICAgIGhlYWRlcnNbJ0F1dGhvcml6YXRpb24nXSA9ICdITUFDICcgKyBjcmVkZW50aWFscztcbiAgICAgICAgfVxuICAgICAgICByZ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iB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTEwLWNkY2JmZGFlLTVlZWEtMTFlNy05ODU5LTAzZmVhODczMjcyZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly95b2JpdC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly95b2JpdC5uZXQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQvZW4vYXBpLycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0L2VuL2ZlZXMvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW5zVG9BZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQUlSJzogJ0FpckNvaW4nLFxuICAgICAgICAgICAgICAgICdBTkknOiAnQU5JQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FOVCc6ICdBbnRzQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FTVCc6ICdBc3RyYWwnLFxuICAgICAgICAgICAgICAgICdBVE0nOiAnQXV0dW1uY29pbicsXG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgICAgICdCQ1MnOiAnQml0Y29pblN0YWtlJyxcbiAgICAgICAgICAgICAgICAnQkxOJzogJ0J1bGxlb24nLFxuICAgICAgICAgICAgICAgICdCVFMnOiAnQml0c2hhcmVzMicsXG4gICAgICAgICAgICAgICAgJ0NBVCc6ICdCaXRDbGF2ZScsXG4gICAgICAgICAgICAgICAgJ0NPVic6ICdDb3ZlbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnQ1BDJzogJ0NhcHJpY29pbicsXG4gICAgICAgICAgICAgICAgJ0NTJzogJ0NyeXB0b1Nwb3RzJyxcbiAgICAgICAgICAgICAgICAnRENUJzogJ0Rpc2NvdW50JyxcbiAgICAgICAgICAgICAgICAnREdEJzogJ0RhcmtHb2xkQ29pbicsXG4gICAgICAgICAgICAgICAgJ0RST1AnOiAnRmF1Y2V0Q29pbicsXG4gICAgICAgICAgICAgICAgJ0VSVCc6ICdFcmlzdGljYSBUb2tlbicsXG4gICAgICAgICAgICAgICAgJ0lDTic6ICdpQ29pbicsXG4gICAgICAgICAgICAgICAgJ0tOQyc6ICdLaW5nTiBDb2luJyxcbiAgICAgICAgICAgICAgICAnTElaSSc6ICdMaVppJyxcbiAgICAgICAgICAgICAgICAnTE9DJzogJ0xvY29Db2luJyxcbiAgICAgICAgICAgICAgICAnTE9DWCc6ICdMT0MnLFxuICAgICAgICAgICAgICAgICdMVU4nOiAnTHVuYXJDb2luJyxcbiAgICAgICAgICAgICAgICAnTURUJzogJ01pZG5pZ2h0JyxcbiAgICAgICAgICAgICAgICAnTkFWJzogJ05hdmFqb0NvaW4nLFxuICAgICAgICAgICAgICAgICdPTUcnOiAnT01HYW1lJyxcbiAgICAgICAgICAgICAgICAnU1RLJzogJ1N0YWtlQ29pbicsXG4gICAgICAgICAgICAgICAgJ1BBWSc6ICdFUEFZJyxcbiAgICAgICAgICAgICAgICAnUExDJzogJ1BsYXRpbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnUkVQJzogJ1JlcHVibGljb2luJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hJTic6ICdYSU5Db2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnb3B0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnNSZXF1aXJlc1N5bWJvbCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgbGV0IHN0YXR1c2VzID0ge1xuICAgICAgICAgICAgJzAnOiAnb3BlbicsXG4gICAgICAgICAgICAnMSc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgJzInOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzMnOiAnb3BlbicsIC8vIG9yIHBhcnRpYWxseS1maWxsZWQgYW5kIGNsb3NlZD8gaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTU5NFxuICAgICAgICB9O1xuICAgICAgICBpZiAoc3RhdHVzIGluIHN0YXR1c2VzKVxuICAgICAgICAgICAgcmV0dXJuIHN0YXR1c2VzW3N0YXR1c107XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBzaWRlcyA9IHsgJ2ZyZWUnOiAnZnVuZHMnLCAndG90YWwnOiAnZnVuZHNfaW5jbF9vcmRlcnMnIH07XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHNpZGVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gc2lkZXNba2V5XTtcbiAgICAgICAgICAgIGlmIChzaWRlIGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXNbc2lkZV0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY3VycmVuY2llcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY2llc1tqXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGxvd2VyY2FzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFtrZXldID0gYmFsYW5jZXNbc2lkZV1bbG93ZXJjYXNlXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgYWNjb3VudFsndG90YWwnXSAhPT0gJ3VuZGVmaW5lZCcpICYmICh0eXBlb2YgYWNjb3VudFsnZnJlZSddICE9PSAndW5kZWZpbmVkJykpXG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZURlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoRGVwb3NpdEFkZHJlc3MgKGNvZGUsIHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbmVlZF9uZXcnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzcycpO1xuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjb2RlLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlWydpbmZvJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY29kZSwgcGFyYW1zID0ge30pI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ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW5OYW1lJzogY3VycmVuY3lbJ2lkJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yX2xvZycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3JfbG9nJ10uaW5kZXhPZiAoJ0luc3VmZmljaWVudCBmdW5kcycpID49IDApIHsgLy8gbm90IGVub3VnVGggaXMgYSB0eXBvIGluc2lkZSBMaXF1aSdzIG93biBBUEkuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvcl9sb2cnXSA9PT0gJ1JlcXVlc3RzIHRvbyBvZnRlbicpIHtcbiAgICAgIC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cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAneXVuYmknLFxuICAgICAgICAgICAgJ25hbWUnOiAnWVVOQkknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjAnLFxuICAgICAgICAgICAgICAgICcyaCc6ICcxMjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnNzIwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzQzMjAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU3MDU0OC00ZDY0NmM0MC03MTQ3LTExZTctOWNmNi04MzliOTNlNmQ2MjIuanBnJyxcbiAgICAgICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5qc29uJywgLy8gZGVmYXVsdCBleHRlbnNpb24gYXBwZW5kZWQgdG8gZW5kcG9pbnQgVVJMc1xuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3l1bmJpLmNvbS9kb2N1bWVudHMvYXBpL2d1aWRlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL3N3YWdnZXIvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzc2VzL3thZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFydG5lcnMvb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2UgPSByZXF1aXJlICgnLi9iYXNlL0V4Y2hhbmdlJyk7XG5jb25zdCB7IEV4Y2hhbmdlRXJyb3IgfSA9IHJlcXVpcmUgKCcuL2Jhc2UvZXJyb3JzJyk7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyB6YWlmIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd6YWlmJyxcbiAgICAgICAgICAgICduYW1lJzogJ1phaWYnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdKUCcsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTI3LTM5Y2EyYWRhLTVlZWItMTFlNy05NzJmLTFiNDE5OTUxOGNhNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vdGVjaGJ1cmVhdS1hcGktZG9jdW1lbnQucmVhZHRoZWRvY3MuaW8vamEvbGF0ZXN0L2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MvYXBpX2xpbmtzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL3lvdTIxOTc5L25vZGUtemFpZicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3phaWYuanAvZmVlP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IC0wLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAwMDUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pZF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcGVyc29uYWxfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdlY2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZUlkc0J5T3JkZXJOdW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RsYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3Vwcy97Z3JvdXBfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlyc0FsbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKG1hcmtldFsnaXRlbV91bml0X3N0ZXAnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydhdXhfdW5pdF9wb2ludCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsIC8vIGNhbiB0cmFkZSBvciBub3RcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2l0ZW1fdW5pdF9taW4nKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYXV4X3VuaXRfbWluJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlc1snZnVuZHMnXSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbJ2Z1bmRzJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKCdkZXBvc2l0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlc1snZGVwb3NpdCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlc1snZGVwb3NpdCddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aFBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgdndhcCA9IHRpY2tlclsndndhcCddO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHRpY2tlclsndm9sdW1lJ107XG4gICAgICAgIGxldCBxdW90ZVZvbHVtZSA9IGJhc2VWb2x1bWUgKiB2d2FwO1xuICAgICAgICBsZXQgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydiaWQnXSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydhc2snXSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0cmFkZV90eXBlJ10gPT09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnLCBpZCk7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdG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aW1pdCBvcmRlcnMgb25seScpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3lfcGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnYWN0aW9uJzogKHNpZGUgPT09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXR1cm4nXVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydhY3Rpb24nXSA9PT0gJ2JpZCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsncHJpY2UnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydhbW91bnQnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVycyAob3JkZXJzLCBtYXJrZXQgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKG9yZGVycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA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5vbmNlLnRvRml4ZWQgKDgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJ2FwaS8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ2ZhcGknKSB7XG4gICAgICAgICAgICB1cmwgKz0gJ2ZhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKGFwaSA9PT0gJ2VjYXBpJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnZWNhcGknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICd0bGFwaScpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ3RsYXBpJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0YXBpJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm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PcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAvLyAnMTAwMCc6ICdTdWNjZXNzZnVsIG9wZXJhdGlvbicsXG4gICAgICAgICAgICAgICAgJzEwMDEnOiBFeGNoYW5nZUVycm9yLCAvLyAnR2VuZXJhbCBlcnJvciBtZXNzYWdlJyxcbiAgICAgICAgICAgICAgICAnMTAwMic6IEV4Y2hhbmdlRXJyb3IsIC8vICdJbnRlcm5hbCBlcnJvcicsXG4gICAgICAgICAgICAgICAgJzEwMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyAnVmVyaWZpY2F0aW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b28gb2Z0ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzI4NTkxODctY2Q1MjE0ZjAtY2E1ZS0xMWU3LTk2N2QtOTY1NjhlMmUyYmQxLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwOi8vYXBpLnpiLmNvbS9kYXRhJywgLy8gbm8gaHR0cHMgZm9yIHB1YmxpYyBBUElcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly90cmFkZS56Yi5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuemIuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnpiLmNvbS9pL2RldmVsb3BlcicsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuemIuY29tL2kvcmF0ZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzcG90IEFQSVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzTmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFVuZmluaXNoZWRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVc2VyQWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDbnlXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXZlcmFnZSBBUElcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRMZXZlckFzc2V0c0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExldmVyQmlsbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVySW5MZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJPdXRMZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsTG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExvYW5SZWNvcmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSZXBheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDQVNIJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTksnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hBVCc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdENOWSc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hMQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNXJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50U2NhbGUnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlU2NhbGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRHZXRBY2NvdW50SW5mbyAocGFyYW1zKTtcbiAgICAgICAgLy8gdG9kbzogdXNlIHRoaXMgc29tZWhvd1xuICAgICAgICAvLyBsZXQgcGVybWlzc2lvbnMgPSByZXNwb25zZVsncmVzdWx0J11bJ2Jhc2UnXTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWydjb2lucyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICAvLyAgICAgeyAgICAgICAgZW5OYW1lOiBcIkJUQ1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICBmcmVlejogXCIwLjAwMDAwMDAwXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgIHVuaXREZWNpbWFsOiAgOCwgLy8gYWx3YXlzIDhcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICBjbk5hbWU6IFwiQlRDXCIsXG4gICAgICAgICAgICAvLyAgICAgICBpc0NhblJlY2hhcmdlOiAgdHJ1ZSwgLy8gVE9ETzogc2hvdWxkIHVzZSB0aGlzXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICB1bml0VGFnOiBcIuC4v1wiLFxuICAgICAgICAgICAgLy8gICAgICAgaXNDYW5XaXRoZHJhdzogIHRydWUsICAvLyBUT0RPOiBzaG91bGQgdXNlIHRoaXNcbiAgICAgICAgICAgIC8vICAgICAgICAgICBhdmFpbGFibGU6IFwiMC4wMDAwMDAwMFwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgIGtleTogXCJidGNcIiAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsna2V5J107XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKVxuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2N1cnJlbmN5XVsnY29kZSddO1xuICAgICAgICAgICAgZWxzZVxuIC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9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGxpbWl0ID0gMTAwMDtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAg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iAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgICAgICAnYW1vdW50JzogdGhpcy5hbW91bnRUb1N0cmluZyAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICAgICAgJ3RyYWRlVHlwZSc6IChzaWRlID09PSAnYnV5JykgPyAnMScgOiAnMCcsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZUdldENhbmNlbE9yZGVyIChvcmRlcik7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgaWYgKHR5cGVvZiBzeW1ib2wgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2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gICAgICBpZiAodHlwZW9mIHN0YXR1cyAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBjb25zdCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICcwJzogJ29wZW4nLFxuICAgICAgICAgICAgJzEnOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzInOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICczJzogJ29wZW4nLC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ICAgIGRbaV0gPSBpIDw8IDE7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICBkW2ldID0gKGkgPDwgMSkgXiAweDExYjtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIFdhbGsgR0YoMl44KVxuXHQgICAgICAgIHZhciB4ID0gMDtcblx0ICAgICAgICB2YXIgeGkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBzYm94XG5cdCAgICAgICAgICAgIHZhciBzeCA9IHhpIF4gKHhpIDw8IDEpIF4gKHhpIDw8IDIpIF4gKHhpIDw8IDMpIF4gKHhpIDw8IDQpO1xuXHQgICAgICAgICAgICBzeCA9IChzeCA+Pj4gOCkgXiAoc3ggJiAweGZmKSBeIDB4NjM7XG5cdCAgICAgICAgICAgIFNCT1hbeF0gPSBzeDtcblx0ICAgICAgICAgICAgSU5WX1NCT1hbc3hdID0geDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIG11bHRpcGxpY2F0aW9uXG5cdCAgICAgICAgICAgIHZhciB4MiA9IGRbeF07XG5cdCAgICAgICAgICAgIHZhciB4NCA9IGRbeDJdO1xuXHQgICAgICAgICAgICB2YXIgeDggPSBkW3g0XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIHN1YiBieXRlcywgbWl4IGNvbHVtbnMgdGFibGVzXG5cdCAgICAgICAgICAgIHZhciB0ID0gKGRbc3hdICogMHgxMDEpIF4gKHN4ICogMHgxMDEwMTAwKTtcblx0ICAgICAgICAgICAgU1VCX01JWF8wW3hdID0gKHQgPDwgMjQpIHwgKHQgPj4+IDgpO1xuXHQgICAgICAgICAgICBTVUJfTUlYXzFbeF0gPSAodCA8PCAxNikgfCAodCA+Pj4gMTYpO1xuXHQgICAgICAgICAgICBTVUJfTUlYXzJbeF0gPSAodCA8P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B7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAtIDRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICBpZiAoaW52S3NSb3cgPCA0IHx8IGtzUm93IDw9IDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSB0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSBJTlZfU1VCX01JWF8wW1NCT1hbdCA+Pj4gMjRdXSBeIElOVl9TVUJfTUlYXzFbU0JPWFsodCA+Pj4gMTYpICYgMHhmZl1dIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgIC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ZiBrZXkgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFzc3dvcmRCYXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkuZGVjcnlwdChjaXBoZXIsIGNpcGhlcnRleHQsIGtleSwgY2ZnKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9O1xuXHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0oKSlcblx0ICAgIH0pO1xuXG5cdCAgICAvKipcblx0ICAgICAqIEFic3RyYWN0IGJhc2Ugc3RyZWFtIGNpcGhlciB0ZW1wbGF0ZS5cblx0ICAgICAqXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gYmxvY2tTaXplIFRoZSBudW1iZXIgb2YgMzItYml0IHdvcmRzIHRoaXMgY2lwaGVyIG9wZXJ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Bvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbWVtYmVyIHRoaXMgYmxvY2sgdG8gdXNlIHdpdGggbmV4dCBibG9ja1xuXHQgICAgICAgICAgICAgICAgdmFyIHRoaXNCbG9jayA9IHdvcmRzLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgYmxvY2tTaXplKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRGVjcnlwdCBhbmQgWE9SXG5cdCAgICAgICAgICAgICAgICBjaXBoZXIuZGVjcnlwdEJsb2NrKHdvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBUaGlzIGJsb2NrIGJlY29tZXMgdGhlIHByZXZpb3VzIGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB0aGlzQmxvY2s7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIGZ1bmN0aW9uIHhvckJsb2NrKHdvcmRzLCBvZmZzZXQsIGJsb2NrU2l6ZSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaXYgPSB0aGlzLl9pdjtcblxuXHQgICAgICAgICAgICAvLyBDaG9vc2UgbWl4aW5nIGJsb2NrXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaXY7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBJViBmb3Igc3Vic2VxdWVudCBibG9ja3Ncblx0ICAgICAgICAgICAgICAgIHRoaXMuX2l2ID0gdW5kZWZpbmVkO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gdGhpcy5fcHJldkJsb2NrO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gWE9SIGJsb2Nrc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tvZmZzZXQgKyBpXSBePSBibG9ja1tpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIHJldHVybiBDQkM7XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFBhZGRpbmcgbmFtZXNwYWNlLlxuXHQgICAgICovXG5cdCAgICB2YXIgQ19wYWQgPSBDLnBhZCA9IHt9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ubW9kZS5DQkMsXG5cdCAgICAgICAgICogICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUEtDUzcsXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIGNpcGhlciBwYXJhbXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAdGhyb3dzIEVycm9yIElmIG5laXRoZXIgdGhlIGZvcm1hdHRlciBub3IgdGhlIGRlZmF1bHQgZm9ybWF0dGVyIGlzIHNldC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IGNpcGhlclBhcmFtcyArICcnO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gY2lwaGVyUGFyYW1zLnRvU3RyaW5nKCk7XG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSBjaXBoZXJQYXJhbXMudG9TdHJp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5saWIgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBCYXNlIG9iamVjdCBmb3IgcHJvdG90eXBhbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4gYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICpcblx0ICAgICAqIEBwcm9wZXJ0eSB7QXJyYXl9IHdvcmRzIFRoZSBhcnJheSBvZiAzMi1iaXQgd29yZHMuXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gc2lnQnl0ZXMgVGhlIG51bWJlciBvZiBzaWduaWZpY2FudCBieXRlcyBpbiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgKi9cblx0ICAgIHZhciBXb3JkQXJyYXkgPSBDX2xpYi5Xb3JkQXJyYXkgPSBCYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0IC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N0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7RW5jb2Rlcn0gZW5jb2RlciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheTEu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G5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0gd29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgd29yZCBhcnJheSBmaWxsZWQgd2l0aCByYW5kb20gYnl0ZXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbkJ5dGVzIFRoZSBudW1iZXIgb2YgcmFuZG9tIGJ5dGVzIHRvIGdlbmVyYXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKHV0ZjhTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAodXRmOFN0cikge1xuXHQgICAgICAgICAgICByZXR1cm4gTGF0aW4xLnBhcnNlKHVuZXNjYXBlKGVuY29kZVVSSUNvbXBvbmVudCh1dGY4U3RyKSkpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogQWJzdHJhY3QgYnVmZmVyZWQgYmxvY2sgYWxnb3JpdGhtIHRlbXBsYXRlLl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XHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgc2hvcnRjdXQgZnVuY3Rpb24gdG8gdGhlIEhNQUMncyBvYmplY3QgaW50ZXJmYWNlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtIYXNoZXJ9IGhhc2hlciBUaGUgaGFzaGVyIHRvIHVzZSBpbiB0aGlzIEhNQUMgaGVscGVyLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7RnVuY3Rpb259IFRoZSBzaG9ydGN1dCBmdW5jdGlvbi5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIEhtYWNTSEEyNTYgPSBDcnlwdG9KUy5saWIuSGFzaGVyLl9jcmVhdGVIbWFjSGVscGVyKENyeXB0b0pTLmFsZ28uU0hBMjU2KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBfY3JlYXRlSG1hY0hlbHBlcjogZnVuY3Rpb24gKGhhc2hlcikge1xuXHQgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG1lc3NhZ2UsIGtleSkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBDX2FsZ28uSE1BQy5pbml0KGhhc2hlciwga2V5KS5maW5hbGl6ZShtZXNzYWdlKTtcblx0ICAgICAgICAgICAgfTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBBbGdvcml0aG0gbmFtZXNwYWNlLlxuXHQgICAgICovXG5cdCAgICB2YXIgQ19hbGdvID0gQy5hbGdvID0ge307XG5cblx0ICAgIHJldHVybiBDO1xuXHR9KE1hdGgpKTtcblxuXG5cdHJldHVybiBDcnlwdG9KUztcblxufSkpO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lIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBiYXNlNjRTdHJpbmcgPSBDcnlwdG9KUy5lbmMuQmFzZTY0LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLl9tYXA7XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXAgZXhjZXNzIGJpdHNcblx0ICAgICAgICAgICAgd29yZEFycmF5LmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgYmFzZTY0Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAzKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTEgPSAod29yZHNbaSA+Pj4gMl0gICAgICAgPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgICAgICAgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUyID0gKHdvcmRzWyhpICsgMSkgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAxKSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMyA9ICh3b3Jkc1soaSArIDIpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMikgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0cmlwbGV0ID0gKGJ5dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYXAubGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV2ZXJzZU1hcFttYXAuY2hhckNvZGVBdChqKV0gPSBqO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIElnbm9yZSBwYWRkaW5nXG5cdCAgICAgICAgICAgIHZhciBwYWRkaW5nQ2hhciA9IG1hcC5jaGFyQXQoNjQpO1xuXHQgICAgICAgICAgICBpZiAocGFkZGluZ0NoYXIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBwYWRkaW5nSW5kZXggPSBiYXNlNjRTdHIuaW5kZXhPZihwYWRkaW5nQ2hhcik7XG5cdCAgICAgICAgICAgICAgICBpZiAocGFkZGluZ0luZGV4ICE9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hIFVURi0xNiBCRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTE2IEJFIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHV0ZjE2U3RyaW5nID0gQ3J5cHRvSlMuZW5jLlV0ZjE2LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xN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CAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxlXG5cdCAgICAgKlxuXHQgICAgICogICAgIHZhciBrZXkgPSBDcnlwdG9KUy5FdnBLREYocGFzc3dvcmQsIHNhbHQpO1xuXHQgICAgICogICAgIHZ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gICAgICB2YXIgaUtleSA9IHRoaXMuX2lLZXkgPSBrZXkuY2xvbmUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIG9LZXlXb3JkcyA9IG9LZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBpS2V5V29yZHMgPSBpS2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFhPUiBrZXlzIHdpdGggcGFkIGNvbnN0YW50c1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGhhc2hlckJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBvS2V5V29yZHNbaV0gXj0gMHg1YzVjNWM1Yztcblx0ICAgICAgICAgICAgICAgIGlLZXlXb3Jkc1tpXSBePSAweDM2MzYzNjM2O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIG9LZXkuc2lnQnl0ZXMgPSBpS2V5LnNpZ0J5dGVzID0gaGFzaGVyQmxvY2tTaXplQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gU2V0IGluaXRpYWwgdmFsdWVzXG5cdCAgICAgICAgICAgIHRoaXMucmVzZXQoKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVzZXRzIHRoaXMgSE1BQyB0byBpdHMgaW5pdGlhbCBzdGF0ZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBoYXNoZXIgPSB0aGlzLl9oYXNoZXI7XG5cblx0ICAgICAgICAgICAgLy8gUmVzZXRcblx0ICAgICAgICAgICAgaG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dCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA9IE1bb2Zmc2V0ICsgMTBdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTEgPSBNW29mZnNldCArIDExXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzEyID0gTVtvZmZzZXQgKyAxMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMyA9IE1bb2Zmc2V0ICsgMTNdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTQgPSBNW29mZnNldCArIDE0XTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzE1ID0gTVtvZmZzZXQgKyAxNV07XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWxiZXNcblx0ICAgICAgICAgICAgdmFyIGEgPSBIWzBdO1xuXHQgICAgICAgICAgICB2YXIg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ml0c1RvdGFsTCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgIC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HJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IEhNQUNcblx0ICAgICAgICAgICAgdmFyIGhtYWMgPSBITUFDLmNyZWF0ZShjZmcuaGFzaGVyLCBwYXNzd29yZCk7XG5cblx0ICAgICAgICAgICAgLy8gSW5pdGlhbCB2YWx1ZXNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXkgPSBXb3JkQXJyYXkuY3JlYXRlKCk7XG5cdCAgICAgICAgICAgIHZhciBibG9ja0luZGV4ID0gV29yZEFycmF5LmNyZWF0ZShbMHgwMDAwMDAwMV0pO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleVdvcmRzID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZVdvcmRzID0gaW50ZXJtZWRpYXRlLndvcmRzO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gWE9SIGludGVybWVkaWF0ZSB3aXRoIGJsb2NrXG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBibG9ja1dvcmRzTGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tXb3Jkc1tqXSBePSBpbnRlcm1lZGlhdGVXb3Jkc1tqXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRLZXkuY29uY2F0KGJsb2NrKTtcblx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E2KSxcblx0ICAgICAgICAgICAgICAgIEtbMl0sIChLWzFdIDw8IDE2KSB8IChLWzBdID4+PiAxNiksXG5cdCAgICAgICAgICAgICAgICBLWzNdLCAoS1syXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpXG5cdCAgICAgICAgICAgIF07XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgaW5pdGlhbCBjb3VudGVyIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgQyA9IHRoaXMuX0MgPSBbXG5cdCAgICAgICAgICAgICAgICAoS1syXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLCAoS1swXSAmIDB4ZmZmZjAwMDApIHwgKEtbMV0gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzNdIDw8IDE2KSB8IChLWzNdID4+PiAxNiksIChLWzFdICYgMHhmZmZmMDAwMCkgfCAoS1syXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbMF0gPDwgMTYpIHwgKEtbMF0gPj4+IDE2KSwgKEtbMl0gJiAweGZmZmYwMDAwKSB8IChLWzNdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1szXSA9IFhbNl0gXiAoWFszXSA+Pj4gMTYpIF4gKFhbMV0gPDwgMTYpO1xuXG5cdCAgICA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MF0gPj4+IDE2KSwgKEtbMl0gJiAweGZmZmYwMDAwKSB8IChLWzNdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1szXSA9IFhbNl0gXiAoWFszXSA+Pj4gMTYpIF4gKFhbMV0gPDwgMTYpO1xuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgU1tpXSA9ICgoKFNbaV0gPDwgOCkgIHwgKFNbaV0gPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgICAgKCgoU1tpXSA8PCAyNCkgfCAoU1tpXSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgICAgICBNW29mZnNldCArIGldIF49IFNbaV07XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgYmxvY2tTaXplOiAxMjgvMzIsXG5cblx0ICAgICAgICBpdlNpemU6IDY0LzMyXG5cdCAgICB9KTtcblxuXHQgICAgZnVuY3Rpb24gbmV4dFN0YXRlKCkge1xuXHQgICAgICAgIC8vIFNob3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gIC8qKlxuXHQgICAgICogUkM0IHN0cmVhbSBjaXBoZXIgYWxnb3JpdGhtLlxuXHQgICAgICovXG5cdCAgICB2YXIgUkM0ID0gQ19hbGdvLlJDNCA9IFN0cmVhbUNpcGhlci5leHRlbmQoe1xuXHQgICAgICAgIF9kb1Jlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIga2V5ID0gdGhpcy5fa2V5O1xuXHQgICAgICAgICAgICB2YXIga2V5V29yZHMgPSBrZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaWdCeXRlcyA9IGtleS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBJbml0IHNib3hcblx0ICAgICAgICAgICAgdmFyIFMgPSB0aGlzLl9TID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIFNbaV0gPSBpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gS2V5IHNldHVwXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBqID0gMDsgaSA8IDI1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qnl0ZUluZGV4ID0gaSAlIGtleVNpZ0J5dGVzO1xuXHQgICAgICAgICAgICAgICAgdmFyIGtleUJ5dGUgPSAoa2V5V29yZHNba2V5Qnl0ZUluZGV4ID4+PiAyXSA+Pj4gKDI0IC0gKGtleUJ5dGVJbmRleCAlIDQpICogOCkpICYgMHhmZjtcblxuXHQgICAgICAgICAgICAgICAgaiA9IChqICsgU1tpXSArIGtleUJ5dGUpICUgMjU2O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwXG5cdCAgICAgICAgICAgICAgICB2YXIgdCA9IFNbaV07XG5cdCAgICAgICAgICAgICAgICBTW2ldID0gU1tqXTtcblx0ICAgIC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ZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEh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gICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEhhc2hlci5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS5faGFzaCA9IHRoaXMuX2hhc2guY2xvbmUoKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gY2xvbmU7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblxuXHQgICAgZnVuY3Rpb24gZjEoeCwgeSwgeikge1xuXHQgICAgICAgIHJldHVybiAoKHgpIF4gKHkpIF4gKHopKTtcblxuXHQgICAgfVxuXG5cdCAgICBmdW5jdGlvbiBmMih4LCB5LCB6KSB7XG5cdCAgICAgICAgcmV0dXJuICgoKHgpJih5KSk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HQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlIDMyKTtcblx0ICAgICAgICAgICAgZGF0YVdvcmRzWygoKG5CaXRzTGVm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ICAgIC8vIEluaXRpYWxpemF0aW9uIGFuZCByb3VuZCBjb25zdGFudHMgdGFibGVzXG5cdCAgICB2YXIgSCA9IFtdO1xuXHQgICAgdmFyIEsgPSBbXTtcblxuXHQgICAgLy8gQ29tcHV0ZSBjb25zdGFudHNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgZnVuY3Rpb24gaXNQcmltZShuKSB7XG5cdCAgICAgICAgICAgIHZhciBzcXJ0TiA9IE1hdGguc3FydChuKTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgZmFjdG9yID0gMjsgZmFjdG9yIDw9IHNxcnROOyBmYWN0b3IrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKCEobiAlIGZhY3RvcikpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICBmdW5jdGlvbiBnZXRGcmFjdGlvbmFsQml0cyhuKSB7XG5cdCAgICAgICAgICAgIHJldHVybiAoKG4gLSAobiB8IDApKSAqIDB4MTAwMDAwMDAwKSB8IDA7XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgdmFyIG4gPSAyO1xuXHQgICAgICAgIHZhciBuUHJpbWUgPSAwO1xuXHQgICAgICAgIHdoaWxlIChuUHJpbWUgPCA2NCkge1xuXHQgICAgICAgICAgICBpZiAoaXNQcmltZShuKSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKG5QcmltZSA8IDgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBIW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgS1tuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDMpKTtcblxuXHQgICAgICAgICAgICAgICAgblByaW1lKys7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBuKys7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0yNTYgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEyNTYgPSBDX2FsZ28uU0hBMjU2ID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChILnNsaWNlKDApKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIWzBdID0gKEhbMF0gKyBhKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMV0gPSAoSFsxXSArIGIpIHwgMDtcblx0ICAgICAgICAgICAgSFsyXSA9IChIWzJdICsgYykgfCAwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbM10gKyBkKSB8IDA7XG5cdCAgICAgICAgICAgIEhbNF0gPSAoSFs0XSArIGUpIHwgMDtcblx0ICAgICAgICAgICAgSFs1XSA9IChIWzVdICsgZikgfCAwO1xuXHQgICAgICAgICAgICBIWzZdID0gKEhbNl0gKyBnKSB8IDA7XG5cdCAgICAgICAgICAgIEhbN10gPSAoSFs3XSArIGg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XNoZXIgPSBDX2xpYi5IYXNoZXI7XG5cdCAgICB2YXIgQ194NjQgPSBDLng2NDtcblx0ICAgIHZhciBYNjRXb3JkID0gQ194NjQuV29yZDtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIENvbnN0YW50cyB0YWJsZXNcblx0ICAgIHZhciBSSE9fT0ZGU0VUUyA9IFtdO1xuXHQgICAgdmFyIFBJX0lOREVYRVMgID0gW107XG5cdCAgICB2YXIgUk9VTkRfQ09OU1RBTlRTID0gW107XG5cblx0ICAgIC8vIENvbXB1dGUgQ29uc3RhbnRzXG5cdCAgICAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgIC8vIENvbXB1dGUgcmhvIG9mZnNldCBjb25zdGFudHNcblx0ICAgICAgICB2YXIgeCA9IDEsIHkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIHQgPSAwOyB0IDwgMjQ7IHQrKykge1xuXHQgICAgICAgICAgICBSSE9fT0ZGU0VUU1t4ICsgNSAqIHldID0gKCh0ICsgMSkgKiAodCArIDIpIC8gMikgJSA2NDtcblxuXHQgICAgICAgICAgICB2YXIgbmV3WCA9IHkgJSA1O1xuXHQgICAgICAgICAgICB2YXIgbmV3WSA9ICgyICogeCArIDMgKiB5KSAlIDU7XG5cdCAgICAgICAgICAgIHggPSBuZXdYO1xuXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPSAoTEZTUiA8PCAxKSBeIDB4NzE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICA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gIH0pLFxuXG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGUgPSBbXVxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHN0YXRlW2ldID0gbmV3IFg2NFdvcmQuaW5pdCgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgdGhpcy5ibG9ja1NpemUgPSAoMTYwMCAtIDIgKiB0aGlzLmNmZy5vdXRwdXRMZW5ndGgpIC8gMzI7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGU7XG5cdCAgICAgICAgICAgIHZhciBuQmxvY2tTaXplTGFuZXMgPSB0aGlzLmJsb2NrU2l6ZSAvIDI7XG5cblx0ICAgICAgICAgICAgLy8gQWJzb3JiXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbkJsb2NrU2l6ZUxhbmVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3VuZF07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gcm91bmRDb25zdGFudC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5sb3cgIF49IHJvdW5kQ29uc3RhbnQubG93Oztcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID0gZGF0YS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIG5CaXRzVG90YWwgPSB0aGlzLl9uRGF0YUJ5dGVzICogODtcblx0ICAgICAgICA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AgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3F1ZWV6ZSBzdGF0ZSB0byByZXRyaWV2ZSBoYXNoXG5cdCAgICAgICAgICAgICAgICBoYXNoV29yZHMucHVzaChsYW5lTHN3KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hXb3Jkcy5wdXNoKGxhbmVNc3cpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdChoYXNoV29yZHMsIG91dHB1dExlbmd0aEJ5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIH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AgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdp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+PiAyOSkpIF4gKGdhbW1hMXhoID4+PiA2KTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExbCAgPSAoKGdhbW1hMXhsID4+PiAxOSkgfCAoZ2FtbWExeGggPDwgMTMpKSBeICgoZ2FtbWExeGwgPDwgMykgfCAoZ2FtbWExeGggPj4+IDI5KSkgXiAoKGdhbW1hMXhsID4+PiA2KSB8IChnYW1tYTF4aCA8PCAyNikpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gV1tpXSA9IGdhbW1hMCArIFdbaSAtIDddICsgZ2FtbWExICsgV1tpIC0gMTZdXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpNyAgPSBXW2kgLSA3XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2k3aCA9IFdpNy5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTdsID0gV2k3LmxvdztcblxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTE2ICA9IFdbaSAtIDE2XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2kxNmggPSBXaTE2LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpMTZsID0gV2kxNi5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2lsID0gZ2FtbWEwbCArIFdpN2w7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpaCA9IGdhbW1hMGggKyBXaTdoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMGwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBnYW1tYTFsO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWggPSBXaWggKyBnYW1tYTFoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMWwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBXaTE2bDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2loICsgV2kxNmggKyAoKFdpbCA+Pj4gMCkgPCAoV2kxNmwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgV2kuaGlnaCA9IFdpaDtcblx0ICAgICAgICAgICAgICAgICAgICBXaS5sb3cgID0gV2lsO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICB2YXIgY2hoICA9IChlaCAmIGZoKSBeICh+ZWggJiBnaCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgY2hsICA9IChlbCAmIGZsKSBeICh+ZWwgJiBnbCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqaCA9IChhaCAmIGJoKSBeIChhaCAmIGNoKSBeIChiaCAmIGNoKTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYWpsID0gKGFsICYgYmwpIF4gKGFsICYgY2wpIF4gKGJsICYgY2wpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwaCA9ICgoYWggPj4+IDI4KSB8IChhbCA8PCA0KSkgIF4gKChhaCA8PCAzMCkgIHwgKGFsID4+PiAyKSkgXiAoKGFoIDw8IDI1KSB8IChhbCA+Pj4gNykpO1xuXHQgICAgICAgICAgICAgICAgdmFyIHNpZ21hMGwgPSAoKGFsID4+PiAyOCkgfCAoYWggPDwgNCkpICBeICgoYWwgPDwgMzApICB8IChhaCA+Pj4gMikpIF4gKChhbCA8PCAyNSkgfCAoYWggPj4+IDcpKTtcblx0ICAgICAgICAgICAgICAgIHZhciBzaWdtYTFoID0gKChlaCA+Pj4gMTQpIHwgKGVsIDw8IDE4KSkgXiAoKGVoID4+PiAxOCkgfCAoZWwgPDwgMTQpKSBeICgoZWggPDwgMjMpIHwgKGVsID4+PiA5KSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExbCA9ICgoZWwgPj4+IDE0KSB8IChlaCA8PCAxOCkpIF4gKChlbCA+Pj4gMTgpIHwgKGVoIDw8IDE0KSkgXiAoKGVsIDw8IDIzKSB8IChlaCA+Pj4gOSkpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldXG5cdCAgICAgICAgICAgICAgICB2YXIgS2kgID0gS1tpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBLaWggPSBLaS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgdmFyIEtpbCA9IEtpLmxvdztcblxuXHQgICAgICAgICAgICAgICAgdmFyIHQxbCA9IGhsICsgc2lnbWExbDtcblx0ICAgICAgICAgICAgICAgIHZhciB0MWggPSBoaCArIHNpZ21hMWggKyAoKHQxbCA+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+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGl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HhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhhODAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHhjODAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxMTAwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHgxMjAwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgxNjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwMDogMHg0MDAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTkwMDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwMDA6IDB4ODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDAwMDA6IDB4NDAwODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDA6IDB4ODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTE4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwMDA6IDB4NDAwODAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwMDA6IDB4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDAwMDogMHg0MDAwNDAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgxNzgwMDAwMDogMHg0MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxOTgwMDAwMDogMHg0MDAwMDAxMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxYjgwMDAwMDogMHg4MDAxMCxcblx0ICAgICAgICAgICAgMHgxYzgwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwMDA6IDB4ODQwMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgyMDAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWQ6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFlOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFmOiAweDgwMjA4MDBcblx0ICAgICAgICB9XG5cdCAgICBdO1xuXG5cdCAgICAvLyBNYXNrcyB0aGF0IHNlbGVjdCB0aGUgU0JPWCBpbnB1dFxuXHQgICAgdmFyIFNCT1hfTUFTSyA9IFtcblx0ICAgICAgICAweGY4MDAwMDAxLCAweDFmODAwMDAwLCAweDAxZjgwMDAwLCAweDAwMWY4MDAwLFxuXHQgICAgICAgIDB4MDAwMWY4MDAsIDB4MDAwMDFmODAsIDB4MDAwMDAxZjgsIDB4ODAwMDAwMWZcblx0ICAgIF07XG5cblx0ICAgIC8qKlxuXHQgICAgICogREVTIGJsb2NrIGNpcGhlciBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBERVMgPSBDX2FsZ28uREVTID0gQmxvY2tDaXBoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGtleSA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFNlbGVjdCA1NiBiaXRzIGFjY29yZGluZyB0byBQQzFcblx0ICAgICAgICAgICAgdmFyIGtleUJpdHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qml0UG9zID0gUEMxW2ldIC0gMTtcblx0ICAgICAgICAgICAgICAgIGtleUJpdHNbaV0gPSAoa2V5V29yZHNba2V5Qml0UG9zID4+PiA1XSA+Pj4gKDMxIC0ga2V5Qml0UG9zICUgMzIpKSAmIDE7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgdGhpcy5fZG9DcnlwdEJsb2NrKE0sIG9mZnNldCwgdGhpcy5fc3ViS2V5cyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGRlY3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICB0aGlzLl9kb0NyeXB0QmxvY2soTSwgb2Zmc2V0LCB0aGlzLl9pbnZTdWJLZXlzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvQ3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCwgc3ViS2V5cykge1xuXHQgICAgICAgICAgICAvLyBHZXQgaW5wdXRcblx0ICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gTVtvZmZzZXRdO1xuXHQgICAgICAgICAgICB0aGlzLl9yQmxvY2sgPSBNW29mZnNldCArIDFdO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXRpYWwgcGVybXV0YXRpb25cblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDQsICAweDBmMGYwZjBmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDE2LCAweDAwMDBmZmZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDIsICAweDMzMzMzMzMzKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDgsICAweDAwZmYwMGZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDEsICAweDU1NTU1NTU1KTtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgcm91bmQgPSAwOyByb3VuZCA8IDE2OyByb3VuZCsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW3JvdW5kXTtcblx0ICAgICAgICAgICAgICAgIHZhciBsQmxvY2sgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgICAgICB2YXIgckJsb2NrID0gdGhpcy5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFVuZG8gc3dhcCBmcm9tIGxhc3Qgcm91bmRcblx0ICAgICAgICAgICAgdmFyIHQgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHRoaXMuX3JCbG9jaztcblx0ICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gdDtcblxuXHQgICAgICAgICAgICAvLyBGaW5hbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgNCwgIDB4MGYwZjBmMGYpO1xuXG5cdCAgICAgICAgICAgIC8vIFNldCBvdXRwdXRcblx0ICAgICAgICAgICAgTVtvZmZzZXRdID0gdGhpcy5fbEJsb2NrO1xuXHQgICAgICAgICAgICBNW29mZnNldCArIDFdID0gdGhpcy5fckJsb2NrO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBrZXlTaXplOiA2NC8zMixcblxuXHQgICAgICAgIGl2U2l6ZTogNjQvMzIsXG5cblx0ICAgICAgICBibG9ja1NpemU6IDY0LzMyXG5cdCAgICB9KTtcblxuXHQgICAgLy8gU3dhcCBiaXRzIGFjcm9zcyB0aGUgbGVmdCBhbmQgcmlnaHQgd29yZHNcblx0ICAgIGZ1bmN0aW9uIGV4Y2hhbmdlTFIob2Zmc2V0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JkLmFuZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gYW5kOiBmdW5jdGlvbiAod29yZCkge1xuXHQgICAgICAgICAgICAvLyB2YXIgaGlnaCA9IHRoaXMuaGlnaCAmIHdvcmQuaGlnaDtcblx0ICAgICAgICAgICAgLy8gdmFyIGxvdyA9IHRoaXMubG93ICYgd29yZC5sb3c7XG5cblx0ICAgICAgICAgICAgLy8gcmV0dXJuIFg2NFdvcmQuY3JlYXRlKGhpZ2gsIGxvdyk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEJpdHdpc2UgT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gT1Igd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgT1JpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBvcmVkID0geDY0V29yZC5vcihhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gb3I6IGZ1bmN0aW9uICh3b3JkKSB7XG5cdCAgICAgICAgICAgIC8vIHZhciBoaWdoID0gdGhpcy5oaWdoIHwgd29yZC5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5sb3cgfCB3b3JkLmxvdztcblxuXHQgICAgICAgICAgICAvLyByZXR1cm4gWDY0V29yZC5jcmVhdGUoaGlnaCwgbG93KTtcblx0ICAgICAgICAvLyB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQml0d2lzZSBYT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gWE9SIHdpdGggdGhpcyB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIFhPUmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHhvcmVkID0geDY0V29yZC54b3IoYW5vdGhlclg2NFdvcmQpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIC8vIHhvcjogZnVuY3Rpb24gKHdvcmQpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB0aGlzLmhpZ2ggXiB3b3JkLmhpZ2g7XG5cdCAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmxvdyBeIHdvcmQubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBTaGlmdHMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgbGVmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBuIFRoZSBudW1iZXIgb2YgYml0cyB0byBzaGlmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1g2NFdvcmR9IEEgbmV3IHg2NC1Xb3JkIG9iamVjdCBhZnRlciBzaGlmdGluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICA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dCAgICAgICAgICAgIC8vIGlmIChuIDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgIC8vIHZhciBsb3cgPSAodGhpcy5sb3cgPj4+IG4pIHwgKHRoaXMuaGlnaCA8PCAoMzIgLSBuKSk7XG5cdCAgICAgICAgICAgICAgICAvLyB2YXIgaGlnaCA9IHRoaXMuaGlnaCA+Pj4gbjtcblx0ICAgICAgICAgICAgLy8gfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmhpZ2ggPj4+IChuIC0gMzIpO1xuXHQgICAgICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSAwO1xuXHQgICAgICAgICAgICAvLyB9XG5cblx0ICAgICAgICAgICAgLy8gcmV0dXJuIFg2NFdvcmQuY3JlYXRlKGhpZ2gsIGxvdyk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgbGVmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBuIFRoZSBudW1iZXIgb2YgYml0cyB0byByb3RhdGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgcm90YXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciByb3RhdGVkID0geDY0V29yZC5yb3RMKDI1KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RMOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdEwobikub3IodGhpcy5zaGlmdFIoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtYNjRXb3JkfSB3b3JkIFRoZSB4NjQtV29yZCB0byBhZGQgd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgYWRkaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYWRkZWQgPSB4NjRXb3JkLmFkZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gYWRkOiBmdW5jdGlvbiAod29yZCkge1xuXHQgICAgICAgICA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AgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY2ggWDY0V29yZCBvYmplY3Rcblx0ICAgICAgICAgICAgdmFyIHdvcmRzTGVuZ3RoID0gd29yZHMubGVuZ3RoO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2ldID0gd29yZHNbaV0uY2xvbmUoKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblx0fSgpKTtcblxuXG5cdHJldHVybiBDcnlwdG9KUztcblxufSkpOyIsIihmdW5jdGlvbiAoc2VsZikge1xuICAndXNlIHN0cmljdCc7XG5cbiAgZnVuY3Rpb24gZmV0Y2hQb255ZmlsbChvcHRpb25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RGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgICAgICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgRGF0YVZpZXcucHJvdG90eXBlLmlzUHJvdG90eXBlT2Yob2JqKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBpc0FycmF5QnVmZmVyVmlldyA9IEFycmF5QnVmZmVyLmlzVmlldyB8fCBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgdmlld0NsYXNzZXMuaW5kZXhPZihPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSkgPiAtMVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIG5vcm1hbGl6ZU5hbWUobmFtZSkge1xuICAgICAgICAgIGl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igpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGl0ZXJhdG9yXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIGl0ZXJhdG9yXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBIZWFkZXJzKGhlYWRlcnMpIHtcbiAgICAgICAgICB0aGlzLm1hcCA9IHt9XG5cbiAgICAgICAgICBpZiAoaGVhZGVycyBpbnN0YW5jZW9mIEhlYWRlcnMpIHtcbiAgICAgICAgICAgIGhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkge1xuICAgICAgICAgICAgICB0aGlzLmFwcGVuZChuYW1lLCB2YWx1ZSlcbiAgICAgICAgICAgIH0sIHRoaXMpXG4gICAgICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KGhlYWRlcnMpKSB7XG4gICAgICAgICAgICBoZWFkZXJzLmZvckVhY2goZnVuY3Rpb24oaGVhZGVyKSB7XG4gICAgICAgICAgICAgIHRoaXMuYXBwZW5kKGhlYWRlclswXSwgaGVhZGVyWzFdKVxuICAgICAgICAgICAgfSwgdGhpcylcbiAgICAgICAgICB9IGVsc2UgaWYgKGhlYWRlcnMpIHtcbiAgICAgICAgICAgIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKGhlYWRlcnMpLmZvckVhY2goZnVuY3Rpb24obmFtZSkge1xuICAgICAgICAgICAgICB0aGlzLmFwcGVuZChuYW1lLCBoZWFkZXJzW25hbWVdKVxuICAgICAgICAgICAgfSwgdGhpcylcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBIZWFkZXJzLnByb3RvdHlwZS5hcHBlbmQgPSBmdW5jdGlvbihuYW1lLCB2YWx1ZSkge1xuICAgICAgICAgIG5hbWUgPSBub3JtYWxpemVOYW1lKG5hbWUpXG4gICAgICAgICAgdmFsdWUgPSBub3JtYWxpemVWYWx1ZSh2YWx1ZSlcbiAgICAgIC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HtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgICAgICAgcmV0dXJuIHZpZXcuYnVmZmVyXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gQm9keSgpIHtcbiAgICAgICAgICB0aGlzLmJvZHlVc2VkID0gZmFsc2VcblxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5ID0gZnVuY3Rpb24oYm9keSkge1xuICAgICAgICAgICAgdGhpcy5fYm9keUluaXQgPSBib2R5XG4gICAgICAgICAgICBpZiAoIWJvZHkpIHtcbiAgICAgICAgICAgICAgdGhpcy5fYm9keVRleHQgPSAnJ1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgYm9keSA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgd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QXJyYXlCdWZmZXIgPSBidWZmZXJDbG9uZShib2R5KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bnN1cHBvcnRlZCBCb2R5SW5pdCB0eXBlJylcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLmhlYWRlcnMuZ2V0KCdjb250ZW50LXR5cGUnKSkge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIGJvZHkgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ3RleHQvcGxhaW47Y2hhcnNldD1VVEYtOCcpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUJsb2IgJiYgdGhpcy5fYm9keUJsb2IudHlwZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoJ2NvbnRlbnQtdHlwZScsIHRoaXMuX2JvZHlCbG9iLnR5cGUpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3VwcG9ydC5zZWFyY2hQYXJhbXMgJiYgVVJMU2VhcmNoUGFyYW1zLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpc1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSFRUUCBtZXRob2RzIHdob3NlIGNhcGl0YWxpemF0aW9uIHNob3VsZCBiZSBub3JtYWxpemVkXG4gICAgICAgIHZhciBtZXRob2RzID0gWydERUxFVEUnLCAnR0VUJywgJ0hFQUQnLCAnT1BUSU9OUycsICdQT1NUJywgJ1BVVCddXG5cbiAgICAgICAgZnVuY3Rpb24gbm9ybWFsaXplTWV0aG9kKG1ldGhvZCkge1xuICAgICAgICAgIHZhciB1cGNhc2VkID0gbWV0aG9kLnRvVXBwZXJDYXNlKClcbiAgICAgICAgICByZXR1cm4gKG1ldGhvZHMuaW5kZXhPZih1cGNhc2VkKSA+IC0xKSA/IHVwY2FzZWQgOiBtZXRob2RcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIFJlcXVlc3QoaW5wdXQsIG9wdGlvbnMpIHtcbiAgICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fVxuICAgICAgICAgIHZhciBib2R5ID0gb3B0aW9ucy5ib2R5XG5cbiAgICAgICAgICBpZiAoaW5wdXQgaW5zdGFuY2VvZiBSZXF1ZXN0KSB7XG4gICAgICAgICAgICBpZiAoaW5wdXQuYm9keVVzZWQpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQWxyZWFkeSByZWFkJylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudXJsID0gaW5wdXQudXJsXG4gICAgICAgICAgICB0aGlzLmNyZWRlbnRpYWxzID0gaW5wdXQuY3JlZGVudGlhbHNcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKGlucHV0LmhlYWRlcnMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLm1ldGhvZCA9IGlucHV0Lm1ldGhvZFxuICAgICAgICAgICAgdGhpcy5tb2RlID0gaW5wdXQubW9kZVxuICAgICAgICAgICAgaWYgKCFib2R5IC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ybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGhlYWRlcnNcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICAgICAgICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgICAgICAgIGlmICghb3B0aW9ucykge1xuICAgICAgICAgICAgb3B0aW9ucyA9IHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgICAgICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICAgICAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgICAgICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKVxuICAgICAgICAgIHRoaXMudXJsID0gb3B0aW9ucy51cmwgfHwgJydcbiAgICAgICAgICB0aGlzLl9pbml0Qm9keShib2R5SW5pdClcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXNwb25zZS5wcm90b3R5cGUpXG5cbiAgICAgICAgUmVzcG9uc2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBSZXNwb25zZSh0aGlzLl9ib2R5SW5pdCwge1xuICAgICAgICAgICAgc3RhdHVzOiB0aGlzLnN0YXR1cyxcbiAgICAgICAgICAgIHN0YXR1c1RleHQ6IHRoaXMuc3RhdHVzVGV4dCxcbiAgICA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B2YXIgcmVxdWVzdCA9IG5ldyBSZXF1ZXN0KGlucHV0LCBpbml0KVxuICAgICAgICAgICAgdmFyIHhociA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpXG5cbiAgICAgICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzOiB4aHIuc3RhdHVzLFxuICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHhoci5zdGF0dXNUZXh0LFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHBhcnNlSGVhZGVycyh4aHIuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkgfHwgJycpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgb3B0aW9ucy51cmwgPSAncmVzcG9uc2VVUkwnIGluIHhociA/IHhoci5yZXNwb25zZVVSTCA6IG9wdGlvbnMuaGVhZGVycy5nZXQoJ1gtUmVxdWVzdC1VUkwnKVxuICAgICAgICAgICAgICB2YXIgYm9keSA9ICdyZXNwb25zZScgaW4geGhyID8geGhyLnJlc3BvbnNlIDogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB4aHIub3BlbihyZXF1ZXN0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xdWFsc1BvcyArIDE7XG5cbiAgICAgICAgdmFyIGtleSwgdmFsO1xuICAgICAgICBpZiAocG9zID09PSAtMSkge1xuICAgICAgICAgICAga2V5ID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQsIGRlZmF1bHRzLmRlY29kZXIpO1xuICAgICAgICAgICAgdmFsID0gb3B0aW9ucy5zdHJpY3ROdWxsSGFuZGxpbmcgPyBudWxsIDogJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydC5zbGljZSgwLCBwb3MpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgICAgIHZhbCA9IG9wdGlvbnMuZGVjb2RlcihwYXJ0LnNsaWNlKHBvcyArIDEpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaGFzLmNhbGwob2JqLCBrZXkpKSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IFtdLmNvbmNhdChvYmpba2V5XSkuY29uY2F0KHZhbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IHZhbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JqW2NsZWFuUm9vdF0gPSBsZWFmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGVhZiA9IG9iajtcbiAgICB9XG5cbiAgICByZXR1cm4gbGVhZjtcbn07XG5cbnZhciBwYXJzZUtleXMgPSBmdW5jdGlvbiBwYXJzZVF1ZXJ5U3RyaW5nS2V5cyhnaXZlbktleSwgdmFsLCBvcHRpb25zKSB7XG4gICAgaWYgKCFnaXZlbktleSkge1xuICAgICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgLy8gVHJhbnNmb3JtIGRvdCBub3RhdGlvbiB0byBicmFja2V0IG5vdGF0aW9uXG4gICAgdmFyIGt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nO1xuICAgIH1cblxuICAgIGlmICh0eXBlb2Ygb2JqID09PSAnc3RyaW5nJyB8fCB0eXBlb2Ygb2JqID09PSAnbnVtYmVyJyB8fCB0eXBlb2Ygb2JqID09PSAnYm9vbGVhbicgfHwgdXRpbHMuaXNCdWZmZXIob2JqKSkge1xuICAgICAgICBpZiAoZW5jb2Rlcikge1xuICAgICAgICAgICAgdmFyIGtleVZhbHVlID0gZW5jb2RlVmFsdWVzT25seSA/IHByZWZpeCA6IGVuY29kZXIocHJlZml4LCBkZWZhdWx0cy5lbmNvZGVyKTtcbiAgICAgICAgICAgIHJldHVybiBbZm9ybWF0dGVyKGtleVZhbHVlKSArICc9JyArIGZvcm1hdHRlcihlbmNvZGVyKG9iaiwgZGVmYXVsdHMuZW5jb2RlcikpXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gW2Zvcm1hdHRlcihwcmVmaXgpICsgJz0nICsgZm9ybWF0dGVyKFN0cmluZyhvYmopKV07XG4gICAgfVxuXG4gICAgdmFyIHZhbHVlcyA9IFtdO1xuXG4gICAgaWYgKHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiB2YWx1ZXM7XG4gICAgfVxuXG4gICAgdmFyIG9iaktleXM7XG4gICAgaWYgKEFycmF5LmlzQXJyYXkoZmlsdGVyKSkge1xuICAgICAgICBvYmpLZXlzID0gZmlsdGVyO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgb2JqS2V5cyA9IHNvcnQgPyBrZXlzLnNvcnQoc29ydCkgOiBrZXlzO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZ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gICAgICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgfVxuXG4gICAgaWYgKHNvcnQpIHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9ialtqXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGFjdGVkLnB1c2gob2JqW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGl0ZW0ub2JqW2l0ZW0ucHJvcF0gPSBjb21wYWN0ZWQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gb2JqO1xufTtcblxuZXhwb3J0cy5hcnJheVRvT2JqZWN0ID0gZnVuY3Rpb24gYXJyYXlUb09iamVjdChzb3VyY2UsIG9wdGlvbnMpIHtcbiAgICB2YXIgb2JqID0gb3B0aW9ucyAmJiBvcHRpb25zLnBsYWluT2JqZWN0cyA/IE9iamVjdC5j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BpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgYyA9IHN0cmluZy5jaGFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjY3h0LmJyb3dzZXIuanMiLCJjY3h0LmpzIiwianMvXzFicm9rZXIuanMiLCJqcy9fMWJ0Y3hlLmpzIiwianMvYWN4LmpzIiwianMvYWxsY29pbi5qcyIsImpzL2FueHByby5qcyIsImpzL2Jhc2UvRXhjaGFuZ2UuanMiLCJqcy9iYXNlL01hcmtldC5qcyIsImpzL2Jhc2UvZXJyb3JzLmpzIiwianMvYmFzZS9mdW5jdGlvbnMuanMiLCJqcy9iYXNlL2Z1bmN0aW9ucy9jcnlwdG8uanMiLCJqcy9iYXNlL2Z1bmN0aW9ucy9lbmNvZGUuanMiLCJqcy9iYXNlL2Z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cycpLFxuICAgICdiaXRmaW5leCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4LmpzJyksXG4gICAgJ2JpdGZpbmV4Mic6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0ZmluZXgyLmpzJyksXG4gICAgJ2JpdGZseWVyJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Zmx5ZXIuanMnKSxcbiAgICAnYml0aHVtYic6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRodW1iLmpzJyksXG4gICAgJ2JpdGtrJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0a2suanMnKSxcbiAgICAnYml0bGlzaCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRsaXNoLmpzJyksXG4gICAgJ2JpdG1hcmtldCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bWFya2V0LmpzJyksXG4gICAgJ2JpdG1leCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0bWV4LmpzJyksXG4gICAgJ2JpdHNvJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c28uanMnKSxcbiAgICAnYml0c3RhbXAnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzdGFtcC5qcycpLFxuICAgICdiaXRzdGFtcDEnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wMS5qcycpLFxuICAgICdiaXR0cmV4JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHRyZXguanMnKSxcbiAgICAnYml0eic6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXR6LmpzJyksXG4gICAgJ2JsM3AnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmwzcC5qcycpLFxuICAgICdibGV1dHJhZGUnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsZXV0cmFkZS5qcycpLFxuICAgICdicmF6aWxpZXgnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JyYXppbGlleC5qcycpLFxuICAgICdidGNib3gnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2JveC5qcycpLFxuICAgICdidGNjaGluYSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2NoaW5hLmpzJyksXG4gICAgJ2J0Y2V4Y2hhbmdlJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjZXhjaGFuZ2UuanMnKSxcbiAgICAnYnRjbWFya2V0cyc6ICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNtYXJrZXRzLmpzJyksXG4gICAgJ2J0Y3RyYWRlaW0nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjdHJhZGVpbS5qcycpLFxuICAgICdidGN0cmFkZXVhJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3RyYWRldWEuanMnKSxcbiAgICAnYnRjdHVyayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0dXJrLmpzJyksXG4gICAgJ2J0Y3gnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjeC5qcycpLFxuICAgICdieGludGgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J4aW50aC5qcycpLFxuICAgICdjY2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NjZXguanMnKSxcbiAgICAnY2V4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jZXguanMnKSxcbiAgICAnY2hidGMnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGJ0Yy5qcycpLFxuICAgICdjaGlsZWJpdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NoaWxlYml0LmpzJyksXG4gICAgJ2NvYmluaG9vZCc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29iaW5ob29kLmpzJyksXG4gICAgJ2NvaW5jaGVjayc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmNoZWNrLmpzJyksXG4gICAgJ2NvaW5lZ2cnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbmVnZy5qcycpLFxuICAgICdjb2luZXgnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leC5qcycpLFxuICAgICdjb2luZXhjaGFuZ2UnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5leGNoYW5nZS5qcycpLFxuICAgICdjb2luZmxvb3InOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5mbG9vci5qcycpLFxuICAgICdjb2luZ2knOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5naS5qcycpLFxuICAgICdjb2lubWFya2V0Y2FwJzogICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXJrZXRjYXAuanMnKSxcbiAgICAnY29pbm1hdGUnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lubWF0ZS5qcycpLFxuICAgICdjb2lubmVzdCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5uZXN0LmpzJyksXG4gICAgJ2NvaW5vbmUnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY29pbm9uZS5qcycpLFxuICAgICdjb2luc2VjdXJlJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zZWN1cmUuanMnKSxcbiAgICAnY29pbnNwb3QnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luc3BvdC5qcycpLFxuICAgICdjb2ludGlnZXInOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW50aWdlci5qcycpLFxuICAgICdjb29sY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Nvb2xjb2luLmpzJyksXG4gICAgJ2NyeXB0b3BpYSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY3J5cHRvcGlhLmpzJyksXG4gICAgJ2RzeCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZHN4LmpzJyksXG4gICAgJ2V0aGZpbmV4JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXRoZmluZXguanMnKSxcbiAgICAnZXhtbyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9leG1vLmpzJyksXG4gICAgJ2V4eCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZXh4LmpzJyksXG4gICAgJ2Zsb3didGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZmxvd2J0Yy5qcycpLFxuICAgICdmb3hiaXQnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2ZveGJpdC5qcycpLFxuICAgICdmeWJzZSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2Z5YnNlLmpzJyksXG4gICAgJ2Z5YnNnJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2cuanMnKSxcbiAgICAnZ2F0ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nYXRlY29pbi5qcycpLFxuICAgICdnYXRlaW8nOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVpby5qcycpLFxuICAgICdnZGF4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dkYXguanMnKSxcbiAgICAnZ2VtaW5pJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZW1pbmkuanMnKSxcbiAgICAnZ2V0YnRjJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9nZXRidGMuanMnKSxcbiAgICAnaGFkYXgnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9oYWRheC5qcycpLFxuICAgICdoaXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0Yy5qcycpLFxuICAgICdoaXRidGMyJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0YzIuanMnKSxcbiAgICAnaHVvYmknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaS5qcycpLFxuICAgICdodW9iaWNueSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpY255LmpzJyksXG4gICAgJ2h1b2JpcHJvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmlwcm8uanMnKSxcbiAgICAnaWNlM3gnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pY2UzeC5qcycpLFxuICAgICdpbmRlcGVuZGVudHJlc2VydmUnOiAgICAgIHJlcXVpcmUgKCcuL2pzL2luZGVwZW5kZW50cmVzZXJ2ZS5qcycpLFxuICAgICdpbmRvZGF4JzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2luZG9kYXguanMnKSxcbiAgICAnaXRiaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pdGJpdC5qcycpLFxuICAgICdqdWJpJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2p1YmkuanMnKSxcbiAgICAna3Jha2VuJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rcmFrZW4uanMnKSxcbiAgICAna3Vjb2luJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdWNvaW4uanMnKSxcbiAgICAna3VuYSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdW5hLmpzJyksXG4gICAgJ2xha2VidGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGFrZWJ0Yy5qcycpLFxuICAgICdsYmFuayc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xiYW5rLmpzJyksXG4gICAgJ2xpcXVpJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGlxdWkuanMnKSxcbiAgICAnbGl2ZWNvaW4nOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9saXZlY29pbi5qcycpLFxuICAgICdsdW5vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2x1bm8uanMnKSxcbiAgICAnbHlra2UnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9seWtrZS5qcycpLFxuICAgICdtZXJjYWRvJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL21lcmNhZG8uanMnKSxcbiAgICAnbWl4Y29pbnMnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9taXhjb2lucy5qcycpLFxuICAgICduZWdvY2llY29pbnMnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL25lZ29jaWVjb2lucy5qcycpLFxuICAgICdub3ZhJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL25vdmEuanMnKSxcbiAgICAnb2tjb2luY255JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2NvaW5jbnkuanMnKSxcbiAgICAnb2tjb2ludXNkJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2NvaW51c2QuanMnKSxcbiAgICAnb2tleCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9va2V4LmpzJyksXG4gICAgJ3BheW1pdW0nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcGF5bWl1bS5qcycpLFxuICAgICdwb2xvbmlleCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3BvbG9uaWV4LmpzJyksXG4gICAgJ3FyeXB0b3MnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXJ5cHRvcy5qcycpLFxuICAgICdxdWFkcmlnYWN4JzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3F1YWRyaWdhY3guanMnKSxcbiAgICAncXVvaW5leCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xdW9pbmV4LmpzJyksXG4gICAgJ3NvdXRoeGNoYW5nZSc6ICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc291dGh4Y2hhbmdlLmpzJyksXG4gICAgJ3N1cmJpdGNvaW4nOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvc3VyYml0Y29pbi5qcycpLFxuICAgICd0aGVyb2NrJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3RoZXJvY2suanMnKSxcbiAgICAndGlkZWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aWRlYml0LmpzJyksXG4gICAgJ3RpZGV4JzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdGlkZXguanMnKSxcbiAgICAndXJkdWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy91cmR1Yml0LmpzJyksXG4gICAgJ3ZhdWx0b3JvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmF1bHRvcm8uanMnKSxcbiAgICAndmJ0Yyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YnRjLmpzJyksXG4gICAgJ3ZpcndveCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmlyd294LmpzJyksXG4gICAgJ3dleCc6ICAgICAgICAgICAgICAg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YWwgbWFya2V0IGRhdGEuIEFuIGludmFsaWQgcmVzb2x1dGlvbiB3YXMgcHJvYmFibHkgdXNlZC5cIn1cbiAgICAgICAgICAgICAgICAnMTVtJzogJzkwMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzM2MDAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICc4NjQwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjAyMS00MjBiZDlmYy01ZWNiLTExZTctOGVkNi01NmQwMDgxZWZlZDIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vMWJyb2tlci5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJyb2tlci5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly8xYnJva2VyLmNvbS8/Yz1lbi9jb250ZW50L2FwaS1kb2N1bWVudGF0aW9uJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvYmFycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2NhdGVnb3JpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9kZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3F1b3RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RpY2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vZWRpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vc2hhcmVkL2dldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc29jaWFsL3Byb2ZpbGVfc3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc29jaWFsL3Byb2ZpbGVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcXVvdGFfc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3RyYW5zYWN0aW9uX2xvZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xu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ZWdvcnkudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzcG9uc2UnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXNwb25zZSddW3BdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKChjYXRlZ29yeSA9PT0gJ0ZPUkVYJykgfHwgKGNhdGVnb3J5ID09PSAnQ1JZUFRPJykpIHtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0cyA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgcXVvdGUgPSAnVVNEJztcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXNfLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyT3ZlcnZpZXcgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGJhbGFuY2VbJ3Jlc3BvbnNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0b3RhbCA9IHRoaXMuc2FmZUZsb2F0IChyZXNwb25zZSwgJ2JhbGFuY2UnKTtcbiAgICAgICAgcmVzdWx0WydCVEMnXVsnZnJlZSddID0gdG90YWw7XG4gICAgICAgIHJlc3VsdFsnQlRD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gICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMWQnOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwNDktMmIyOTQ0MDgtNWVjYy0xMWU3LTg1Y2MtYWRhZmYwMTNkYzFhLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcmljYWwtcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzLWFuZC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci10cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidGMtZGVwb3NpdC1hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgeyAnaWQnOiAnVVNEJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcgfSxcbiAgICAgICAgICAgIHsgJ2lkJzogJ0VVUicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICB7ICdpZCc6ICdDTlknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJyB9LFxuICAgICAgICAgICAgeyAnaWQnOiAnUlVCJywgJ3N5bWJvbCc6ICdCVEMvUlVCJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1JVQicgfSxcbiAgICAgICAgICA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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGFjeCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYWN4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0FDWCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0FVJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyNDc2MTQtMWZlNjFjNzQtOTYyMS0xMWU3LTllOGMtZjFhNjI3YWZhMjc5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FjeC5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hY3guaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hY3guaW8vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJywgLy8gR2V0IGRlcHRoIG9yIHNwZWNpZmllZCBtYXJrZXQgQm90aCBhc2tzIGFuZCBiaWRzIGFyZSBzb3J0ZWQgZnJvbSBoaWdoZXN0IHByaWNlIHRvIGxvd2VzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLCAvLyBHZXQgSyBkYXRhIHdpdGggcGVuZGluZyB0cmFkZXMsIHdoaWNoIGFyZSB0aGUgdHJhZGVzIG5vdCBpbmNsdWRlZCBpbiBLIGRhdGEgeWV0LCBiZWNhdXNlIHRoZXJlJ3MgZGVsYXkgYmV0d2VlbiB0cmFkZSBnZW5lcmF0ZWQgYW5kIHByb2Nlc3NlZCBieSBLIGRhdGEgZ2VuZXJhdG9yXG4gICAgICAgICAgICAgICAgICAgICAgICAnaycsIC8vIEdldCBPSExDKGsgbGluZSkgb2Ygc3BlY2lmaWMgbWFya2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cycsIC8vIEdldCBhbGwgYXZhaWxhYmxlIG1hcmtldHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJywgLy8gR2V0IHRoZSBvcmRlciBib29rIG9mIHNwZWNpZmllZCBtYXJrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJywgLy8gR2V0IHRpY2tlciBvZiBhbGwgbWFya2V0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve21hcmtldH0nLCAvLyBHZXQgdGlja2VyIG9mIHNwZWNpZmljIG1hcmtldFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsIC8vIEdldCBzZXJ2ZXIgY3VycmVudCB0aW1lLCBpbiBzZWNvbmRzIHNpbmNlIFVuaXggZXBvY2hcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLCAvLyBHZXQgcmVjZW50IHRyYWRlcyBvbiBtYXJrZXQsIGVhY2ggdHJhZGUgaXMgaW5jbHVkZWQgb25seSBvbmNlIFRyYWRlcyBhcmUgc29ydGVkIGluIHJldmVyc2UgY3JlYXRpb24gb3JkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLCAvLyBHZXQgeW91ciBwcm9maWxlIGFuZCBhY2NvdW50cyBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMnLCAvLyBHZXQgeW91ciBkZXBvc2l0cyBoaXN0b3J5XG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCcsIC8vIEdldCBkZXRhaWxzIG9mIHNwZWNpZmljIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLCAvLyBXaGVyZSB0byBkZXBvc2l0IFRoZSBhZGRyZXNzIGZpZWxkIGNvdWxkIGJlIGVtcHR5IHdoZW4gYSBuZXcgYWRkcmVzcyBpcyBnZW5lcmF0aW5nIChlLmcuIGZvciBiaXRjb2luKSwgeW91IHNob3VsZCB0cnkgYWdhaW4gbGF0ZXIgaW4gdGhhdCBjYXNlLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsIC8vIEdldCB5b3VyIG9yZGVycywgcmVzdWx0cyBpcyBwYWdpbmF0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIEdldCBpbmZvcm1hdGlvbiBvZiBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvbXknLCAvLyBHZXQgeW91ciBleGVjdXRlZCB0cmFkZXMgVHJhZGVzIGFyZSBzb3J0ZWQgaW4gcmV2ZXJzZSBjcmVhdGlvbiBvcmRlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLCAvLyBHZXQgeW91ciBjcnlwdG9jdXJyZW5jeSB3aXRoZHJhd3NcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsIC8vIEdldCB5b3VyIGNyeXB0b2N1cnJlbmN5IHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsIC8vIENyZWF0ZSBhIFNlbGwvQnV5IG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL211bHRpJywgLy8gQ3JlYXRlIG11bHRpcGxlIHNlbGwvYnV5IG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsIC8vIENhbmNlbCBhbGwgbXkgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVsZXRlJywgLy8gQ2FuY2VsIGFuIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLCAvLyBDcmVhdGUgYSB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sIC8vIFRoZXJlIGlzIG9ubHkgMSUgZmVlIG9uIHdpdGhkcmF3YWxzIHRvIHlvdXIgYmFuayBhY2NvdW50LlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzIwMDInOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMjAwMyc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE1lbWJlcnNNZSAoKTt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AodGlja2Vycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFz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pLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JlbWFpbmluZ192b2x1bWUnKSxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHBhcnNlSW50IChpZCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndm9sdW1lJzogYW1vdW50LnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZF90eXBlJzogdHlwZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2UudG9TdHJpbmcgKCk7XG4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0aGlzLnByaXZhdGVQb3N0V2l0aGRyYXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdzdW0nOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgZW5jb2RlUGFyYW1zIChwYXJhbXMpIHtcbiAgICAgICAgaWYgKCdvcmRlcnMnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgbGV0IG9yZGVycyA9IHBhcmFtc1snb3JkZXJzJ107XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0ICh0aGlzLm9taXQgKHBhcmFtcywgJ29yZGVycycpKSk7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBvcmRlciA9IG9yZGVyc1tpXTtcbiAgICAgICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChvcmRlcik7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2tdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBvcmRlcltrZXldO1xuICAgICAgICAgICAgICAgICAgICBxdWVyeSArPSAnJm9yZGVycyU1QiU1RCU1QicgKyBrZXkgKyAnJTVEPScgKyB2YWx1ZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gcXVlcnk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSAnL2FwaScgKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGlmICgnZXh0ZW5zaW9uJyBpbiB0aGlzLnVybHMpXG4gICAgICAgICAgICByZXF1ZXN0ICs9IHRoaXMudXJsc1snZXh0ZW5zaW9uJ107XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmVuY29kZVBhcmFtcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgc3VmZml4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gc3VmZml4O1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDApIHtcbiAgICAgICAgICAgIGNvbnN0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBjb25zdCB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nQWxsY29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NBJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXh0ZW5zaW9uJzogJycsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNTYxODA5LWMzMTZiMzdjLWIwNjEtMTFlNy04ZDVhLWI1NDdiNGQ3MzBlYi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cuYWxsY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmFsbGNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmFsbGNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tL0Fib3V0L0FQSVJlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0hvbWUvTWFya2V0T3ZlclZpZXdEZXRhaWwvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzogdW5kZWZpbmVkLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0SG9tZU1hcmtldE92ZXJWaWV3RGV0YWlsICgpO1xuICAgICAgICBsZXQgY29pbnMgPSByZXNwb25zZVsnbWFya2V0Q29pbnMnXTtcbiAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBjb2lucy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldHMgPSBjb2luc1tqXVsnTWFya2V0cyddO1xuICAgICAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBtYXJrZXRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba11bJ01hcmtldCddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydQcmltYXJ5J107XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydTZWNvbmRhcnknXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZUlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArICdfJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydUcmFkZUVuYWJsZWQnXSAmJiBtYXJrZXRbJ0J1eUVuYWJsZWQnXSAmJiBtYXJrZXRbJ1NlbGxFbmFibGVkJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3R5cGUnOiAnc3BvdCcsXG4gICAgICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBtYXJrZXRbJ0Fza0ZlZVJhdGUnXSwgLy8gQmlkRmVlUmF0ZSAwLCBBc2tGZWVSYXRlIDAuMDAyLCB3ZSB1c2UganVzdCB0aGUgQXNrRmVlUmF0ZSBoZXJlXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnQXNrRmVlUmF0ZSddLCAvLyBCaWRGZWVSYXRlIDAsIEFza0ZlZVJhdGUgMC4wMDIsIHdlIHVzZSBqdXN0IHRoZSBBc2tGZWVSYXRlIGhlcmVcbiAgICAgICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ1ByaW1hcnlEaWdpdHMnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsnU2Vjb25kYXJ5RGlnaXRzJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4VHJhZGVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluT3JkZXJQcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ01heE9yZGVyUHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBpZiAoc3RhdHVzID09PSAtMSlcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAgICAgICBpZiAoc3RhdHVzID09PSAwKVxuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMSlcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7IC8vIHBhcnRpYWxseSBmaWxsZWRcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMilcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMTApXG4gICAgICAgICAgICByZXR1cm4gJ2NhbmNlbGVkJztcbiAgICAgICAgcmV0dXJuIHN0YXR1cztcbiAgICB9XG5cbiAgICBnZXRDcmVhdGVEYXRlRmllbGQgKCkge1xuICAgICAgICAvLyBhbGxjb2luIHR5cG8gY3JlYXRlX2RhdGEgaW5zdGVhZCBvZiBjcmVhdGVfZGF0ZVxuICAgICAgICByZXR1cm4gJ2Ny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ICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NTk4My1mZDg1OTVkYS01ZWM5LTExZTctODJlMy1hZGIzYWI4YzI2MTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYW54cHJvLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9hbnhwcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cDovL2RvY3MuYW54djIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYW54cHJvLmNvbS9wYWdlcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvdHJhZGUvZmV0Y2gnLCAvLyBkaXNhYmxlZCBieSBBTlhQcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3lfcGFpcn0vbW9uZXkvb3JkZXIvcXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9yZXN1bHQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21vbmV5L3tjdXJyZW5jeX0vYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9zZW5kX3NpbXBsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvdHJhZGUvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkvd2FsbGV0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdCVENVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ211bHRpcGxpZXInOiAxMDAwMDAgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0hLRCc6IHsgJ2lkJzogJ0JUQ0hLRCcsICdzeW1ib2wnOiAnQlRDL0hLRCcs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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi9cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBFeGNoYW5nZSB7XG5cbiAgICBnZXRNYXJrZXQgKHN5bWJvbCkge1xuXG4gICAgICAgIGlmICghdGhpcy5tYXJrZXRDbGFzc2VzKVxuICAgICAgICAgICAgdGhpcy5tYXJrZXRDbGFzc2VzID0ge31cblxuICAgICAgICBsZXQgbWFya2V0Q2xhc3MgPSB0aGlzLm1hcmtldENsYXNzZXNbc3ltYm9sXVxuXG4gICAgICAgIGlmIChtYXJrZXRDbGFzcylcbiAgICAgICAgICAgIHJldHVybiBtYXJrZXRDbGFzc1xuXG4gICAgICAgIG1hcmtldENsYXNzID0gbmV3IE1hcmtldCAodGhpcywgc3ltYm9sKVxuICAgICAgICB0aGlzLm1hcmtldENsYXNzZXNbc3ltYm9sXSA9IG1hcmtldENsYXNzIC8vIG9ubHkgb25lIE1hcmtldCBpbnN0YW5jZSBwZXIgbWFya2V0XG4gICAgICAgIHJldHVybiBtYXJrZXRDbGFzc1xuICAgIH1cblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICduYW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdlbmFibGVSYXRlTGltaXQnOiBmYWxzZSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLCAvLyBtaWxsaXNlY29uZHMgPSBzZWNvbmRzICogMTAwMFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdwdWJsaWNBUEknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcml2YXRlQVBJJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZUxpbWl0T3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQmFsYW5jZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQmlkc0Fza3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEwyT3JkZXJCb29rJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNYXJrZXRzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlckJvb2snOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyQm9va3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRpbmdGZWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnd3d3JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdkb2MnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiAgIHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6ICAgdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogICAgICBmYWxzZSxcbiAgICAgICAgICAgICAgICAnbG9naW4nOiAgICBmYWxzZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAndHdvZmEnOiAgICBmYWxzZSwgLy8gMi1mYWN0b3IgYXV0aGVudGljYXRpb24gKG9uZS10aW1lIHBhc3N3b3JkIGtleSlcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHVuZGVmaW5lZCwgLy8gdG8gYmUgZmlsbGVkIG1hbnVhbGx5IG9yIGJ5IGZldGNoTWFya2V0c1xuICAgICAgICAgICAgJ2N1cnJlbmNpZXMnOiB7fSwgLy8gdG8gYmUgZmlsbGVkIG1hbnVhbGx5IG9yIGJ5IGZldGNoTWFya2V0c1xuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB1bmRlZmluZWQsIC8vIHJlZGVmaW5lIGlmIHRoZSBleGNoYW5nZSBoYXMuZmV0Y2hPSExDVlxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncGFyc2VKc29uUmVzcG9uc2UnOiB0cnVlLCAvLyB3aGV0aGVyIGEgcmVwbHkgaXMgcmVxdWlyZWQgdG8gYmUgaW4gSlNPTiBvciBub3RcbiAgICAgICAgICAgICd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k0IFNhZmFyaS81MzcuMzYnLFxuICAgICAgICAgICAgJ2Nocm9tZTM5JzogJ01vemlsbGEvNS4wIChXaW5kb3dzIE5UIDYuMTsgV09XNjQpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIENocm9tZS8zOS4wLjIxNzEuNzEgU2FmYXJpLzUzNy4zNicsXG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmhlYWRlcnMgPSB7fVxuXG4gICAgICAgIC8vIHByZXBlbmRlZCB0byBVUkwsIGxpa2UgaHR0cHM6Ly9wcm94eS5jb20vaHR0cHM6Ly9leGNoYW5nZS5jb20vYXBpLi4uXG4gICAgICAgIHRoaXMucHJveHkgPSAnJ1xuICAgICAgICB0aGlzLm9yaWdpbiA9ICcqJyAvLyBDT1JTIG9yaWdpblxuXG4gICAgICAgIHRoaXMuaXNvODYwMSAgICAgICAgICA9IHRpbWVzdGFtcCA9PiAoKHR5cGVvZiB0aW1lc3RhbXAgPT09ICd1bmRlZmluZWQnKSA/IHRpbWVzdGFtcCA6IG5ldyBEYXRlICh0aW1lc3RhbXApLnRvSVNPU3RyaW5nICgpKVxuICAgICAgICB0aGlzLnBhcnNlODYwMSAgICAgICAgPSB4ID0+IERhdGUucGFyc2UgKCgoKHguaW5kZXhPZiAoJysnKSA+PSAwKSB8fCAoeC5zbGljZSAoLTEpID09PSAnWicpKSA/IHggOiAoeCArICdaJykucmVwbGFjZSAoL1xccyhcXGRcXGQpOi8sICdUJDE6JykpKVxuICAgICAgICB0aGlzLnBhcnNlRGF0ZSAgICAgICAgPSAoeCkgPT4ge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiB4ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICByZXR1cm4geFxuICAgICAgICAgICAgcmV0dXJuICgoeC5pbmRleE9mICgnR01UJykgPj0gMCkgP1xuICAgICAgICAgICAgICAgIERhdGUucGFyc2UgKHgpIDpcbiAgICAgICAgICAgICAgICB0a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gICAgdGhpcy5zZWNyZXQgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnVpZCAgICAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMubG9naW4gICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5wYXNzd29yZCA9IHVuZGVmaW5lZFxuXG4gICAgICAgIHRoaXMuYmFsYW5jZSAgICA9IHt9XG4gICAgICAgIHRoaXMub3JkZXJib29rcyA9IHt9XG4gICAgICAgIHRoaXMudGlja2VycyAgICA9IHt9XG4gICAgICAgIHRoaXMub3JkZXJzICAgICA9IHt9XG4gICAgICAgIHRoaXMudHJhZGVzICAgICA9IHt9XG5cbiAgICAgICAgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5sYXN0X2pzb25fcmVzcG9uc2UgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5sYXN0X3Jlc3BvbnNlX2hlYWRlcnMgPSB1bmRlZmluZWRcblxuICAgICAgICB0aGlzLmFycmF5Q29uY2F0ID0gKGEsIGIpID0+IGEuY29uY2F0IChiKVxuXG4gICAgICAgIGNvbnN0IHVuQ2FtZWxDYXNlUHJvcGVydGllcyA9IChvYmogPSB0aGlzKSA9PiB7XG4gICAgICAgICAgICBpZiAob2JqICE9PSBudWxsKSB7XG4gICAgICAgICAgICAgICAgZm9yIChjb25zdCBrIG9mIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzIChvYmopKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXNbdW5DYW1lbENhc2UgKGspXSA9IHRoaXNba11cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdW5DYW1lbENhc2VQcm9wZXJ0aWVzIChPYmplY3QuZ2V0UHJvdG90eXBlT2YgKG9iaikpXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdW5DYW1lbENhc2VQcm9wZXJ0aWVzICgpXG5cbiAgICAgICAgLy8gbWVyZ2UgY29uZmlnc1xuICAgICAgICBjb25zdCBjb25maWcgPSBkZWVwRXh0ZW5kICh0aGlzLmRlc2NyaWJlICgpLCB1c2VyQ29uZmlnKVxuXG4gICAgICAgIC8vIG1lcmdlIHRvIHRoaXNcbiAgICAgICAgZm9yIChjb25zdCBbcHJvcGVydHksIHZhbHVlXSBvZiBPYmplY3QuZW50cmllcyAoY29uZmlnKSlcbiAgICAgICAgICAgIHRoaXNbcHJvcGVydHldID0gZGVlcEV4dGVuZCAodGhpc1twcm9wZXJ0eV0sIHZhbHVlKVxuXG4gICAgICAgIC8vIGdlbmVyYXRlIG9sZCBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgZm9yIChjb25zdCBrIGluIHRoaXMuaGFzKSB7XG4gICAgICAgICAgICB0aGlzWydoYXMnICsgY2FwaXRhbGl6ZSAoayldID0gISF0aGlzLmhhc1trXSAvLyBjb252ZXJ0cyAnZW11bGF0ZWQnIHRvIHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFwaSlcbiAgICAgICAgICAgIHRoaXMuZGVmaW5lUmVzdEFwaSAodGhpcy5hcGksICdyZXF1ZXN0JylcblxuICAgICAgICB0aGlzLmluaXRSZXN0UmF0ZUxpbWl0ZXIgKClcblxuICAgICAgICBpZiAodGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgdGhpcy5zZXRNYXJrZXRzICh0aGlzLm1hcmtldHMpXG5cbiAgICAgICAgaWYgKHRoaXMuZGVidWcgJiYgam91cm5hbCkge1xuICAgICAgICAgICAgam91cm5hbCAoKCkgPT4gdGhpcy5qb3VybmFsLCB0aGlzLCBPYmplY3Qua2V5cyAodGhpcy5oYXMpKVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZGVmYXVsdHMgKCkge1xuICAgICAgICByZXR1cm4geyAvKiBvdmVycmlkZSBtZSAqLyB9XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4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ZSA9XG4gICAgICAgICAgICAgICAgZmV0Y2hJbXBsZW1lbnRhdGlvbiAodXJsLCB7IG1ldGhvZCwgaGVhZGVycywgYm9keSwgJ2FnZW50JzogdGhpcy5hZ2VudCB8fCBudWxsLCB0aW1lb3V0OiB0aGlzLnRpbWVvdXQgfSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoIChlID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc05vZGUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlTm90QXZhaWxhYmxlIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBlLnR5cGUsIGUubWVzc2FnZSBdLmpvaW4gKCcgJykpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBlIC8vIHJldGhyb3cgYWxsIHVua25vd24gZXJyb3JzXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC50aGVuIChyZXNwb25zZSA9PiB0aGlzLmhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSlcblxuICAgICAgICAgICAgcmV0dXJuIHRpbWVvdXQgKHRoaXMudGltZW91dCwgcHJvbWlzZSkuY2F0Y2ggKGUgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgVGltZWRPdXQpXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSZXF1ZXN0VGltZW91dCAodGhpcy5pZCArICcgJyArIG1ldGhvZCArICcgJyArIHVybCArICcgcmVxdWVzdCB0aW1lZCBvdXQgKCcgKyB0aGlzLnRpbWVvdXQgKyAnIG1zKScpXG4gICAgICAgICAgICAgICAgdGhyb3cgZVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGRlZmluZVJlc3RBcGkgKGFwaSwgbWV0aG9kTmFtZSwgb3B0aW9ucyA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB0eXBlIG9mIE9iamVjdC5rZXlzIChhcGkpKSB7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGh0dHBNZXRob2Qgb2YgT2JqZWN0LmtleXMgKGFwaVt0eXBlXSkpIHtcblxuICAgICAgICAgICAgICAgIGxldCBwYXRocyA9IGFwaVt0eXBlXVtodHRwTWV0aG9kXVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGF0aHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBwYXRoc1tpXS50cmltICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBzcGxpdFBhdGggPSBwYXRoLnNwbGl0ICgvW15hLXpBLVowLTldLylcblxuICAgICAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9VcHBlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvd2VyY2FzZU1ldGhvZCAgPSBodHRwTWV0aG9kLnRvTG93ZXJDYXNlICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VNZXRob2QgID0gdGhpcy5jYXBpdGFsaXplIChsb3dlcmNhc2VNZXRob2QpXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2VTdWZmaXggID0gc3BsaXRQYXRoLm1hcCAodGhpcy5jYXBpdGFsaXplKS5qb2luICgnJylcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVuZGVyc2NvcmVTdWZmaXggPSBzcGxpdFBhdGgubWFwICh4ID0+IHgudHJpbSAoKS50b0xvd2VyQ2FzZSAoKSkuZmlsdGVyICh4ID0+IHgubGVuZ3RoID4gMCkuam9pbiAoJ18nKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCBjYW1lbGNhc2UgID0gdHlwZSArIGNhbWVsY2FzZU1ldGhvZCArIHRoaXMuY2FwaXRhbGl6ZSAoY2FtZWxjYXNlU3VmZml4KVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZSA9IHR5cGUgKyAnXycgKyBsb3dlcmNhc2VNZXRob2QgKyAnXycgKyB1bmRlcnNjb3JlU3VmZml4XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCdzdWZmaXhlcycgaW4gb3B0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2UnIGluIG9wdGlvbnNbJ3N1ZmZpeGVzJ10pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnNbJ3N1ZmZpeGVzJ11bJ2NhbWVsY2FzZSddXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ3VuZGVyc2NvcmUnIGluIG9wdGlvbnMuc3VmZml4ZXMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZSArPSBvcHRpb25zWydzdWZmaXhlcyddWyd1bmRlcnNjb3JlJ11cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICgndW5kZXJzY29yZV9zdWZmaXgnIGluIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlICs9IG9wdGlvbnMudW5kZXJzY29yZVN1ZmZpeDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjYW1lbGNhc2Vfc3VmZml4JyBpbiBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlICs9IG9wdGlvbnMuY2FtZWxjYXNlU3VmZml4O1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0aWFsID0gYXN5bmMgcGFyYW1zID0+IHRoaXNbbWV0aG9kTmFtZV0gKHBhdGgsIHR5cGUsIHVwcGVyY2FzZU1ldGhvZCwgcGFyYW1zIHx8IHt9KVxuXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbY2FtZWxjYXNlXSAgPSBwYXJ0aWFsXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbdW5kZXJzY29yZV0gPSBwYXJ0aWFsXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgZmV0Y2ggKHVybCwgbWV0aG9kID0gJ0dFVCcsIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcblxuICAgICAgICBpZiAoaXNOb2RlICYmIHRoaXMudXNlckFnZW50KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHRoaXMudXNlckFnZW50ID09PSAnc3RyaW5nJylcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh7ICdVc2VyLUFnZW50JzogdGhpcy51c2VyQWdlbnQgfSwgaGVhZGVycylcbiAgICAgICAgICAgIGVsc2UgaWYgKCh0eXBlb2YgdGhpcy51c2VyQWdlbnQgPT09ICdvYmplY3QnKSAmJiAoJ1VzZXItQWdlbnQnIGluIHRoaXMudXNlckFnZW50KSlcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0gZXh0ZW5kICh0aGlzLnVzZXJBZ2VudCwgaGVhZGVycylcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0eXBlb2YgdGhpcy5wcm94eSA9PT0gJ2Z1bmN0aW9uJykge1xuXG4gICAgICAgICAgICB1cmwgPSB0aGlzLnByb3h5ICh1cmwpXG4gICAgICAgICAgICBpZiAoaXNOb2RlKVxuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBleHRlbmQgKHsgJ09yaWdpbic6IHRoaXMub3JpZ2luIH0sIGhlYWRlcnMpXG5cbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgdGhpcy5wcm94eSA9PT0gJ3N0cmluZycpIHtcblxuICAgICAgICAgICAgaWYgKHRoaXMucHJveHkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIGlmIChpc05vZGUpXG4gIC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gICAgICAgICAgICBkZXRhaWxzICs9ICcgKHBvc3NpYmxlIHJlYXNvbnM6ICcgKyBbXG4gICAgICAgICAgICAgICAgICAgICdpbnZhbGlkIEFQSSBrZXlzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBvciBvbGQgbm9uY2UnLFxuICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UgaXMgZG93biBvciBvZmZsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgJ29uIG1haW50ZW5hbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgJ0REb1MgcHJvdGVjdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdyYXRlLWxpbWl0aW5nJyxcbiAgICAgICAgICAgICAgICBdLmpvaW4gKCcsICcpICsgJyknXG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSBpZiAoWyA0MDgsIDUwNCBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBSZXF1ZXN0VGltZW91dFxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAxLCA1MTEgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gQXV0aGVudGljYXRpb25FcnJvclxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZUVycm9yXG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IGVycm9yIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBjb2RlLCByZWFzb24sIGRldGFpbHMgXS5qb2luICgnICcpKVxuICAgIH1cblxuICAgIGhhbmRsZVJlc3RSZXNwb25zZSAocmVzcG9uc2UsIHVybCwgbWV0aG9kID0gJ0dFVCcsIHJlcXVlc3RIZWFkZXJzID0gdW5kZWZpbmVkLCByZXF1ZXN0Qm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgIHJldHVybiByZXNwb25zZS50ZXh0ICgpLnRoZW4gKChyZXNwb25zZUJvZ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cmtldHMsICdpZCcpXG4gICAgICAgIHRoaXMubWFya2V0c19ieV9pZCA9IHRoaXMubWFya2V0c0J5SWRcbiAgICAgICAgdGhpcy5zeW1ib2xzID0gT2JqZWN0LmtleXMgKHRoaXMubWFya2V0cykuc29ydCAoKVxuICAgICAgICB0aGlzLmlkcyA9IE9iamVjdC5rZXlzICh0aGlzLm1hcmtldHNfYnlfaWQpLnNvcnQgKClcbiAgICAgICAgaWYgKGN1cnJlbmNpZXMpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGN1cnJlbmNpZXMsIHRoaXMuY3VycmVuY2llcylcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGJhc2VDdXJyZW5jaWVzID1cbiAgICAgICAgICAgICAgICB2YWx1ZXMuZmlsdGVyIChtYXJrZXQgPT4gJ2Jhc2UnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LmJhc2VJZCB8fCBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bWVyaWNJZDogKHR5cGVvZiBtYXJrZXQuYmFzZU51bWVyaWNJZCAhPT0gJ3VuZGVmaW5lZCcpID8gbWFya2V0LmJhc2VOdW1lcmljSWQgOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZWNpc2lvbjogbWFya2V0LnByZWNpc2lvbiA/IChtYXJrZXQucHJlY2lzaW9uLmJhc2UgfHwgbWFya2V0LnByZWNpc2lvbi5hbW91bnQpIDogOCxcbiAgICAgICAgICAgICAgICAgICAgfSkpXG4gICAgICAgICAgICBjb25zdCBxdW90ZUN1cnJlbmNpZXMgPVxuICAgICAgICAgICAgICAgIHZhbHVlcy5maWx0ZXIgKG1hcmtldCA9PiAncXVvdGUnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LnF1b3RlSWQgfHwgbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVtZXJpY0lkOiAodHlwZW9mIG1hcmtldC5xdW90ZU51bWVyaWNJZCAhPT0gJ3VuZGVmaW5lZCcpID8gbWFya2V0LnF1b3RlTnVtZXJpY0lkIDogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgY29kZTogbWFya2V0LnF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24ucXVvdGUgfHwgbWFya2V0LnByZWNpc2lvbi5wcmljZSkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IGFsbEN1cnJlbmNpZXMgPSBiYXNlQ3VycmVuY2llcy5jb25jYXQgKHF1b3RlQ3VycmVuY2llcylcbiAgICAgICAgICAgIGNvbnN0IGdyb3VwZWRDdXJyZW5jaWVzID0gZ3JvdXBCeSAoYWxsQ3VycmVuY2llcywgJ2NvZGUnKVxuICAgICAgICAgICAgY29uc3QgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChncm91cGVkQ3VycmVuY2llcykubWFwIChjb2RlID0+XG4gICAgICAgICAgICAgICAgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV0ucmVkdWNlICgocHJldmlvdXMsIGN1cnJlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICgocHJldmlvdXMucHJlY2lzaW9uID4gY3VycmVudC5wcmVjaXNpb24pID8gcHJldmlvdXMgOiBjdXJyZW50KSwgZ3JvdXBlZEN1cnJlbmNpZXNbY29kZV1bMF0pKVxuICAgICAgICAgICAgY29uc3Qgc29ydGVkQ3VycmVuY2llcyA9IHNvcnRCeSAoZmxhdHRlbiAoY3VycmVuY2llcyksICdjb2RlJylcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGluZGV4QnkgKHNvcnRlZEN1cnJlbmNpZXMsICdjb2RlJyksIHRoaXMuY3VycmVuY2llcylcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmN1cnJlbmNpZXNfYnlfaWQgPSBpbmRleEJ5ICh0aGlzLmN1cnJlbmNpZXMsICdpZCcpXG4gICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNcbiAgICB9XG5cbiAgICBhc3luYyBsb2FkTWFya2V0cyAocmVsb2FkID0gZmFsc2UpIHtcbiAgICAgICAgaWYgKCFyZWxvYWQgJiYgdGhpcy5tYXJrZXRzKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnNldE1hcmtldHMgKHRoaXMubWFya2V0cylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBtYXJrZXRzID0gYXdhaXQgdGhpcy5mZXRjaE1hcmtldHMgKClcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB1bmRlZmluZWRcbiAgICAgICAgaWYgKHRoaXMuaGFzLmZldGNoQ3VycmVuY2llcykge1xuICAgICAgICAgICAgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMuZmV0Y2hDdXJyZW5jaWVzICgpXG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuc2V0TWFya2V0cyAobWFya2V0cywgY3VycmVuY2llcylcbiAgICB9XG5cbiAgICBmZXRjaEJpZHNBc2tzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aHJvdyBuZXcgTm90U3VwcG9ydGVkICh0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sIHBhcmFtcylcbiAgICAgICAgbGV0IG9obGN2YyA9IGJ1aWxkT0hMQ1ZDICh0cmFkZXMsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0cylcbiAgICAgICAgcmV0dXJuIG9obGN2Yy5tYXAgKGMgPT4gYy5zbGljZSAoMCwgLTEpKVxuICAgIH1cblxuICAgIGNvbnZlcnRUcmFkaW5nVmlld1RvT0hMQ1YgKG9obGN2cykge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb2hsY3ZzWyd0J10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoIChbXG4gICAgICAgICAgICAgICAgb2hsY3ZzWyd0J11baV0gKiAxMDAwLFxuICAgICAgICAgICAgICAgIG9obGN2c1snbyddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snaCddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snbCddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1snYyddW2ldLFxuICAgICAgICAgICAgICAgIG9obGN2c1sndiddW2ldLFxuICAgICAgICAgICAgXSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb252ZXJ0T0hMQ1ZUb1RyYWRpbmdWaWV3IChvaGxjdnMpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICd0JzogW10sXG4gICAgICAgICAgICAnbyc6IFtdLFxuICAgICAgICAgICAgJ2gnOiBbXSxcbiAgICAgICAgICAgICdsJzogW10sXG4gICAgICAgICAgICAnYyc6IFtdLFxuICAgICAgICAgICAgJ3YnOiBbXSxcbiAgICAgICAgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvaGxjdnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIHJlc3VsdFsndCddLnB1c2ggKHBhcnNlSW50IChva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N0YWxlQ2FjaGUgJiYgKCdvcGVuX29yZGVycycgaW4gYmFsYW5jZVsnaW5mbyddKSkge1xuICAgICAgICAgICAgICAgICAgICAvLyBsaXF1aSBleGNoYW5nZSByZXBvcnRzIG51bWJlciBvZiBvcGVuIG9yZGVycyB3aXRoIGJhbGFuY2UgcmVzcG9uc2VcbiAgICAgICAgICAgICAgICAgICAgLy8gdXNlIGl0IHRvIHZhbGlkYXRlIHRoZSBjYWNoZVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNoYW5nZU9yZGVyc0NvdW50ID0gYmFsYW5jZVsnaW5mbyddWydvcGVuX29yZGVycyddO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjYWNoZWRPcmRlcnNDb3VudCA9IE9iamVjdC52YWx1ZXMgKHRoaXMub3JkZXJzKS5maWx0ZXIgKG9yZGVyID0+IChvcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykpLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhY2hlZE9yZGVyc0NvdW50ID09PSBleGNoYW5nZU9yZGVyc0NvdW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID0gdGhpcy5nZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udXNlZCA9IHRoaXMuZ2V0Q3VycmVuY3lVc2VkT25PcGVuT3JkZXJzIChjdXJyZW5jeSlcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWw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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqL1xuXG5tb2R1bGUuZXhwb3J0cyA9IHN1YmNsYXNzIChcblxuLyogIFJvb3QgY2xhc3MgICAgICAgICAgICAgICAgICAqL1xuXG4gICAgRXJyb3IsXG5cbi8qICBEZXJpdmVkIGNsYXNzIGhpZXJhcmNoeSAgICAgKi9cblxuICAgIHsgJ0Jhc2VFcnJvcic6XG4gICAgICAgIHsgJ0V4Y2hhbmdlRXJyb3InOlxuICAgICAgICAgICAgeyAnTm90U3VwcG9ydGVkJzogICAgICAgICAgICAgICB7fVxuICAgICAgICAgICAgLCAnQXV0aGVudGljYXRpb25FcnJvcic6XG4gICAgICAgICAgICAgICAgeyAnUGVybWlzc2lvbkRlbmllZCc6ICAgICAgIHt9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgLCAnSW5zdWZmaWNpZW50RnVuZHMnOiAgICAgICAgICB7fVxuICAgICAgICAgICAgLCAnSW52YWxpZEFkZHJlc3MnOiAgICAgICAgICAgICB7fVxuICAgICAgICAgICAgLCAnSW52YWxpZE9yZGVyJzpcbiAgICAgICAgICAgICAgICB7ICdPcmRlck5vdEZvdW5kJzogICAgICAgICAge31cbiAgICAgICAgICAgICAgICAsICdPcmRlck5vdENhY2hlZCc6ICAgICAgICAge31cbiAgICAgICAgICAgICAgICAsICdDYW5jZWxQZW5kaW5nJzogICAgICAgICAge31cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICwgJ05ldHdvcmtFcnJvcic6XG4gICAgICAgICAgICB7ICdERG9TUHJvdGVjdGlvbic6ICAgICAgICAge31cbiAgICAgICAgICAgICwgJ1JlcXVlc3RUaW1lb3V0JzogICAgICAgICB7fVxuICAgICAgICAgICAgLCAnRXhjaGFuZ2VOb3RBdmFpbGFibGUnOiAgIHt9XG4gICAgICAgICAgICAsICdJbnZhbGlkTm9uY2UnOiAgICAgICAgICAge31cbiAgICAg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zZWQgYXMgYSBncm91cGluZyBwYXJhbWV0ZXI6XG4gICAgICAgYXJyYXkgPSBbXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTEnIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTInIH0sXG4gICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUzJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTMnIH0sXG4gICAgICAgXVxuICAgICAgIGtleSA9ICdzb21lS2V5J1xuXG4gICAgICAgUmV0dXJucyBhIG1hcDpcbiAgICAgIHtcbiAgICAgICAgICB2YWx1ZTE6IFtcbiAgICAgICAgICAgIHsgc29tZUtleTogJ3ZhbHVlMScsIGFub3RoZXJLZXk6ICdhbm90aGVyVmFsdWUxJyB9LFxuICAgICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUxJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTInIH0sXG4gICAgICAgICAgXVxuICAgICAgICAgIHZhbHVlMzogW1xuICAgICAgICAgICAgeyBzb21lS2V5OiAndmFsdWUzJywgYW5vdGhlcktleTogJ2Fub3RoZXJWYWx1ZTMnIH1cbiAgICAgICAgICBdLFxuICAgICAgfVxuICAgICovXG5cbiAgICAsIGdyb3VwQnkgKHgsIGssIG91dCA9IHt9KSB7XG5cbiAgICAgICAgZm9yIChjb25zdCB2IG9mIHZhbHVlcyAoeCkpIHtcbiAgICAgICAgICAgIGlmIChrIGluIHYpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBwID0gdltrXVxuICAgICAgICAgICAgICAgIG91dFtwXSA9IG91dFtwXSB8fCBbXVxuICAgICAgICAgICAgICAgIG91dFtwXS5wdXNoICh2KVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvdXRcbiAgICB9XG5cbi8qICAuLi4uLi4uLi4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gICAgICAgICAgIGtleSxcbiAgICAgICAgICAgICAgIGRlc2NlbmRpbmcgPSBmYWxzZSxcbiAgICAgICAgICAgICAgIGRpcmVjdGlvbiAgPSBkZXNjZW5kaW5nID8gLTEgOiAxKSA9PiBhcnJheS5zb3J0ICgoYSwgYikgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFba2V5XSA8IGJba2V5XSkgPyAtZGlyZWN0aW9uIDpcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGFba2V5XSA+IGJba2V5XSkgPyAgZGlyZWN0aW9uIDogMCkpKVxuXG4vKiAgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgKi9cblxuICAgICwgZmxhdHRlbjogZnVuY3Rpb24gZmxhdHRlbiAoeCwgb3V0ID0gW10pIHtcblxuICAgICAgICBmb3IgKGNvbnN0IHYgb2YgeCkge1xuICAgICAgICAgICAgaWYgKGlzQXJyYXkgKHYpKSBmbGF0dGVuICh2LCBvdXQpXG4gICAgICAgICAgICBlbHNlIG91dC5wdXNoICh2KVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHBsdWNrOiAoeCwgaykgPT4gdmFsdWVzICh4KVxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbHRlciAodiA9PiBrIGluIHYpXG4gICAgICAgICAgICAgICAgICAgICAgICAubWFwICh2ID0+IHZba10pXG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLCBvbWl0ICh4LCAuLi5hcmdzKSB7XG5cbiAgICAgICAgY29uc3Qgb3V0ID0gY2xvbmUgKHgpXG5cbiAgICAgICAgZm9yIChjb25zdCBrIG9mIGFyZ3MpIHtcblxuICAgICAgICAgICAgaWYgKGlzQXJyYXkgKGspKSAvLyBvbWl0ICh4LCBbJ2EnLCAnYiddKVxuICAgICAgICAgICAgICAgIGZvciAoY29uc3Qga2sgb2YgaylcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG91dFtra11cblxuICAgICAgICAgICAgZWxzZSBkZWxldGUgb3V0W2tdIC8vIG9taXQgKHgsICdhJywgJ2InKVxuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIG91dFxuICAgIH1cblxuLyogIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLiAgICovXG5cbiAgICAsIHN1bSAoLi4ueHMpIHtcblxuICAgICAgICBjb25zdCBucyA9IHhzLmZpbHRlciAoaXNOdW1iZXIpIC8vIGxlYXZlIG9ubHkgbnVtYmVyc1xuXG4gICAgICAgIHJldHVybiAobnMubGVuZ3RoID4gMClcbiAgICAgICAgICAgICAgICAgICAgPyBucy5yZWR1Y2UgKChhLCBiKSA9PiBhICsgYiwgMClcbiAgICAgICAgICAgICAgICAgICAgOiB1bmRlZmluZWRcbiAgICB9XG5cbi8qICAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4gICAqL1xuXG4gICAgLCBkZWVwRXh0ZW5kOiBmdW5jdGlvbiBkZWVwRXh0ZW5kICguLi54cykge1xuXG4gICAgICAgIGxldCBvdXQgPSB1bmRlZmluZWRcblxuICAgICAgICBmb3IgKGNvbnN0IHggb2YgeHMpIHtcblxuICAgICAgICAgICAgaWYgKGlzRGljdGlvbmFyeSAoeCkpIHtcblxuICAgICAgICAgICAgICAgIGlmICghaXNPYmplY3QgKG91dCkpXG4gICAgICAgICAgICAgICAgICAgIG91dCA9IHt9XG5cbiAgICAgICA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uXG4vKiAgUmVzZXQgdGhlIGxhc3Qgc2lnbmlmaWNhbnQgZGlnaXQgaW5kZXgsIGFzIGl0IHdpbGwgY2hhbmdlIGR1cmluZyB0aGUgcm91bmRpbmcvdHJ1bmNhdGlvbi4gICAqL1xuXG4gICAgZGlnaXRzRW5kID0gLTFcblxuLyogIFBlcmZvcm0gcm91bmRpbmcvdHJ1bmNhdGlvbiBwZXIgZGlnaXQsIGZyb20gZGlnaXRzRW5kIHRvIGRpZ2l0c1N0YXJ0LCBieSB1c2luZyB0aGUgZm9sbG93aW5nXG4gICAgYWxnb3JpdGhtIChyb3VuZGluZyA5OTkg4oaSIDEwMDAsIGFzIGFuIGV4YW1wbGUpOlxuXG4gICAgICAgIHN0ZXAgID0gICAgICAgICAgaT0zICAgICAgaT0yICAgICAgaT0xICAgICAgaT0wXG5cbiAgICAgICAgY2hhcnMgPSAgICAgICAgIDA5OTkgICAgIDA5OTkgICAgIDA5MDAgICAgIDEwMDBcbiAgICAgICAgbWVtbyAgPSAgICAgICAgIC0tLTAgICAgIC0tMS0gICAgIC0xLS0gICAgIDAtLS0gICAgICAgICAgICAgICAgICAgICAqL1xuXG4gICAgZm9yIChsZXQgaSA9IGNoYXJzLmxlbmd0aCAtIDEsIG1lbW8gPSAwOyBpID49IDA7IGktLSkge1xuXG4gICAgICAgIGxldCBjID0gY2hhcnNbaV1cblxuICAgICAgICBpZiAoaSAhPT0gMCkge1xuICAgICAgICAgICAgYyArPSBtZW1vXG5cbiAgICAgICAgICAgIGlmIChpID49IChwcmVjaXNpb25TdGFydCArIG51bVByZWNpc2lvbkRpZ2l0cykpIHtcblxuICAgICAgICAgICAgICAgIGNvbnN0IGNlaWwgPSAocm91bmRpbmdNb2RlID09PSBST1VORCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGMgPj0gRklWRSkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAhKChjID09PSBGSVZFKSAmJiBtZW1vKSAvLyBwcmV2ZW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ICAgICA9IChkaWdpdHNFbmQgICAgPCBhZnRlckRvdCkgPyAoYWZ0ZXJEb3QgICAgKSA6IGRpZ2l0c0VuZCAgIC8vIDEyKDMpMDAwICAgICAtLS0tPiAxMjMwMDAoIClcblxuLyogIENvbXB1dGUgdmFyaW91cyBzdWItcmFuZ2VzICAgICAgICovXG5cbiAgICBjb25zdCBuU2lnbiAgICAgICAgID0gICAgIChpc05lZ2F0aXZlID8gMSA6IDApICAgICAgICAgICAgICAgIC8vICgtKTEyMy40NTZcbiAgICAgICAgLCBuQmVmb3JlRG90ICAgID0gICAgIChuU2lnbiArIChhZnRlckRvdCAtIHJlYWRTdGFydCkpICAgIC8vICgtMTIzKS40NTZcbiAgICAgICAgLCBuQWZ0ZXJEb3QgICAgID0gbWF4IChyZWFkRW5kIC0gYWZ0ZXJEb3QsIDApICAgICAgICAgICAgIC8vIC0xMjMuKDQ1NilcbiAgICAgICAgLCBhY3R1YWxMZW5ndGggID0gICAgIChyZWFkRW5kIC0gcmVhZFN0YXJ0KSAgICAgICAgICAgICAgIC8vIC0oMTIzLjQ1NilcbiAgICAgICAgLCBkZXNpcmVkTGVuZ3RoID0gICAgIChwYWRkaW5nTW9kZSA9PT0gTk9fUEFERElORylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gKGFjdHVhbExlbmd0aCkgICAgICAgICAgICAgIC8vIC0oMTIzLjQ1NilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogKHByZWNpc2lvbkVuZCAtIHJlYWRTdGFydCkgIC8vIC0oMTIzLjQ1NiAgICApXG5cbiAgICAgICAgLCBwYWQgICAgICAgICAgID0gbWF4IChkZXNpcmVkTGVuZ3RoIC0gYWN0dWFsTGVuZ3RoLCAwKSAgIC8vICAtMTIzLjQ1NiggICAgKVxuICAgICAgICAsIHBhZFN0YXJ0ICAgICAgPSAgICAgKG5CZWZvcmVEb3QgKyAxICsgbkFmdGVyRG90KSAgICAgICAgLy8gIC0xMjMuNDU2KCApXG4gICAgICAgICwgcGFkRW5kICAgICAgICA9ICAgICAocGFkU3RhcnQgKyBwYWQpICAgICAgICAgICAgICAgICAgICAvLyAgLTEyMy40NTYgICAgICggKVxuICAgICAgICAsIGlzSW50ZWdlciAgICAgPSAgICAgKG5BZnRlckRvdCArIHBhZCkgPT09IDAgICAgICAgICAgICAgLy8gIC0xMjNcblxuLyogIEZpbGwgdGhlIG91dHB1dCBidWZmZXIgd2l0aCBjaGFyYWN0ZXJzICAgICovXG5cbiAgICBjb25zdCBvdXQgPSBuZXcgVWludDhBcnJheSAobkJlZm9yZURvdCArIChpc0ludGVnZXIgPyAwIDogMSkgKyBuQWZ0ZXJEb3QgKyBwYWQpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuICAgIGlmICAoaXNOZWdhdGl2ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dFswXSAgICAgICAgICA9IE1JTlVTICAgICAvLyAtICAgICBtaW51cyBzaWduXG4gICAgZm9yIChpID0gblNpZ24sIGogPSByZWFkU3RhcnQ7ICAgICAgICAgIGkgPCBuQmVmb3JlRG90OyBpKyssIGorKykgb3V0W2ldICAgICAgICAgID0gY2hhcnNbal0gIC8vIDEyMyAgIGJlZm9yZSBkb3RcbiAgICBpZiAgKCFpc0ludGVnZXIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRbbkJlZm9yZURvdF0gPSBET1QgICAgICAgLy8gLiAgICAgZG90XG4gICAgZm9yIChpID0gbkJlZm9yZURvdCArIDEsIGogPSBhZnRlckRvdDsgIGkgPCBwYWRTdGFydDsgICBpKyssIGorKykgb3V0W2ldICAgICAgICAgID0gY2hhcnNbal0gIC8vIDQ1Ni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XG5cbiAgICAgICAgcmV0dXJuIE9iamVjdC5hc3NpZ24gKGNvc3QgPT4ge1xuXG4gICAgICAgICAgICBpZiAocXVldWUubGVuZ3RoID4gY2ZnLm1heENhcGFjaXR5KVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvciAoJ0JhY2tsb2cgaXMgb3ZlciBtYXggY2FwYWNpdHkgb2YgJyArIGNmZy5tYXhDYXBhY2l0eSlcblxuICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlIChhc3luYyAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG5cbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBxdWV1ZS5wdXNoICh7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9KVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICghcnVubmluZykge1xuICAgICAgICAgICAgICAgICAgICAgICAgcnVubmluZyA9IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChxdWV1ZS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaGFzRW5vdWdoVG9rZW5zID0gY2ZnLmNhcGFjaXR5ID8gKG51bVRva2VucyA+IDApIDogKG51bVRva2VucyA+PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNFbm91Z2hUb2tlbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7IGNvc3QsIHJlc29sdmUsIHJlamVjdCB9ID0gcXVldWVbMF1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAoY29zdCB8fCBjZmcuZGVmYXVsdENvc3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnVtVG9rZW5zID49IE1hdGgubWluIChjb3N0LCBjZmcuY2FwYWNpdHkpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtVG9rZW5zIC09IGNvc3RcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZS5zaGlmdCAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUgKClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0ID0gbm93ICgpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwgZWxhcHNlZCA9IHQgLSBsYXN0VGltZXN0YW1wXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGFzdFRpbWVzdGFtcCA9IHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1Ub2tlbnMgPSBNYXRoLm1pbiAoY2ZnLmNhcGFjaXR5LCBudW1Ub2tlbnMgKyBlbGFwc2VkICogY2ZnLnJlZmlsbFJhdGUpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgc2xlZXAgKGNmZy5kZWxheSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bm5pbmcgPSBmYWxzZVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlamVjdCAoZSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuXG4gICAgICAgIH0sIGNmZywgeyBjb25maWd1cmU6IG5ld0NmZyA9PiB0aHJvdHRsZSAoT2JqZWN0LmFzc2lnbiAoe30sIGNmZywgbmV3Q2ZnKSkgfSlcbiAgICB9XG59X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JzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAncHVibGljQVBJJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQmFsYW5jZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEZ1bmRpbmdGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsIC8vIG9yIHRoZXkgd2lsbCByZXR1cm4gaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMjMzOFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICd3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM0OTAyNjExLTJiZThiZjFhLWY4MzAtMTFlNy05MWEyLTExYjJmMjkyZTc1MC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYmlib3guY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpYm94LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaWJveGNvbS9hcGlfcmVmZXJlbmNlL3dpa2kvaG9tZV9lbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQmlib3hjb20vYXBpX3JlZmVyZW5jZS93aWtpL2FwaV9yZWZlcmVuY2UnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9iaWJveC56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDQ0MTcwMTMtRmVlLVN0cnVjdHVyZS1vbi1CaWJveCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IHJld29yayBmb3IgZnVsbCBlbmRwb2ludC9jbWQgcGF0aHMgaGVyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ21kYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJwZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDIxJzogSW5zdWZmaWNpZW50RnVuZHMsIC8vIEluc3VmZmljaWVudCBiYWxhbmNlIGF2YWlsYWJsZSBmb3Igd2l0aGRyYXdhbFxuICAgICAgICAgICAgICAgICcyMDE1JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gR29vZ2xlIGF1dGhlbnRpY2F0b3IgaXMgd3JvbmdcbiAgICAgICAgICAgICAgICAnMjAzMyc6IE9yZGVyTm90Rm91bmQsIC8vIG9wZXJhdGlvbiBmYWlsZWQhIE9yZGVycyBoYXZlIGJlZW4gY29tcGxldGVkIG9yIHJldm9rZWRcbiAgICAgICAgICAgICAgICAnMjA2Nyc6IEludmFsaWRPcmRlciwgLy8gRG9lcyBub3Qgc3VwcG9ydCBtYXJrZXQgb3JkZXJzXG4gICAgICAgICAgICAgICAgJzIwNjgnOiBJbnZhbGlkT3JkZXIsIC8vIFRoZSBudW1iZXIgb2Ygb3JkZXJzIGNhbiBub3QgYmUgbGVzcyB0aGFuXG4gICAgICAgICAgICAgICAgJzMwMTInOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBpbnZhbGlkIGFwaUtleVxuICAgICAgICAgICAgICAgICczMDI0JzogUGVybWlzc2lvbkRlbmllZCwgLy8gd3JvbmcgYXBpa2V5IHBlcm1pc3Npb25zXG4gICAgICAgICAgICAgICAgJzMwMjUnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyBzaWduYXR1cmUgZmFpbGVkXG4gICAgICAgICAgICAgICAgJzQwMDAnOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gY3VycmVudCBuZXR3b3JrIGlzIHVuc3RhYmxlXG4gICAgICAgICAgICAgICAgJzQwMDMnOiBERG9TUHJvdGVjdGlvbiwgLy8gc2VydmVyIGJ1c3kgcGxlYXNlIHRyeSBhZ2FpbiBsYXRlclxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdLRVknOiAnQmlodScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWRhdGEgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY21kJzogJ21hcmtldEFsbCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY29pbl9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydjdXJyZW5jeV9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gYmFzZSArICdfJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIC8vIHdlIGRvbid0IHNldCB2YWx1ZXMgdGhhdCBhcmUgbm90IGRlZmluZWQgYnkgdGhlIGV4Y2hhbmdlXG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNhZmVJbnRlZ2VyICh0aWNrZXIsICd0aW1lc3RhbXAnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHV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keSc6IHt9LFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7XG4gICAgICAgICAgICBsZXQgZGVwb3NpdCA9IGN1cnJlbmN5WydlbmFibGVfZGVwb3NpdCddO1xuICAgICAgICAgICAgbGV0IHdpdGhkcmF3ID0gY3VycmVuY3lbJ2VuYWJsZV93aXRoZHJhdyddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChkZXBvc2l0ICYmIHdpdGhkcmF3KSA/IHRydWUgOiBmYWxzZTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL2Fzc2V0cycsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3NlbGVjdCc6IDEsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBpbmRleGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2Fzc2V0c19saXN0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXNbJ2Fzc2V0c19saXN0J10sICdjb2luX3N5bWJvbCcpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaW5kZXhlZCA9IGJhbGFuY2VzO1xuICAgICAgICB9XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGluZGV4ZWQpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKGNvZGUuaW5kZXhPZiAoJ1RPVEFMXycpID49IDApIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoNik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoY29kZSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2NvZGVdWydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBi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JTaWRlID0gKHNpZGUgPT09ICdidXknKSA/IDEgOiAyO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJwZW5kaW5nICh7XG4gICAgICAgICAgICAnY21kJzogJ29yZGVycGVuZGluZy90cmFkZScsXG4gICAgICAgICAgICAnYm9keSc6IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ2FjY291bnRfdHlwZSc6IDAsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAgICAgJ29yZGVyX3NpZGUnOiBvcmRlclNpZGUsXG4gICAgICAgICAgICAgICAgJ3BheV9iaXgnOiAwLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpLFxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAncmVzdWx0JyksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnBlbmRpbmcgKHtcbiAgICAgICAgICAgICdjbWQnOiAnb3JkZXJwZW5kaW5nL2NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICdib2R5JzogdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnb3JkZXJzX2lkJzogaWQsXG4gICAgICAgICAgICB9LC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YgY29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydvcmRlcl9zaWRlJ10gPT09IDEpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnc3RhdHVzJyk7XG4gICAgICAgIGlmICh0eXBlb2Ygc3RhdHVzICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN0YXR1cyA9IHRoaXMucGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnaWQnKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCA/IGNvc3QgOiBwYXJzZUZsb2F0IChwcmljZSkgKiBmaWxsZWQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgIC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5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBzaXplID0gKGxpbWl0KSA/IGxpbWl0IDogMjAwO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJwZW5kaW5nICh7XG4gICAgICAgICAgICAnY21kJzogJ29yZGVycGVuZGluZy9vcmRlckhpc3RvcnlMaXN0JyxcbiAgICAgICAgICAgICdib2R5JzogdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICAgICAnYWNjb3VudF90eXBlJzogMCwgLy8gMCAtIHJlZ3VsYXIsIDEgLSBtYXJnaW5cbiAgICAgICAgICAgICAgICAncGFnZSc6IDEsXG4gICAgICAgICAgICAgICAgJ3NpemUnOiBzaXplLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSxcbiAgICAgICAgfSk7XG4gICAgICAgIGxldCB0cmFkZXMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2VbJ3Jlc3VsdCddLCAnaXRlbXMnLCBbXSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJzICh0cmFkZXMsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaERlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmN5IChjb2RlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYW5zZmVyICh7XG4gICAgICAgICAgICAnY21kJzogJ3RyYW5zZmVyL3RyYW5zZmVySW4nLFxuICAgICAgICAgICAgJ2JvZHknOiB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd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JywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgY21kcyA9IHRoaXMuanNvbiAoWyBwYXJhbXMgXSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kICE9PSAnR0VUJylcbiAgICAgICAgICAgICAgICBib2R5ID0geyAnY21kcyc6IGNtZHMgfTtcbiAgICAgICAgICAgIGVsc2UgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB7XG4gICAgICAgICAgICAgICAgJ2NtZHMnOiBjbWRzLFxuICAgICAgICAgICAgICAgICdhcGlrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGNtZHMpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnbWQ1JyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChib2R5LCB7ICdjb252ZXJ0QXJyYXlzVG9PYmplY3RzJzogdHJ1ZSB9KTtcbiAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlWydlcnJvciddLCAnY29kZScpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIGJvZHk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBleGNlcHRpb25zID0gdGhpcy5leGNlcHRpb25zO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoa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ICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRnVuZGluZ0ZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmgnLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnOGgnOiAnOGgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICczZCc6ICczZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk2MDQwMjAtZDU0ODNjZGMtODdlZS0xMWU3LTk0YzctZDFhOGQ5MTY5MjkzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3YXBpJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL3dhcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgICAgICd2Myc6ICdodHRwczovL2FwaS5iaW5hbmNlLmNvbS9hcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAndjEnOiAnaHR0cHM6Ly9hcGkuYmluYW5jZS5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYmluYW5jZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2JpbmFuY2UtZXhjaGFuZ2UvYmluYW5jZS1vZmZpY2lhbC1hcGktZG9jcy9ibG9iL21hc3Rlci9yZXN0LWFwaS5tZCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpbmFuY2UuemVuZGVzay5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwNDI5MzMyJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaW5hbmNlLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDA1ODMzMTEnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3B1YmxpYy9wcm9kdWN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3SGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRTdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbVN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGZWUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3YzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2Jvb2tUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZUluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZ2dUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyLzI0aHInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9hbGxQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci9hbGxCb29rVGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYm9va1RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2VJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFsgJ3VzZXJEYXRhU3RyZWFtJyBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFsgJ3VzZXJEYXRhU3RyZWFtJyBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogWyAndXNlckRhdGFTdHJlYW0nIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWxsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci90ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIHNob3VsZCBiZSBkZWxldGVkLCB0aGVzZSBhcmUgb3V0ZGF0ZWQgYW5kIGluYWNjdXJhdGVcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQURBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDQuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSU9OJzogMS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQic6IDExLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVBQQyc6IDYuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogMTguMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNQVCc6IDEwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOQic6IDAuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JSRCc6IDYuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDY3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ01UJzogMzcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiA0Ny4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAxMS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDUxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRic6IDYuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkcnOiAyLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogNDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEYnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAyLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDQ1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogODUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUTyc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC41MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHWFMnOiAwLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSENDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNYJzogMS4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tOQyc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRU5EJzogNTQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSU5LJzogMTIuOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMTFQnOiA1NC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDkuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjI5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiA3NC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuODYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTURBJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PRCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAzNC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UTCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOQVYnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiAyLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogOC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1NUJzogMTcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiA4OC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiA4LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMC4yNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRU1AnOiAyMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JDTic6IDM1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkROJzogMi4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUSc6IDE4LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogNC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTFQnOiAxLjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JUQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDI5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMzIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE9SSic6IDUuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiA3LjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5CJzogODIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA0Ny4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSSUcnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMTI5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDIzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMS44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDI4LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDcuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQUJJJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiA5LjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYWkMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMzkuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiA1LjcsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnWU9ZTyc6ICdZT1lPVycsXG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgICAgICdOQU5PJzogJ1hSQicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgLy8gZXhjaGFuZ2Utc3BlY2lmaWMgb3B0aW9uc1xuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2RlZmF1bHRMaW1pdE9yZGVyVHlwZSc6ICdsaW1pdCcsIC8vIG9yICdsaW1pdF9tYWtlcidcbiAgICAgICAgICAgICAgICAnaGFzQWxyZWFkeUF1dGhlbnRpY2F0ZWRTdWNjZXNzZnVsbHknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2Fybk9uRmV0Y2hPcGVuT3JkZXJzV2l0aG91dFN5bWJvbCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3JlY3ZXaW5kb3cnOiA1ICogMTAwMCwgLy8gNSBzZWMsIGJpbmFuY2UgZGVmYXVsdFxuICAgICAgICAgICAgICAgICd0aW1lRGlmZmVyZW5jZSc6IDAsIC8vIHRoZSBkaWZmZXJlbmNlIGJldHdlZW4gc3lzdGVtIGNsb2NrIGFuZCBCaW5hbmNlIGNsb2NrXG4gICAgICAgICAgICAgICAgJ2FkanVzdEZvclRpbWVEaWZmZXJlbmNlJzogZmFsc2UsIC8vIGNvbnRyb2xzIHRoZSBhZGp1c3RtZW50IGxvZ2ljIHVwb24gaW5zdGFudGlhdGlvblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGN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gICAgICAgICAgIC8vIFwiMTIzNDU2XCIgaXMgYSBcInRlc3Qgc3ltYm9sL21hcmtldFwiXG4gICAgICAgICAgICBpZiAoaWQgPT09ICcxMjM0NTYnKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnYmFzZUFzc2V0J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGVBc3NldCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmlsdGVycyA9IHRoaXMuaW5kZXhCeSAobWFya2V0WydmaWx0ZXJzJ10sICdmaWx0ZXJUeXBlJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdiYXNlJzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZUFzc2V0UHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydxdW90ZVByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0dXMnXSA9PT0gJ1RSQURJTkcnKTtcbiAgICAgICAgICAgIC8vIGxvdCBzaXplIGlzIGRlcHJlY2F0ZWQgYXMgb2YgMjAxOC4wMi4wNlxuICAgICAgICAgICAgbGV0IGxvdCA9IC0xICogTWF0aC5sb2cxMCAocHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgZW50cnkgPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCwgLy8gbG90IHNpemUgaXMgZGVwcmVjYXRlZCBhcyBvZiAyMDE4LjAyLjA2XG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoJ1BSSUNFX0ZJTFRFUicgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydQUklDRV9GSUxURVInXTtcbiAgICAgICAgICAgICAgICBlbnRyeVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsndGlja1NpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xpbWl0cyddWydwcmljZSddID0ge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGZpbHRlciwgJ21pblByaWNlJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWF4UHJpY2UnKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdMT1RfU0laRScgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydMT1RfU0laRSddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsnYW1vdW50J10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsnc3RlcFNpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xvdCddID0gdGhpcy5zYWZlRmxvYXQgKGZpbHRlciwgJ3N0ZXBTaXplJyk7IC8vIGxvdCBzaXplIGlzIGRlcHJlY2F0ZWQgYXMgb2YgMjAxOC4wMi4wNlxuICAgICAgICAgICAgICAgIGVudHJ5WydsaW1pdHMnXVsnYW1vdW50J10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWluUXR5JyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAoZmlsdGVyLCAnbWF4UXR5JyksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmICgnTUlOX05PVElPTkFMJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xpbWl0cyddWydjb3N0J11bJ21pbiddID0gcGFyc2VGbG9hdCAoZmlsdGVyc1snTUlOX05PVElPTkFMJ11bJ21pbk5vdGlvbmFsJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKGVudHJ5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAg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HJldmVyc2VkIGludGVudGlvbmFsbHlcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHNpZGUgPSAodHJhZGVbJ2lzQnV5ZXInXSkgPyAnYnV5JyA6ICdzZWxsJzsgLy8gdGhpcyBpcyBhIHRydWUgc2lkZVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY29tbWlzc2lvbicgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2NvbW1pc3Npb24nKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodHJhZGVbJ2NvbW1pc3Npb25Bc3NldCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRha2VyT3JNYWtlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdpc01ha2VyJyBpbiB0cmFkZSlcbiAgICAgICAgICAgIHRha2VyT3JNYWtlciA9IHRyYWRlWydpc01ha2VyJ10gPyAnbWFrZXInIDogJ3Rha2VyJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGFrZXJPck1ha2VyJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ3NpZGUnO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WQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ29yZGVySWQnKTtcbiAgICAgICAgbGV0IHR5cGUgPSB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAndHlwZScpO1xuICAgICAgICBpZiAodHlwZW9mIHR5cGUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdHlwZSA9IHR5cGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCBzaWRlID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3NpZGUnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBzaWRlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHNpZGUgPSBzaWRlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAvLyB0aGUgbmV4dCA1IGxpbmVzIGFyZSBhZGRlZCB0byBzdXBwb3J0IGZvciB0ZXN0aW5nIG9yZGVyc1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0T3JkZXInO1xuICAgICAgICBsZXQgdGVzdCA9IHRoaXMuc2FmZVZhbHVlIChwYXJhbXMsICd0ZXN0JywgZmFsc2UpO1xuICAgICAgICBpZiAodGVzdCkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdUZXN0JztcbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMub21pdCAocGFyYW1zLCAndGVzdCcpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAncXVhbnRpdHknOiB0aGlzLmFtb3VudFRvU3RyaW5nIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbGltaXQnKSB7XG4gICAgICAgICAgICBvcmRlclsndHlwZSddID0gdGhpcy5vcHRpb25zWydkZWZhdWx0TGltaXRPcmRlclR5cGUnXS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5leHRlbmQgKG9yZGVyLCB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AgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRGVwb3NpdEFkZHJlc3MgKGNvZGUsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY3kgKGNvZGUpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndhcGlHZXREZXBvc2l0QWRkcmVzcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzJyk7XG4gICAgICAgICAgICAgICAgbGV0IHRhZyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdhZGRyZXNzVGFnJyk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY29kZSxcbiAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3MnOiB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyksXG4gICAgICAgICAgICAgICAgICAgICd0YWcnOiB0YWcsXG4gICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYy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hpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBxdWVyeSArPSAnJicgKyAnc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdYLU1CWC1BUElLRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoKG1ldGhvZCA9PT0gJ0dFVCcpIHx8IChhcGkgPT09ICd3YXBpJykpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKChjb2RlID09PSA0MTgpIHx8IChjb2RlID09PSA0MjkpKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgY29kZS50b1N0cmluZyAoKSArICcgJyArIHJlYXNvbiArICcgJyArIGJvZHkpO1xuICAgICAgICA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XNlIHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgLy8gY2hlY2sgc3VjY2VzcyB2YWx1ZSBmb3Igd2FwaSBlbmRwb2ludHNcbiAgICAgICAgICAgICAgICAvLyByZXNwb25zZSBpbiBmb3JtYXQgeydtc2cnOiAnVGhlIGNvaW4gZG9lcyBub3QgZXhpc3QuJywgJ3N1Y2Nlc3MnOiB0cnVlL2ZhbHNlfVxuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnc3VjY2VzcycsIHRydWUpO1xuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ21zZycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gSlNPTi5wYXJzZSAocmVzcG9uc2VbJ21zZyddKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAvLyBjaGVja3MgYWdhaW5zdCBlcnJvciBjb2Rlc1xuICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlcnJvciAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGEgd29ya2Fyb3VuZCBmb3Ige1wiY29kZVwiOi0yMDE1LFwibXNnXCI6XCJJbnZhbGlkIEFQSS1rZXksIElQLCBvciBwZXJtaXNzaW9ucyBmb3IgYWN0aW9uLlwifVxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGVzcGl0ZSB0aGF0IHRoZWlyIG1lc3NhZ2UgaXMgdmVyeSBjb25mdXNpbmcsIGl0IGlzIHJhaXNlZCBieSBCaW5hbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiBhIHRlbXBvcmFyeSBiYW4gKHRoZSBBUEkga2V5IGlzIHZhbGlkLCBidXQgZGlzYWJsZWQgZm9yIGEgd2hpbGUpXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGVycm9yID09PSAnLTIwMTUnKSAmJiB0aGlzLm9wdGlvbnNbJ2hhc0FscmVhZHlBdXRoZW50aWNhdGVkU3VjY2Vzc2Z1bGx5J10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnIHRlbXBvcmFyeSBiYW5uZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2Vycm9yXSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnOiB1bmtub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AgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdDJjLmNvLmlsL2hvbWUvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9PZmVyRS9iaXQyYycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9UaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS9sYXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdNZXJjaGFudC9DcmVhdGVDaGVja291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkRnVuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VCdXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyTWFya2V0UHJpY2VTZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9DYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkQ29pbkZ1bmRzUmVxdWVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWRkU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L0dldE15SWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvU2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUGF5bWVudC9QYXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9NeU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvR2V0QnlJZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWNjb3VudEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL09yZGVySGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL05JUyc6IHsgJ2lkJzogJ0J0Y05pcycsICdzeW1ib2wnOiAnQlRDL05JUycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9OSVMnOiB7ICdpZCc6ICdCY2hOaXMnLCAnc3ltYm9sJzogJ0JDSC9OSVMnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvTklTJzogeyAnaWQnOiAnTHRjTmlzJywgJ3N5bWJvbCc6ICdMVEMvTklTJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQlRHL05JUyc6IHsgJ2lkJzogJ0J0Z05pcycsICdzeW1ib2wnOiAnQlRHL05JUycsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEJhbGFuY2VWMiAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgYXZhaWxhYmxlID0gJ0FWQUlMQUJMRV8nICsgY3VycmVuY3k7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5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zZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG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1bHRbJ05ld09yZGVyJ11bJ2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJDYW5jZWxPcmRlciAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcuanNvbic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJ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3MgYml0YmFuayBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0YmFuaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdiaXRiYW5rJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSlAnLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW1pbicsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG1pbicsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc4aCc6ICc4aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc4MDgwODEtYjg3ZjJkOWMtMmU1OS0xMWU4LTg5NGQtYzE5MDBiNzU4NGZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3B1YmxpYy5iaXRiYW5rLmNjJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYml0YmFuay5jYycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0YmFuay5jYy8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmJpdGJhbmsuY2MvJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2JpdGJhbmsuY2MvZG9jcy9mZWVzLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3BhaXJ9L3RyYW5zYWN0aW9ucy97WVlZWU1NRER9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cGFpcn0vY2FuZGxlc3RpY2sve2NhbmRsZS10eXBlfS97WVlZWU1NRER9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3Qvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9hY3RpdmVfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3QvdHJhZGVfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93aXRoZHJhd2FsX2FjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3Qvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9jYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3BvdC9jYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Nwb3Qvb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvQlRDJzogeyAnaWQnOiAnYmNjX2J0YycsICdzeW1ib2wnOiAnQkNIL0JUQycsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdCVEMnLCAnYmFzZUlkJzogJ2JjYycsICdxdW90ZUlkJzogJ2J0YycgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0pQWSc6IHsgJ2lkJzogJ2JjY19qcHknLCAnc3ltYm9sJzogJ0JDSC9KUFknLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAn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J3F1b3RlJzogJ0pQWScsICdiYXNlSWQnOiAnYnRjJywgJ3F1b3RlSWQnOiAnanB5JyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAvLyBvbmx5IHRlbXBvcmFyaWx5XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdKUFknOiBhbW91bnQgPT4gYW1vdW50ID4gMzAwMDAgPyA3NTYgOiA1NDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9OQSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDAwMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzIwMDAyJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMjAwMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDAwNSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzIwMDA0JzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICc0MDAyMCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnNDAwMjEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzQwMDI1JzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnNDAwMTMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICc0MDAxNCc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzUwMDA4JzogUGVybWlzc2lvbkRlbmllZCxcbiAgICAgICAgICAgICAgICAnNTAwMDknOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICc1MDAxMCc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzYwMDAxJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaX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AgbGV0IGNvc3QgPSB0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSAqIGFtb3VudCk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFuc2FjdGlvbl9pZCcpO1xuICAgICAgICBpZiAoIWlkKSB7XG4gICAgICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFkZV9pZCcpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZmVlX2Ftb3VudF9xdW90ZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWVfYW1vdW50X3F1b3RlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyX2lkJyksXG4gICAgICAgICAgICAndHlwZSc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0eXBlJyksXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJz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UgfTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXVsnYXNzZXRzJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBiYWxhbmNlWydhc3NldCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2lkXVsnY29kZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydmcmVlX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZF9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnb25oYW5kX2Ftb3VudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBtYXJrZXRJZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdwYWlyJyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXRJZCAmJiAhbWFya2V0IC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AgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnQ0FOQ0VMRURfVU5GSUxMRUQnIHx8IHN0YXR1cyA9PT0gJ0NBTkNFTEVEX1BBUlRJQUxMWV9GSUxMRUQnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnb3JkZXJfaWQnKSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNl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lsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2U7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYXV0aCArPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBxdWVyeSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1TSUdOQVRVUkUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlSW50ZWdlciAocmVzcG9uc2UsICdzdWNjZXNzJyk7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RlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0YmF5JyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdEJheScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnUEwnLCAnRVUnIF0sIC8vIFBvbGFuZFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYxMzItOTc4YTdiZDgtNWVjZS0xMWU3LTk1NDAtYmM5NmQxZTliYmI4LmpwZycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdGJheS5uZXQnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L0FQSS9QdWJsaWMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2JpdGJheS5uZXQvQVBJL1RyYWRpbmcvdHJhZGluZ0FwaS5waHAnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0YmF5Lm5ldC9hY2NvdW50L3RhYi1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdEJheU5ldC9BUEknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9iaXRiYXkubmV0L2VuL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VT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JTi9FVVInOiB7ICdpZCc6ICdYSU5FVVInLCAnc3ltYm9sJzogJ1hJTi9FVVInLCAnYmFzZSc6ICdYSU4nLCAncXVvdGUnOiAnRVVSJywgJ2Jhc2VJZCc6ICdYSU4nLCAncXVvdGVJZCc6ICdFVVInIH0sXG4gICAgICAgICAgICAgICAgLy8gJ1hJTi9QTE4nOiB7ICdpZCc6ICdYSU5QTE4nLCAnc3ltYm9sJzogJ1hJTi9QTE4nLCAnYmFzZSc6ICdYSU4nLCAncXVvdGUnOiAnUExOJywgJ2Jhc2VJZCc6ICdYSU4nLCAncXVvdGVJZCc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ1hJTi9CVEMnOiB7ICdpZCc6ICdYSU5CVEMnLCAnc3ltYm9sJzogJ1hJTi9CVEMnLCAnYmFzZSc6ICdYSU4nLCAncXVvdGUnOiAnQlRDJywgJ2Jhc2VJZCc6ICdYSU4nLCAncXVvdGVJZCc6ICdCVEMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMyAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDQzLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBTUUnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMS41LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzQwMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIEF0IGxlYXN0IG9uZSBwYXJhbWV0ZXIgd2Fzbid0IHNldFxuICAgICAgICAgICAgICAgICc0MDEnOiBJbnZhbGlkT3JkZXIsIC8vIEludmFsaWQgb3JkZXIgdHlwZVxuICAgICAgICAgICAgICAgICc0MDInOiBJbnZhbGlkT3JkZXIsIC8vIE5vIG9yZGVycyB3aXRoIHNwZWNpZmllZCBjdXJyZW5jaWVzXG4gICAgICAgICAgICAgICAgJzQwMyc6IEludmFsaWRPcmRlciwgLy8gSW52YWxpZCBwYXltZW50IGN1cnJlbmN5IG5hbWVcbiAgICAgICAgICAgICAgICAnNDA0JzogSW52YWxpZE9yZGVyLCAvLyBFcnJvci4gV3JvbmcgdHJhbnNhY3Rpb24gdHlwZVxuICAgICAgICAgICAgICAgICc0MDUnOiBJbnZhbGlkT3JkZXIsIC8vIE9yZGVyIHdpdGggdGhpcyBpZCBkb2Vzbid0IGV4aXN0XG4gICAgICAgICAgICAgICAgJzQwNic6IEluc3VmZmljaWVudEZ1bmRzLCAvLyBObyBlbm91Z2ggbW9uZXkgb3IgY3J5cHRvXG4gICAgICAgICAgICAgICAgLy8gY29kZSA0MDcgbm90IHNwZWNpZmllZCBhcmUgbm90IHNwZWNpZmllZCBpbiB0aGVpciBkb2NzXG4gICAgICAgICAgICAgICAgJzQwOCc6IEludmFsaWRPcmRlciwg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5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGlmICgnYmFsYW5jZXMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgICAgICBsZXQgY29kZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29kZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IGNvZGVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc1tjb2RlXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gYmFsYW5jZSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2lkXVsnYXZhaWxhYmxlJ10pO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2lkXVsnbG9ja2VkJ10pO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICAgIC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ICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21heCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdtaW4nKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZXJhZ2UnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICA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dGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcykgKyAnLmpzb24nO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbW9tZW50JzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0F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iAxLCAuLi4gfVxuICAgICAgICAgICAgICAgIC8vICAgICAgeyAnY29kZSc6IDUwMiwgJ21lc3NhZ2UnOiAnSW52YWxpZCBzaWduJyB9XG4gICAgICAgICAgICAgICAgLy8gICAgICB7ICdjb2RlJzogMCwgJ21lc3NhZ2UnOiAnb2ZmZXIgZnVuZHMgbm90IGV4Y2VlZGluZyBtaW5pbXVtcycgfVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDAgQXQgbGVhc3Qgb25lIHBhcmFtZXRlciB3YXNuJ3Qgc2V0XG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDEgSW52YWxpZCBvcmRlciB0eXBlXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDIgTm8gb3JkZXJzIHdpdGggc3BlY2lmaWVkIGN1cnJlbmNpZXNcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwMyBJbnZhbGlkIHBheW1lbnQgY3VycmVuY3kgbmFtZVxuICAgICAgICAgICAgICAgIC8vICAgICAgNDA0IEVycm9yLiBXcm9uZyB0cmFuc2FjdGlvbiB0eXBlXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDUgT3JkZXIgd2l0aCB0aGlzIGlkIGRvZXNuJ3QgZXhpc3RcbiAgICAgICAgICAgICAgICAvLyAgICAgIDQwNiBObyBlbm91Z2ggbW9uZXkgb3IgY3J5cHRvXG4gICAgICAgICAgICAgICAgLy8gICAgICA0MDggSW52YWxpZCBjdXJyZW5jeSBuYW1lXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDEgSW52YWxpZCBwdWJsaWMga2V5XG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDIgSW52YWxpZCBzaWduXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDMgSW52YWxpZCBtb21lbnQgcGFyYW1ldGVyLiBSZXF1ZXN0IHRpbWUgZG9lc24ndCBtYXRjaCBjdXJyZW50IHNlcnZlciB0aW1lXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDQgSW52YWxpZCBtZXRob2RcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUwNSBLZXkgaGFzIG5vIHBlcm1pc3Npb24gZm9yIHRoaXMgYWN0aW9uXG4gICAgICAgICAgICAgICAgLy8gICAgICA1MDYgQWNjb3VudCBsb2NrZWQuIFBsZWFzZSBjb250YWN0IHdpdGggY3VzdG9tZXIgc2VydmljZVxuICAgICAgICAgICAgICAgIC8vICAgICAgNTA5IFRoZSBCSUMvU1dJRlQgaXMgcmVxdWlyZWQgZm9yIHRoaXMgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAvLyAgICAgIDUxMCBJbnZhbGlkIG1hcmtldCBuYW1lXG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IHJlc3BvbnNlWydjb2RlJ107IC8vIGFsd2F5cyBhbiBpbnRlZ2VyXG4gICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICBpZiAoY29kZSBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4Y2VwdGlvbnNbY29kZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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ICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRpbmdGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNW0nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICczaCc6ICczaCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzEyaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnN0QnLFxuICAgICAgICAgICAgICAgICcydyc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI0NC1lMzI4YTUwYy01ZWQyLTExZTctOTQ3Yi0wNDE0MTY1NzliYjMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdGZpbmV4LnJlYWRtZS5pby92MS9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaXRmaW5leGNvbS9iaXRmaW5leC1hcGktbm9kZScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdjYW5kbGVzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kYm9vay97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kcy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RvZGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9pbmZvcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jhc2tldF9tYW5hZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWRpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L21vdmVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2V5X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbl9pbmZvcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215dHJhZGVzX2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL211bHRpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvcmVwbGFjZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xhaW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VuX2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b3RhbF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VudXNlZF90YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGllcnMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAndGFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNzUwMDAwMCwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMTggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxNTAwMDAwMCwgMC4xNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMCwgMC4xIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMDYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjA0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzc1MDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE1MDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLCAvLyB0cnVlIGZvciB0aWVyLWJhc2VkL3Byb2dyZXNzaXZlXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsIC8vIGZpeGVkIGNvbW1pc3Npb25cbiAgICAgICAgICAgICAgICAgICAgLy8gQWN0dWFsbHkgZGVwb3NpdCBmZWVzIGFyZSBmcmVlIGZvciBsYXJnZXIgZGVwb3NpdHMgKD4gJDEwMDAgVVNEIGVxdWl2YWxlbnQpXG4gICAgICAgICAgICAgICAgICAgIC8vIHRoZXNlIHZhbHVlcyBiZWxvdyBhcmUgZGVwcmVjYXRlZCwgd2Ugc2hvdWxkIG5vdCBoYXJkY29kZSBmZWVzIGFuZCBsaW1pdHMgYW55bW9yZVxuICAgICAgICAgICAgICAgICAgICAvLyB0byBiZSByZWltcGxlbWVudGVkIHdpdGggYml0ZmluZXggZnVuZGluZyBmZWVzIGZyb20gdGhlaXIgQVBJIG9yIHdlYiBlbmRwb2ludHNcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjI0Mjc5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC45OTI2OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVlXJzogMTYuOTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjE0MDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVEEnOiAyMC43NzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEuOTg1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuOTUwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS4zMDQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDI4LjE4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAxLjk5NDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkNOJzogMTAuNzkzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROQic6IDMxLjkxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAxNC45NzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkxDJzogMS40MTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05UJzogNS44OTUyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQSyc6IDEwLjg5MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLjA0MTE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiA2LjE1NDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxGJzogMS44NzUzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDMyLjMzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkcnOiAxOC42MjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlEJzogOC4wOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkEnOiAxNi42MTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVDJzogMS42NTA0LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjI0Mjc5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC45OTI2OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVlXJzogMTYuOTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjE0MDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVEEnOiAyMC43NzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEuOTg1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuOTUwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS4zMDQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyOC4xODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMS45OTQ3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JDTic6IDEwLjc5MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTkInOiAzMS45MTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMTQuOTc2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JMQyc6IDEuNDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOVCc6IDUuODk1MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTUEsnOiAxMC44OTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wNDExNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFUJzogNi4xNTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRic6IDEuODc1MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAzMi4zMzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HJzogMTguNjIyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJRCc6IDguMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5BJzogMTYuNjE3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQyc6IDEuNjUwNCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdCQ0MnOiAnQ1NUX0JDQycsXG4gICAgICAgICAgICAgICAgJ0JDVSc6ICdDU1RfQkNVJyxcbiAgICAgICAgICAgICAgICAnREFUJzogJ0RBVEEnLFxuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsIC8vIEJpdGZpbmV4IG5hbWVzIERhc2ggYXMgRFNILCBpbnN0ZWFkIG9mIERBU0hcbiAgICAgICAgICAgICAgICAnSU9TJzogJ0lPU1QnLFxuICAgICAgICAgICAgICAgICdJT1QnOiAnSU9UQScsXG4gICAgICAgICAgICAgICAgJ01OQSc6ICdNQU5BJyxcbiAgICAgICAgICAgICAgICAnUVNIJzogJ1FBU0gnLFxuICAgICAgICAgICAgICAgICdRVE0nOiAnUVRVTScsXG4gICAgICAgICAgICAgICAgJ1NORyc6ICdTTkdMUycsXG4gICAgICAgICAgICAgICAgJ1NQSyc6ICdTUEFOSycsXG4gICAgICAgICAgICAgICAgJ1lZVyc6ICdZT1lPVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2V4YWN0Jzoge1xuICAgICAgICAgICAgICAgICAgICAndGVtcG9yYXJpbHlfdW5hdmFpbGFibGUnOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gU29ycnksIHRoZSBzZXJ2aWNlIGlzIHRlbXBvcmFyaWx5IHVuYXZhaWxhYmxlLiBTZWUgaHR0cHM6Ly93d3cuYml0ZmluZXguY29tLyBmb3IgbW9yZSBpbmZvLlxuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgY291bGQgbm90IGJlIGNhbmNlbGxlZC4nOiBPcmRlck5vdEZvdW5kLCAvLyBub24tZXhpc3RlbnQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgJ05vIHN1Y2ggb3JkZXIgZm91bmQuJzogT3JkZXJOb3RGb3VuZCwgLy8gP1xuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgcHJpY2UgbXVzdCBiZSBwb3NpdGl2ZS4nOiBJbnZhbGlkT3JkZXIsIC8vIG9uIHByaWNlIDw9IDBcbiAgICAgICAgICAgICAgICAgICAgJ0NvdWxkIG5vdCBmaW5kIGEga2V5IG1hdGNoaW5nIHRoZSBnaXZlbiBYLUJGWC1BUElLRVkuJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAgICAgJ1RoaXMgQVBJIGtleSBkb2VzIG5vdCBoYXZlIHBlcm1pc3Npb24gZm9yIHRoaXMgYWN0aW9uJzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gYXV0aGVudGljYXRlZCBidXQgbm90IGF1dGhvcml6ZWRcbiAgICAgICAgICAgICAgICAgICAgJ0tleSBwcmljZSBzaG91bGQgYmUgYSBkZWNpbWFsIG51bWJlciwgZS5nLiBcIjEyMy40NTZcIic6IEludmFsaWRPcmRlciwgLy8gb24gaXNOYU4gKHByaWNlKVxuICAgICAgICAgICAgICAgICAgICAnS2V5IGFtb3VudCBzaG91bGQgYmUgYSBkZWNpbWFsIG51bWJlciwgZS5nLiBcIjEyMy40NTZcIic6IEludmFsaWRPcmRlciwgLy8gb24gaXNOYU4gKGFtb3VudClcbiAgICAgICAgICAgICAgICAgICAgJ0VSUl9SQVRFX0xJTUlUJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdOb25jZSBpcyB0b28gc21hbGwuJzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Jyb2FkJzoge1xuICAgICAgICAgICAgICAgICAgICAnSW52YWxpZCBvcmRlcjogbm90IGVub3VnaCBleGNoYW5nZSBiYWxhbmNlIGZvciAnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gd2hl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BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFN1bW1hcnkgKHBhcmFtcyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ21ha2VyJzogdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlLCAnbWFrZXJfZmVlJyksXG4gICAgICAgICAgICAndGFrZXInOiB0aGlzLnNhZmVGbG9hdCAocmVzcG9uc2UsICd0YWtlcl9mZWUnKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9sc0RldGFpbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpciddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbmltdW1fb3JkZXJfc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fb3JkZXJfc2l6ZScpLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxpbWl0c1snY29zdCddID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSAqIGxpbWl0c1sncHJpY2UnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3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FsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgdXBwZXJjYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgIC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iAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGVJZCA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF9wcmljZScpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4n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AgIGxldCBmZWVDb3N0ID0gLXRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZV9hbW91bnQnKTtcbiAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdmZWVfY3VycmVuY3knKTtcbiAgICAgICAgICAgIGlmIChmZWVDdXJyZW5jeSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbZmVlQ3VycmVuY3ldWydjb2RlJ107XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMg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BzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoY2FuY2VsZWQpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgbGV0IGV4Y2hhbmdlID0gb3JkZXJbJ3N5bWJvbCddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKGV4Y2hhbmdlIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtleGNoYW5nZV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICBsZXQgZXhjaGFuZ2UgPSBvcmRlclR5cGUuaW5kZXhPZiAoJ2V4Y2hhbmdlICcpID49IDA7XG4gICAgICAgIGlmIChleGNoYW5nZSkge1xuICAgICAgICAgICAgbGV0IHBhcnRzID0gb3JkZXJbJ3R5cGUnXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgIG9yZGVyVHlwZSA9IHBhcnRzWzFdO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAocGFyc2VGbG9hdCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLF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gICdCVEMnOiAnYml0Y29pbicsXG4gICAgICAgICAgICAnQlRHJzogJ2Jnb2xkJyxcbiAgICAgICAgICAgICdDRkknOiAnY2ZpJyxcbiAgICAgICAgICAgICdEQUknOiAnZGFpJyxcbiAgICAgICAgICAgICdEQVNIJzogJ2Rhc2gnLFxuICAgICAgICAgICAgJ0RBVEEnOiAnZGF0YWNvaW4nLFxuICAgICAgICAgICAgJ0RUSCc6ICdkdGgnLFxuICAgICAgICAgICAgJ0VETyc6ICdlaWRvbycsIC8vICMxODExXG4gICAgICAgICAgICAnRUxGJzogJ2VsZicsXG4gICAgICAgICAgICAnRU9TJzogJ2VvcycsXG4gICAgICAgICAgICAnRVRDJzogJ2V0aGVyZXVtYycsXG4gICAgICAgICAgICAnRVRIJzogJ2V0aGVyZXVtJyxcbiAgICAgICAgICAgICdFVFAnOiAnbWV0YXZlcnNlJyxcbiAgICAgICAgICAgICdGVU4nOiAnZnVuJyxcbiAgICAgICAgICAgICdHTlQnOiAnZ29sZW0nLFxuICAgICAgICAgICAgJ0lPU1QnOiAnaW9zJyxcbiAgICAgICAgICAgICdJT1RBJzogJ2lvdGEnLFxuICAgICAgICAgICAgJ0xSQyc6ICdscmMnLFxuICAgICAgICAgICAgJ0xUQyc6ICdsaXRlY29pbicsXG4gICAgICAgICAgICAnTUFOQSc6ICdtbmEnLFxuICAgICAgICAgICAgJ01JVCc6ICdtaXQnLFxuICAgICAgICAgICAgJ01UTic6ICdtdG4nLFxuICAgICAgICAgICAgJ05FTyc6ICduZW8nLFxuICAgICAgICAgICAgJ09ERSc6ICdvZGUnLFxuICAgICAgICAgICAgJ09NRyc6ICdvbWlzZWdvJyxcbiAgICAgICAgICAgICdPTU5JJzogJ21hc3RlcmNvaW4nLFxuICAgICAgICAgICAgJ1FBU0gnOiAncWFzaCcsXG4gICAgICAgICAgICAnUVRVTSc6ICdxdHVtJywgLy8gIzE4MTFcbiAgICAgICAgICAgICdSQ04nOiAncmNuJyxcbiAgICAgICAgICAgICdSRE4nOiAncmRuJyxcbiAgICAgICAgICAgICdSRVAnOiAncmVwJyxcbiAgICAgICAgICAgICdSRVEnOiAncmVxJyxcbiAgICAgICAgICAgICdSTEMnOiAncmxjJyxcbiAgICAgICAgICAgICdTQU4nOiAnc2FudGltZW50JyxcbiAgICAgICAgICAgICdTTkdMUyc6ICdzbmcnLFxuICAgICAgICAgICAgJ1NOVCc6ICdzdGF0dXMnLFxuICAgICAgICAgICAgJ1NQQU5LJzogJ3NwaycsXG4gICAgICAgICAgICAnU1RKJzogJ3N0aicsXG4gICAgICAgICAgICAnVE5CJzogJ3RuYicsXG4gICAgICAgICAgICAnVFJYJzogJ3RyeCcsXG4gICAgICAgICAgICAnVVNEJzogJ3dpcmUnLFxuICAgICAgICAgICAgJ1VTRFQnOiAndGV0aGVydXNvJywgLy8gdW5kb2N1bWVudGVkXG4gICAgICAgICAgICAnV0FYJzogJ3dheCcsXG4gICAgICAgICAgICAnWExNJzogJ3hsbScsXG4gICAgICAgICAgICAnWE1SJzogJ21vbmVybycsXG4gICAgICAgICAgICAnWFJQJzogJ3JpcHBsZScsXG4gICAgICAgICAgICAnWFZHJzogJ3h2ZycsXG4gICAgICAgICAgICAnWU9ZT1cnOiAneW95b3cnLFxuICAgICAgICAgICAgJ1pFQyc6ICd6Y2FzaCcsXG4gICAgICAgICAgICAnWlJYJzogJ3pyeCcsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjdXJyZW5jeSBpbiBuYW1lcylcbiAgICAgICAgICAgIHJldHVybiBuYW1lc1tjdXJyZW5jeV07XG4gICAgICAgIHRocm93IG5ldyBOb3RTdXBwb3J0ZWQgKHRoaXMuaWQgKyAnICcgKyBjdXJyZW5jeSArICcgbm90IHN1cHBvcnRlZCBmb3Igd2l0aGRyYXdhbCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZURlcG9zaXRBZGRyZXNzIChjdXJyZW5jeSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3Bv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gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAndjInKSB7XG4gICAgICAgICAgICByZXF1ZXN0ID0gJy8nICsgYXBpICsgcmVxdWVzdDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSAnLycgKyB0aGlzLnZlcnNpb24gKyByZXF1ZXN0O1xuICAgICAgICB9XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoKGFwaSA9PT0gJ3B1YmxpYycpIHx8IChwYXRoLmluZGV4T2YgKCcvaGlzdCcpID49IDApKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBsZXQgc3VmZml4ID0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB1cmwgKz0gc3VmZml4O1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgKz0gc3VmZml4O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgIC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GlhbEtleSkgPj0gMClcbiAgICAgICAgICAgICAgICByZXR1cm4gcGFydGlhbEtleTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICBjb25zdCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgIGVsc2UgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UgPSByZXNwb25zZVsnZXJyb3InXTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7IC8vIG1hbGZvcm1lZCAodG8gb3VyIGtub3dsZWRnZSkgcmVzcG9uc2VcbiAgICAgICAgICAgICAgICBjb25zdCBleGFjdCA9IHRoaXMuZXhjZXB0aW9uc1snZXhhY3QnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSBpbiBleGFjdClcbiAgICAgICAgICAgICAgICAgICAgdGhyb3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lci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2JpdGZpbmV4MicsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXRmaW5leCB2MicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1ZHJyxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVMaW1pdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZWRpdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYyNDQtZTMyOGE1MGMtNWVkMi0xMWU3LTk0N2ItMDQxNDE2NTc5YmIzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjIvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YxJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYXRmb3JtL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS97cHJlY2lzaW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9QMycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9vay97c3ltYm9sfS9SMCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS97c2lkZX0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9sb25nL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vc2hvcnQvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYWxjL3RyYWRlL2F2ZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivb3JkZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlci97c3ltYm9sfTp7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9vZmZlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvbG9hbnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy90cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2luZm8vbWFyZ2luL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9mdW5kaW5nL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbW92ZW1lbnRzL3tjdXJyZW5jeX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3N0YXRzL3BlcmY6e3RpbWVmcmFtZX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3NldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3t0eXBlfTp7c3ltYm9sfTp7cHJpY2V9L2RlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9jYWxjL29yZGVyL2F2YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbGVkZ2Vycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9UJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVE0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQSyc6IDkuMjc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVQnOiA5LjA4ODMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05UJzogOC4yODgxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDE0LjMwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMy4yNDI4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lZVyc6IDE4LjA1NSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgaXNGaWF0IChjb2RlKSB7XG4gICAgICAgIGxldCBmaWF0ID0ge1xuICAgICAgICAgICAgJ1VTRCc6ICdVU0QnLFxuICAgICAgICAgICAgJ0VVUic6ICdFVVInLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gKGNvZGUgaW4gZmlhdCk7XG4gICAgfVxuXG4gICAgZ2V0Q3VycmVuY3lJZCAoY29kZSkge1xuICAgICAgICBsZXQgaXNGaWF0ID0gdGhpcy5pc0ZpYXQgKGNvZGUpO1xuICAgICAgICBsZXQgcHJlZml4ID0gaXNGaWF0ID8gJ2YnIDogJ3QnO1xuICAgICAgICByZXR1cm4gcHJlZml4ICsgY29kZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMudjFHZXRTeW1ib2xzRGV0YWlscyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGlkID0gJ3QnICsgaWQ7XG4gICAgICAgICAgICBiYXNlSWQgPSB0aGlzLmdldEN1cnJlbmN5SWQgKGJhc2VJZCk7XG4gICAgICAgICAgICBxdW90ZUlkID0gdGhpcy5nZXRDdXJyZW5jeUlkIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydwcmljZV9wcmVjaXNpb24nXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4aW11bV9vcmRlcl9zaXplJyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGltaXRzWydjb3N0J10gPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGxpbWl0c1snYW1vdW50J11bJ21pbiddICogbGltaXRzWydwcmljZSddWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QXV0aFJXYWxsZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZVR5cGUgPSB0aGlzLnNhZmVTdHJpbmcgKHBhcmFtcywgJ3R5cGUnLCAnZXhjaGFuZ2UnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGFjY291bnRUeXBlID0gYmFsYW5jZVswXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbMV07XG4gICAgICAgICAgICBsZXQgdG90YWwgPSBiYWxhbmNlWzJdO1xuICAgICAgICAgICAgbGV0IGF2YWlsYWJsZSA9IGJhbGFuY2VbNF07XG4gICAgICAgICAgICBpZiAoYWNjb3VudFR5cGUgPT09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WzBdID09PSAndCcpXG4gICAgICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gY3VycmVuY3kuc2xpY2UgKDEpO1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodXBwZXJjYXNlKTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBhdmFpbGFibGU7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICAgICAgICAgIGlmIChhY2NvdW50WydmcmVlJ10pXG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbFByZWNpc2lvbiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6ICdSMCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbm9uY2UnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJib29rLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcmJvb2tbaV07XG4gICAgICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsxXTtcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsyXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gKGFtb3VudCA+IDApID8gJ2JpZHMnIDogJ2Fza3MnO1xuICAgICAgICAgICAgYW1vdW50ID0gTWF0aC5hYnMgKGFtb3VudCk7XG4gICAgICAgICAgICByZXN1bHRbc2lkZV0ucHVzaCAoWyBwcmljZSwgYW1vdW50IF0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdFsnYmlkcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYmlkcyddLCAwLCB0cnVlKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRb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9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCBbIGlkLCB0aW1lc3RhbXAsIGFtb3VudCwgcHJpY2UgXSA9IHRyYWRlO1xuICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPCAwKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICBpZiAoYW1vdW50IDwgMCkge1xuICAgICAgICAgICAgYW1vdW50ID0gLWFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gMTIwLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAg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VkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL2FwaScgKyAnLycgKyByZXF1ZXN0ICsgbm9uY2UgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMzg0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdiZngtbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYmZ4LWFwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdiZngtc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChyZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb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4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRmbHllcicsXG4gICAgICAgICAgICAnbmFtZSc6ICdiaXRGbHllcicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0pQJyxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLCAvLyB0aGVpciBub25jZS10aW1lc3RhbXAgaXMgaW4gc2Vjb25kcy4uLlxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA1MTY0Mi01NjE1NDE4Mi02NjBlLTExZTctOWIwZC02MDQyZDFlNmVkZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZseWVyLmpwJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRmbHllci5qcC9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzL3VzYScsIC8vIG5ldyAod2lwKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMvZXUnLCAgLy8gbmV3ICh3aXApXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0cycsICAgICAvLyBvciAnbWFya2V0cydcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZCcsICAgICAgIC8vIC4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0aGVhbHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRib2FyZHN0YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGF0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbGFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRhZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5pbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5vdXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYW5rYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y2hpbGRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBhcmVudG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0dHJhZGluZ2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kcGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbHBhcmVudG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxhbGxjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IGpwX21hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEdldG1hcmtldHMgKCk7XG4gICAgICAgIGxldCB1c19tYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRtYXJrZXRzVXNhICgpO1xuICAgICAgICBsZXQgZXVfbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0bWFya2V0c0V1ICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHRoaXMuYXJyYXlDb25jYXQgKGpwX21hcmtldHMsIHVzX21hcmtldHMpO1xuICAgICAgICBtYXJrZXRzID0gdGhpcy5hcnJheUNvbmNhdCAobWFya2V0cywgZXVfbWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncHJvZHVjdF9jb2RlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbnVtQ3VycmVuY2llcyA9IGN1cnJlbmNpZXMubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKG51bUN1cnJlbmNpZXMgPT09IDEpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gc3ltYm9sLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHN5bWJvbC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG51bUN1cnJlbmNpZXMgPT09IDIpIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1swXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBiYXNlID0gY3VycmVuY2llc1sxXTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IGN1cnJlbmNpZXNbMl07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEdldGJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHt9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHJlc3BvbnNlLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHJlc3BvbnNlW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYWNjb3VudFsnY3VycmVuY3lfY29kZSddO1xuICAgICAgICAgICAgYmFsYW5jZXNbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICA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ICAgICAgIGxldCBpZCA9IHNpZGUgKyAnX2NoaWxkX29yZGVyX2FjY2VwdGFuY2VfaWQnO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVtpZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2Ygb3JkZXIgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgb3JkZXIgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnY2hpbGRfb3JkZXJfYWNjZXB0YW5jZV9pZCcpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydleGVjX2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ3NpemUnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7X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AodHlwZW9mIG1hcmtldElkICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZUNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0b3RhbF9jb21taXNzaW9uJyk7XG4gICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2NoaWxkX29yZGVyX2FjY2VwdGFuY2VfaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFx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V0IHJlcXVlc3QgPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJylcbiAgICAgICAgICAgIHJlcXVlc3QgKz0gJ21lLyc7XG4gICAgICAgIHJlcXVlc3QgKz0gcGF0aDtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIG5vbmNlLCBtZXRob2QsIHJlcXVlc3QgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLVRJTUVTVEFNUCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdBQ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tcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNTk3MTc3LWVhODAwMTcyLTlkNWUtMTFlNy04MDRjLWI5ZDRmYTliNTZiMC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYml0aHVtYi5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRodW1iLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRodW1iLmNvbS91MS9VUzEyNycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWNlbnRfdHJhbnNhY3Rpb25zL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9hY2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vd2FsbGV0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby91c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvcGxhY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vb3JkZXJfZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J0Y193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9rcndfZGVwb3NpdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL21hcmtldF9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL21hcmtldF9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjE1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsICgpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzWydkYXRhJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChpZCAhPT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgICAgICdsb3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm9CYWxhbmNlICh0aGlzLmV4d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YW5nZSAvIG9wZW4gKiAxMDAsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc3VtIChvcGVuLCBjbG9zZSkgLyAyLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogYmFzZVZvbHVtZSAqIHZ3YXAsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQWxsIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSByZXNwb25zZVsnZGF0YSddWydkYXRlJ107XG4gICAgICAgIGxldCB0aWNrZXJzID0gdGhpcy5vbWl0IChyZXNwb25zZVsnZGF0YSddLCAnZGF0ZScpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB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2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFJlY2VudFRyYW5zYWN0aW9uc0N1cnJlbmN5ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgICAgICAnY291bnQnOiAxMDAsIC8vIG1heCA9IDEwMFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydkYXRhJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0VHJhZGUnO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0Jykge1xuICAgICAgICAgICAgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnb3JkZXJfY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ1BheW1lbnRfY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ3VuaXRzJzogYW1vdW50LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICd0eXBlJzogKHNpZGUgPT09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbWV0aG9kICs9ICdQbGFjZSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgICAgICd1bml0cyc6IGFtb3VudCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBtZXRob2QgKz0gJ01hcmtldCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnb3JkZXJfaWQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ29yZGVyX2lkJ10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgc2lkZV9pbl9wYXJhbXMgPSAoJ3NpZGUnIGluIHBhcmFtcyk7XG4gICAgICAgIGlmICghc2lkZV9pbl9wYXJhbXMpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIgcmVxdWlyZXMgYSBzaWRlIHBhcmFtZXRlciAoc2VsbCBvciBidXkpIGFuZCBhIGN1cnJlbmN5IHBhcmFtZXRl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yZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdlbmRwb2ludCc6IGVuZHBvaW50LFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IGVuZHBvaW50ICsgJ1xcMCcgKyBib2R5ICsgJ1xcMCcgKyBub25jZTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZTY0ID0gdGhpcy5kZWNvZGUgKHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChzaWduYXR1cmUpKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FwaS1TaWduJzogc2lnbmF0dXJlNjQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAgICAgJ0FwaS1Ob25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKH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ldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0bGlzaCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXRsaXNoJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdHQicsICdFVScsICdSVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxaCc6IDM2MDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjI3NS1kY2ZjNmMzMC01ZWQzLTExZTctODM5ZC0wMGE4NDYzODVkMGIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYml0bGlzaC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0bGlzaC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRsaXNoLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gYW5vbnltb3VzIDAuMyUsIHZlcmlmaWVkIDAuMiVcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHNfb3BlcmF0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGVzX2J5X2lkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9iY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RlbXBsYXRlX3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjY291bnRzX29wZXJhdGlvbnNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY3RpdmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2Jjb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV9tYXRjaGVzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudF9tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1fY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVzaWduJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWduaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25vdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19ieV9pZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnRFNIJzogJ0RBU0gnLFxuICAgICAgICAgICAgICAgICdYREcnOiAnRE9HRScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21heCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdtaW4nKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgIC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ICAgICAgIH1cbiAgICAgICAgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2Z1bmRzJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydob2xkZWQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RTaWduaW4gKHtcbiAgICAgICAgICAgICdsb2dpbic6IHRoaXMubG9naW4sXG4gICAgICAgICAgICAncGFzc3dkJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgY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RpZCBub3QgZG9jdW1lbnQgb3RoZXIgdHlwZXMuLi5cbiAgICAgICAgICAgIHRocm93IG5ldyBOb3RTdXBwb3J0ZWQgKHRoaXMuaWQgKyAnIGN1cnJlbnRseSBzdXBwb3J0cyBCVEMgd2l0aGRyYXdhbHMgb25seSwgdW50aWwgdGhleSBkb2N1bWVudCBvdGhlciBjdXJyZW5jaWVzLi4uJyk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3kudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAoYW1vdW50KSxcbiAgICAgICAgICAgICdhY2NvdW50JzogYWRkcmVzcyxcbiAgICAgICAgICAgICdwYXltZW50X21ldGhvZCc6ICdiaXRjb2luJywgLy8gdGhleSBkaWQgbm90IGRvY3VtZW50IG90aGVyIHR5cGVzLi4uXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydtZXNzYWdlX2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgI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tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGJpdG1hcmtldCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0bWFya2V0JyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdE1hcmtldCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnUEwnLCAnRVUnIF0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnOTBtJzogJzkwbScsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3ZCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvUExOJzogeyAnaWQnOiAnQkNDUExOJywgJ3N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cbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40NSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjQ1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuNDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuNDMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuNDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuNDEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjQwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC4zOSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTkuOTksIDAuMzggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjM3IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuMzYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OS45OSwgMC4zNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjM0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMzMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OTkuOTksIDAuMzIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMzEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC45IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC44IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OS45OSwgMC43IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OS45OSwgMC40IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTk5Ljk5LCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMiwgLy8gU0VQQS4gVHJhbnNmZXIgSU5UIChTSEEpOiA1IEVVUlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDAsXG4gICA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QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID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nMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL3Rlc3RuZXQuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjMxOS1mNjUzYzZlNi01ZWQ0LTExZTctOTMzZC1mMGJjMzY5OWFlOGYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmJpdG1leC5jb20vYXBwL2FwaU92ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9CaXRNRVgvYXBpLWNvbm5lY3RvcnMvdHJlZS9tYXN0ZXIvb2ZmaWNpYWwtaHR0cCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tL2FwcC9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYW5ub3VuY2VtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQvdXJnZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9hY3RpdmVBbmRJbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUludGVydmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9jb21wb3NpdGVJbmRleCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudC9pbmRpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN1cmFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlYWRlcmJvYXJkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXF1aWRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJCb29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2svTDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2NoZW1hJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEvd2Vic29ja2V0SGVscCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2V0dGxlbWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idWNrZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY2hhbm5lbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQvY29ubmVjdGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGVjdXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbi90cmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25vdGlmaWNhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FmZmlsaWF0ZVN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jaGVja1JlZmVycmFsQ29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21hcmdpbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9taW5XaXRoZHJhd2FsRmVlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9kaXNhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXkvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYnVsaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsQWxsQWZ0ZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2Nsb3NlUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2lzb2xhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9yaXNrTGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3RyYW5zZmVyTWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NhbmNlbFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVtYWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbmZpcm1FbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybVdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGlzYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0QWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByZWZlcmVuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3JlcXVlc3RFbmFibGVURkEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGlLZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5zdHJ1bWVudEFjdGl2ZUFuZEluZGljZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0ZSddICE9PSAnVW5saXN0ZWQnKTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsndW5kZXJseWluZyddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdHlwZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBmdXR1cmUgPSBmYWxzZTtcbiAgICAgICAgICAgIGxldCBwcmVkaWN0aW9uID0gZmFsc2U7XG4gICAgICAgICAgICBsZXQgYmFzZXF1b3RlID0gYmFzZSArIHF1b3RlO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzd2FwID0gKGlkID09PSBiYXNlcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKHN3YXApIHtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ3N3YXAnO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaWQuaW5kZXhPZiAoJ0JfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAncHJlZGljdGlvbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWFya2V0Wydsb3RTaXplJ10pXG4gICAgICAgICAgICAgICAgcHJlY2lzaW9uWydhbW91bnQnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAodGhpcy50cnVuY2F0ZV90b19zdHJpbmcgKG1hcmtldFsnbG90U2l6ZSddLCAxNikpO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsndGlja1NpemUnXSlcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ3ByaWNlJ10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKHRoaXMudHJ1bmNhdGVfdG9fc3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10sIDE2KSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnbWF4T3JkZXJRdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsndGlja1NpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heFByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ3Rha2VyRmVlJ10sXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydtYWtlckZlZSddLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydtYXJnaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09PSAnQlRDJykge1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGFjY291bnRbJ2ZyZWUnXSAqIDAuMDAwMDAwMDE7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGFjY291bnRbJ3RvdGFsJ10gKiAwLjAwMDAwMDAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnZGVwdGgnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlckJvb2tMMiAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ25vbmNlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGxldCBvID0gMDsgbyA8IG9yZGVyYm9vay5sZW5ndGg7IG8rKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJib29rW29dO1xuICAgICAgICAgICAgbGV0IHNpZGUgPSAob3JkZXJbJ3NpZGUnXSA9PT0gJ1NlbGwnKSA/ICdhc2tzJyA6ICdiaWRzJztcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsnc2l6ZSddO1xuICAgICAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICByZXN1bHRbc2lkZV0ucHVzaCAoWyBwcmljZSwgYW1vdW50IF0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdFsnYmlkcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYmlkcyddLCAwLCB0cnVlKTtcbiAgICAgICAgcmVzdWx0Wydhc2tzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0Wydhc2tzJ10sIDApO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAg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AgICAgIGxldCByZW1haW5pbmcgPSBNYXRoLm1heCAoYW1vdW50IC0gZmlsbGVkLCAwLjApO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcklEJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsnb3JkVHlwZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWR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cy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWyd0cmFuc2FjdElEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSA0MjkpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keSkge1xuICAgICAgICAgICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHJlc3BvbnNlWydlcnJvciddKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2VbJ2Vycm9yJ10sICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtZXNzYWdlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgQVBJIEtleS4nKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0dWIgY29kZSwgbmVlZCBwcm9wZXIgaGFuZGxpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ1BVVCcpXG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHF1ZXJ5ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHF1ZXJ5O1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgcXVlcnkgKyBub25jZTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJyB8fCBtZXRob2QgPT09ICdQVVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdhcGktbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdhcGktc2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2UgPSByZXF1aXJlICgnLi9iYXNlL0V4Y2hhbmdlJyk7XG5jb25zdCB7IEV4Y2hhbmdlRXJyb3IsIEludmFsaWROb25jZSwgQXV0aGVudGljYXRpb25FcnJvciB9ID0gcmVxdWlyZSAoJy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0cHM6Ly9iaXRzby5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYml0c28uY29tL2ZlZXM/bD1lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F2YWlsYWJsZV9ib29rcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5ncy97ZmlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19kZXN0aW5hdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAna3ljX2RvY3VtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVkZ2VyL2Z1bmRpbmdzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvd2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ214X2JhbmtfY29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzL3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL3t3aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWJpdF9jYXJkX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfbnVtYmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV92ZXJpZmljYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NwZWlfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcwMjAxJzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gSW52YWxpZCBOb25jZSBvciBJbnZhbGlkIENyZWRlbnRpYWxzXG4gICAgICAgICAgICAgICAgJzEwNCc6IEludmFsaWROb25jZSwgLy8gQ2Fubm90IHBlcmZvcm0gcmVxdWVzdCAtIG5vbmNlIG11c3QgYmUgaGlnaGVyIHRoYW4gMTUyMDMwNzIwMzcyNDIzN1xuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEF2YWlsYWJsZUJvb2tzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0c1sncGF5bG9hZCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncGF5bG9hZCddW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wydib29rJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQudG9VcHBlckNhc2UgKCkucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5pbXVtX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluaW11bV9wcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heGltdW1fcHJpY2UnKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbmltdW1fdmFsdWUnKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhpbXVtX3ZhbHVlJyksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IGxpbWl0c1snYW1vdW50J11bJ21pbiddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncGF5bG9hZCddWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydsb2NrZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsndG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dX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lmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ21ham9yJyk7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGFtb3VudCA9IE1hdGguYWJzIChhbW91bnQpO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZXNfYW1vdW50Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdmZWVzX2N1cnJlbmN5Jyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGZlZUN1cnJlbmN5ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmIChmZWVDdXJyZW5jeSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2ZlZUN1cnJlbmN5XVsnY29kZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdtaW5vcicpO1xuICAgICAgICBpZiAodHlwZW9mIGNvc3QgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgY29zdCA9IE1hdGguYWJzIChjb3N0KTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IG9yZGVySWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnb2lkJyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdib29rJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaX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gICAgICAgICAgICAgICBlbmRwb2ludCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgZW5kcG9pbnQ7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSBbIG5vbmNlLCBtZXRob2QsIGVuZHBvaW50IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0ICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5hcGlLZXkgKyAnOicgKyBub25jZSArICc6JyArIHNpZ25hdHVyZTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiAnQml0c28gJyArIGF1dGgsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ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zdWNjZXNzID09PSAnMScpKVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvciA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZXJyb3IgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAoZXJyb3IsICdjb2RlJyk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID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CksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRzdGFtcCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXRzdGFtcCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0dCJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3Nzg2Mzc3LThjOGFiNTdlLTVmZTktMTFlNy04ZWE0LTJiMDViNmJjY2VlYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyX2hvdXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nLXBhaXJzLWluZm8vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY2hfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JjaF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy9hbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwvbWFya2V0L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y193aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbHRjX2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAneHJwX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4cnBfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsLXJlcXVlc3RzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9vcGVuLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uX2FkZHJlc3MvbmV3LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjEnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0aWVycyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4yNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwLCAwLjI0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjIyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwLCAwLjIwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNjAwMDAwLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAsIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDAsIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMSwgMC4xMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuOTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAyNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGluZ1BhaXJzSW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBiYXNlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBxdW90ZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2xJZCA9IGJhc2VJZCArICdfJyArIHF1b3RlSWQ7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3VybF9zeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZV9kZWNpbWFscyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsnY291bnRlcl9kZWNpbWFscyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwYXJ0cyA9IG1hcmtldFsnbWluaW11bV9vcmRlciddLnNwbGl0ICgnICcpO1xuICAgICAgICAgICAgbGV0IGNvc3QgPSBwYXJ0c1swXTtcbiAgICAgICAgICAgIC8vIGxldCBbIGNvc3QsIGN1cnJlbmN5IF0gPSBtYXJrZXRbJ21pbmltdW1fb3JkZXInXS5zcGxpdCAoJyAnKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0Wyd0cmFkaW5nJ10gPT09ICdFbmFibGVkJyk7XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2xJZCc6IHN5bWJvbElkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChjb3N0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7X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ZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGdldE1hcmtldEZyb21UcmFkZSAodHJhZGUpIHtcbiAgICAgICAgdHJhZGUgPSB0aGlzLm9taXQgKHRyYWRlLCBbXG4gICAgICAgICAgICAnZmVlJyxcbiAgICAgICAgICAgICdwcmljZScsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnLFxuICAgICAgICAgICAgJ3RpZCcsXG4gICAgICAgICAgICAndHlwZScsXG4gICAgICAgICAgICAnb3JkZXJfaWQnLFxuICAgICAgICAgICAgJ3NpZGUnLFxuICAgICAgICBdKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5SWRzID0gT2JqZWN0LmtleXMgKHRyYWRlKTtcbiAgICAgICAgbGV0IG51bUN1cnJlbmN5SWRzID0gY3VycmVuY3lJZHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtQ3VycmVuY3lJZHMgPiAyKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGdldE1hcmtldEZyb21UcmFkZSB0b28gbWFueSBrZXlzOiAnICsgdGhpcy5qc29uIChjdXJyZW5jeUlkcykgKyAnIGluIHRoZSB0cmFkZTogJyArIHRoaXMuanNvbiAodHJhZGUpKTtcbiAgICAgICAgaWYgKG51bUN1cnJlbmN5SWRzID09PSAyKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSBjdXJyZW5jeUlkc1swXSArIGN1cnJlbmN5SWRzWzFdO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIG1hcmtldElkID0gY3VycmVuY3lJZHNbMV0gKyBjdXJyZW5jeUlkc1swXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpb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RlJyk7XG4gICAgICAgIGxldCBvcmRlcklkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyX2lkJyk7XG4gICAgICAgIGlmICh0eXBlb2Ygb3JkZXJJZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIHNpZGUgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9IHRoaXMuc2FmZUludGVnZXIgKHRyYWRlLCAndHlwZScpO1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09PSAwKVxuICAgICAgICAgICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKTtcbiAgICAgICAgaWQgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnaWQnLCBpZCk7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAodHJhZGUpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgaWYgKGtleXNbaV0uaW5kZXhPZiAoJ18nKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IGtleXNbaV0ucmVwbGFjZSAoJ18nLCAnJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIC8vIGlmIHRoZSBtYXJrZXQgaXMgc3RpbGwgbm90IGRlZmluZWRcbiAgICAgICAgICAgIC8vIHRyeSB0byBkZWR1Y2UgaXQgZnJvbSB1c2VkIGtleXNcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmdldE1hcmtldEZyb21UcmFkZSAodHJhZGUpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyk7XG4gICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgbWFya2V0WydzeW1ib2xJZCddLCBwcmljZSk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsIG1hcmtldFsnYmFzZUlkJ10sIGFtb3VudCk7XG4gICAgICAgICAgICBmZWVDdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgICAgICB9LFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYW5zYWN0aW9uc1BhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lJzogJ2hvdXInLFxuICAgICAgIC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07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgdHJhZGVzID0gW107XG4gICAgICAgIGxldCB0cmFuc2FjdGlvbnMgPSB0aGlzLnNhZmVWYWx1ZSAob3JkZXIsICd0cmFuc2FjdGlvbnMnKTtcbiAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIHRyYW5zYWN0aW9ucyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFuc2FjdGlvbnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdGhpcy5wYXJzZVRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAgICAgICAgIH0sIHRyYW5zYWN0aW9uc1tpXSksIG1hcmtldCk7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCArPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ICs9IHRyYWRlWydmZWUnXVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgY29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVsnY29zdCddO1xuICAgICAgICAgICAgICAgICAgICB0cmFkZXMucHVzaCAodHJhZGUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAoKHN0YXR1cyA9PT0gJ0luIFF1ZXVlJykgfHwgKHN0YXR1cyA9PT0gJ09wZW4nKSlcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgZWxzZSBpZiAoc3RhdHVzID09PSAnRmluaXNoZWQnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBhbW91bnQgPSBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmdldE1hcmtldEZyb21UcmFkZXMgKHRyYWRlcyk7XG4gICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBjb3N0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChmaWxsZWQgPiAwKVxuICAgICAgICAgICAgICAgIHByaWNlID0gY29zdCAvIGZpbGxlZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0ge1xuICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVk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ICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICd0YWcnOiB0YWcsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjb2RlLCBhbW91bnQsIGFkZHJlc3MsIHRhZyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpO1xuICAgICAgICBpZiAodGhpcy5pc0ZpYXQgKGNvZGUpKVxuICAgICAgICAgICAgdGhyb3cgbmV3IE5vdFN1cHBvcnRlZCAodGhpcy5pZCArICcgZmlhdCB3aXRoZHJhdygpIGZvciAnICsgY29kZSArICcgaXMgbm90IGltcGxlbWVudGVkIHlldCcpO1xuICAgICAgICBsZXQgbmFtZSA9IHRoaXMuZ2V0Q3VycmVuY3lOYW1lIChjb2RlKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdjEgPSAoY29kZSA9PT0gJ0JUQycpO1xuICAgICAgICBsZXQgbWV0aG9kID0gdjEgPyAndjEnIDogJ3ByaXZhdGUnOyAvLyB2MSBvciB2MlxuICAgICAgICBtZXRob2QgKz0gJ1Bvc3QnICsgdGhpcy5jYXBpdGFsaXplIChuYW1lKSArICdXaXRoZHJhd2FsJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gcGFyYW1zO1xuICAgICAgICBpZiAoY29kZSA9PT0gJ1hSUCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdGFnICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ2Rlc3RpbmF0aW9uX3RhZyddID0gdGFnO1xuICAgICAgICAgICAgICA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XMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmVuY29kZSAodGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3N0YXR1cycpO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PT0gJ2Vycm9yJykge1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvZGUgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlID09PSAnQVBJMDAwNScpXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgaW52YWxpZCBzaWduYXR1cmUsIHVzZSB0aGUgdWlkIGZvciB0aGUgbWFpbiBhY2NvdW50IGlmIHlvdSBoYXZlIHN1YmFjY291bnRzJyk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwMjUsICd0YWtlcic6IDAuMDAyNSB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnYnRjZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicsICdtYWtlcic6IDAuMDAyNSwgJ3Rha2VyJzogMC4wMDI1IH0sXG4gICAgICAgICAgICAgICAgJ0VVUi9VU0QnOiB7ICdpZCc6ICdldXJ1c2QnLCAnc3ltYm9sJzogJ0VVUi9VU0QnLCAnYmFzZSc6ICdFVVInLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDI1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnWFJQL1VTRCc6IHsgJ2lkJzogJ3hycHVzZCcsICd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pcy5wYXJzZTg2MDEgKHRyYWRlWydkYXRldGltZSddKTtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZXRpbWUnXSkgKiAxMDAwO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0eXBlJ10gPT09IDApID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCBvcmRlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl9pZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlciA9IHRyYWRlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBpZiAoJ2N1cnJlbmN5X3BhaXInIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBpZiAodHJhZGVbJ2N1cnJlbmN5X3BhaXInXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnY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ZiAoc3ltYm9sICE9PSAnQlRDL1VTRCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgdjEgc3VwcG9ydHMgQlRDL1VTRCBvcmRlcnMgb25seScpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyKSB7XG4gICAgICAgIGlmICgob3JkZXJbJ3N0YXR1cyddID09PSAnUXVldWUnKSB8fCAob3JkZXJbJ3N0YXR1cyddID09PSAnT3BlbicpKVxuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PT0gJ0ZpbmlzaGVkJylcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgcmV0dXJuIG9yZGVyWydzdGF0dXMnXTtcbiAgICB9XG5cbiAgICBhc3luY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mRlciBpcyBub3QgaW1wbGVtZW50ZWQgeWV0Jyk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5lbmNvZGUgKHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbm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oTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ29uZU1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJ2ZpdmVNaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAndGhpcnR5TWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnaG91cicsXG4gICAgICAgICAgICAgICAgJzFkJzogJ2RheScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjM1Mi1jZjBiM2MyNi01ZWQ1LTExZTctODJiNy1mMzgyNmI3YTk3ZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnbWFya2V0JzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3YyJzogJ2h0dHBzOi8vYml0dHJleC5jb20vYXBpL3YyLjAvcHViJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubnBtanMub3JnL3BhY2thZ2Uvbm9kZS5iaXR0cmV4LmFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0dHJleC5jb20vRmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuYml0dHJleC5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwMTk5NjUxLVdoYXQtZmVlcy1kb2VzLUJpdHRyZXgtY2hhcmdlLScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd2Mic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL0dldEJUQ1ByaWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0VGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRMYXRlc3RUaWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNYXJrZXRzL0dldE1hcmtldFN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdhY2NvdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JERCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgLy8gJ0NhbGwgdG8gQ2FuY2VsIHdhcyB0aHJvdHRsZWQuIFRyeSBhZ2FpbiBpbiA2MCBzZWNvbmRzLic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgIC8vICdDYWxsIHRvIEdldEJhbGFuY2VzIHdhcyB0aHJvdHRsZWQuIFRyeSBhZ2FpbiBpbiA2MCBzZWNvbmRzLic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgICdBUElTSUdOX05PVF9QUk9WSURFRCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0lOVkFMSURfU0lHTkFUVVJFJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnSU5WQUxJRF9DVVJSRU5DWSc6IEV4Y2hhbmdlRXJy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ByaWNlJ10pO1xuICAgIH1cblxuICAgIGZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGZlZSkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoZmVlKSwgdGhpcy5tYXJrZXRzW3N5bWJvbF1bJ3ByZWNpc2lvbiddWydwcmljZSddKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnYyR2V0TWFya2V0c0dldE1hcmtldFN1bW1hcmllcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJlc3BvbnNlWydyZXN1bHQnXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHJlc3BvbnNlWydyZXN1bHQnXVtpXVsnTWFya2V0J107XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydJc0FjdGl2ZSddIHx8IG1hcmtldFsnSXNBY3RpdmUnXSA9PT0gJ3RydWUnO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pblRyYWRlU2l6ZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTW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2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAocGFyYW1zWyd0eXBlJ10gPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgICAgICAgICAnYnV5JzogcmVzcG9uc2VbJ3Jlc3VsdCddLFxuICAgICAgICAgICAgICAgICAgICAnc2VsbCc6IFtdLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHBhcmFtc1sndHlwZSddID09PSAnc2VsbCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiBbXSxcbiAgICAgICAgICAgICAgICAgICAgJ3NlbGwnOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcsICdSYXRlJywgJ1F1YW50aXR5Jyk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNhZmVTdHJpbmcgKHRpY2tlciwgJ1RpbWVTdGFtcCcpO1xuICAgICAgICBsZXQgaXNvODYwMSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICBpZiAodGltZXN0YW1wLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICBpc284NjAxID0gdGhpcy5pc284NjAxICh0aW1lc3RhbXApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJldmlvdXMgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnUHJldkRheScpO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMYXN0Jyk7XG4gICAgICAgIGxldCBjaGFuZ2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBwZXJjZW50YWdlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGxhc3QgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmV2aW91cyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBjaGFuZ2UgPSBsYXN0IC0gcHJldmlvdXM7XG4gICAgICAgICAgICAgICAgaWYgKHByZXZpb3VzID4gMClcbiAgICAgICAgICAgICAgICAgICAgcGVyY2VudGFnZSA9IChjaGF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ICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IGN1cnJlbmN5WydDb2luVHlwZSddLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ0N1cnJlbmN5TG9uZyddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBjdXJyZW5jeVsnSXNBY3RpdmUnXSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnVHhGZWUnKSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydUeEZlZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJpZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBl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9IHRoaXMucGFyc2VPcmRlclN0YXR1cyAob3JkZXJbJ1N0YXR1cyddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdFeGNoYW5nZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG9yZGVyWydFeGNoYW5nZSddO1xuICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSB0aGlzLnBhcnNlU3ltYm9sIChtYXJrZXRJZCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ09wZW5lZCcgaW4gb3JkZXIpXG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ09wZW5lZCddICsgJyswMDowMCcpO1xuICAgICAgICBpZiAoJ0NyZWF0ZWQnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydDcmVhdGVkJ10gKyAnKzAwOjAwJyk7XG4gICAgICAgIGxldCBsYXN0VHJhZGVUaW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgoJ1RpbWVTdGFtcCcgaW4gb3JkZXIpICYmICh0eXBlb2Ygb3JkZXJbJ1RpbWVTdGFtcCddICE9PSAndW5kZWZpbmVkJykpXG4gICAgICAgICAgICBsYXN0VHJhZGVUaW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ1RpbWVTdGFtcCddICsgJyswMDowMCcpO1xuICAgICAgICBpZiAoKCdDbG9zZWQnIGluIG9yZGVyKSAmJiAodHlwZW9mIG9yZGVyWydDbG9zZWQnXSAhPT0gJ3VuZGVmaW5lZCcpKVxuICAgICAgICAgICAgbGFzdFRyYWRlVGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydDbG9zZWQnXSArICcrMDA6MDAnKTtcbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gbGFzdFRyYWRlVGltZXN0YW1wO1xuICAgICAgICBsZXQgaXNvODYwMSA9ICh0eXBlb2YgdGltZXN0YW1wICE9PSAndW5kZWZpbmVkJykgPyB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCkgOiB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb21taXNzaW9uID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ0NvbW1pc3Npb24nIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb24nO1xuICAgICAgICB9IGVsc2UgaWYgKCdDb21taXNzaW9uUGFpZCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGNvbW1pc3Npb24gPSAnQ29tbWlzc2lvblBhaWQnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21taXNzaW9uKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnTGltaXQnKTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHknKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1F1YW50aXR5UmVtYWluaW5nJywgMC4wKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgaWYgKCFjb3N0KSB7XG4gICAgICAgICAgICBpZiAocHJpY2UgJiYgYW1vdW50KVxuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXByaWNlKSB7XG4gICAgICAgICAgICBpZiAoY29zdCAmJiBmaWxsZWQpXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBhdmVyYWdlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUHJpY2VQZXJVbml0Jyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdPcmRlclV1aWQnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBpZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdPcmRlcklkJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiBsYXN0VHJhZGVUaW1lc3RhbXAsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBsZXQgb3JkZXJJZEZpZWxkID0gdGhpcy5nZXRPcmRlcklkRmllbGQgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICAgICAgcmVxdWVzdFtvcmRlcklkRmllbGRdID0gaWQ7XG4gICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IHRoaXMuYWNjb3VudEdldE9yZGVyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIH0gY2F0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gndXVpZCcgaW4gcmVzcG9uc2VbJ3Jlc3VsdCddKVxuICAgICAgICAgICAgICAgIGlkID0gcmVzcG9uc2VbJ3Jlc3VsdCddWyd1dWlkJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgIT09ICd2MicpXG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICd2MicpIHtcbiAgICAgICAgICAgIHVybCArPSBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpICsgJy8nO1xuICAgICAgICAgICAgaWYgKCgoYXBpID09PSAnYWNjb3VudCcpICYmIChwYXRoICE9PSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT09ICdvcGVub3JkZXJzJykpXG4gICAgICAgICAgICAgICAgdXJsICs9IG1ldGhvZC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBwYXRoICsgJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiBzaWduYXR1cmUgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIC8vIHsgc3VjY2VzczogZmFsc2UsIG1lc3NhZ2U6IFwibWVzc2FnZVwiIH1cbiAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnc3VjY2V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biAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICd1c2VyQWdlbnQnOiB0aGlzLnVzZXJBZ2VudHNbJ2Nocm9tZSddLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzU4NjI2MDYtNGY1NTRmMTQtMGI1ZC0xMWU4LTk1N2QtMzUwNThjNTA0YjZmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXQtei5jb20vYXBpX3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXQtei5jb20vYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmJpdC16LmNvbS9hYm91dC9mZWUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcmFsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZUFkZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVDYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RLS1QnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQ1QnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hYSSc6ICcwLjglJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWkMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dYUyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUE0nOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMSyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAzNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lCQ1QnOiAzNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTlQnOiA5LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1NTJzogMTUwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVJUJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xFTyc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMTMwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklVJzogMzUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDRCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyMDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIV0MnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVU5JVCc6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPWFknOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMC4zNTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCVEMnOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNYJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VURic6ICcwLjUlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQWUxOVCc6IDAuNDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUkInOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogJzAuNSUnLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdsYXN0Tm9uY2VUaW1lc3RhbXAnOiAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdQWEMnOiAnUGl4aWVjb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyYWxsICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAoZGF0YSwgJ3VpZCcpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IGlkSGFzVW5kZXJzY29yZSA9IChpZC5pbmRleE9mICgnXycpID49IDApO1xuICAgICAgICAgICAgaWYgKCFpZEhhc1VuZGVyc2NvcmUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtpZF1bJ2NvZGUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHVzZWRGaWVsZCA9IGlkICsgJ19sb2NrJztcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSB0aGlzLnNhZmVGbG9hdCAoYmFsYW5jZXMsIHVzZWRGaWVsZCk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlcywgaWQpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50Wyd1c2VkJ107XG4gICAgICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciw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bGV0IGlzbzg2MDEgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZGF0ZXRpbWUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAob3JkZXJbJ2RhdGV0aW1lJ10pO1xuICAgICAgICAgICAgaXNvODYwMSA9IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiBpc284NjAxLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYW1vdW50Jzogb3JkZXJbJ251bWJlciddLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcb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gdGhpcy5vcHRpb25zWydsYXN0Tm9uY2UnXSArPSAxO1xuICAgICAgICByZXR1cm4gdGhpcy5vcHRpb25zWydsYXN0Tm9uY2UnXTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChxdWVyeS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aGlzLnNlY29uZHMgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogdGhpcy5ub25jZSAoKSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpKTtcbiAgICAgICAgICAgIGJvZHkgKz0gJyZzaWduPScgKyB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChib2R5ICsgdGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGxldCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgaWYgKGNvZGUgIT09ICcwJykge1xuICAgICAgICAgICAgbGV0IEVycm9yQ2xhc3MgPSB0aGlzLnNhZmVWYWx1ZSAoe1xuICAgICAgICAgICAgICAgICcxMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDAnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICc0MDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICc0MDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcyMDMnOiBJbnZhbGlkTm9uY2UsXG4gICAgICAgICAgICAgICAgJzIwMSc6IE9yZGVyTm90Rm91bmQsXG4gICAgICAgICAgICAgICAgJzQwOCc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcxMD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sXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODUwMTc1Mi02MGMyMWI4Mi02ZmViLTExZTctODE4Yi0wNTVlZTZkMGU3NTQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJsM3AuZXUnLFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JsM3AuZXUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQml0b25pY05ML2JsM3AtYXBpL3RyZWUvbWFzdGVyL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2JpdG9uaWMubmwvZW4vYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9kZXB0aC9mdWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvcmVzdWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS90cmFkZXMvZmV0Y2gnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvbmV3X2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dhbGxldC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdCVENFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnR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gICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2JhbGFuY2UnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlQmlkQXNrIChiaWRhc2ssIHByaWNlS2V5ID0gMCwgYW1vdW50S2V5ID0gMCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgYmlkYXNrW3ByaWNlS2V5XSAvIDEwMDAwMC4wLFxuICAgICAgICAgICAgYmlkYXNrW2Ftb3VudEtleV0gLyAxMDAwMDAwMDAuMCxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9u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ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBxdW90ZXNcbiAgICAgICAgICAgIGxldCBhdXRoID0gcmVxdWVzdCArIFwiXFwwXCIgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnUmVzdC1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnUmVzdC1TaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cm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oT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAzMDMwMDAtYjYwMmRiZTYtOTc2ZC0xMWU3LTk1NmQtMzZjNTA0OWMwMWU3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vaGVscC9BUEknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL2ZlZXNfYW5kX2RlYWRsaW5lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBREMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JJVEInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDRCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRE4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xBTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RQQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRkwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWFAnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkpDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JTVFknOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFRNTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT05BJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT09OJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlZDJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hQTSc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NMUic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEFSVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTEcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJPTEwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVU5PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWUkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hWUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXREMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnSW5zdWZmaWNpZW50IGZ1bmRzISc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICdJbnZhbGlkIE9yZGVyIElEJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICdJbnZhbGlkIGFwaWtleSBvciBhcGlzZWNyZXQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdwYXJzZU9yZGVyU3RhdHVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzdWx0J10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnSXNBY3RpdmUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAg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AgICAgICAgICAgICduYW1lJzogJ0JyYXppbGlleCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0JSJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzQ3MDM1OTMtYzQ0OTg2NzQtZjUwNC0xMWU3LThkMTQtZmY4ZTQ0ZmI3OGMxLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2JyYXppbGlleC5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnJhemlsaWV4LmNvbS8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9icmF6aWxpZXguY29tL2V4Y2hhbmdlL2FwaS5waHAnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vYnJhemlsaWV4LmNvbS9leGNoYW5nZS9mZWVzLnBocCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2sve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeS97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tcGxldGVfYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3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AgfVxuICAgICAgICAgICAgbGV0IGNhbldpdGhkcmF3ID0gdGhpcy5zYWZlSW50ZWdlciAoY3VycmVuY3ksICdpc193aXRoZHJhd2FsX2FjdGl2ZScpID09PSAxO1xuICAgICAgICAgICAgbGV0IGNhbkRlcG9zaXQgPSB0aGlzLnNhZmVJbnRlZ2VyIChjdXJyZW5jeSwgJ2lzX2RlcG9zaXRfYWN0aXZlJykgPT09IDE7XG4gICAgICAgICAgICBpZiAoIWNhbldpdGhkcmF3IHx8ICFjYW5EZXBvc2l0KVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmUnOiBjYW5XaXRoZHJhdyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsndHhXaXRoZHJhd2FsRmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbkRlcG9zaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3R4RGVwb3NpdEZlZSddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluQW1vdW50VHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5XaXRoZHJhd2FsJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluRGVwb3NpdCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAoKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2FjdGl2ZScpID09PSAxO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbC50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsnZGF0ZSddO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ3RpY2tlciddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2hlc3RCaWQyNCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3dlc3RBc2syNCcpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoZXN0QmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3dlc3RBc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgIC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aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0ge1xuICAgICAgICAgICAgICAgICdkYXRlJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgICAgICd0aWNrZXInOiB0aWNrZXJzW2lkXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZX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zg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ19pZCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdHJhZGVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZWhpc3RvcnlNYXJrZXQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHRyYWRlcywgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENvbXBsZXRlQmFsYW5jZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgbGV0IG1hcmtldElkID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ21hcmtldC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GFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdjb21tYW5kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZ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gICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGNib3guY28uanAvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC9oZWxwL2FzbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWxsdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfdmlldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnQlRDL0pQWScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEwNCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwNSc6IFBlcm1pc3Npb25EZW5pZWQsXG4gICAgICAgICAgICAgICAgJzEwNic6IEludmFsaWROb25jZSxcbiAgICAgICAgICAgICAgICAnMTA3JzogSW52YWxpZE9yZGVyLCAvLyBwcmljZSBzaG91bGQgYmUgYW4gaW50ZWdlclxuICAgICAgICAgICAgICAgICcyMDAnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnMjAxJzogSW52YWxpZE9yZGVyLCAvLyBhbW91bnQgdG9vIHNtYWxsXG4gICAgICAgICAgICAgICAgJzIwMic6IEludmFsaWRPcmRlciwgLy8gcHJpY2Ugc2hvdWxkIGJlIFswIDogMTAwMDAwMF1cbiAgICAgICAgICAgICAgICAnMjAzJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNDAxJzogT3JkZXJOb3RGb3VuZCwgLy8gY2FuY2VsIGNhbmNlbGVkLCBjbG9zZWQgb3Igbm9uLWV4aXN0ZW50IG9yZGVyXG4gICAgICAgICAgICAgICAgJzQwMic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubG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QgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGxldCBudW1TeW1ib2xzID0gdGhpcy5zeW1ib2xzLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bVN5bWJvbHMgPiAxKVxuICAgICAgICAgICAgcmVxdWVzdFsnY29pbiddID0gbWFya2V0WydpZCddO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdoaWdoJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXknKSxcbiAgICAgICAgIC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AgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHRoaXMuc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1TeW1ib2xzID4gMSlcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvaW4nXSA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDsgLy8gR01UIHRpbWVcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOi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XN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiAnQlRDL0pQWScsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGVWaWV3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsI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9yZGVyID0gb3JkZXJzW2ldO1xuICAgICAgICAgICAgb3JkZXJbJ3N0YXR1cyddID0gJ29wZW4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBvcmRlcnM7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgcXVlcnlbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlIChzZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICAvLyB0eXBpY2FsIGVycm9yIHJlc3BvbnNlOiB7XCJyZXN1bHRcIjpmYWxzZSxcImNvZGVcIjpcIjQwMVwifVxuICAgICAgICBpZiAoaHR0cENvZGUgPj0gNDAwKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyByZXNvcnQgdG8gZGVmYXVsdEVycm9ySGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSAhPT0gJ3snKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBub3QganNvbiwgcmVzb3J0IHRvIGRlZmF1bHRFcnJvckhhbmRsZXJcbiAgICAgICAgY29uc3QgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgY29uc3QgcmVzdWx0ID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncmVzdWx0Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgcmVzdWx0ID09PSAndW5kZWZpbmVkJyB8fCByZXN1bHQgPT09IHRydWUpXG4gICAgICAgICAgICByZXR1cm47IC8v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AgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzNjgtNDY1YjMyODYtNWVkNi0xMWU3LTlhMTEtMGY2NDY3ZTFkODJiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3BsdXMnOiAnaHR0cHM6Ly9wbHVzLWFwaS5idGNjaGluYS5jb20vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuYnRjY2hpbmEuY29tL2RhdGEnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNjaGluYS5jb20vYXBpX3RyYWRlX3YxLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20vYXBpZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncGx1cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5ZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQnV5T3JkZXIyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbEljZWJlcmdPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFyY2hpdmVkT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0SWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0RGVwdGgyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0V2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlcXVlc3RXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxTdG9wT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGNjbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ2FwaSc6ICdwdWJsaWMnLCAncGx1cyc6IGZhbHNlIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9DTlknOiB7ICdpZCc6ICdsdGNjbnknLCAnc3ltYm9sJzogJ0xUQy9DTlknLCAnYmFz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tleS5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBpZCA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbi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5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gbWFya2V0WydhcGknXSArICdHZXRPcmRlcmJvb2snO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuY3JlYXRlTWFya2V0UmVxdWVzdCAobWFya2V0KTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRlJ10gKiAxMDAwO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3Z3YXAnKSxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlclBsdXMgKHRpY2tlciwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ1RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaCcpLFxuICAgICA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Rob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzWyd0aWNrZXInXTtcbiAgICAgICAgaWYgKG1hcmtldFsncGx1cyddKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXJQbHVzICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGVQbHVzICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydzaXplJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZXNQbHVzICh0cmFkZXMsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhZGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5wYXJzZVRyYWRlUGx1cyAodHJhZGVzW2ldLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gbWFya2V0WydhcGknXSArICdHZXRUcmFkZSc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5jcmVhdGVNYXJrZXRSZXF1ZXN0IChtYXJrZXQpO1xuICAgICAgICBp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wYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IHAgPSBbXTtcbiAgICAgICAgICAgIGlmICgncGFyYW1zJyBpbiBwYXJhbXMpXG4gICAgICAgICAgICAgICAgcCA9IHBhcmFtc1sncGFyYW1zJ107XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcCA9IHAuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gKFxuICAgICAgICAgICAgICAgICd0b25jZT0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmYWNjZXNza2V5PScgKyB0aGlzLmFwaUtleSArXG4gICAgICAgICAgICAgICAgJyZyZXF1ZXN0bWV0aG9kPScgKyBtZXRob2QudG9Mb3dlckNhc2UgKCkgK1xuICAgICAgICAgICAgICAgICcmaWQ9JyArIG5vbmNlICtcbiAgICAgICAgICAgICAgICAnJm1ldGhvZD0nICsgcGF0aCArXG4gICAgICAgICAgICAgICAgJyZwYXJhbXM9JyArIHBcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hc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VzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI5MTQyOTExLTBlMWFjZmMyLTdkNWMtMTFlNy05OGM0LTA3ZDk1MzJiMjlkNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuYnRjbWFya2V0cy5uZXQnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNtYXJrZXRzLm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC9kYXRhJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGNtYXJrZXRzLm5ldC8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ01hcmtldHMvQVBJJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vdGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tpZH0vdHJhZGluZ2ZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmR0cmFuc2Zlci93aXRoZHJhd0NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3RUZUJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdHJhZGUvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlQmF0Y2gnLCAvLyB0aGV5IHByb21pc2UgaXQncyBjb21pbmcgc29vbi4uLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9CVENNYXJrZXRzL3tpZH0vdGlja0J5VGltZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0FVRCc6IHsgJ2lkJzogJ0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ucyc6IHtcbiAgICAgICAgICAgICAgICAnMyc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnNic6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBtdWx0aXBsaWVyID0gMTAwMDAwMDAwO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddIC8gbXVsdGlwbGllcik7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ3BlbmRpbmdGdW5kcyddIC8gbXVsdGlwbGllcik7XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHRvdGFsIC0gdXNlZDtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ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AgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0UHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiZXN0QmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiZXN0QXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lMjRoJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldElkVGljayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYW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IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlclRyYWRlSGlzdG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU15VHJhZGVzIChyZXNwb25zZVsndHJhZGVzJ10sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJpID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgdXJpO1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBxdW90ZXNcbiAgICAgICAgICAgIGxldCBhdXRoID0gdXJpICsgXCJcXG5cIiArIG5vbmNlICsgXCJcXG5cIjtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgc2VjcmV0LCAnc2hhNTEyJywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVyc1snc2lnbmF0dXJlJ10gPSB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yQ29kZScpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycm9yIGluIHRoaXMuZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb25DbGFzcyAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1c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dHJhZGUuaW0vaGVscC5hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYnRjdHJhZGUuaW0vc3BlbmQucHJpY2UuaHRtbCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmIChhcGkgPT09ICd3ZWInKSB7XG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGRhdGEgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdkYXRhJyk7XG4gICAgICAgIGlmIChkYXRhKSB7XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdjb2R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FxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk0MTQ4My03OWZjNzM1MC02MmQ5LTExZTctOWY2MS1hYzQ3ZjI4ZmNkOTYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYnRjLXRyYWRlLmNvbS51YS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9idGMtdHJhZGUuY29tLnVhJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jcy5nb29nbGUuY29tL2RvY3VtZW50L2QvMW9jWUEweU15X1JYZDU2MXNmRzNxRVBaODBreWxsMzZIVXh2Q1JlNUdiaEUvZWRpdCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYWxzL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J1eS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnamFwYW5fc3RhdC9oaWdoL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhc2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpZC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteV9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1vdmUvb3JkZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQkNIL1VBSCc6IHsgJ2lkJzogJ2JjaF91YWgnLCAnc3ltYm9sJzogJ0JDSC9VQUgnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnVUFIJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVUFIJzogeyAnaWQnOiAnYnRjX3VhaCcsICdzeW1ib2wnOiAnQlRDL1VBSCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVQUgnLCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAxIH0sICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMDAwMDEgfX19LFxuICAgICAgICAgICAgICAgICdEQVNIL0JUQyc6IHsgJ2lkJzogJ2Rhc2hfYnRjJywgJ3N5bWJvbCc6ICdEQVNIL0JUQycsICdiYXNlJzogJ0RBU0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HtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05WQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDEwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBzaWduSW4gKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5wcml2YXRlUG9zdEF1dGggKCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBpZiAoJ2FjY291bnRzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGFjY291bnRzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGFjY291bnRzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFjY291bnQgPSBhY2NvdW50c1tiXTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBhY2NvdW50WydjdXJyZW5jeSddO1xuICAgICAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYWNjb3VudFsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBiaWRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNCdXlTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGFza3MgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc1NlbGxTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHtcbiAgICAgICAgICAgICdiaWRzJzogW10sXG4gICAgICAgICAgICAnYXNrcyc6IFtdLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoYmlkcykge1xuICAgICAgICAgICAgaWYgKCdsaXN0JyBpbiBiaWRzKVxuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYmlkcyddID0gYmlkc1snbGlzdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhc2tzKSB7XG4gICAgICAgICAgICBpZiAoJ2xpc3QnIGluIGFza3MpXG4gICAgICAgICAgICAgICAgb3JkZXJib29rWydhc2tzJ10gPSBhc2tzWydsaXN0J107XG4gICAgICAgIH1cbiAgICAgICAgcmV0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QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpY2tlckxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIGlmICh0aWNrZXJMZW5ndGggPiAwKSB7XG4gICAgICAgICAgICBsZXQgc3RhcnQgPSBNYXRoLm1heCAodGlja2VyTGVuZ3RoIC0gNDgsIDApO1xuICAgICAgICAgICAgZm9yIChsZXQgdCA9IHN0YXJ0OyB0IDwgdGlja2VyLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNhbmRsZSA9IHRpY2tlclt0XTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFsnb3BlbiddID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydvcGVuJ10gPSBjYW5kbGVbMV07XG4gICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgcmVzdWx0WydoaWdoJ10gPT09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0WydoaWdoJ10gPCBjYW5kbGVbMl0pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2hpZ2gnXSA9IGNhbmRsZVsyXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2xvdyddID09PSAndW5kZWZpbmVkJykgfHwgKHJlc3VsdFsnbG93J10gPiBjYW5kbGVbM10pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2xvdyddID0gY2FuZGxlWzNdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydiYXNlVm9sdW1lJ10gPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9IC1jYW5kbGVbNV07XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2Jhc2VWb2x1bWUnXSAtPSBjYW5kbGVbNV07XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGFzdCA9IHRpY2tlckxlbmd0aCAtIDE7XG4gICAgICAgICAgICByZXN1bHRbJ2xhc3QnXSA9IHRpY2tlcltsYXN0XVs0XTtcbiAgICAgICAgICAgIHJlc3VsdFsnY2xvc2UnXSA9IHJlc3VsdFsnbGFzdCddO1xuICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtMSAqIHJlc3VsdFsnYmFzZVZvbHVtZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29udmVydEN5cmlsbGljTW9udGhOYW1lVG9TdHJpbmcgKGN5cmlsbGljKSB7XG4gICAgICAgIGxldCBtb250aHMgPSB7XG4gICAgICAgICAgICAn0Y/QvdCy0LDRgNGPJzogJzAxJyxcbiAgICAgICAgICAgICfRhNC10LLRgNCw0LvRjyc6ICcwMicsXG4gICAgICAgICAgICAn0LzQsNGA0YLQsCc6ICcwMycsXG4gICAgICAgICAgICAn0LDQv9GA0LXQu9GPJzogJzA0JyxcbiAgICAgICAgICAgICfQvNCw0Y8nOiAnMDUnLFxuICAgICAgICAgICAgJ9C40Y7QvdGPJzogJzA2JyxcbiAgICAgICAgICAgICfQuNGO0LvRjyc6ICcwNycsXG4gICAgICAgICAgICAn0LDQstCz0YPRgdGC0LAnOiAnMDgnLFxuICAgICAgICAgICAgJ9GB0LXQvdGC0Y/QsdGA0Y8nOiAnMDknLFxuICAgICAgICAgICAgJ9C+0LrRgtGP0LHRgNGPJzogJzEwJyxcbiAgICAgICAgICAgICfQvdC+0Y/QsdGA0Y8nOiAnMTEnLFxuICAgICAgICAgICAgJ9C00LXQutCw0LHRgNGPJzogJzEyJyxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG1vbnRoID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoY3lyaWxsaWMgaW4gbW9udGhzKVxuICAgICAgICAgICAgbW9udGggPSBtb250aHNbY3lyaWxsaWNdO1xuICAgICAgICByZXR1cm4gbW9udGg7XG4gICAgfVxuXG4gICAgcGFyc2VDeXJpbGxpY0RhdGV0aW1lIChjeXJpbGxpYykge1xuICAgICAgICBsZXQgcGFydHMgPSBjeXJpbGxpYy5zcGxpdCAoJyAnKTtcbiAgICAgICAgbGV0IGRheSA9IHBhcnRzWzBdO1xuICAgICAgICBsZXQgbW9udGggPSB0aGlzLmNvbnZlcnRDeXJpbGxpY01vbnRoTmFtZVRvU3RyaW5nIChwYXJ0c1sxXSk7XG4gICAgICAgIGlmICghbW9udGgpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcGFyc2VUcmFkZSgpIHVuZGVmaW5lZCBtb250aCBuYW1lOiAnICsgY3lyaWxsaWMpO1xuICAgICAgICBsZXQgeWVhciA9IHBhcnRzWzJdO1xuICAgICAgICBsZXQgaG1zID0gcGFydHNbNF07XG4gICAgICAgIGxldCBobXNMZW5ndGggPSBobXMubGVuZ3RoO1xuICAgICAgICBpZiAoaG1zTGVuZ3RoID09PSA3KSB7XG4gICAgICAgICAgICBobXMgPSAnMCcgKyBobXM7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGRheS5sZW5ndGggPT09IDEpIHtcbiAgICAgICAgICAgIGRheSA9ICcwJyArIGRheTtcbiAgICAgICAgfVxuICAgICAgICBsZ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leHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYnRjdHVyaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCVENUdXJrJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVFInLCAvLyBUdXJrZXlcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxZCc6ICcxZCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MjcwOS0xOGUxNTY0Ni02NGEzLTExZTctOWZhMi1iMDk1MGVjNzcxMmYuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJ0Y3R1cmsuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQlRDVHJhZGVyL2Jyb2tlci1hcGktZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGNkYXRhJywgLy8gP2xhc3Q9Q09VTlRcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJywgICAvLyA/bGFzdD1DT1VOVCAobWF4IDUwKVxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlclRyYW5zYWN0aW9ucycsIC8vID9vZmZzZXQ9MCZsaW1pdD0yNSZzb3J0PWFzY1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9UUlknOiB7ICdpZCc6ICdCVENUUlknLCAnc3ltYm9sJzogJ0JUQy9UUlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVFJZJywgJ21ha2VyJzogMC4wMDIgKiAxLjE4LCAndGFrZXInOiAwLjAwMzUgKiAxLjE4IH0sXG4gICAgICAgICAgICAgICAgJ0VUSC9UUlknOiB7ICdpZCc6ICdFVEhUUlknLCAnc3ltYm9sJzogJ0VUSC9UUlknLCAnYmFzZSc6ICdF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uICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS97aWR9L3tsaW1pdH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjL3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdidGMvZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIGxpbWl0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ2xp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snb3JkZXInXVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHsgJ29yZGVyJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdNZXRob2QnOiBwYXRoLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gIC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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYnhpbnRoIGV4dGVuZHMgRXhjaGFuZ2Uge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdieGludGgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlguaW4udGgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdUSCcsIC8vIFRoYWlsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDEyLTU2N2IxZWI0LTVlZDctMTFlNy05NGE4LWZmNmEzODg0ZjZjNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9ieC5pbi50aC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ieC5pbi50aCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2J4LmluLnRoL2luZm8vYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJywgLy8gdGlja2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlyaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxsZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxncm91cCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbHBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1pc3N1ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLXNlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tbXliaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teW9wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1leGVyY2lzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWNhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsLWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMjUgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnREFTJzogJ0RBU0gnLFxuICAgICAgICAgICAgICAgICdET0cnOiAnRE9HRScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpcmluZyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpcmluZ19pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3NlY29uZGFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydwcmltYXJ5X2N1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2UpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxld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gIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyaW5nJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0cmFkZV9kYXRlJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3RyYWRlX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3JhdGUnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKSxcbiAgICAgICAgfTtcbiAgICB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ICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL2MtY2V4LmNvbS90JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2MtY2V4LmNvbS90L2FwaV9wdWIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2MtY2V4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2MtY2V4LmNvbS8/aWQ9YXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbm5hbWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndm9sdW1lX3tjb2lufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VkaXN0cmlidXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdWxsb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdJT1QnOiAnSW9UY29pbicsXG4gICAgICAgICAgICAgICAgJ0JMQyc6ICdDcnlwdG9idWxsY29pbicsXG4gICAgICAgICAgICAgICAgJ1hJRCc6ICdJbnRlcm5hdGlvbmFsRGlhbW9uZCcsXG4gICAgICAgICAgICAgICAgJ0xVWCc6ICdMdXhtaScsXG4gICAgICAgICAgICAgICAgJ0NSQyc6ICdDb3JlQ29pbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMud2ViR2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3BhaXJzJ107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIC8vIGFuIGFsdGVybmF0aXZlIGRvY3VtZW50ZWQgcGFyc2VyXG4gICAgICAgIC8vICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgLy8gICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sncmVzdWx0J10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgLy8gICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11bcF07XG4gICAgICAgIC8vICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgIC8vICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgIC8vICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgLy8gICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAvLyAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAvLyAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgIC8vICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAvLyAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAvLyAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgIC8vICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAvLyAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgLy8gICAgICAgICB9KTtcbiAgICAgICAg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ICAgICAgICAgIGxldCBiaWRhc2tzQnlNYXJrZXRJZCA9IHRoaXMuZ3JvdXBCeSAoYmlkYXNrcywgJ01hcmtldCcpO1xuICAgICAgICAgICAgbGV0IG1hcmtldElkcyA9IE9iamVjdC5rZXlzIChiaWRhc2tzQnlNYXJrZXRJZCk7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IG1hcmtldElkcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IG1hcmtldElkc1tqXTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0SWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHNpZGUgPSB0eXBlO1xuICAgICAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbc3ltYm9sXTtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgaW52ZXJ0ZWRJZCA9IHF1b3RlICsgJy0nICsgYmFzZTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGludmVydGVkSWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2ludmVydGVkSWRdO1xuICAgICAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIShzeW1ib2wgaW4gb3JkZXJib29rcykpXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyYm9va3Nbc3ltYm9sXSA9IHt9O1xuICAgICAgICAgICAgICAgIG9yZGVyYm9va3Nbc3ltYm9sXVtzaWRlXSA9IGJpZGFza3NCeU1hcmtldElkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG9yZGVyYm9va3MpO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2tdO1xuICAgICAgICAgICAgcmVzdWx0W2tleV0gPSB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2tzW2tleV0sIHVuZGVmaW5lZCwgJ2J1eScsICdzZWxsJywgJ1JhdGUnLCAnUXVhbnRpdHknKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0cHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuIC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AgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMud2ViR2V0UHJpY2VzIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdXBwZXJjYXNlLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAod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ogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdxdWFudGl0eSc6IGFtb3VudCxcbiAgICAgICAgICAgICdyYXRlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsndXVpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlR2V0Q2FuY2VsICh7ICd1dWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYSc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdhcGlzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAodXJsKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpIH07XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogJ2dldCcgKyBwYXRoLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpICsgJy5qc29uJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoYXBpID09PSAnd2ViJylcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKVxuICAgICAgICAg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RydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ0Mi04ZGRjMzNiMC01ZWQ4LTExZTctOGI5OC1mNzg2YWVmMGYzYzkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY2V4LmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NleC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NleC5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vY2V4LmlvL2ZlZS1zY2hlZHVsZScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NleC5pby9saW1pdHMtY29tbWlzc2lvbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X2xpbWl0cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RfcHJpY2Uve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZXMve2N1cnJlbmNpZXN9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YvaGQve3l5eXltbWRkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2sve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve2N1cnJlbmNpZXN9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29udmVydC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlX3N0YXRzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVyc19zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcmNoaXZlZF9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3JlcGxhY2Vfb3JkZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2xvc2VfcG9zaXRpb24ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbXlmZWUvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJfdHgvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fcG9zaXRpb24ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2Vfb3JkZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnVVNEJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ0VVUic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdSVUInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnR0JQJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnVVNEJzogYW1vdW50ID0+IGFtb3VudCAqIDAuMDM1ICsgMC4yNSxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vICdFVVInOiBhbW91bnQgPT4gYW1vdW50ICogMC4wMzUgKyAwLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1JVQic6IGFtb3VudCA9PiBhbW91bnQgKiAwLjA1ICsgMTUuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyAnR0JQJzogYW1vdW50ID0+IGFtb3VudCAqIDAuMDM1ICsgMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWExNJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lMaW1pdHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydkYXRhJ11bJ3BhaXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydkYXRhJ11bJ3BhaXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbDEnXSArICcvJyArIG1hcmtldFsnc3ltYm9sMiddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IG1hcmtldFsnbWluTG90U2l6ZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5QcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IC0xICogTWF0aC5sb2cxMCAobWFya2V0WydtaW5Mb3RTaXplJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbkxvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ21heExvdFNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5QcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhQcmljZScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ21pbkxvdFNpemVTMiddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25z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aW1lc3RhbXApO1xuICAgICAgICB9XG4gICAgICAgIGxldCB2b2x1bWUgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lJyk7XG4gICAgICAgIGxldCBoaWdoID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKTtcbiAgICAgICAgbGV0IGxvdyA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKTtcbiAgICAgICAgbGV0IGJpZCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKTtcbiAgICAgICAgbGV0IGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICdoaWdoJzogaGlnaCxcbiAgICAgICAgICAgICdsb3cnOiBsb3csXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4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QnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIC8vIERlcGVuZGluZyBvbiB0aGUgY2FsbCwgJ3RpbWUnIGNhbiBiZSBhIHVuaXggaW50LCB1bml4IHN0cmluZyBvciBJU08gc3RyaW5nXG4gICAgICAgIC8vIFllcywgcmVhbGx5XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlclsndGltZSddO1xuICAgICAgICBpZiAodHlwZW9mIG9yZGVyWyd0aW1lJ10gPT09ICdzdHJpbmcnICYmIG9yZGVyWyd0aW1lJ10uaW5kZXhPZiAoJ1QnKSA+PSAwKSB7XG4gICAgICAgICAgICAvLyBJU084NjAxIHN0cmluZ1xuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpbWVzdGFtcCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBlaXRoZXIgaW50ZWdlciBvciBzdHJpbmcgaW50ZWdlclxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpbWVzdGFtcCk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBvcmRlclsnc3ltYm9sMSddICsgJy8nICsgb3JkZXJbJ3N5bWJvbDInXTtcbiAgICAgICAgICAgIGlmIChzeW1ib2wgaW4gdGhpcy5tYXJrZXRzKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdhJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nOyAvLyB0aGUgd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ICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IGJhc2VGZWVDb3N0LFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9IGVsc2UgaWYgKChxdW90ZUZlZSBpbiBvcmRlcikgfHwgKHF1b3RlVGFrZXJGZWUgaW4gb3JkZXIpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlRmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcXVvdGVGZWVDb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcXVvdGVGZWVDb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCBxdW90ZVRha2VyRmVlKTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHF1b3RlRmVlQ29zdCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICghY29zdClcbiAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQ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S0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjaGJ0YyBleHRlbmRzIHpiIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY2hidGMnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ0hCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU1NTY1OS1mMDA0MGRjMi03MTA5LTExZTctOWQ5OS02ODhhNDM4YmY5ZjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuY2hidGMuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY2hidGMuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgIC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gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgIC8vIHRoZSBmaXJzdCB0d28gZG9uJ3Qgc2VlbSB0byB3b3JrIGF0IGFsbFxuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICc3ZCc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzE0ZCc6ICcxNEQnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxTScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNTc1NTU3Ni1kZWUwMmU1Yy0wODc4LTExZTgtOTg5Zi0xNTk1ZDgwYmE0N2YuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vYXBpLmNvYmluaG9vZC5jb20vdjEnLFxuICAgICAgICAgICAgICAgICAgICAnd3MnOiAnd3NzOi8vZmVlZC5jb2Jpbmhvb2QuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2Jpbmhvb2QuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29iaW5ob29kLmdpdGh1Yi5pby9hcGktcHVibGljJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdzeXN0ZW0nOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVzc2FnZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lc3NhZ2VzL3ttZXNzYWdlX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnYWRtaW4nOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtL21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeXN0ZW0vbWVzc2FnZXMve21lc3NhZ2VfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3lzdGVtL21lc3NhZ2VzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcy97bWVzc2FnZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5c3RlbS9tZXNzYWdlcy97bWVzc2FnZV9pZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90cmFkaW5nX3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3JkZXJib29rcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3N0YXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja2Vycy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L3RyYWRlcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhcnQvY2FuZGxlcy97dHJhZGluZ19wYWlyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycy97b3JkZXJfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycy97b3JkZXJfaWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy90cmFkZXMve3RyYWRlX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvbGVkZ2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdF9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2FsX2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L3dpdGhkcmF3YWxzL3t3aXRoZHJhd2FsX2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdHMve2RlcG9zaXRfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2RlcG9zaXRfYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvd2l0aGRyYXdhbF9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC93aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy9vcmRlcnMve29yZGVyX2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2luc3VmZmljaWVudF9iYWxhbmNlJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0Q3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsncmVzdWx0J11bJ2N1cnJlbmNpZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBtaW5Vbml0ID0gdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnbWluX3VuaXQnKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmaWF0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoY3VycmVuY3lbJ21pbl91bml0J10pLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5Vbml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluVW5pdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5Vbml0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnd2l0aGRyYXdhbF9mZWUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnZGVwb3NpdF9mZWUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRUcmFkaW5nUGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWyd0cmFkaW5nX3BhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3F1b3RlX2luY3JlbWVudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdGhpcy5zYWZlVmFsdWUgKG1hcmtldCwgJ2lzX2FjdGl2ZScsIHRydWUpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYmFzZV9taW5fc2l6ZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdiYXNlX21heF9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRoaXMuc2FmZVN0cmluZyAodGlja2VyLCAndHJhZGluZ19wYWlyX2lkJyk7XG4gICAgICAgICAgICBtYX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iAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgc2lkZSA9IChvcmRlclsnc2lkZSddID09PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSwgLy8gbWFya2V0LCBsaW1pdCwgc3RvcCwgc3RvcF9saW1pdCwgdHJhaWxpbmdfc3RvcCwgZmlsbF9vcl9raWxsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW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ICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5jaGVjaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdjb2luY2hlY2snLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ0lEJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ2NC0zYjVjM2M3NC01ZWQ5LTExZTctODQwZS0zMWIzMjk2OGUxZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9kb2N1bWVudHMvZXhjaGFuZ2UvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2xldmVyYWdlX2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9vcGVucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9uc19wYWdpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sZXZlcmFnZS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy9tYXRjaGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5L3tpZH0vZmFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvdG9fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy9mcm9tX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy97aWR9L3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnYnRjX2pweScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sIC8vIHRoZSBvbmx5IHJlYWwgcGFpclxuICAgICAgICAgICAgICAgIC8vICdFVEgvSlBZJzogeyAnaWQnOiAnZXRoX2pweScsICdzeW1ib2wnOiAnRVRIL0pQWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdKUFknIH0sXG4gICAgICAgICAgICAgICAgLy8gJ0VUQy9KUFknOiB7ICdpZCc6ICdldGNfanB5JywgJ3N5bWJvbCc6ICdFVEMvSlBZJywgJ2Jhc2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LnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ2NyZWF0ZWRfYXQnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnb3JkZXJfdHlwZSddLFxuIC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b3VudHJpZXMnOiBbICdDTicsICdVSycgXSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzY3NzAzMTAtYWRmYTc2NGUtMWM1YS0xMWU4LThlMDktNDQ5ZGFhYzNkMmZiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5jb2luZWdnLmNvbS9jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Jlc3QnOiAnaHR0cHM6Ly9hcGkuY29pbmVnZy5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20vZXhwbGFpbi5hcGkuaHRtbCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuY29pbmVnZy5jb20vZmVlLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L2FsbGNvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3txdW90ZX0vdHJlbmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L3tiYXNlfS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3F1b3RlfS97YmFzZX0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7cXVvdGV9L3tiYXNlfS9kZXB0aC5qcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfYWRkL3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2NhbmNlbC97cXVvdGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV92aWV3L3txdW90ZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2xpc3Qve3F1b3RlfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0FNRSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR09PQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJRkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWUkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hQTSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUFDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZaJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVQnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JTUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEdDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS1QnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0pCQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUklPJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMS0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pDQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRRUMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FVCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWVRDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdITEInOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01SWUMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxMDMnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDUnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDYnOiBJbnZhbGlkTm9uY2UsXG4gICAgICAgICAgICAgICAgJzIwMCc6IEluc3VmZmljaWVudEZ1bmRzLFxuICAgICAgICAgICAgICAgICcyMDEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzIwMic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMjAzJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNDAyJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2Vycm9yTWVzc2FnZXMnOiB7XG4gICAgICAgICAgICAgICAgJzEwMCc6ICdSZXF1aXJlZCBwYXJhbWV0ZXJzIGNhbiBub3QgYmUgZW1wdHknLFxuICAgICAgICAgICAgICAgICcxMDEnOiAnSWxsZWdhbCBwYXJhbWV0ZXInLFxuICAgICAgICAgICAgICAgICcxMDInOiAnY29pbiBkb2VzIG5vdCBleGlzdCcsXG4gICAgICAgICAgICAgICAgJzEwMyc6ICdLZXkgZG9lcyBub3QgZXhpc3QnLFxuICAgICAgICAgICAgICAgICcxMDQnOiAnU2lnbmF0dXJlIGRvZXMgbm90IG1hdGNoJyxcbiAgICAgICAgICAgICAgICAnMTA1JzogJ0luc3VmZmljaWVudCBwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgJzEwNic6ICdSZXF1ZXN0IGV4cGlyZWQobm9uY2UgZXJyb3IpJyxcbiAgICAgICAgICAgICAgICAnMjAwJzogJ0xhY2sgb2YgYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMSc6ICdUb28gc21hbGwgZm9yIHRoZSBudW1iZXIgb2YgdHJhZGluZycsXG4gICAgICAgICAgICAgICAgJzIwMic6ICdQcmljZSBtdXN0IGJlIGluIDAgLSAxMDAwMDAwJyxcbiAgICAgICAgICAgICAgICAnMjAzJzogJ09yZGVyIGRvZXMgbm90IGV4aXN0JyxcbiAgICAgICAgICAgICAgICAnMjA0JzogJ1BlbmRpbmcgb3JkZXIgYW1vdW50IG11c3QgYmUgYWJvdmUgMC4wMDEgQlRDJyxcbiAgICAgICAgICAgICAgICAnMjA1JzogJ1Jlc3RyaWN0IHBlbmRpbmcgb3JkZXIgcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAnMjA2JzogJ0RlY2ltYWwgcGxhY2UgZXJyb3InLFxuICAgICAgICAgICAgICAgICc0MDEnOiAnU3lzdGVtIGVycm9yJyxcbiAgICAgICAgICAgICAgICAnNDAyJzogJ1JlcXVlc3RzIGFyZSB0b28gZnJlcXVlbnQnLFxuICAgICAgICAgICAgICAgICc0MDMnOiAnTm9uLW9wZW4gQVBJJyxcbiAgICAgICAgICAgICAgICAnNDA0JzogJ0lQIHJlc3RyaWN0aW9uIGRvZXMgbm90IHJlcXVlc3QgdGhlIHJlc291cmNlJyxcbiAgICAgICAgICAgICAgICAnNDA1JzogJ0N1cnJlbmN5IHRyYW5zYWN0aW9ucyBhcmUgdGVtcG9yYXJpbHkgY2xvc2VkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnb3B0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAncXVvdGVJZHMnOiBbICdidGMnLCAnZXRoJywgJ3VzYycgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBxdW90ZUlkcyA9IHRoaXMub3B0aW9uc1sncXVvdGVJZHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IHF1b3RlSWRzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IHF1b3RlSWRzW2JdO1xuICAgICAgICAgICAgbGV0IGJhc2VzID0gYXdhaXQgdGhpcy53ZWJHZXRRdW90ZUFsbGNvaW4gKHtcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZUlkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhc2VzID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cygpIGZvciBcIicgKyBxdW90ZUlkICsgJ1wiIHJldHVybmVkOiBcIicgKyB0aGlzLmpzb24gKGJhc2VzKSArICdcIicpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZHMgPSBPYmplY3Qua2V5cyAoYmFzZXMpO1xuICAgICAgICAgICAgbGV0IG51bUJhc2VJZHMgPSBiYXNlSWRzLmxlbmd0aDtcbiAgICAgICAgICAgIGlmIChudW1CYXNlSWRzIDwgMSlcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cygpIGZvciBcIicgKyBxdW90ZUlkICsgJ1wiIHJldHVybmVkOiBcIicgKyB0aGlzLmpzb24gKGJhc2VzKSArICdcIicpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IGJhc2VzW2Jhc2VJZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICA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GNoYW5nZUVycm9yICgnZmV0Y2hUaWNrZXJzIGZhaWxlZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlSWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbYmFzZUlkXTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c0J5SWRbaWRdO1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlnaCc6IHRpY2tlcls0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbNV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JzogdGlja2VyWzJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnOiB0aWNrZXJbM10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdCc6IHRpY2tlclsxXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjaGFuZ2UnOiB0aWNrZXJbOF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAndm9sJzogdGlja2VyWzZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlVm9sJzogdGlja2VyWzddLFxuICAgICAgICAgICAgICAgICAgICB9LCBtYXJrZXQpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cb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1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2VbJ2RhdGEnXSwgJ3VpZCcpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbaV07XG4gICAgICAgICAgICBsZXQgWyBjdXJyZW5jeUlkLCBhY2NvdW50VHlwZSBdID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjdXJyZW5jeUlkO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5SWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtjdXJyZW5jeUlkXVsnY29kZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCEoY29kZSBpbiByZXN1bHQpKSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYWNjb3VudFR5cGUgPSAoYWNjb3VudFR5cGUgPT09ICdsb2NrJykgPyAndXNlZCcgOiAnZnJlZSc7XG4gICAgICAgICAgICByZXN1bHRbY29kZV1bYWNjb3VudFR5c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F0dXMnKTtcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gJ2NhbmNlbGxlZCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzdGF0dXMgPSByZW1haW5pbmcgPyAnb3BlbicgOiAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaW5mbyA9IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlcik7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnaWQnKSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGVBZGRRdW90ZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgICAgICdxdW90ZSc6IG1hcmtldFsncXVvdGVJZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gcmVzcG9uc2VbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLnltZGhtcyAodGhpcy5taWxsaXNlY29uZHMgKCkpLFxuICAgICAgICAgICAgJ2Ftb3VudF9vcmlnaW5hbCc6IGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnRfb3V0c3RhbmRpbmcnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH0sIG1hcmtldCk7XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gb3JkZXI7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2Vs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ldCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAoc2VjcmV0KSk7XG4gICAgICAgICAgICBxdWVyeSArPSAnJicgKyAnc2lnbmF0dXJlPScgKyBzaWduYXR1cmU7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgYm9keSA9IHF1ZXJ5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIC8vIGNoZWNrcyBhZ2FpbnN0IGVycm9yIGNvZGVzXG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA9PT0gMClcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKGJvZHlbMF0gIT09ICd7JylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4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5leCBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbmV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5FeCcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0NOJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDQ2MzEyLTBiNDUwYWFjLTMyYzgtMTFlOC05OWFiLWJjNmIxMzZiNmNjNy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuY29pbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmNvaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmNvaW5leC5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2luZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZXhjb20vY29pbmV4X2V4Y2hhbmdlX2FwaS93aWtpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5jb2luZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXMvbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC90aWNrZXIvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9kZWFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9maW5pc2hlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZmluaXNoZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdXNlci9kZWFscycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy53ZWJHZXRSZXNNYXJrZXQgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXVsnbWFya2V0X2luZm8nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ2J1eV9hc3NldF90eXBlJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydzZWxsX2Fzc2V0X3R5cGUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogbWFya2V0WydzZWxsX2Fzc2V0X3R5cGVfcGxhY2VzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydidXlfYXNzZXRfdHlwZV9wbGFjZXMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbnVtTWVyZ2VMZXZlbHMgPSBtYXJrZXRbJ21lcmdlJ10ubGVuZ3RoO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZXJfZmVlX3JhdGUnKSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWFrZXJfZmVlX3JhdGUnKSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2xlYXN0X2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWVyZ2UnXVtudW1NZXJnZUxldmVscyAtIDFdKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ2RhdGUnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHRpY2tlciA9IHRpY2tlclsndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdm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hZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2RlYWxfbW9uZXknKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbF9hbW91bnQnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAtIGZpbGxlZCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdkb25lJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvLyBub3RfZGVhbFxuICAgICAgICAgICAgLy8gcGFydF9kZWFsXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdpZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbF9mZWUnKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RPcmRlcicgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4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m5vbmNlICgpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhY2Nlc3NfaWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5rZXlzb3J0IChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgdXJsZW5jb2RlZCA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5oYXNoICh0aGlzLmVuY29kZSAodXJsZW5jb2RlZCArICcmc2VjcmV0X2tleT0nICsgdGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0F1dGhvcml6YXRpb24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoKG1ldGhvZCA9PT0gJ0dFVCcpIHx8IChtZXRob2QgPT09ICdERUxFVEUnKSkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB1cmxlbmNvZGVkO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICBsZXQgZGF0YSA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ2RhdGEnKTtcbiAgICAgICAgaWYgKGNvZGUgIT09ICcwJyB8fCAhZGF0YSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlQ29kZXMgPSB7XG4gICAgICAgICAgICAgICAgJzI0JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMjUnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDcnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAnNjAwJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAnNjAxJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICc2MDInOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzYwNic6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgRXJyb3JDbGFzcyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZUNvZGVzLCBjb2RlLCBFeGNoYW5nZUVycm9yKTtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvckNsYXNzIChyZXNwb25zZVsnbWVzc2FnZSddKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0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gICAgICAgICAgICdlZGl0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzQ4NDIzMDMtMjljOTlmY2EtZjcxYy0xMWU3LTgzYzEtMDlkOTAwY2IyMzM0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5jb2luZXhjaGFuZ2UuaW8vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5leGNoYW5nZWlvLmdpdGh1Yi5pby9zbGF0ZS8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvaW5leGNoYW5nZS5pby9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGN1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG1hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0bWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMTUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnMTMzNyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnNDIwRyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnNjExJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNFUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUNPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBQ1AnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEQ04nOiA1MDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFNUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBR1JJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBS1knOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FMSVMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUxMJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTU1PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVFgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOWSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJHVVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSR1VTT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUT00nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0IyQic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCMyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFLRUQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCREwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFRVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFTEEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFTkpJJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JGSSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSUdVUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVJEUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQklUQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCSVonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JMQVMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxBWlInOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxLJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTE4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkxVRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCT0FUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk9OUEFZJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPUFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JQT0snOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JSSVQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JTTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCU1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQmMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQ1JFRCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVENSRic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlREWCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEUnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRQTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVMTFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVWlonOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JYVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQzQ3JzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBQ0gnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FMQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FOTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0JBTksnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NIRUFQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDSEVTUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hJTEknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NISVBTJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NKJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVBDTyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTVgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOTkMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ08yJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPT0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPVVBFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUVNUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSQUNLRVJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDUkROQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFQSc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JFQUsnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSRVZBMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JNU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NSTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1JXJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVElDMic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1VCRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1hUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDWUNMT05FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDWURFUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQUxDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBUkknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElNRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE1CJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5DVjInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RORSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRUonOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSR04nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJTJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEVENUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RVVENIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURSQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUVDTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUdDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMQ08nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxJWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNSVJHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTlRSQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTlpPJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VRTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJTTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVNQJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VURyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSEQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSE9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUTic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVJPUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWENMJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYVE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZBSVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZBUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQVpaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZHWic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGTEFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkxJSyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUlQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlNYJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlhFJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBSU4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0InOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0JYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHREMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VFUlQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0ZDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dMUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0xUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTUInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dNWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR09LVU9MRCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0xGJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dPT0QnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1AnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dSRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JFRU5GJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHUk1EJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dSUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1JYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1dDJzogMC4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBTExPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIRUFMVEhZJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdISUdIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdITUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hOQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSE9DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT0RMJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT0xMWSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIT05FWSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSE9QRSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVUInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFlQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIWVBFUic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09UJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lGVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lNWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESUEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOU04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOWFQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU9FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJUVQnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdKQVBBTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSkVESSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSkVUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0pJTic6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQVlJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQjMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tHQic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0xDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS09CTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLT0knOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tPUlVOQSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLUkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tVQk8nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tVUlQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBTUJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQ1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTERDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRVZPJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElOREEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJTlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTE1DJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xOSyc6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRHJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVQ0snOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xWUFMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BQyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUcnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BUlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BUlMyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQVhJJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQVknOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01CQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUJJVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNRU5UQUwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUVSJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01FVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUdNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNR1QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JTE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlORVgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlOVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01OWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9JTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNT09OJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TQ04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01VRSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVVgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVhDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWFQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05CSVQnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkJYJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU9HJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FT04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05MQzInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05MRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOUk4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05STyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRDJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVUEnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlVNVVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09DJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPR04nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFSSVMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWVUnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUENOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BDUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUERHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQRUMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BHTCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSE4nOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElDTyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSUUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJR0dZJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJVlgnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BLVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEFDTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MT0InOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPU1QnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9TVyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9UJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUklNVSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJMJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVVJBJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVUkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BVVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQV0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BXUic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVUFOVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkFJTic6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSQkwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JEQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRUdBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSSE8nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUklZQSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSTUMnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUk5TJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdST0MnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUk9PRlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JVQic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVORSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVOTkVSUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlVQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQklUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NPUkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDT1JFT0xEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0ZDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTRkUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NHUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSElUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NITSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSE5EJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NIT1QnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJTEsyJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSU1QJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS09JTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tVTEwnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NMRVZJTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0xSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05PVyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU09MQVInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NQUlRTJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NSQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1NUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUQVJTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUEVSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVBFUk1BTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSR0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTWU5RJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTWU5YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCUyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVENPSU4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RFTEwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEVSJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEdUJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJR0VSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVBTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTEUnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RPUEFaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUT1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RQQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFBHJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUEknOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJBTkNFJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUkMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSVVgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RTRSc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUU1RSJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVVJCTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUZPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUxBJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTklGWSc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVTklUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VOTyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVUUMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNBJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkdTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSURaJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSVNJTyc6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkxUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT05FJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT1gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZTWCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlVMQ0FOTyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0FTSCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXQ0wnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOSyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV09NRU4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dPUk0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dPVyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXUlAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dZVic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEJDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQkwnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEJVJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hDSEUnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWENTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQ1QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hDWFQnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hERTInOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYR09YJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYR1RDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTFInOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1DQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFAnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBBU0MnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hRTic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFNBJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hTVEMnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFREJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVlMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hYWCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYWU9DJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hZWic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFpDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1haQ0QnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lIQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkNDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQ0cnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkNMJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVJVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRU5JJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRVJPJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaTUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWk9JJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pVUk1PJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1paQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0JPTic6ICdCb25QZUthTycsXG4gICAgICAgICAgICAgICAgJ0VUTic6ICdFdGhlcm5leCcsXG4gICAgICAgICAgICAgICAgJ0dEQyc6ICdHb2xkZW5DcnlwdG9Db2luJyxcbiAgICAgICAgICAgICAgICAnR1RDJzogJ0dsb2JhbFRvdXJDb2luJyxcbiAgICAgICAgICAgICAgICAnSE5DJzogJ0h1bmNvaW4nLFxuICAgICAgICAgICAgICAgICdNQVJTJzogJ01hcnNCdXgnLFxuICAgICAgICAgICAgICAgICdNRVInOiAnVGhlTWVybWFpZENvaW4nLFxuICAgICAgICAgICAgICAgICdSVUInOiAnUnViYmxlQ29pbicsXG4gICAgICAgICAgICAgICAgJ1VQJzogJ1Vwc2NhbGVUb2tlbicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0Y3VycmVuY2llcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCBwcmVjaXNpb24gPSB0aGlzLnByZWNpc2lvblsnYW1vdW50J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ0N1cnJlbmN5SUQnXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5WydUaWNrZXJDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IGN1cnJlbmN5WydXYWxsZXRTdGF0dXMnXSA9PT0gJ29ubGluZSc7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgICAgIGlmICghYWN0aXZlKVxuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdkaXNhYmxlZCc7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0bWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0SUQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnTWFya2V0QXNzZXRDb2RlJ10pO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnQmFzZUN1cnJlbmN5Q29kZSddKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBtYXJrZXRbJ01hcmtldEFzc2V0SUQnXSxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IG1hcmtldFsnQmFzZUN1cnJlbmN5SUQnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogbWFya2V0WydBY3RpdmUnXSxcbiAgICAgICAgICAgICAgICAnbG90JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRpY2tlclsnTWFya2V0SUQnXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRJZDtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMYXN0UHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaFByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xvd1ByaWNlJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZFByaWNlJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdBc2tQcmljZScpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IH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XG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3dlYmFwaS5jb2luZmxvb3IuY28udWs6ODA5MC9iaXN0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51aycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZmxvb3IvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51ay9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9lc3RpbWF0ZV9zZWxsX21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vZXN0aW1hdGVfYnV5X21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9HQlAnOiB7ICdpZCc6ICdYQlQvR0JQJywgJ3N5bWJvbCc6ICdCVEMvR0JQJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0dCUCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ1hCVC9FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUL1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdYQlQvUExOJywgJ3N5bWJvbCc6ICdCVEMvUExOJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1BMTicgfSx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ICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldElkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyY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9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdzdGF0dXMnKTtcbiAgICAgICAgaWYgKG9yZGVyWyd0eXBlJ10gPT09IDApXG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIGVsc2UgaWYgKG9yZGVyWyd0eXBlJ10gPT09IDEpXG4gICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgaWQgPSBvcmRlclsnaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGRhdGV0aW1lLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3V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dQQScsICdCRycsICdDTicsICdVUycgXSwgLy8gUGFuYW1hLCBCdWxnYXJpYSwgQ2hpbmEsIFVTXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODYxOTcwNy01YzkyMzJhOC03MjEyLTExZTctODZkNi05OGZlNWQxNWNjNmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50JzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAndXNlcic6ICdodHRwczovL2FwaS5jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly9kb2NzLmNvaW5naS5hcGlhcnkuaW8vJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3d3cnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjdXJyZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyLWJvb2sve3BhaXJ9L3thc2tDb3VudH0ve2JpZENvdW50fS97ZGVwdGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9L3ttYXhDb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzI0aG91ci1yb2xsaW5nLWFnZ3JlZ2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd1c2VyJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGQtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZS1jcnlwdG8td2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdWVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAg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gICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIC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ICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGUnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ2Jsb2NrZWQnXSArIGJhbGFuY2VbJ2luT3JkZXJzJ10gKyBiYWxhbmNlWyd3aXRoZHJhd2luZyddLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IDAuMCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IDUxMiwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5jdXJyZW50R2V0T3JkZXJCb29rUGFpckFza0NvdW50QmlkQ291bnREZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2RlcHRoJzogMzIsIC8vIG1heGltdW0gbnVtYmVyIG9mIGRlcHRoIHJhbmdlIHN0ZXBzIDEtMzJcbiAgICAgICAgICAgICdhc2tDb3VudCc6IGxpbWl0LCAvLyBtYXhpbXVtIHJldHVybmVkIG51bWJlciBvZiBhc2tzIDEtNTEyXG4gICAgICAgICAgICAnYmlkQ291bnQnOiBsaW1pdCwgLy8gb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AgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHMpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLmZldGNoVGlja2VycyAodW5kZWZpbmVkLCBwYXJhbXMpO1xuICAgICAgICBpZiAoc3ltYm9sIGluIHRpY2tlcnMpXG4gICAgICAgICAgICByZXR1cm4gdGlja2Vyc1tzeW1ib2xdO1xuICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmV0dXJuIGRpZCBub3QgY29udGFpbiAnICsgc3ltYm9sKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeVBhaXInXV07XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAg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XRDYXAnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZUFQSSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVMaW1pdE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaEJhbGFuY2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlckJvb2snOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgyNDQyNDQtOWJlNjMxMmEtNjllZC0xMWU3LTk5YzEtN2MxNzk3Mjc1MjY1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdmaWxlcyc6ICdodHRwczovL2ZpbGVzLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2NoYXJ0cyc6ICdodHRwczovL2dyYXBoLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NvaW5tYXJrZXRjYXAuY29tL2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdmaWxlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZW5lcmF0ZWQvc3RhdHMvZ2xvYmFsLmpzb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2dyYXBocyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3tuYW1lfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dsb2JhbC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2N1cnJlbmN5Q29kZXMnOiBbXG4gICAgICAgICAgICAgICAgJ0FVRCcsXG4gICAgICAgICAgICAgICAgJ0JSTCcsXG4gICAgICAgICAgICAgICAgJ0NBRCcsXG4gICAgICAgICAgICAgICAgJ0NIRicsXG4gICAgICAgICAgICAgICAgJ0NOWScsXG4gICAgICAgICAgICAgICAgJ0VVUicsXG4gICAgICAgICAgICAgICAgJ0dCUCcsXG4gICAgICAgICAgICAgICAgJ0hLRCcsXG4gICAgICAgICAgICAgICAgJ0lEUicsXG4gICAgICAgICAgICAgICAgJ0lOUicsXG4gICAgICAgICAgICAgICAgJ0pQWScsXG4gICAgICAgICAgICAgICAgJ0tSVycsXG4gICAgICAgICAgICAgICAgJ01YTicsXG4gICAgICAgICAgICAgICAgJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1VTRCcsXG4gICAgICAgICAgICBdLFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKCdGZXRjaGluZyBvcmRlciBib29rcyBpcyBub3Qgc3VwcG9ydGVkIGJ5IHRoZSBBUEkgb2YgJyArIHRoaXMuaWQpO1xuICAgIH1cblxuICAgIGN1cnJlbmN5Q29kZSAoYmFzZSwgbmFtZSkge1xuICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0ge1xuICAgICAgICAgICAgJ0FDQ2hhaW4nOiAnQUNDaGFpbicsXG4gICAgICAgICAgICAnQWRDb2luJzogJ0FkQ29pbicsXG4gICAgICAgICAgICAnQmF0Q29pbic6ICdCYXRDb2luJyxcbiAgICAgICAgICAgICdCaXRnZW0nOiAnQml0Z2VtJyxcbiAgICAgICAgICAgICdCbGF6ZUNvaW4nOiAnQmxhemVDb2luJyxcbiAgICAgICAgICAgICdCbG9ja0NBVCc6ICdCbG9ja0NBVCcsXG4gICAgICAgICAgICAnQ2F0Y29pbic6ICdDYXRjb2luJyxcbiAgICAgICAgICAgICdIaSBNdXR1YWwgU29jaWV0eSc6ICdIaSBNdXR1YWwgU29jaWV0eScsXG4gICAgICAgICAgICAnaUNvaW4nOiAnaUNvaW4nLFxuICAgICAgICAgICAgJ01hZ2dpZSc6ICdNYWdnaWUnLFxuICAgICAgICAgICAgJ01JT1RBJzogJ0lPVEEnLCAvLyBhIHNwZWNpYWwgY2FzZSwgbW9zdCBleGNoYW5nZXMgbGlzdCBpdCBhcyBJT1RBLCB0aGVyZWZvcmUgd2UgY2hhbmdlIGp1c3QgdGhlIENvaW5tYXJrZXRjYXAgaW5zdGVhZCBvZiBjaGFuZ2luZyB0aGVtIGFsbFxuICAgICAgICAgICAgJ05ldENvaW4nOiAnTmV0Q29pbicsXG4gICAgICAgICAgICAnUG9sY29pbic6ICdQb2xjb2luJyxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG5hbWUgaW4gY3VycmVuY2llcylcbiAgICAgICAgICAgIHJldHVybiBjdXJyZW5jaWVzW25hbWVdO1xuICAgICAgICByZXR1cm4gYmFzZTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB0aGlzLmN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY3VycmVuY3lDb2RlIChtYXJrZXRbJ3N5bWJvbCddLCBtYXJrZXRbJ25hbWUnXSk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hHbG9iYWwgKGN1cnJlbmN5ID0gJ1VTRCcpIHtcbiAgICAgICAgYXdha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cbiAgICAgICAgICAgICAgICBpZiAodGlja2VyW3ByaWNlS2V5XSlcbiAgICAgICAgICAgICAgICAgICAgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsIHByaWNlS2V5KTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdm9sdW1lS2V5ID0gJzI0aF92b2x1bWVfJyArIG1hcmtldFsncXVvdGVJZCddO1xuICAgICAgICAgICAgaWYgKHZvbHVtZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICAgICAgaWYgKHRpY2tlclt2b2x1bWVLZXldKVxuICAgICAgICAgICAgICAgICAgICB2b2x1bWUgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCB2b2x1bWVLZXkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IGNoYW5nZSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoY3VycmVuY3kgPSAnVVNEJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnbGltaXQnOiAxMDAwMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGN1cnJlbmN5KVxuICAgICAgICAgICAgcmVxdWVzdFsnY29udmVydCddID0gY3VycmVuY3k7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXJzID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgcmVzcG9uc2UubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVt0XTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeUlkID0gKGN1cnJlbmN5IGluIHRoaXMuY3VycmVuY2llcykgPyB0aGlzLmN1cnJlbmNpZXNbY3VycmVuY3ldWydpZCddIDogY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ2lkJ10gKyAnLycgKyBjdXJyZW5jeUlkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aWNrZXJzW3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRpY2tlcnM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY29udmVydCc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnYmFzZUlkJ10sXG4gICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHJlcXVlc3QpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xu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9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZ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nOiAnaHR0cHM6Ly9jb2lubWF0ZS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9kb2NzLmNvaW5tYXRlLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5tYXRlLmlvL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJXaXRoSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbEluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25IaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZEJpdGNvaW5EZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ19FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DWksnOiB7ICdpZCc6ICdCVENfQ1pLJywgJ3N5bWJvbCc6ICdCVEMvQ1pLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NaSycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnTFRDX0JUQycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogNSB9fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlc1tjdXJyZW5jeV1bJ3Jlc2VydmVkJ107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYmFsYW5jZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdW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ICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYW5zYWN0aW9uSWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdHJhZGVbJ3RpbWVzdGFtcCddLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0cmFkZVsndGltZXN0YW1wJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYW5zYWN0aW9ucyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnbWludXRlc0ludG9IaXN0b3J5JzogMTAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0b3RhbCddID0gYW1vdW50OyAvLyBhbW91bnQgaW4gZmlhdFxuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDsgLy8gYW1vdW50IGluIGZpYXRcbiAgICAgICAgICAgIG1ldGhvZCArPSAnSW5zdGFudCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7IC8vIGFtb3VudCBpbiBjcnlwdG9cbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgICAgICBtZXRob2QgKz0gdGhpcy5jYXBpdGFsaXplICh0eXBlKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAg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aXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2NsaWVudElkJzogdGhpcy51aWQsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3B1YmxpY0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3InXSlcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0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J3B1YmxpYyc6ICdodHRwczovL2FwaS5jb2lubmVzdC5jby5rci9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5jb2lubmVzdC5jby5rci9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmNvaW5uZXN0LmNvLmtyJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY29pbm5lc3QuY28ua3InLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbm5lc3QuY28ua3IvZG9jL2ludHJvLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb2lubmVzdGhlbHAuemVuZGVzay5jb20vaGMva28vYXJ0aWNsZXMvMTE1MDAyMTEwMjUyLSVFQSVCMSVCMCVFQiU5RSU5OC0lRUMlODglOTglRUMlODglOTglRUIlQTMlOEMlRUIlOEElOTQtJUVDJTk2JUJDJUVCJUE3JTg4JUVDJTlEJUI4JUVBJUIwJTgwJUVDJTlBJTk0LScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5uZXN0aGVscC56ZW5kZXNrLmNvbS9oYy9rby9hcnRpY2xlcy8xMTUwMDIxMTAyNzItJUVCJUI5JTg0JUVEJThBJUI4JUVDJUJEJTk0JUVDJTlEJUI4LSVFQyU4OCU5OCVFQyU4OCU5OCVFQiVBMyU4QyVFQiVBNSVCQy0lRUMlODQlQTAlRUQlODMlOUQlRUQlOTUlOTglRUIlOEElOTQtJUVDJTlEJUI0JUVDJTlDJUEwJUVBJUIwJTgwLSVFQiVBQyVCNCVFQyU5NyU4NyVFQyU5RCVCOCVFQSVCMCU4MCVFQyU5QSU5NC0nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnd2ViJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW4vYWxsY29pbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1Yi90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1Yi9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHViL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvZmV0Y2h0cnVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvdHJ1c3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAnMC4wMDInLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHF1b3RlID0gJ0tSVyc7XG4gICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIC8vIHRvZG86IHJld3JpdGUgdGhpcyBmb3Igd2ViIGVuZHBvaW50XG4gICAgICAgIGxldCBjb2lucyA9IFtcbiAgICAgICAgICAgICdidGMnLFxuICAgICAgICAgICAgJ2JjaCcsXG4gICAgICAgICAgICAnYnRnJyxcbiAgICAgICAgICAgICdiY2QnLFxuICAgICAgICAgICAgJ3VidGMnLFxuICAgICAgICAgICAgJ2J0bicsXG4gICAgICAgICAgICAna3N0JyxcbiAgICAgICAgICAgICdsdGMnLFxuICAgICAgICAgICAgJ2FjdCcsXG4gICAgICAgICAgICAnZXRoJyxcbiAgICAgICAgICAgICdldGMnLFxuICAgICAgICAgICAgJ2FkYScsXG4gICAgICAgICAgICAncXR1bScsXG4gICAgICAgICAgICAneGxtJyxcbiAgICAgICAgICAgICduZW8nLFxuICAgICAgICAgICAgJ2dhcycsXG4gICAgICAgICAgICAncnB4JyxcbiAgICAgICAgICAgICdoc3InLFxuICAgICAgICAgICAgJ2tuYycsXG4gICAgICAgICAgICAndHNsJyxcbiAgICAgICAgICAgICd0cm9uJyxcbiAgICAgICAgICAgICdvbWcnLFxuICAgICAgICAgICAgJ3d0YycsXG4gICAgICAgICAgICAnbWNvJyxcbiAgICAgICAgICAgICdzdG9ybScsXG4gICAgICAgICAgICAnZ3RvJyxcbiAgICAgICAgICAgICdweHMnLFxuICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgJ2luaycsXG4gICAgICAgICAgICAnb2MnLFxuICAgICAgICAgICAgJ2hsYycsXG4gICAgICAgICAgICAnZW50JyxcbiAgICAgICAgICAgICdxYnQnLFxuICAgICAgICAgICAgJ3NwYycsXG4gICAgICAgICAgICAncHV0JyxcbiAgICAgICAgXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvaW5zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gY29pbnNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd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mFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiBwcmljZSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFt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gICAgICAgJ251bWJlcic6IGFtb3VudCxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2lkJ10sXG4gICAgICAgICAgICAndGltZSc6IHRoaXMuc2Vjb25kcyAoKSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudF90b3RhbCc6IGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnRfb3Zlcic6IGFtb3VudCxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLnBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQpO1xuICAgICAgICByZXR1cm4gb3JkZXI7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlQ2FuY2VsICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnY29pbic6IG1hcmtldFsnYmFzZUlkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW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aXQnOiA2NjcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zODAwMzMwMC1hZGMxMmZiYS0zMjNmLTExZTgtODUyNS03MjVmNTNjNGE2NTkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5vbmUuY28ua3InLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lub25lLmNvLmtyJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZG9jLmNvaW5vbmUuY28ua3InLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2svJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2J0Y19kZXBvc2l0X2FkZHJlc3MvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2RhaWx5X2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3VzZXJfaW5mby8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdmlydHVhbF9hY2NvdW50LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsX2FsbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0X2J1eS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2xpbWl0X3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jb21wbGV0ZV9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9saW1pdF9vcmRlcnMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcl9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb24vYXV0aF9udW1iZXIvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9oaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb24va3J3L2hpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9idGMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9jb2luLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAg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gJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMCwgMC4wMDA5XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMCwgMC4wMDA4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMDAwMCwgMC4wMDA3XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAwMDAsIDAuMDAwNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwMDAwLCAwLjAwMDVdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMDAwMCwgMC4wMDA0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMDAwMDAsIDAuMDAwM10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAwMDAwLCAwLjAwMDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4wMDFdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMDAsIDAuMDAwOF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMDAsIDAuMDAwNl0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAwMDAsIDAuMDAwNF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwMDAwLCAwLjAwMDJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzMwMDAwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzQwNSc6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QWNjb3VudEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlW2lkXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKVxuICAgICAgICAgICAgICAgIGNvZGUgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbaWRdWydjb2RlJ107XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsJ10pO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdmb3JtYXQnOiAnanNvbicsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAocmVzcG9uc2UsIHVuZGVmaW5lZCwgJ2JpZCcsICdhc2snLCAncHJpY2UnLCAncXR5Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6ICdhbGwnLFxuICAgICAgICAgICAg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EJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSByZXF1ZXN0O1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLycgKyByZXF1ZXN0O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBqc29uID0gdGhpcy5qc29uICh7XG4gICAgICAgICAgICAgICAgJ2FjY2Vzc190b2tlbic6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuc3RyaW5nVG9CYXNlNjQgKHRoaXMuZW5jb2RlIChqc29uKSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5kZWNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuc2VjcmV0LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAocGF5bG9hZCwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgICAgICAnWC1DT0lOT05FLVBBWUxPQUQnOiBwYXlsb2FkLFxuICAgICAgICAgICAgICAgICdYLUNPSU5PTkUtU0lHTkFUVVJFJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdyZXN1bHQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9PSAnc3VjY2VzcycpIHtcbiAgICAgICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAgICAgLy8gICAgeyAgXCJlcnJvckNvZGVcIjogXCI0MDVcIiwgIFwic3RhdHVzXCI6IFwibWFpbnRlbmFuY2VcIiwgIFwicmVzdWx0XCI6IFwiZXJyb3JcIn1cbiAgICAgICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY29kZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdlcnJvckNvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIGV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBleGNlcHRpb25zW2NvZGVdIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBFeGNoYW5nZSA9IHJlcXVpcmUgKCcuL2Jhc2UvRXhjaGFuZ2UnKTtcbmNvbnN0IHsgRXhjaGFuZ2VFcnJvciwgTm90U3VwcG9ydGVkIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbnNlY3VyZSBleHRlbmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbnNlY3VyZScsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luc2VjdXJlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSU4nLCAvLyBJbmRpYVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NDcyLTljYmQyMDBhLTVlZDktMTFlNy05NTUxLTIyNjdhZDdiYWMwOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luc2VjdXJlL3BsdWdpbnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luL3NlYXJjaC9jb25maXJtYXRpb24ve3R4aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svbG93JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hc2svb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9iaWQvaGlnaCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXgyNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9taW4yNEhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvY2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L3NtcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmV0a2kvc2VhcmNoL3tuZXRraU5hbWV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2Jhbmsvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2t5Yy9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9vdHAve251bWJlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2RlcG9zaXQvdW5jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93YWxsZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL2NvbXBsZXRlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvcGVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vYmFsYW5jZS90b3RhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC9jYW5jZWxsZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdW52ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vZGVwb3NpdC92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Jhbmsvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9jb2luL2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9maWF0L2ZlZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9reWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2NvaW4vcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3N1Y2Nlc3NmdWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvZmlhdC9wYWlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS90cmFkZS9zdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ2luL3Rva2VuL3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9wYXNzd29yZC9mb3Jnb3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2dhL2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbmV0a2kvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvaW1hZ2UvdXBkYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGFzc3dvcmQvY2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL3Jlc2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWdudXAvdmVyaWZ5L3t0b2tlbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvaW5zdGFudC9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2FjY291bnQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvaW5pdGlhdGUvZW5hYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvc2VuZFRvRXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2djbS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbG9nb3V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsL3tkZXBvc2l0SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9jYW5jZWwve29yZGVySUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2F1dGh5L2Rpc2FibGUve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9nYS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL3Bob25lL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL2RlbGV0ZS97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkL2NhbmNlbC97d2l0aGRyYXdJRH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9JTlInOiB7ICdpZCc6ICdCVEMvSU5SJywgJ3N5bWJvbCc6ICdCVEMvSU5SJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0lOUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjQgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckV4Y2hhbmdlQmFua1N1bW1hcnkgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgbGV0IGNvaW4gPSB7XG4gICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUNvaW5CYWxhbmNlJ10sXG4gICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ3BlbmRpbmdDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsndG90YWxDb2luQmFsYW5jZSddLFxuICAgICAgICB9O1xuICAgICAgICBsZX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cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVB1dFVzZXJFeGNoYW5nZSc7XG4gICAgICAgIGxldCBvcmRlciA9IHt9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnSW5zdGFudCcgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWydtYXhGaWF0J10gPSBhbW91bnQ7XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgb3JkZXJbJ21heFZvbCddID0gYW1vdW50O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGRpcmVjdGlvbiA9IChzaWRlID09PSAnYnV5JykgPyAnQmlkJyA6ICdBc2snO1xuICAgICAgICAgICAgbWV0aG9kICs9IGRpcmVjdGlvbiArICdOZXcnO1xuICAgICAgICAgICAgb3JkZXJbJ3JhdGUnXSA9IHByaWNlO1xuICAgICAgICAgICAgb3JkZXJbJ3ZvbCddID0gYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnbWVzc2FnZSddWydvcmRlcklEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9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AgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gcmVzcG9uc2VbJ3N1Y2Nlc3MnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoISgnbWVzc2FnZScgaW4gcmVzcG9uc2UpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgbWFsZm9ybWVkIHJlc3BvbnNlOiBubyBcIm1lc3NhZ2VcIiBpbiByZXNwb25zZTogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAg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W5TcG90JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQVUnLCAvLyBBdXN0cmFsaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgyMDg0MjktM2NhY2RmOWEtNjg5Ni0xMWU3LTg1NGUtNGM3OWE3NzJhMzBmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvcHViYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2NvaW4vc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L2J1eS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L3NlbGwvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDJywgJ3N5bWJvbCc6ICdCVEMvQVVEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0FVRCc6IHsgJ2lkJzogJ0xUQycsICdzeW1ib2wnOiAnTFRDL0FVRCcsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICAgICAgJ0RPR0UvQVVEJzogeyAnaWQnOiAnRE9HRScsICdzeW1ib2wnOiAnRE9HRS9BVUQnLCAnYmFzZSc6ICdET0dFJywgJ3F1b3RlJzogJ0FVRCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE15QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzKTtcbiAgICAgICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VzW2N1cnJlbmN5XSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmICh1cHBlcmNhc2UgPT09ICdEUksnKVxuICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9X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gdW5kZWZpbmVkKSB7XG4gICAgICAgIGlmICghdGhpcy5hcGlLZXkpXG4gICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYXBpS2V5IGZvciBhbGwgcmVxdWVzdHMnKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAodGhpcy5leHRlbmQgKHsgJ25vbmNlJzogbm9uY2UgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgaHVvYmlwcm8gPSByZXF1aXJlICgnLi9odW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Nzk3MjYxLWQ1OGRmMTk2LTUzNjMtMTFlOC05ODgwLTJlYzc4ZWM1YmQyNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkuY29pbnRpZ2VyLmNvbS9leGNoYW5nZS90cmFkaW5nL2FwaS9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5jb2ludGlnZXIuY29tL2V4Y2hhbmdlL3RyYWRpbmcvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlJzogJ2h0dHBzOi8vd3d3LmNvaW50aWdlci5jb20vZXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2ludGlnZXIuY29tL2V4Y2hhbmdlL3JlZ2lzdGVyLmh0bWw/cmVmQ29kZT1GZnZEdHQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2NvaW50aWdlci9hcGktZG9jcy1lbi93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9rbGluZScsIC8vIOiOt+WPlkvnur/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwvbWVyZ2VkJywgLy8g6I635Y+W6IGa5ZCI6KGM5oOFKFRpY2tlcilcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsIC8vIOiOt+WPliBNYXJrZXQgRGVwdGgg5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLCAvLyDojrflj5YgVHJhZGUgRGV0YWlsIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvdHJhZGUnLCAvLyDmibnph4/ojrflj5bmnIDov5HnmoTkuqTmmJPorrDlvZVcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWwnLCAvLyDojrflj5YgTWFya2V0IERldGFpbCAyNOWwj+aXtuaIkOS6pOmHj+aVsOaNrlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2V4Y2hhbmdlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Zvb3Rlci90cmFkaW5ncnVsZS5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhcGkvcHVibGljL21hcmtldC9kZXRhaWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJzInOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICc1JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxNic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIGZ1bmRpbmcgcGFzc3dvcmQgbm90IHNldFxuICAgICAgICAgICAgICAgICcxMDAwMDEnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICcxMDAwMDInOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSxcbiAgICAgICAgICAgICAgICAnMTAwMDAzJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnMTAwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHRoaXMucGFyc2VKc29uUmVzcG9uc2UgPSBmYWxzZTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5leGNoYW5nZUdldEZvb3RlclRyYWRpbmdydWxlSHRtbCAoKTtcbiAgICAgICAgdGhpcy5wYXJzZUpzb25SZXNwb25zZSA9IHRydWU7XG4gICAgICAgIGxldCByb3dzID0gcmVzcG9uc2Uuc3BsaXQgKCc8dHI+Jyk7XG4gICAgICAgIGxldCBudW1Sb3dzID0gcm93cy5sZW5ndGg7XG4gICAgICAgIGxldCBsaW1pdCA9IG51bVJvd3MgLSAxO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAxOyBpIDwgbGltaXQ7IGkrKykge1xuICAgICAgICAgICAgbGV0IHJvdyA9IHJvd3NbaV07XG4gICAgICAgICAgICBsZXQgcGFydHMgPSByb3cuc3BsaXQgKCc8c3BhbiBzdHlsZT1cImNvbG9yOiNmZmZmZmZcIj4nKTtcbiAgICAgICAgICAgIGxldCBudW1QYXJ0cyA9IHBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgIGlmICgobnVtUGFydHMgPCA2KSB8fCAocGFydHNbMV0uaW5kZXhPZiAoJ0tpbmQmbmJzcCcpID49IDApKVxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgbGV0IGlkID0gcGFydHNbMV0uc3BsaXQgKCc8L3NwYW4+JylbMF07XG4gICAgICAgICAgICBsZXQgbWluQW1vdW50ID0gcGFydHNbMl0uc3BsaXQgKCc8L3NwYW4+JylbMF07XG4gICAgICAgICAgICBsZXQgbWluUHJpY2UgPSBwYXJ0c1s0XS5zcGxpdCAoJzwvc3Bhbj4nKVswXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWluQW1vdW50KSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1pblByaWNlKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZCA9IGlkLnNwbGl0ICgnJm5ic3AnKVswXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgYmFzZUlkID0gYmFzZUlkLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGVJZCA9IHF1b3RlSWQudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAndXBwZXJjYXNlSWQnOiBpZC50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWluQW1vdW50KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtaW5QcmljZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5vcHRpb25zWydtYXJrZXRzQnlVcHBlcmNhc2VJZCddID0gdGhpcy5pbmRleEJ5IChyZXN1bHQsICd1cHBlcmNhc2VJZCcpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKHRpY2tlciwgJ2lkJyk7XG4gICAgICAgIGxldCBjbG9zZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0Jyk7XG4gICAgICAgIGxldCBwZXJjZW50YWdlID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3BlcmNlbnRDaGFuZ2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaDI0aHInKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93MjRocicpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd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21hcmtldHNCeVVwcGVyY2FzZUlkJ11baWRdWydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAocmVzcG9uc2VbaWRdLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICAvL1xuICAgICAgICAvLyAgICAge1xuICAgICAgICAvLyAgICAgICAgIFwidm9sdW1lXCI6IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJhbW91bnRcIjogXCIxLjAwMFwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuaIkOS6pOmHj1wiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgIC8vICAgICAgICAgXCJwcmljZVwiOiB7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwiYW1vdW50XCI6IFwiMC4wNDk3ODg4M1wiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuWnlOaJmOS7t+agvFwiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgLy8gICAgICAgICBcImNyZWF0ZWRfYXRcIjogMTUxMzI0NTEzNDAwMCxcbiAgICAgICAgLy8gICAgICAgICBcImRlYWxfcHJpY2VcIjoge1xuICAgICAgICAvLyAgICAgICAgICAgICBcImFtb3VudFwiOiAwLjA0OTc4ODgzMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImljb25cIjogXCJcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJ0aXRsZVwiOiBcIuaIkOS6pOS7t+agvFwiXG4gICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAvLyAgICAgICAgIFwiaWRcIjogMTM4XG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCBzaWRlID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3NpZGUnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHByaWNlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBzaWRlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc2lkZSA9IHNpZGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ByaWNlJyk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlWydwcmljZSddLCAnYW1vdW50Jyk7XG4gICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGVbJ3ZvbHVtZSddLCAnYW1vdW50Jyk7XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlWydkZWFsX3ByaWNlJ10sICdhbW91bnQnKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICA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Sk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT0hMQ1ZzIChyZXNwb25zZVsnZGF0YSddWydrbGluZV9kYXRhJ10sIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlckJhbGFuY2UgKHBhcmFtcyk7XG4gICAgICAgIC8vXG4gICAgICAgIC8vICAgICB7XG4gICAgICAgIC8vICAgICAgICAgXCJjb2RlXCI6IFwiMFwiLFxuICAgICAgICAvLyAgICAgICAgIFwibXNnXCI6IFwic3VjXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJkYXRhXCI6IFt7XG4gICAgICAgIC8vICAgICAgICAgICAgIFwibm9ybWFsXCI6IFwiMTgxMy4wMTE0NDE3OVwiLFxuICAgICAgICAvLyAgICAgICAgICAgICBcImxvY2tcIjogXCIxMzI1LjQyMDM2Nzg1XCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiY29pblwiOiBcImJ0Y1wiXG4gICAgICAgIC8vICAgICAgICAgfSwge1xuICAgICAgICAvLyAgICAgICAgICAgICBcIm5vcm1hbFwiOiBcIjk1NTEuOTY2OTIyNDRcIixcbiAgICAgICAgLy8gICAgICAgICAgICAgXCJsb2NrXCI6IFwiNTQ3LjA2NTA2NzE3XCIsXG4gICAgICAgIC8vICAgICAgICAgICAgIFwiY29pblwiOiBcImV0aFwiXG4gICAgICAgIC8vICAgICAgICAgfV1cbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy9cbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB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iAocmVtYWluaW5nID4gMCkpXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGlmICghdGhpcy5wYXNzd29yZClcbiAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yICh0aGlzLmlkICsgJyBjcmVhdGVPcmRlciByZXF1aXJlcyBleGNoYW5nZS5wYXNzd29yZCB0byBiZSBzZXQgdG8gdXNlciB0cmFkaW5nIHBhc3N3b3JkIChub3QgbG9naW4gcGFzc3dvcmQhKScpO1xuICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJUeXBlID0gKHR5cGUgPT09ICdsaW1pdCcpID8gMSA6IDI7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyVHlwZSxcbiAgICAgICAgICAgICd2b2x1bWUnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnY2FwaXRhbF9wYXNzd29yZCc6IHRoaXMucGFzc3dvcmQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICgodHlwZSA9PT0gJ21hcmtldCcpICYmIChzaWRlID09PSAnYnV5JykpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmVxdWlyZXMgcHJpY2UgYXJndW1lbnQgZm9yIG1hcmtldCBidXkgb3JkZXJzIHRvIGNhbGN1bGF0ZSB0b3RhbCBjb3N0IGFjY29yZGluZyB0byBleGNoYW5nZSBydWxlcycpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgb3JkZXJbJ3ZvbHVtZSddID0gdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiBwcmljZSk7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlciAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIHtcIm9yZGVyX2lkXCI6MzQzNDN9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgIC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JpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RpbWUnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gJyc7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGtleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBhdXRoICs9IGtleXNbaV0gKyBxdWVyeVtrZXlzW2ldXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGF1dGggKz0gdGhpcy5zZWNyZXQ7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKTtcbiAgICAgICAgICAgIGxldCBpc0NyZWF0ZU9yZGVyTWV0aG9kID0gKHBhdGggPT09ICdvcmRlcicpICYmIChtZXRob2QgPT09ICdQT1NUJyk7XG4gICAgICAgICAgICBsZXQgdXJsUGFyYW1zID0gaXNDcmVhdGVPcmRlck1ldGhvZCA/IHt9IDogcXVlcnk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXBpX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgfSwgdXJsUGFyYW1zKSkpO1xuICAgICAgICAgICAgdXJsICs9ICcmc2lnbj0nICsgdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaV9rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICB7XCJjb2RlXCI6XCIxMDAwMDVcIixcIm1zZ1wiOlwicmVxdWVzdCBzaWduIGlsbGVnYWxcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIGNvZGUgIT09ICd1bmRlZmluZWQnKSAmJiAoY29kZSAhPT0gJzAnKSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ21zZycpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgPT09IDIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ29mZnNldE5vdCBOdWxsJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ1BhcmFtZXRlciBlcnJvcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgZXhjZXB0aW9uc1tjb2RlXSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHVua25vd24gXCJlcnJvclwiIHZhbHVlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxufTtcblxuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGNvaW5lZ2cgPSByZXF1aXJlICgnLi9jb2luZWdnLmpzJyk7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjb29sY29pbiBleHRlbmRzIGNvaW5lZ2cge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdjb29sY29pbicsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb29sQ29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJyxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzY3NzA1MjktYmU3YjFhMDQtMWM1Yi0xMWU4LTk2MDAtZDExZjE5OTZiNTM5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5jb29sY29pbi5jb20vY29pbicsXG4gICAgICAgICAgICAgICAgICAgICdyZXN0JzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbS9hcGkvdjEnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb29sY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29vbGNvaW4uY29tL2hlbHAuYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmNvb2xjb2luLmNvbS9zcGVuZC5wcmljZS5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQkMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTREMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVMnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDVCc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FLJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQ1MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hDQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VDJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lGQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQR0MnOiAnMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tUQyc6ICcxJScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5UJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAnMC41JScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tUJzogJzElJyxcbiAgICAgICAgICAgICAgICAg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gICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL0NhdGVnb3J5LzQ1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU2JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZVBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXQve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJzL3tpZH0ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJHcm91cHMve2lkc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldE9yZGVyR3JvdXBzL3tpZHN9L3tjb3VudH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbFRyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRpcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQUNDJzogJ0FkQ29pbicsXG4gICAgICAgICAgICAgICAgJ0JBVCc6ICdCYXRDb2luJyxcbiAgICAgICAgICAgICAgICAnQkxaJzogJ0JsYXplQ29pbicsXG4gICAgICAgICAgICAgICAgJ0JURyc6ICdCaXRnZW0nLFxuICAgICAgICAgICAgICAgICdDQyc6ICdDQ1gnLFxuICAgICAgICAgICAgICAgICdDTVQnOiAnQ29tZXQnLFxuICAgICAgICAgICAgICAgICdGQ04nOiAnRmFjaWxlY29pbicsXG4gICAgICAgICAgICAgICAgJ0ZVRUwnOiAnRkMyJywgLy8gRnVlbENvaW4gIT0gRlVFTFxuICAgICAgICAgICAgICAgICdIQVYnOiAnSGF2ZWNvaW4nLFxuICAgICAgICAgICAgICAgICdMREMnOiAnTEFEQUNvaW4nLFxuICAgICAgICAgICAgICAgICdNQVJLUyc6ICdCaXRtYXJrJyxcbiAgICAgICAgICAgICAgICAnTkVUJzogJ05ldENvaW4nLFxuICAgICAgICAgICAgICAgICdRQlQnOiAnQ3ViaXRzJyxcbiAgICAgICAgICAgICAgICAnV1JDJzogJ1dhckNvaW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnNFcnJvcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRUcmFkZVBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ0RhdGEnXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ0xhYmVsJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydTeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydCYXNlU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBtYXJrZXRbJ01pbmltdW1UcmFkZSddO1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pbmltdW1QcmljZSddLFxuICAgICAgICAgICAgICAgICdtYXgnOiBtYXJrZXRbJ01heGltdW1QcmljZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydNYXhpbXVtVHJhZGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ01pbmltdW1CYXNlVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ1N0YXR1cyddID09PSAnT0snO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdsYWJlbCc6IG1hcmtldFsnTGFiZWwnXSxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFya2V0WydUcmFkZUZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogbGltaXRzWydhbW91bnQnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLm9wdGlvbnNbJ21hcmtldHNCeUxhYmVsJ10gPSB0aGlzLmluZGV4QnkgKHJlc3VsdCwgJ2xhYmVsJyk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgI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VZvbHVtZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgaWYgKGJhc2VWb2x1bWUgPiAwKVxuICAgICAgICAgICAgICAgICAgICB2d2FwID0gcXVvdGVWb2x1bWUgLyBiYXNlVm9sdW1lO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnTG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0JpZFByaWNlJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdBc2tQcmljZScpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogb3BlbixcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBjaGFuZ2UsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdDaGFuZ2UnKSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zd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iAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdQcmljZScpO1xuICAgICAgICBpZiAoIXByaWNlKVxuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdSYXRlJyk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnVG90YWwnKTtcbiAgICAgICAgbGV0IGlkID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ1RyYWRlSWQnKTtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnVHJhZGVQYWlySWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgICAgIGlmICh0cmFkZVsnVHJhZGVQYWlySWQnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnVHJhZGVQYWlySWQnXV07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmICgnRmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRyYWRlWydGZWUnXSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAg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zICE9PSAnb2snKVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ05hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydXaXRoZHJhd0ZlZSddLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnTWluQmFzZVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ01pbldpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogY3VycmVuY3lbJ01heFdpdGhkcmF3J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRCYWxhbmNlIChwYXJhbXMpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGJhbGFuY2VbJ1N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydBdmFpbGFibGUnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydUb3RhbCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAg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V0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFN1Ym1pdFRyYWRlICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY3JlYXRlT3JkZXIgcmV0dXJuZWQgdW5rbm93biBlcnJvcjogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBpZiAoJ0RhdGEnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAoJ09yZGVySWQnIGluIHJlc3BvbnNlWydEYXRhJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ0RhdGEnXVsnT3JkZXJJZCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGlkID0gcmVzcG9uc2VbJ0RhdGEnXVsnT3JkZXJJZCddLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiBhbW91bnQgLSBmaWxsZWQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIGlmIChpZClcbiAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlbmQgKHsgJ2luZm8nOiByZXNwb25zZSB9LCBvcmRlcik7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdUeXBlJzogJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAnT3JkZXJJZCc6IGlkLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdWydzdGF0dXMnXSA9ICdjYW5jZWxlZCc7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmxhc3RfanNvbl9yZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nICh0aGlzLmxhc3RfanNvbl9yZXNwb25zZSwgJ0Vycm9yJyk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ2RvZXMgbm90IGV4aXN0JykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIGlmICgnTWFya2V0JyBpbiBvcmRlcikge1xuICAgICAgICAgICAgbGV0IGlkID0gb3JkZXJbJ01hcmtldCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3B0aW9uc1snbWFya2V0c0J5TGFiZWwnXSkge1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm9wdGlvbnNbJ21hcmtldHNCeUxhYmVsJ11baWRdO1xuICAgICAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdBbW91bnQnKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1JlbWFpbmluZycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ09yZGVySWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdGhpcy5vbWl0IChvcmRlciwgJ3N0YXR1cycpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvb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RzW2tdO1xuICAgICAgICAgICAgaWYgKGlkIGluIG9wZW5PcmRlcnNJbmRleGVkQnlJZCkge1xuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIG9wZW5PcmRlcnNJbmRleGVkQnlJZFtpZF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHN5bWJvbCA9PT0gJ3VuZGVmaW5lZCcpIHx8IChvcmRlclsnc3ltYm9sJ10gPT09IHN5bWJvbCkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IG9yZGVyWydhbW91bnQnXSAqIG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgaWYgKCh0eXBlb2Ygc3ltYm9sID09PSAndW5kZWZpbmVkJykgfHwgKG9yZGVyWydzeW1ib2wnXSA9PT0gc3ltYm9sKSlcbiAgICAgICAgICAgICA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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgZHN4IGV4dGVuZHMgbGlxdWkge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdkc3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnRFNYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVUsnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MDI3NS0xNDEzMTU4YS02NDVhLTExZTctOTMxYy05NDcxN2Y3NTEwZTMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vZHN4LnVrL21hcGknLCAvLyBtYXJrZXQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2RzeC51ay90YXBpJywgLy8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICAnZHdhcGknOiAnaHR0cHM6Ly9kc3gudWsvZHdhcGknLCAvLyBkZXBvc2l0L3dpdGhkcmF3XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZHN4LnVrJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2RzeC51ay9hcGlfZG9jcy9wcml2YXRlJyxcbiAgICAgICAgICAgICAgICAgICAgJycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgIC8vIG1hcmtldCBkYXRhIChwdWJsaWMpXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXJzRnJvbU1vbWVudC97aWR9L3twZXJpb2R9L3tzdGFydH0nLCAvLyBlbXB0eSByZXBseSA6XFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhc3RCYXJzL3tpZH0ve3BlcmlvZH0ve2Ftb3VudH0nLCAvLyBwZXJpb2QgaXMgKG0sIGggb3IgZClcbiAgICAgICAgICAgICAgICAgICAgICAgICdwZXJpb2RCYXJzL3tpZH0ve3BlcmlvZH0ve3N0YXJ0fS97ZW5kfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyB0cmFkaW5nIChwcml2YXRlKVxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAvLyBkZXBvc2l0IC8gd2l0aGRyYXcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ2R3YXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDcnlwdG9EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRXaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25TdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAg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ICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXInKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGdldE9yZGV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gICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGZWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hGdW5kaW5nRmVlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0ZlZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnM2gnOiAnM2gnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxRCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzdEJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMTREJyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc1NTU1MjYtNzAxOGE3N2MtMjlmOS0xMWU4LTg4MzUtOGU0MTVjMDM4YTE4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5ldGhmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZXRoZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjEvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuZXRoZmluZXguY29tL2FwaV9kb2NzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5jb25zdCBFeGNoYW5nZSA9IHJlcXVpcm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bXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlclRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJCb29rcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ5MS0xYjBlYTk1Ni01ZWRhLTExZTctOTIyNS00MGQ2N2I0ODFiOGQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmV4bW8uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vZXhtby5tZS8/cmVmPTEzMTY4NScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZXhtby5tZS9lbi9hcGlfZG9jP3JlZj0xMzE2ODUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2V4bW8tZGV2L2V4bW9fYXBpX2xpYi90cmVlL21hc3Rlci9ub2RlanMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9leG1vLmNvbS9lbi9kb2NzL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcl9zZXR0aW5ncycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2NhbmNlbGxlZF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVxdWlyZWRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NyeXB0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19nZXRfdHhpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjb2RlX2xvYWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMzUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogNTAsXG4gICAgICAgIC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LCAvLyBQcmljZSBieSBvcmRlciBpcyBsZXNzIHRoYW4gcGVybWlzc2libGUgbWluaW11bSBmb3IgdGhpcyBwYWlyXG4gICAgICAgICAgICAgICAgJzUwMzIxJzogSW52YWxpZE9yZGVyLCAvLyBQcmljZSBieSBvcmRlciBpcyBtb3JlIHRoYW4gcGVybWlzc2libGUgbWF4aW11bSBmb3IgdGhpcyBwYWlyXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpclNldHRpbmdzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQucmVwbGFjZSAoJ18nLCAnLycpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3F1YW50aXR5JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9xdWFudGl0eScpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfcHJpY2UnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9hbW91bnQnKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0a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mVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgY29uc3QgbGFzdCA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0X3RyYWRlJyk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eV9wcmljZScpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbF9wcmljZScpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhdmcnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbCcpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXJyJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVtpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2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IHBhcnNlRmxvYXQgKGFtb3VudCk7XG4gICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAocHJpY2UpO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiAwLjAsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgIHJldHVybiB0aGlzLmV4dGVuZCAoeyAnaW5mbyc6IHJlc3BvbnNlIH0sIG9yZGVyKTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0g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gICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ2Nsb3NlZCcsIC8vIGxpa2V3aXNlIGl0IG1pZ2h0IGhhdmUgYmVlbiBjYW5jZWxlZCBleHRlcm5hbGx5ICh1bm5vdGljZWQgYnkgXCJ1c1wiKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2Nvc3QnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2ZpbGxlZCddICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlclsnY29zdCddID0gb3JkZXJbJ2ZpbGxlZCddICogb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnRvQXJyYXkgKHRoaXMub3JkZXJzKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB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lZmluZWQ7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzaWRlID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3R5cGUnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0SWQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoJ3BhaXInIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0SWQgPSBvcmRlclsncGFpciddO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgoJ2luX2N1cnJlbmN5JyBpbiBvcmRlcikgJiYgKCdvdXRfY3VycmVuY3knIGluIG9yZGVyKSkge1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09PSAnYnV5JylcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0SWQgPSBvcmRlclsnaW5fY3VycmVuY3knXSArICdfJyArIG9yZGVyWydvdXRfY3VycmVuY3knXTtcbiAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgIG1hcmtldElkID0gb3JkZXJbJ291dF9jdXJyZW5jeSddICsgJ18nICsgb3JkZXJbJ2luX2N1cnJlbmN5J107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoKHR5cGVvZiBtYXJrZXRJZCAhPT0gJ3VuZGVmaW5lZCcpICYmIChtYXJrZXRJZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IGFtb3VudE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gICAgICAgICAgICAgICBpZiAodGltZXN0YW1wID4gdHJhZGVbJ3RpbWVzdGFtcCddKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wID0gdHJhZGVbJ3RpbWVzdGFtcCddO1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgKz0gdHJhZGVbJ2Ftb3VudCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgLy8gZmVlQ29zdCArPSB0cmFkZVsnZmVlJ11bJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgIGNvc3QgKz0gdHJhZGVbJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgdHJhZGVzLnB1c2ggKHRyYWRlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiB0aW1lc3RhbXAgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaXNvODYwMSA9IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpOyAvLyBpbiBjYXNlIHdlIG5lZWQgdG8gcmVkZWZpbmUgaXQgZm9yIGNhbmNlbGVkIG9yZGVyc1xuICAgICAgICBpZiAoZmlsbGVkID49IGFtb3VudClcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICBlbHNlXG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMuZ2V0TWFya2V0RnJvbVRyYWRlcyAodHJhZGVzKTtcbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBmZWVDdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGZpbGxlZCA+IDApXG4gICAgICAgICAgICAgICAgcHJpY2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogaXNvODYwMSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBnZXRNYXJrZXRGcm9tVHJhZGVzICh0cmFkZXMpIHtcbiAgICAgICAgbGV0IHRyYWRlc0J5U3ltYm9sID0gdGhpcy5pbmRleEJ5ICh0cmFkZXMsICdwYWlyJyk7XG4gICAgICAgIGxldCBzeW1ib2xzID0gT2JqZWN0LmtleXMgKHRyYWRlc0J5U3ltYm9sKTtcbiAgICAgICAgbGV0IG51bVN5bWJvbHMgPSBzeW1ib2xzLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bVN5bWJvbHMgPT09IDEpXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5tYXJrZXRzW3N5bWJvbHNbMF1dO1xuICAgICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGN1cnJlbmN5LCBhbW91bnQsIGFkZHJlc3MsIHRhZyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgdGFnICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHJlcXVlc3RbJ2ludm9pY2UnXSA9IHRhZztcbiAgICAgICAgbGV0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhd0NyeXB0ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3VsdCxcbiAgICAgICAgICAgICdpZCc6IHJlc3VsdFsndGFza19pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICdub25jZSc6IG5vbmNlIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGh0dHBDb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKChib2R5WzBdID09PSAneycpIHx8IChib2R5WzBdID09PSAnWycpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHtcInJlc3VsdFwiOmZhbHNlLFwiZXJyb3JcIjpcIkVycm9yIDUwMDUyOiBJbnN1ZmZpY2llbnQgZnVuZHNcIn1cbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIGxldCBzdWNjZXNzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncmVzdWx0JywgZmFsc2UpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygc3VjY2VzcyA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKChzdWNjZXNzID09PSAndHJ1ZScpIHx8IChzdWNjZXNzID09PSAnMScpKVxuICAgICAgICAgICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3MgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCFzdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBjb2RlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBtZXNzYWdlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yUGFydHMgPSBtZXNzYWdlLnNwbGl0ICgnOicpO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtUGFydHMgPSBlcnJvclBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG51bVBhcnRzID4gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JTdWJQYXJ0cyA9IGVycm9yUGFydHNbMF0uc3BsaXQgKCcgJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbnVtU3ViUGFydHMgPSBlcnJvclN1YlBhcnRzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUgPSAobnVtU3ViUGFydHMgPiAxKSA/IGVycm9yU3ViUGFydHNbMV0gOiBlcnJvclN1YlBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGZlZWRiYWNrID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgICAgICBj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gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCAvIDEwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNzc3MDI5Mi1mYmY2MTNkMC0yZGU0LTExZTgtOWY3OS1mMmRjNDUxYjhjY2IuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmV4eC5jb20vZGF0YS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdHJhZGUuZXh4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5leHguY29tLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5leHguY29tL2hlbHAvcmVzdEFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuZXh4LmNvbS9oZWxwL3JhdGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0MnOiAwLjAwMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JPVCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDI1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBZJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOSyc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNPJzogMC42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PTkEnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBU0gnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNBU0gnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgdXBwZXIgPSBpZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlci5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnaXNPcGVuJ10gPT09IHRydWU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUludCAobWFya2V0WydhbW91bnRTY2FsZSddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwYXJzZUludCAobWFya2V0WydwcmljZVNjYWxlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0aWNrZXJbJ2RhdGUnXSk7XG4gICAgICAgIHRpY2tlciA9IHRpY2tlclsndGlja2VyJ107XG4gICAgICAgIGxld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WRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdGlja2VyID0ge1xuICAgICAgICAgICAgICAgICdkYXRlJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgICAgICd0aWNrZXInOiB0aWNrZXJzW2lkXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCBvcmRlcmJvb2tbJ3RpbWVzdGFtcCddKTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2Ftb3VudCcpO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSAqIGFtb3VudCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdHJhZGVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAodHJhZGV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lcycpLFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdpZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSByZXNwb25zZVsnaWQnXTtcbiAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0cmFkZV9kYXRlJzogdGhpcy5taWxsaXNlY29uZHMgKCksXG4gICAgICAgICAgICAndG90YWxfYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9LCBtYXJrZXQpO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIG9yZGVyO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRDYW5jZWwgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1z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5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1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gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzQnlEYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFByb2R1Y3RQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZXRVc2VySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTW9kaWZ5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxBbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAzNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY1Bvc3RHZXRQcm9kdWN0UGFpcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Byb2R1Y3RQYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydwcm9kdWN0MUxhYmVsJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3Byb2R1Y3QyTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ3Byb2R1Y3QxRGVjaW1hbFBsYWNlcycpLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ3Byb2R1Y3QyRGVjaW1hbFBsYWNlcycpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICA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AgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnaW5jb21pbmdPcmRlclNpZGUnXSA9PT0gMCkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydweCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydxdHknXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0VHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lucyc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdzdGFydEluZGV4JzogLTEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2VbJ3RyYWRl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udGVudC5jb20vMTI5NDQ1NC8yNzk5MTQxMy0xMWI0MGQ0Mi02NDdmLTExZTctOTFlZS03OGNlZDg3NGRkMDkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2ZveGJpdC5leGNoYW5nZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2JsaW5rdHJhZGUuY29tL2RvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0JsaW5rdHJhZGUgQVBJJyxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RpY2tlcicsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS9vcmRlcmJvb2snLCAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vdHJhZGVzJywgICAgLy8gP2NyeXB0b19jdXJyZW5jeT1CVEMmc2luY2U9PFRJTUVTVEFNUD4mbGltaXQ9PE5VTUJFUj5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdEJywgICAvLyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0YnLCAgIC8vIGNhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1UyJywgIC8vIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNCcsICAvLyBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNicsICAvLyB3aXRoZHJhd1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UxOCcsIC8vIGRlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjQnLCAvLyBjb25maXJtIHdpdGhkcmF3YWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMjYnLCAvLyBsaXN0IHdpdGhkcmF3YWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTMwJywgLy8gbGlzdCBkZXBvc2l0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UzNCcsIC8vIGxlZGdlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1U3MCcsIC8vIGNhbmNlbCB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1ZFRic6IHsgJ2lkJzogJ0JUQ1ZFRicsICdzeW1ib2wnOiAnQlRDL1ZFRicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdWRUYnLCAnYnJva2VySWQnOiAxLCAnYnJva2VyJzogJ1N1ckJpdGNvaW4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9WTkQnOiB7ICdpZCc6ICdCVENWTkQnLCAnc3ltYm9sJzogJ0JUQy9WTkQnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVk5EJywgJ2Jyb2tlcklkJzogMywgJ2Jyb2tlcic6ICdWQlRDJyB9LFxuICAgICAgICAgICAgICAgICdCVEM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ICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeVRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdjcnlwdG9fY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJTaWRlID0gKHNpZGUgPT09ICdidXknKSA/ICcxJyA6ICcyJztcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ0NsT3JkSUQnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgJ1N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdTaWRlJzogb3JkZXJTaWRlLFxuICAgICAgICAgICAgJ09yZFR5cGUnOiAnMicsXG4gICAgICAgICAgICAnUHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdPcmRlclF0eSc6IGFtb3VudCxcbiAgICAgICAgICAgICdCcm9rZXJJRCc6IG1hcmtldFsnYnJva2VySWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0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AnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoeyAnTXNnVHlwZSc6IHBhdGggfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAobm9uY2UpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ1N0YXR1cycgaW4gcmVzcG9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ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTEyLTMxMDE5NzcyLTVlZGItMTFlNy04MjQxLTJlNjc1ZTY3OTdmMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuZnlic2Uuc2UvYXBpL1NFSycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5meWJzZS5zZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vZG9jcy5meWIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJkZXRhaWxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFjY2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlbmRpbmdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGVuZGluZ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1NFSyc6IHsgJ2lkJzogJ1NFSycsICdzeW1ib2wnOiAnQlRDL1NFSycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdTRUsnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldGFjY2luZm8gKCk7XG4gICAgICAgIGxldCBidGMgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydidGNCYWwnXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB0aGlzLnN5bWJvbHNbMF07XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMubWFya2V0c1tzeW1ib2xdWydxdW90ZSddO1xuICAgICAgICBsZXQgbG93ZXJjYXNlID0gcXVvdGUudG9Mb3dlckNhc2UgKCkgKyAnQmFsJztcbiAgICAgICAgbGV0IGZpYXQgPSBwYXJzZUZsb2F0IChiYWxhbmNlW2xvd2VyY2FzZV0pO1xuICAgICAgICBsZXQgY3J5cHRvID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBidGMsXG4gICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICd0b3RhbCc6IGJ0YyxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ0JUQyc6IGNyeXB0byB9O1xuICAgICAgICByZXN1bHRbcXVvdGVdID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBmaWF0LFxuICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAndG90YWwnOiBmaWF0LFxuICAgICAgICB9O1x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mluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZX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ydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcyNGgnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg2NDY4MTctNTA4NDU3ZjItNzI2Yy0xMWU3LTllZWItMzUyOGQyNDEzYTU4LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nYXRlY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dhdGVjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0dhdGVjb2luL1JFU1RmdWwtQVBJLUltcGxlbWVudGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbS9zd2FnZ2VyLXVpL2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgIC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ZmVyZW5jZS9JbmNvbWVTb3VyY2VMaXN0JywgLy8gR2V0IHRoZSBpbmNvbWUgc291cmNlIGxpc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlbmNlL1ZlcmlmaWNhdGlvbkxldmVsTGlzdCcsIC8vIEdldCB0aGUgdmVyaWYgbGV2ZWwgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdTdHJlYW0vUHVibGljQ2hhbm5lbCcsIC8vIEdldCB0aGUgcHVibGljIHB1Ym51YiBjaGFubmVsIGxpc3RcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhwb3J0L1RyYW5zYWN0aW9ucycsIC8vIFJlcXVlc3QgYSBleHBvcnQgb2YgYWxsIHRyYWRlcyBmcm9tIGJhc2VkIG9uIGN1cnJlbmN5cGFpciwgc3RhcnQgZGF0ZSBhbmQgZW5kIGRhdGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdQaW5nJywgLy8gUG9zdCBhIHN0cmluZywgdGhlbiBnZXQgaXQgYmFjay5cbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvVW5zdWJzY3JpYmUve0VtYWlsQ29kZX0nLCAvLyBMZXRzIHRoZSB1c2VyIHVuc3Vic2NyaWJlIGZyb20gZW1haWxzXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVnaXN0ZXJVc2VyJywgLy8gSW5pdGlhbCB0cmFkZXIgcmVnaXN0cmF0aW9uLlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Db3Jwb3JhdGVEYXRhJywgLy8gR2V0IGNvcnBvcmF0ZSBhY2NvdW50IGRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50QWRkcmVzcycsIC8vIENoZWNrIGlmIHJlc2lkZW5jZSBwcm9vZiB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIENoZWNrIGlmIHJlZ2lzdGVyZWQgZG9jdW1lbnQgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBDaGVjayBpZiBJRCBkb2N1bWVudCBjb3B5IHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsJywgLy8gR2V0IHVzZXIgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0ZlZVJhdGUnLCAvLyBHZXQgZmVlIHJhdGUgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0xldmVsJywgLy8gR2V0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gR2V0IHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Qcm9maWxlJywgLy8gR2V0IHRyYWRlciBwcm9maWxlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBHZXQgcmVmZXJyYWwgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsQ29kZScsIC8vIEdldCB0aGUgcmVmZXJyYWwgY29kZSBvZiB0aGUgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmFsTmFtZXMnLCAvLyBHZXQgbmFtZXMgb2YgcmVmZXJyZWQgdHJhZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxSZXdhcmQnLCAvLyBHZXQgcmVmZXJyYWwgcmV3YXJkIGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJlZENvZGUnLCAvLyBHZXQgcmVmZXJyYWwgY29kZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVzaWRlbnRJbmZvcm1hdGlvbicsIC8vIEdldCBTdGVwMiBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9TZWN1cml0eVNldHRpbmdzJywgLy8gR2V0IHZlcmlmIGRldGFpbHMgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1VzZXInLCAvLyBHZXQgYWxsIHVzZXIgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FQSUtleS9BUElLZXknLCAvLyBHZXQgQVBJIEtleSBmb3IgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0Nvbm5lY3Rpb25IaXN0b3J5JywgLy8gR2V0cyBjb25uZWN0aW9uIGhpc3Rvcnkgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdCYWxhbmNlL0JhbGFuY2VzJywgLy8gR2V0cyB0aGUgYXZ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ICAgJ1RyYWRlL1RyYWRlcycsIC8vIEdldHMgYWxsIHRyYW5zYWN0aW9ucyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1VzZXJUcmFkZXMnLCAvLyBHZXRzIGFsbCB0cmFuc2FjdGlvbnMgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEFkZHJlc3MnLCAvLyBVcGxvYWQgYWRkcmVzcyBwcm9vZiBkb2N1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRDb3Jwb3JhdGlvbicsIC8vIFVwbG9hZCByZWdpc3RlcmVkIGRvY3VtZW50IGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBsb2FkIElEIGRvY3VtZW50IGNvcHlcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1JlcXVlc3RWZXJpZnknLCAvLyBSZXF1ZXN0IGZvciB2ZXJpZmljYXRpb24gZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsL1ZlcmlmeScsIC8vIFZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvR29vZ2xlQXV0aCcsIC8vIEVuYWJsZSBnb29nbGUgYXV0aFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBSZXF1ZXN0IHZlcmlmIGxldmVsIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdGlvbm5haXJlJywgLy8gRmlsbCB0aGUgcXVlc3Rpb25uYWlyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWwnLCAvLyBQb3N0IGEgcmVmZXJyYWwgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUElLZXkvQVBJS2V5JywgLy8gQ3JlYXRlIGEgbmV3IEFQSSBrZXkgZm9yIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9DaGFuZ2VQYXNzd29yZCcsIC8vIENoYW5nZSBwYXNzd29yZC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0ZvcmdvdFBhc3N3b3JkJywgLy8gUmVxdWVzdCByZXNldCBwYXNzd29yZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvRm9yZ290VXNlcklEJywgLy8gUmVxdWVzdCB1c2VyIGlkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dpbicsIC8vIFRyYWRlciBzZXNzaW9uIGxvZyBpbi5cbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0xvZ291dCcsIC8vIExvZ291dCBmcm9tIHRoZSBjdXJyZW50IHNlc3Npb24uXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Mb2dvdXRPdGhlclNlc3Npb25zJywgLy8gTG9nb3V0IG90aGVyIHNlc3Npb25zLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvUmVzZXRQYXNzd29yZCcsIC8vIFJlc2V0IHBhc3N3b3JkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9UcmFuc2FjdGlvbnMnLCAvLyBSZXF1ZXN0IGEgdHJhbnNmZXIgZnJvbSB0aGUgdHJhZGVycyBhY2NvdW50IG9mIHRoZSBsb2dnZWQgaW4gdXNlci4gVGhpcyBpcyBvbmx5IGF2YWlsYWJsZSBmb3IgYmFuayBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9Vc2VyQWNjb3VudHMnLCAvL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zLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ05vdGlmaWNhdGlvbi9NZXNzYWdlcycsIC8vIE1hcmsgYWxsIGFzIHJlYWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdOb3RpZmljYXRpb24vTWVzc2FnZXMve0lEfScsIC8vIE1hcmsgYXMgcmVhZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL09yZGVycycsIC8vIFBsYWNlIGFuIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9TdG9wT3JkZXJzJywgLy8gUGxhY2UgYSBzdG9wIG9yZGVyIGF0IHRoZSBleGNoYW5nZS5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3B1dCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBVcGRhdGUgdXNlciBjb21wYW55IGRhdGEgZm9yIGNvcnBvcmF0ZSBhY2NvdW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudElEJywgLy8gVXBkYXRlIElEIGRvY3VtZW50IG1ldGEgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJbmZvcm1hdGlvbicsIC8vIFVwZGF0ZSBTdGVwMyBEYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9FbWFpbCcsIC8vIFVwZGF0ZSB1c2VyIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9QZXJzb25hbEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAxIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Bob25lJywgLy8gVXBkYXRlIHVzZXIgcGhvbmUgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9RdWVzdG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xuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnMnLCAvLyBDYW5jZWxzIGFsbCBleGlzdGluZyBzdG9wIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnMve0lEfScsIC8vIENhbmNlbHMgYW4gZXhpc3Rpbmcgc3RvcCBvcmRlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDM1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0JDUCc6ICdCQ1BUJyxcbiAgICAgICAgICAgICAgICAnRkxJJzogJ0ZMSVhYJyxcbiAgICAgICAgICAgICAgICAnTUFOJzogJ01BTkEnLFxuICAgICAgICAgICAgICAgICdTTFQnOiAnU0FMVCcsXG4gICAgICAgICAgICAgICAgJ1RSQSc6ICdUUkFDJyxcbiAgICAgICAgICAgICAgICAnV0dTJzogJ1dJTkdTJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UmVmZXJlbmNlQ3VycmVuY3lQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnY3VycmVuY3lQYWlycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3RyYWRpbmdDb2RlJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwcmljZURlY2ltYWxQbGFjZXMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlQmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3lJZCA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGN1cnJlbmN5SWQ7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3lJZCBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgY29kZSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtjdXJyZW5jeUlkXVsnY29kZSddO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVCYWxhbmNlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAoXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ3BlbmRpbmdJbmNvbWluZyddLFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nT3V0Z29pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsnb3Blbk9yZGVyJ11cbiAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNNYXJrZXREZXB0aEN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GVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQdWJsaWNMaXZlVGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsndGlja2VycyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ2N1cnJlbmN5UGFpciddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFB1YmxpY0xpdmVUaWNrZXJDdXJyZW5je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0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmVlQ29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZUFtb3VudCcpO1xuICAgICAgICBsZXQgcHJpY2UgPSB0cmFkZVsncHJpY2UnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRyYWRlWydxdWFudGl0eSddO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICBsZXQgZmVlQ3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgZmVlQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogZmVlQ3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ3JhdGUnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWVSYXRlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ3RyYW5zYWN0aW9uSWQnKSxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbX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ICAgICBsZXQgZmVlUmF0ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhbnNhY3Rpb25zICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5ICh0cmFuc2FjdGlvbnMpKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhbnNhY3Rpb25zLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGUgPSB0aGlzLnBhcnNlVHJhZGUgKHRyYW5zYWN0aW9uc1tpXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlc0ZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzRmlsbGVkID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmFkZXNDb3N0ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFkZXNDb3N0ID0gMC4wO1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzRmlsbGVkICs9IHRyYWRlWydhbW91bnQnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyYWRlc0Nvc3QgKz0gdHJhZGVbJ2Ftb3VudCddICogdHJhZGVbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHRyYWRlWydmZWUnXVsnY29zdCddICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZlZUNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IDAuMDtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCArPSB0cmFkZVsnZmVlJ11bJ2Nvc3QnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSB0cmFkZVsnZmVlJ11bJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB0cmFkZVsnZmVlJ11bJ3JhdGUnXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVSYXRlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZlZVJhdGUgPSAwLjA7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZlZVJhdGUgKz0gdHJhZGVbJ2ZlZSddWydyYXRlJ107XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdHJhZGVzLnB1c2ggKHRyYWRlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiB0cmFkZXNGaWxsZWQgIT09ICd1bmRlZmluZWQnKSAmJiAodHJhZGVzRmlsbGVkID4gMCkpXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmljZSA9IHRyYWRlc0Nvc3QgLyB0cmFkZXNGaWxsZWQ7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlUmF0ZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBudW1UcmFkZXMgPSB0cmFkZXMubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG51bVRyYWRlcyA+IDApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmVlUmF0ZSA9IGZlZVJhdGUgLyBudW1UcmFkZXM7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBmZWVDb3N0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IGZlZVJhdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICd0cmFkZXMnO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IChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBub25jZVN0cmluZyA9IG5vbmNlLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGNvbnRlbnRUeXBlID0gKG1ldGhvZCA9PT0gJ0dFVCcpID8gJycgOiAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArIHVybCArIGNvbnRlbnRUeXBlICsgbm9uY2VTdHJpbmc7XG4gICAgICAgICAgICBhdXRoID0gYXV0aC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSV9QVUJMSUNfS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FQSV9SRVFVRVNUX1NJR05BVFVSRSc6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgICAgICdBUElfUkVRVUVTVF9EQVRFJzogbm9uY2VTdHJpbmcsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCAhPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9IGNvbnRlbnRUeXBlO1xuICAgICAgICAgICAgICAg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DT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMxNzg0MDI5LTAzMTNjNzAyLWI1MDktMTFlNy05Y2NjLWJjMGRhNmEwZTQzNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kYXRhLmdhdGUuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9kYXRhLmdhdGUuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nYXRlLmlvLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dhdGUuaW8vYXBpMicsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dhdGUuaW8vZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5nYXRlLmlvL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMzU3NzY3MycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRpbmZvICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHRoaXMuc2FmZVZhbHVlIChyZXNwb25zZSwgJ3BhaXJzJyk7XG4gICAgICAgIGlmICghbWFya2V0cylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE1hcmtldHMgZ290IGFuIHVucmVjb2duaXplZCByZXNwb25zZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXQpO1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1swXTtcbiAgICAgICAgICAgIGxldCBkZXRhaWxzID0gbWFya2V0W2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IGRldGFpbHNbJ21pbl9hbW91bnQnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtZGV0YWlsc1snZGVjaW1hbF9wbGFjZXMnXSksXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogYW1vdW50TGltaXRzWydtaW4nXSAqIHByaWNlTGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmICgnYXZhaWxhYmxlJyBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2F2YWlsYWJsZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdsb2NrZWQnIGluIGJhbGFuY2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnbG9ja2VkJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnbG9ja2VkJ11bY3VycmVuY3ldKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdC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RheCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdHREFYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiA2MCxcbiAgICAgICAgICAgICAgICAnNW0nOiAzMDAsXG4gICAgICAgICAgICAgICAgJzE1bSc6IDkwMCxcbiAgICAgICAgICAgICAgICAnMWgnOiAzNjAwLFxuICAgICAgICAgICAgICAgICc2aCc6IDIxNjAwLFxuICAgICAgICAgICAgICAgICcxZCc6IDg2NDAwLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vYXBpLXB1YmxpYy5zYW5kYm94LmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTI3LWIxYmU0MWM2LTVlZGItMTFlNy05NWY2LTViNDk2YzQ2OWUyYy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmdkYXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmdkYXguY29tL2N1c3RvbWVyL2VuL3BvcnRhbC90b3BpY3MvOTM5NDAyLWRlcG9zaXRpbmctYW5kLXdpdGhkcmF3aW5nLWZ1bmRzL2FydGljbGVzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMve2lkfS90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5iYXNlLWFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC1tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2Vycy9zZWxmL3RyYWlsaW5nLXZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzL2NvaW5iYXNlLWFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzL3BheW1lbnQtbWV0aG9kJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb2luYmFzZS1hY2NvdW50cy97aWR9L2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZy9yZXBheScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZmlsZXMvbWFyZ2luLXRyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9jb2luYmFzZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY3J5cHRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9wYXltZW50LW1ldGhvZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsIC8vIGNvbXBsaWNhdGVkIHRpZXIgc3lzdGVtIHBlciBjb2luXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjMgLyAxMDAsIC8vIHRpZXJlZCBmZWUgc3RhcnRzIGF0IDAuMyVcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMC4xNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3F1b3RlX2luY3JlbWVudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKHRoaXMuc2FmZVN0cmluZyAobWFya2V0LCAncXVvdGVfaW5jcmVtZW50JykpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IHRoaXMuZmVlc1sndHJhZGluZyddWyd0YWtlciddOyAgLy8gZG9lcyBub3Qgc2VlbSByaWdodFxuICAgICAgICAgICAgaWYgKChiYXNlID09PSAnRVRIJykgfHwgKGJhc2UgPT09ICdMVEMnKSkge1xuICAgICAgICAgICAgICAgIHRha2VyID0gMC4wMDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0WydzdGF0dXMnXSA9PT0gJ29ubGluZSc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdiYXNlX21pbl9zaXplJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2Jhc2VfbWF4X3NpemUnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fbWFya2V0X2Z1bmRzJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21heF9tYXJrZXRfZnVuZHMnKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICA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lja2VyLCAncHJpY2UnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IGJpZCxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogYXNrLFxuICAgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdW5kZWZpbmVkO1xuICAgICAgICB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T0gJ2J1eScpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdzaXplJyksXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTXlUcmFkZXMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBpZiAodHlwZW9mIHN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsncHJvZHVjdF9pZCddID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnb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uICAgICAgICBdO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT0hMQ1YgKHN5bWJvbCwgdGltZWZyYW1lID0gJzFtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBncmFudWxhcml0eSA9IHRoaXMudGltZWZyYW1lc1t0aW1lZnJhbWVdO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdncmFudWxhcml0eSc6IGdyYW51bGFyaXR5LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnQnXSA9IHRoaXMueW1kaG1zIChzaW5jZSk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGxpbWl0ID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIC8vIGh0dHBzOi8vZG9jcy5nZGF4LmNvbS8jZ2V0LWhpc3RvcmljLXJhdGVzXG4gICAgICAgICAgICAgICAgbGltaXQgPSAzMDA7IC8vIG1heCA9IDMwMFxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVxdWVzdFsnZW5kJ10gPSB0aGlzLnltZGhtcyAodGhpcy5zdW0gKGxpbWl0ICogZ3JhbnVsYXJpdHkgKiAxMDAwLCBzaW5jZSkpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJvZHVjdHNJZENhbmRsZXMgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJu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xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0T3JkZXJzSWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXIgKHJlc3BvbnNlKTtcbiAgIC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JyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgdGFnID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0V2l0aGRyYXdhbHMnO1xuICAgICAgICBpZiAoJ3BheW1lbnRfbWV0aG9kX2lkJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnUGF5bWVudE1ldGhvZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoJ2NvaW5iYXNlX2FjY291bnRfaWQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdDb2luYmFzZUFjY291bnQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdDcnlwdG8nO1xuICAgICAgICAgICAgcmVxdWVzdFsnY3J5cHRvX2FkZHJlc3MnXSA9IGFkZHJlc3M7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpXG4gICAgICAgICAgICB0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NvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKChjb2RlID09PSA0MDApIHx8IChjb2RlID09PSA0MDQpKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmljZSB0b28gc21hbGwnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ3ByaWNlIHRvbyBwcmVjaXNlJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChlcnJvcik7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdOb3RGb3VuZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKGVycm9yKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UgPT09ICdJbnZhbGlkIEFQSSBLZXknKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvb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xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzgxNjg1Ny1jZTdiZTY0NC02MDk2LTExZTctODJkNi0zYzI1NzI2MzIyOWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9nZW1pbmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kb2NzLnNhbmRib3guZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAndGVzdCc6ICdodHRwczovL2FwaS5zYW5kYm94LmdlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL2ZlZS1zY2hlZHVsZS8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9nZW1pbmkuY29tL3RyYW5zZmVyLWZlZXMvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2wg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AgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgYWxsb3dzIGxpbWl0IG9yZGVycyBvbmx5Jyk7XG4gICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd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hZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3R4SGFzaCcpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdyZXF1ZXN0JzogdXJsLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSB0aGlzLmpzb24gKHJlcXVlc3QpO1xuICAgICAgICAgICAgcG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nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaGFkYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGFkYXgvY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdoYWRheC9jb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hhZGF4L3NldHRpbmdzL2N1cnJlbmN5cycsIC8vID9sYW5ndWFnZT1lbi1VU1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoTWFya2V0c01ldGhvZCc6ICdwdWJsaWNHZXRIYWRheENvbW1vblN5bWJvbHMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufTtcbiIsIid1c2Ugc3RyaWN0JztcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU1NS04ZWFlYzIwZS01ZWRjLTExZTctOWM1Yi02ZGM2OWZjNDJmNWUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHA6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2hpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2hpdGJ0Yy1jb20vaGl0YnRjLWFwaS9ibG9iL21hc3Rlci9BUEl2MS5tZCcsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hpdGJ0Yy5jb20vZmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5oaXRidGMuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwNTE0ODYwNS1GZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvcmVjZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2J5L29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICduZXdfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncGF5bWVudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zL3t0cmFuc2FjdGlvbn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlcl90b190cmFkaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlcl90b19tYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW91dCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAvLyBoYXJkY29kZWQgZmVlcyBhcmUgZGVwcmVjYXRlZCBhbmQgc2hvdWxkIG9ubHkgYmUgdXNlZCB3aGVuIHRoZXJlJ3Mgbm8gb3RoZXIgd2F5IHRvIGdldCBmZWUgaW5mb1xuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAtMC4wMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDQyc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLjg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMC4wMTAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiA1NjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiA2MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDguNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjAwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDYyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAuMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMC4yNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMC4wMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogNi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDIuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDU5MTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMTUuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDExMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMi4yNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMTY0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogNDA3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAuMDM3NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLjUxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjkxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDIuMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogNy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMzk1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMVNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FNUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RFTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlBVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQ09MRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNR08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hWTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMU0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0lTQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0tJTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JDQycsXG4gICAgICAgICAgICAgICAgJ1hCVCc6ICdCVEMnLFxuICAgICAgICAgICAgICAgICdEUksnOiAnREFTSCcsXG4gICAgICAgICAgICAgICAgJ0NBVCc6ICdCaXRDbGF2ZScsXG4gICAgICAgICAgICAgICAgJ1VTRCc6ICdVU0RUJyxcbiAgICAgICAgICAgICAgICAnRU1HTyc6ICdNR08nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydzeW1ib2xzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydzeW1ib2xzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY29tbW9kaXR5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsnY3VycmVuY3knXTtc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JlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0Wydsb3QnXSksXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydzdGVwJ10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWV0aG9kID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICd0eXBlJywgJ3RyYWRpbmcnKTtcbiAgICAgICAgbWV0aG9kICs9ICdHZXRCYWxhbmNlJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsICd0eXBlJyk7XG4gICAg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O1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdleGVjUHJpY2UnKTtcbiAgICAgICAgbGV0IGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgbGV0IGZlZSA9IHtcbiAgICAgICAgICAgICdjb3N0JzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyksXG4gICAgICAgICAgICAnY3VycmVuY3knOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndHJhZGVJZCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdHJhZGVbJ2NsaWVudE9yZGVySWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb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G4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcmRlclF1YW50aXR5Jyk7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eUxlYXZlcycpO1xuICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdsZWF2ZXNRdWFudGl0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFtb3VudERlZmluZWQgPSAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpO1xuICAgICAgICBsZXQgcmVtYWluaW5nRGVmaW5lZCA9ICh0eXBlb2YgcmVtYWluaW5nICE9PSAndW5kZWZpbmVkJyk7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoYW1vdW50RGVmaW5lZClcbiAgICAgICAgICAgICAgICBhbW91bnQgKj0gbWFya2V0Wydsb3QnXTtcbiAgICAgICAgICAgIGlmIChyZW1haW5pbmdEZWZpbmVkKVxuICAgICAgICAgICAgICAgIHJlbWFpbmluZyAqPSBtYXJrZXRbJ2xvdCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChhbW91bnREZWZpbmVkKSB7XG4gICAgICAgICAgICBpZiAocmVtYWluaW5nRGVmaW5lZCkge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgICAgICBjb3N0ID0gYXZlcmFnZVByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnY2xpZW50T3JkZXJJZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy50cmFkaW5nR2V0T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAn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WVyeSA9IHRoaXMuZXh0ZW5kIChwYXlsb2FkLCBxdWVyeSk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJylcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnWC1TaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgP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gICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnTTEnLFxuICAgICAgICAgICAgICAgICczbSc6ICdNMycsXG4gICAgICAgICAgICAgICAgJzVtJzogJ001JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJ00xNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICdNMzAnLCAvLyBkZWZhdWx0XG4gICAgICAgICAgICAgICAgJzFoJzogJ0gxJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnSDQnLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEMScsXG4gICAgICAgICAgICAgICAgJzF3JzogJ0Q3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NTUtOGVhZWMyMGUtNWVkYy0xMWU3LTljNWItNmRjNjlmYzQyZjVlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbS8/cmVmX2lkPTVhNWQzOWE2NWQ0NjYnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hpdGJ0Yy5jb20vZmVlcy1hbmQtbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5oaXRidGMuY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwNTE0ODYwNS1GZWVzLWFuZC1saW1pdHMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsIC8vIEF2YWlsYWJsZSBDdXJyZW5jeSBTeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tzeW1ib2x9JywgLy8gR2V0IHN5bWJvbCBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLCAvLyBBdmFpbGFibGUgQ3VycmVuY2llc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tjdXJyZW5jeX0nLCAvLyBHZXQgY3VycmVuY3kgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsIC8vIFRpY2tlciBsaXN0IGZvciBhbGwgc3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsIC8vIFRpY2tlciBmb3Igc3ltYm9sXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JywgLy8gVHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tzeW1ib2x9JywgLy8gT3JkZXJib29rXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy97c3ltYm9sfScsIC8vIENhbmRsZXNcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gTGlzdCB5b3VyIGN1cnJlbnQgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBHZXQgYSBzaW5nbGUgb3JkZXIgYnkgY2xpZW50T3JkZXJJZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvYmFsYW5jZScsIC8vIEdldCB0cmFkaW5nIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2ZlZS97c3ltYm9sfScsIC8vIEdldCB0cmFkaW5nIGZlZSByYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyJywgLy8gR2V0IGhpc3RvcmljYWwgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlci97aWR9L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlcyBieSBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLCAvLyBHZXQgbWFpbiBhY2Njb3VudCBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMnLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucy97aWR9JywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb24gYnkgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBHZXQgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdycsIC8vIFdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIENyZWF0ZSBuZXcgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNmZXInLCAvLyBUcmFuc2ZlciBhbW91bnQgdG8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gQ29tbWl0IHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ2FuY2VsIGFsbCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBSb2xsYmFjayB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBSZXBsYWNlIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAxIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNDJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDA5NTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuNTA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTU0nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU5UJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDE4LjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRCJzogMC4wMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTSc6IDUwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiA4NjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMS45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JBUyc6IDExMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMTI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JLQic6IDQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAyLjU3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDQuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVENBJzogMzUxLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0FQUCc6IDk3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMJzogMTMuODUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMC44OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiA1NzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1BBWSc6IDUuNDg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVRBJzogMTIuOTQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RCSVgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMTI4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMTAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VLTyc6IDExMzYuMzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMC4wMDE3MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUMnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRkNOJzogMC4wMDAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQU1FJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dVUCc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMS4yLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDc5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tNRCc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEEnOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMRU5EJzogMzg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMT0MnOiAxMS4wNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMC4zNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMTQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiA1LjQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiA0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAxLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDEyMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ08nOiAwLjM1NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiA5MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAzLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMTY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FVCc6IDMuOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlRPJzogOTk4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05HQyc6IDIuMzY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDEzLjM5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YVCc6IDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAzMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDIuOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPVE4nOiAwLjU3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDMuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiA5NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTEJUJzogMC4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFInOiAxMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMC44NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiA3ODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDMuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRSc6IDMyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDM5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSUyc6IDYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFVJzogNjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiA2NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JMQyc6IDEuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0MnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dGVEMnOiAzNTIuOTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RBUic6IDAuMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JNJzogMTUzLjE5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1BGJzogMTQuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUR1QnOiAxNzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAyNzAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VUVCc6IDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVSSSc6IDAuMDM3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDUwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAxNDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiA2MTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0VBTFRIJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMi40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuNzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1JDJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDMuMjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAxNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkFQJzogMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMjMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMTkxLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUVPTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUlSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JVUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0ZJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05YJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDT1NTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRERGJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZSRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lOREknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lUUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tJQ0snOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJRkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01JUFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1JNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9MTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BUT1knOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0JEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQ0wnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVEVFTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RSQVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUVSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1dUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQUFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RGTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUdUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVk9JU0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEFVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEROJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgIC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sndGlja1NpemUnXSksXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydxdWFudGl0eUluY3JlbWVudCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZUxpcXVpZGl0eVJhdGUnKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdwcm92aWRlTGlxdWlkaXR5UmF0ZScpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3N0ZXAnOiBzdGVwLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCAqIHN0ZXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnaWQnXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG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luLFxuICAgICAgICAgICAgICAgICdwYXlvdXQnOiBwYXlvdXQsXG4gICAgICAgICAgICAgICAgJ3RyYW5zZmVyJzogdHJhbnNmZXIsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydmdWxsTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAncGF5b3V0RmVlJyksIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZUdldCcgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpICsgJ0JhbGFuY2UnO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzW21ldGhvZF0gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVs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lID0gY2hhbmdlIC8gb3BlbiAqIDEwMDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdndhcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBxdW90ZVZvbHVtZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBpZiAodHlwZW9mIGJhc2VWb2x1bWUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGlmIChiYXNlVm9sdW1lID4gMClcbiAgICAgICAgICAgICAgICAgICAgdndhcCA9IHF1b3RlVm9sdW1lIC8gYmFzZVZvbHVtZTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IG9wZW4sXG4gICAgICAgICAgICAnY2xvc2UnOiBsYXN0LFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ3ByZXZpb3VzQ2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhb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Fya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGlja2VyWydtZXNzYWdlJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGlkID0gdHJhZGVbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXQgPyBtYXJrZXRbJ3F1b3RlJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY2xpZW50T3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlcklkID0gdHJhZGVbJ2NsaWVudE9yZGVySWQnXTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcklkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb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zdGF0dXMnXTtcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gJ25ldycpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdzdXNwZW5kZWQnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAncGFydGlhbGx5RmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gJ2ZpbGxlZCcpIHtcbiAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICB9XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydjbGllbnRPcmRlcklkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGlmICh0eXBlb2YgcHJpY2UgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpXG4gICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLm9yZGVyc1tpZF1bJ3ByaWNlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgIC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ICAgICBsZXQgdGFnID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3BheW1lbnRJZCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAndGFnJzogdGFnLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRGVwb3NpdEFkZHJlc3MgKGNvZGUsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY3kgKGNvZGUpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50Q3J5cHRvQWRkcmVzc0N1cnJlbmN5ICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSk7XG4gICAgICAgIGxldCBhZGRyZXNzID0gcmVzcG9uc2VbJ2FkZHJlc3MnXTtcbiAgICAgICAgdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpO1xuICAgICAgICBsZXQgdGFnID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ3BheW1lbnRJZCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3kuY29kZSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICd0YWcnOiB0YWcsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGNvZGUsIGFtb3VudCwgYWRkcmVzcywgdGFnID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB0aGlzLmNoZWNrQWRkcmVzcyAoYWRkcmVzcyk7XG4gICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY3kgKGNvZGUpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5WydpZCddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0YWcpXG4gICAgICAgICAgICByZXF1ZXN0WydwYXltZW50SWQnXSA9IHRhZztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFjY291bnRDcnlwdG9XaXRoZHJhdyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAocGF5bG9hZCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogJ0Jhc2ljICcgKyB0aGlzLmRlY29kZSAoYXV0aCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgaWYgKGNvZGUgPj0gNDAwKSB7XG4gICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyBib2R5O1xuICAgICAgICAgICAgLy8ge1wiY29kZVwiOjUwNCxcIm1lc3NhZ2VcIjpcIkdhdGV3YXkgVGltZW91dFwiLFwiZGVzY3JpcHRpb25cIjpcIlwifVxuICAgICAgICAgICAgaWYgKChjb2RlID09PSA1MDMpIHx8IChjb2RlID09PSA1MDQpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZU5vdEF2YWlsYWJsZSAoZmVlZGJhY2spO1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgnZXJyb3InIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ2Vycm9yJ11bJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBvcmRlciBub3QgZm91bmQgaW4gYWN0aXZlIG9yZGVycycpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUXVhbnRpdHkgbm90IGEgdmFsaWQgbnVtYmVyJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ0luc3VmZmljaWVudCBmdW5kcycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ0R1cGxpY2F0ZSBjbGllbnRPcmRlcklkJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yIChmZWVkYmFjayk7XG4gICAgICAgIH1cbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpO1xuY29uc3QgeyBFeGNoYW5nZUVycm9yIH0gPSByZXF1aXJlICgnLi9iYXNlL2Vycm9ycycpO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgaHVvYmkgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2h1b2JpJyxcbiAgICAgICAgICAgICduYW1lJzogJ0h1b2JpJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcwMDEnLFxuICAgICAgICAgICAgICAgICc1bSc6ICcwMDUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMDE1JyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzAzMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzA2MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzEwMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzIwMCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzMwMCcsXG4gICAgICAgICAgICAgICAgJzF5JzogJzQwMCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU2OS0xNWFhN2I5YS01ZWRkLTExZTctOWU3Zi00NDc5MWY0ZWU0OWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHA6Ly9hcGkuaHVvYmkuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaHVvYmlhcGkvQVBJX0RvY3NfZW4vd2lraScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnc3RhdGljbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH1fa2xpbmVfe3BlcmlvZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9X3tsZW5ndGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWxfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndXNkbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH1fa2xpbmVfe3BlcmlvZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aF97aWR9X3tsZW5ndGh9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXRhaWxfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndHJhZGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9hY2NvdW50X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5X21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbF9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X25ld19kZWFsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyX2lkX2J5X3RyYWRlX2lkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X3dpdGhkcmF3X2NvaW5fcmVzdWx0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbl9hdmFpbGFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9sb2FucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgIC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bG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndHMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpb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OiBhbW91bnQsXG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydxdW90ZSddLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIGVsc2VcbiAgICAgICAgICAgIG1ldGhvZCArPSB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnRyYWRlUG9zdENhbmNlbE9yZGVyICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ107XG4gICAgICAgIGlmIChhcGkgPT09ICd0cmFkZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgdXJsICs9ICcvYXBpJyArIHRoaXMudmVyc2lvbjtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMua2V5c29ydCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAg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gJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGluZ0xpbWl0cyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW1pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MG1pbicsXG4gICAgICAgICAgICAgICAgJzFkJzogJzFkYXknLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxd2VlaycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtb24nLFxuICAgICAgICAgICAgICAgICcxeSc6ICcxeWVhcicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjU2OS0xNWFhN2I5YS01ZWRkLTExZTctOWU3Zi00NDc5MWY0ZWU0OWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmh1b2JpcHJvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaXByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzL3dpa2kvUkVTVF9hcGlfcmVmZXJlbmNlJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5odW9iaXByby5jb20vYWJvdXQvZmVlLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbW1vbi9leGNoYW5nZScsIC8vIG9yZGVyIGxpbWl0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3NldHRpbmdzL2N1cnJlbmN5cycsIC8vID9sYW5ndWFnZT1lbi1VU1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2RlcG9zaXQtdmlydHVhbC9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1ZXJ5L2RlcG9zaXQtd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9sb2FuLW9yZGVycycsIC8vIOWAn+i0t+iuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9hY2NvdW50cy9iYWxhbmNlJywgLy8g5YCf6LS36LSm5oi36K+m5oOFXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9wbGFjZScsIC8vIOWIm+W7uuW5tuaJp+ihjOS4gOS4quaWsOiuouWNlSAo5LiA5q2l5LiL5Y2V77yMIOaOqOiNkOS9v+eUqClcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDliJvlu7rkuIDkuKrmlrDnmoTorqLljZXor7fmsYIg77yI5LuF5Yib5bu66K6i5Y2V77yM5LiN5omn6KGM5LiL5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vcGxhY2UnLCAvLyDmiafooYzkuIDkuKrorqLljZUg77yI5LuF5omn6KGM5bey5Yib5bu655qE6K6i5Y2V77yJXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0vc3VibWl0Y2FuY2VsJywgLy8g55Sz6K+35pKk6ZSA5LiA5Liq6K6i5Y2V6K+35rGCXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL2JhdGNoY2FuY2VsJywgLy8g5om56YeP5pKk6ZSA6K6i5Y2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZHcvYmFsYW5jZS90cmFuc2ZlcicsIC8vIOi1hOS6p+WIkui9rFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3L2FwaS9jcmVhdGUnLCAvLyDnlLPor7fmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy90cmFuc2Zlci1pbi9tYXJnaW4nLCAvLyDnjrDotKfotKbmiLfliJLlhaXoh7PlgJ/otLfotKbmiLdcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy90cmFuc2Zlci1vdXQvbWFyZ2luJywgLy8g5YCf6LS36LSm5oi35YiS5Ye66Iez546w6LSn6LSm5oi3XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luL29yZGVycycsIC8vIOeUs+ivt+WAn+i0t1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbi9vcmRlcnMve2lkfS9yZXBheScsIC8vIOW9kui/mOWAn+i0t1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXhjZXB0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnYWNjb3VudC1mcm96ZW4tYmFsYW5jZS1pbnN1ZmZpY2llbnQtZXJyb3InOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8ge1wic3RhdHVzXCI6XCJlcnJvclwiLFwiZXJyLWNvZGVcIjpcImFjY291bnQtZnJvemVuLWJhbGFuY2UtaW5zdWZmaWNpZW50LWVycm9yXCIsXCJlcnItbXNnXCI6XCJ0cmFkZSBhY2NvdW50IGJhbGFuY2UgaXMgbm90IGVub3VnaCwgbGVmdDogYDAuMDAyN2BcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgICdvcmRlci1saW1pdG9yZGVyLWFtb3VudC1taW4tZXJyb3InOiBJbnZhbGlkT3JkZXIsIC8vIGxpbWl0IG9yZGVyIGFtb3VudCBlcnJvciwgbWluOiBgMC4wMDFgXG4gICAgICAgICAgICAgICAgJ29yZGVyLW9yZGVyc3RhdGUtZXJyb3InOiBPcmRlck5vdEZvdW5kLCAvLyBjYW5jZWxpbmcgYW4gYWxyZWFkeSBjYW5jZWxlZCBvcmRlclxuICAgICAgICAgICAgICAgICdvcmRlci1xdWVyeW9yZGVyLWludmFsaWQnOiBPcmRlck5vdEZvdW5kLCAvLyBxdWVyeWluZyBhIG5vbi1leGlzdGVudCBvcmRlclxuICAgICAgICAgICAgICAgICdvcmRlci11cGRhdGUtZXJyb3InOiBFeGNoYW5nZU5vdEF2YWlsYWJsZSwgLy8gdW5kb2N1bWVudGVkIGVycm9yXG4gICAgICAgICAgICB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xcbiAgICAgICAgICAgICdpbmZvJzogaW5mbyxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRpbmdMaW1pdHMgKHJlc3BvbnNlLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgaWYgKHR5cGVvZiBkYXRhID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGF0YVsnbGltaXQtb3JkZXItbXVzdC1ncmVhdGVyLXRoYW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogZGF0YVsnbGltaXQtb3JkZXItbXVzdC1sZXNzLXRoYW4nXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHRoaXMub3B0aW9uc1snZmV0Y2hNYXJrZXRzTWV0aG9kJ107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgbnVtTWFya2V0cyA9IG1hcmtldHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtTWFya2V0cyA8IDEpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcHVibGljR2V0Q29tbW9uU3ltYm9scyByZXR1cm5lZCBlbXB0eSByZXNwb25zZTogJyArIHRoaXMuanNvbiAobWFya2V0cykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSAoYmFzZSA9PT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGJpZFZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFza1ZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHRpY2tlclsnYmlkJ10pKSB7XG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICAgICAgICAgIGJpZFZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2JpZCddLCAxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoJ2FzaycgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSAodGlja2VyWydhc2snXSkpIHtcbiAgICAgICAgICAgICAgICBhc2sgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyWydhc2snXSwgMCk7XG4gICAgICAgICAgICAgICAgYXNrVm9sdW1lID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYXNrJ10sIDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVu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BsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLm1hcmtldEdldERlcHRoICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ3N0ZXAwJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgndGljaycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3RpY2snXSkge1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWyd0aWNrJ107XG4gICAgICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJib29rWyd0cyddO1xuICAgICAgICAgICAgb3JkZXJib29rWydub25jZSddID0gb3JkZXJib29rWyd2ZXJzaW9uJ107XG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaE9yZGVyQm9vaygpIHJldHVybmVkIHVucmVjb2duaXplZCByZXNwb25zZTogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZS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kKSB7XG4gICAgICAgICAgICB0aGlzLmFjY291bnRzID0gYXdhaXQgdGhpcy5mZXRjaEFjY291bnRzICgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHRoaXMuYWNjb3VudHMpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5hY2NvdW50cztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50cyA9IGF3YWl0IHRoaXMuZmV0Y2hBY2NvdW50cyAoKTtcbiAgICAgICAgICAgICAgICB0aGlzLmFjY291bnRzQnlJZCA9IHRoaXMuaW5kZXhCeSAodGhpcy5hY2NvdW50cywgJ2lkJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuYWNjb3VudHM7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hBY2NvdW50cyAoKSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50cyAoKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlWydkYXRhJ107XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFNldHRpbmdzQ3VycmVuY3lzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xhbmd1YWdlJzogdGhpcy5vcHRpb25zWydsYW5ndWFnZSddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAvLyAgeyAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFwiY3R4Y1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICdkaXNwbGF5LW5hbWUnOiBcIkNUWENcIixcbiAgICAgICAgICAgIC8vICAgICAgICAnd2l0aGRyYXctcHJlY2lzaW9uJzogIDgsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAnY3VycmVuY3ktdHlwZSc6IFwiZXRoXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgJ2N1cnJlbmN5LXBhcnRpdGlvbic6IFwicHJvXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAnc3VwcG9ydC1zaXRlcyc6ICBudWxsLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgJ290Yy1lbmFibGUnOiAgMCxcbiAgICAgICAgICAgIC8vICAgICAgICAnZGVwb3NpdC1taW4tYW1vdW50JzogXCIyXCIsXG4gICAgICAgICAgICAvLyAgICAgICAnd2l0aGRyYXctbWluLWFtb3VudCc6IFwiNFwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAnc2hvdy1wcmVjaXNpb24nOiBcIjhcIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICAgICAgICAgIHdlaWdodDogXCIyOTg4XCIsXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgIHZpc2libGU6ICB0cnVlLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICdkZXBvc2l0LWRlc2MnOiBcIlBsZWFzZSBkb27igJl0IGRlcG9zaXQgYW55IG90aGVyIGRpZ2l0YWwgYXNzZXRzIGV4Y2VwdCBDVFhDIHTigKZcIixcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICd3aXRoZHJhdy1kZXNjJzogXCJNaW5pbXVtIHdpdGhkcmF3YWwgYW1vdW50OiA0IENUWEMuICE+XzwhRm9yIHNlY3VyaXR5IHJlYXNvbuKAplwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICdkZXBvc2l0LWVuYWJsZWQnOiAgdHJ1ZSxcbiAgICAgICAgICAgIC8vICAgICAgICAgICd3aXRoZHJhdy1lbmFibGVkJzogIHRydWUsXG4gICAgICAgICAgICAvLyAgICAnY3VycmVuY3ktYWRkci13aXRoLXRhZyc6ICBmYWxzZSxcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICdmYXN0LWNvbmZpcm1zJzogIDE1LFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgJ3NhZmUtY29uZmlybXMnOiAgMzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy9cbiAgICAgICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVZhbHVlIChjdXJyZW5jeSwgJ25hbWUnKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB0aGlzLnNhZmVJbnRlZ2VyIChjdXJyZW5jeSwgJ3dpdGhkcmF3LXByZWNpc2lvbicpO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IGN1cnJlbmN5Wyd2aXNpYmxlJ10gJiYgY3VycmVuY3lbJ2RlcG9zaXQtZW5hYmxlZCddICYmIGN1cnJlbmN5Wyd3aXRoZHJhdy1lbmFibGVkJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ2NyeXB0bycsXG4gICAgICAgICAgICAgICAgLy8gJ3BheWluJzogY3VycmVuY3lbJ2RlcG9zaXQtZW5hYmxlZCddLFxuICAgICAgICAgICAgICAgIC8vICdwYXlvdXQnOiBjdXJyZW5jeVsnd2l0aGRyYXctZW5hYmxlZCddLFxuICAgICAgICAgICAgICAgIC8vICd0cmFuc2Zlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydkaXNwbGF5LW5hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBhY3RpdmUgPyAnb2snIDogJ2Rpc2FibGVkJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLCAvLyB0b2RvIG5lZWQgdG8gZmV0Y2ggZnJvbSBmZWUgZW5kcG9pbnRcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnZGVwb3NpdC1taW4tYW1vdW50JyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKGN1cnJlbmN5LCAnd2l0aGRyYXctbWluLWFtb3VudCcpLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudEFjY291bnRzSWRCYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ11bJ2xpc3QnXTtcbiAgICAgICAg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ydGlhbC1maWxsZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gJ3BhcnRpYWwtY2FuY2VsZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdmaWxsZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnY2FuY2VsZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdzdWJtaXR0ZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzdGF0dXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgc2lkZSA9IG9yZGVyVHlwZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSBvcmRlclR5cGVbMV07XG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0ZSddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkLWF0J107XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWVsZC1hbW91bnQnXSk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWNhc2gtYW1vdW50J10pO1xuICAgICAgICBsZXQgYXZlcmFnZSA9IDA7XG4gICAgICAgIGlmIChmaWxsZWQpXG4gICAgICAgICAgICBhdmVyYWdlID0gcGFyc2VGbG9hdCAoY29zdCAvIGZpbGxlZCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdhY2NvdW50LWlkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlICsgJy0nICsgdHlwZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlck9yZGVyc1BsYWNlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ2RhdGEnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQ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Ghpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGF1dGggKz0gJyYnICsgdGhpcy51cmxlbmNvZGUgKHsgJ1NpZ25hdHVyZSc6IHNpZ25hdHVyZSB9KTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyBhdXRoO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoaHR0cENvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoKGJvZHlbMF0gPT09ICd7JykgfHwgKGJvZHlbMF0gPT09ICdbJykpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdGF0dXMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAge1wic3RhdHVzXCI6XCJlcnJvclwiLFwiZXJyLWNvZGVcIjpcIm9yZGVyLWxpbWl0b3JkZXItYW1vdW50LW1pbi1lcnJvclwiLFwiZXJyLW1zZ1wiOlwibGltaXQgb3JkZXIgYW1vdW50IGVycm9yLCBtaW46IGAwLjAwMWBcIixcImRhdGFcIjpudWxsfVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdzdGF0dXMnKTtcbiAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSAnZXJyb3InKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyLWNvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2VwdGlvbnMgPSB0aGlzLmV4Y2VwdGlvbnM7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjb2Rl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ZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDEyMTc2LTExNjE2YzMyLTMyNjktMTFlOC05ZjA1LWU2NWNmODg1YmIxNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9pY2UzeC5jb20vYXBpL3YxJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9pY2UzeC5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9pY2UzeC5jby56YScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vaWNlM3guY28uemEvaWNlLWN1YmVkLWJpdGNvaW4tZXhjaGFuZ2UtYXBpLWRvY3VtZW50YXRpb24tMS1qdW5lLTIwMTcnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oZWxwLmljZTMuY29tL3N1cHBvcnQvc29sdXRpb25zL2FydGljbGVzLzExMDAwMDMzMjkzLXRyYWRpbmctZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hlbHAuaWNlMy5jb20vc3VwcG9ydC9zb2x1dGlvbnMvYXJ0aWNsZXMvMTEwMDAwMzMyODgtZmVlcy1leHBsYWluZWQnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9oZWxwLmljZTMuY29tL3N1cHBvcnQvc29sdXRpb25zL2FydGljbGVzLzExMDAwMDA4MTMxLXdoYXQtYXJlLXlvdXItZmlhdC1kZXBvc2l0LWFuZC13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vaGVscC5pY2UzLmNvbS9zdXBwb3J0L3NvbHV0aW9ucy9hcnRpY2xlcy8xMTAwMDAzMzI4OS1kZXBvc2l0LWZlZXMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXIvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cy9tYXJrZXRkZXB0aGZ1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL21hcmtldGRlcHRoYnRjYXYnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzL21hcmtldGRlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2svaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbi9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnZvaWNlL2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ludm9pY2UvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW52b2ljZS9wZGYnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lMaXN0IChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydyZXNwb25zZSddWydlbnRpdGllcyddO1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0gdGhpcy5wcmVjaXNpb25bJ2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydjdXJyZW5jeV9pZCddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ2lzbyddLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGlmICghT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcykubGVuZ3RoKSB7XG4gICAgICAgICAgICB0aGlzLmN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLmZldGNoQ3VycmVuY2llcyAoKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLmN1cnJlbmNpZXNfYnlfaWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuY3VycmVuY2llcywgJ2lkJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UGFpckxpc3QgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3Jlc3BvbnNlJ11bJ2VudGl0aWVzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBt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1xuICAgICAgICBsZXQgdGlja2VycyA9IHJlc3BvbnNlWydyZXNwb25zZSddWydlbnRpdGllcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGlja2Vycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzQnlJZFt0aWNrZXJbJ3BhaXJfaWQnXV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2tJbmZvICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXJfaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydyZXNwb25zZSddWydlbnRpdGllcyddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydjcmVhdGVkJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3ZvbHVtZScpO1xuICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSAqIGFtb3VudCkpO1xuICAgICAgICBsZXQgZmVlID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAnZmVlJyk7XG4gICAgICAgIGlmIChmZWUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFkZV9pZCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxu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7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd2b2x1bWUnKTtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAnYWN0aXZlJyk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5pbmcnKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN0YXR1cyA9PT0gMSkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICByZW1haW5pbmcgPSAwO1xuICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKTtcbiAgICAgICAgaWYgKGZlZSkge1xuICAgICAgICAgICAgZmVlID0geyAnY29zdCc6IGZlZSB9O1xuICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdvcmRlcl9pZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJOZXcgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcl9pZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogcmVzcG9uc2VbJ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kgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICAgICAgaWYgKHBhcmFtcy5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHBhcmFtcztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGxldCBlcnJvcnMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdlcnJvcnMnKTtcbiAgICAgICAgbGV0IGRhdGEgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdyZXNwb25zZScpO1xuICAgICAgICBpZiAoZXJyb3JzIHx8ICFkYXRhKSB7XG4gICAgICAgICAgICBsZXQgYXV0aEVycm9yS2V5cyA9IFsgJ0tleScsICd1c2VyX2lkJywgJ1NpZ24nIF07XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGF1dGhFcnJvcktleXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3JLZXkgPSBhdXRoRXJyb3JLZXlzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBlcnJvck1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKGVycm9ycywgZXJyb3JLZXkpO1xuICAgICAgICAgICAgICAgIGlmICghZXJyb3JNZXNzYWdlKVxuICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgICAgICAgICBpZiAoZXJyb3JLZXkgPT09ICd1c2VyX2lkJyAmJiBlcnJvck1lc3NhZ2UuaW5kZXhPZiAoJ2F1dGhvcml6YXRpb24nKSA8IDApXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChlcnJvck1lc3NhZ2UpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbm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mNDc3Yy05YmNiLTExZTctODliYy1kMWFjODUwMTJlZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmluZGVwZW5kZW50cmVzZXJ2ZS5jb20vUHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbS9Qcml2YXRlJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRMaW1pdE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTWFya2V0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFRyYW5zYWN0aW9uVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UmVjZW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRGeFJhdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZUxpbWl0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZEZpbGxlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJEZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3luY2hEaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc1dpdGhCbG9ja2NoYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0RpZ2l0YWxDdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdEZpYXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IGJhc2VDdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRWYWxpZFByaW1hcnlDdXJyZW5jeUNvZGVzICgpO1xuICAgICAgICBsZXQgcXVvdGVDdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRHZXRWYWxpZFNlY29uZGFyeUN1cnJlbmN5Q29kZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYXNlQ3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2VDdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGJhc2VJZFVwcGVyY2FzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZFVwcGVyY2FzZSk7XG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IHF1b3RlQ3VycmVuY2llcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGVDdXJyZW5jaWVzW2pdO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkVXBwZXJjYXNlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZFVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZUlkICsgJy8nICsgcXVvdGVJZDtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50cyAoKTtcbiAgIC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0ICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZSA9IHtcbiAgICAgICAgICAgICdyYXRlJzogZmVlUmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGZlZUN1cnJlbmN5LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgaWQgPSBvcmRlclsnT3JkZXJHdWlkJ107XG4gICAgICAgIGxldCBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydTdGF0dXMnXSk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnVmFsdWUnKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdBdmdQcmljZScpO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZScsIGF2ZXJhZ2UpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgIC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YWRlLCAnT3JkZXJUeXBlJyk7XG4gICAgICAgIGlmICh0eXBlb2Ygc2lkZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmIChzaWRlLmluZGV4T2YgKCdCaWQnKSA+PSAwKVxuICAgICAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgICAgIGVsc2UgaWYgKHNpZGUuaW5kZXhPZiAoJ09mZmVyJykgPj0gMClcbiAgICAgICAgICAgICAgICBzaWRlID0gJ3NlbGwnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVySWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0UmVjZW50VHJhZGVzICh0aGlzL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AgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFtcbiAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgJ2FwaUtleT0nICsgdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlPScgKyBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICAvLyByZW1vdmUgdGhpcyBjcmFwXG4gICAgICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSBbXTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIHBheWxvYWQucHVzaCAoa2V5ICsgJz0nICsgcGFyYW1zW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgYXV0aCA9IHRoaXMuYXJyYXlDb25jYXQgKGF1dGgsIHBheWxvYWQpO1xuICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBhdXRoLmpvaW4gKCcsJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAobWVzc2FnZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgf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cbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxLjcnLCAvLyBhcyBvZiA2IE5vdmVtYmVyIDIwMTdcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzc0NDMyODMtMmZkZGQwZTQtMjgxYy0xMWU4LTk3NDEtYjRmMTQxOTAwMWI1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmluZG9kYXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vaW5kb2RheC5jb20vZG93bmxvYWRzL0JJVENPSU5DT0lELUFQSS1ET0NVTUVOVEFUSU9OLnBkZicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVySGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSURSJzogeyAnaWQnOiAnYnRjX2lkcicsICdzeW1ib2wnOiAnQlRDL0lEUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdJRF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GUnOiAnQlRDJywgJ2Jhc2VJZCc6ICduZW0nLCAncXVvdGVJZCc6ICdidGMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogOCwgJ3ByaWNlJzogOCB9LCAnbGltaXRzJzogeyAnYW1vdW50JzogeyAnbWluJzogMSwgJ21heCc6IHVuZGVmaW5lZCB9fX0sXG4gICAgICAgICAgICAgICAgJ1hSUC9CVEMnOiB7ICdpZCc6ICd4cnBfYnRjJywgJ3N5bWJvbCc6ICdYUlAvQlRDJywgJ2Jhc2UnOiAnWFJQJywgJ3F1b3RlJzogJ0JUQycsICdiYXNlSWQnOiAneHJwJywgJ3F1b3RlSWQnOiAnYnRjJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDgsICdwcmljZSc6IDggfSwgJ2xpbWl0cyc6IHsgJ2Ftb3VudCc6IHsgJ21pbic6IDAuMDEsICdtYXgnOiB1bmRlZmluZWQgfX19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQ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7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpXG4gICAgICAgICAgICBzaWRlID0gb3JkZXJbJ3R5cGUnXTtcbiAgICAgICAgbGV0IHN0YXR1cyA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdzdGF0dXMnLCAnb3BlbicpO1xuICAgICAgICBpZiAoc3RhdHVzID09PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09PSAnY2FsY2VsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gbWFya2V0WydxdW90ZUlkJ107XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlSWQnXTtcbiAgICAgICAgICAgIGlmICgobWFya2V0WydxdW90ZUlkJ10gPT09ICdpZHInKSAmJiAoJ29yZGVyX3JwJyBpbiBvcmRlcikpXG4gICAgICAgICAgICAgICAgcXVvdGVJZCA9ICdycCc7XG4gICAgICAgICAgICBpZiAoKG1hcmtldFsnYmFzZUlkJ10gPT09ICdpZHInKSAmJiAoJ3JlbWFpbl9ycCcgaW4gb3JkZXIpKVxuICAgICAgICAgICAgICAgIGJhc2VJZCA9ICdycCc7XG4gICAgICAgICAgICBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnb3JkZXJfJyArIHF1b3RlSWQpO1xuICAgICAgICAgICAgaWYgKGNvc3QpIHtcbiAgICAgICAgICAgICAgICBhbW91bnQgPSBjb3N0IC8gcHJpY2U7XG4gICAgICAgICAgICAgICAgbGV0IHJlbWFpbmluZ0Nvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdyZW1haW5fJyArIHF1b3RlSWQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nQ29zdCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVtYWluaW5nID0gcmVtYWluaW5nQ29zdCAvIHByaWNlO1xuICAgICAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdvcmRlcl8nICsgYmFzZUlkKTtcbiAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBhbW91bnQ7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmVtYWluXycgKyBiYXNlSWQpO1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgYXZlcmFnZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKGZpbGxlZClcbiAgICAgICAgICAgIGF2ZXJhZ2UgPSBjb3N0IC8gZmlsbGVkO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWydzdWJtaXRfdGltZSddKTtcbiAgIC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sdGVyQnlTeW1ib2wgKG9yZGVycywgc3ltYm9sKTtcbiAgICAgICAgcmV0dXJuIG9yZGVycztcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSAhPT0gJ2xpbWl0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgY3VycmVuY3kgPSBtYXJrZXRbJ2Jhc2VJZCddO1xuICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgIG9yZGVyW21hcmtldFsncXVvdGVJZCddXSA9IGFtb3VudCAqIHByaWNlO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3JkZXJbbWFya2V0WydiYXNlSWQnXV0gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgb3JkZXJbY3VycmVuY3ldID0gYW1vdW50O1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiBy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RoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIHtcbiAgICAgICAgLy8gICAgICAgICBcInN1Y2Nlc3NcIjogMSxcbiAgICAgICAgLy8gICAgICAgICBcInN0YXR1c1wiOiBcImFwcHJvdmVkXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19jdXJyZW5jeVwiOiBcInhycFwiLFxuICAgICAgICAvLyAgICAgICAgIFwid2l0aGRyYXdfYWRkcmVzc1wiOiBcInJ3V3I3S1VaM1pGd3pnYURHaktCeXNBREJ5enh2b2hRM0NcIixcbiAgICAgICAgLy8gICAgICAgICBcIndpdGhkcmF3X2Ftb3VudFwiOiBcIjEwMDAwLjAwMDAwMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJmZWVcIjogXCIyLjAwMDAwMDAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJhbW91bnRfYWZ0ZXJfZmVlXCI6IFwiOTk5OC4wMDAwMDAwMFwiLFxuICAgICAgICAvLyAgICAgICAgIFwic3VibWl0X3RpbWVcIjogXCIxNTA5NDY5MjAwXCIsXG4gICAgICAgIC8vICAgICAgICAgXCJ3aXRoZHJhd19pZFwiOiBcInhycC0xMjM0NVwiLFxuICAgICAgICAvLyAgICAgICAgIFwidHhpZFwiOiBcIlwiLFxuICAgICAgICAvLyAgICAgICAgIFwid2l0aGRyYXdfbWVtb1wiOiBcIjEyMzEyM1wiXG4gICAgICAgIC8vICAgICB9XG4gICAgICAgIC8vXG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCgndHhpZCcgaW4gcmVzcG9uc2UpICYmIChyZXNwb25zZVsndHhpZCddLmxlbmd0aCA+IDApKVxuICAgICAgICAgICAgaWQgPSByZXNwb25zZVsndHhpZCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiB0aGlzLm5vbmNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSwgcmVzcG9uc2UgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHR5cGVvZiBib2R5ICE9PSAnc3RyaW5nJylcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgLy8geyBzdWNjZXNzOiAwLCBlcnJvcjogXCJpbnZhbGlkIG9yZGVyLlwiIH1cbiAgICAgICAgLy8gb3JcbiAgICAgICAgLy8gW3sgZGF0YSwgLi4uIH0sIHsgLi4uIH0sIC4uLiBdXG4gICAgICAgIGlmICh0eXBlb2YgcmVzcG9uc2UgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7JyB8fCBib2R5WzBdID09PSAnWycpXG4gICAgICAgICAgICAgICAgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKHJlc3BvbnNlKSlcbiAgICAgICAgICAgIHJldHVybjsgLy8gcHVibGljIGVuZHBvaW50cyBtYXkgcmV0dXJuIFtdLWFycmF5c1xuICAgICAgICBpZiAoISgnc3VjY2VzcycgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBubyAnc3VjY2VzcycgcHJvcGVydHkgb24gcHVibGljIHJlc3BvbnNlc1xuICAgICAgICBpZiAocmVzcG9uc2VbJ3N1Y2Nlc3MnXSA9PT0gMSkge1xuICAgICAgICAgICAgLy8geyBzdWNjZXNzOiAxLCByZXR1cm46IHsgb3JkZXJzOiBbXSB9fVxuICAgICAgICAgICAgaWYgKCEoJ3JldHVybicgaW4gcmVzcG9uc2UpKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJzogbWFsZm9ybWVkIHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICA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XQnLFxuICAgICAgICAgICAgJ25hbWUnOiAnaXRCaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MjIxNTktNjYxNTM2MjAtNjBhZC0xMWU3LTg5ZTctMDA1ZjZkN2YzZGUwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaXRiaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuaXRiaXQuY29tL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuaXRiaXQuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMve3N5bWJvbH0vb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vYmFsYW5jZXMve2N1cnJlbmN5Q29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9mdW5kaW5nX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9jcnlwdG9jdXJyZW5jeV9kZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXJlX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ1hCVFVTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9TR0QnOiB7ICdpZCc6ICdYQlRTR0QnLCAnc3ltYm9sJzogJ0JUQy9TR0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnU0dEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnWEJURVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0c1N5bWJvbE9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdz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hZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZVsncmVjZW50VHJhZGVzJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2hXYWxsZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVswXVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlQmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWyd0b3RhbEJhbGFuY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBh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ICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10ucmVwbGFjZSAobWFya2V0WydxdW90ZSddLCAnJyksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Rpc3BsYXknOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdpbnN0cnVtZW50JzogbWFya2V0WydpZCddLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0V2FsbGV0c1dhbGxldElkT3JkZXJzICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCB3YWxsZXRJZEluUGFyYW1zID0gKCd3YWxsZXRJZCcgaW4gcGFyYW1zKTtcbiAgICAgICAgaWYgKCF3YWxsZXRJZEluUGFyYW1zKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoT3JkZXIgcmVxdWlyZXMgYSB3YWxsZXRJZCBwYXJhbWV0ZXInKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZUdldFdhbGxldHNXYWxsZXRJZE9yZGVyc0lkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAg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YmknLFxuICAgICAgICAgICAgJ25hbWUnOiAnanViaS5jb20nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTgxLTlkMzk3ZDlhLTVlZGQtMTFlNy04ZmI5LTVkODIzNmMwZTY5Mi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuanViaS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmp1YmkuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3Lmp1YmkuY29tL2hlbHAvYXBpLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFsbHRpY2tlciAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW3BdO1xuICAgICAgICAgICAgbGV0IGJhc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B0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzQnlBbHRuYW1lJzoge30sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzIxNjAwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTk5LTIyNzA5MzA0LTVlZGUtMTFlNy05ZGUxLTlmMzM3MzJlMTUwOS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9hcGkua3Jha2VuLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnemVuZGVzayc6ICdodHRwczovL3N1cHBvcnQua3Jha2VuLmNvbS9oYy9lbi11cy9hcnRpY2xlcycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9ub3RoaW5naXNkZWFkL25wbS1rcmFrZW4tYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20vZW4tdXMvaGVscC9mZWVzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMjZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4wMDI0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjAwMjJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMDAyMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wMDE4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4wMDE2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wMDE0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMDEyXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMDAwMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjAwMTZdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMCwgMC4wMDE0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjAwMTJdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMDAxMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4wMDA4XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMCwgMC4wMDA2XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wMDA0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4wMDAyXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDAuMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgLy8gdGhpcyBpcyBhIGJhZCB3YXkgb2YgaGFyZGNvZGluZyBmZWVzIHRoYXQgY2hhbmdlIG9uIGRhaWx5IGJhc2lzXG4gICAgICAgICAgICAgICAgLy8gaGFyZGNvZGluZyBpcyBub3cgY29uc2lkZXJlZCBvYnNvbGV0ZSwgd2Ugd2lsbCByZW1vdmUgYWxsIG9mIGl0IGV2ZW50dWFsbHlcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTE0nOiAwLjAwMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiAxMCwgLy8gQ0FEIEVGVCBXaXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMzAwLCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01MTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCwgLy8gZnJlZSBkZXBvc2l0IGlmIEVVUiBTRVBBIERlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMCwgLy8gRG9tZXN0aWMgRGVwb3NpdCAoRnJlZSwgwqU1LDAwMCBkZXBvc2l0IG1pbmltdW0pXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd6ZW5kZXNrJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2Ugc2hvdWxkIHJlYWxseSByZWZyYWluIGZyb20gcHV0dGluZyBmaXhlZCBmZWUgbnVtYmVycyBhbmQgc3RvcCBoYXJkY29kaW5nXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSB3aWxsIGJlIHVzaW5nIHRoZWlyIHdlYiBBUElzIHRvIHNjcmFwZSBhbGwgbnVtYmVycyBmcm9tIHRoZXNlIGFydGljbGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjA1ODkzNzA4LVdoYXQtaXMtdGhlLW1pbmltdW0tb3JkZXItc2l6ZS0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJzIwMTM5Njc3Ny1XaGF0LWFyZS10aGUtZGVwb3NpdC1mZWVzLScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjAxODkzNjA4LVdoYXQtYXJlLXRoZS13aXRoZHJhd2FsLWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0hMQycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3ByZWFkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRNZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXBvc2l0U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMZWRnZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuUG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeUxlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZXNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdjYWNoZURlcG9zaXRNZXRob2RzT25GZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSwgLy8gd2lsbCBpc3N1ZSB1cCB0byB0d28gY2FsbHMgaW4gZmV0Y2hEZXBvc2l0QWRkcmVzc1xuICAgICAgICAgICAgICAgICdkZXBvc2l0TWV0aG9kcyc6IHt9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdFRnVuZGluZzpVbmtub3duIHdpdGhkcmF3IGtleSc6IEV4Y2hhbmdlRXJyb3IsXG4gICAgICAgICAgICAgICAgJ0VGdW5kaW5nOkludmFsaWQgYW1vdW50JzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJ0VTZXJ2aWNlOlVuYXZhaWxhYmxlJzogRXhjaGFuZ2VOb3RBdmFpbGFibGUsXG4gICAgICAgICAgICAgICAgJ0VEYXRhYmFzZTpJbnRlcm5hbCBlcnJvcic6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgICAgICdFU2VydmljZTpCdXN5JzogRXhjaGFuZ2VOb3RBdmFpbGFibGUsXG4gICAgICAgICAgICAgICAgJ0VBUEk6UmF0ZSBsaW1pdCBleGNlZWRlZCc6IEREb1NQcm90ZWN0aW9uLFxuICAgICAgICAgICAgICAgICdFUXVlcnk6VW5rbm93biBhc3NldCc6IEV4Y2hhbmdlRXJyb3IsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydw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V0IGxpc3RJdGVtID0gbGlzdEl0ZW1zW2xdO1xuICAgICAgICAgICAgbGV0IGNodW5rcyA9IGxpc3RJdGVtLnNwbGl0IChzZXBhcmF0b3IpO1xuICAgICAgICAgICAgbGV0IG51bUNodW5rcyA9IGNodW5rcy5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtQ2h1bmtzID4gMSkge1xuICAgICAgICAgICAgICAgIGxldCBsaW1pdCA9IHBhcnNlRmxvYXQgKGNodW5rc1sxXSk7XG4gICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBjaHVua3NbMF07XG4gICAgICAgICAgICAgICAgY2h1bmtzID0gbmFtZS5zcGxpdCAoJygnKTtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjaHVua3NbMV07XG4gICAgICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGxpbWl0O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCBsaW1pdHMgPSBhd2FpdCB0aGlzLmZldGNoTWluT3JkZXJTaXplcyAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1sncmVzdWx0J10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtpZF07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgaWYgKChiYXNlWzBdID09PSAnWCcpIHx8IChiYXNlWzBdID09PSAnWicpKVxuICAgICAgICAgICAgICAgIGJhc2UgPSBiYXNlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIGlmICgocXVvdGVbMF0gPT09ICdYJykgfHwgKHF1b3RlWzBdID09PSAnWicpKVxuICAgICAgICAgICAgICAgIHF1b3RlID0gcXVvdGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBkYXJrcG9vbCA9IGlkLmluZGV4T2YgKCcuZCcpID49IDA7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gZGFya3Bvb2wgPyBtYXJrZXRbJ2FsdG5hbWUnXSA6IChiYXNlICsgJy8nICsgcXVvdGUpO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKCdmZWVzX21ha2VyJyBpbiBtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsnZmVlc19tYWtlciddWzBdWzFdKSAvIDEwMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnbG90X2RlY2ltYWxzJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydwYWlyX2RlY2ltYWxzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IG1pbkFtb3VudCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgaWYgKGJhc2UgaW4gbGltaXRzKVxuICAgICAgICAgICAgICAgIG1pbkFtb3VudCA9IGxpbWl0c1tiYXNlXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Rhcmtwb29sJzogZGFya3Bvb2wsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2FsdG5hbWUnOiBtYXJrZXRbJ2FsdG5hbWUnXSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiBwYXJzZUZsb2F0IChtYXJrZXRbJ2ZlZXMnXVswXVsxXSkgLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1pbkFtb3VudCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEluYWN0aXZlTWFya2V0cyAocmVzdWx0KTtcbiAgICAgICAgdGhpcy5tYXJrZXRzQnlBbHRuYW1lID0gdGhpcy5pbmRleEJ5IChyZXN1bHQsICdhbHRuYW1lJyk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXBwZW5kSW5hY3RpdmVNYXJrZXRzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0geyAnYW1vdW50JzogOCwgJ3ByaWNlJzogOCB9O1xuICAgICAgICBsZXQgY29zdExpbWl0cyA9IHsgJ21pbic6IDAsICdtYXgnOiB1bmRlZmluZWQgfTtcbiAgICAgICAgbGV0IHByaWNlTGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSwgJ21heCc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBsZXQgYW1vdW50TGltaXRzID0geyAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pIH07XG4gICAgICAgIGxldCBsaW1pdHMgPSB7ICdhbW91bnQnOiBhbW91bnRMaW1pdHMsICdwcmljZSc6IHByaWNlTGltaXRzLCAnY29zdCc6IGNvc3RMaW1pdHMgfTtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2Rhcmtwb29sJzogZmFsc2UsXG4gICAgICAgICAgICAnaW5mbyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdtYWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0YWtlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhY3RpdmUnOiBmYWxzZSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgbWFya2V0cyA9IFtcbiAgICAgICAgICAgIC8vIHsgJ2lkJzogJ1hYTE1aRVVSJywgJ3N5bWJvbCc6ICdYTE0vRVVSJywgJ2Jhc2UnOiAnWExNJywgJ3F1b3RlJzogJ0VVUicsICdhbHRuYW1lJzogJ1hMTUVVUicgfSxcbiAgICAgICAgXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKGRlZmF1bHRzLCBtYXJrZXRzW2ldKSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0QXNzZXRzIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChjdXJyZW5jaWVzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpZF07XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3lbJ2FsdG5hbWUnXSk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ2RlY2ltYWxzJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkaW5nRmVlcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZVZvbHVtZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRyYWRlZFZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0IChyZXNwb25zZVsncmVzdWx0J10sICd2b2x1bWUnKTtcbiAgICAgICAgbGV0IHRpZXJzID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3RpZXJzJ107XG4gICAgICAgIGxldCB0YWtlciA9IHRpZXJzWyd0YWtlciddWzFdO1xuICAgICAgICBsZXQgbWFrZXIgPSB0aWVyc1snbWFrZXInXVsxXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWVyc1sndGFrZXInXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKHRyYWRlZFZvbHVtZSA+PSB0aWVyc1sndGFrZXInXVtpXVswXSlcbiAgICAgICAgICAgICAgICB0YWtlciA9IHRpZXJzWyd0YWtlciddW2ldWzFdO1xuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGllcnNbJ21ha2VyJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGlmICh0cmFkZWRWb2x1bWUgPj0gdGllcnNbJ21ha2VyJ11baV1bMF0pXG4gICAgICAgICAgICAgICAgbWFrZXIgPSB0aWVyc1snbWFrZXInXVtpXVsxXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgaWYgKG1hcmtldFsnZGFya3Bvb2wnXSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBkb2VzIG5vdCBwcm92aWRlIGFuIG9yZGVyIGJvb2sgZm9yIGRhcmtwb29sIHN5bWJvbCAnICsgc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbi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hcnNlRmxvYXQgKHRpY2tlclsnaCddWzFdKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2wnXVsxXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiJ11bMF0pLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2EnXVswXSksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbycpLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHBhaXJzID0gW107XG4gICAgICAgIGZvciAobGV0IHMgPSAwOyBzIDwgdGhpcy5zeW1ib2xzLmxlbmd0aDsgcysrKSB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGhpcy5zeW1ib2xzW3NdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsnYWN0aXZlJ10pXG4gICAgICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rhcmtwb29sJ10pXG4gICAgICAgICAgICAgICAgICAgIHBhaXJzLnB1c2ggKG1hcmtldFsnaWQnXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZpbHRlciA9IHBhaXJzLmpvaW4gKCcsJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBmaWx0ZXIsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VycyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1z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uICAgICAgICBsZXQgYW1vdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBvcmRlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLmZpbmRNYXJrZXRCeUFsdG5hbWVPcklkICh0cmFkZVsncGFpciddKTtcbiAgICAgICAgaWYgKCdvcmRlcnR4aWQnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBvcmRlciA9IHRyYWRlWydvcmRlcnR4aWQnXTtcbiAgICAgICAgICAgIGlkID0gdHJhZGVbJ2lkJ107XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ3RpbWUnXSAqIDEwMDApO1xuICAgICAgICAgICAgc2lkZSA9IHRyYWRlWyd0eXBlJ107XG4gICAgICAgICAgICB0eXBlID0gdHJhZGVbJ29yZGVydHlwZSddO1xuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdwcmljZScpO1xuICAgICAgICAgICAgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAndm9sJyk7XG4gICAgICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpLFxuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWzJdICogMTAwMCk7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWzNdID09PSAncycpID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgICAgICB0eXBlID0gKHRyYWRlWzRdID09PSAnbCcpID8gJ2xpbWl0JyA6ICdtYXJrZXQnO1xuICAgICAgICAgICAgcHJpY2UgPSBwYXJzZUZsb2F0ICh0cmFkZVswXSk7XG4gICAgICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsxXSk7XG4gICAgICAgICAgICBsZXQgdHJhZGVMZW5ndGggPSB0cmFkZS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAodHJhZGVMZW5ndGggPiA2KVxuICAgICAgICAgICAgICAgIGlkID0gdHJhZGVbNl07IC8vIGFydGlmaWNpYWxseSBhZGRlZCBhcyBwZXIgIzE3OTRcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gKG1hcmtldCkgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgIC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vZGVbMF0gPT09ICdaJykge1xuICAgICAgICAgICAgICAgIGNvZGUgPSBjb2RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ29yZGVydHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAndm9sdW1lJzogdGhpcy5hbW91bnRUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ2xpbWl0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5wcmljZVRvUHJlY2lzaW9uIChzeW1ib2wsIHByaWNlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFkZE9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2VbJ3Jlc3VsdCddLCAndHhpZCcpO1xuICAgICAgICBpZiAodHlwZW9mIGlkICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkgKGlkKSkge1xuICAgICAgICAgICAgICAgIGxldCBsZW5ndGggPSBpZC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgaWQgPSAobGVuZ3RoID4gMSkgPyBpZCA6IGlkWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgZmluZE1hcmtldEJ5QWx0bmFtZU9ySWQgKGlkKSB7XG4gICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNCeUFsdG5hbWUpIHtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLm1hcmtldHNCeUFsdG5hbWVbaWRdO1xuICAgICAgICB9IGVsc2UgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBkZXNjcmlwdGlvbiA9IG9yZGVyWydkZXNjciddO1xuICAgICAgICBsZXQgc2lkZSA9IGRl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29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZScpO1xuICAgICAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBmZWVDb3N0LFxuICAgICAgICAgICAgICAgICAgICAncmF0ZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgIGlmIChmbGFncy5pbmRleE9mICgnZmNpcScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgZmVlWydjdXJyZW5jeSddID0gbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaWInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdma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RkcmVzcyxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaERlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmN5IChjb2RlKTtcbiAgICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIHF1b3Rlc1xuICAgICAgICBsZXQgbWV0aG9kID0gdGhpcy5zYWZlU3RyaW5nIChwYXJhbXMsICdtZXRob2QnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBtZXRob2QgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zWydjYWNoZURlcG9zaXRNZXRob2RzT25GZXRjaERlcG9zaXRBZGRyZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAvLyBjYWNoZSBkZXBvc2l0TWV0aG9kc1xuICAgICAgICAgICAgICAgIGlmICghKGNvZGUgaW4gdGhpcy5vcHRpb25zWydkZXBvc2l0TWV0aG9kcyddKSlcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcHRpb25zWydkZXBvc2l0TWV0aG9kcyddW2NvZGVdID0gYXdhaXQgdGhpcy5mZXRjaERlcG9zaXRNZXRob2RzIChjb2RlKTtcbiAgICAgICAgICAgICAgICBtZXRob2QgPSB0aGlzLm9wdGlvbnNbJ2RlcG9zaXRNZXRob2RzJ11bY29kZV1bMF1bJ21ldGhvZCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hEZXBvc2l0QWRkcmVzcygpIHJlcXVpcmVzIGFuIGV4dHJhI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gICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCB0YWcgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgaWYgKCdrZXknIGluIHBhcmFtcykge1xuICAgICAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYXNzZXQnOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgICAgIC8vICdhZGRyZXNzJzogYWRkcmVzcywgLy8gdGhleSBkb24ndCBhbGxvdyB3aXRoZHJhd2FscyB0byBkaXJlY3QgYWRkcmVzc2VzXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgXCIgd2l0aGRyYXcgcmVxdWlyZXMgYSAna2V5JyBwYXJhbWV0ZXIgKHdpdGhkcmF3YWwga2V5IG5hbWUsIGFzIHNldCB1cCBvbiB5b3VyIGFjY291bnQpXCIpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGg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YWMgKGJpbmhhc2gsIHNlY3JldCwgJ3NoYTUxMicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnQVBJLVNpZ24nOiB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsID0gJy8nICsgcGF0aDtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdJbnZhbGlkIG9yZGVyJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgbm9uY2UnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWROb25jZSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnSW5zdWZmaWNpZW50IGZ1bmRzJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnQ2FuY2VsIHBlbmRpbmcnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IENhbmNlbFBlbmRpbmcgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0ludmFsaWQgYXJndW1lbnRzOnZvbHVtZScpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByZXNwb25zZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbnVtRXJyb3JzID0gcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoO1xuICAgICAgICAgICAgICAgICAgICBpZiAobnVtRXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2VbJ2Vycm9yJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2Vycm9yJ11baV0gaW4gdGhpcy5leGNlcHRpb25zKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyB0aGlzLmV4Y2VwdGlvbnN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1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLCAvLyBzZWUgdGhlIG1ldGhvZCBpbXBsZW1lbnRhdGlvbiBiZWxvd1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogJ2VtdWxhdGVkJywgLy8gdGhpcyBtZXRob2QgaXMgdG8gYmUgZGVsZXRlZCwgc2VlIGltcGxlbWVudGF0aW9uIGFuZCBjb21tZW50cyBiZWxvd1xuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogMSxcbiAgICAgICAgICAgICAgICAnNW0nOiA1LFxuICAgICAgICAgICAgICAgICcxNW0nOiAxNSxcbiAgICAgICAgICAgICAgICAnMzBtJzogMzAsXG4gICAgICAgICAgICAgICAgJzFoJzogNjAsXG4gICAgICAgICAgICAgICAgJzhoJzogNDgwLFxuICAgICAgICAgICAgICAgICcxZCc6ICdEJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMzc5NTY1NS1iM2M0NmU0OC1kY2Y2LTExZTctOGFiZS1kYzQ1ODhiYTc5MDEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5rdWNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2tpdGNoZW4nOiAnaHR0cHM6Ly9raXRjaGVuLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICAgICAna2l0Y2hlbi0yJzogJ2h0dHBzOi8va2l0Y2hlbi0yLmt1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5rdWNvaW4uY29tLz9yPUU1d2txZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2t1Y29pbmFwaWRvY3MuZG9jcy5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vbmV3cy5rdWNvaW4uY29tL2VuL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAna2l0Y2hlbic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2NvbmZpZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2RlYWwtb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2xhbmctbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzLWJ1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMtc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2luLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL2NvaW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2lucy10cmVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dhbGxldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93YWxsZXQvcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vc3VtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWFsLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hY3RpdmUtbWFwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWFsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWZlcnJlci9kZXNjZW5kYW50L2NvdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93aXRoZHJhdy9hcHBseScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2l0aGRyYXcvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3Byb21vdGlvbi9kcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwtb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwtYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoYW5nZS1sYW5nJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnS0NTJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHQVMnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVkMnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BBWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JIQyc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIU1InOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSUFgnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVRJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9EJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FQkwnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NBRyc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkROJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VLRyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ1BUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05VTFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1ZUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTVCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVVJBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NVQic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRU1AnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9XUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGTElYWCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEVORCc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1CJzogMy4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JIT0MnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUic6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUkdOJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FDVCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIC8vIGV4Y2hhbmdlLXNwZWNpZmljIG9wdGlvbnNcbiAgICAgICAgICAgICdvcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICd0aW1lRGlmZmVyZW5jZSc6IDAsIC8vIHRoZSBkaWZmZXJlbmNlIGJldHdlZW4gc3lzdGVtIGNsb2NrIGFuZCBLdWNvaW4gY2xvY2tcbiAgICAgICAgICAgICAgICAnYWRqdXN0Rm9yVGltZURpZmZlcmVuY2UnOiBmYWxzZSwgLy8gY29udHJvbHMgdGhlIGFkanVzdG1lbnQgbG9naWMgdXBvbiBpbnN0YW50aWF0aW9uXG4g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GUnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnY29pblR5cGVQYWlyJ107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gbWFya2V0Wyd0cmFkaW5nJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2ZlZVJhdGUnKSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnZmVlUmF0ZScpLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaERlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmN5IChjb2RlKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudENvaW5XYWxsZXRBZGRyZXNzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW4nOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKGRhdGEsICdhZGRyZXNzJyk7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgbGV0IHRhZyA9IHRoaXMuc2FmZVN0cmluZyAoZGF0YSwgJ3VzZXJPaWQnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAg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iAgICAgICAgICAgIGxldCB3aXRoZHJhdyA9IGN1cnJlbmN5WydlbmFibGVXaXRoZHJhdyddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChkZXBvc2l0ICYmIHdpdGhkcmF3KTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3dpdGhkcmF3TWluRmVlJ10sIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRCYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0JzogMjAsIC8vIGRlZmF1bHQgMTIsIG1heCAyMFxuICAgICAgICAgICAgJ3BhZ2UnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXMsICdjb2luVHlwZScpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChpbmRleGVkKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZX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gICAgICAgIGlmICh0eXBlb2Ygc3RhdHVzID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiByZW1haW5pbmcgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIGlmIChyZW1haW5pbmcgPiAwKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2Ygc3RhdHVzICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09PSAnY2xvc2VkJylcbiAgICAgICAgICAgICAgICAgICAgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIH0gZWxzZSBpZiAoZmlsbGVkID09PSAwLjApIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGNvc3QgPSAwO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdHJhZGVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCArPSB0cmFkZXNbaV1bJ2Ftb3VudCddO1xuICAgICAgICAgICAgICAgICAgICBjb3N0ICs9IHRyYWRlc1tpXVsnY29zdCddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICAvLyBrdWNvaW4gcHJpY2UgYW5kIGFtb3VudCBmaWVsZHMgaGF2ZSB2YXJ5aW5nIG5hbWVzXG4gICAgICAgIC8vIHRodXMgdGhlIGNvbnZvbHV0ZWQgc3BhZ2hldHRpIGNvZGUgYmVsb3dcbiAgICAgICAgbGV0IHByaWNlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIC8vIGlmIHRoZSBvcmRlciB3YXMgZmlsbGVkIGF0IGxlYXN0IGZvciBzb21lIHBhcnRcbiAgICAgICAgICAgIGlmIChmaWxsZWQgPiAwLjApIHtcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbFByaWNlJyk7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZGVhbFByaWNlQXZlcmFnZScpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBpdCdzIGFuIG9wZW4gb3JkZXIsIG5vdCBmaWxsZWQgeWV0LCB1c2UgdGhlIGluaXRpYWwgcHJpY2VcbiAgICAgICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ29yZGVyUHJpY2UnKTtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHByaWNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNvc3QgPT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gcHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc3VtIChmaWxsZWQsIHJlbWFpbmluZyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGVvZiByZW1haW5pbmcgPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdvcGVuJykge1xuICAgICAgICAgICAgaWYgKCh0eXBlb2YgY29zdCA9PT0gJ3VuZGVmaW5lZCcpIHx8IChjb3N0ID09PSAwLjApKVxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICBjb3N0ID0gYW1vdW50ICogcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIG1hcmtldCAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGZlZUN1cnJlbmN5ID0gKHNpZGUgPT09ICdzZWxsJykgPyBtYXJrZXRbJ3F1b3RlJ10gOiBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGx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gKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ29yZGVyT2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyRGV0YWlsICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2VbJ2RhdGEnXSlcbiAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAvL1xuICAgICAgICAvLyB0aGUgY2FjaGluZyBwYXJ0IHRvIGJlIHJlbW92ZWRcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2VbJ2RhdGEnXSwgbWFya2V0KTtcbiAgICAgICAgLy8gICAgIGxldCBvcmRlcklkID0gb3JkZXJbJ2lkJ107XG4gICAgICAgIC8vICAgICBpZiAob3JkZXJJZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgLy8gICAgICAgICBvcmRlclsnc3RhdHVzJ10gPSB0aGlzLm9yZGVyc1tvcmRlcklkXVsnc3RhdHVzJ107XG4gICAgICAgIC8vICAgICB0aGlzLm9yZGVyc1tvcmRlcklkXSA9IG9yZGVyO1xuICAgICAgICAvL1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZVsnZGF0YSddLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzQnlTdGF0dXMgKG9yZGVycywgbWFya2V0LCBzaW5jZSwgbGltaXQsIHN0YXR1cykge1xuICAgICAgICBsZXQgcm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ICAgICAgICAgcmVxdWVzdFsnbGltaXQnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlckRlYWx0ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcnMgPSByZXNwb25zZVsnZGF0YSddWydkYXRhcyddO1xuICAgICAgICAvL1xuICAgICAgICAvLyB0aGUgY2FjaGluZyBwYXJ0IHRvIGJlIHJlbW92ZWRcbiAgICAgICAgLy9cbiAgICAgICAgLy8gICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgIC8vICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5wYXJzZU9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXJzW2ldLCB7XG4gICAgICAgIC8vICAgICAgICAgICAgICdzdGF0dXMnOiAnY2xvc2VkJyxcbiAgICAgICAgLy8gICAgICAgICB9KSwgbWFya2V0KTtcbiAgICAgICAgLy8gICAgICAgICBsZXQgb3JkZXJJZCA9IG9yZGVyWydpZCddO1xuICAgICAgICAvLyAgICAgICAgIGlmIChvcmRlcklkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAvLyAgICAgICAgICAgICBpZiAodGhpcy5vcmRlcnNbb3JkZXJJZF1bJ3N0YXR1cyddID09PSAnY2FuY2VsZWQnKVxuICAgICAgICAvLyAgICAgICAgICAgICAgICAgb3JkZXJbJ3N0YXR1cyddID0gdGhpcy5vcmRlcnNbb3JkZXJJZF1bJ3N0YXR1cyddO1xuICAgICAgICAvLyAgICAgICAgIHRoaXMub3JkZXJzW29yZGVyWydpZCddXSA9IG9yZGVyO1xuICAgICAgICAvLyAgICAgfVxuICAgICAgICAvLyAgICAgbGV0IGNsb3NlZE9yZGVycyA9IHRoaXMuZmlsdGVyQnkgKHRoaXMub3JkZXJzLCAnc3RhdHVzJywgJ2Nsb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BzdG9yZSBpdCBpbiBjYWNoZSBmb3IgZnVydGhlciByZWZlcmVuY2VzXG4gICAgICAgIC8vICAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAvLyAgICAgICAgIGxldCBzaWRlID0gcmVxdWVzdFsndHlwZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAvLyAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHtcbiAgICAgICAgLy8gICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIC8vICAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgIC8vICAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgIC8vICAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgLy8gICAgICAgICAgICAgJ3N0YXR1cyc6ICdjYW5jZWxlZCcsXG4gICAgICAgIC8vICAgICAgICAgfTtcbiAgICAgICAgLy8gICAgIH1cbiAgICAgICAgLy8gICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgLy9cbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWydkYXRldGltZSddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPS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AgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheSAodHJhZGUpKSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0cmFkZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgaWYgKHRyYWRlWzFdID09PSAnQlVZJykge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodHJhZGVbMV0gPT09ICdTRUxMJykge1xuICAgICAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwcmljZSA9IHRyYWRlWzJdO1xuICAgICAgICAgICAgYW1vdW50ID0gdHJhZGVbM107XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aW1lc3RhbXAgPSB0aGlzLnNhZmVWYWx1ZSAodHJhZGUsICdjcmVhdGVkQXQnKTtcbiAgICAgICAgICAgIG9yZGVyID0gdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyT2lkJyk7XG4gICAgICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdvaWQnKTtcbiAgICAgICAgICAgIHNpZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnZGlyZWN0aW9uJyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHNpZGUgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHNpZGUgPSBzaWRlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdkZWFsUHJpY2UnKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2RlYWxWYWx1ZScpO1xuICAgICAgICAgICAgbGV0IGZlZUN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgZmVlQ3VycmVuY3kgPSAoc2lkZSA9PT0gJ3NlbGwnKSA/IG1hcmtldFsncXVvdGUnXSA6IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgZmVlQ3VycmVuY3lGaWVsZCA9IChzaWRlID09PSAnc2VsbCcpID8gJ2NvaW5UeXBlUGFpcicgOiAnY29pblR5cGUnO1xuICAgICAgICAgICAgICAgIGxldCBmZWVDdXJyZW5jeSA9IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsIGZlZUN1cnJlbmN5RmllbGQpO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZmVlQ3VycmVuY3kgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmZWVDdXJyZW5jeSBpbiB0aGlzLmN1cnJlbmNpZXNfYnlfaWQpXG4gICAgICAgICAgICAgICAgICAgICAgICBmZWVDdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtmZWVDdXJyZW5jeV1bJ2NvZGUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdmZWUnKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBmZWVDdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBtYXJrZXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXIsXG4gICAgICAgICAgICAnaW5mbyc6IGluZm8sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3BlbkRlYWxPcmRlcnMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydkYXRhJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE15VHJhZGVzIChzeW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HRVQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeVN0cmluZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IGVuZHBvaW50ICsgJy8nICsgbm9uY2UgKyAnLycgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKGF1dGgpKTtcbiAgICAgICAgICAgIC8vIHBheWxvYWQgc2hvdWxkIGJlIFwiZW5jb2RlZFwiIGFzIHJldHVybmVkIGZyb20gc3RyaW5nVG9CYXNlNjRcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnS0MtQVBJLU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PbkVycm9yIChyZXNwb25zZSkge1xuICAgICAgICAvL1xuICAgICAgICAvLyBBUEkgZW5kcG9pbnRzIH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ZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgaWYgKGNvZGUgPT09ICdVTkFVVEgnKSB7XG4gICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ0ludmFsaWQgbm9uY2UnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkTm9uY2UgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgIH0gZWxzZSBpZiAoY29kZSA9PT0gJ0VSUk9SJykge1xuICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ1RoZSBwcmVjaXNpb24gb2YgYW1vdW50JykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIGFtb3VudCB2aW9sYXRlcyBwcmVjaXNpb24uYW1vdW50XG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnTWluIGFtb3VudCBlYWNoIG9yZGVyJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIGFtb3VudCA8IGxpbWl0cy5hbW91bnQubWluXG4gICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnTWluIHByaWNlOicpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAoZmVlZGJhY2spOyAvLyBwcmljZSA8IGxpbWl0cy5wcmljZS5taW5cbiAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdNYXggcHJpY2U6JykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyIChmZWVkYmFjayk7IC8vIHByaWNlID4gbGltaXRzLnByaWNlLm1heFxuICAgICAgICAgICAga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MnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTY5NzYzOC05MTI4MjRmYS1iM2MxLTExZTctOGMzNi1jZjk2MDZlYjk0YWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8va3VuYS5pbycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2t1bmEuaW8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9rdW5hLmlvL2RvY3VtZW50cy9hcGknLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8va3VuYS5pby9kb2N1bWVudHMvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnVUFIJzogJzElJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dBVkVTJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHT0wnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0JHJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1JNQyc6IDAuMDAxIEJU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ICAgYmFzZUlkID0gYmFzZUlkLnJlcGxhY2UgKCdnYmcnLCAnJyk7XG4gICAgICAgICAgICAgICAgaWYgKGJhc2VJZC5sZW5ndGggPiAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBiYXNlSWRMZW5ndGggPSBiYXNlSWQubGVuZ3RoIC0gMDsgLy8gYSB0cmFuc3BpbGVyIHdvcmthcm91bmRcbiAgICAgICAgICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoYmFzZUlkTGVuZ3RoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0cy5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuIC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VuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdsYWtlYnRjJyxcbiAgICAgICAgICAgICduYW1lJzogJ0xha2VCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVUycsXG4gICAgICAgICAgICAndmVyc2lvbic6ICdhcGlfdjInLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA3NDEyMC03MmI3YzM4YS02NjYwLTExZTctOTJkOS1kOTAyNzUwMjI4MWQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxha2VidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmxha2VidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20vcy9hcGlfdjInLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubGFrZWJ0Yy5jb20vcy9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jjb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0RXh0ZXJuYWxBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGtleXMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGtleXNba107XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlSWQgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGJhc2VJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHF1b3RlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QWNjb3VudEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMuY3VycmVuY2llc19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY3VycmVuY2llc19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgY29kZSA9IGN1cnJlbmN5Wydjb2RlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VzW2lkXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0QmNvcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2spO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICh0eXBlb2YgbWFya2V0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGF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MpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSBwYXJhbXMuam9pbiAoJywnKTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBwYXJhbXMgPSAnJztcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdyZXF1ZXN0bWV0aG9kJzogbWV0aG9kLnRvTG93ZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcGFyYW1zLFxuICAgICAgICAgICAgICAgICdpZCc6IG5vbmNlLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMScpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmVuY29kZSAodGhpcy5hcGlLZXkgKyAnOicgKyBzaWduYXR1cmUpO1xuICAgICAgICAgICAgaGV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ICAgICAgICAgICAgICAnMzBtJzogJ21pbnV0ZTMwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnaG91cjEnLFxuICAgICAgICAgICAgICAgICcyaCc6ICdob3VyMicsXG4gICAgICAgICAgICAgICAgJzRoJzogJ2hvdXI0JyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnaG91cjYnLFxuICAgICAgICAgICAgICAgICc4aCc6ICdob3VyOCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICdob3VyMTInLFxuICAgICAgICAgICAgICAgICcxZCc6ICdkYXkxJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnd2VlazEnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzgwNjM2MDItOTYwNWUyOGEtMzMwMi0xMWU4LTgxYmUtNjRiMWU1M2M0Y2ZiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5sYmFuay5pbmZvJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmxiYW5rLmluZm8nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGJhbmsuaW5mby9hcGkvYXBpLW92ZXJ2aWV3JyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xiYW5raW5mby56ZW5kZXNrLmNvbS9oYy96aC1jbi9hcnRpY2xlcy8xMTUwMDIyOTUxMTQtLSVFOCVCNCVCOSVFNyU4RSU4NyVFOCVBRiVCNCVFNiU5OCU4RScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnNfaW5mb19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ1FUVU0nOiBhbW91bnQgPT4gTWF0aC5tYXggKDAuMDEsIGFtb3VudCAqICgwLjEgLyAxMDApKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQyc6IDUwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogMjAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOQVMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hXQyc6IDUuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVFMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5LJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCT1QnOiAzLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWU9ZT1cnOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RHQyc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NNVCc6IDIwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0VFUic6IDIwMDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGSUwnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlycyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkLnRvVXBwZXJDYXNlICgpKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBbYmFzZSwgcXVvdGVdLmpvaW4gKCcvJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGlkLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgaW5mbyA9IHRpY2tlcjtcbiAgICAgICAgdGlja2VyID0gaW5mb1sndGlja2VyJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhdGVzdCcpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgIC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OiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndGlkJyksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAoY29zdCksXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aGlzLnNhZmVWYWx1ZSAodHJhZGUsICdpbmZvJywgdHJhZGUpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnc2l6ZSc6IDEwMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHNpbmNlKVxuICAgICAgICAgICAgcmVxdWVzdFsndGltZSddID0gcGFyc2VJbnQgKHNpbmNlIC8gMTAwMCk7XG4gICAgICAgIGlmIChsaW1pdClcbiAgICAgICAgICAgIHJlcXVlc3RbJ3NpemUnXSA9IGxpbWl0O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4g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gICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAob3JkZXIsICdvcmRlcl9pZCcpLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ29yZGVyX3R5cGUnKSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRoaXMuc2FmZVZhbHVlIChvcmRlciwgJ2luZm8nLCBvcmRlciksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT09ICdtYXJrZXQnKSB7XG4gICAgICAgICAgICBvcmRlclsndHlwZSddICs9ICdfbWFya2V0JztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENyZWF0ZU9yZGVyICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICBvcmRlciA9IHRoaXMub21pdCAob3JkZXIsICd0eXBlJyk7XG4gICAgICAgIG9yZGVyWydvcmRlcl9pZCddID0gcmVzcG9uc2VbJ29yZGVyX2lkJ107XG4gICAgICAgIG9yZGVyWyd0eXBlJ10gPSBzaWRlO1xuICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gdHlwZTtcbiAgICAgICAgb3JkZXJbJ2NyZWF0ZV90aW1lJ10gPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgb3JkZXJbJ2luZm8nXSA9IHJlc3BvbnNlO1xuICAgICAgICBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCk7XG4gICAgICAgIGxldCBpZCA9IG9yZGVyWydpZCddO1xuICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIG9yZGVyO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V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6ICdLZXkgZG9lcyBub3QgZXhpc3QnLFxuICAgICAgICAgICAgICAgICcxMDAwNic6ICd1c2VyIGRvZXMgbm90IGV4aXN0JyxcbiAgICAgICAgICAgICAgICAnMTAwMDcnOiAnSW52YWxpZCBzaWduYXR1cmUnLFxuICAgICAgICAgICAgICAgICcxMDAwOCc6ICdUaGlzIGN1cnJlbmN5IHBhaXIgaXMgbm90IHN1cHBvcnRlZCcsXG4gICAgICAgICAgICAgICAgJzEwMDA5JzogJ0xpbWl0IG9yZGVycyBjYW4gbm90IGJlIG1pc3Npbmcgb3JkZXJzIGFuZCB0aGUgbnVtYmVyIG9mIG9yZGVycycsXG4gICAgICAgICAgICAgICAgJzEwMDEwJzogJ09yZGVyIHByaWNlIG9yIG9yZGVyIHF1YW50aXR5IG11c3QgYmUgZ3JlYXRlciB0aGFuIDAnLFxuICAgICAgICAgICAgICAgICcxMDAxMSc6ICdNYXJrZXQgb3JkZXJzIGNhbiBub3QgYmUgbWlzc2luZyB0aGUgYW1vdW50IG9mIHRoZSBvcmRlcicsXG4gICAgICAgICAgICAgICAgJzEwMDEyJzogJ21hcmtldCBzZWxsIG9yZGVycyBjYW4gbm90IGJlIG1pc3Npbmcgb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAnMTAwMTMnOiAnaXMgbGVzcyB0aGFuIHRoZSBtaW5pbXVtIHRyYWRpbmcgcG9zaXRpb24gMC4wMDEnLFxuICAgICAgICAgICAgICAgICcxMDAxNCc6ICdBY2NvdW50IG51bWJlciBpcyBub3QgZW5vdWdoJyxcbiAgICAgICAgICAgICAgICAnMTAwMTUnOiAnVGhlIG9yZGVyIHR5cGUgaXMgd3JvbmcnLFxuICAgICAgICAgICAgICAgICcxMDAxNic6ICdBY2NvdW50IGJhbGFuY2UgaXMgbm90IGVub3VnaCcsXG4gICAgICAgICAgICAgICAgJzEwMDE3JzogJ0Fibm9ybWFsIHNlcnZlcicsXG4gICAgICAgICAgICAgICAgJzEwMDE4JzogJ29yZGVyIGlucXVpcnkgY2FuIG5vdCBiZSBtb3JlIHRoYW4gNTAgbGVzcyB0aGFuIG9uZScsXG4gICAgICAgICAgICAgICAgJzEwMDE5JzogJ3dpdGhkcmF3YWwgb3JkZXJzIGNhbiBub3QgYmUgbW9yZSB0aGFuIDMgbGVzcyB0aGFuIG9uZScsXG4gICAgICAgICAgICAgICAgJzEwMDIwJzogJ2xlc3MgdGhhbiB0aGUgbWluaW11bSBhbW91bnQgb2YgdGhlIHRyYW5zYWN0aW9uIGxpbWl0IG9mIDAuMDAxJyxcbiAgICAgICAgICAgIH0sIGVycm9yQ29kZSwgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgbGV0IEVycm9yQ2xhc3MgPSB0aGlzLnNhZmVWYWx1ZSAoe1xuICAgICAgICAgICAgICAgICcxMDAwMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA0JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzEwMDA1JzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMTAwMDYnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDAwNyc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMDA5JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMCc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTEnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDEyJzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxMyc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAnMTAwMTQnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgJzEwMDE1JzogSW52YWxpZE9yZGVyLFxuICAgICAgICAgICAgICAgICcxMDAxNic6IE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GVyQm9va3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb2luRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWRlZW1Db3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7fSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7fSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdEU0gnOiAnREFTSCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzgwMyc6IEludmFsaWRPcmRlciwgLy8gXCJDb3VudCBjb3VsZCBub3QgYmUgbGVzcyB0aGFuIDAuMDAxLlwiIChzZWxsaW5nIGJlbG93IG1pbkFtb3VudClcbiAgICAgICAgICAgICAgICAnODA0JzogSW52YWxpZE9yZGVyLCAvLyBcIkNvdW50IGNvdWxkIG5vdCBiZSBtb3JlIHRoYW4gMTAwMDAuXCIgKGJ1eWluZyBhYm92ZSBtYXhBbW91bnQpXG4gICAgICAgICAgICAgICAgJzgwNSc6IEludmFsaWRPcmRlciwgLy8gXCJwcmljZSBjb3VsZCBub3QgYmUgbGVzcyB0aGFuIFguXCIgKG1pblByaWNlIHZpb2xhdGlvbiBvbiBidXkgJiBzZWxsKVxuICAgICAgICAgICAgICAgICc4MDYnOiBJbnZhbGlkT3JkZXIsIC8vIFwicHJpY2UgY291bGQgbm90IGJlIG1vcmUgdGhhbiBYLlwiIChtYXhQcmljZSB2aW9sYXRpb24gb24gYnV5ICYgc2VsbClcbiAgICAgICAgICAgICAgICAnODA3JzogSW52YWxpZE9yZGVyLCAvLyBcImNvc3QgY291bGQgbm90IGJlIGxlc3MgdGhhbiBYLlwiIChtaW5Db3N0IHZpb2xhdGlvbiBvbiBidXkgJiBzZWxsKVxuICAgICAgICAgICAgICAgIC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nLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUludGVnZXIgKG1hcmtldCwgJ2RlY2ltYWxfcGxhY2VzJyksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX2Ftb3VudCcpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X2Ftb3VudCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmljZUxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgICAgICdtYXgnOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fdG90YWwnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0TGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBoaWRkZW4gPSB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdoaWRkZW4nKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoaGlkZGVuID09PSAwKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ2ZlZSddIC8gMTAwLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBmdW5kcyA9IGJhbGFuY2VzWydmdW5kcyddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChmdW5kcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN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HtcbiAgICAgICAgICAgICAgICBsZXQgbnVtSWRzID0gdGhpcy5pZHMubGVuZ3RoO1xuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBoYXMgJyArIG51bUlkcy50b1N0cmluZyAoKSArICcgc3ltYm9scyBleGNlZWRpbmcgbWF4IFVSTCBsZW5ndGgsIHlvdSBhcmUgcmVxdWlyZWQgdG8gc3BlY2lmeSBhIGxpc3Qgb2Ygc3ltYm9scyBpbiB0aGUgZmlyc3QgYXJndW1lbnQgdG8gZmV0Y2hPcmRlckJvb2tzJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgICAgICBpZHMgPSBpZHMuam9pbiAoJy0nKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERlcHRoUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBpZHMgPSBPYmplY3Qua2V5cyAocmVzcG9uc2UpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3lt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leGNlZWRpbmcgbWF4IFVSTCBsZW5ndGgsIHlvdSBhcmUgcmVxdWlyZWQgdG8gc3BlY2lmeSBhIGxpc3Qgb2Ygc3ltYm9scyBpbiB0aGUgZmlyc3QgYXJndW1lbnQgdG8gZmV0Y2hUaWNrZXJzJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgICAgICBpZHMgPSBpZHMuam9pbiAoJy0nKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2tdO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAg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gICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAncmF0ZSc6IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSksXG4gICAgICAgIH07XG4gICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAocHJpY2UpO1xuICAgICAgICBhbW91bnQgPSBwYXJzZUZsb2F0IChhbW91bnQpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGlkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICBsZXQgZmlsbGVkID0gMC4wO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50O1xuICAgICAgICBpZiAoJ3JldHVybicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sIHRoaXMuZ2V0T3JkZXJJZEtleSAoKSk7XG4gICAgICAgICAgICBpZiAoaWQgPT09ICcwJykge1xuICAgICAgICAgICAgICAgIGlkID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZVsncmV0dXJuJ10sICdpbml0X29yZGVyX2lkJyk7XG4gICAgICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAocmVzcG9uc2VbJ3JldHVybiddLCAncmVjZWl2ZWQnLCAwLjApO1xuICAgICAgICAgICAgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKHJlc3BvbnNlWydyZXR1cm4nXSwgJ3JlbWFpbnMnLCBhbW91bnQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogZmlsbGVkLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC8vICd0cmFkZXMnOiB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsndHJhZGVzJ10sIG1hcmtldCksXG4gICAgICAgIH07XG4gICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IG9yZGVyO1xuICAgICAgICByZXR1cm4gdGhpcy5leHRlb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YW1vdW50Jyk7XG4gICAgICAgICAgICByZW1haW5pbmcgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdhbW91bnQnKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2Ftb3VudCcpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIGFtb3VudCA9IHRoaXMub3JkZXJzW2lkXVsnYW1vdW50J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW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biAgICAgICAgICAgICAgICAvLyBjYWNoZWQgb3JkZXIgaXMgYWJzZW50IGZyb20gdGhlIGxpc3Qgb2Ygb3BlbiBvcmRlcnMgLT4gbWFyayB0aGUgY2FjaGVkIG9yZGVyIGFzIGNsb3NlZFxuICAgICAgICAgICAgICAgIGlmIChjYWNoZWRPcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICBjYWNoZWRPcmRlciA9IHRoaXMuZXh0ZW5kIChjYWNoZWRPcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLCAvLyBsaWtld2lzZSBpdCBtaWdodCBoYXZlIGJlZW4gY2FuY2VsZWQgZXh0ZXJuYWxseSAodW5ub3RpY2VkIGJ5IFwidXNcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3N0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IGNhY2hlZE9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1haW5pbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydjb3N0J10gPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGNhY2hlZE9yZGVyWydmaWxsZWQnXSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FjaGVkT3JkZXJbJ2Nvc3QnXSA9IGNhY2hlZE9yZGVyWydmaWxsZWQnXSAqIGNhY2hlZE9yZGVyWydwcmljZSddO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2NhY2hlZE9yZGVySWRdID0gY2FjaGVkT3JkZXI7XG4gICAgICAgICAgICAgIC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ddW2FwaV07XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuc2lnbkJvZHlXaXRoU2VjcmV0IChib2R5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuZ2V0VmVyc2lvblN0cmluZyAoKSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChodHRwQ29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHkubGVuZ3RoIDwgMilcbiAgICAgICAgICAgIHJldHVybjsgLy8gZmFsbGJhY2sgdG8gZGVmYXVsdCBlcnJvciBoYW5kbGVyXG4gICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAxIC0gTGlxdWkgb25seSByZXR1cm5zIHRoZSBpbnRlZ2VyICdzdWNjZXNzJyBrZXkgZnJvbSB0aGVpciBwcml2YXRlIEFQSVxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IDEsIC4uLiB9IGh0dHBDb2RlID09PSAyMDBcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Nlc3NcIjogMCwgLi4uIH0gaHR0cENvZGUgPT09IDIwMFxuICAgICAgICAgICAgICAgIC8vXG4gICAgICAgICAgICAgICAgLy8gMiAtIEhvd2V2ZXIsIGV4Y2hhbmdlcyBkZXJpdmVkIGZyb20gTGlxdWksIGNhbiByZXR1cm4gbm9uLWludGVnZXJzXG4gICAgICAgICAgICAgICAgLy9cbiAgICAgICAgICAgICAgICAvLyAgICAgSXQgY2FuIGJlIGEgbnVtZXJpYyBzdHJpbmdcbiAgICAgICAgICAgICAgICAvLyAgICAgeyBcInN1Y2Vzc3NcIjogXCIxXCIsIC4uLiB9XG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNlc3NzXCI6IFwiMFwiLCAuLi4gfSwgaHR0cENvZGUgPj0gMjAwIChjYW4gYmUgNDAzLCA1MDIsIGV0YylcbiAgICAgICAgICAgICAgICAvL1xuICAgICAgICAgICAgICAgIC8vICAgICBPciBqdXN0IGEgc3RyaW5nXG4gICAgICAgICAgICAgICAgLy8gICAgIHsgXCJzdWNjZXNzXCI6IFwidHJ1ZVwiLCAuLi4gfVxuICAgICAgICAgICAgICAgIC8vICAgICB7IFwic3VjY2Vzc1wi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IHN1Y2Nlc3MgPSB0cnVlO1xuICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICghc3VjY2Vzcykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBjb2RlID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2NvZGUnKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdlcnJvcicpO1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZXhjZXB0aW9ucyA9IHRoaXMuZXhjZXB0aW9ucztcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgaW4gZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IGV4Y2VwdGlvbnNbY29kZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAvLyBuZWVkIGEgc2Vjb25kIGVycm9yIG1hcCBmb3IgdGhlc2UgbWVzc2FnZXMsIGFwcGFyZW50bHkuLi5cbiAgICAgICAgICAgICAgICAgICAgLy8gaW4gZmFjdCwgd2UgY2FuIHVzZSB0aGUgc2FtZSAuZXhjZXB0aW9ucyB3aXRoIHN0cmluZy1rZXlzIHRvIHNhdmUgc29tZSBsb2MgaGVyZVxuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgYXBpIGtleScpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2ludmFsaWQgc2lnbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBBdXRoZW50aWNhdGlvbkVycm9yIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ2FwaSBrZXkgZG9udCBoYXZlIHRyYWRlIHBlcm1pc3Npb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAoZmVlZGJhY2spO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ2ludmFsaWQgcGFyYW1ldGVyJykgPj0gMCkgeyAvLyBlcnJvckNvZGUgMCwgcmV0dXJuZWQgb24gYnV5KHN5bWJvbCwgMCwgMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnaW52YWxpZCBvcmRlcicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlID09PSAnUmVxdWVzdHMgdG9vIG9mdGVuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uIChmZWVkYmFjayk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PT0gJ25vdCBhdmFpbGFibGUnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VOb3RBdmFpbGFibGUgKGZlZWRiYWNrKTtcbiAgICAgICAgICAgICAgICAgIC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OiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MDc2OC1mMjJmYzQyNC02MzhhLTExZTctODljOS02MDEwYTU0ZmY5YmUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cubGl2ZWNvaW4ubmV0L2FwaT9sYW5nPWVuJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYWxsL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9tYXhiaWRfbWluYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9yZXN0cmljdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RpY2tlcicsIC8vIG9taXQgcGFyYW1zIHRvIGdldCBhbGwgdGlja2VycyBhdCBvbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9jb2luSW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jbGllbnRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9jb21taXNzaW9uQ29tbW9uSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2dldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3Rvcnkvc2l6ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9oaXN0b3J5L3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eWxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9idXltYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NhbmNlbGxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9zZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcGl0YWxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NhcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L29rcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L291dC9wYXllZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BlcmZlY3Rtb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL21ha2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvdm91Y2hlci9yZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjE4IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NQQyc6ICdDYXByaWNvaW4nLFxuICAgICAgICAgICAgICAgICdDUkMnOiAnQ3J5Q2FzaCcsXG4gICAgICAgICAgICAgICAgJ09SRSc6ICdPcmVjdGljJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hCVCc6ICdCcmlja3RveCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4Y2VwdGlvbnMnOiB7XG4gICAgICAgICAgICAgICAgJzEnOiBFeGNoYW5nZUVycm9yLFxuICAgICAgICAgICAgICAgICcxMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEwMCc6IEV4Y2hhbmdlRXJyb3IsIC8vIGludmFsaWQgcGFyYW1ldGVyc1xuICAgICAgICAgICAgICAgICcxMDEnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDInOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICcxMDMnOiBJbnZhbGlkT3JkZXIsIC8vIGludmFsaWQgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAnMTA0JzogSW52YWxpZE9yZGVyLCAvLyBpbnZhbGlkIGFtb3VudFxuICAgICAgICAgICAgICAgICcxMDUnOiBJbnZhbGlkT3JkZXIsIC8vIHVuYWJsZSB0byBibG9jayBmdW5kc1xuICAgICAgICAgICAgICAgICcxMSc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzEyJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMic6IEF1dGhlbnRpY2F0aW9uRXJyb3IsIC8vIFwiVXNlciBub3QgZm91bmRcIlxuICAgICAgICAgICAgICAgICcyMCc6IEF1dGhlbnRpY2F0aW9uRXJyb3IsXG4gICAgICAgICAgICAgICAgJzMwJzogQXV0aGVudGljYXRpb25FcnJvcixcbiAgICAgICAgICAgICAgICAnMzEnOiBOb3RTdXBwb3J0ZWQsXG4gICAgICAgICAgICAgICAgJzMyJzogRXhjaGFuZ2VFcnJvcixcbiAgICAgICAgICAgICAgICAnNDI5JzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgJzUwMyc6IEV4Y2hhbmdlTm90QXZhaWxhYmxlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcm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ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChjb2luUmVzdHJpY3Rpb25zKSB7XG4gICAgICAgICAgICAgICAgcHJlY2lzaW9uWydwcmljZSddID0gdGhpcy5zYWZlSW50ZWdlciAoY29pblJlc3RyaWN0aW9ucywgJ3ByaWNlU2NhbGUnLCA1KTtcbiAgICAgICAgICAgICAgICBsaW1pdHNbJ2Ftb3VudCddWydtaW4nXSA9IHRoaXMuc2FmZUZsb2F0IChjb2luUmVzdHJpY3Rpb25zLCAnbWluTGltaXRRdWFudGl0eScsIGxpbWl0c1snYW1vdW50J11bJ21pbiddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxpbWl0c1sncHJpY2UnXSA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5mb0NvaW5JbmZvIChwYXJhbXMpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IHJlc3BvbnNlWydpbmZvJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY3lbJ3N5bWJvbCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ3dhbGxldFN0YXR1cyddID09PSAnbm9ybWFsJyk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd3aXRoZHJhd0ZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluT3JkZXJBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbldpdGhkcmF3QW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnbWluRGVwb3NpdEFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHQgPSB0aGlzLmFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQpO1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFwcGVuZEZpYXRDdXJyZW5jaWVzIChyZXN1bHQgPSBbXSkge1xuICAgICAgICBsZXQgcHJlY2lzaW9uID0gODtcbiAgICAgICAgbGV0IGRlZmF1bHRzID0ge1xuICAgICAgICAgICAgJ2luZm8nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdkZXBvc2l0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHsgJ21pbic6IHVuZGVmaW5lZCwgJ21heCc6IHVuZGVmaW5lZCB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkLCAnbWF4JzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBbXG4gICAgICAgICAgICB7ICdpZCc6ICdVU0QnLCAnY29kZSc6ICdVU0QnLCAnbmFtZSc6ICdVUyBEb2xsYXInIH0sXG4gICAgICAgICAgICB7ICdpZCc6ICdFVVInLCAnY29kZSc6ICdFVVInLCAnbmFtZSc6ICdFdXJvJyB9LFxuICAgICAgICAgICAgLy8geyAnaWQnOiAnUlVSJywgJ2NvZGUnOiAnUlVCJywgJ25hbWUnOiAnUnVzc2lhbiBydWJsZScgfSxcbiAgICAgICAgXTtcbiAgICAgICAgY3VycmVuY2llcy5wdXNoICh7XG4gICAgICAgICAgICAnaWQnOiAnUlVSJyxcbiAgICAgICAgICAgICdjb2RlJzogdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKCdSVVInKSxcbiAgICAgICAgICAgICduYW1lJzogJ1J1c3NpYW4gcnVibGUnLFxuICAgICAgICB9KTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW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J3F1YW50aXR5JywgcmVtYWluaW5nKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnbGFzdFRyYWRlVGltZXN0YW1wJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzoge1xuICAgICAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBxdW90ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V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gICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRGVwb3NpdEFkZHJlc3MgKGN1cnJlbmN5LCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRQYXltZW50R2V0QWRkcmVzcyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgYWRkcmVzcyA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICd3YWxsZXQnKTtcbiAgICAgICAgbGV0IHRhZyA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKGFkZHJlc3MuaW5kZXhPZiAoJzonKSA+PSAwKSB7XG4gICAgICAgICAgICBsZXQgcGFydHMgPSBhZGRyZXNzLnNwbGl0ICgnOicpO1xuICAgICAgICAgICAgYWRkcmVzcyA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgdGFnID0gcGFydHNbMl07XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAndGFnJzogdGFnLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyBwYXRoO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJylcbiAgICAgICAgICAgICAgICBib2R5ID0gcXVlcnk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocXVlcnkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhMjU2Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAodHlwZW9mIGJvZHkgIT09ICdzdHJpbmcnKVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmIChjb2RlID49IDMwMCkge1xuICAgICAgICAgICAgICAgIGxldCBlcnJvckNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JDb2RlJyk7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yQ29kZSBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yQ29kZV07XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb25DbGFzcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgLy8gcmV0dXJucyBzdGF0dXMgY29kZSAyMDAgZXZlbiBpZiBzdWNjZXNzID09PSBmYWxzZVxuICAgICAgICAgICAgbGV0IHN1Y2Nlc3MgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdzdWNjZXNzJywgdHJ1ZSk7XG4gICAgICAgICAgICBpZiAoIXN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICA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1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjYwNy04YzFhNjlkOC01ZWRlLTExZTctOTMwYy01NDBiNWViOWJlMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLm15Yml0eC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx1bm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHVuby5jb20vZW4vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vbnBtanMub3JnL3BhY2thZ2UvYml0eCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYmF1c21laWVyL25vZGUtYml0eCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3RvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0b3BvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvYXV0aDIvZ3JhbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCY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HRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2xpbWl0X3ZvbHVtZScpO1xuICAgICAgICBsZXQgcXVvdGVGZWUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWVfY291bnRlcicpO1xuICAgICAgICBsZXQgYmFzZUZlZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZV9iYXNlJyk7XG4gICAgICAgIGxldCBmZWUgPSB7ICdjdXJyZW5jeSc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBpZiAocXVvdGVGZWUpIHtcbiAgICAgICAgICAgIGZlZVsnc2lkZSddID0gJ3F1b3RlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gcXVvdGVGZWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmZWVbJ3NpZGUnXSA9ICdiYXNlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gYmFzZUZlZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2UpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd0aW1lc3RhbXAnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3RfdHJhZGUnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMu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VjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnaXNfYnV5J10pID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAg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bmRzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnbHlra2UnLFxuICAgICAgICAgICAgJ25hbWUnOiAnTHlra2UnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDSCcsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zNDQ4NzYyMC0zMTM5YTdiMC1lZmU2LTExZTctOTBmNS1lNTIwY2VmNzQ0NTEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vaGZ0LWFwaS5seWtrZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9iaWxlJzogJ2h0dHBzOi8vYXBpLmx5a2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9oZnQtc2VydmljZS1kZXYubHlra2V4Lm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5seWtrZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2hmdC1hcGkubHlra2UuY29tL3N3YWdnZXIvdWkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmx5a2tlLmNvbS9seWtrZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cubHlra2UuY29tL3RyYWRpbmctY29uZGl0aW9ucycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbW9iaWxlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FsbEFzc2V0UGFpclJhdGVzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRQYWlycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJc0FsaXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckJvb2tzL3tBc3NldFBhaXJJZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVycy9saW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL21hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJzL3tpZH0vQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wLCAvLyBhcyBvZiA3IEZlYiAyMDE4LCBzZWUgaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTg2M1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAsIC8vIGh0dHBzOi8vd3d3Lmx5a2tlLmNvbS9jcC93YWxsZXQtZmVlcy1hbmQtbGltaXRzXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0V2FsbGV0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gYmFsYW5jZVsnQmFsYW5jZSddO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBiYWxhbmNlWydSZXNlcnZlZCddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSB0b3RhbCAtIHVzZWQ7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnNJZENhbmNlbCAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBxdWVyeSA9IHtcbiAgICAgICAgICAgICdBc3NldFBhaXJJZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdPcmRlckFjdGlvbic6IHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSksXG4gICAgICAgICAgICAnVm9sdW1lJzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIHF1ZXJ5WydBc3NldCddID0gKHNpZGUgPT09ICdidXknKSA/IG1hcmtldFsnYmFzZSddIDogbWFya2V0WydxdW90ZSddO1xuICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgIHF1ZXJ5WydQcmljZSddID0gcHJpY2U7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdE9yZGVycycgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocXVlcnksIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEFzc2V0UGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnSWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydCYXNlQXNzZXRJZCddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydRdW90aW5nQXNzZXRJZCddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ05hbWUnXTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnQWNjdXJhY3knXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ0ludmVydGVkQWNjdXJhY3knXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ1Jlc3VsdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0JpZCddKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydSYXRlJ11bJ0FzayddKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLm1vYmlsZUdldEFsbEFzc2V0UGFpclJhdGVzTWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGlmIChzdGF0dXMgPT09ICdQZW5kaW5nJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09ICdJbk9yZGVyQm9vaycpIHtcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09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WxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIGxldCBjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ0lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyc0lkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ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bJ2FwaSddW2FwaV0gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbW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SxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MzcwNjAtZTdjNTg3MTQtNjBlYS0xMWU3LTkxOTItZjA1ZTg2YWRiODNmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnInLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvYXBpLWRvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5tZXJjYWRvYml0Y29pbi5jb20uYnIvdHJhZGUtYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vb3JkZXJib29rLycsIC8vIGxhc3Qgc2xhc2ggY3JpdGljYWxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RyYWRlcy97ZnJvbX0ve3RvfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L2RheS1zdW1tYXJ5L3t5ZWFyfS97bW9udGh9L3tkYXl9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3N5c3RlbV9tZXNzYWdlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9idXlfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlX3NlbGxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdCUkxCVEMnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJywgJ3N1ZmZpeCc6ICdCaXRjb2luJyB9LFxuICAgICAgICAgICAgICAgICdM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BsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0UGxhY2UnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKSArICdPcmRlcic7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICAgICAgJ2xpbWl0X3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzcG9uc2VfZGF0YSddWydvcmRlciddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAoIXN5bWJvbClcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIHJlcXVpcmVzIGEgc3ltYm9sIGFyZ3VtZW50Jyk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnb3JkZXJfaWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl90eXBlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ29yZGVyX3R5cGUnXSA9PT0gMSkgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IHN0YXR1cyA9IG9yZGVyWydzdGF0dXMnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCFtYXJrZXQpIHtcbiAgICAgICAgICAgIGlmICgnY29pbl9wYWlyJyBpbiBvcmRlcilcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ2NvaW5fcGFpciddIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjb2luX3BhaXInXV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY3JlYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWydjcmVhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICgndXBkYXRlZF90aW1lc3RhbXAnIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gcGFyc2VJbnQgKG9yZGVyWyd1cGRhdGVkX3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGxldCBmZWUgPSB7XG4gICAgICAgICAgICAnY29zdC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mljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICghc3ltYm9sKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgcmVxdWlyZXMgYSBzeW1ib2wgYXJndW1lbnQnKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW5fcGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IHBhcnNlSW50IChpZCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZVsncmVzcG9uc2VfZGF0YSddWydvcmRlciddKTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWR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gJ2RvYyc6ICdodHRwczovL21peGNvaW5zLmNvbS9oZWxwL2FwaS8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y191c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ21ha2VyJzogMC4wMDE1LCAndGFrZXInOiAwLjAwMjUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUSC9CVEMnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJz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5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5zYWZlRmxvYXQgKHRyYWRlLCAncHJpY2UnKSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnNhZm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0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWwgKHsgJ2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgIC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7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBuZWdvY2llY29pbnMgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ25lZ29jaWVjb2lucycsXG4gICAgICAgICAgICAnbmFtZSc6ICdOZWdvY2llQ29pbnMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdCUicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzM4MDA4NTcxLTI1YTYyNDZlLTMyNTgtMTFlOC05NjliLWFlYjY5MTA0OTI0NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9icm9rZXIubmVnb2NpZWNvaW5zLmNvbS5ici9hcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2Jyb2tlci5uZWdvY2llY29pbnMuY29tLmJyL3RyYWRlYXBpL3YxJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubmVnb2NpZWNvaW5zLmNvbS5icicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLXRyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5lZ29jaWVjb2lucy5jb20uYnIvZG9jdW1lbnRhY2FvLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5uZWdvY2llY29pbnMuY29tLmJyL2NvbWlzc29lcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne1BBUn0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tQQVJ9L3RyYWRlcy97dGltZXN0YW1wX2luaWNpYWx9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7UEFSfS90cmFkZXMve3RpbWVzdGFtcF9pbmljaWFsfS97dGltZXN0YW1wX2ZpbmFsfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXIve29yZGVySWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCMlgvQlJMJzogeyAnaWQnOiAnYjJ4YnJsJywgJ3N5bWJvbCc6ICdCMlgvQlJMJywgJ2Jhc2UnOiAnQjJYJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0JSTCc6IHsgJ2lkJzogJ2JjaGJybCcsICdzeW1ib2wnOiAnQkNIL0JSTCcsICdiYXNlJzogJ0JDSCcsICdxdW90ZSc6ICdCUkwnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9CUkwnOiB7ICdpZCc6ICdidGNicmwnLCAnc3ltYm9sJzogJ0JUQy9CUkwnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQlJMJyB9LFxuICAgICAgICAgICAgICAgICdCVEcvQlJMJzogeyAnaWQnOiAnYnRnYnJsJywgJ3N5bWJvbCc6ICdCVEcvQlJMJywgJ2Jhc2UnOiAnQlRHJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgICAgICAnREFTSC9CUkwnOiB7ICdpZCc6ICdkYXNoYnJsJywgJ3N5bWJvbCc6ICdEQVNIL0JSTCcsICdiYXNlJzogJ0RBU0gnLCAncXVvdGUnOiAnQlJMJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvQlJMJzogeyAnaWQnOiAnbHRjYnJsJywgJ3N5bWJvbCc6ICdMVEMvQlJMJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0JSTCcgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwMDksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0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lbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpZF07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWyd0b3RhbCddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghbWFya2V0KSB7XG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLnNhZmVWYWx1ZSAodGhpcy5tYXJrZXRzQnlJZCwgb3JkZXJbJ3BhaXInXSk7XG4gICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvcmRlclsnY3JlYXRlZCddKTtcbiAgICAgICAgbGV0IHByaWNlID0gdG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RpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ3F1b3RlJ10sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFVzZXJPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICd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G9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBsZXQgcXVlcnlTdHJpbmcgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKHF1ZXJ5U3RyaW5nLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnNlY29uZHMgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGNvbnRlbnQgPSAnJztcbiAgICAgICAgICAgIGlmIChxdWVyeVN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICAgICAgY29udGVudCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKGJvZHkpLCAnbWQ1JywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gJyc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdXJpID0gdGhpcy5lbmNvZGVVUklDb21wb25lbnQgKHVybCkudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IFsgdGhpcy5hcGlLZXksIG1ldGhvZCwgdXJpLCB0aW1lc3RhbXAsIG5vbmNlLCBjb250ZW50IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdzaGEyNTYnLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBzaWduYXR1cmUgPSB0aGlzLmJpbmFyeVRvU3RyaW5nIChzaWduYXR1cmUpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIHRoaXMuYXBpS2V5LCBzaWduYXR1cmUsIG5vbmNlLCB0aW1lc3RhbXAgXS5qb2luICgnOicpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6ICdhbXggJyArIGF1dGgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbjsgY2hhcnNldD1VVEYtOCc7XG4gICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1MZW5ndGgnXSA9IGJvZHkubGVuZ3RoO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChxdWVyeVN0cmluZy5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgcXVlcnlTdHJpbmc7XG4gICAgICAgICAgICAgICAgYm9keSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS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ICAgICAgJ2FwaSc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vbm92YWV4Y2hhbmdlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20vcmVtb3RlL2ZhcScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3tiYXNlY3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2luZm8ve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29yZGVyaGlzdG9yeS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYnV5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0vYm90aC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS97b3JkZXJ0eXBlfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2VzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZS97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2Fscy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG5ld2RlcG9zaXRhZGRyZXNzL3tjdXJyZW5jeX0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlvcGVub3JkZXJzX21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxvcmRlci97b3JkZXJpZH0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FsaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHN0YXR1cy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnbWFya2V0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldG5hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJ18nKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChtYXJrZXRbJ2Rpc2FibGVkJ10pXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVub3JkZXJzUGFpckJvdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0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3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGxvY2tib3ggPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfbG9ja2JveCddKTtcbiAgICAgICAgICAgIGxldCB0cmFkZXMgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdHJhZGVzJ10pO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiB0aGlzLnN1bSAobG9ja2JveCwgdHJhZGVzKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydhbW91bnRfdG90YWwnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG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keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKVxuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJztcbiAgICAgICAgdXJsICs9IHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh7ICdub25jZSc6IG5vbmNlIH0pO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHVybCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGV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XG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3Mgb2tjb2luY255IGV4dGVuZHMgb2tjb2ludXNkIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnb2tjb2luY255JyxcbiAgICAgICAgICAgICduYW1lJzogJ09LQ29pbiBDTlknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njc5Mi04YmU5MTU3YS01ZWU1LTExZTctOTI2Yy02ZDY5YjhkMzM3OGQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jbicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jbi9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5va2NvaW4uY24nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNuL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJ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PcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmdXR1cmVzJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcuZG8nLCAvLyBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlX3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2VzdGltYXRlZF9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2hvbGRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaW5kZXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3ByaWNlX2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd3NfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2JvcnJvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9iYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2Rldm9sdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9leHBsb3NpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mb180Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3VibWl0X290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VucmVwYXltZW50c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NzkxLTg5ZmZiNTAyLTVlZTUtMTFlNy04YTViLWM1OTUwYjY4YWM2NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5va2NvaW4uY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL29rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcxMDA5JzogT3JkZXJOb3RGb3VuZCwgLy8gZm9yIHNwb3QgbWFya2V0cywgY2FuY2VsbGluZyBjbG9zZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAnMTA1MSc6IE9yZGVyTm90Rm91bmQsIC8vIGZvciBzcG90IG1hcmtldHMsIGNhbmNlbGxpbmcgXCJqdXN0IGNsb3NlZFwiIG9yZGVyXG4gICAgICAgICAgICAgICAgJzEwMTknOiBPcmRlck5vdEZvdW5kLCAvLyBvcmRlciBjbG9zZWQ/XG4gICAgICAgICAgICAgICAgJzIwMDE1JzogT3JkZXJOb3RGb3VuZCwgLy8gZm9yIGZ1dHVyZSBtYXJ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GU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRzW2ldWydtYXhTaXplRGlnaXQnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRzW2ldWydtYXhQcmljZURpZ2l0J10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1pbkFtb3VudCA9IG1hcmtldHNbaV1bJ21pblRyYWRlU2l6ZSddO1xuICAgICAgICAgICAgbGV0IG1pblByaWNlID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0c1tpXVsnb25saW5lJ10gIT09IDApO1xuICAgICAgICAgICAgbGV0IGJhc2VOdW1lcmljSWQgPSBtYXJrZXRzW2ldWydiYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZU51bWVyaWNJZCA9IG1hcmtldHNbaV1bJ3F1b3RlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnYmFzZU51bWVyaWNJZCc6IGJhc2VOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlTnVtZXJpY0lkJzogcXVvdGVOdW1lcmljSWQsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXRzW2ldLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWluUHJpY2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBtaW5BbW91bnQgKiBtaW5QcmljZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgZnV0dXJlUXVvdGUgPSAobWFya2V0WydxdW90ZSddID09PSAnVVNEVCcpID8gJ1VTRCcgOiBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICBsZX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rZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlb2YgbGltaXQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgcmVxdWVzdFsnc2l6ZSddID0gbGltaXQ7XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ10gPSAndGhpc193ZWVrJzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgIH1cbiAgICAgICAgbWV0aG9kICs9ICdEZXB0aCc7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXRJZCA9IHRpY2tlclsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgaWYgKG1hcmtldElkIGluIHRoaXMubWFya2V0c19ieV9pZClcbiAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW21hcmtldElkXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW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ICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gdGhpcy5zYWZlRmxvYXQgKGJhbGFuY2VzWydmcmVlemVkJ10sIGlkLCAwLjApO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlLFxuICAgICAgICB9O1xuICAgICAgICBpZiAobWFya2V0WydmdXR1cmUnXSkge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdGdXR1cmUnO1xuICAgICAgICAgICAgb3JkZXIgPSB0aGlzLmV4dGVuZCAob3JkZXIsIHtcbiAgICAgICAgICAgICAgICAnY29udHJhY3RfdHlwZSc6ICd0aGlzX3dlZWsnLCAvLyBuZXh0X3dlZWssIHF1YXJ0ZXJcbiAgICAgICAgICAgICAgICAnbWF0Y2hfcHJpY2UnOiAwLCAvLyBtYXRjaCBiZXN0IGNvdW50ZXIgcGFydHkgcHJpY2U/IDAgb3IgMSwgaWdub3JlcyBwcmljZSBpZiAxXG4gICAgICAgICAgICAgICAgJ2xldmVyX3JhdGUnOiAxMCwgLy8gbGV2ZXJhZ2UgcmF0ZSB2YWx1ZTogMTAgb3IgMjAgKDEwIGJ5IGRlZmF1bHQpXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHR5cGUgPT09ICdsaW1pdCcpIHtcbiAgICAgICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSArPSAnX21hcmtldCc7XG4gICAgICAgICAgICAgICAgaWYgKHNpZGUgPT09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5zYWZlRmxvYXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcmRlclsncHJpY2UnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYXJrZXQgYnV5IG9yZGVycyByZXF1aXJlIGFuIGFkZGl0aW9uYWwgY29zdCBwYXJhbWV0ZXIsIGNvc3QgPSBwcmljZSAqIGFtb3VudCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyYW1zID0gdGhpcy5vbWl0IChwYXJhbXMsICdjb3N0Jyk7XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGUnO1xuICAgICAgICBsZXQg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R1cm4gJ2Nsb3NlZCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICBpZiAoc3RhdHVzID09PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclNpZGUgKHNpZGUpIHtcbiAgICAgICAgaWYgKHNpZGUgPT09IDEpXG4gICAgICAgICAgICByZXR1cm4gJ2J1eSc7IC8vIG9wZW4gbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gMilcbiAgICAgICAgICAgIHJldHVybiAnc2VsbCc7IC8vIG9wZW4gc2hvcnQgcG9zaXRpb25cbiAgICAgICAgaWYgKHNpZGUgPT09IDMpXG4gICAgICAgICAgICByZXR1cm4gJ3NlbGwnOyAvLyBsaXF1aWRhdGUgbG9uZyBwb3NpdGlvblxuICAgICAgICBpZiAoc2lkZSA9PT0gNClcbiAgICAgICAgICAgIHJldHVybiAnYnV5JzsgLy8gbGlxdWlkYXRlIHNob3J0IHBvc2l0aW9uXG4gICAgICAgIHJldHVybiBzaWRlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCB0eXBlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3R5cGUnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICBpZiAoKG9yZGVyWyd0eXBlJ10gPT09ICdidXknKSB8fCAob3JkZXJbJ3R5cGUnXSA9PT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnYnV5X21hcmtldCcpIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdtYXJrZXQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsndHlwZSddID09PSAnc2VsbF9tYXJrZXQnKSB7XG4gICAgICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgICAgICAgICB0eXBlID0gJ21hcmtldCc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHNpZGUgPSB0aGlzLnBhcnNlT3JkZXJTaWRlIChvcmRlclsndHlwZSddKTtcbiAgICAgICAgICAgICAgICBpZiAoKCdjb250cmFjdF9uYW1lJyBpbiBvcmRlcikgfHwgKCdsZXZlcl9yYXRlJyBpbiBvcmRlcikpXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSAnbWFyZ2luJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKVxuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3N5bWJvbCddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNyZWF0ZURhdGVGaWVs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LmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2lkJzogcGFyYW1zWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVySGlzdG9yeSc7XG4gICAgICAgICAgICAgICAgcmVxdWVzdCA9IHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCB7XG4gICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW50X3BhZ2UnOiAxLCAvLyBjdXJyZW50IHBhZ2UgbnVtYmVyXG4gICAgICAgICAgICAgICAgICAgICdwYWdlX2xlbmd0aCc6IDIwMCwgLy8gbnVtYmVyIG9mIG9yZGVycyByZXR1cm5lZCBwZXIgcGFnZSwgbWF4aW11bSAyMDBcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHBhcmFtcyA9IHRoaXMub21pdCAocGFyYW1zLCBbICd0eXBlJywgJ3N0YXR1cycgXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcnNGaWVsZCA9IHRoaXMuZ2V0T3JkZXJzRmllbGQgKCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJzIChyZXNwb25zZVtvcmRlcnNGaWVsZF0sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9wZW5PcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5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gICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5Lmxlbmd0aCA8IDIpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keVswXSA9PT0gJ3snKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnZXJyb3JfY29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnZXJyb3JfY29kZScpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiB0aGlzLmV4Y2VwdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IEV4Y2VwdGlvbkNsYXNzID0gdGhpcy5leGNlcHRpb25zW2Vycm9yXTtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbkNsYXNzIChtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgIC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uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzI1NTI3NjgtMGQ2ZGQzYzYtYzRhNi0xMWU3LTkwZjgtYzA0M2I2NDc1NmE3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5va2V4LmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93d3cub2tleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cub2tleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL29rY29pbi1va2V4L0FQSS1kb2NzLU9LRXguY29tJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3d3dy5va2V4LmNvbS9mZWVzLmh0bWwnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdjb21tb25DdXJyZW5jaWVzJzoge1xuICAgICAgICAgICAgICAgICdGQUlSJzogJ0ZhaXJHYW1lJyxcbiAgICAgICAgICAgICAgICAnSE1DJzogJ0hpIE11dHVhbCBTb2NpZXR5JyxcbiAgICAgICAgICAgICAgICAnTUFHJzogJ01hZ2dpZScsXG4gICAgICAgICAgICAgICAgJ05BTk8nOiAnWFJCJyxcbiAgICAgICAgICAgICAgICAnWU9ZTyc6ICdZT1lPVycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV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gICAgICAnbmFtZSc6ICdQYXltaXVtJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdGUicsICdFVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc5MDU2NC1hOTQ1YTlkNC01ZmY5LTExZTctOWQyZC1iNjM1NzYzZjJmMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vcGF5bWl1bS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnBheW1pdW0uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL1BheW1pdW0vYXBpLWRvY3VtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cucGF5bWl1bS5jb20vcGFnZS9kZXZlbG9wZXJzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb3VudHJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RhdGEve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fY2hhcnRzL3tpZH0vZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvZ2V0X3BheW1lbnQve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMve2J0Y19hZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcGF5bWVudF9yZXF1ZXN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcmljZV9hbGVydHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lcmNoYW50L2NyZWF0ZV9wYXltZW50JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycy97VVVJRH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnZXVyJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDU5LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0VXNlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudC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luZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVt2b2x1bWVdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERhdGFJZFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5jYXBpdGFsaXplICh0eXBlKSArICdPcmRlcicsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2RpcmVjdGlvbic6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB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AgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB1cmw7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQXBpLUtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdBcGktU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpLFxuICAgICAgICAgICAgICAgICdBcGktTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAg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llcyc6ICdVUycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCwgLy8gdXAgdG8gNiBjYWxscyBwZXIgc2Vjb25kXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2VkaXRPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2NyZWF0ZU1hcmtldE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODE3LWU5NDU2MzEyLTVlZTYtMTFlNy05YjNjLWI2MjhjYTU2MjZhNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vdHJhZGluZ0FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcG9sb25pZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9wb2xvbmlleC5jb20vc3VwcG9ydC9hcGkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9wYXN0ZWJpbi5jb20vZE1YN21aRTAnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybjI0aFZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ2hhcnREYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Mb2FuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbExvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlTWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUxvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVOZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5TZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3ZlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkFjdGl2ZUxvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BdmFpbGFibGVBY2NvdW50QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Db21wbGV0ZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5GZWVJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5MZW5kaW5nSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTWFyZ2luQWNjb3VudFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5Mb2FuT2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlclRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGFibGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b2dnbGVBdXRvUmVuZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAuMDAwMDAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQlRNJzogJ0JpdG1hcmsnLFxuICAgICAgICAgICAgICAgICdTVFInOiAnWExNJyxcbiAgICAgICAgICAgICAgICAnQkNDJzogJ0JUQ3RhbGtjb2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNhbGN1bGF0ZUZlZSAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlLCB0YWtlck9yTWFrZXIgPSAndGFrZXInLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgIGxldCBrZXkgPSAncXVvdGUnO1xuICAgICAgICBsZXQgcmF0ZSA9IG1hcmtldFt0YWtlck9yTWFrZXJdO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKHRoaXMuY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCAqIHJhdGUpKTtcbiAgICAgICAgaWYgKHNpZGUgPT09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPSExDViAob2hsY3YsIG1hcmtldCA9IHVuZGVmaW5lZCwgdGltZWZyYW1lID0gJzVtJywgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICBvaGxjdlsnZGF0ZSddICogMTAwMCxcbiAgICAgICAgICAgIG9obGN2WydvcGVuJ10sXG4gICAgICAgICAgICBvaGxjdlsnaGlnaCddLFxuICAgICAgICAgICAgb2hsY3ZbJ2xvdyddLFxuICAgICAgICAgICAgb2hsY3ZbJ2Nsb3NlJ10sXG4gICAgICAgICAgICBvaGxjdlsncXVvdGVWb2x1bWUnXSxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICc1bScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID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biAgICAgICAgICAgIGxldCBpZCA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpZF07XG4gICAgICAgICAgICBsZXQgWyBxdW90ZSwgYmFzZSBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiAxMDAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVybkNvbXBsZXRlQmFsYW5jZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnYWNjb3VudCc6ICdhbGwnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaWRdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hd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c6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WyduYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB0aGlzLnNhZmVGbG9hdCAoY3VycmVuY3ksICd0eEZlZScpLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ3R4RmVlJ10sXG4gICAgICAgICAg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Lm1hcmtldHNfYnlfaWRbY3VycmVuY3lQYWlyXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gY3VycmVuY3lQYWlyLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3RvdGFsJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdhbW91bnQnKTtcbiAgICAgICAgaWYgKCdmZWUnIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBsZXQgcmF0ZSA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ2ZlZScpO1xuICAgICAgICAgICAgbGV0IGZlZUNvc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGJhc2U7XG4gICAgICAgICAgICAgICAgZmVlQ29zdCA9IGFtb3VudCAqIHJhdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gcXVvdGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgZmVlQ29zdCA9IGNvc3QgKiByYXRlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGZlZUNvc3QsXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAndHJhZGVJRCcpLFxuICAgICAgICAgICAgJ29yZGVyJzogdGhpcy5zYWZlU3RyaW5nICh0cmFkZSwgJ29yZGVyTnVtYmVyJyksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAodHJhZGUsICdyYXRlJyksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYW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GxldCBwYWlyID0gbWFya2V0ID8gbWFya2V0WydpZCddIDogJ2FsbCc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0geyAnY3VycmVuY3lQYWlyJzogcGFpciB9O1xuICAgICAgICBpZiAodHlwZW9mIHNpbmNlICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgcmVxdWVzdFsnc3RhcnQnXSA9IHBhcnNlSW50IChzaW5jZSAvIDEwMDApO1xuICAgICAgICAgICAgcmVxdWVzdFsnZW5kJ10gPSB0aGlzLnNlY29uZHMgKCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gbGltaXQgaXMgZGlzYWJsZWQgKGRvZXMgbm90IHJlYWxseSB3b3JrIGFzIGV4cGVjdGVkKVxuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gcGFyc2VJbnQgKGxpbWl0KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVyblRyYWRlSGlzdG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAndGltZXN0YW1wJyk7XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydkYXRlJ10pO1xuICAgICAgICBsZXQgdHJhZGVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3Jlc3VsdGluZ1RyYWRlcycgaW4gb3JkZXIpXG4gICAgICAgICAgICB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsncmVzdWx0aW5nVHJhZGVzJ10sIG1hcmtldCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdzdGFydGluZ0Ftb3VudCcsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gMDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlbWFpbmluZyAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIGNvc3QgPSBmaWxsZWQgKiBwcmljZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIGZpbGxlZCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgdHJhZGVzICE9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgIGZpbGxlZCA9IDA7XG4gICAgICAgICAgICAgICAgY29zdCA9IDA7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0cmFkZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlID0gdHJhZGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHJhZGVBbW91bnQgPSB0cmFkZVsnYW1vdW50J107XG4gICAgICAgICAgICAgICAgICAgIGxldCB0cmFkZVByaWNlID0gdHJhZGVbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHRoaXMuc3VtIChmaWxsZWQsIHRyYWRlQW1vdW50KTtcbiAgICAgICAgICAgICAgICAgICAgY29zdCArPSB0cmFkZVByaWNlICogdHJhZGVBbW91bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBvcmRlclsnc3RhdHVzJ10sXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAndHJhZGVzJzogdHJhZGVzLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9wZW5PcmRlcnMgKG9yZGVycywgbWFya2V0LCByZXN1bHQgPSBbXSkge1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGV4dGVuZGVkID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG9yZGVyWydyYXRlJ10sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLnBhcnNlT3JkZXIgKGV4dGVuZGVkLCBtYXJrZXQpKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHN5bWJvbClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcGFpciA9IG1hcmtldCA/IG1hcmtldFsnaWQnXSA6ICdhbGwnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0UmV0dXJuT3Blbk9yZGVycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiBwYWlyLFxuICAgICAgICB9KSk7XG4gICAgICAgIGxldCBvcGVuT3JkZXJzID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgIC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gICAgIGlmIChpZCBpbiBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT09ICdvcGVuJykge1xuICAgICAgICAgICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlsbGVkJzogb3JkZXJbJ2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbWFpbmluZyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2Nvc3QnXSA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3JkZXJbJ2ZpbGxlZCddICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcmRlclsnY29zdCddID0gb3JkZXJbJ2ZpbGxlZCddICogb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRl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AgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKSB7XG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF1bJ3N0YXR1cyddID0gJ2NhbmNlbGVkJztcbiAgICAgICAgICAgIGxldCBuZXdpZCA9IHJlc3BvbnNlWydvcmRlck51bWJlciddO1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbbmV3aWRdID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW2lkXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IG5ld2lkLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgYW1vdW50ICE9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tuZXdpZF1bJ2Ftb3VudCddID0gYW1vdW50O1xuICAgICAgICAgICAgcmVzdWx0ID0gdGhpcy5leHRlbmQgKHRoaXMub3JkZXJzW25ld2lkXSwgeyAnaW5mbyc6IHJlc3BvbnNlIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChzeW1ib2wpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgICAgICByZXN1bHQgPSB0aGlzLnBhcnNlT3JkZXIgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbcmVzdWx0WydpZCddXSA9IHJlc3VsdDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdC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CddID0gdGFnO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3VsdCxcbiAgICAgICAgICAgICdpZCc6IHJlc3VsdFsncmVzcG9uc2UnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7ICdjb21tYW5kJzogcGF0aCB9LCBwYXJhbXMpO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHF1ZXJ5Wydub25jZSddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICA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tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHFyeXB0b3MgZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3FyeXB0b3MnLFxuICAgICAgICAgICAgJ25hbWUnOiAnUVJZUFRPUycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnQ04nLCAnVFcnIF0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA5NTM5MTUtYjE2MTFkYzAtYTQzNi0xMWU3LTg5NDctYzk1YmQ1YTQyMDg2LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xcnlwdG9zLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZGV2ZWxvcGVycy5xdW9pbmUuY29tL3YyJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogJ2h0dHBzOi8vcXJ5cHRvcy56ZW5kZXNrLmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDc4NTgxNjctRmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L3ByaWNlX2xldmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaXJfbGFkZGVycy97Y3VycmVuY3l9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL21haW5fYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9ucy9tZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9leGVjdXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9L2xvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nX2FjY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWF0X2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2FuX2JpZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5zL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL2Nsb3NlX2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdza2lwSnNvbk9uU3RhdHVzQ29kZXMnOiBbNDAxXSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ0FQSSBBdXRoZW50aWNhdGlvbiBmYWlsZWQnOiBBdXRoZW50aWNhdGlvbkVycm9yLFxuICAgICAgICAgICAgICAgICAgICAnTm9uY2UgaXMgdG9vIHNtYWxsJzogSW52YWxpZE5vbmNlLFxuICAgICAgICAgICAgICAgICAgICAnT3JkZXIgbm90IGZvdW5kJzogT3JkZXJOb3RGb3VuZCxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZXInOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90X2Vub3VnaF9mcmVlX2JhbGFuY2UnOiBJbnN1ZmZpY2llbnRGdW5kcyxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ211c3RfYmVfcG9zaXRpdmUnOiBJbnZhbGlkT3JkZXIsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdxdWFudGl0eSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXNzX3RoYW5fb3JkZXJfc2l6ZSc6IEludmFsaWRPcmRlcixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydxdW90ZWRfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbWFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgdGFrZXIgPSB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAndGFrZXJfZmVlJyk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gIW1hcmtldFsnZGlzYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBtaW5BbW91bnQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgbWluUHJpY2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoYmFzZSA9PT0gJ0JUQycpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoYmFzZSA9PT0gJ0VUSCcpIHtcbiAgICAgICAgICAgICAgICBtaW5BbW91bnQgPSAwLjAxO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHF1b3RlID09PSAnQlRDJykge1xuICAgICAgICAgICAgICAgIG1pblByaWNlID0gMC4wMDAwMDAwMTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGUgPT09ICdFVEgnIHx8IHF1b3RlID09PSAnVVNEJyB8fCBxdW90ZSA9PT0gJ0pQWScpIHtcbiAgICAgICAgICAgICAgICBtaW5QcmljZSA9IDAuMDAwMDE7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiB7ICdtaW4nOiBtaW5BbW91bnQgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7ICdtaW4nOiBtaW5QcmljZSB9LFxuICAgICAgICAgICAgICAgICdjb3N0JzogeyAnbWluJzogdW5kZWZpbmVkIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5QcmljZSAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBsaW1pdHNbJ2Nvc3QnXVsnbWluJ10gPSBtaW5QcmljZSAqIG1pbkFtb3VudDtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBtaW5BbW91bnQgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsnYW1vdW50J10gPSAtTWF0aC5sb2cxMCAobWluQW1vdW50KTtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgbWluUHJpY2UgIT09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgIHByZWNpc2lvblsncHJpY2UnXSA9IC1NYXRoLmxvZzEwIChtaW5QcmljZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRzQmFsYW5jZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHRvdGFsLFxu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AgICAgICAgICAgaWYgKGxlbmd0aCA+IDApXG4gICAgICAgICAgICAgICAgICAgIGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdF90cmFkZWRfcHJpY2UnKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaF9tYXJrZXRfYXNrJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd19tYXJrZXRfYmlkJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9iaWQnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9hc2snKSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc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Rlclsnc3RhdHVzJ10gPT09ICdjYW5jZWxsZWQnKSB7IC8vICdsbCcgaW50ZW5kZWRcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmlsbGVkX3F1YW50aXR5Jyk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWydvcmRlcl90eXBlJ10sXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogY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ZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAncGF0aCc6IHVybCxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAndG9rZW5faWQnOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnaWF0JzogTWF0aC5mbG9vciAobm9uY2UgLyAxMDAwKSwgLy8gaXNzdWVkIGF0XG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaGVhZGVyc1snWC1RdW9pbmUtQXV0aCddID0gdGhpcy5qd3QgKHJlcXVlc3QsIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSwgcmVzcG9uc2UgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKGNvZGUgPj0gMjAwICYmIGNvZGUgPD0gMjk5KVxuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICBjb25zdCBtZXNzYWdlcyA9IHRoaXMuZXhjZXB0aW9uc1snbWVzc2FnZXMnXTtcbiAgICAgICAgaWYgKGNvZGUgPT09IDQwMSkge1xuICAgICAgICAgICAgLy8gZXhwZWN0ZWQgbm9uLWpzb24gcmVzcG9uc2VcbiAgICAgICAgICAgIGlmIChib2R5IGluIG1lc3NhZ2VzKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBtZXNzYWdlc1tib2R5XSAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAodHlwZW9mIHJlc3BvbnNlID09PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSlcbiAgICAgICAgICAgICAgICByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgY29uc3QgZmVlZGJhY2sgPSB0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSk7XG4gICAgICAgIGlmIChjb2RlID09PSA0MDQpIHtcbiAgICAgICAgICAgIC8vIHsgXCJtZXNzYWdlXCI6IFwiT3JkZXIgbm90IGZvdW5kXCIgfVxuICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICBpZiAobWVzc2FnZSBpbiBtZXNzYWdlcylcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgbWVzc2FnZXNbbWVzc2FnZV0gKGZlZWRiYWNrKTtcbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09PSA0MjIpIHtcbiAgICAgICAgICAgIC8vIGFycmF5IG9mIGVycm9yIG1lc3NhZ2VzIGlzIHJldHVybmVkIGluICd1c2VyJyBvciAncXVhbnRpdHknIHByb3BlcnR5IG9mICdlcnJvcnMnIG9iamVjdCwgZS5nLjpcbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInVzZXJcIjogW1wibm90X2Vub3VnaF9mcmVlX2JhbGFuY2VcIl0gfX1cbiAgICAgICAgICAgIC8vIHsgXCJlcnJvcnNcIjogeyBcInF1YW50aXR5XCI6IFtcImxlc3NfdGhhbl9vcmRlcl9zaXplXCJdIH19XG4gICAgICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnJvcnMgPSByZXNwb25zZVsnZXJyb3JzJ107XG4gICAgICAgICAgICAgICAgY29uc3QgZXJyb3JUeXBlcyA9IFsndXNlcicsICdxdWFudGl0eScsICdwcmljZSddO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZXJyb3JUeXBlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCBlcnJvclR5cGUgPSBlcnJvclR5cGVzW2ldO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3JUeXBlIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXJyb3JNZXNzYWdlcyA9IGVycm9yc1tlcnJvclR5cGVdO1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCBlcnJvck1lc3NhZ2VzLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZSA9IGVycm9yTWVzc2FnZXNbal07XG4gICAgICAgICAgICAgICAgICAgICAgICAgICA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zogJ3YyJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4MjUtOThhNmQwZGUtNWVlNy0xMWU3LTlmYTQtMzhlMTFhMmM2ZjUyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xdWFkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5xdWFkcmlnYWN4LmNvbS9hcGlfaW5mbycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luY2FzaF9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5jYXNoX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5nb2xkX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbmdvbGRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGl0ZWNvaW5fZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXRlY29pbl93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb29rdXBfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAg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AgICAgICAgICAgJ2Fza1ZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogbGFzdCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsnZGF0ZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICA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uZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSBbIG5vbmNlLnRvU3RyaW5nICgpLCB0aGlzLnVpZCwgdGhpcy5hcGlLZXkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ3NpZ25hdHVyZSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgICAgICBib2R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VzJzogWyAnSlAnLCAnU0cnLCAnVk4nIF0sXG4gICAgICAgICAgICAndmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzUwNDcxMTQtMGUyNGFkNGEtZmJhYS0xMWU3LTk2YTktNjljMWE3NTYwODNiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5xdW9pbmUuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcXVvaW5leC5jb20vJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kZXZlbG9wZXJzLnF1b2luZS5jb20nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kZXZlbG9wZXJzLnF1b2luZS5jb20vdjInLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9uZXdzLnF1b2luZXguY29tL2ZlZXMvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cbn07XG4iLCIndXNlIHN0cmljdCc7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2UgPSByZXF1aXJlICgnLi9iYXNlL0V4Y2hhbmd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c6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnNvdXRoeGNoYW5nZS5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE1hcmtldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlbmV3YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ1NNVCc6ICdTbWFydE5vZGUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbMF07XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsxXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gc3ltYm9sO1xuICAgICAgICAgICAgcmVzdWx0LnB1c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5X2lkW3VwcGVyY2FzZV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IGN1cnJlbmN5Wydjb2RlJ107XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0F2YWlsYWJsZSddKTtcbiAgICAgICAgICAgIGxldCBkZXBvc2l0ZWQgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydEZXBvc2l0ZWQnXSk7XG4gICAgICAgICAgICBsZXQgdW5jb25maXJtZWQgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydVbmNvbmZpcm1lZCddKTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHRoaXMuc3VtIChkZXBvc2l0ZWQsIHVuY29uZmlybWVkKTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dX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0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJpY2VTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnQXQnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGV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mF3ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdIYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiA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ICAgICAgICdpZCc6ICd0aGVyb2NrJyxcbiAgICAgICAgICAgICduYW1lJzogJ1RoZVJvY2tUcmFkaW5nJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnTVQnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg2OS03NTA1N2ZhMi01ZWU5LTExZTctOWE2Zi0xM2U2NDFmYTQ3MDcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYXBpLnRoZXJvY2t0cmFkaW5nLmNvbS9kb2MvdjEvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20vZG9jLycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMvdGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkaXNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbl9iYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L3Bvc2l0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19saW1pdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXRtcy93aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vb3JkZXJzL3JlbW92ZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAyLjUsICAvLyB3b3JzdC1jYXNlIHNjZW5hcmlvOiBodHRwczovL3RoZXJvY2t0cmFkaW5nLmNvbS9lbi9wYWdlcy9mZWVzXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc1RpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Z1bmRfaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBiYWxhbmNlWyd0cmFkaW5nX2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmc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BhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlRGVsZXRlRnVuZHNGdW5kSWRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHVybDtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtVFJULUtF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gICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMTIwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMTJoJzogJzcyMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzE0NDAnLFxuICAgICAgICAgICAgICAgICczZCc6ICc0MzIwJyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMTAwODAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzkwMzQ5MjEtZTNhY2YwMTYtNDQ4MC0xMWU4LTk5NDUtYTYwODZhMTA4MmZlLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy50aWRlYml0LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cudGlkZWJpdC5jb20vZG9jdW1lbnRzL2FwaV92MicsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21hcmtldHMnLCAvLyBWMk1hcmtldHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvdGlja2VycycsIC8vIFYyVGlja2Vyc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi90aWNrZXJzL3ttYXJrZXR9JywgLy8gVjJUaWNrZXJzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcycsIC8vIFYyVHJhZGVzSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL3RyYWRlcy97bWFya2V0fScsIC8vIFYyVHJhZGVzTWFya2V0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyX2Jvb2snLCAvLyBWMk9yZGVyQm9va0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlcicsIC8vIFYyT3JkZXJKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIva193aXRoX3BlbmRpbmdfdHJhZGVzJywgLy8gVjJLV2l0aFBlbmRpbmdUcmFkZXNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvaycsIC8vIFYyS0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXB0aCcsIC8vIFYyRGVwdGhKc29uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW10sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0cycsIC8vIFYyRGVwb3NpdHNKc29uXG4gICAgICAgICAgICAgICAgICAgICAgICAndjIvZGVwb3NpdF9hZGRyZXNzJywgLy8gVjJEZXBvc2l0QWRkcmVzc0pzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9kZXBvc2l0JywgLy8gVjJEZXBvc2l0SnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL21lbWJlcnMvbWUnLCAvLyBWMk1lbWJlcnNNZUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9hZGRyZXNzZXMve2FkZHJlc3N9JywgLy8gVjJBZGRyZXNzZXNBZGRyZXNzSnNvblxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9kZWxldGUnLCAvLyBWMk9yZGVyRGVsZXRlSnNvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ3YyL29yZGVyJywgLy8gVjJPcmRlckpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9tdWx0aScsIC8vIFYyT3JkZXJNdWx0aUpzb25cbiAgICAgICAgICAgICAgICAgICAgICAgICd2Mi9vcmRlci9jbGVhcicsIC8vIFYyT3JkZXJDbGVhckpzb25cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHt9LCAvLyBUaGVyZSBpcyBvbmx5IDElIGZlZSBvbiB3aXRoZHJhd2FscyB0byB5b3VyIGJhbmsgYWNjb3VudC5cbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICcyMDAyJzogSW5zdWZmaWNpZW50RnVuZHMsXG4gICAgICAgICAgICAgICAgJzIwMDMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY29kZSwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFYyRGVwb3NpdEFkZHJlc3MgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzcycpO1xuICAgICAgICAgICAgICAgIGxldCB0YWcgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzc1RhZycpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgICAgICdhZGRyZXNzJzogdGhpcy5jaGVja0FkZHJlc3MgKGFkZHJlc3MpLFxuICAgICAgICAgICAgICAgICAgICAndGFnJzogdGFnLFxuICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFYyTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZUlkLCBxdW90ZUlkIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgICAgICdxdW90ZUlkJzogcXVvdGVJZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRWMkRlcG9zaXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5SWQgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBjdXJyZW5jeUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5SWQgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKVxuICAgICAgICAgICAgICAgIGNvZGUgPSB0aGlzLmN1cnJlbmNpZXNfYnlfaWRbY3VycmVuY3lJZF1bJ2NvZGUnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2xvY2tlZCddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcn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mtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRWMlRpY2tlcnMgKHBhcmFtcyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKSB7XG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICA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1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZF90eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2V4ZWN1dGVkX3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JlbWFpbmluZ192b2x1bWUnKSxcbiAgICAgICAgICAgICd0cmFkZXMnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICd2b2x1bWUnOiBhbW91bnQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkX3R5cGUnOiB0eXBlLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9P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gaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChwYXlsb2FkKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgc3VmZml4O1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBib2R5ID0gc3VmZml4O1xuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cm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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyB0aWRleCBleHRlbmRzIGxpcXVpIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAndGlkZXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVGlkZXgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVSycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzMnLFxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAvLyAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgIC8vICdmZXRjaFRpY2tlcnMnOiB0cnVlXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDc4MTc4MC0wMzE0OWRjNC1hMTJlLTExZTctODJiYi0zMTNiMjY5ZDI0ZDQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd2ViLnRpZGV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS9hcGkvMycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLnRpZGV4LmNvbS90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90aWRleC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly90aWRleC5jb20vZXhjaGFuZ2UvcHVibGljLWFwaScsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9hc3NldHMtc3BlYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3RpZGV4LmNvbS9leGNoYW5nZS9wYWlycy1zcGVjJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUtZGF0YS97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnTUdPJzogJ1dNR08nLFxuICAgICAgICAgICAgICAgICdFTUdPJzogJ01HTycsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gYXdhaXQgdGhpcy53ZWJHZXRDdXJyZW5jeSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gY3VycmVuY3lbJ2Ftb3VudFBvaW50J107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBjdXJyZW5jeVsndmlzaWJsZSddID09PSB0cnVlO1xuICAgICAgICAgICAgbGV0IHN0YXR1cyA9ICdvayc7XG4gICAgICAgICAgICBpZiAoIWFjdGl2ZSkge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdkaXNhYmxlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgY2FuV2l0aGRyYXcgPSBjdXJyZW5jeVsnd2l0aGRyYXdFbmFibGUnXSA9PT0gdHJ1ZTtcbiAgICAgICAgICAgIGxldCBjYW5EZXBvc2l0ID0gY3VycmVuY3lbJ2RlcG9zaXRFbmFibGUnXSA9PT0gdHJ1ZTtcbiAgICAgICAgICAgIGlmICghY2FuV2l0aGRyYXcgfHwgIWNhbkRlcG9zaXQpIHtcbiAgICAgICAgICAgICAgICBhY3RpdmUgPSBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlJzogY2FuV2l0aGRyYXcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ3dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGNhbkRlcG9zaXQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91dCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ2RlcG9zaXRNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGdldFZlcnNpb25TdHJpbmcgKCkge1xuICAgICAgICByZXR1cm4gJyc7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLnNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmdldFZlcnNpb25TdHJpbmcgKCkgKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59O1xuIiwiJ3VzZSBzdHJpY3QnO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgZm94Yml0ID0gcmVxdWlyZSAoJy4vZm94Yml0LmpzJyk7XG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHVyZHViaXQgZXh0ZW5kcyBmb3hiaXQge1xuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd1cmR1Yml0JyxcbiAgICAgICAgICAgICduYW1lJzogJ1VyZHVCaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdQSycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk5MTQ1My0xNTZiZjNhZS02NDgwLTExZTctODJlYi03Mjk1ZmUxYjViYjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJsaW5rdHJhZGUuY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3VyZHViaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxpbmt0cmFkZS5jb20vZG9jcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ29wdGlvbnMnOiB7XG4gICAgICAgICAgICAgICA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jE1ODgwNzUyLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2NvbW1vbkN1cnJlbmNpZXMnOiB7XG4gICAgICAgICAgICAgICAgJ0dMRCc6ICdHb2xkJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgbGV0IHF1b3RlSWQgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2VJZCk7XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdz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XJ2ZWQnXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHRoaXMuc3VtIChmcmVlLCB1c2VkKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnJlZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHVzZWQsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rIChwYXJhbXMpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiByZXNwb25zZVsnZGF0YSddWzBdWydiJ10sXG4gICAgICAgICAgICAnYXNrcyc6IHJlc3BvbnNlWydkYXRhJ11bMV1bJ3MnXSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ0dvbGRfUHJpY2UnLCAnR29sZF9BbW91bnQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcXVvdGUgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJpZGFuZGFz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YXN0JzogbGFzdCxcbiAgICAgICAgICAgICdwcmV2aW91c0Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICcyNGhWb2x1bWUnKSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZSddKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ0dvbGRfUHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnR29sZF9BbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLC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2RhdGEnXVsnT3JkZXJfSUQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nO1xuICAgICAgICBpZiAoYXBpID09PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSkpO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArI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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyB2aXJ3b3ggZXh0ZW5kcyBFeGNoYW5nZSB7XG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3ZpcndveCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdWaXJXb1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0FUJywgJ0VVJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODk0LTZkYTlkMzYwLTVlZWEtMTFlNy05MGFhLTQxZjI3MTFiNzQwNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS52aXJ3b3guY29tL2FwaS9qc29uLnBocCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20vYXBpL3RyYWRpbmcucGhwJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2RldmVsb3BlcnMucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvZ2luJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncGFzc3dvcmQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0R2V0SW5zdHJ1bWVudHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtrZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaW5zdHJ1bWVudElEJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydsb25nQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnc2hvcnRDdXJyZW5jeSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge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gICAgICAgICAgICAnb3JkZXJJRCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBhdXRoID0ge307XG4gICAgICAgIGlmIChhcGkgPT09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBhdXRoWydrZXknXSA9IHRoaXMuYXBpS2V5O1xuICAgICAgICAgICAgYXV0aFsndXNlciddID0gdGhpcy5sb2dpbjtcbiAgICAgICAgICAgIGF1dGhbJ3Bhc3MnXSA9IHRoaXMucGFzc3dvcmQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgaWYgKG1ldGhvZCA9PT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0sIGF1dGgsIHBhcmFtcykpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiB0aGlzLmV4dGVuZCAoYXV0aCwgcGFyYW1zKSxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09PSAyMDApIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PT0gJ3snKSB8fCAoYm9keVswXSA9PT0gJ1snKSkge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yQ29kZScgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXJyb3JDb2RlID0gcmVzdWx0WydlcnJvckNvZGUnXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlcnJvckNvZGUgIT09ICdPSycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZXJyb3IgcmV0dXJuZWQ6ICcgKyBib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYWxmb3JtZWQgcmVzcG9uc2U6IG5v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ICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaERlcG9zaXRBZGRyZXNzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNjUyNzUxLWQ3NGVjOGY4LTllMzEtMTFlNy05OGM1LTcxNDY5ZmNlZjAzZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93ZXgubnovYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly93ZXgubnovdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd2V4Lm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovYXBpLzMvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3dleC5uei90YXBpL2RvY3MnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93ZXgubnovZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05NQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVkMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdleGNlcHRpb25zJzoge1xuICAgICAgICAgICAgICAgICdtZXNzYWdlcyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2JhZCBzdGF0dXMnOiBPcmRlck5vdEZvdW5kLFxuICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdHMgdG9vIG9mdGVuJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdub3QgYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJzogRERvU1Byb3RlY3Rpb24sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbCcpLFxuICAgICAgICAgICAgJ2JpZFZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzog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oYW5kbGVyXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGVycm9yID0gdGhpcy5zYWZlU3RyaW5nIChyZXNwb25zZSwgJ2Vycm9yJyk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG1hbGZvcm1lZCBlcnJvcjogJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciA9PT0gJ25vIG9yZGVycycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybmVkIGJ5IGZldGNoT3Blbk9yZGVycyBpZiBubyBvcGVuIG9yZGVycyAoZml4IGZvciAjNDg5KSAtPiBub3QgYW4gZXJyb3JcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBjb25zdCBmZWVkYmFjayA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWVzc2FnZXMgPSB0aGlzLmV4Y2VwdGlvbnNbJ21lc3NhZ2VzJ107XG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJvciBpbiBtZXNzYWdlcykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IG1lc3NhZ2VzW2Vycm9yXSAoZmVlZGJh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ICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdSVScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCwgLy8gcmVzcG9uc2VzIGFyZSBjYWNoZWQgZXZlcnkgMiBzZWNvbmRzXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWNBUEknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdjcmVhdGVNYXJrZXRPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgwNTk0MTQtZTIzNTk3MGMtNjYyYy0xMWU3LThjM2EtMDhlMzFmNzg2ODRiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NyeXB0b3R0bGl2ZXdlYmFwaS54YnRjZS5uZXQ6ODQ0My9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tL3RyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC54YnRjZS5pbmZvL0tub3dsZWRnZWJhc2UvQXJ0aWNsZS9WaWV3LzUyLzI1L3hidGNlLWV4Y2hhbmdlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2VydmVyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZC9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9wZXJpb2RpY2l0aWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcy9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS92ZXJzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFyZ2luQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnUHJvZml0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICBiYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnSXNUcmFkZUFsbG93ZWQnXSA/IHN5bWJvbCA6IGlkO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBc3NldCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIC8vIHhidGNlIG5hbWVzIERBU0ggaW5jb3JyZWN0bHkgYXMgRFNIXG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ0ZyZWVBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAndX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gICBpZiAodGltZXN0YW1wIDwgdGlja2VyWydMYXN0QnV5VGltZXN0YW1wJ10pIHtcbiAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSB0aWNrZXJbJ0xhc3RCdXlUaW1lc3RhbXAnXTtcbiAgICAgICAgICAgICAgICBsYXN0ID0gdGlja2VyWydMYXN0QnV5UHJpY2UnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgaWYgKCdMYXN0U2VsbFRpbWVzdGFtcCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgaWYgKHRpbWVzdGFtcCA8IHRpY2tlclsnTGFzdFNlbGxUaW1lc3RhbXAnXSkge1xuICAgICAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsnTGFzdFNlbGxUaW1lc3RhbXAnXTtcbiAgICAgICAgICAgICAgICBsYXN0ID0gdGlja2VyWydMYXN0U2VsbFByaWNlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnRGFpbHlCZXN0QnV5UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RhaWx5QmVzdFNlbGxQcmljZSddLFxuICAgICAgICAgICAgJ2JpZCc6IHRpY2tlclsnQmVzdEJpZCddLFxuICAgICAgICA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pKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGlkc1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgICAgIGlmIChiYXNlID09PSAnRFNIJylcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBpZiAocXVvdGUgPT09ICdEU0gnKVxuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPS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pdHknOiBwZXJpb2RpY2l0eSxcbiAgICAgICAgLy8gICAgICAgICAndGltZXN0YW1wJzogc2luY2UsXG4gICAgICAgIC8vICAgICAgICAgJ2NvdW50JzogbGltaXQsXG4gICAgICAgIC8vICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgLy8gICAgIHJldHVybiB0aGlzLnBhcnNlT0hMQ1ZzIChyZXNwb25zZVsnQmFycyddLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICAgICAgdGhyb3cgbmV3IE5vdFN1cHBvcnRlZCAodGhpcy5pZCArICcgZmV0Y2hPSExDViBpcyBkaXNhYmxlZCBieSB0aGUgZXhjaGFuZ2UnKTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PT0gJ21hcmtldCcpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgYWxsb3dzIGxpbWl0IG9yZGVycyBvbmx5Jyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmF0ZSc6IHByaWNlLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnSW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gIHVybCArPSAnLycgKyBhcGk7XG4gICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0FjY2VwdC1FbmNvZGluZyc6ICdnemlwLCBkZWZsYXRlJyB9O1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB0aGlzLnVpZCArIHRoaXMuYXBpS2V5ICsgbWV0aG9kICsgdXJsO1xuICAgICAgICAgICA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ICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3lvYml0JyxcbiAgICAgICAgICAgICduYW1lJzogJ1lvQml0JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnUlUnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDMwMDAsIC8vIHJlc3BvbnNlcyBhcmUgY2FjaGVkIGV2ZXJ5IDIgc2Vjb25kc1xuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMycsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdjcmVhdGVEZXBvc2l0QWRkcmVzcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoRGVwb3NpdEFkZHJlc3MnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTEwLWNkY2JmZGFlLTVlZWEtMTFlNy05ODU5LTAzZmVhODczMjcyZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly95b2JpdC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly95b2JpdC5uZXQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnlvYml0Lm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQvZW4vYXBpLycsXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0L2VuL2ZlZXMvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0NvaW5zVG9BZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge30sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbW9uQ3VycmVuY2llcyc6IHtcbiAgICAgICAgICAgICAgICAnQUlSJzogJ0FpckNvaW4nLFxuICAgICAgICAgICAgICAgICdBTkknOiAnQU5JQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FOVCc6ICdBbnRzQ29pbicsXG4gICAgICAgICAgICAgICAgJ0FTVCc6ICdBc3RyYWwnLFxuICAgICAgICAgICAgICAgICdBVE0nOiAnQXV0dW1uY29pbicsXG4gICAgICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgICAgICdCQ1MnOiAnQml0Y29pblN0YWtlJyxcbiAgICAgICAgICAgICAgICAnQkxOJzogJ0J1bGxlb24nLFxuICAgICAgICAgICAgICAgICdCVFMnOiAnQml0c2hhcmVzMicsXG4gICAgICAgICAgICAgICAgJ0NBVCc6ICdCaXRDbGF2ZScsXG4gICAgICAgICAgICAgICAgJ0NPVic6ICdDb3ZlbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnQ1BDJzogJ0NhcHJpY29pbicsXG4gICAgICAgICAgICAgICAgJ0NTJzogJ0NyeXB0b1Nwb3RzJyxcbiAgICAgICAgICAgICAgICAnRENUJzogJ0Rpc2NvdW50JyxcbiAgICAgICAgICAgICAgICAnREdEJzogJ0RhcmtHb2xkQ29pbicsXG4gICAgICAgICAgICAgICAgJ0RST1AnOiAnRmF1Y2V0Q29pbicsXG4gICAgICAgICAgICAgICAgJ0VSVCc6ICdFcmlzdGljYSBUb2tlbicsXG4gICAgICAgICAgICAgICAgJ0lDTic6ICdpQ29pbicsXG4gICAgICAgICAgICAgICAgJ0tOQyc6ICdLaW5nTiBDb2luJyxcbiAgICAgICAgICAgICAgICAnTElaSSc6ICdMaVppJyxcbiAgICAgICAgICAgICAgICAnTE9DJzogJ0xvY29Db2luJyxcbiAgICAgICAgICAgICAgICAnTE9DWCc6ICdMT0MnLFxuICAgICAgICAgICAgICAgICdMVU4nOiAnTHVuYXJDb2luJyxcbiAgICAgICAgICAgICAgICAnTURUJzogJ01pZG5pZ2h0JyxcbiAgICAgICAgICAgICAgICAnTkFWJzogJ05hdmFqb0NvaW4nLFxuICAgICAgICAgICAgICAgICdPTUcnOiAnT01HYW1lJyxcbiAgICAgICAgICAgICAgICAnU1RLJzogJ1N0YWtlQ29pbicsXG4gICAgICAgICAgICAgICAgJ1BBWSc6ICdFUEFZJyxcbiAgICAgICAgICAgICAgICAnUExDJzogJ1BsYXRpbiBDb2luJyxcbiAgICAgICAgICAgICAgICAnUkVQJzogJ1JlcHVibGljb2luJyxcbiAgICAgICAgICAgICAgICAnUlVSJzogJ1JVQicsXG4gICAgICAgICAgICAgICAgJ1hJTic6ICdYSU5Db2luJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnb3B0aW9ucyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnNSZXF1aXJlc1N5bWJvbCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgbGV0IHN0YXR1c2VzID0ge1xuICAgICAgICAgICAgJzAnOiAnb3BlbicsXG4gICAgICAgICAgICAnMSc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgJzInOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzMnOiAnb3BlbicsIC8vIG9yIHBhcnRpYWxseS1maWxsZWQgYW5kIGNsb3NlZD8gaHR0cHM6Ly9naXRodWIuY29tL2NjeHQvY2N4dC9pc3N1ZXMvMTU5NFxuICAgICAgICB9O1xuICAgICAgICBpZiA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bGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFtrZXldID0gYmFsYW5jZXNbc2lkZV1bbG93ZXJjYXNlXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh0eXBlb2YgYWNjb3VudFsndG90YWwnXSAhPT0gJ3VuZGVmaW5lZCcpICYmICh0eXBlb2YgYWNjb3VudFsnZnJlZSddICE9PSAndW5kZWZpbmVkJykpXG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZURlcG9zaXRBZGRyZXNzIChjb2RlLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoRGVwb3NpdEFkZHJlc3MgKGNvZGUsIHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbmVlZF9uZXcnOiAx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ICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY29kZSwgYW1vdW50LCBhZGRyZXNzLCB0YWcgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRoaXMuY2hlY2tBZGRyZXNzIChhZGRyZXNzKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RXaXRoZHJhd0NvaW5zVG9BZGRyZXNzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW5OYW1lJzogY3VycmVuY3lbJ2lkJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5WzBdID09PSAneycpIHtcbiAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yX2xvZycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnZXJyb3JfbG9nJ10uaW5kZXhPZiAoJ0luc3VmZmljaWVudCBmdW5kcycpID49IDApIHsgLy8gbm90IGVub3VnVGggaXMgYSB0eXBvIGluc2lkZSBMaXF1aSdzIG93biBBUEkuLi5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlWydlcnJvcl9sb2cnXSA9PT0gJ1JlcXVlc3RzIHRvbyBvZnRlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChyZXNwb25zZVsnZXJyb3JfbG9nJ10gPT09ICdub3QgYXZhaWxhYmxlJykgfHwgKHJlc3BvbnNlWydlcnJvcl9sb2cnXSA9PT0gJ2V4dGVybmFsIHNlcnZpY2UgdW5hdmFpbGFibGUnKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBERG9TUHJvdGVjdGlvbiAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9X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xMjAnLFxuICAgICAgICAgICAgICAgICc0aCc6ICcyNDAnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnNzIwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzNkJzogJzQzMjAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcxMDA4MCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU3MDU0OC00ZDY0NmM0MC03MTQ3LTExZTctOWNmNi04MzliOTNlNmQ2MjIuanBnJyxcbiAgICAgICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5qc29uJywgLy8gZGVmYXVsdCBleHRlbnNpb24gYXBwZW5kZWQgdG8gZW5kcG9pbnQgVVJMc1xuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly95dW5iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3l1bmJpLmNvbS9kb2N1bWVudHMvYXBpL2d1aWRlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL3N3YWdnZXIvJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzL3ttYXJrZXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWRkcmVzc2VzL3thZGRyZXNzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFydG5lcnMvb3JkZXJzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2RlbGV0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9jbGVhcicsXG4gICAgICAgICAgICAg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J3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTI3LTM5Y2EyYWRhLTVlZWItMTFlNy05NzJmLTFiNDE5OTUxOGNhNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vdGVjaGJ1cmVhdS1hcGktZG9jdW1lbnQucmVhZHRoZWRvY3MuaW8vamEvbGF0ZXN0L2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MvYXBpX2xpbmtzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL3lvdTIxOTc5L25vZGUtemFpZicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3phaWYuanAvZmVlP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IC0wLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAwMDUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pZF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcGVyc29uYWxfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdlY2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZUlkc0J5T3JkZXJOdW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RsYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3Vwcy97Z3JvdXBfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlyc0FsbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKG1hcmtldFsnaXRlbV91bml0X3N0ZXAnXSksXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydhdXhfdW5pdF9wb2ludCddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsIC8vIGNhbiB0cmFkZSBvciBub3RcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ2l0ZW1fdW5pdF9taW4nKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnYXV4X3VuaXRfbWluJyksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEluZm8gKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXR1cm4nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlc1snZnVuZHMnXSk7XG4gICAgICAgIGZvciAobGV0IGMgPSAwOyBjIDwgY3VycmVuY2llcy5sZW5ndGg7IGMrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tjXTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbJ2Z1bmRzJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKCdkZXBvc2l0JyBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlc1snZGVwb3NpdCddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBiYWxhbmNlc1snZGVwb3NpdCddW2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aFBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJQYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgdndhcCA9IHRpY2tlclsndndhcCddO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHRpY2tlclsndm9sdW1lJ107XG4gICAgICAgIGxldCBxdW90ZVZvbHVtZSA9IGJhc2VWb2x1bWUgKiB2d2FwO1xuICAgICAgICBsZXQgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydiaWQnXSxcbiAgICAgICAgICAgICdiaWRWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydhc2snXSxcbiAgICAgICAgICAgICdhc2tWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWyd0cmFkZV90eXBlJ10gPT09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdpZCcpO1xuICAgICAgICBpZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0aWQnLCBpZCk7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW3RyYWRlWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAg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oaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydhY3Rpb24nXSA9PT0gJ2JpZCcpID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIGlmICghbWFya2V0KVxuICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW29yZGVyWydjdXJyZW5jeV9wYWlyJ11dO1xuICAgICAgICBsZXQgcHJpY2UgPSBvcmRlclsncHJpY2UnXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydhbW91bnQnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdsYXN0VHJhZGVUaW1lc3RhbXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1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AgICAgICAgICAgaWYgKGFwaSA9PT0gJ2VjYXBpJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnZWNhcGknO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChhcGkgPT09ICd0bGFwaScpIHtcbiAgICAgICAgICAgICAgICB1cmwgKz0gJ3RsYXBpJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0YXBpJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ2FwaScsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICB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RzIEV4Y2hhbmdlIHtcbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnemInLFxuICAgICAgICAgICAgJ25hbWUnOiAnWkInLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlTWFya2V0T3JkZXInOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5J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lkgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDInOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBCVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDMnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBMVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDUnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBFVEggQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDYnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBFVEMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDcnOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0luc3VmZmljaWVudCBCVFMgQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgJzIwMDknOiBJbnN1ZmZpY2llbnRGdW5kcywgLy8gJ0FjY291bnQgYmFsYW5jZSBpcyBub3QgZW5vdWdoJyxcbiAgICAgICAgICAgICAgICAnMzAwMSc6IE9yZGVyTm90Rm91bmQsIC8vICdQZW5kaW5nIG9yZGVycyBub3QgZm91bmQnLFxuICAgICAgICAgICAgICAgICczMDAyJzogSW52YWxpZE9yZGVyLCAvLyAnSW52YWxpZCBwcmljZScsXG4gICAgICAgICAgICAgICAgJzMwMDMnOiBJbnZhbGlkT3JkZXIsIC8vICdJbnZhbGlkIGFtb3VudCcsXG4gICAgICAgICAgICAgICAgJzMwMDQnOiBBdXRoZW50aWNhdGlvbkVycm9yLCAvLyAnVXNlciBkb2VzIG5vdCBleGlzdCcsXG4gICAgICAgICAgICAgICAgJzMwMDUnOiBFeGNoYW5nZUVycm9yLCAvLyAnSW52YWxpZCBwYXJhbWV0ZXInLFxuICAgICAgICAgICAgICAgICczMDA2JzogQXV0aGVudGljYXRpb25FcnJvciwgLy8gJ0ludmFsaWQgSVA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XMnOiAnaHR0cHM6Ly93d3cuemIuY29tL2kvcmF0ZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAna2xpbmUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBzcG90IEFQSVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzTmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFVuZmluaXNoZWRPcmRlcnNJZ25vcmVUcmFkZVR5cGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEFjY291bnRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVc2VyQWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRDbnlXaXRoZHJhd1JlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255Q2hhcmdlUmVjb3JkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXZlcmFnZSBBUElcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRMZXZlckFzc2V0c0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExldmVyQmlsbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVySW5MZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJPdXRMZXZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsTG9hbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldExvYW5SZWNvcmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib3Jyb3cnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSZXBheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAuMDAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRTJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogJzAuMSUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDQVNIJzogNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTksnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUVic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEJUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0hBVCc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdENOWSc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hMQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNXJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2VJZCwgcXVvdGVJZCBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICBsZXQgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlSWQudG9VcHBlckNhc2UgKCkpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50U2NhbGUnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlU2NhbGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRHZXRBY2NvdW50SW5mbyAocGFyYW1zKTtcbiAgICAgICAgLy8gdG9kbzogdXNlIHRoaXMgc29tZWhvd1xuICAgICAgICAvLyBsZXQgcGVybWlzc2lvbnMgPSByZXNwb25zZVsncmVzdWx0J11bJ2Jhc2UnXTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddWydjb2lucyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYmFsYW5jZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbaV07XG4gICAgICAgICAgICAvLyAgICAgeyAgICAgICAgZW5OYW1lOiBcIkJUQ1wiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICBmcmVlejogXCIwLjAwMDAwMDAwXCIsXG4gICAgICAgICAgICAvLyAgICAgICAgIHVuaXREZWNpbWFsOiAgOCwgLy8gYWx3YXlzIDhcbiAgICAgICAgICAgIC8vICAgICAgICAgICAgICBjbk5hbWU6IFwiQlRDXCIsXG4gICAgICAgICAgICAvLyAgICAgICBpc0NhblJlY2hhcmdlOiAgdHJ1ZSwgLy8gVE9ETzogc2hvdWxkIHVzZSB0aGlzXG4gICAgICAgICAgICAvLyAgICAgICAgICAgICB1bml0VGFnOiBcIuC4v1wiLFxuICAgICAgICAgICAgLy8gICAgICAgaXNDYW5XaXRoZHJhdzogIHRydWUsICAvLyBUT0RPOiBzaG91bGQgdXNlIHRoaXNcbiAgICAgICAgICAgIC8vICAgICAgICAgICBhdmFpbGFibGU6IFwiMC4wMDAwMDAwMFwiLFxuICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgIGtleTogXCJidGNcIiAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsna2V5J107XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gdGhpcy5jdXJyZW5jaWVzX2J5X2lkKVxuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzX2J5X2lkW2N1cnJlbmN5XVsnY29kZSddO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhbGFuY2VbJ2VuTmFtZSddKTtcbiAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2ZyZWV6J10pO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgZ2V0TWFya2V0RmllbGROYW1lICgpIHtcbiAgICAgICAgcmV0dXJuICdtYXJrZXQnO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIGxpbWl0ID0gdW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0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYmlkVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAnYXNrVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IGxhc3QsXG4gICAgICAgICAgICAnbGFzdCc6IGxhc3QsXG4gICAgICAgICAgICAncHJldmlvdXNDbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2t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2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbJ3ByaWNlJ107XG4gICAgICAgIGxldCBhdmVyYWdlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgZmlsbGVkID0gb3JkZXJbJ3RyYWRlX2Ftb3VudCddO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ3RvdGFsX2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgY29zdCA9IG9yZGVyWyd0cmFkZV9tb25leSddO1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5zYWZlU3RyaW5nIChvcmRlciwgJ3N0YXR1cycpO1xuICAgICAgICBpZiAodHlwZW9mIHN0YXR1cyAhPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2xhc3RUcmFkZVRpbWVzdGFtcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBjb25zdCBzdGF0dXNlcyA9IHtcbiAgICAgICAgICAgICcwJzogJ29wZW4nLFxuICAgICAgICAgICAgJzEnOiAnY2FuY2VsZWQnLFxuICAgICAgICAgICAgJzInOiAnY2xvc2VkJyxcbiAgICAgICAgICAgICczJzogJ29wZW4nLCAvLyBwYXJ0aWFsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChzdGF0dXMgaW4gc3RhdHVzZXMpXG4gICAgICAgICAgICByZXR1cm4gc3RhdHVzZXNbc3RhdHVzXTtcbiAgICAgICAgcmV0dXJuIHN0YXR1cztcbiAgICB9XG5cbiAgICBnZXRDcmVhdGVEYXRlRmllbGQgKCkge1xuICAgICAgICByZXR1cm4gJ3RyYWRlX2RhdGUnO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1x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Db2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmICh0eXBlb2YgYm9keSAhPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm47IC8vIGZhbGxiYWNrIHRvIGRlZmF1bHQgZXJyb3IgaGFuZGxlclxuICAgICAgICBpZiAoYm9keS5sZW5ndGggPCAyKVxuICAgICAgICAgICAgcmV0dXJuOyAvLyBmYWxsYmFjayB0byBkZWZhdWx0IGVycm9yIGhhbmRsZXJcbiAgICAgICAgaWYgKGJvZHlbMF0gPT09ICd7Jykge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBpZiAoJ2NvZGUnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnY29kZScpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gdGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIGlmIChjb2RlIGluIHRoaXMuZXhjZXB0aW9ucykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgRXhjZXB0aW9uQ2xhc3MgPSB0aGlzLmV4Y2VwdGlvbnNbY29kZV07XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNlcHRpb25DbGFzcyAobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjb2RlICE9PSAnMTAwMCcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn07XG4iLCI7KGZ1bmN0aW9uIChyb290LCBmYWN0b3J5LCB1bmRlZikge1xuXHRpZ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ICAgLy8gQ29tcHV0ZSBudW1iZXIgb2Ygcm91bmRzXG5cdCAgICAgICAgICAgIHZhciBuUm91bmRzID0gdGhpcy5fblJvdW5kcyA9IGtleVNpemUgKyA2O1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGUgbnVtYmVyIG9mIGtleSBzY2hlZHVsZSByb3dzXG5cdCAgICAgICAgICAgIHZhciBrc1Jvd3MgPSAoblJvdW5kcyArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGtleSBzY2hlZHVsZVxuXHQgICAgICAgICAgICB2YXIga2V5U2NoZWR1bGUgPSB0aGlzLl9rZXlTY2hlZHVsZSA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBrc1JvdyA9IDA7IGtzUm93IDwga3NSb3dzOyBrc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgIC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ggZW5jcnlwdCBhbmQgZGVjcnlwdCBzaG9ydGN1dCBmdW5jdGlvbnMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBBRVMgPSBDcnlwdG9KUy5saWIuQ2lwaGVyLl9jcmVhdGVIZWxwZXIoQ3J5cHRvSlMuYWxnby5BRVMpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIF9jcmVhdGVIZWxwZXI6IChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIGZ1bmN0aW9uIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBrZXkgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFzc3dvcmRCYXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCB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QgICAgICAgICAqIEFic3RyYWN0IGJhc2UgQ0JDIG1vZGUuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdmFyIENCQyA9IEJsb2NrQ2lwaGVyTW9kZS5leHRlbmQoKTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBlbmNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkVuY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lw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tcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNpcGhlclBhcmFtcyA9IENyeXB0b0pTLmxpYi5DaXBoZXJQYXJhbXMuY3JlYXRlKHtcblx0ICAgICAgICAgKiAgICAgICAgIGNpcGhlcnRleHQ6IGNpcGhlcnRleHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBrZXk6IGtleVdvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIGl2OiBpdldvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIHNhbHQ6IHNhbHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBhbGdvcml0aG06IENyeXB0b0pTLmFsZ28uQUVTLFxuXHQgICAgICAgICAqICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXG5cdCAgICAgICAgICogICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUEtDUzcsXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1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biAob2JqKSB7XG5cdCAgICAgICAgICAgIHZhciBzdWJ0eXBlO1xuXG5cdCAgICAgICAgICAgIEYucHJvdG90eXBlID0gb2JqO1xuXG5cdCAgICAgICAgICAgIHN1YnR5cGUgPSBuZXcgRigpO1xuXG5cdCAgICAgICAgICAgIEYucHJvdG90eXBlID0gbnVsbDtcblxuXHQgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICB9O1xuXHQgICAgfSgpKVxuXG5cdCAgICAvKipcblx0ICAgICAqIENyeXB0b0pTIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBMaWJyYXJ5IG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfbGliID0gQy5saWIgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBCYXNlIG9iamVjdCBmb3IgcHJvdG90eXBhbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4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ICAgICBpbml0OiBmdW5jdGlvbiAod29yZHMsIHNpZ0J5dGVzKSB7XG5cdCAgICAgICAgICAgIHdvcmRzID0gdGhpcy53b3JkcyA9IHdvcmRzIHx8IFtdO1xuXG5cdCAgICAgICAgICAgIGlmIChzaWdCeXRlcyAhPSB1bmRlZmluZWQpIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSBzaWdCeXRlcztcblx0ICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSB3b3Jkcy5sZW5ndGggKiA0O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIHRoaXMgd29yZCBhcnJheSB0byBhIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7RW5jb2Rlcn0gZW5jb2RlciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheTEuY29uY2F0KHdvcmRBcnJheTIpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNvbmNhdDogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHRoaXNXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGF0V29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGlzU2lnQnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB2YXIgdGhhdFNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wIGV4Y2VzcyBiaXRzXG5cdCAgICAgICAgICAgIHRoaXMuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDb25jYXRcblx0ICAgICAgICAgICAgaWYgKHRoaXNTaWdCeXRlcyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgIC8vIENvcHkgb25lIGJ5dGUgYXQgYSB0aW1lXG5cdCAgICAgICAgICAgICAgIC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AgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB0aGlzLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wXG5cdCAgICAgICAgICAgIHdvcmRzW3NpZ0J5dGVzID4+PiAyXSAmPSAweGZmZmZmZmZmIDw8ICgzMiAtIChzaWdCeXRlcyAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIHdvcmRzLmxlbmd0aCA9IE1hdGguY2VpbChzaWdCeXRlcyAvIDQpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0gd29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgd29yZCBhcnJheSBmaWxsZWQgd2l0aCByYW5kb20gYnl0ZXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbkJ5dGVzIFRoZSBudW1iZXIgb2YgcmFuZG9tIGJ5dGVzIHRvIGdlbmVyYXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzd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mVkQmxvY2tBbGdvcml0aG0ucmVzZXQoKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICByZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB0aGlzLl9kYXRhID0gbmV3IFdvcmRBcnJheS5pbml0KCk7XG5cdCAgICAgICAgICAgIHRoaXMuX25EYXRhQnl0ZXMgPSAwO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBBZGRzIG5ldyBkYXRhIHRvIHRoaXMgYmxvY2sgYWxnb3JpdGhtJ3MgYnVmZmVyLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBkYXRhIFRoZSBkYXRhIHRvIGFwcGVuZC4gU3RyaW5ncyBhcmUgY29udmVydGVkIHRvIGEgV29yZEFycmF5IHVzaW5nIFVURi04LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICBidWZmZXJlZEJsb2NrQWxnb3JpdGhtLl9hcHBlbmQoJ2RhdGEnKTtcblx0ICAgICAgICAgKiAgICAgYnVmZmVyZWRCbG9ja0FsZ29yaXRobS5fYXBwZW5kKHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgX2FwcGVuZDogZnVuY3Rpb24gKGRhdGEpIHtcblx0ICAgICAgICAgICAgLy8gQ29udmVydCBzdHJpbmcgdG8gV29yZEFycmF5LCBlbHNlIGFzc3VtZSBXb3JkQXJyYXkgYWxyZWFkeVxuXHQgICAgICAgICAgICBpZiAodHlwZW9mIGRhdGEgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgIGRhdGEgPSBVdGY4LnBhcnNlKGRhdGEpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQXBw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0aW9uLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGFzaGVyID0gQ3J5cHRvSlMuYWxnby5TSEEyNTYuY3JlYXRlKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgaW5pdDogZnVuY3Rpb24gKGNmZykge1xuXHQgICAgICAgICAgICAvLyBBcHBseSBjb25maWcgZGVmYXVsdHNcblx0ICAgICAgICAgICAgdGhpcy5jZmcgPSB0aGlzLmNmZy5leHRlbmQoY2ZnKTtcblxuXHQgICAgICAgICAgICAvLyBTZXQgaW5pdGlhbCB2YWx1ZXNcblx0ICAgICAgICAgICAgdGhpcy5yZXNldCgpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBSZXNldHMgdGhpcyBoYXNoZXIgdG8gaXRzIGluaXRpYWwgc3RhdGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIGhhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFJlc2V0IGRhdGEgYnVmZmVyXG5cdCAgICAgICAgICAgIEJ1ZmZlcmVkQmxvY2tBbGdvcml0aG0ucmVzZXQuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBQZXJmb3JtIGNvbmNyZXRlLWhhc2hlciBsb2dpY1xuXHQgICAgICAgICAgICB0aGlzLl9kb1Jlc2V0KCk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFVwZGF0ZXMgdGhpcyBoYXNoZXIgd2l0aCBhIG1lc3NhZ2UuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJ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ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIFNIQTI1NiA9IENyeXB0b0pTLmxpYi5IYXNoZXIuX2NyZWF0ZUhlbHBlcihDcnlwdG9KUy5hbGdvLlNIQTI1Nik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgX2NyZWF0ZUhlbHBlcjogZnVuY3Rpb24gKGhhc2hlcikge1xuXHQgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG1lc3NhZ2UsIGNmZykge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBoYXNoZXIuaW5pdChjZmcpLmZpbmFsaXplKG1lc3NhZ2UpO1xuXHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgc2hvcnRjdXQgZnVuY3Rpb24gdG8gdGhlIEhNQUMncyBvYmplY3QgaW50ZXJmYWNlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtIYXNoZXJ9IGhhc2hlciBUaGUgaGFzaGVyIHRvIHVzZSBpbiB0aGlzIEhNQUMgaGVscGVyLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7RnVuY3Rpb259IFRoZSBzaG9ydGN1dCBmdW5jdGlvbi5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIEhtYWNTSEEyNTYgPSBDcnlwdG9KUy5saWIuSGFzaGVyLl9jcmVhdGVIbWFjSGVscGVyKENyeXB0b0pTLmFsZ28uU0hBMjU2KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBfY3JlYXR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AgdmFyIFdvcmRBcnJheSA9IENfbGliLldvcmRBcnJheTtcblx0ICAgIHZhciBDX2VuYyA9IEMuZW5jO1xuXG5cdCAgICAvKipcblx0ICAgICAqIEJhc2U2NCBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2U2NCA9IENfZW5jLkJhc2U2NCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBCYXNlNjQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBiYXNlNjRTdHJpbmcgPSBDcnlwdG9KUy5lbmMuQmFzZTY0LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLl9tYXA7XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXAgZXhjZXNzIGJpdHNcblx0ICAgICAgICAgICAgd29yZEFycmF5LmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgYmFzZTY0Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAzKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTEgPSAod29yZHNbaSA+Pj4gMl0gICAgICAgPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgICAgICAgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUyID0gKHdvcmRzWyhpICsgMSkgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAxKSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMyA9ICh3b3Jkc1soaSArIDIpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMikgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0cmlwbGV0ID0gKGJ5dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA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lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xNiBMRSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgQ19lbmMuVXRmMTZMRSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi0xNiBMRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGYxNlN0ciA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSBzd2FwRW5kaWFuKCh3b3Jkc1tpID4+PiAyXSA+Pj4gKDE2IC0gKGkgJSA0KSAqIDgpKSAmIDB4ZmZmZik7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBMRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnBhcnNlKHV0Z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GluaXQ6IGZ1bmN0aW9uIChjZmcpIHtcblx0ICAgICAgICAgICAgdGhpcy5jZmcgPSB0aGlzLmNmZy5leHRlbmQoY2ZnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogRGVyaXZlcyBhIGtleSBmcm9tIGEgcGFzc3dvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHNhbHQgQSBzYWx0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYX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RlY2ltYWxseSBlbmNvZGVkIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGhleFN0cmluZyA9IENyeXB0b0pTLmZvcm1hdC5IZXguc3RyaW5naWZ5KGNpcGhlclBhcmFtcyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAoY2lwaGVyUGFyYW1zKSB7XG5cdCAgICAgICAgICAgIHJldHVybiBjaXBoZXJQYXJhbXMuY2lwaGVydGV4dC50b1N0cmluZyhIZXgpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleGFkZWNpbWFsbHkgZW5jb2RlZCBjaXBoZXJ0ZXh0IHN0cmluZyB0byBhIGNpcGhlciBwYXJhbXMgb2JqZWN0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGlucHV0IFRoZSBoZXhhZGVjaW1hbGx5IGVuY29kZWQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q2lwaGVyUGFyYW1zfSBUaGUgY2lwaGVyIHBhcmFtcyBvYmplY3QuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjaXBoZXJQYXJhbXMgPSBDcnlwdG9KUy5mb3JtYXQuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChpbnB1dCkge1xuXHQgICAgICAgICAgICB2YXIgY2lwaGVydGV4dCA9IEhle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gICAgICAgIHRoaXMucmVzZXQoKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVzZXRzIHRoaXMgSE1BQyB0byBpdHMgaW5pdGlhbCBzdGF0ZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBoYXNoZXIgPSB0aGlzLl9oYXNoZXI7XG5cblx0ICAgICAgICAgICAgLy8gUmVzZXRcblx0ICAgICAgICAgICAgaGFzaGVyLnJlc2V0KCk7XG5cdCAgICAgICAgICAgIGhhc2hlci51cGRhdGUodGhpcy5faUtleSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFVwZGF0ZXMgdGhpcyBITUFDIHdpdGggYSBtZXNzYWdlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBtZXNzYWdlVXBkYXRlIFRoZSBtZXNzYWdlIHRvIGFwcGVuZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge0hNQUN9IFRoaXMgSE1BQyBpbnN0YW5jZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUoJ21lc3NhZ2UnKTtcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB1cGRhdGU6IGZ1bmN0aW9uIChtZXNzYWdlVXBkYXRlKSB7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AgICAgICAgICAgdmFyIE1fb2Zmc2V0X2kgPSBNW29mZnNldF9pXTtcblxuXHQgICAgICAgICAgICAgICAgTVtvZmZzZXRfaV0gPSAoXG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCA4KSAgfCAoTV9vZmZzZXRfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDI0KSB8IChNX29mZnNldF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA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ChuQml0c1RvdGFsSCA8PCA4KSAgfCAobkJpdHNUb3RhbEggPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAoKChuQml0c1RvdGFsSCA8PCAyNCkgfCAobkJpdHNUb3RhbEggPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbKCgobkJpdHNMZWZ0ICsgNjQpID4+PiA5KSA8PCA0KSArIDE0XSA9IChcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDgpICB8IChuQml0c1RvdGFsTCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDI0KSB8IChuQml0c1RvdGFsTCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgZnVuY3Rpb24gRkYoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGMpIHwgKH5iICYgZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gR0coYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGQpIHwgKGMgJiB+ZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gSEgoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArIChiIF4gYyBeIGQpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3R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CgpO1xuXG5cdCAgICB2YXIgRW5jcnlwdG9yID0gQ1RSLkVuY3J5cHRvciA9IENUUi5leHRlbmQoe1xuXHQgICAgICAgIHByb2Nlc3NCbG9jazogZnVuY3Rpb24gKHdvcmRzLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBjaXBoZXIgPSB0aGlzLl9jaXBoZXJcblx0ICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cdCAgICAgICAgICAgIHZhciBpdiA9IHRoaXMuX2l2O1xuXHQgICAgICAgICAgICB2YXIgY291bnRlciA9IHRoaXMuX2NvdW50ZXI7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5c3RyZWFtXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgY291bnRlciA9IHRoaXMuX2NvdW50ZXIgPSBpdi5zbGljZSgwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIElWIGZvciBzdWJzZXF1ZW50IGJsb2Nrc1xuXHQgICAgICAgICAgICAgICAgdGhpcy5faXYgPSB1bmRlZmluZWQ7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgdmFyIGtleXN0cmVhbSA9IGNvdW50ZXIuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2soa2V5c3RyZWFtLCAwKTtcblxuXHQgICAgICAgICAgICAvLyBJbmNyZW1lbnQgY291bnRlclxuXHQgICAgICAgICAgICBjb3VudGVyW2Jsb2NrU2l6ZSAtIDFdID0gKGNvdW50ZXJbYmxvY2tTaXplIC0gMV0gKyAxKSB8IDBcblxuXHQgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICA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HgwMDAwMDAwMV0pO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleVdvcmRzID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZVdvcmRzID0gaW50ZXJtZWRpYXRlLndvcmRzO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gWE9SIGludGVybWVkaWF0ZSB3aXRoIGJsb2NrXG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBibG9ja1dvcmRzTGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tXb3Jkc1tqXSBePSBpbnRlcm1lZGlhdGVXb3Jkc1tqXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRLZXkuY29uY2F0KGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgIGJsb2NrSW5kZXhXb3Jkc1swXSsrO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBDb21wdXRlcyB0aGUgUGFzc3dvcmQtQmFzZWQgS2V5IERlcml2YXRpb24gRnVuY3Rpb24gMi5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEF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G5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRl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AmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1szXSA9IFhbNl0gXiAoWFszXSA+Pj4gMTYpIF4gKFhbMV0gPDwgMTYpO1xuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgU1t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ggID0gV29yZEFycmF5LmNyZWF0ZShbMHg2NzQ1MjMwMSwgMHhFRkNEQUI4OSwgMHg5OEJBRENGRSwgMHgxMDMyNTQ3NiwgMHhDM0QyRTFGMF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblxuXHQgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDE2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIG9mZnNldF9pID0gb2Zmc2V0ICsgaTtcblx0ICAgICAgICAgICAgICAgIHZhciBNX29mZnNldF9pID0gTVtvZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbNF0gKyBhbCArIGJyKXwwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbMF0gKyBibCArIGNyKXwwO1xuXHQgICAgICAgICAgICBIWzBdID0gIHQ7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlIDMyKTtcblx0ICAgICAgICAgICAgZGF0YVdvcmRzWygoKG5CaXRzTGVmdCArIDY0KSA+Pj4gOSkgPDwgNCkgKyAxNF0gPSAoXG5cdCAgICAgICAgICAgICAgICAoKChuQml0c1RvdGFsIDw8IDgpICB8IChuQml0c1RvdGFsID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgKCgobkJpdHNUb3RhbCA8PCAyNCkgfCAobkJpdHNUb3RhbCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIGRhdGEuc2lnQnl0ZXMgPSAoZGF0YVdvcmRzLmxlbmd0aCArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBIYXNoIGZpbmFsIGJsb2Nrc1xuXHQgICAgICAgICAgICB0aGlzLl9wcm9jZXNzKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc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MHg2NzQ1MjMwMSwgMHhlZmNkYWI4OSxcblx0ICAgICAgICAgICAgICAgIDB4OThiYWRjZmUsIDB4MTAzMjU0NzYsXG5cdCAgICAgICAgICAgICAgICAweGMzZDJlMWYwXG5cdCAgICAgICAgICAgIF0pO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhID0gSFswXTtcblx0ICAgICAgICAgICAgdmFyIGIgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICA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kcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdC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HkgJSA1O1xuXHQgICAgICAgICAgICB2YXIgbmV3WSA9ICgyICogeCArIDMgKiB5KSAlIDU7XG5cdCAgICAgICAgICAgIHggPSBuZXdYO1xuXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPSAoTEZTUiA8PCAxKSBeIDB4NzE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPDw9IDE7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBST1VORF9DT05TVEFOVFNbaV0gPSBYNjRXb3JkLmNyZWF0ZShyb3VuZENvbnN0YW50TXN3LCByb3VuZENvbnN0YW50THN3KTtcblx0ICAgICAgICB9XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvLyBSZXVzYWJsZSBvYmplY3RzIGZvciB0ZW1wb3JhcnkgdmFsdWVzXG5cdCAgICB2YXIgVCA9IFtdO1xuXHQgICAgKGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgVFtpXSA9IFg2NFdvcmQuY3JlYXRlKCk7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBTSEEtMyBoYXNoIGFsZ29yaXRobS5cblx0ICAgICAqL1xuXHQgICAgdmFyIFNIQTMgPSBDX2FsZ28uU0hBMyA9IEhhc2hlci5leHRlbmQoe1xuXHQgICAgICAgIC8qKlxuX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3JiXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbkJsb2NrU2l6ZUxhbmVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3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lID0gdGhpcy5fc3RhdGU7XG5cdCAgICAgICAgICAgIHZhciBvdXRwdXRMZW5ndGhCeXRlcyA9IHRoaXMuY2ZnLm91dHB1dExlbmd0aCAvIDg7XG5cdCAgICAgICAgICAgIHZhciBvdXRwdXRMZW5ndGhMYW5lcyA9IG91dHB1dExlbmd0aEJ5dGVzIC8gODtcblxuXHQgICAgICAgICAgICAvLyBTcXVlZXplXG5cdCAgICAgICAgICAgIHZhciBoYXNoV29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBvdXRwdXRMZW5ndGhMYW5lczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKV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hiYjY3YWU4NSwgMHg4NGNhYTczYiksXG5cdCAgICAgICAgICAgICAgICBuZXcgWDY0V29yZC5pbml0KDB4M2M2ZWYzNzIsIDB4ZmU5NGY4MmIpLCBuZXcgWDY0V29yZC5pbml0KDB4YTU0ZmY1M2EsIDB4NWYxZDM2ZjEpLFxuXHQgICAgICAgICAgICAgICAgbmV3IFg2NFdvcmQuaW5pdCgweDUxMGU1MjdmLCAweGFkZTY4MmQxKSwgbmV3IFg2NFdvcmQuaW5pdCgweDliMDU2ODhjLCAweDJiM2U2YzFmKSxcblx0ICAgICAgICAgICAgICAgIG5ldyBYNjRXb3JkLmluaXQoMHgxZjgzZDlhYiwgMHhmYjQxYmQ2YiksIG5ldyBYNjRXb3JkLmluaXQoMHg1YmUwY2QxOSwgMHgxMzdlMjE3OSlcblx0ICAgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpLmxvdyAgPSBNW29mZnNldCArIGkgKiAyICsgMV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTBcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweCAgPSBXW2kgLSAxNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHhoID0gZ2FtbWEweC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4bCA9IGdhbW1hMHgubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTBoICA9ICgoZ2FtbWEweGggPj4+IDEpIHwgKGdhbW1hMHhsIDw8IDMxKSkgXiAoKGdhbW1hMHhoID4+PiA4KSB8IChnYW1tYTB4bCA8PCAyNCkpIF4gKGdhbW1hMHhoID4+PiA3KTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEwbCAgPSAoKGdhbW1hMHhsID4+PiAxKSB8IChnYW1tYTB4aCA8PCAzMSkpIF4gKChnYW1tYTB4bCA+Pj4gOCkgfCAoZ2FtbWEweGggPDwgMjQpKSBeICgoZ2FtbWEweGwgPj4+IDcpIHwgKGdhbW1hMHhoIDw8IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTFcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeCAgPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeGggPSBnYW1tYTF4LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXhsID0gZ2FtbWExeC5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMWggID0gKChnYW1tYTF4aCA+Pj4gMTkpIHwgKGdhbW1hMXhsIDw8IDEzKSkgXiAoKGdhbW1hMXhoIDw8IDMpIHwgKGdhbW1hMXhsID4+PiAyOSkpIF4gKGdhbW1hMXhoID4+PiA2KTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExbCAgPSAoKGdhbW1hMXhsID4+PiAxOSkgfCAoZ2FtbWExeGggPDwgMTMpKSBeICgoZ2FtbWExeGwgPDwgMykgfCAoZ2FtbWExeGggPj4+IDI5KSkgXiAoKGdhbW1hMXhsID4+PiA2KSB8IChnYW1tYTF4aCA8PCAyNikpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gV1tpXSA9IGdhbW1hMCArIFdbaSAtIDddICsgZ2FtbWExICsgV1tpIC0gMTZdXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpNyAgPSBXW2kgLSA3XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2k3aCA9IFdpNy5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTdsID0gV2k3LmxvdztcblxuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaTE2ICA9IFdbaSAtIDE2XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2kxNmggPSBXaTE2LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpMTZsID0gV2kxNi5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2lsID0gZ2FtbWEwbCArIFdpN2w7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpaCA9IGdhbW1hMGggKyBXaTdoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMGwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBnYW1tYTFsO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWggPSBXaWggKyBnYW1tYTFoICsgKChXaWwgPj4+IDApIDwgKGdhbW1hMWwgPj4+IDApID8gMSA6IDApO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBXaWwgPSBXaWwgKyBXaTE2bDtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2loICsgV2kxNmggKyAoKFdpbCA+Pj4gMCkgPCAoV2kxNmwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgV2kuaGlnaCA9IFdpaDtcblx0ICAgICAgICAgICAgICAgICAgICBXaS5sb3cgID0gV2lsO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICB2YXIgY2hoICA9IChlaCAmIGZoKSBeICh+ZWggJiBnaCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgY2hsICA9IChlbCAmIGZsKSBeICh+ZWwgJiBnbCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqaCA9IChhaCAmIGJoKSBeIChhaCAmIGNoKSBeIChiaCAmIGNoKTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYWpsID0gKGFsICYgYmwpIF4gKGFsICYgY2wpIF4gKGJsICYgY2wpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwaCA9ICgoYWggPj4+IDI4KSB8IChhbCA8PCA0KSkgIF4gKChhaCA8PCAzMCkgIHwgKGFsID4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cdCAgICAgICAgICAgICAgICB2YXIgdDFoID0gdDFoICsgS2loICsgKCh0MWwgPj4+IDApIDwgKEtpbCA+Pj4gMCkgPyAxIDogMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgdDFsID0gdDFsICsgV2lsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQxaCA9IHQxaCArIFdpaCArICgodDFsID4+PiAwKSA8IChXaWwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyB0MiA9IHNpZ21hMCArIG1halxuXHQgICAgICAgICAgICAgICAgdmFyIHQybCA9IHNpZ21hMGwgKyBtYWpsO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyaCA9IHNpZ21hMGggKyBtYWpoICsgKCh0MmwgPj4+IDApIDwgKHNpZ21hMGwgPj4+IDApID8gMSA6IDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBVcGRhdGUgd29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgICAgIGhoID0gZ2g7XG5cdCAgICAgICAgICAgICAgICBobCA9IGdsO1xuXHQgICAgICAgICAgICAgICAgZ2ggPSBmaDtcblx0ICAgICAgICAgICAgICAgIGdsID0gZmw7XG5cdCAgICAgICAgICAgICAgICBmaCA9IGVoO1xuXHQgICAgICAgICAgICAgICAgZmwgPSBlbDtcblx0ICAgICAgICAgICAgICAgIGVsID0gKGRsICsgdDFsKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBlaCA9IChkaCArIHQxaCArICgoZWwgPj4+IDApIDwgKGRsID4+PiAwKSA/IDEgOiAwKSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZGggPSBjaDtcblx0ICAgICAgICAgICAgICAgIGRsID0gY2w7XG5cdCAgICAgICAgICAgICAgICBjaCA9IGJoO1xuXHQgICAgICAgICAgICAgICAgY2wgPSBibDtcblx0ICAgICAgICAgICAgICAgIGJoID0gYWg7XG5cdCAgICAgICAgICAgICAgICBibCA9IGFsO1xuXHQgICAgICAgICAgICAgICAgYWwgPSAodDFsICsgdDJsKSB8IDA7XG5cdCAgICAgICAgICAgICAgICBhaCA9ICh0MWggKyB0MmggKyAoKGFsID4+PiAwKSA8ICh0MWwgPj4+IDApID8gMSA6IDApKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIMGwgPSBIMC5sb3cgID0gKEgwbCArIGFsKTtcblx0ICAgICAgICAgICAgSDAuaGlnaCA9IChIMGggKyBhaCArICgoSDBsID4+PiAwKSA8IChhbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIMWwgPSBIMS5sb3cgID0gKEgxbCArIGJsKTtcblx0ICAgICAgICAgICAgSDEuaGlnaCA9IChIMWggKyBiaCArICgoSDFsID4+PiAwKSA8IChibCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIMmwgPSBIMi5sb3cgID0gKEgybCArIGNsKTtcblx0ICAgICAgICAgICAgSDIuaGlnaCA9IChIMmggKyBjaCArICgoSDJsID4+PiAwKSA8IChjbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBIM2wgPSBIMy5sb3cgID0gKEgzbCArIGRsKTtcblx0ICAgICAgICAgICAgSDMuaGlnaCA9IChIM2ggKyBkaCArICgoSDNsID4+PiAwKSA8IChkbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINGwgPSBINC5sb3cgID0gKEg0bCArIGVsKTtcblx0ICAgICAgICAgICAgSDQuaGlnaCA9IChINGggKyBlaCArICgoSDRsID4+PiAwKSA8IChlbCA+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgICAgICBINWwgPSBINS5sb3cgID0gKEg1bCArIGZsKTtcblx0ICAgICAgICAgICAgSDUuaGlnaCA9IChINWggKyBmaCArICgoSDVsID4+PiAwKSA8IChmbCA+Pj4gMCkgP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MDAwOiAweDgwODIwMixcblx0ICAgICAgICAgICAgMHg2MDAwMDAwMDogMHg4MDAyMDIsXG5cdCAgICAgICAgICAgIDB4NzAwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAwOiAweDIwMixcblx0ICAgICAgICAgICAgMHg5MDAwMDAwMDogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4YTAwMDAwMDA6IDB4ODIwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMDogMHg4MDgwMDAsXG5cdCAgICAgICAgICAgIDB4YzAwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhhODAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHhjODAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxMTAwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHgxMjAwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDAwMDAwMDogMHg0MDA4MD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gwMDAwMDogMHg4MDAxMCxcblx0ICAgICAgICAgICAgMHgxYzgwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwMDA6IDB4ODQwMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgyMDAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWQ6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFlOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFmOiAweDgwMjA4MDBcblx0ICAgICAgICB9XG5cdCAgICBdO1xuXG5cdCAgICAvLyBNYXNrcyB0aGF0IHNlbGVjdCB0aGUgU0JPWCBpbnB1dFxuXHQgICAgdmFyIFNCT1hfTUFTSyA9IFtcblx0ICAgICAgICAweGY4MDAwMDAxLCAweDFmODAwMDAwLCAweDAxZjgwMDAwLCAweDAwMWY4MDAwLFxuXHQgICAgICAgIDB4MDAwMWY4MDAsIDB4MDAwMDFmODAsIDB4MDAwMDAxZjgsIDB4ODAwMDAwMWZcblx0ICAgIF07XG5cblx0ICAgIC8qKlxuXHQgICAgICogREVTIGJsb2NrIGNpcGhlciBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBERVMgPSBDX2FsZ28uREVTID0gQmxvY2tDaXBoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGtleSA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFNlbGVjdCA1NiBiaXRzIGFjY29yZGluZyB0byBQQzFcblx0ICAgICAgICAgICAgdmFyIGtleUJpdHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qml0UG9zID0gUEMxW2ldIC0gMTtcblx0ICAgICAgICAgICAgICAgIGtleUJpdHNbaV0gPSAoa2V5V29yZHNba2V5Qml0UG9zID4+PiA1XSA+Pj4gKDMxIC0ga2V5Qml0UG9zICUgMzIpKSAmIDE7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgd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0ICAgICAgICAgICAgICAgIHZhciBsQmxvY2sgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgICAgICB2YXIgckJsb2NrID0gdGhpcy5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFVuZG8gc3dhcCBmcm9tIGxhc3Qgcm91bmRcblx0ICAgICAgICAgICAgdmFyIHQgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHRoaXMuX3JCbG9jaztcblx0ICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gdDtcblxuXHQgICAgICAgICAgICAvLyBGaW5hbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUx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G5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBvcmVkID0geDY0V29yZC5vcihhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gb3I6IGZ1bmN0aW9uICh3b3JkKSB7XG5cdCAgICAgICAgICAgIC8vIHZhciBoaWdoID0gdGhpcy5oaWdoIHwgd29yZC5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5sb3cgfCB3b3JkLmxvdztcblxuXHQgICAgICAgICAgICAvLyByZXR1cm4gWDY0V29yZC5jcmVhdGUoaGlnaCwgbG93KTtcblx0ICAgICAgICAvLyB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQml0d2lzZSBYT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gWE9SIHdpdGggdGhpcyB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIFhPUmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHhvcmVkID0geDY0V29yZC54b3IoYW5vdGhlclg2NFdvcmQpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIC8vIHhvcjogZnVuY3Rpb24gKHdvcmQpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB0aGlzLmhpZ2ggXiB3b3JkLmhpZ2g7XG5cdCAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmxvdyBeIHdvcmQubG93O1xuXG5cdCAgICAgICAgICA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XIgb2YgYml0cyB0byByb3RhdGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgcm90YXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciByb3RhdGVkID0geDY0V29yZC5yb3RMKDI1KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RMOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdEwobikub3IodGhpcy5zaGlmdFIoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3N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mF5LlxuXHQgICAgICovXG5cdCAgICB2YXIgWDY0V29yZEFycmF5ID0gQ194NjQuV29yZEFycmF5ID0gQmFzZS5leHRlbmQoe1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEluaXRpYWxpemVzIGEgbmV3bHkgY3JlYXRlZCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgKE9wdGlvbmFsKSBBbiBhcnJheSBvZiBDcnlwdG9KUy54NjQuV29yZCBvYmplY3RzLlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBzaWdCeXRlcyAoT3B0aW9uYWwpIFRoZSBudW1iZXIgb2Ygc2lnbmlmaWNhbnQgYnl0ZXMgaW4gdGhlIHdvcmRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY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gICAgIHNlYXJjaFBhcmFtczogJ1VSTFNlYXJjaFBhcmFtcycgaW4gc2VsZixcbiAgICAgICAgICBpdGVyYWJsZTogJ1N5bWJvbCcgaW4gc2VsZiAmJiAnaXRlcmF0b3InIGluIFN5bWJvbCxcbiAgICAgICAgICBibG9iOiAnRmlsZVJlYWRlcicgaW4gc2VsZiAmJiAnQmxvYicgaW4gc2VsZiAmJiAoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICBuZXcgQmxvYigpXG4gICAgICAgICAgICAgIHJldHVybiB0cnVlXG4gICAgICAgICAgICB9IGNhdGNoKGUpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSkoKSxcbiAgICAgICAgICBmb3JtRGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgICAgICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgd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aW9uKCkge1xuICAgICAgICAgIHZhciBpdGVtcyA9IFtdXG4gICAgICAgICAgdGhpcy5mb3JFYWNoKGZ1bmN0aW9uKHZhbHVlLCBuYW1lKSB7IGl0ZW1zLnB1c2goW25hbWUsIHZhbHVlXSkgfSlcbiAgICAgICAgICByZXR1cm4gaXRlcmF0b3JGb3IoaXRlbXMpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc3VwcG9ydC5pdGVyYWJsZSkge1xuICAgICAgICAgIEhlYWRlcnMucHJvdG90eXBlW1N5bWJvbC5pdGVyYXRvcl0gPSBIZWFkZXJzLnByb3RvdHlwZS5lbnRyaWVzXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBjb25zdW1lZChib2R5KSB7XG4gICAgICAgICAgaWYgKGJvZHkuYm9keVVzZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICA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YgVVJMU2VhcmNoUGFyYW1zLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpc1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSFRUUCBtZXRob2RzIHdob3NlIGNhcGl0YWxpemF0aW9uIHNob3VsZCBiZSBub3JtYWxpemVkXG4gICAgICAgIHZhciBtZXRob2RzID0gWydERUxFVEUnLCAnR0VUJywgJ0hFQUQnLCAnT1BUSU9OUycsICdQT1NUJywgJ1BVVCddXG5cbiAgICAgICAgZnVuY3Rpb24gbm9ybWFsaXplTWV0aG9kKG1ldGhvZCkge1xuICAgICAgICAgIHZhciB1cGNhc2VkID0gbWV0aG9kLnRvVXBwZXJDYXNlKClcbiAgICAgICAgICByZXR1cm4gKG1ldGhvZHMuaW5kZXhPZih1cGNhc2VkKSA+IC0xKSA/IHVwY2FzZWQgOiBtZXRob2RcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIFJlcXVlc3QoaW5wdXQsIG9wdGlvbnMpIHtcbiAgICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fVxuICAgICAgICAgIHZhciBib2R5ID0gb3B0aW9ucy5ib2R5XG5cbiAgICAgICAgICBpZiAoaW5wdXQgaW5zdGFuY2VvZiBSZXF1ZXN0KSB7XG4gICAgICAgICAgICBpZiAoaW5wdXQuYm9keVVzZWQpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQWxyZWFkeSByZWFkJylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudXJsID0gaW5wdXQudXJsXG4gICAgICAgICAgICB0aGlzLmNyZWRlbnRpYWxzID0gaW5wdXQuY3JlZGVudGlhbHNcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKGlucHV0LmhlYWRlcnMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLm1ldGhvZCA9IGlucHV0Lm1ldGhvZFxuICAgICAgICAgICAgdGhpcy5tb2RlID0gaW5wdXQubW9kZVxuICAgICAgICAgICAgaWYgKCFib2R5ICYmIGlucHV0Ll9ib2R5SW5pdCAhPSBudWxsKSB7XG4gICAgICAgICAgICAgIGJvZHkgPSBpbnB1dC5fYm9keUluaXRcbiAgICAgICAgICAgICAgaW5wdXQuYm9keVVzZWQgPSB0cnVlXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudXJsID0gU3RyaW5nKGlucHV0KVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuY3JlZGVudGlhbHMgPSBvcHRpb25zLmNyZWRlbnRpYWxzIHx8IHRoaXMuY3JlZGVudGlhbHMgfHwgJ29taXQnXG4gICAgICAgICAgaWYgKG9wdGlvbnMuaGVhZGVycyB8fCAhdGhpcy5oZWFkZXJzKSB7XG4gICAgICAgICAgICB0aGlzLmhlYWRlcnMgPSBuZXcgSGVhZGVycyhvcHRpb25zLmhlYWRlcnMpXG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMubWV0aG9kID0gbm9ybWFsaXplTWV0aG9kKG9wdGlvbnMubWV0aG9kIHx8IHRoaXMubWV0aG9kIHx8ICdHRVQnKVxuICAgICAgICAgIHRoaXMubW9kZSA9IG9wdGlvbnMubW9kZSB8fCB0aGlzLm1vZGUgfHwgbnVsbFxuICAgICAgICAgIHRoaXMucmVmZXJyZXIgPSBudWxsXG5cbiAgICAgICAgICBpZiAoKHRoaXMubWV0aG9kID09PSAnR0VUJyB8fCB0aGlzLm1ldGhvZCA9PT0gJ0hFQUQnKSAmJiBib2R5KSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdCb2R5IG5vdCBhbGxvd2VkIGZvciBHRVQgb3IgSEVBRCByZXF1ZXN0cycpXG4gICAgICAgICAgfVxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5KGJvZHkpXG4gICAgICAgIH1cblxuICAgICAgICBSZXF1ZXN0LnByb3RvdHlwZS5jbG9uZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGhlYWRlcnNcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICAgICAgICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgICAgICAgIGlmICghb3B0aW9ucykge1xuICAgICAgICAgICAgb3B0aW9ucyA9IHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgICAgICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICAgICAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgICAgICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgICAgICAgdGhpcy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ogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB4aHIub3BlbihyZXF1ZXN0Lm1ldGhvZCwgcmVxdWVzdC51cmwsIHRydWUpXG5cbiAgICAgICAgICAgIGlmIChyZXF1ZXN0LmNyZWRlbnRpYWxzID09PSAnaW5jbHVkZScpIHtcbiAgICAgICAgICAgICAgeGhyLndpdGhDcmVkZW50aWFscyA9IHRydWVcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCdyZXNwb25zZVR5cGUnIGluIHhociAmJiBzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgICAgeGhyLnJlc3BvbnNlVHlwZSA9ICdibG9iJ1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICByZXF1ZXN0LmhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkge1xuICAgICAgICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcihuYW1lLCB2YWx1ZSlcbiAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgIHhoci5zZW5kKHR5cGVvZiByZXF1ZXN0Ll9ib2R5SW5pdCA9PT0gJ3VuZGVmaW5lZCcgPyBudWxsIDogcmVxdWVzdC5fYm9keUluaXQpXG4gICAgICAgICAgfSlcbiAg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IHZhbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAg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CBvdmVyd3JpdGUgb2JqZWN0IHByb3RvdHlwZSBwcm9wZXJ0aWVzXG4gICAgICAgIGlmICghb3B0aW9ucy5wbGFpbk9iamVjdHMgJiYgaGFzLmNhbGwoT2JqZWN0LnByb3RvdHlwZSwgcGFyZW50KSkge1xuICAgICAgICAgICAgaWYgKCFvcHRpb25zLmFsbG93UHJvdG90eXBlcykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMucHVzaChwYXJlbnQpO1xuICAgIH1cblxuICAgIC8vIExvb3AgdGhyb3VnaCBjaGlsZHJlbiBhcHBlbmRpbmcgdG8gdGhlIGFycmF5IHVudGlsIHdlIGhpdCBkZXB0aFxuXG4gICAgdmFyIGkgPSAwO1xuICAgIHdoaWxlICgoc2VnbWVudCA9IGNoaWxkLmV4ZWMoa2V5KSkgIT09IG51bGwgJiYgaSA8IG9wdGlvbnMuZGVwdGgpIHtcbiAgICAgICAgaSArPSAxO1xuICAgICAgICBpZiAoIW9wdGlvbnMucGxhaW5PYmplY3RzICYmIGhhcy5jYWxsKE9iamVjdC5wcm90b3R5cGUsIHNlZ21lbnRbMV0uc2xpY2UoMSwgLTEpKSkge1xuICAgICAgICAgICAgaWYgKCFvcHRpb25zLmFsbG93UHJvdG90eXBlcykge1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBrZXlzLnB1c2goc2VnbWVudFsxXSk7XG4gICAgfVxuXG4gICAgLy8gSWYgdGhlcmUncyBhIHJlbWFpbmRlciwganVzdCBhZGQgd2hhdGV2ZXIgaXMgbGVmdFxuXG4gICAgaWYgKHNlZ21lbnQpIHtcbiAgICAgICAga2V5cy5wdXNoKCdbJyArIGtleS5zbGljZShzZWdtZW50LmluZGV4KSArICddJyk7XG4gICAgfVxuXG4gICAgcmV0dXJuIHBhcnNlT2JqZWN0KGtleXMsIHZhbCwgb3B0a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IHJldHVybiB2YWx1ZXM7XG4gICAgfVxuXG4gICAgdmFyIG9iaktleXM7XG4gICAgaWYgKEFycmF5LmlzQXJyYXkoZmlsdGVyKSkge1xuICAgICAgICBvYmpLZXlzID0gZmlsdGVyO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHZhciBrZXlzID0gT2JqZWN0LmtleXMob2JqKTtcbiAgICAgICAgb2JqS2V5cyA9IHNvcnQgPyBrZXlzLnNvcnQoc29ydCkgOiBrZXlzO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiB2YWx1ZXM7XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvYmplY3QsIG9wdHMpIHtcbiAgICB2YXIgb2JqID0gb2JqZWN0O1xuICAgIHZhciBvcHRpb25zID0gb3B0cyA/IHV0aWxzLmFzc2lnbih7fSwgb3B0cykgOiB7fTtcblxuICAgIGlmIChvcHRpb25zLmVuY29kZXIgIT09IG51bGwgJiYgb3B0aW9ucy5lbmNvZGVyICE9PSB1bmRlZmluZWQgJiYgdHlwZW9mIG9wdGlvbnMuZW5jb2RlciAhPT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKCdFbmNvZGVyIGhhcyB0byBiZSBhIGZ1bmN0aW9uLicpO1xuICAgIH1cblxuICAgIHZhciBkZWxpbWl0ZXIgPSB0eXBlb2Ygb3B0aW9ucy5kZWxpbWl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B0aW9ucy5hcnJheUZvcm1hdCBpbiBhcnJheVByZWZpeEdlbmVyYXRvcnMpIHtcbiAgICAgICAgYXJyYXlGb3JtYXQgPSBvcHRpb25zLmFycmF5Rm9ybWF0O1xuICAgIH0gZWxzZSBpZiAoJ2luZGljZXMnIGluIG9wdGlvbnMpIHtcbiAgICAgICAgYXJyYXlGb3JtYXQgPSBvcHRpb25zLmluZGljZXMgPyAnaW5kaWNlcycgOiAncmVwZWF0JztcbiAgICB9IGVsc2Uge1xuICAgICAgICBhcnJheUZvcm1hdCA9ICdpbmRpY2VzJztcbiAgICB9XG5cbiAgICB2YXIgZ2VuZXJhdGVBcnJheVByZWZpeCA9IGFycmF5UHJlZml4R2VuZXJhdG9yc1thcnJheUZvcm1hdF07XG5cbiAgICBpZiAoIW9iaktleXMpIHtcbiAgICAgICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgfVxuXG4gICAgaWYgKHNvcnQpIHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbi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bSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRbaV0gPSBpdGVtO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgICAgcmV0dXJuIHRhcmdldDtcbiAgICB9XG5cbiAgICByZXR1cm4gT2JqZWN0LmtleXMoc291cmNlKS5yZWR1Y2UoZnVuY3Rpb24gKGFjYywga2V5KSB7XG4gICAgICAgIHZhciB2YWx1ZSA9IHNvdXJjZVtrZXldO1xuXG4gICAgICAgIGlmIChoYXMuY2FsbChhY2MsIGtleSkpIHtcbiAgICAgICAgICAgIGFjY1trZXldID0gZXhwb3J0cy5tZXJnZShhY2Nba2V5XSwgdmFsdWUsIG9wdGlvbnMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYWNjW2tleV0gPSB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gYWNjO1xuICAgIH0sIG1lcmdlVGFyZ2V0KTtcbn07XG5cbmV4cG9ydHMuYXNzaWduID0gZnVuY3Rpb24gYXNzaWduU2luZ2xlU291cmNlKHRhcmdldCwgc291cmNlKSB7XG4gICAgcmV0dXJuIE9iamVjdC5rZXlzKHNvdXJjZSkucmVkdWNlKGZ1bmN0aW9uIChhY2MsIGtleSkge1xuICAgICAgICBhY2Nba2V5XSA9IHNvdXJjZVtrZXldO1xuICAgICAgICByZXR1cm4gYWNjO1xuICAgIH0sIHRhcmdldCk7XG59O1xuXG5leHBvcnRzLmRlY29kZSA9IGZ1bmN0aW9uIChzdHIpIHtcbiAgICB0cnkge1xuICAgICAgICByZXR1cm4gZGVjb2RlVVJJQ29tcG9uZW50KHN0ci5yZXBsYWNlKC9cXCsvZywgJyAnKSk7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgICByZXR1cm4gc3RyO1xuICAgIH1cbn07XG5cbmV4cG9ydHMuZW5jb2RlID0gZnVuY3Rpb24gZW5jb2RlKHN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uICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 diff --git a/ccxt.js b/ccxt.js index 5048aecfd37c..833efaefe73d 100644 --- a/ccxt.js +++ b/ccxt.js @@ -37,7 +37,7 @@ const Exchange = require ('./js/base/Exchange') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.13.142' +const version = '1.13.143' Exchange.ccxtVersion = version diff --git a/package.json b/package.json index 1d6f46179390..7a31ed35c9c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.13.142", + "version": "1.13.143", "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ exchanges", "main": "./ccxt.js", "unpkg": "build/ccxt.browser.js", diff --git a/php/Exchange.php b/php/Exchange.php index 5e0b15849b29..67470415f963 100644 --- a/php/Exchange.php +++ b/php/Exchange.php @@ -30,7 +30,7 @@ namespace ccxt; -$version = '1.13.142'; +$version = '1.13.143'; // rounding mode const TRUNCATE = 0; diff --git a/php/cobinhood.php b/php/cobinhood.php index e8b566bf8c5e..ced922a0441a 100644 --- a/php/cobinhood.php +++ b/php/cobinhood.php @@ -127,6 +127,9 @@ public function describe () { 'amount' => 8, 'price' => 8, ), + 'exceptions' => array ( + 'insufficient_balance' => '\\ccxt\\InsufficientFunds', + ), )); } @@ -560,7 +563,12 @@ public function handle_errors ($code, $reason, $url, $method, $headers, $body) { throw new ExchangeError ($this->id . ' ' . $body); } $response = json_decode ($body, $as_associative_array = true); - $message = $this->safe_value($response['error'], 'error_code'); - throw new ExchangeError ($this->id . ' ' . $message); + $error_code = $this->safe_value($response['error'], 'error_code'); + $feedback = $this->id . ' ' . $this->json ($response); + $exceptions = $this->exceptions; + if (is_array ($exceptions) && array_key_exists ($error_code, $exceptions)) { + throw new $exceptions[$code] ($feedback); + } + throw new ExchangeError ($feedback); } } diff --git a/php/coinegg.php b/php/coinegg.php index c53bc4d7e81c..2497afb2052e 100644 --- a/php/coinegg.php +++ b/php/coinegg.php @@ -247,7 +247,7 @@ public function fetch_ticker ($symbol, $params = array ()) { public function fetch_tickers ($symbols = null, $params = array ()) { $this->load_markets(); - $quoteIds = array ( 'btc', 'usc' ); + $quoteIds = $this->options['quoteIds']; $result = array (); for ($b = 0; $b < count ($quoteIds); $b++) { $quoteId = $quoteIds[$b]; diff --git a/php/lbank.php b/php/lbank.php index 8e06b8738e69..eade922f93a7 100644 --- a/php/lbank.php +++ b/php/lbank.php @@ -168,7 +168,7 @@ public function parse_ticker ($ticker, $market = null) { 'percentage' => null, 'average' => null, 'baseVolume' => $this->safe_float($ticker, 'vol'), - 'quoteVolume' => null, + 'quoteVolume' => $this->safe_float($ticker, 'turnover'), 'info' => $info, ); } diff --git a/python/ccxt/__init__.py b/python/ccxt/__init__.py index 9fae974c2b53..1d607b75c19a 100644 --- a/python/ccxt/__init__.py +++ b/python/ccxt/__init__.py @@ -22,7 +22,7 @@ # ---------------------------------------------------------------------------- -__version__ = '1.13.142' +__version__ = '1.13.143' # ---------------------------------------------------------------------------- diff --git a/python/ccxt/async/__init__.py b/python/ccxt/async/__init__.py index 4042c5fb0d19..3910ee4d2417 100644 --- a/python/ccxt/async/__init__.py +++ b/python/ccxt/async/__init__.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.13.142' +__version__ = '1.13.143' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/base/exchange.py b/python/ccxt/async/base/exchange.py index f725918c5d89..94fb3346dbd8 100644 --- a/python/ccxt/async/base/exchange.py +++ b/python/ccxt/async/base/exchange.py @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.13.142' +__version__ = '1.13.143' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/cobinhood.py b/python/ccxt/async/cobinhood.py index eea9b6445eb8..00092f48bfa1 100644 --- a/python/ccxt/async/cobinhood.py +++ b/python/ccxt/async/cobinhood.py @@ -6,6 +6,7 @@ from ccxt.async.base.exchange import Exchange import json from ccxt.base.errors import ExchangeError +from ccxt.base.errors import InsufficientFunds class cobinhood (Exchange): @@ -128,6 +129,9 @@ def describe(self): 'amount': 8, 'price': 8, }, + 'exceptions': { + 'insufficient_balance': InsufficientFunds, + }, }) async def fetch_currencies(self, params={}): @@ -527,5 +531,9 @@ def handle_errors(self, code, reason, url, method, headers, body): if body[0] != '{': raise ExchangeError(self.id + ' ' + body) response = json.loads(body) - message = self.safe_value(response['error'], 'error_code') - raise ExchangeError(self.id + ' ' + message) + error_code = self.safe_value(response['error'], 'error_code') + feedback = self.id + ' ' + self.json(response) + exceptions = self.exceptions + if error_code in exceptions: + raise exceptions[code](feedback) + raise ExchangeError(feedback) diff --git a/python/ccxt/async/coinegg.py b/python/ccxt/async/coinegg.py index 90d46f471f28..f69016789fd8 100644 --- a/python/ccxt/async/coinegg.py +++ b/python/ccxt/async/coinegg.py @@ -257,7 +257,7 @@ async def fetch_ticker(self, symbol, params={}): async def fetch_tickers(self, symbols=None, params={}): await self.load_markets() - quoteIds = ['btc', 'usc'] + quoteIds = self.options['quoteIds'] result = {} for b in range(0, len(quoteIds)): quoteId = quoteIds[b] diff --git a/python/ccxt/async/lbank.py b/python/ccxt/async/lbank.py index 9cfcd9d88b6c..998c6ce515fc 100644 --- a/python/ccxt/async/lbank.py +++ b/python/ccxt/async/lbank.py @@ -169,7 +169,7 @@ def parse_ticker(self, ticker, market=None): 'percentage': None, 'average': None, 'baseVolume': self.safe_float(ticker, 'vol'), - 'quoteVolume': None, + 'quoteVolume': self.safe_float(ticker, 'turnover'), 'info': info, } diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index a5e776c5c52f..1845d85cb117 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.13.142' +__version__ = '1.13.143' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/cobinhood.py b/python/ccxt/cobinhood.py index 06507988f90e..3c4299d7f618 100644 --- a/python/ccxt/cobinhood.py +++ b/python/ccxt/cobinhood.py @@ -6,6 +6,7 @@ from ccxt.base.exchange import Exchange import json from ccxt.base.errors import ExchangeError +from ccxt.base.errors import InsufficientFunds class cobinhood (Exchange): @@ -128,6 +129,9 @@ def describe(self): 'amount': 8, 'price': 8, }, + 'exceptions': { + 'insufficient_balance': InsufficientFunds, + }, }) def fetch_currencies(self, params={}): @@ -527,5 +531,9 @@ def handle_errors(self, code, reason, url, method, headers, body): if body[0] != '{': raise ExchangeError(self.id + ' ' + body) response = json.loads(body) - message = self.safe_value(response['error'], 'error_code') - raise ExchangeError(self.id + ' ' + message) + error_code = self.safe_value(response['error'], 'error_code') + feedback = self.id + ' ' + self.json(response) + exceptions = self.exceptions + if error_code in exceptions: + raise exceptions[code](feedback) + raise ExchangeError(feedback) diff --git a/python/ccxt/coinegg.py b/python/ccxt/coinegg.py index d1849151c2b7..d6d0249d0cb6 100644 --- a/python/ccxt/coinegg.py +++ b/python/ccxt/coinegg.py @@ -257,7 +257,7 @@ def fetch_ticker(self, symbol, params={}): def fetch_tickers(self, symbols=None, params={}): self.load_markets() - quoteIds = ['btc', 'usc'] + quoteIds = self.options['quoteIds'] result = {} for b in range(0, len(quoteIds)): quoteId = quoteIds[b] diff --git a/python/ccxt/lbank.py b/python/ccxt/lbank.py index 57ac2c017717..a1d431494774 100644 --- a/python/ccxt/lbank.py +++ b/python/ccxt/lbank.py @@ -169,7 +169,7 @@ def parse_ticker(self, ticker, market=None): 'percentage': None, 'average': None, 'baseVolume': self.safe_float(ticker, 'vol'), - 'quoteVolume': None, + 'quoteVolume': self.safe_float(ticker, 'turnover'), 'info': info, }