diff --git a/build/ccxt.browser.js b/build/ccxt.browser.js index de2ec0fd8108..4af6d75dbdb8 100644 --- a/build/ccxt.browser.js +++ b/build/ccxt.browser.js @@ -45,7 +45,7 @@ const errors = require ('./js/base/errors') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.10.528' +const version = '1.10.529' Exchange.ccxtVersion = version @@ -5965,7 +5965,7 @@ module.exports = class bithumb extends Exchange { 'currency': market['id'], 'units': amount, }; - method += 'Market' + this.capitalise (side); + method += 'Market' + this.capitalize (side); } let response = await this[method] (this.extend (request, params)); let id = undefined; @@ -36769,4 +36769,4 @@ exports.isBuffer = function isBuffer(obj) { }; },{}]},{},[1]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjY3h0LmJyb3dzZXIuanMiLCJjY3h0LmpzIiwianMvXzFicm9rZXIuanMiLCJqcy9fMWJ0Y3hlLmpzIiwianMvYWN4LmpzIiwianMvYWxsY29pbi5qcyIsImpzL2FueHByby5qcyIsImpzL2Jhc2UvRXhjaGFuZ2UuanMiLCJqcy9iYXNlL01hcmtldC5qcyIsImpzL2Jhc2UvZXJyb3JzLmpzIiwianMvYmFzZS9mdW5jdGlvbnMuanMiLCJqcy9iYXNlL3Rocm90dGxlLmpzIiwianMvYmluYW5jZS5qcyIsImpzL2JpdDJjLmpzIiwianMvYml0YmF5LmpzIiwianMvYml0Y29pbmNvaWQuanMiLCJqcy9iaXRmaW5leC5qcyIsImpzL2JpdGZpbmV4Mi5qcyIsImpzL2JpdGZseWVyLmpzIiwianMvYml0aHVtYi5qcyIsImpzL2JpdGxpc2guanMiLCJqcy9iaXRtYXJrZXQuanMiLCJqcy9iaXRtZXguanMiLCJqcy9iaXRzby5qcyIsImpzL2JpdHN0YW1wLmpzIiwianMvYml0c3RhbXAxLmpzIiwianMvYml0dHJleC5qcyIsImpz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XInOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9fMWJyb2tlci5qcycpLFxuICAgICdfMWJ0Y3hlJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL18xYnRjeGUuanMnKSxcbiAgICAnYWN4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9hY3guanMnKSxcbiAgICAnYWxsY29pbic6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9hbGxjb2luLmpzJyksXG4gICAgJ2FueHBybyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYW54cHJvLmpzJyksXG4gICAgJ2JpbmFuY2UnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmluYW5jZS5qcycpLFxuICAgICdiaXQyYyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdDJjLmpzJyksXG4gICAgJ2JpdGJheSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0YmF5LmpzJyksXG4gICAgJ2JpdGNvaW5jb2lkJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Y29pbmNvaWQuanMnKSxcbiAgICAnYml0ZmluZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRmaW5leC5qcycpLFxuICAgICdiaXRmaW5leDInOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4Mi5qcycpLFxuICAgICdiaXRmbHllcic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZseWVyLmpzJyksXG4gICAgJ2JpdGh1bWInOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0aHVtYi5qcycpLFxuICAgICdiaXRsaXNoJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGxpc2guanMnKSxcbiAgICAnYml0bWFya2V0JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtYXJrZXQuanMnKSxcbiAgICAnYml0bWV4JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtZXguanMnKSxcbiAgICAnYml0c28nOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzby5qcycpLFxuICAgICdiaXRzdGFtcCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wLmpzJyksXG4gICAgJ2JpdHN0YW1wMSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c3RhbXAxLmpzJyksXG4gICAgJ2JpdHRyZXgnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0dHJleC5qcycpLFxuICAgICdibDNwJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsM3AuanMnKSxcbiAgICAnYmxldXRyYWRlJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ibGV1dHJhZGUuanMnKSxcbiAgICAnYnRjYm94JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNib3guanMnKSxcbiAgICAnYnRjY2hpbmEnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNjaGluYS5qcycpLFxuICAgICdidGNleGNoYW5nZSc6ICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2V4Y2hhbmdlLmpzJyksXG4gICAgJ2J0Y21hcmtldHMnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjbWFya2V0cy5qcycpLFxuICAgICdidGN0cmFkZXVhJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3RyYWRldWEuanMnKSxcbiAgICAnYnRjdHVyayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0dXJrLmpzJyksXG4gICAgJ2J0Y3gnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjeC5qcycpLFxuICAgICdidGVyJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0ZXIuanMnKSxcbiAgICAnYnhpbnRoJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ieGludGguanMnKSxcbiAgICAnY2NleCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jY2V4LmpzJyksXG4gICAgJ2NleCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2V4LmpzJyksXG4gICAgJ2NoYnRjJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2hidGMuanMnKSxcbiAgICAnY2hpbGViaXQnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGlsZWJpdC5qcycpLFxuICAgICdjb2luY2hlY2snOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5jaGVjay5qcycpLFxuICAgICdjb2luZmxvb3InOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5mbG9vci5qcycpLFxuICAgICdjb2luZ2knOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5naS5qcycpLFxuICAgICdjb2lubWFya2V0Y2FwJzogICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXJrZXRjYXAuanMnKSxcbiAgICAnY29pbm1hdGUnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lubWF0ZS5qcycpLFxuICAgICdjb2luc2VjdXJlJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zZWN1cmUuanMnKSxcbiAgICAnY29pbnNwb3QnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luc3BvdC5qcycpLFxuICAgICdjcnlwdG9waWEnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NyeXB0b3BpYS5qcycpLFxuICAgICdkc3gnOiAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2RzeC5qcycpLFxuICAgICdleG1vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2V4bW8uanMnKSxcbiAgICAnZmxvd2J0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9mbG93YnRjLmpzJyksXG4gICAgJ2ZveGJpdCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZm94Yml0LmpzJyksXG4gICAgJ2Z5YnNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2UuanMnKSxcbiAgICAnZnlic2cnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9meWJzZy5qcycpLFxuICAgICdnYXRlY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVjb2luLmpzJyksXG4gICAgJ2dhdGVpbyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2F0ZWlvLmpzJyksXG4gICAgJ2dkYXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2RheC5qcycpLFxuICAgICdnZW1pbmknOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dlbWluaS5qcycpLFxuICAgICdnZXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dldGJ0Yy5qcycpLFxuICAgICdoaXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0Yy5qcycpLFxuICAgICdoaXRidGMyJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0YzIuanMnKSxcbiAgICAnaHVvYmknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaS5qcycpLFxuICAgICdodW9iaWNueSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpY255LmpzJyksXG4gICAgJ2h1b2JpcHJvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmlwcm8uanMnKSxcbiAgICAnaW5kZXBlbmRlbnRyZXNlcnZlJzogICAgICByZXF1aXJlICgnLi9qcy9pbmRlcGVuZGVudHJlc2VydmUuanMnKSxcbiAgICAnaXRiaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pdGJpdC5qcycpLFxuICAgICdqdWJpJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2p1YmkuanMnKSxcbiAgICAna3Jha2VuJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rcmFrZW4uanMnKSxcbiAgICAna3Vjb2luJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdWNvaW4uanMnKSxcbiAgICAna3VuYSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdW5hLmpzJyksXG4gICAgJ2xha2VidGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGFrZWJ0Yy5qcycpLFxuICAgICdsaXF1aSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xpcXVpLmpzJyksXG4gICAgJ2xpdmVjb2luJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGl2ZWNvaW4uanMnKSxcbiAgICAnbHVubyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9sdW5vLmpzJyksXG4gICAgJ21lcmNhZG8nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbWVyY2Fkby5qcycpLFxuICAgICdtaXhjb2lucyc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL21peGNvaW5zLmpzJyksXG4gICAgJ25vdmEnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbm92YS5qcycpLFxuICAgICdva2NvaW5jbnknOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rY29pbmNueS5qcycpLFxuICAgICdva2NvaW51c2QnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rY29pbnVzZC5qcycpLFxuICAgICdva2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rZXguanMnKSxcbiAgICAncGF5bWl1bSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9wYXltaXVtLmpzJyksXG4gICAgJ3BvbG9uaWV4JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcG9sb25pZXguanMnKSxcbiAgICAncXJ5cHRvcyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xcnlwdG9zLmpzJyksXG4gICAgJ3F1YWRyaWdhY3gnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXVhZHJpZ2FjeC5qcycpLFxuICAgICdxdW9pbmUnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3F1b2luZS5qcycpLFxuICAgICdzb3V0aHhjaGFuZ2UnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3NvdXRoeGNoYW5nZS5qcycpLFxuICAgICdzdXJiaXRjb2luJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3N1cmJpdGNvaW4uanMnKSxcbiAgICAndGhlcm9jayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aGVyb2NrLmpzJyksXG4gICAgJ3RpZGV4JzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdGlkZXguanMnKSxcbiAgICAndXJkdWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy91cmR1Yml0LmpzJyksXG4gICAgJ3ZhdWx0b3JvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmF1bHRvcm8uanM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gIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MDIxLTQyMGJkOWZjLTVlY2ItMTFlNy04ZWQ2LTU2ZDAwODFlZmVkMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly8xYnJva2VyLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly8xYnJva2VyLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFicm9rZXIuY29tLz9jPWVuL2NvbnRlbnQvYXBpLWRvY3VtZW50YXRpb24nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9iYXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvY2F0ZWdvcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvcXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2VfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9zaGFyZWQvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzb2NpYWwvcHJvZmlsZV9zdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzb2NpYWwvcHJvZmlsZV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vdmVydmlldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9xdW90YV9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvdHJhbnNhY3Rpb25fbG9nJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDYXRlZ29yaWVzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWFya2V0Q2F0ZWdvcmllcyAoKTtcbiAgICAgICAgLy8gdGhleSByZXR1cm4gYW4gZW1wdHkgc3RyaW5nIGFtb25nIHRoZWlyIGNhd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ICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAoKGNhdGVnb3J5ID09ICdGT1JFWCcpIHx8IChjYXRlZ29yeSA9PSAnQ1JZUFRPJykpIHtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0cyA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgcXVvdGUgPSAnVVNEJztcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXNfLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAn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lzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0TWFya2V0QmFycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3Jlc29sdXRpb24nOiA2MCxcbiAgICAgICAgICAgICdsaW1pdCc6IDEsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5mZXRjaE9yZGVyQm9vayAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3VsdFsncmVzcG9uc2UnXVswXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0aWNrZXJbJ2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbCddKSxcbiAgICAgICAgICAgICdiaWQnOiBvcmRlcmJvb2tbJ2JpZHMnXVswXVswXSxcbiAgICAgICAgICAgICdhc2snOiBvcmRlcmJvb2tbJ2Fza3MnXVswXVswXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ28nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2MnXSksXG4gICAgICAgICAgICAnZmlyc3QnOiB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jb20vYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcmljYWwtcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzLWFuZC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci10cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidGMtZGVwb3NpdC1hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9uZ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WNlcyddLCAncmVxdWVzdF9jdXJyZW5jeScpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAob2hsY3ZzLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ21ha2VyX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYW5zYWN0aW9ucyAodGhpcy5leHRlbmQ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ICAgICAgICAgICdpZCc6ICdhY3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQUNYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQVUnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzJoJzogJzEyMCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICc3MjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnNDMyMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwMjQ3NjE0LTFmZTYxYzc0LTk2MjEtMTFlNy05ZThjLWYxYTYyN2FmYTI3OS5qcGcnLFxuICAgICAgICAgICAgICAgICdleHRlbnNpb24nOiAnLmpzb24nLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hY3guaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYWN4LmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYWN4LmlvL2RvY3VtZW50cy9hcGlfdjInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJywgLy8gR2V0IGFsbCBhdmFpbGFibGUgbWFya2V0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLCAvLyBHZXQgdGlja2VyIG9mIGFsbCBtYXJrZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97bWFya2V0fScsIC8vIEdldCB0aWNrZXIgb2Ygc3BlY2lmaWMgbWFya2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJywgLy8gR2V0IHJlY2VudCB0cmFkZXMgb24gbWFya2V0LCBlYWNoIHRyYWRlIGlzIGluY2x1ZGVkIG9ubHkgb25jZSBUcmFkZXMgYXJlIHNvcnRlZCBpbiByZXZlcnNlIGNyZWF0aW9uIG9yZGVyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLCAvLyBHZXQgdGhlIG9yZGVyIGJvb2sgb2Ygc3BlY2lmaWVkIG1hcmtldFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJywgLy8gR2V0IGRlcHRoIG9yIHNwZWNpZmllZCBtYXJrZXQgQm90aCBhc2tzIGFuZCBiaWRzIGFyZSBzb3J0ZWQgZnJvbSBoaWdoZXN0IHByaWNlIHRvIGxvd2VzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdrJywgLy8gR2V0IE9ITEMoayBsaW5lKSBvZiBzcGVjaWZpYyBtYXJrZXRcbiAg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XJzJywgLy8gR2V0IHlvdXIgb3JkZXJzLCByZXN1bHRzIGlzIHBhZ2luYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gR2V0IGluZm9ybWF0aW9uIG9mIHNwZWNpZmllZCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsIC8vIEdldCB5b3VyIGV4ZWN1dGVkIHRyYWRlcyBUcmFkZXMgYXJlIHNvcnRlZCBpbiByZXZlcnNlIGNyZWF0aW9uIG9yZGVyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cycsIC8vIEdldCB5b3VyIGNyeXB0b2N1cnJlbmN5IHdpdGhkcmF3c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JywgLy8gR2V0IHlvdXIgY3J5cHRvY3VycmVuY3kgd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJywgLy8gQ3JlYXRlIGEgU2VsbC9CdXkgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvbXVsdGknLCAvLyBDcmVhdGUgbXVsdGlwbGUgc2VsbC9idXkgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2NsZWFyJywgLy8gQ2FuY2VsIGFsbCBteSBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWxldGUnLCAvLyBDYW5jZWwgYW4gb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsIC8vIENyZWF0ZSBhIHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiAwLjAsIC8vIFRoZXJlIGlzIG9ubHkgMSUgZmVlIG9uIHdpdGhkcmF3YWxzIHRvIHlvdXIgYmFuayBhY2NvdW50LlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE1lbWJlcnNNZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2JhbGFuY2UnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBwYXJzZUZsb2F0IChiYWxhbmNlWydsb2NrZWQnXSksXG4gICAgICAgIC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4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ2F0J10gKiAxMDAwO1xuICAgICAgICB0aWNrZXIgPSB0aWNrZXJbJ3RpY2tlciddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcsIHVuZGVmaW5lZCksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvdycsIHVuZGVmaW5lZCksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScsIHVuZGVmaW5lZCksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnLCB1bmRlZmluZWQpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnLCB1bmRlZmluZWQpLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2wnLCB1bmRlZmluZWQpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSA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GhkcmF3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3kudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAnc3VtJzogYW1vdW50LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzdWx0LFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIGVuY29kZVBhcmFtcyAocGFyYW1zKSB7XG4gICAgICAgIGlmICgnb3JkZXJzJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgIGxldCBvcmRlcnMgPSBwYXJhbXNbJ29yZGVycyddO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAodGhpcy5vbWl0IChwYXJhbXMsICdvcmRlcnMnKSkpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBvcmRlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcnNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAob3JkZXIpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0ga2V5c1trXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID0gb3JkZXJba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgcXVlcnkgKz0gJyZvcmRlcnMlNUIlNUQlNUInICsga2V5ICsgJyU1RD0nICsgdmFsdWUudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoJ2V4dGVuc2lvbicgaW4gdGhpcy51cmxzKVxuICAgICAgICAgICAgcmVxdWVzdCArPSB0aGlzLnVybHNbJ2V4dGVuc2lvbiddO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB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xLTExZTctOGQ1YS1iNTQ3YjRkNzMwZWIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbS9BYm91dC9BUElSZWZlcmVuY2UnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdIb21lL01hcmtldE92ZXJWaWV3RGV0YWlsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldEhvbWVNYXJrZXRPdmVyVmlld0RldGFpbCAoKTtcbiAgICAgICAgbGV0IGNvaW5zID0gcmVzcG9uc2VbJ21hcmtldENvaW5zJ107XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29pbnMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRzID0gY29pbnNbal1bJ01hcmtldHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgbWFya2V0cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tdWydNYXJrZXQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnUHJpbWFyeSddO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnU2Vjb25kYXJ5J107XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKSArICdfJyArIHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICAgICAnc3BvdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdmdXR1cmUnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAtMSlcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAgICAgICBpZiAoc3RhdHVzID09IDApXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICBpZiAoc3RhdHVzID09IDEpXG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nOyAvLyBwYXJ0aWFsbHkgZmlsbGVkXG4gICAgICAgIGlmIChzdGF0dXMgPT0gMilcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAxMClcbiAgICAgICAgICAgI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J2NvdW50cmllcyc6IFsgJ0pQJywgJ1NHJywgJ0hLJywgJ05aJyBdLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY1OTgzLWZkODU5NWRhLTVlYzktMTFlNy04MmUzLWFkYjNhYjhjMjYxMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hbnhwcm8uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2FueHByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vZG9jcy5hbnh2Mi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hbnhwcm8uY29tL3BhZ2VzL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L2RlcHRoL2Z1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90cmFkZS9mZXRjaCcsIC8vIGRpc2FibGVkIGJ5IEFOWFByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9xdW90ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS97Y3VycmVuY3l9L3NlbmRfc2ltcGxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS90cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS93YWxsZXQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ0JUQ1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbXVsdGlwbGllcic6IDEwMD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ICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1vbmV5SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlWydXYWxsZXRzJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnV2FsbGV0cyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IHdhbGxldCA9IGJhbGFuY2VbJ1dhbGxldHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAod2FsbGV0WydBdmFpbGFibGVfQmFsYW5jZSddWyd2YWx1ZSddKTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAod2FsbGV0WydCYWxhbmNlJ11bJ3ZhbHVlJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgIC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ICA9IHRydWVcbiAgICAgICAgdGhpcy5oYXNXaXRoZHJhdyAgICAgICAgICA9IGZhbHNlXG4gICAgICAgIHRoaXMuaGFzQ3JlYXRlT3JkZXIgICAgICAgPSB0aGlzLmhhc1ByaXZhdGVBUElcbiAgICAgICAgdGhpcy5oYXNDYW5jZWxPcmRlciAgICAgICA9IHRoaXMuaGFzUHJpdmF0ZUFQSVxuXG4gICAgICAgIHRoaXMuYXBpS2V5ICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5zZWNyZXQgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnVpZCAgICAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMubG9naW4gICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5wYXNzd29yZCA9IHVuZGVmaW5lZFxuXG4gICAgICAgIHRoaXMucmVxdWlyZWRDcmVkZW50aWFscyA9IHtcbiAgICAgICAgICAgICdhcGlLZXknOiAgIHRydWUsXG4gICAgICAgICAgICAnc2VjcmV0JzogICB0cnVlLFxuICAgICAgICAgICAgJ3VpZCc6ICAgICAgZmFsc2UsXG4gICAgICAgICAgICAnbG9naW4nOiAgICBmYWxzZSxcbiAgICAgICAgICAgICdwYXNzd29yZCc6IGZhbHNlLFxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5iYWxhbmNlICAgID0ge31cbiAgICAgICAgdGhpcy5vcmRlcmJvb2tzID0ge31cbiAgICAgICAgdGhpcy50aWNrZXJzICAgID0ge31cbiAgICAgICAgdGhpcy5mZWVzICAgICAgID0ge31cbiAgICAgICAgdGhpcy5vcmRlcnMgICAgID0ge31cbiAgICAgICAgdGhpcy50cmFkZXMgICAgID0ge31cbiAgICAgICAgdGhpcy5jdXJyZW5jaWVzID0ge31cblxuICAgICAgICB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLmxhc3RfanNvbl9yZXNwb25zZSA9IHVuZGVmaW5lZFxu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AgIHRoaXMuZmV0Y2hfdGlja2VyICAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaFRpY2tlclxuICAgICAgICB0aGlzLmZldGNoX3RyYWRlcyAgICAgICAgICAgICAgICA9IHRoaXMuZmV0Y2hUcmFkZXNcbiAgICAgICAgdGhpcy5mZXRjaF9vcmRlciAgICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoT3JkZXJcbiAgICAgICAgdGhpcy5mZXRjaF9vcmRlcnMgICAgICAgICAgICAgICAgPSB0aGlzLmZldGNoT3JkZXJzXG4gICAgICAgIHRoaXMuZmV0Y2hfb3Blbl9vcmRlcnMgICAgICAgICAgID0gdGhpcy5mZXRjaE9wZW5PcmRlcnNcbiAgICAgICAgdGhpcy5mZXRjaF9jbG9zZWRfb3JkZXJzICAgICAgICAgPSB0aGlzLmZldGNoQ2xvc2VkT3JkZXJzXG4gICAgICAgIHRoaXMuZmV0Y2hfb3JkZXJfc3RhdHVzICAgICAgICAgID0gdGhpcy5mZXRjaE9yZGVyU3RhdHVzXG4gICAgICAgIHRoaXMuZmV0Y2hfbWFya2V0cyAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaE1hcmtldHNcbiAgICAgICAgdGhpcy5sb2FkX21hcmtldHMgICAgICAgICAgICAgICAgPSB0aGlzLmxvYWRNYXJrZXRzXG4gICAgICAgIHRoaXMuc2V0X21hcmtldHMgICAgICAgICAgICAgICAgID0gdGhpcy5zZXRNYXJrZXRzXG4gICAgICAgIHRoaXMucGFyc2VfYmFsYW5jZSAgICAgICAgICAgICAgID0gdGhpcy5wYXJzZUJhbGFuY2VcbiAgICAgICAgdGhpcy5wYXJzZV9iaWRfYXNrICAgICAgICAgICAgICAgPSB0aGlzLnBhcnNlQmlkQXNrXG4gICAgICAgIHRoaXMucGFyc2VfYmlkc19hc2tzICAgICAgICAgICAgID0gdGhpcy5wYXJzZUJpZHNBc2tzXG4gICAgICAgIHRoaXMucGFyc2Vfb3JkZXJfYm9vayAgICAgICAgICAgID0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lciAoKSB7XG5cbiAgICAgICAgdGhpcy50b2tlbkJ1Y2tldCA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICByZWZpbGxSYXRlOiAgMSAvIHRoaXMucmF0ZUxpbWl0LFxuICAgICAgICAgICAgZGVsYXk6ICAgICAgIDEsXG4gICAgICAgICAgICBjYXBhY2l0eTogICAgMSxcbiAgICAgICAgICAgIGRlZmF1bHRDb3N0OiAxLFxuICAgICAgICAgICAgbWF4Q2FwYWNpdHk6IDEwMDAsXG4gICAgICAgIH0sIHRoaXMudG9rZW5CdWNrZXQpXG5cbiAgICAgICAgdGhpcy50aHJvdHRsZSA9IHRocm90dGxlICh0aGlzLnRva2VuQnVja2V0KVxuXG4gICAgICAgIHRoaXMuZXhlY3V0ZVJlc3RSZXF1ZXN0ID0gZnVuY3Rpb24gKHVybCwgbWV0aG9kID0gJ0dFVCcsIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcblxuICAgICAgICAgICAgbGV0IHByb21pc2UgPVxuICAgICAgICAgICAgICAgIHRoaXMuZmV0Y2hJbXBsZW1lbnRhdGlvbiAodXJsLCB7ICdtZXRob2QnOiBtZXRob2QsICdoZWFkZXJzJzogaGVhZGVycywgJ2JvZHknOiBib2R5LCAnYWdlbnQnOiB0aGlzLnR1bm5lbEFnZW50IHx8IG51bGwsIHRpbWVvdXQ6IHRoaXMudGltZW91dH0pXG4gICAgICAgICAgICAgICAgICAgIC5jYXRjaCAoZSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNOb2RlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZU5vdEF2YWlsYWJsZSAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgZS50eXBlLCBlLm1lc3NhZ2UgXS5qb2luICgnICcpKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgZSAvLyByZXRocm93IGFsbCB1bmtub3duIGVycm9yc1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAudGhlbiAocmVzcG9uc2UgPT4gdGhpcy5oYW5kbGVSZXN0RXJyb3JzIChyZXNwb25zZSwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpKVxuICAgICAgICAgICAgICAgICAgICAudGhlbiAocmVzcG9uc2UgPT4gdGhpcy5oYW5kbGVSZXN0UmVzcG9uc2UgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkpXG5cbiAgICAgICAgICAgIHJldHVybiB0aW1lb3V0ICh0aGlzLnRpbWVvdXQsIHByb21pc2UpLmNhdGNoIChlID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIFJlcXVlc3RUaW1lb3V0KVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUmVxdWVzdFRpbWVvdXQgKHRoaXMuaWQgKyAnICcgKyBtZXRob2QgKyAnICcgKyB1cmwgKyAnICcgKyBlLm1lc3NhZ2UgKyAnICgnICsgdGhpcy50aW1lb3V0ICsgJyBtcyknKVxuICAgICAgICAgICAgICAgIHRocm93IGVcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBkZWZpbmVSZXN0QXBpIChhcGksIG1ldGhvZE5hbWUsIG9wdGlvbnMgPSB7fSkge1xuXG4gICAgICAgIGZvciAoY29uc3QgdHlwZSBvZiBPYmplY3Qua2V5cyAoYXBpKSkge1xuICAgICAgICAgICAgZm9yIChjb25zdCBodHRwTWV0aG9kIG9mIE9iamVjdC5rZXlzIChhcGlbdHlwZV0pKSB7XG5cbiAgICAgICAgICAgICAgICBsZXQgdXJscyA9IGFwaVt0eXBlXVtodHRwTWV0aG9kXVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdXJscy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gdXJsc1tpXS50cmltICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBzcGxpdFBhdGggPSB1cmwuc3BsaXQgKC9bXmEtekEtWjAtOV0vKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2VNZXRob2QgID0gaHR0cE1ldGhvZC50b1VwcGVyQ2FzZSAoKVxuICAgICAgICAgICAgICAgICAgICBsZXQgbG93ZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9Mb3dlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZU1ldGhvZCAgPSB0aGlzLmNhcGl0YWxpemUgKGxvd2VyY2FzZU1ldGhvZClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZVN1ZmZpeCAgPSBzcGxpdFBhdGgubWFwICh0aGlzLmNhcGl0YWxpemUpLmpvaW4gKCcnKVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZVN1ZmZpeCA9IHNwbGl0UGF0aC5tYXAgKHggPT4geC50cmltICgpLnRvTG93ZXJDYXNlICgpKS5maWx0ZXIgKHggPT4geC5sZW5ndGggPiAwKS5qb2luICgnXycpXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhbWVsY2FzZVN1ZmZpeC5pbmRleE9mIChjYW1lbGNhc2VNZXRob2QpID09PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlU3VmZml4ID0gY2FtZWxjYXNlU3VmZml4LnNsaWNlIChjYW1lbGNhc2VNZXRob2QubGVuZ3RoKVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICh1bmRlcnNjb3JlU3VmZml4LmluZGV4T2YgKGxvd2VyY2FzZU1ldGhvZCkgPT09IDApXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlU3VmZml4ID0gdW5kZXJzY29yZVN1ZmZpeC5zbGljZSAobG93ZXJjYXNlTWV0aG9kLmxlbmd0aClcblxuICAgICAgICAgICAgICAgICAgICBsZXQgY2FtZWxjYXNlICA9IHR5cGUgKyBjYW1lbGNhc2VNZXRob2QgKyB0aGlzLmNhcGl0YWxpemUgKGNhbWVsY2FzZVN1ZmZpeClcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVuZGVyc2NvcmUgPSB0eXBlICsgJ18nICsgbG93ZXJjYXNlTWV0aG9kICsgJ18nICsgdW5kZXJzY29yZVN1ZmZpeFxuXG4gICAgICAgICAgICAgICAgICAgIGlmICgnc3VmZml4ZXMnIGluIG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnY2FtZWxjYXNlJyBpbiBvcHRpb25zWydzdWZmaXhlcyddKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbWVsY2FzZSArPSBvcHRpb25zWydzdWZmaXhlcyddWydjYW1lbGNhc2UnXVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCd1bmRlcnNjb3JlJyBpbiBvcHRpb25zLnN1ZmZpeGVzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyc2NvcmUgKz0gb3B0aW9uc1snc3VmZml4ZXMnXVsndW5kZXJzY29yZSddXG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAoJ3VuZGVyc2NvcmVfc3VmZml4JyBpbiBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZSArPSBvcHRpb25zLnVuZGVyc2NvcmVTdWZmaXg7XG4gICAgICAgICAgICAgICAgICAgIGlmICgnY2FtZWxjYXNlX3N1ZmZpeCcgaW4gb3B0aW9ucylcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbWVsY2FzZSArPSBvcHRpb25zLmNhbWVsY2FzZVN1ZmZpeDtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgcGFydGlhbCA9IGFzeW5jIHBhcmFtcyA9PiB0aGlzW21ldGhvZE5hbWVdICh1cmws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SBlbHNlIGlmIChbIDQwNCwgNDA5LCA0MjIsIDUwMCwgNTAxLCA1MDIsIDUyMCwgNTIxLCA1MjIsIDUyNSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAwLCA0MDMsIDQwNSwgNTAzLCA1MzAgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGxldCBkZG9zUHJvdGVjdGlvbiA9IGJvZHkubWF0Y2ggKC9jbG91ZGZsYXJlfGluY2Fwc3VsYS9pKVxuICAgICAgICAgICAgaWYgKGRkb3NQcm90ZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgZXJyb3IgPSBERG9TUHJvdGVjdGlvblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBlcnJvciA9IEV4Y2hhbmdlTm90QXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgZGV0YWlscyArPSAnIChwb3NzaWJsZSByZWFzb25zOiAnICsgW1xuICAgICAgICAgICAgICAgICAgICAnaW52YWxpZCBBUEkga2V5cycsXG4gICAgICAgICAgICAgICAgICAgICdiYWQgb3Igb2xkIG5vbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlIGlzIGRvd24gb3Igb2ZmbGluZScsXG4gICAgICAgICAgICAgICAgICAgICdvbiBtYWludGVuYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICdERG9TIHByb3RlY3Rpb24nLFxuICAgICAgICAgICAgICAgICAgICAncmF0ZS1saW1pdGluZycsXG4gICAgICAgICAgICAgICAgXS5qb2luICgnLCAnKSArICcpJ1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKFsgNDA4LCA1MDQgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gUmVxdWVzdFRpbWVvdXRcbiAgICAgICA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ByZXNwb25zZVxuICAgICAgICAgICAgaWYgKHRoaXMucGFyc2VKc29uUmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmxhc3RfanNvbl9yZXNwb25zZSA9XG4gICAgICAgICAgICAgICAgICAgICgodHlwZW9mIHJlc3BvbnNlID09ICdzdHJpbmcnKSAmJiAocmVzcG9uc2UubGVuZ3RoID4gMSkpID9cbiAgICAgICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UgKHJlc3BvbnNlKSA6IHJlc3BvbnNlXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZVxuXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcblxuICAgICAgICAgICAgbGV0IG1haW50ZW5hbmNlID0gcmVzcG9uc2UubWF0Y2ggKC9vZmZsaW5lfGJ1c3l8cmV0cnl8d2FpdHx1bmF2YWlsYWJsZXxtYWludGFpbnxtYWludGVuYW5jZXxtYWludGVuYW5jaW5nL2kpXG4gICAgICAgICAgICBsZXQgZGRvc1Byb3RlY3Rpb24gPSByZXNwb25zZS5tYXRjaCAoL2Nsb3VkZmxhcmV8aW5jYXBzdWxhfG92ZXJsb2FkL2kpXG5cbiAgICAgICAgICAgIGlmIChlIGluc3RhbmNlb2YgU3ludGF4RXJyb3IpIHtcblxuICAgICAgICAgICAgICAgIGxldCBlcnJvciA9IEV4Y2hhbmdlTm90QXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgbGV0IGRldGFpbHMgPSAnbm90IGFjY2Vzc2libGUgZnJvbSB0aGlzIGxvY2F0aW9uIGF0IHRoZSBtb21lbnQnXG4gICAgICAgICAgICAgICAgaWYgKG1haW50ZW5hbmNlKVxuICAgICAgICAgICAgICAgICAgICBkZXRhaWxzID0gJ29mZmxpbmUsIG9uIG1haW50ZW5hbmNlIG9yIHVucmVhY2hhYmxlIGZyb20gdGhpcyBsb2NhdGlvbiBhdCB0aGUgbW9tZW50J1xuICAgICAgICAgICAgICAgIGlmIChkZG9zUHJvdGVjdGlvbilcbiAgICAgICAgICAgICAgICAgICAgZXJyb3IgPSBERG9TUHJvdGVjdGlvblxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBlcnJvciAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgZGV0YWlscyBdLmpvaW4gKCcgJykpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLnZlcmJvc2UpXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2cgKHRoaXMuaWQsIG1ldGhvZCwgdXJsLCAnZXJyb3InLCBlLCBcInJlc3BvbnNlIGJvZHk6XFxuJ1wiICsgcmVzcG9uc2UgKyBcIidcIilcblxuICAgICAgICAgICAgdGhyb3cgZVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgc2V0TWFya2V0cyAobWFya2V0cywgY3VycmVuY2llcyA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdmFsdWVzID0gT2JqZWN0LnZhbHVlcyAobWFya2V0cykubWFwIChtYXJrZXQgPT4gZGVlcEV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0cyc6IHRoaXMubGltaXRzLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHRoaXMucHJlY2lzaW9uLFxuICAgICAgICB9LCB0aGlzLmZlZXNbJ3RyYWRpbmcnXSwgbWFya2V0KSlcbiAgICAgICAgdGhpcy5tYXJrZXRzID0gZGVlcEV4dGVuZCAodGhpcy5tYXJrZXRzLCBpbmRleEJ5ICh2YWx1ZXMsICdzeW1ib2wnKSlcbiAgICAgICAgdGhpcy5tYXJrZXRzQnlJZCA9IGluZGV4QnkgKG1hcmtldHMsICdpZCcpXG4gICAgICAgIHRoaXMubWFya2V0c19ieV9pZCA9IHRoaXMubWFya2V0c0J5SWRcbiAgICAgICAgdGhpcy5zeW1ib2xzID0gT2JqZWN0LmtleXMgKHRoaXMubWFya2V0cykuc29ydCAoKVxuICAgICAgICB0aGlzLmlkcyA9IE9iamVjdC5rZXlzICh0aGlzLm1hcmtldHNfYnlfaWQpLnNvcnQgKClcbiAgICAgICAgaWYgKGN1cnJlbmNpZXMpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGN1cnJlbmNpZXMsIHRoaXMuY3VycmVuY2llcylcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGJhc2VDdXJyZW5jaWVzID1cbiAgICAgICAgICAgICAgICB2YWx1ZXMuZmlsdGVyIChtYXJrZXQgPT4gJ2Jhc2UnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LmJhc2VJZCB8fCBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IG1hcmtldC5iYXNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24uYmFzZSB8fCBtYXJrZXQucHJlY2lzaW9uLmFtb3VudCkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IHF1b3RlQ3VycmVuY2llcyA9XG4gICAgICAgICAgICAgICAgdmFsdWVzLmZpbHRlciAobWFya2V0ID0+ICdxdW90ZScgaW4gbWFya2V0KVxuICAgICAgICAgICAgICAgICAgICAubWFwIChtYXJrZXQgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBtYXJrZXQucXVvdGVJZCB8fCBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb246IG1hcmtldC5wcmV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ib29rW2Fza3NLZXldLCBwcmljZUtleSwgYW1vdW50S2V5KSA6IFtdLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBnZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KSB7XG4gICAgICAgIHJldHVybiBPYmplY3QudmFsdWVzICh0aGlzLm9yZGVycykuZmlsdGVyIChvcmRlciA9PiAob3JkZXJbJ3N0YXR1cyddID09ICdvcGVuJykpLnJlZHVjZSAoKHRvdGFsLCBvcmRlcikgPT4ge1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG9yZGVyWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgICAgIGxldCBhbW91bnQgPSBvcmRlclsncmVtYWluaW5nJ11cbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSA9PSBtYXJrZXRbJ2Jhc2UnXSAmJiBvcmRlclsnc2lkZSddID09ICdzZWxsJykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIGFtb3VudFxuICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSBtYXJrZXRbJ3F1b3RlJ10gJiYgb3JkZXJbJ3NpZGUnXSA9PSAnYnV5Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIChvcmRlclsnY29zdCddIHx8IChvcmRlclsncHJpY2UnXSAqIGFtb3VudCkpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbFxuICAgICAgICAgICAgfVxuICAgICAgICB9LCAwKVxuICAgIH1cblxuICAgIHBhcnNlQmFsYW5jZSAoYmFsYW5jZSkge1xuXG4gICAgICAgIGNv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XG4gICAgWW1kICh0aW1lc3RhbXAsIGluZml4ID0gJyAnKSB7XG4gICAgICAgIGxldCBkYXRlID0gbmV3IERhdGUgKHRpbWVzdGFtcClcbiAgICAgICAgbGV0IFkgPSBkYXRlLmdldFVUQ0Z1bGxZZWFyICgpXG4gICAgICAgIGxldCBtID0gZGF0ZS5nZXRVVENNb250aCAoKSArIDFcbiAgICAgICAgbGV0IGQgPSBkYXRlLmdldFVUQ0RhdGUgKClcbiAgICAgICAgbSA9IG0gPCAxMCA/ICgnMCcgKyBtKSA6IG1cbiAgICAgICAgZCA9IGQgPCAxMCA/ICgnMCcgKyBkKSA6IGRcbiAgICAgICAgcmV0dXJuIFkgKyAnLScgKyBtICsgJy0nICsgZFxuICAgIH1cblxuICAgIFltZEhNUyAodGltZXN0YW1wLCBpbmZpeCA9ICcgJykge1xuICAgICAgICBsZXQgZGF0ZSA9IG5ldyBEYXRlICh0aW1lc3RhbXApXG4gICAgICAgIGxldCBZID0gZGF0ZS5nZXRVVENGdWxsWWVhciAoKVxuICAgICAgICBsZXQgbSA9IGRhdGUuZ2V0VVRDTW9udGggKCkgKyAxXG4gICAgICAgIGxldCBkID0gZGF0ZS5nZXRVVENEYXRlICgpXG4gICAgICAgIGxldCBIID0gZGF0ZS5nZXRVVENIb3VycyAoKVxuICAgICAgICBsZXQgTSA9IGRhdGUuZ2V0VVRDTWludXRlcyAoKVxuICAgICAgICBsZXQgUyA9IGRhdGUuZ2V0VVRDU2Vjb25kcyAoKVxuICAgICAgICBtID0gbSA8IDEwID8gKCcwJyArIG0pIDogbVxuICAgICAgICBkID0gZCA8IDEwID8gKCcwJyArIGQpIDogZFxuICAgICAgICBIID0gSCA8IDEwID8gKCcwJyArIEgpIDogSFxuICAgICAgICBNID0gTSA8IDEwID8gKCcwJyArIE0pIDogTVxuICAgICAgICBTID0gUyA8IDEwID8gKCcwJyArIFMpIDogU1xuICAgICAgICByZXR1cm4gWSArICctJyArIG0gKyAnLScgKyBkICsgaW5maXggKyB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hcmdzKSB7XG4gICAgICAgIGlmICh0eXBlb2YgeCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGRlbGV0ZSByZXN1bHRbeF1cbiAgICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5ICh4KSkge1xuICAgICAgICAgICAgZm9yIChjb25zdCBrIG9mIHgpXG4gICAgICAgICAgICAgICAgZGVsZXRlIHJlc3VsdFtrXVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXN1bHRcbn1cblxuY29uc3QgZ3JvdXBCeSA9IChhcnJheSwga2V5KSA9PiB7XG4gICAgY29uc3QgcmVzdWx0ID0ge31cbiAgICBPYmplY3RcbiAgICAgICAgLnZhbHVlcyAoYXJyYXkpXG4gICAgICAgIC5maWx0ZXIgKGVudHJ5ID0+IGVudHJ5W2tleV0gIT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgIC5mb3JFYWNoIChlbnRyeSA9PiB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFtlbnRyeVtrZXldXSA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICByZXN1bHRbZW50cnlba2V5XV0gPSBbXVxuICAgICAgICAgICAgcmVzdWx0W2VudHJ5W2tleV1dLnB1c2ggKGVudHJ5KVxuICAgICAgICB9KVxuICAgIHJldHVybiByZXN1bHRcbn1cblxuY29uc3QgZmlsdGVyQnkgPSAoYXJyYXksIGtleSwgdmFsdWUgPSB1bmRlZmluZWQpID0+IHtcbiAgICBpZiAodmFsdWUpIHtcbiAgICAgICAgbGV0IGdyb3VwZWQgPSBncm91cEJ5IChhcnJheSwga2V5KVxuICAgICAgICBpZiAodmFsdWUgaW4gZ3JvdXBlZClcbiAgICAgICAgICAgIHJldHVybiBncm91cGVkW3ZhbHVlXVxuICAgICAgICByZXR1cm4gW11cbiAgICB9XG4gICAgcmV0dXJuIGFycmF5XG59XG5cbmNvbnN0IGluZGV4QnkgPSAoYXJyYXksIGtleSkgPT4ge1x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bmV3IFByb21pc2UgKGFzeW5jIChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgICAgICAgdHJ5IHtcblxuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2ggKHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0pXG5cbiAgICAgICAgICAgICAgICBpZiAoIXJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgcnVubmluZyA9IHRydWVcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGhhc0Vub3VnaFRva2VucyA9IGNmZy5jYXBhY2l0eSA/IChudW1Ub2tlbnMgPiAwKSA6IChudW1Ub2tlbnMgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNFbm91Z2hUb2tlbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocXVldWUubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgeyBjb3N0LCByZXNvbHZlLCByZWplY3QgfSA9IHF1ZXVlWzBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAoY29zdCB8fCBjZmcuZGVmYXVsdENvc3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChudW1Ub2tlbnMgPj0gTWF0aC5taW4gKGNvc3QsIGNmZy5jYXBhY2l0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVRva2VucyAtPSBjb3N0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZS5zaGlmdCAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vdyA9IERhdGUubm93ICgpXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZWxhcHNlZCA9IG5vdyAtIGxhc3RUaW1lc3RhbXBcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RUaW1lc3RhbXAgPSBub3dcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bVRva2VucyA9IE1hdGgubWluIChjZmcuY2FwYWNpdHksIG51bVRva2VucyArIGVsYXBzZWQgKiBjZmcucmVmaWxsUmF0ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IHNsZWVwIChjZmcuZGVsYXkpXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcnVubmluZyA9IGZhbHNlXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG5cbiAgICAgICAgICAgICAgICByZWplY3QgKGUpXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG5cbiAgICB9LCBjZmcsIHtcbiAgICAgICAgY29uZmlndXJlOiBuZXdDZmcgPT4gdGhyb3R0bGUgKE9iamVjdC5hc3NpZ24gKHt9LCBjZmcsIG5ld0NmZykpXG4gICAgfSlcbn1cblxubW9kdWxlLmV4cG9ydHMgPSB0aHJvdHRsZVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2UgPSByZXF1aXJlICgnLi9iYXNlL0V4Y2hhbmdlJylcbmNvbnN0IHsgRXhjaGFuZ2VFcnJvciwgSW5zdWZmaWNpZW50RnVuZHMsIE9yZGVyTm90Rm91bmQsIEludmFsaWRPcmRlciwgRERvU1Byb3RlY3Rpb24g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gICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmgnLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnOGgnOiAnOGgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICczZCc6ICczZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk2MDQwMjAtZDU0ODNjZGMtODdlZS0xMWU3LTk0YzctZDFhOGQ5MTY5MjkzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3YXBpJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL3dhcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpbmFuY2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaW5hbmNlLWV4Y2hhbmdlL2JpbmFuY2Utb2ZmaWNpYWwtYXBpLWRvY3MvYmxvYi9tYXN0ZXIvcmVzdC1hcGkubWQnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaW5hbmNlLnplbmRlc2suY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMDQyOTMzMicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuYmluYW5jZS5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwNTgzMzExJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9wdWJsaWMvcHJvZHVjdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2VJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWdnVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci8yNGhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYWxsUHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYWxsQm9va1RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlckRhdGFTdHJlYW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyRGF0YVN0cmVhbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTkInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiA1MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBUyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAzMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogOC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLTkMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJTksnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFZHJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQUxUJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTURBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UTCc6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5HJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVEnOiAzMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiA3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDUwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PRCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RPUkonOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElOSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFZHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01EQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1dSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JKJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZUluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3N5bWJvbHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnYmFzZUFzc2V0J10pO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsncXVvdGVBc3NldCddKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmlsdGVycyA9IHRoaXMuaW5kZXhCeSAobWFya2V0WydmaWx0ZXJzJ10sICdmaWx0ZXJUeXBlJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdiYXNlJzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZUFzc2V0UHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydxdW90ZVByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0dXMnXSA9PSAnVFJBRElORycpO1xuICAgICAgICAgICAgbGV0IGxvdCA9IC0xICogTWF0aC5sb2cxMCAocHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgZW50cnkgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAtMSAqIE1hdGgubG9nMTAgKHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICgnUFJJQ0VfRklMVEVSJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IGZpbHRlcnNbJ1BSSUNFX0ZJTFRFUiddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsncHJpY2UnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoZmlsdGVyWyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ3ByaWNlJ10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAoZmlsdGVyWydtYXhQcmljZSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdMT1RfU0laRScgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydMT1RfU0laRSddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsnYW1vdW50J10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsnc3RlcFNpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xvdCddID0gcGFyc2VGbG9hdCAoZmlsdGVyWydzdGVwU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Ftb3VudCddID0ge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAoZmlsdGVyWydtaW5RdHknXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21heFF0eSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdNSU5fTk9USU9OQUwnIGluIGZpbHRlcnMpIHtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Nvc3QnXVsnbWluJ10gPSBwYXJzZUZsb2F0IChmaWx0ZXJzWydNSU5fTk9USU9OQUwnXVsnbWluTm90aW9uYWwnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoZW50cnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBpZiAoc2lkZSA9PSAnc2VsbCcpIHtcbiAgICAgICAgICAgIGNvc3QgKj0gcHJpY2U7XG4gICAgICAgIH0g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uICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbc3ltYm9sXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaFByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd1ByaWNlJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZFByaWNlJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2Fza1ByaWNlJyksXG4gICAgICAgICAgICAndndhcCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd3ZWlnaHRlZEF2Z1ByaWNlJyksXG4gICAgICAgICAgICAnb3Blbic6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdvcGVuUHJpY2UnKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdwcmV2Q2xvc2VQcmljZScpLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdFByaWNlJyksXG4gICAgICAgIC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2NvbW1pc3Npb24nIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0cmFkZVsnY29tbWlzc2lvbiddKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodHJhZGVbJ2NvbW1pc3Npb25Bc3NldCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJ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gICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAnRklMTEVEJylcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAnQ0FOQ0VMRUQnKVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXMudG9Mb3dlckNhc2UgKCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGlkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJbJ3RpbWUnXTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAob3JkZXJbJ29yaWdRdHknXSk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZFF0eScsIDAuMCk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBNYXRoLm1heCAoYW1vdW50IC0gZmlsbGVkLCAwLjApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG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uZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgcXVlcnkgKz0gJyYnICsgJ3NpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1NQlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKChtZXRob2QgPT0gJ0dFVCcpIHx8IChhcGkgPT0gJ3dhcGknKSkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHF1ZXJ5O1xuICAgICAgICAgICAgICAgIGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChjb2RlID09IDQxOClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyBjb2RlLnRvU3RyaW5nICgpICsgJyAnICsgcmVhc29uICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnTUlOX05PVElPTkFMJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBjb3N0ID0gYW1vdW50ICogcHJpY2Ugc2hvdWxkIGJlID4gKDAuMDAxIEJUQyBvciAwLjAxIEVUSCBvciAxIEJOQiBvciAxIFVTRFQpJyArIGJvZHkpO1xuICAgICAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0xPVF9TSVpFJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBhbW91bnQgc2hvdWxkIGJlIGV2ZW5seSBkaXZpc2libGUgYnkgbG90IHNpemUsIHVzZSB0aGlzLmFtb3VudFRvTG90cyAoc3ltYm9sLCBhbW91bnQpICcgKyBib2R5KTtcbiAgICAgICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdQUklDRV9GSUxURVInKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnIG9yZGVyIHByaWNlIGV4Y2VlZHMgYWxsb3dlZCBwcmljZSBwcmVjaXNpb24gb3IgaW52YWxpZCwgdXNlIHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpICcgKyBib2R5KTtcbiAgICAgICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdPcmRlciBkb2VzIG5vdCBleGlzdCcpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9ke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gIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXQyYycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXQyQycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0lMJywgLy8gSXNyYWVsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMzAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTE5LTM1OTMyMjBlLTVlY2UtMTFlNy04YjNhLTVhMDQxZjZiY2MzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0MmMuY28uaWwnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0MmMuY28uaWwnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXQyYy5jby5pbC9ob21lL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vT2ZlckUvYml0MmMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNZXJjaGFudC9DcmVhdGVDaGVja291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWNjb3VudEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZENvaW5GdW5kc1JlcXVlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZEZ1bmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlU2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL015T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L0dldE15SWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvU2VuZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL05JUyc6IHsgJ2lkJzogJ0J0Y05pcycsICdzeW1ib2wnOiAnQlRDL05JUycsICdiYXNlJ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AgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW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VzdWx0LFxuICAgICAgICAgICAgJ2lkJzogcmVzdWx0WydOZXdPcmRlciddWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyQ2FuY2VsT3JkZXIgKHsgJ2lkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcuanNvbic7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRp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XG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjEzMi05NzhhN2JkOC01ZWNlLTExZTctOTU0MC1iYzk2ZDFlOWJiYjguanBnJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0YmF5Lm5ldCcsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2JpdGJheS5uZXQvQVBJL1B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYml0YmF5Lm5ldC9BUEkvVHJhZGluZy90cmFkaW5nQXBpLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRiYXkubmV0L3B1YmxpYy1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRiYXkubmV0L2FjY291bnQvdGFiLWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQml0QmF5TmV0L0FQSScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdCVENVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ2Jhc2VJZCc6ICdCVEMnLCAncXVvdGVJZCc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdCVENFVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ2Jhc2VJZCc6ICdCVEMnLCAncXVvdGVJZCc6ICdFVVInIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nL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XG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0MyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0SW5mbyAoKTtcbiAgICAgICAgaWYgKCdiYWxhbmNlcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgICAgIGxldCBjb2RlcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gY29kZXNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzW2NvZGVdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGlmIChpZCBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbaWRdWydhdmFpbGFibGUnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbaWRdWydsb2NrZWQnXSk7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPS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PSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndndhcCcpO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbicpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2F2ZXJhZ2UnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG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4uY28uaWQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGNvaW4uY28uaWQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2Rvd25sb2Fkcy9CSVRDT0lOQ09JRC1BUEktRE9DVU1FTlRBVElPTi5wZGYnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC90cmFkZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0s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bJ3RpY2tlciddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VGbG9hdCAodGlja2VyWydzZXJ2ZXJfdGltZSddKSAqIDEwMDA7XG4gICAgICAgIGxldCBiYXNlVm9sdW1lID0gJ3ZvbF8nICsgbWFya2V0WydiYXNlSWQnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgbGV0IHF1b3RlVm9sdW1lID0gJ3ZvbF8nICsgbWFya2V0WydxdW90ZUlkJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAg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cyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQsIHNpbmNlLCBsaW1pdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnYmFzZUlkJ107XG4gICAgICAgIG9yZGVyW2Jhc2VdID0gYW1vdW50O1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3JldHVybiddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYX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lkJzogJ2JpdGZpbmV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdGZpbmV4JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVkcnLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgLy8gb2xkIG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRGVwb3NpdCc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MjQ0LWUzMjhhNTBjLTVlZDItMTFlNy05NDdiLTA0MTQxNjU3OWJiMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0ZmluZXgucmVhZG1lLmlvL3YxL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2JpdGZpbmV4Y29tL2JpdGZpbmV4LWFwaS1ub2RlJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ2NhbmRsZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YnRpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFza2V0X21hbmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlZGl0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvbW92ZW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrZXlfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luX2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXNfZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9yZXBsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldy9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbGFpbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG90YWxfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bnVzZWRfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzc1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjE4IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTUwMDAwMDAsIDAuMTYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMzAwMDAwMDAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMDggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjA2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs3NTAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxNTAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSwgLy8gdHJ1ZSBmb3IgdGllci1iYXNlZC9wcm9ncmVzc2l2ZVxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLCAvLyBmaXhlZCBjb21taXNzaW9uXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBSJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdZWVcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUQSc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUFInOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lZVyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVRBJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgLy8gaXNzdWUgIzQgQml0ZmluZXggbmFtZXMgRGFzaCBhcyBEU0gsIGluc3RlYWQgb2YgREFTSFxuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RTSCcpXG4gICAgICAgICAgICByZXR1cm4gJ0RBU0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1FUTScpXG4gICAgICAgICAgICByZXR1cm4gJ1FUVU0nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JDQycpXG4gICAgICAgICAgICByZXR1cm4gJ0NTVF9CQ0MnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JDVScpXG4gICAgICAgICAgICByZXR1cm4gJ0NTVF9CQ1UnO1xuICAgICAgICAvLyBpc3N1ZSAjNzk2XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnSU9UJylcbiAgICAgICAgICAgIHJldHVybiAnSU9UQSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9sc0RldGFpbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpciddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fb3JkZXJfc2l6ZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fb3JkZXJfc2l6ZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4g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IGlkID0gdGlja2VyWydwYWlyJ107XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaFRpY2tlcnMoKSBmYWlsZWQgdG8gcmVjb2duaXplIHN5bWJvbCAnICsgaWQgKyAnICcgKyB0aGlzLmpzb24gKHRpY2tlcikpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoVGlja2VycygpIHJlc3BvbnNlIG5vdCByZWNvZ25pemVkICcgKyB0aGlzLmpzb24gKHRpY2tlcnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVidGlja2VyU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvb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dvcmRlcl9pZCcpO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSk7XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAg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ldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICBsZXQgZXhjaGFuZ2UgPSBvcmRlclR5cGUuaW5kZXhPZiAoJ2V4Y2hhbmdlICcpID49IDA7XG4gICAgICAgIGlmIChleGNoYW5nZSkge1xuICAgICAgICAgICAgbGV0IFsgcHJlZml4LCBvcmRlclR5cGUgXSA9IG9yZGVyWyd0eXBlJ10uc3BsaXQgKCcgJyk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChwYXJzZUZsb2F0IChvcmRlclsndGltZXN0YW1wJ10pICogMTAwMCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBwYXJzZUZsb2F0IChvcmRlclsnYXZnX2V4ZWN1dGlvbl9wcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0IChvcmRlclsnb3JpZ2luYWxfYW1vdW50J10pLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHBhcnNlRmxvYXQgKG9yZGVyWydyZW1haW5pbmdfYW1vdW50J10pLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IHBhcnNlRm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AgICAgcmV0dXJuICdsaXRlY29pbic7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ0VUSCcpIHtcbiAgICAgICAgICAgIHJldHVybiAnZXRoZXJldW0nO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdFVEMnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2V0aGVyZXVtYyc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ09NTkknKSB7XG4gICAgICAgICAgICByZXR1cm4gJ21hc3RlcmNvaW4nOyAvLyA/Pz9cbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnWkVDJykge1xuICAgICAgICAgICAgcmV0dXJuICd6Y2FzaCc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ1hNUicpIHtcbiAgICAgICAgICAgIHJldHVybiAnbW9uZXJvJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnVVNEJykge1xuICAgICAgICAgICAgcmV0dXJuICd3aXJlJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnREFTSCcpIHtcbiAgICAgICAgICAgIHJldHVybiAnZGFzaCc7XG4gICAgICAgIH0gZWxzZSBpZiAoY3VycmVuY3kgPT0gJ1hSUCcpIHtcbiAgICAgICAgICAgIHJldHVybiAncmlwcGxlJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnRU9TJykge1xuICAgICAgICAgICAgcmV0dXJuICdlb3MnO1xuICAgICAgICB9IGVsc2UgaWYgKGN1cnJlbmN5ID09ICdCQ0gnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ2JjYXNoJztcbiAgICAgICAgfSBlbHNlIGlmIChjdXJyZW5jeSA9PSAnVVNEVCcpIHtcbiAgICAgICAgICAgIHJldHVybiAndGV0aGVydXNvJztcbiAgICAgICAgfVxuICAgICAgICB0aHJvdyBuZXcgTm90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Sk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogcmVzcG9uc2VbJ2FkZHJlc3MnXSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG5hbWUgPSB0aGlzLmdldEN1cnJlbmN5TmFtZSAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICd3aXRoZHJhd190eXBlJzogbmFtZSxcbiAgICAgICAgICAgICd3YWxsZXRzZWxlY3RlZCc6ICdleGNoYW5nZScsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHJlc3BvbnNlc1swXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnd2l0aGRyYXdhbF9pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1z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zYWdlJ107XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ0tleSBwcmljZSBzaG91bGQgYmUgYSBkZWNpbWFsIG51bWJlcicpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnSW52YWxpZCBvcmRlcjogbm90IGVub3VnaCBleGNoYW5nZSBiYWxhbmNlJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ0ludmFsaWQgb3JkZXInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ09yZGVyIGNvdWxkIG5vdCBiZSBjYW5jZWxsZWQuJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R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gICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG9sZCBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNEZXBvc2l0JzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiBmYWxzZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYyNDQtZTMyOGE1MGMtNWVkMi0xMWU3LTk0N2ItMDQxNDE2NTc5YmIzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjIvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGF0Zm9ybS9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0ve3ByZWNpc2lvbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUjAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS97c2lkZX0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9sb25nL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vc2hvcnQvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYWxjL3RyYWRlL2F2ZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivb3JkZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlci97c3ltYm9sfTp7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9vZmZlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvbG9hbnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy90cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2luZm8vbWFyZ2luL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9mdW5kaW5nL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbW92ZW1lbnRzL3tjdXJyZW5jeX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3N0YXRzL3BlcmY6e3RpbWVmcmFtZX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3NldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3t0eXBlfTp7c3ltYm9sfTp7cHJpY2V9L2RlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9jYWxjL29yZGVyL2F2YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdBVlQvQlRDJzogeyAnaWQnOiAndEFWVEJUQycsICdzeW1ib2wnO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gICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1QnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgLy8gaXNzdWUgIzQgQml0ZmluZXggbmFtZXMgRGFzaCBhcyBEU0gsIGluc3RlYWQgb2YgREFTSFxuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RTSCcpXG4gICAgICAgICAgICByZXR1cm4gJ0RBU0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1FUTScpXG4gICAgICAgICAgICByZXR1cm4gJ1FUVU0nO1xuICAgICAgICAvLyBpc3N1ZSAjNzk2XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnSU9UJylcbiAgICAgICAgICAgIHJldHVybiAnSU9UQSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RBdXRoUldhbGxldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlVHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICdleGNoYW5nZScpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgWyBhY2NvdW50VHlwZSwgY3VycmVuY3ksIHRvdGFsLCBpbnRlcmVzdCwgYXZhaWxhYmxlIF0gPSBiYWxhbmNlO1xuICAgICAgICAgICAgaWYgKGFjY291bnRUeXBlID09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WzBdID09ICd0JylcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS5zbGljZSAoMSk7XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGF2YWlsYWJsZTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdG90YWw7XG4gICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ2ZyZWUnXSlcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2xQcmVjaXNpb24gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiAnUjAnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVyYm9vay5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJib29rW2ldO1xuICAgICAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbMV07XG4gICAgICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbMl07XG4gICAgICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPiAwKSA/ICdiaWRzJyA6ICdhc2tzJztcbiAgICAgICAgICAgIGFtb3VudCA9IE1hdGguYWJzIChhbW91bnQpO1xuICAgICAgICAgICAgcmVzdWx0W3NpZGVdLnB1c2ggKFsgcHJpY2UsIGFtb3VudCBdKTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHRbJ2JpZHMnXSA9IHRoaXMuc29ydEJ5IChyZXN1bHRbJ2JpZHMnXSwgMCwgdHJ1ZSk7XG4gICAgICAgIHJlc3VsdFsnYXNrcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYXNrcyddLCAwKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcb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IHRpY2tlcnMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gdGlja2VyWzBdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCBbIGlkLCB0aW1lc3RhbXAsIGFtb3VudCwgcHJpY2UgXSA9IHRyYWRlO1xuICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPCAwKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICBpZiAoYW1vdW50IDwgMCkge1xuICAgICAgICAgICAgYW1vdW50ID0gLWFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICA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LVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGJpdGZseWVyIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2JpdGZseWVyJyxcbiAgICAgICAgICAgICduYW1lJzogJ2JpdEZseWVyJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnSlAnLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODA1MTY0Mi01NjE1NDE4Mi02NjBlLTExZTctOWIwZC02MDQyZDFlNmVkZDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmJpdGZseWVyLmpwJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0Zmx5ZXIuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRmbHllci5qcC9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzJywgICAgLy8gb3IgJ21hcmtldHMnXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Ym9hcmQnLCAgICAgIC8vIG9yICdib2FyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR0aWNrZXInLCAgICAgLy8gb3IgJ3RpY2tlcidcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRleGVjdXRpb25zJywgLy8gb3IgJ2V4ZWN1dGlvbnMnXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0aGVhbHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGF0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbGFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRhZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5pbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5vdXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYW5rYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y2hpbGRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBhcmVudG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0dHJhZGluZ2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kcGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbHBhcmVudG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxhbGxjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncHJvZHVjdF9jb2RlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbnVtQ3VycmVuY2llcyA9IGN1cnJlbmNpZXMubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKG51bUN1cnJlbmNpZXMgPT0gMSkge1xuICAgICAgICAgICAgICAgIGJhc2UgPSBzeW1ib2wuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gc3ltYm9sLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtQ3VycmVuY2llcyA9PSAyKSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGN1cnJlbmNpZXNbMF07XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBjdXJyZW5jaWVzWzFdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBjdXJyZW5jaWVzWzJdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCx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ZiAoJ3NpZGUnIGluIHRyYWRlKVxuICAgICAgICAgICAgaWYgKHRyYWRlWydzaWRlJ10pIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBzaWRlICsgJ19jaGlsZF9vcmRlcl9hY2NlcHRhbmNlX2lkJztcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdHJhZGUpXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyID0gdHJhZGVbaWRdO1xuICAgICAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydleGVjX2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ3NpemUnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gIC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ZScpXG4gICAgICAgICAgICByZXF1ZXN0ICs9ICdtZS8nO1xuICAgICAgICByZXF1ZXN0ICs9IHBhdGg7XG4gICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIG5vbmNlLCBtZXRob2QsIHJlcXVlc3QsIGJvZHkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBQ0NFU1MtS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1USU1FU1RBTVAnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLVNJR04nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVyc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AuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20vdTEvVVMxMjcnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY2VudF90cmFuc2FjdGlvbnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3dhbGxldF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3BsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVyX2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idGNfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2tyd193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckFsbCAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1snZGF0YSddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBpZiAoaWQgIT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm9CYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogJ0FMTCcsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV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pO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlcmJvb2tbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ3F1YW50aXR5Jyk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodGlja2VyWydkYXRlJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4X3ByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbl9wcmljZScpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdidXlfcHJpY2UnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnc2VsbF9wcmljZScpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHRoaXMuc2FmZUZsb2F0IC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IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHRpY2tlclsnZGF0ZSddID0gdGltZXN0YW1wO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyQ3VycmVuY3kgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyIChyZXNwb25zZVsnZGF0YSddLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgIC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dXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICAgICAnUGF5bWVudF9jdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAndW5pdHMnOiBhbW91bnQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiAoc2lkZSA9PSAnYnV5JykgPyAnYmlkJyA6ICdhc2snLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnVHJhZGVQbGFjZSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ3VuaXRzJzogYW1vdW50LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0JyArIHRoaXMuY2FwaXRhbGlzZSAoc2lkZSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl9pZCcgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnb3JkZXJfaWQnXSlcbiAgICAgICAgICAgICAgICBpZCA9IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlk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lbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gYW5vbnltb3VzIDAuMyUsIHZlcmlmaWVkIDAuMiVcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHNfb3BlcmF0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGVzX2J5X2lkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9iY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RlbXBsYXRlX3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjY291bnRzX29wZXJhdGlvbnNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY3RpdmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2Jjb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV9tYXRjaGVzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudF9tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1fY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVzaWduJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWduaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25vdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19ieV9pZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKCF0aGlzLnN1YnN0aXR1dGVDb21tb25DdXJyZW5jeUNvZGVzKVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hCVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JUQyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQkNDJylcbiAgICAgICAgICAgIHJldHVybiAnQkNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEUksnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEU0gnKVxuICAgICAgICAgICAgY3VycmVuY3kgPSAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWERHJylcbiAgICAgICAgICAgIGN1cnJlbmN5ID0gJ0RPR0UnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya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WZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VycyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbbWFya2V0WydpZCddXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICcxbScsI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uY3kgPSAnREFTSCc7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hERycpXG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSAnRE9HRSc7XG4gICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2Z1bmRzJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydob2xkZWQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RTaWduaW4gKHtcbiAgICAgICAgICAgICdsb2dpbic6IHRoaXMubG9naW4sXG4gICAgICAgICAgICAncGFzc3dkJzogdGhpcy5wYXN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XJyb3JzJylcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGJpdG1hcmtldCBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRtYXJrZXQnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0TWFya2V0JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdQTCcsICdFVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxNTAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnOTBtJzogJzkwbScsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3ZCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzo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ZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40NSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjQ1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuNDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuNDMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuNDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuNDEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjQwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC4zOSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTkuOTksIDAuMzggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjM3IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuMzYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OS45OSwgMC4zNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjM0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMzMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OTkuOTksIDAuMzIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMzEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC45IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC44IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OS45OSwgMC43IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OS45OSwgMC40IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTk5Ljk5LCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMiwgLy8gU0VQQS4gVHJhbnNmZXIgSU5UICh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RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHlwZSddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SnNvbk1hcmtldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYX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J1ZTtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdQTE4nKVxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdxdWFudGl0eSc6IGFtb3VudCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHRoaXMuaXNGaWF0IChjdXJyZW5jeSkpIHtcbiAgICAgICAgICAgIG1ldGhvZCA9ICdwcml2YXRlUG9zdFdpdGhkcmF3RmlhdCc7XG4gICAgICAgICAgICBpZiAoJ2FjY291bnQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ2FjY291bnQnXSA9IHBhcmFtc1snYWNjb3VudCddOyAvLyBiYW5rIGFjY291bnQgY29kZSBmb3Igd2l0aGRyYXdhbFxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYWNjb3VudCBwYXJhbWV0ZXIgdG8gd2l0aGRyYXcgZmlhdCBjdXJyZW5jeScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdhY2NvdW50MicgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgcmVxdWVzdFsnYWNjb3VudDInXSA9IHBhcmFtc1snYWNjb3VudDInXTsgLy8gYmFuayBTV0lGVCBjb2RlIChFVVIgb25seSlcbiAgICAgICAgICAgIH0gZWxz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XBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoICsgJy5qc29uJywgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUEktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FQSS1IYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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gICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vdGVzdG5ldC5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzE5LWY2NTNjNmU2LTVlZDQtMTFlNy05MzNkLWYwYmMzNjk5YWU4Zi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbS9hcHAvYXBpT3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdE1FWC9hcGktY29ubmVjdG9ycy90cmVlL21hc3Rlci9vZmZpY2lhbC1odHRwJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fubm91bmNlbWVudC91cmdlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUFuZEluZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlSW50ZXJ2YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2NvbXBvc2l0ZUluZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2luZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3VyYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVhZGVyYm9hcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vay9MMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NjaGVtYS93ZWJzb2NrZXRIZWxwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZXR0bGVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jaGFubmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jb25uZWN0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9uL3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWZmaWxpYXRlU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoZWNrUmVmZXJyYWxDb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21pbldpdGhkcmF3YWxGZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXBpS2V5L2Rpc2FibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWxBbGxBZnRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2xvc2VQb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaXNvbGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3Jpc2tMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vdHJhbnNmZXJNYXJnaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2FuY2VsV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtRW1haWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kaXNhYmxlVEZBJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXRBbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJlZmVyZW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdEVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9yZXF1ZXN0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2J1bGsnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbnN0cnVtZW50QWN0aXZlQW5kSW5kaWNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ3N0YXRlJ10gIT0gJ1VubGlzdGVkJyk7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3VuZGVybHlpbmcnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgZnV0dXJlID0gZmFsc2U7XG4gICAgICAgICAgICBsZXQgcHJlZGljdGlvbiA9IGZhbHNlO1xuICAgICAgICAgICAgbGV0IGJhc2VxdW90ZSA9IGJhc2UgKyBxdW90ZTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3dhcCA9IChpZCA9PSBiYXNlcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKHN3YXApIHtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ3N3YXAnO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaWQuaW5kZXhPZiAoJ0JfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAncHJlZGljdGlvbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1ha2VyID0gbWFya2V0WydtYWtlckZlZSddO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gbWFya2V0Wyd0YWtlckZlZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydhbW91bnQnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAg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AncmV2ZXJzZSc6IHRydWUsXG4gICAgICAgIH0sIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdW90ZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFF1b3RlQnVja2V0ZWQgKHJlcXVlc3QpO1xuICAgICAgICBsZXQgcXVvdGVzTGVuZ3RoID0gcXVvdGVzLmxlbmd0aDtcbiAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVzW3F1b3Rlc0xlbmd0aCAtIDFdO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVCdWNrZXRlZCAocmVxdWVzdCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzWzBdO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHF1b3RlWydiaWRQcmljZSddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0IChxdW90ZVsnYXNrUHJpY2UnXSksXG4gICAgICAgICAgICAndndhcCc6IHBhcnNlRmxvYXQgKHRpY2tlclsndndhcCddKSxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogcGFyc2VGbG9hdCAodGlja2VyWydjbG9zZSddKSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5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gICAgICAgICAgIGlmICgnc3ltYm9sJyBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ3N5bWJvbCddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0cmRNYXRjaElEJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydzaXplJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0Wydp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sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWyd0cmFuc2FjdElEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID49IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHkpIHtcbiAgICAgICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGFuIGVtcHR5IHJlc3BvbnNlJyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBxdWVyeSA9ICcvYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICBxdWVyeSArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBxdWVyeTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgcXVlcnkgKyBub25jZTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdhcGktbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdhcGktc2lnbmF0dXJlJzogdGhpc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c6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzM1LTcxNWNlN2FhLTVlZDUtMTFlNy04OGE4LTE3M2EyN2JiMzBmZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0c28uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0c28uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYml0c28uY29tL2FwaV9pbmZvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXZhaWxhYmxlX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzL3tmaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nX2Rlc3RpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdreWNfZG9jdW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZnVuZGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci93aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXhfYmFua19jb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMve3RpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve3dpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYml0X2NhcmRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV9udW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3ZlcmlmaWNhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3BlaV93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QXZhaWxhYmxlQm9va3MgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzWydwYXlsb2FkJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydwYXlsb2FkJ11baV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Jvb2snXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC50b1VwcGVyQ2FzZSAoKS5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWFya2V0WydtaW5pbXVtX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV92YWx1ZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV92YWx1ZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5pbXVtX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9wcmljZSddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gbGltaXRzWydhbW91bnQnXVsnbWluJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxp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G1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydjcmVhdGVkX2F0J10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdib29rJyBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2Jvb2snXV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ21ha2VyX3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdib29rJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydwYXlsb2FkJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnYm9vayc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnbWFqb3InOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBwcmljZSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RPcmRlcnMgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9u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NC8yNzc4NjM3Ny04YzhhYjU3ZS01ZmU5LTExZTctOGVhNC0yYjA1YjZiY2NlZWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldC9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl9ob3VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy1wYWlycy1pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2Uve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmNoX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY2hfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMvYWxsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfc3RhdHVzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS9tYXJrZXQve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsdGNfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y19hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JpcHBsZV9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9vcGVuLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uX2FkZHJlc3MvbmV3LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjEnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMCwgMC4yNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMCwgMC4yMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMCwgMC4yMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzYwMDAwMCwgMC4xNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwLCAwLjEzIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjExIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDEsIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuOTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICA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Sk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2xJZCc6IHN5bWJvbElkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChjb3N0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgIC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uICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5lbmNvZGUgKHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGh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XG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Y3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwMjUsICd0YWtlcic6IDAuMDAyNSB9LFxuICAgICAg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yc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnb25lTWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnZml2ZU1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICd0aGlydHlNaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICdob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnZGF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzUyLWNmMGIzYzI2LTVlZDUtMTFlNy04MmI3LWYzODI2YjdhOTdkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JpdHRyZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndjInOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGkvdjIuMC9wdWInLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHRyZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9Ib21lL0FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5vcmcvcGFja2FnZS9ub2RlLmJpdHRyZXguYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9GZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaXR0cmV4LmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDAxOTk2NTEtV2hhdC1mZWVzLWRvZXMtQml0dHJleC1jaGFyZ2UtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvR2V0QlRDUHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRUaWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01hcmtldHMvR2V0TWFya2V0U3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0TGF0ZXN0VGljaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2FjY291bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRhZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JERCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSk7XG4gICAgfVxuXG4gICAgZmVlVG9QcmVjaXNpb24gKHN5bWJvbCwgZmVlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChwYXJzZUZsb2F0IChmZWUpLCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudjJHZXRNYXJrZXRzR2V0TWFya2V0U3VtbWFyaWVzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2VbJ3Jlc3VsdCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddW2ldWydNYXJrZXQnXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnSXNBY3RpdmUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuYWNjb3VudEdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGluZGV4ZWQgPSB0aGlzLmluZGV4QnkgKGJhbGFuY2VzLCAnQ3VycmVuY3knKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoaW5kZXhlZCk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gaW5kZXhlZFtpZF07XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0F2YWlsYWJsZSddKTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHRvdGFsIC0gZnJlZTtcbiAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGZyZWU7XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSB1c2VkO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogW10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgICAgICAgICAnYnV5JzogW10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogcmVzcG9uc2VbJ3Jlc3VsdCddLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5JywgJ3NlbGwnLCAnUmF0ZScsICdRdWFudGl0eScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnVGltZVN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdMb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnQmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbi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zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydDdXJyZW5jeUxvbmcnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogY3VycmVuY3lbJ0lzQWN0aXZlJ10sXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydUeEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ1R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHN1bW1hcmllcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1t0XTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJy0nKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJ5ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J11bMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdCVVknKSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdTRUxMJykge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnSWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgaWQgPSB0cmFkZVsnSWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydQcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnUXVhbnRpdHknXSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFk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SREVSX05PVF9PUEVOJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PSAnVVVJRF9JTlZBTElEJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgZXJyb3I6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ09yZGVyVHlwZScgaW4gb3JkZXIpXG4gICAgICAgICAgICBzaWRlID0gKG9yZGVyWydPcmRlclR5cGUnXSA9PSAnTElNSVRfQlVZJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgaWYgKCdUeXBlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ1R5cGUnXSA9PSAnTElNSVRfQlVZJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IHN0YXR1cyA9ICdvcGVuJztcbiAgICAgICAgaWYgKG9yZGVyWydDbG9zZWQnXSkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAob3JkZXJbJ0NhbmNlbEluaXRpYXRlZCddKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICB9XG4gICAgICAgIGxldC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IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdMaW1pdCcpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdRdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHlSZW1haW5pbmcnLCAwLjApO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBpZiAoIWNvc3QpIHtcbiAgICAgICAgICAgIGlmIChwcmljZSAmJiBhbW91bnQpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICghcHJpY2UpIHtcbiAgICAgICAgICAgIGlmIChjb3N0ICYmIGZpbGxlZClcbiAgICAgICAgICAgICAgICBwcmljZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZVBlclVuaXQnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnT3JkZXJVdWlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJ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ZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY3lJZCA9IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5SWQsXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCd1dWlkJyBpbiByZXNwb25zZVsncmVzdWx0J10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJztcbiAgICAgICAgaWYgKGFwaSAhPSAndjInKVxuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3YyJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBhcGkgKyAnLyc7XG4gICAgICAgICAgICBpZiAoKChhcGkgPT0gJ2FjY291bnQnKSAmJiAocGF0aCAhPSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT0gJ29wZW5vcmRlcnMnKSlcbiAgICAgICAgICAgICAgICB1cmwgKz0gbWV0aG9kLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnYXBpc2lnbic6IHNpZ25hdHVyZSB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID49IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdJTlNVRkZJQ0lFTlRfRlVORFMnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydtZXNzYWdlJ10gPT0gJ01JTl9UUkFERV9SRVFVSVJFTUVOVF9OT1RfTUVUJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnQVBJS0VZX0lOVkFMSUQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmhhc0FscmVhZHlBdXRoZW50aWNhdGVkU3VjY2Vzc2Z1bGx5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnRFVTVF9UUkFERV9ESVNBTExPV0VEX01JTl9WQUxVRV81MEtfU0FUJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgY29zdCBzaG91bGQgYmUgb3ZlciA1MGsgc2F0b3NoaSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAvLyBhIHdvcmthcm91bmQgZm9yIEFQSUtFWV9JTlZBTElEXG4gICAgICAgICAgICAgICAgaWYgKChhcGkgPT0gJ2FjY291bnQnKSB8fCAoYXBpID09ICdtYXJrZXQnKSlcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5oYXNBbHJlYWR5QXV0aGVudGljYXRlZFN1Y2Nlc3NmdWxseSA9IHRydWU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdBRERSRVNTX0dFTkVSQVRJTkcnKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdJTlNVRkZJQ0lFTlRfRlVORFMnKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmV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ICAgICAgICAgJ2lkJzogJ2JsM3AnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQkwzUCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnTkwnLCAnRVUnIF0sIC8vIE5ldGhlcmxhbmRzLCBFVVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0FuIGV4Y2hhbmdlIG1hcmtldCBieSBCaXRvbmljTkwnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg1MDE3NTItNjBjMjFiODItNmZlYi0xMWU3LTgxOGItMDU1ZWU2ZDBlNzU0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0b25pYy5ubCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdG9uaWNOTC9ibDNwLWFwaS90cmVlL21hc3Rlci9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmwzcC5ldS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sL2VuL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvZGVwdGgvZnVsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvdHJhZGVzL2ZldGNoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L25ld19kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS93YWxsZXQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAg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uY3kgaW4gYmFsYW5jZSkge1xuICAgICAgICAgICAgICAgIGlmICgnYXZhaWxhYmxlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsnYXZhaWxhYmxlJ11bJ3ZhbHVlJ10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2JhbGFuY2UnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIHBhcnNlQmlkQXNrIChiaWRhc2ssIHByaWNlS2V5ID0gMCwgYW1vdW50S2V5ID0gMCkge1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgYmlkYXNrWydwcmljZV9pbnQnXSAvIDEwMDAwMC4wLFxuICAgICAgICAgICAgYmlkYXNrWydhbW91bnRfaW50J10gLyAxMDAwMDAwMDAuMCxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVsnMjRoJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRyYWRlWydkYXRlJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRyYWRlWydkYXRlJ10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaW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ZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gcmVxdWVzdCArIFwiXFwwXCIgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnUmVzdC1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnUmVzdC1TaWduJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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ICAgICAgICAgICAgICAgICAgJ21hcmtldCc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3Jlc3VsdCddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydNYXJrZXRDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ0lzQWN0aXZlJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAg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gICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2J0Y2JveCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdCdGNCb3gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdKUCcsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTI3NTgwMy00ZGY3NTVhOC1hYWExLTExZTctOWFiYi0xMWVjMmZhZDlmMmQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJ0Y2JveC5jby5qcC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjYm94LmNvLmpwLycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGNib3guY28uanAvaGVscC9hc20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FsbHRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX3ZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0pQWSc6IHsgJ2lkJzogJ0JUQy9KUFknLCAnc3ltYm9sJzogJ0JUQy9KUFknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSlBZJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAobG93ZXJjYXNlID09ICdkYXNoJylcbiAgICAgICAgICAgICAgICBsb3dlcmNhc2UgPSAnZHJrJztcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBsb3dlcmNhc2UgKyAnX2JhbGFuY2UnO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBsb3dlcmNhc2UgKyAnX2xvY2snO1xuICAgICAgICAgICAgaWYgKGZyZWUgaW4gYmFsYW5jZXMpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbZnJlZV0pO1xuICAgICAgICAgICAgaWYgKHVzZWQgaW4gYmFsYW5jZXMpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbdXNlZF0pO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBsZXQgbnVtU3ltYm9scyA9IHRoaXMuc3ltYm9scy5sZW5ndGg7XG4gICAgICAgIGl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TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0eXBlJzogc2lkZSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG51bVN5bWJvbHMgPSB0aGlzLnN5bWJvbHMubGVuZ3RoO1xuICAgICAgICBpZiAobnVtU3ltYm9scyA+IDEpXG4gICAgICAgICAgICByZXF1ZXN0Wydjb2luJ10gPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZUFkZCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlQ2FuY2VsICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBzZWNyZXQgPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgcXVlcnlbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAocmVxdWVzdCksIHRoaXMuZW5jb2RlIChzZWNyZXQpKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogY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RlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYnRjY2hpbmEnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlRDQ2hpbmEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYzNjgtNDY1YjMyODYtNWVkNi0xMWU3LTlhMTEtMGY2NDY3ZTFkODJiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3BsdXMnOiAnaHR0cHM6Ly9wbHVzLWFwaS5idGNjaGluYS5jb20vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2RhdGEuYnRjY2hpbmEuY29tL2RhdGEnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5idGNjaGluYS5jb20vYXBpX3RyYWRlX3YxLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20vYXBpZG9jcydcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwbHVzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnlkYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eVN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEljZWJlcmdPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0U3RvcE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbE9yZGVyMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y2NueScsICdzeW1ib2wnOiAnQlRDL0NOWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdDTlknLCAnYXBpJzogJ3B1YmxpYycsICdwbHVzJzogZmFsc2UgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0NO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V0c1trZXldO1xuICAgICAgICAgICAgbGV0IHBhcnRzID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGlkID0gcGFydHNbMV07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSA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9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcCA9IFtdO1xuICAgICAgICAgICAgaWYgKCdwYXJhbXMnIGluIHBhcmFtcylcbiAgICAgICAgICAgICAgICBwID0gcGFyYW1zWydwYXJhbXMnXTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBwID0gcC5qb2luICgnLCcpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSAoXG4gICAgICAgICAgICAgICAgJ3RvbmNlPScgKyBub25jZSArXG4gICAgICAgICAgICAgICAgJyZhY2Nlc3NrZXk9JyArIHRoaXMuYXBpS2V5ICtcbiAgICAgICAgICAgICAgICAnJnJlcXVlc3RtZXRob2Q9JyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArXG4gICAgICAgICAgICAgICAgJyZpZD0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmbWV0aG9kPScgKyBwYXRoICtcbiAgICAgICAgICAgICAgICAnJnBhcmFtcz0nICsgcFxuICAgIC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zJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjkxNDI5MTEtMGUxYWNmYzItN2Q1Yy0xMWU3LTk4YzQtMDdkOTUzMmIyOWQ3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5idGNtYXJrZXRzLm5ldCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Y21hcmtldHMubmV0LycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQlRDTWFya2V0cy9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2lkfS90cmFkaW5nZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3Q3J5cHRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kdHJhbnNmZXIvd2l0aGRyYXdFRlQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci90cmFkZS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGVCYXRjaCcsIC8vIHRoZXkgcHJvbWlzZSBpdCdzIGNvbWluZyBzb29uLi4uXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQVVEJzogeyAnaWQnOiAnQlRDL0FVRCcsICdzeW1ib2wnOiAnQlRDL0FVRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdBVUQnLCAnbWFrZXInOiAwLjAwODUsICd0YWtlcic6IDAuMDA4NSB9LFxuICAgICAgICAgICAgICAgICdMVEMvQVVEJzogeyAnaWQnOiAnTFRDL0FVRCcsICdzeW1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G4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Jlc3RCaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydiZXN0QXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0UHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGgnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldElkVGljayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZS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bXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5jYW5jZWxPcmRlcnMgKFsgaWQgXSk7XG4gICAgfVxuXG4gICAgcGFyc2VNeVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCBtdWx0aXBsaWVyID0gMTAwMDAwMDAwO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2NyZWF0aW9uVGltZSddO1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnc2lkZSddID09ICdCaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICAvLyBCVENNYXJrZXRzIGFsd2F5cyBjaGFyZ2UgaW4gQVVEIGZvciBBVUQtcmVsYXRlZCB0cmFuc2FjdGlvbnMuXG4gICAgICAgIGxldCBjdXJyZW5jeSA9IChtYXJrZXRbJ3F1b3RlJ10gPT0gJ0FVRCcpID8gbWFya2V0WydxdW90ZSddIDogbWFya2V0WydiYXNlJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddIC8gbXVsdGlwbGllcixcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICA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gICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHRyYWRlcyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGlkcyA9IFsgaWQgXTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE9yZGVyRGV0YWlsICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVySWRzJzogaWRzLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG51bU9yZGVycyA9IHJlc3BvbnNlWydvcmRlcnMnXS5sZW5ndGg7XG4gICAgICAgIGlmIChudW1PcmRlcnMgPCAxKVxuICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaX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hpcy5wYXJzZU15VHJhZGVzIChyZXNwb25zZVsndHJhZGVzJ10sIG1hcmtldCk7XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJpID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVyaTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHVyaSArIFwiXFxuXCIgKyBub25jZSArIFwiXFxuXCI7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnOiBub25jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgc2VjcmV0LCAnc2hhNTEyJywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVyc1snc2lnbmF0dXJlJ10gPSB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pXG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZ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ICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Yy10cmFkZS5jb20udWEnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZG9jdW1lbnQvZC8xb2NZQTB5TXlfUlhkNTYxc2ZHM3FFUFo4MGt5bGwzNkhVeHZDUmU1R2JoRS9lZGl0JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVhbHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9zZWxsL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqYXBhbl9zdGF0L2hpZ2gve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215X29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbW92ZS9vcmRlci97aWR9JyxcbiAg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ndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNpZ25JbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByaXZhdGVQb3N0QXV0aCAoKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGlmICgnYWNjb3VudHMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudHMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYWNjb3VudHMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IGFjY291bnRzW2JdO1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGFjY291bnRbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChhY2NvdW50WydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgYmlkcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzQnV5U3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBhc2tzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNTZWxsU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGJpZHMpIHtcbiAgICAgICAgICAgIGlmICgnbGlzdCcgaW4gYmlkcylcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2JpZHMnXSA9IGJpZHNbJ2xpc3QnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYXNrcykge1xuICAgICAgICAgICAgaWYgKCdsaXN0JyBpbiBhc2tzKVxuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYXNrcyddID0gYXNrc1snbGlzdCddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICdjdXJyZW5jeV90cmFkZScpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SmFwYW5TdGF0SGlnaFN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMuZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCk7XG4gICAgICAgIGxldCBiaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBudW1CaWRzID0gb3JkZXJib29rWydiaWRzJ10ubGVuZ3RoO1xuICAgICAgICBpZiAobnVtQmlkcyA+IDApXG4gICAgICAgICAgICBiaWQgPSBvcmRlcmJvb2tbJ2JpZHMnXVswXVswXTtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG51bUFza3MgPSBvcmRlcmJvb2tbJ2Fza3MnXS5sZW5ndGg7XG4gICAgICAgIGlmIChudW1Bc2tzID4gMClcbiAgICAgICAgICAgIGFzayA9IG9yZGVyYm9va1snYXNrcyddWzBdWzBdO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RyYWRlcyddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBiaWQsXG4gICAgICAgICAgICAnYXNrJzogYXNrLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdGlja2VyTGVuZ3RoID0gdGlja2VyLmxlbmd0aDtcbiAgICAgICAgaWYgKHRpY2tlckxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGxldCBzdGFydCA9IE1hdGgubWF4ICh0aWNrZXJMZW5ndGggLSA0OCwgMCk7XG4gICAgICAgICAgICBmb3IgKGxldCB0ID0gc3RhcnQ7IHQgPCB0aWNrZXIubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FuZGxlID0gdGlja2VyW3RdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydvcGVuJ10gPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnb3BlbiddID0gY2FuZGxlWzFdO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHJlc3VsdFsnaGlnaCddID09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0WydoaWdoJ10gPCBjYW5kbGVbMl0pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2hpZ2gnXSA9IGNhbmRsZVsyXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2xvdyddID09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0Wydsb3cnXSA+IGNhbmRsZVszXSkpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnbG93J10gPSBjYW5kbGVbM107XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtY2FuZGxlWzVdO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gLT0gY2FuZGxlWzVdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGxhc3QgPSB0aWNrZXJMZW5ndGggLSAxO1xuICAgICAgICAgICAgcmVzdWx0WydjbG9zZSddID0gdGlja2VyW2xhc3RdWzRdO1xuICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtMSAqIHJlc3VsdFsnYmFzZVZvbHVtZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29udmVydEN5cmlsbGljTW9udGhOYW1lVG9TdHJpbmcgKGN5cmlsbGljKSB7XG4gICAgICAgIGxldCBtb250aHMgPSBbXG4gICAgICAgICAgICAn0Y/QvdCy0LDRgNGPJyxcbiAgICAgICAgICAgICfRhNC10LLRgNCw0LvRjycsXG4gICAgICAgICAgICAn0LzQsNGA0YLQsCcsXG4gICAgICAgICAgICAn0LDQv9GA0LXQu9GPJyxcbiAgICAgICAgICAgICfQvNCw0Y8nLFxuICAgICAgICAgICAgJ9C40Y7QvdGPJyxcbiAgICAgICAgICAgICfQuNGO0LvRjycsXG4gICAgICAgICAgICAn0LDQstCz0YPRgdGC0LAnLFxuICAgICAgICAgICAgJ9GB0LXQvdGC0Y/QsdGA0Y8nLFxuICAgICAgICAgICAgJ9C+0LrRgtGP0LHRgNGPJyxcbiAgICAgICAgICAgICfQvdC+0Y/QsdGA0Y8nLFxuICAgICAgICAgICAgJ9C00LXQutCw0LHRgNGPJyxcbiAgICAgICAgXTtcbiAgICAgICAgbGV0IG1vbnRoID0gdW5kZWZpbmVkO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1vbnRocy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGN5cmlsbGljID09IG1vbnRoc1tpXSkge1xuICAgICAgICAgICAgICAgIG1vbnRoID0gaSArIDE7XG4gICAgICAgICAgICAgICAgbW9udGggPSBtb250aC50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICBpZiAoaSA8IDkpXG4gICAgICAgICAgICAgICAgICAgIG1vbnRoID0gJzAnICsgbW9udGg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG1vbnRoO1xuICAgIH1cblxuICAgIHBhcnNlQ3lyaWxsaWNEYXRldGltZSAoY3lyaWxsaWMpIHtcbiAgICAgICAgbGV0IHBhcnRzID0gY3lyaWxsaWMuc3BsaXQgKCcgJyk7XG4gICAgICAgIGxldCBkYXkgPSBwYXJ0c1swXTtcbiAgICAgICAgbGV0IG1vbnRoID0gdGhpcy5jb252ZXJ0Q3lyaWxsaWNNb250aE5hbWVUb1N0cmluZyAocGFydHNbMV0pO1xuICAgICAgICBpZiAoIW1vbnRoKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHBhcnNlVHJhZGUoKSB1bmRlZmluZWQgbW9udGggbmFtZTogJyArIGN5cmlsbGljKTtcbiAgICAgICAgbGV0IHllYXIgPSBwYXJ0c1syXTtcbiAgICAgICAgbGV0IGhtcyA9IHBhcnRzWzRdO1xuICAgICAgICBsZXQgaG1zTGVuZ3RoID0gaG1zLmxlbmd0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ZSAoc2lkZSkgKyAnSWQnO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnY291bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY3VycmVuY3kxJzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydiYXNlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgfTtcbiAgICAgICAgcmV0dXJuIHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RSZW1vdmVPcmRlcklkICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ2lkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLCAvLyB1bnRpbCB0aGV5IGZpeCB0aGVpciB0aW1lc3RhbXBcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb3BlbicsXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsndHlwZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1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XJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ291dF9vcmRlcl9pZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gYm9keSArIHRoaXMuc2VjcmV0O1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAncHVibGljLWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdhcGktc2lnbic6IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKGF1dGgpLCAnc2hhMjU2JyksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxu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biAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5OTI3MDktMThlMTU2NDYtNjRhMy0xMWU3LTlmYTItYjA5NTBlYzc3MTJmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjdHVyay5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ1RyYWRlci9icm9rZXItYXBpLWRvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjZGF0YScsIC8vID9sYXN0PUNPVU5UXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsICAgLy8gP2xhc3Q9Q09VTlQgKG1heCA1MClcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJUcmFuc2FjdGlvbnMnLCAvLyA/b2Zmc2V0PTAmbGltaXQ9MjUmc29ydD1hc2NcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1RSWSc6IHsgJ2lkJzogJ0JUQ1RSWScsICdzeW1ib2wnOiAnQlRDL1RSWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdUUlknLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic6IDAuMDAzNSAqIDEuMTggfSxcbiAgICAgICAgICAgICAgICAnRVRIL1RSWSc6IHsgJ2lkJzogJ0VUSFRSWScsICdzeW1ib2wnOiAnRVRIL1RSWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdUUlknLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic6IDAuMDAzNSAqIDEuMTggfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ0VUSEJUQycsICdzeW1ib2wnOiAnRVRIL0JUQycsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdCVEMnLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic6IDAuMDAzNSAqIDEuMTggfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xu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BhcnNlSW50IChvcmRlcmJvb2tbJ3RpbWVzdGFtcCddICogMTAwMCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHRpbWVzdGFtcCk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyWydvcGVuJ10pLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXZlcmFnZSddKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWNrZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSB0aWNrZXJbJ3BhaXInXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtzeW1ib2xdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5mZXRjaFRpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wgaW4gdGlja2VycylcbiAgICAgICAgICAgIHJlc3VsdCA9IHRpY2tlcnNbc3ltYm9sXTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZGVbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogdHJhZGVbJ2Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1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gICAgICBsZXQgcmVxdWVzdCA9IHt9O1xuICAgICAgICBpZiAobGltaXQpXG4gICAgICAgICAgICByZXF1ZXN0WydsYXN0J10gPSBsaW1pdDtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPaGxjZGF0YSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAocmVzcG9uc2UsIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ1R5cGUnOiAoc2lkZSA9PSAnYnV5JykgPyAnQnV5QnRjJyA6ICdTZWxCdGMnLFxuICAgICAgICAgICAgJ0lzTWFya2V0T3JkZXInOiAodHlwZSA9PSAnbWFya2V0JykgPyAxIDogMCxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWydUb3RhbCddID0gYW1vdW50O1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG9yZGVyWydBbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9yZGVyWydQcmljZSddID0gcHJpY2U7XG4gICAgICAgICAgICBvcmRlclsnQW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID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gICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Yy91c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnYnRjL2V1cicsICdzeW1ib2wnOiAnQlRDL0VVUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdFVVInIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNl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zJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkL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QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdNZXRob2QnOiBwYXRoLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4g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ICAgICAgICAgICAnY291bnRyaWVzJzogWyAnVkcnLCAnQ04nIF0sIC8vIEJyaXRpc2ggVmlyZ2luIElzbGFuZHMsIENoaW5hXG4gICAgICAgICAgICAndmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTgwNDc5LWNmYTMxODhjLTYzODctMTFlNy04MTkxLTkzZmM0MTg0YmE1Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kYXRhLmJ0ZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJ0ZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnRlci5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9idGVyLmNvbS9hcGkyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd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FpbHNbJ2RlY2ltYWxfcGxhY2VzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGV0YWlsc1snbWluX2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdh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y5wdWJsaWNHZXRUaWNrZXJzIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgWyBiYXNlSWQsIHF1b3RlSWQgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBiYXNlSWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBxdW90ZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHMpXG4gICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzW3N5bWJvbF07XG4gICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGF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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGJ4aW50aCBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdieGludGgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQlguaW4udGgnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdUSCcsIC8vIFRoYWlsYW5kXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0MTItNTY3YjFlYjQtNWVkNy0xMWU3LTk0YTgtZmY2YTM4ODRmNmM1LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2J4LmluLnRoL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J4LmluLnRoJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnguaW4udGgvaW5mby9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLCAvLyB0aWNrZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbGdyb3VwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxscGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15aXNzdWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15b3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWV4ZXJjaXNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24taGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwtaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJpbmcgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3BhaXJpbmdfaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydzZWNvbmRhcnlfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJpbWFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIC8vIHdoeSB3b3VsZCB0aGV5IHVzZSB0aHJlZSBsZXR0ZXJzIGluc3RlYWQgb2YgZm91ciBmb3IgY3VycmVuY3kgY29kZXNcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEQVMnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdET0cnKVxuICAgICAgICAgICAgcmV0dXJuICdET0dFJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2UpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydhdmFpbGFibGUnXSksXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcmluZyc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3JkZXJib29rJ11bJ2JpZHMnXVsnaGlnaGJpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ29yZGVyYm9vayddWydhc2tzJ11bJ2hpZ2hiaWQnXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3RfcHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogcGFyc2VGbG9hdCAodGlja2VyWydjaGFuZ2UnXSksXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyY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W5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdrZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgICAgIC8vIHR3b2ZhOiB0aGlzLnR3b2ZhLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJylcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk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AndGlja2Vycyc6ICdodHRwczovL2MtY2V4LmNvbS90JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2MtY2V4LmNvbS90L2FwaV9wdWIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2MtY2V4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2MtY2V4LmNvbS8/aWQ9YXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd0aWNrZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5uYW1lcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ZvbHVtZV97Y29pbn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlZGlzdHJpYnV0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3Blbm9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdJT1QnKVxuICAgICAgICAgICAgcmV0dXJuICdJb1Rjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCTEMnKVxuICAgICAgICAgICAgcmV0dXJuICdDcnlwdG9idWxsY29pbic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWElEJylcbiAgICAgICAgICAgIHJldHVybiAnSW50ZXJuYXRpb25hbERpYW1vbmQnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx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ucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgICAgICdkZXB0aCc6IDEwMCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2J1eScsICdzZWxsJywgJ1JhdGUnLCAnUXVhbnRpdHknKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJz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wZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt1cHBlcmNhc2VdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlcmNhc2Uuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudGlja2Vyc0dldE1hcmtldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZVN0YW1wJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ0lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydPcmRlclR5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydQcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydRdWFudGl0eSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdC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gpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlR2V0Q2FuY2VsICh7ICd1dWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJykgfTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYSc6ICdnZXQnICsgcGF0aCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuIC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wczovL2NleC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NleC5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfbGltaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlcy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdi9oZC97eXl5eW1tZGR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb252ZXJ0L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Vfc3RhdHMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfb3JkZXJzX3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyY2hpdmVkX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfcmVwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbG9zZV9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9teWZlZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl90eC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX3Bvc2l0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeUxpbWl0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sMSddICsgJy8nICsgbWFya2V0WydzeW1ib2wyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluUHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiAtMSAqIE1hdGgubG9nMTAgKG1hcmtldFsnbWluTG90U2l6ZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5Mb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhMb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4UHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluTG90U2l6ZVMyJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IG9tbWl0ZWQgPSBbICd1c2VybmFtZScsICd0aW1lc3RhbXAnIF07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2UsIG9tbWl0ZWQpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdhdmFpbGFibGUnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdvcmRlcnMnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwY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CBiaWQgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyk7XG4gICAgICAgIGxldCBhc2sgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyk7XG4gICAgICAgIGxldCBsYXN0ID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IGlzbzg2MDEsXG4gICAgICAgICAgICAnaGlnaCc6IGhpZ2gsXG4gICAgICAgICAgICAnbG93JzogbG93LFxuICAgICAgICAgICAgJ2JpZCc6IGJpZCxcbiAgICAgICAgICAgICdhc2snOiBhc2ssXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBsYXN0LFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxu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pY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0a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9hdCAob3JkZXIsICd0YTonICsgbWFya2V0WydxdW90ZSddKTtcbiAgICAgICAgICAgIGxldCBiYXNlRmVlID0gJ2ZhOicgKyBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUZlZSA9ICdmYTonICsgbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgbGV0IGZlZVJhdGUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0cmFkaW5nRmVlTWFrZXInKTtcbiAgICAgICAgICAgIGlmICghZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndHJhZGluZ0ZlZVRha2VyJywgZmVlUmF0ZSk7XG4gICAgICAgICAgICBpZiAoZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlIC89IDEwMC4wOyAvLyBjb252ZXJ0IHRvIG1hdGhlbWF0aWNhbGx5LWNvcnJlY3QgcGVyY2VudGFnZSBjb2VmZmljaWVudHM6IDEuMCA9IDEwMCVcbiAgICAgICAgICAgIGlmIChiYXNlRmVlIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgYmFzZUZlZSksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGVGZWUgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb3N0KVxuICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3Blbk9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGxld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gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlID09IHRydWUpIHtcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgfSBlbHNlIGlmICgnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmICgnb2snIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnb2snXSA9PSAnb2snKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgIC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3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU1NTY1OS1mMDA0MGRjMi03MTA5LTExZTctOWQ5OS02ODhhNDM4YmY5ZjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuY2hidGMuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY2hidGMuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGdldE1hcmtldEZpZWxkTmFtZSAoKSB7XG4gICAgICAgIHJldHVybiAnY3VycmVuY3knO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ2J0Y19jbnknLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJyB9LFxuICAgICAgICAgICAgJ0xUQy9DTlknOiB7ICdpZCc6ICdsdGNfY255JywgJ3N5bWJvbCc6ICdMVEMvQ05ZJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0NOWScgfSxcbiAgICAgICAgICAgICdFVEgvQ05ZJzogeyAnaW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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgY29pbmNoZWNrIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5jaGVjaycsXG4gICAgICAgICAgICAnbmFtZSc6ICdjb2luY2hlY2snLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ0lEJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ2NC0zYjVjM2M3NC01ZWQ5LTExZTctODQwZS0zMWIzMjk2OGUxZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luY2hlY2suY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vY29pbmNoZWNrLmNvbS9kb2N1bWVudHMvZXhjaGFuZ2UvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2xldmVyYWdlX2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9vcGVucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9uc19wYWdpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sZXZlcmFnZS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy9tYXRjaGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5L3tpZH0vZmFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvdG9fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy9mcm9tX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy97aWR9L3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSlBZJzogeyAnaWQnOiAnYnRjX2pweScsICdzeW1ib2wnOiAnQlRDL0pQWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdKUFknIH0sIC8vIHRoZSBvbmx5IHJlYWwgcGFpclxuICAgICAgICAgICAgICAgIC8vICdFVEgvSlBZJzogeyAnaWQnOiAnZXRoX2pweScsICdzeW1ib2wnOiAnRVRIL0pQWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdKUFknI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IGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0cmluZyA9ICcnO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHF1ZXJ5KSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAocXVlcnkpKTtcbiAgICAgICAgICAgICAgICAgICAgcXVlcnlTdHJpbmcgPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UgKyB1cmwgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdBQ0NFU1MtS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FDQ0VT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ci5jby51ay9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9lc3RpbWF0ZV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c2FmZUZsb2F0ICh0aWNrZXIsICd2d2FwJyk7XG4gICAgICAgIGxldCBiYXNlVm9sdW1lID0gcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXSk7XG4gICAgICAgIGxldCBxdW90ZVZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiB2d2FwICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICBxdW90ZVZvbHVtZSA9IGJhc2VWb2x1bWUgKiB2d2FwO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldElkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pLFxuICAgICA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gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbmdpJyxcbiAgICAgICAgICAgICduYW1lJzogJ0NvaW5naScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiBbICdQQScsICdCRycsICdDTicsICdVUycgXSwgLy8gUGFuYW1hLCBCdWxnYXJpYSwgQ2hpbmEsIFVTXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NjE5NzA3LTVjOTIzMmE4LTcyMTItMTFlNy04NmQ2LTk4ZmU1ZDE1Y2M2ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luZ2kuY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbnQnOiAnaHR0cHM6Ly9hcGkuY29pbmdpLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd1c2VyJzogJ2h0dHBzOi8vYXBpLmNvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cDovL2RvY3MuY29pbmdpLmFwaWFyeS5pby8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3d3dyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2N1cnJlbnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXItYm9vay97cGFpcn0ve2Fza0NvdW50fS97YmlkQ291bnR9L3tkZXB0aH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0ve21heENvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjRob3VyLXJvbGxpbmctYWdncmVnYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZXInOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsLW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlLWNyeXB0by13aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTUMnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMSxcbiAgICAgICAgICAgICAgICA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gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4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OiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGlja2VyWydiYXNlVm9sdW1lJ10sXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aWNrZXJbJ2NvdW50ZXJWb2x1bWUnXSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gdGlja2VyO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5jdXJyZW50R2V0MjRob3VyUm9sbGluZ0FnZ3JlZ2F0aW9uIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgcmVzcG9uc2UubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVt0XTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGlja2VyWydjdXJyZW5jeVBhaXInXVsnYmFzZSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGlja2VyWydjdXJyZW5jeVBhaXInXVsnY291bnRlciddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0cykge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgfVx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B9IGVsc2UgaWYgKGFwaSA9PSAndXNlcicpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAndG9rZW4nOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UudG9TdHJpbmcgKCkgKyAnJCcgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ2N1cnJlbnQnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZH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AgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1ByaXZhdGVBUEknOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNDcmVhdGVPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0NhbmNlbE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hCYWxhbmNlJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlckJvb2snOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODI0NDI0NC05YmU2MzEyYS02OWVkLTExZTctOTljMS03YzE3OTcyNzUyNjUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2xvYmFsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY3VycmVuY3lDb2Rlcyc6IFtcbiAgICAgICAgICAgICAgICAnQVVEJyxcbiAgICAgICAgICAgICAgICAnQlJMJyxcbiAgICAgICAgICAgICAgICAnQ0FEJyxcbiAgICAgICAgICAgICAgICAnQ0hGJyxcbiAgICAgICAgICAgICAgICAnQ05ZJyxcbiAgICAgICAgICAgICAgICAnRVVSJyxcbiAgICAgICAgICAgICAgICAnR0JQJyxcbiAgICAgICAgICAgICAgICAnSEtEJyxcbiAgICAgICAgICAgICAgICAnSURSJyxcbiAgICAgICAgICAgICAgICAnSU5SJyxcbiAgICAgICAgICAgICAgICAnSlBZJyxcbiAgICAgICAgICAgICAgICAnS1JXJyxcbiAgICAgICAgICAgICAgICAnTVhOJyxcbiAgICAgICAgICAgICAgICAnUlVCJyxcbiAgICAgICAgICAgICAgICAnVVNEJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICgnRmV0Y2hpbmcgb3JkZXIgYm9va3MgaXMgbm90IHN1cHBvcnRlZCBieSB0aGUgQVBJIG9mICcgKyB0aGlzLmlkKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB0aGlzLmN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuIC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vbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHZvbHVtZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgbGV0IHByaWNlS2V5ID0gJ3ByaWNlXycgKyBtYXJrZXRbJ3F1b3RlSWQnXTtcbiAgICAgICAgICAgIGlmIChwcmljZUtleSBpbiB0aWNrZXIpXG4gICAgICAgICAgICAgICAgaWYgKHRpY2tlcltwcmljZUtleV0pXG4gICAgICAgICAgICAgICAgICAgIGxhc3QgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCBwcmljZUtleSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IHZvbHVtZUtleSA9ICcyNGhfdm9sdW1lXycgKyBtYXJrZXRbJ3F1b3RlSWQnXTtcbiAgICAgICAgICAgIGlmICh2b2x1bWVLZXkgaW4gdGlja2VyKVxuICAgICAgICAgICAgICAgIGlmICh0aWNrZXJbdm9sdW1lS2V5XSlcbiAgICAgICAgICAgICAgICAgICAgdm9sdW1lID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgdm9sdW1lS2V5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsb3cnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmlkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Fzayc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRl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ICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRpY2tlcnNbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGlja2VycztcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb252ZXJ0JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJJZCAocmVxdWVzdCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVswXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEN1cnJlbmNpZXMgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydzeW1ib2wnXTtcbiAgICAgICAgICAgIC8vIHRvZG86IHdpbGwgbmVlZCB0byByZXRoaW5rIHRoZSBmZWVzXG4gICAgICAgICAgICAvLyB0byBhZGQgc3VwcG9ydCBmb3IgbXVsdGlwbGUgd2l0aGRyYXdhbC9kZXBvc2l0IG1ldGhvZHMgYW5kXG4gICAgICAgICAgICAvLyBkaWZmZXJlbnRpYXRlZCBmZWVzIGZvciBlYWNoIHBhcnRpY3VsYXIgbWV0aG9kXG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0gODsgLy8gZGVmYXVsdCBwcmVjaXNpb24sIHRvZG86IGZpeCBcIm1hZ2ljIGNvbnN0YW50c1wiXG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcv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waWFyeS5pbycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5tYXRlLmlvL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJXaXRoSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbEluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25IaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZEJpdGNvaW5EZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ19FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DWksnOiB7ICdpZCc6ICdCVENfQ1pLJywgJ3N5bWJvbCc6ICdCVEMvQ1pLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NaSycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnTFRDX0JUQycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogNSB9fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlc1tjdXJyZW5jeV1bJ3Jlc2VydmVkJ107XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzW2N1cnJlbmN5XVsnYmFsYW5jZSddO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5j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XZhdGVQb3N0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpXG4gICAgICAgICAgICAgICAgb3JkZXJbJ3RvdGFsJ10gPSBhbW91bnQ7IC8vIGFtb3VudCBpbiBmaWF0XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgb3JkZXJbJ2Ftb3VudCddID0gYW1vdW50OyAvLyBhbW91bnQgaW4gZmlhdFxuICAgICAgICAgICAgbWV0aG9kICs9ICdJbnN0YW50JztcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDsgLy8gYW1vdW50IGluIGNyeXB0b1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgIG1ldGhvZCArPSB0aGlzLmNhcGl0YWxpemUgKHR5cGUpO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAoc2VsZi5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnZGF0YSddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlcklkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdjbGllbnRJZCc6IHRoaXMudWlkLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdwdWJsaWNLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBjb2luc2VjdXJlIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NvaW5zZWN1cmUnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQ29pbnNlY3VyZScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0lOJywgLy8gSW5kaWFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ3Mi05Y2JkMjAwYS01ZWQ5LTExZTctOTU1MS0yMjY3YWQ3YmFjMDguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5zZWN1cmUuaW4nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2luc2VjdXJlLmluJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vY29pbnNlY3VyZS9wbHVnaW5zJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbi9zZWFyY2gvY29uZmlybWF0aW9uL3t0eGlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYXNrL2xvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYXNrL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL2hpZ2gnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2JpZC9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbWF4MjRIcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbWluMjRIcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L2NhbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9zbXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ldGtpL3NlYXJjaC97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iYW5rL290cC97bnVtYmVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9reWMvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvcGhvbmUvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2FkZHJlc3Mve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC9jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L3VuY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L3VuY29uZmlybWVkL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9iYWxhbmNlL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvdG90YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9iYWxhbmNlL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvdG90YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9kZXBvc2l0L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvY29pbi9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvZmlhdC9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3BhaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvY29pbi9zdWNjZXNzZnVsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2ZpYXQvcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvdHJhZGUvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dpbi90b2tlbi97dG9rZW59JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4vcGFzc3dvcmQvZm9yZ290JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9nYS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbnVwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL3VwZGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL3VwZGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL2NoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXNzd29yZC9yZXNldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbnVwL3ZlcmlmeS97dG9rZW59JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2t5YycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2luc3RhbnQvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2luc3RhbnQvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9hdXRoeS9pbml0aWF0ZS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2dhL2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9uZXRraS9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3NlbmRUb0V4Y2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9nY20ve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L2NhbmNlbC97ZGVwb3NpdElEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY2FuY2VsL3tvcmRlcklEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsL3tvcmRlcklEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9hdXRoeS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvZGlzYWJsZS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9kZWxldGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9pbWFnZS9kZWxldGUve25ldGtpTmFtZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSU5SJzogeyAnaWQnOiAnQlRDL0lOUicsICdzeW1ib2wnOiAnQlRDL0lOUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdJTlInIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNCAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJFeGNoYW5nZUJhbmtTdW1tYXJ5ICgpO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgIGxldCBjb2luID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydwZW5kaW5nQ29pbkJhbGFuY2UnXSxcbiAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VbJ3RvdGFsQ29pbkJhbGFuY2UnXSxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IGZpYXQgPSB7XG4gICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2F2YWlsYWJsZUZpYXRCYWxhbmNlJ10sXG4gICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ3BlbmRpbmdGaWF0QmFsYW5jZSddLFxuICAgICAgICAgICA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1L3B1YmFwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvY29pbi9kZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL3NlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXkvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9zZWxs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B1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAodXBwZXJjYXNlID09ICdEUksnKVxuICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW50eXBlJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5b3JkZXJzJywgJ3NlbGxvcmRlcnMnLCAncmF0ZScsICdhbW91bnQnKTtcbiAgICAgICAgcmVzdWx0WydiaWRzJ10gPSB0aGlzLnNvcnRCeSAocmVzdWx0WydiaWRzJ10sIDAsIHRydWUpO1xuICAgICAgICByZXN1bHRbJ2Fza3MnXSA9IHRoaXMuc29ydEJ5IChyZXN1bHRbJ2Fza3MnXSwgMCk7XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRMYXRlc3QgKHBhcmFtcyk7XG4gICAgICAgIGxldCBpZCA9IHRoaXMubWFya2V0SWQgKHN5bWJvbCk7XG4gICAgICAgIGlkID0gaWQudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncHJpY2VzJ11baWRdO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2JpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByaXZhdGVQb3N0T3JkZXJzSGlzdG9yeSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2ludHlwZSc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIGNyZWF0ZU9yZGVyIChtYXJrZXQsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3RNeScgKyB0aGlzLmNhcGl0YWxpemUgKHNpZGUpO1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2NvaW50eXBlJzogdGhpcy5tYXJrZXRJZCAobWFya2V0KSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmF0ZSc6IHByaWNlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1c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6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yOTQ4NDM5NC03YjRlYTZlMi04NGM2LTExZTctODNlNS0xZmNjZjRiMmRjODEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL0NhdGVnb3J5LzQ1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU2JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZVBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXQve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJzL3tpZH0ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJHcm91cHMve2lkc30ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VGlwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NDJylcbiAgICAgICAgICAgIHJldHVybiAnQ0NYJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdGQ04nKVxuICAgICAgICAgICAgcmV0dXJuICdGYWNpbGVjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdORVQnKVxuICAgICAgICAgICAgcmV0dXJuICdOZXRDb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEcnKVxuICAgICAgICAgICAgcmV0dXJuICdCaXRnZW0nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZVRUwnKVxuICAgICAgICAgICAgcmV0dXJuICdGQzInOyAvLyBGdWVsQ29pbiAhPSBGVUVMXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnV1JDJylcbiAgICAgICAgICAgIHJldHVybiAnV2FyQ29pbic7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBjdXJyZW5jeUlkIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NDWCcpXG4gICAgICAgICAgICByZXR1cm4gJ0NDJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdGYWNpbGVjb2luJylcbiAgICAgICAgICAgIHJldHVybiAnRkNOJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdOZXRDb2luJylcbiAgICAgICAgICAgIHJldHVybiAnTkVUJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCaXRnZW0nKVxuICAgICAgICAgICAgcmV0dXJuICdCVEcnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZDMicpXG4gICAgICAgICAgICByZXR1cm4gJ0ZVRUwnOyAvLyBGdWVsQ29pbiAhPSBGVUVMXG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlUGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydJZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4aW11bVRyYWRlJ11cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJpY2VMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bVByaWNlJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4aW11bVByaWNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ1N0YXR1cyddID09ICdPSyc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ1RyYWRlRmVlJ10gLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGFtb3VudExpbWl0c1snbWluJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJzSWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ0J1eScsICdTZWxsJywgJ1ByaWNlJywgJ1ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydIaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgK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1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoJ0ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB0cmFkZVsnRmVlJ10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydUeXBlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnQW1vdW50J10sXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRo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gICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ1dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5CYXNlVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5XaXRoZHJhdyddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IGN1cnJlbmN5WydNYXhXaXRoZHJhdyddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ0RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBiYWxhbmNlWydTeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnQXZhaWxhYmxlJ10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZVsnVG90YWwnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1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3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNyZWF0ZU9yZGVyIHJldHVybmVkIHVua25vd24gZXJyb3I6ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IDAuMDtcbiAgICAgICAgaWYgKCdEYXRhJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdPcmRlcklkJyBpbiByZXNwb25zZVsnRGF0YSddKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ0ZpbGxlZE9yZGVycycgaW4gcmVzcG9uc2VbJ0RhdGEnXSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWRPcmRlcnMgPSByZXNwb25zZVsnRGF0YSddWydGaWxsZWRPcmRlcnMnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmlsbGVkT3JkZXJzTGVuZ3RoID0gZmlsbGVkT3JkZXJzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoZmlsbGVkT3JkZXJzTGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoaWQpXG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXh0ZW5kICh7ICdpbmZvJzogcmVzcG9uc2UgfSwgb3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxUcmFkZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnVHlwZSc6ICdUcmFkZScsXG4gICAgICAgICAgICAgICAgJ09yZGVySWQnOiBpZCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXVsnc3RhdHVzJ10gPSAnY2FuY2VsZWQnO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdFcnJvcicpO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdkb2VzIG5vdCBleGlzdCcpID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH0gZWxzZSBpZiAoJ01hcmtldCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBpZCA9IG9yZGVyWydNYXJrZXQnXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJr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1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlkID0gaWQudG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBvcmRlcnMgPSBhd2FpdCB0aGlzLmZldGNoT3JkZXJzIChzeW1ib2wsIHBhcmFtcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAob3JkZXJzW2ldWydpZCddID09IGlkKVxuICAgICAgICAgICAgICAgIHJldHVybiBvcmRlcnNbaV07XG4gICAgICAgIH1cbiAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Q2FjaGVkICh0aGlzLmlkICsgJyBvcmRlciAnICsgaWQgKyAnIG5vdCBmb3VuZCBpbiBjYWNoZWQgLm9yZGVycywgZmV0Y2hP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uZHMgbGlxdWkge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2RzeCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdEU1gnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdVSycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTkwMjc1LTE0MTMxNThhLTY0NWEtMTFlNy05MzFjLTk0NzE3Zjc1MTBlMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kc3gudWsvbWFwaScsIC8vIG1hcmtldCBkYXRhXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vZHN4LnVrL3RhcGknLCAvLyB0cmFkaW5nXG4gICAgICAgICAgICAgICAgICAgICdkd2FwaSc6ICdodHRwczovL2RzeC51ay9kd2FwaScsIC8vIGRlcG9zaXQvd2l0aGRyYXdcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9kc3gudWsnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5kc3gudWsnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kc3gudWsvYXBpX2RvY3MvcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3ByaXZhdGUnLFxuICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgLy8gbWFya2V0IGRhdGEgKHB1YmxpYylcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhcnNGcm9tTW9tZW50L3tpZH0ve3BlcmlvZH0ve3N0YXJ0fScsIC8vIGVtcHR5IHJlcGx5IDpcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdEJhcnMve2lkfS97cGVyaW9kfS97YW1vdW50fScsIC8vIHBlcmlvZCBpcyAobSwgaCBvciBkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BlcmlvZEJhcnMve2lkfS97cGVyaW9kfS97c3RhcnR9L3tlbmR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIHRyYWRpbmcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIGRlcG9zaXQgLyB3aXRoZHJhdyAocHJpdmF0ZSlcbiAgICAgICAgICAgICAgICAnZHdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENyeXB0b0RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9XaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvblN0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgZ2V0QmFzZVF1b3RlRnJvbU1hcmtldElkIChpZCkge1xuICAgICAgICBsZXQgdXBwZXJjYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgIG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zogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VzWyd0b3RhbCddW2N1cnJlbmN5XSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZp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tMWIwZWE5NTYtNWVkYS0xMWU3LTkyMjUtNDBkNjdiNDgxYjhkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5leG1vLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2V4bW8ubWUnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2V4bW8ubWUvZW4vYXBpX2RvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vZXhtby1kZXYvZXhtb19hcGlfbGliL3RyZWUvbWFzdGVyL25vZGVqcycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJfc2V0dGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl9jYW5jZWxsZWRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcXVpcmVkX2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jcnlwdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfZ2V0X3R4aWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y29kZV9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y29kZV9sb2FkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyU2V0dGluZ3MgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3F1YW50aXR5J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcXVhbnRpdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5fYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VySW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXNwb25zZVsnYmFsYW5jZXMnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChyZXNwb25zZVsnYmFsYW5jZXMnXVtjdXJyZW5jeV0pO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3BvbnNlWydyZXNlcnZlZCddKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKHJlc3BvbnNlWydyZXNlcnZlZCddW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gcmVzcG9uc2VbbWFya2V0WydpZCddXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkJywgJ2FzaycpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGlja2VyWyd1cGRhdGVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICA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0Yy5jb20uYnIvYXBpLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzQnlEYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFByb2R1Y3RQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZXRVc2VySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTW9kaWZ5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxBbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldFByb2R1Y3RQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncHJvZHVjdFBhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3Byb2R1Y3QxTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJvZHVjdDJMYWJlbCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnY3VycmVuY2llcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWyduYW1lJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ2hvbGQnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7X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BwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGhyJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGhyUHJvZHVjdDInXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndW5peHRpbWUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWydpbmNvbWluZ09yZGVyU2lkZSddID09IDApID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgIC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5bWJvbCBwYXJhbWV0ZXIgZm9yIGNhbmNlbGxpbmcgYW4gb3JkZXInKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlLnRvU3RyaW5nICgpICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnYXBpTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpU2lnJzogc2lnbmF0dXJlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBmb3hiaXQgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnZm94Yml0JyxcbiAgICAgICAgICAgICduYW1lJzogJ0ZveEJpdCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0JSJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5OTE0MTMtMTFiNDBkNDItNjQ3Zi0xMWU3LTkxZWUtNzhjZWQ4NzRkZDA5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5ibGlua3RyYWRlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5ibGlua3RyYWRlLmNvbS90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9mb3hiaXQuZXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9ibGlua3RyYWRlLmNvbS9kb2NzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbWVudCc6ICdCbGlua3RyYWRlIEFQSScsXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS90aWNrZXInLCAgICAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vb3JkZXJib29rJywgLy8gP2NyeXB0b19jdXJyZW5jeT1CVENcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RyYWRlcycsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDJnNpbmNlPTxUSU1FU1RBTVA+JmxpbWl0PTxOVU1CRVI+XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRCcsICAgLy8gb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdGJywgICAvLyBjYW5jZWwgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMicsICAvLyBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTQnLCAgLy8gbXkgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTYnLCAgLy8gd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMTgnLCAvLyBkZXBvc2l0XG4gICAgICAgICAgICAgICAgICAgICAgICAnVTI0JywgLy8gY29uZmlybSB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTI2JywgLy8gbGlzdCB3aXRoZHJhd2Fsc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UzMCcsIC8vIGxpc3QgZGVwb3NpdHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMzQnLCAvLyBsZWRnZ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RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGxvd2VyY2FzZVF1b3RlID0gbWFya2V0WydxdW90ZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSAndm9sXycgKyBsb3dlcmNhc2VRdW90ZTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VG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SB0aGlzLmV4dGVuZCAoeyAnTXNnVHlwZSc6IHBhdGggfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAobm9uY2UpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ1N0YXR1cycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ1N0YXR1cyddICE9IDIwMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn1cbiIsIlwidX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JzZS5zZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vZG9jcy5meWIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJkZXRhaWxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFjY2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlbmRpbmdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGVuZGluZ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1NFSyc6IHsgJ2lkJzogJ1NFSycsICdzeW1ib2wnOiAnQlRDL1NFSycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdTRUsnIH0sXG4gICAgICAgICAgICB9LFxuICAgICA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biAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB2b2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbJ2Ftb3VudCddKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3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XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnZ2F0ZWNvaW4nLFxuICAgICAgICAgICAgJ25hbWUnOiAnR2F0ZWNvaW4nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJywgLy8gSG9uZyBLb25nXG4gICAgICAgICAgICAnY29tbWVudCc6ICdhIHJlZ3VsYXRlZC9saWNlbnNlZCBleGNoYW5nZScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMWgnLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzI0aCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODY0NjgxNy01MDg0NTdmMi03MjZjLTExZTctOWVlYi0zNTI4ZDI0MTNhNTguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2F0ZWNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vR2F0ZWNvaW4vUkVTVGZ1bC1BUEktSW1wbGVtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZ2F0ZWNvaW4uY29tL3N3YWdnZXItdWkvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0V4Y2hhbmdlUmF0ZScsIC8vIEdldCB0aGUgZXhjaGFuZ2UgcmF0ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlcicsIC8vIEdldCBsaXZlIHRpY2tlciBmb3IgYWxsIGN1cnJlbmN5XG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0xpdmVUaWNrZXIve0N1cnJlbmN5UGFpcn0nLCAvLyBHZXQgbGl2ZSB0aWNrZXIgYnkgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlcnMnLCAvLyBHZXQgbGl2ZSB0aWNrZXIgZm9yIGFsbCBjdXJyZW5jeVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9NYXJrZXREZXB0aC97Q3VycmVuY3lQYWlyfScsIC8vIEdldHMgcHJpY2VzIGFuZCBtYXJrZXQgZGVwdGggZm9yIHRoZSBjdXJyZW5jeSBwYWlyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9OZXR3b3JrU3RhdGlzdGljcy97RGlnaUN1cnJlbmN5fScsIC8vIEdldCB0aGUgbmV0d29yayBzdGF0dXMgb2YgYSBzcGVjaWZpYyBkaWdpdGFsIG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IGxpc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlbmNlL0lkZW50eWRvY3VtZW50VHlwZXMnLCAvLyBHZXQgdGhlIGRpZmZlcmVudCB0eXBlcyBvZiBpZGVudGl0eSBkb2N1bWVudHMgcG9zc2libGUuXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlbmNlL0luY29tZVJhbmdlTGlzdCcsIC8vIEdldCB0aGUgaW5jb21lIHJhbmdlIGxpc3QuXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVmZXJlbmNlL0luY29tZVNvdXJjZUxpc3QnLCAvLyBHZXQgdGhlIGluY29tZSBzb3VyY2UgbGlzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVuY2UvVmVyaWZpY2F0aW9uTGV2ZWxMaXN0JywgLy8gR2V0IHRoZSB2ZXJpZiBsZXZlbCBsaXN0LlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N0cmVhbS9QdWJsaWNDaGFubmVsJywgLy8gR2V0IHRoZSBwdWJsaWMgcHVibnViIGNoYW5uZWwgbGlzdFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeHBvcnQvVHJhbnNhY3Rpb25zJywgLy8gUmVxdWVzdCBhIGV4cG9ydCBvZiBhbGwgdHJhZGVzIGZyb20gYmFzZWQgb24gY3VycmVuY3lwYWlyLCBzdGFydCBkYXRlIGFuZCBlbmQgZGF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BpbmcnLCAvLyBQb3N0IGEgc3RyaW5nLCB0aGVuIGdldCBpdCBiYWNrLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9VbnN1YnNjcmliZS97RW1haWxDb2RlfScsIC8vIExldHMgdGhlIHVzZXIgdW5zdWJzY3JpYmUgZnJvbSBlbWFpbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWdpc3RlclVzZXInLCAvLyBJbml0aWFsIHRyYWRlciByZWdpc3RyYXRpb24uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBHZXQgY29ycG9yYXRlIGFjY291bnQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRBZGRyZXNzJywgLy8gQ2hlY2sgaWYgcmVzaWRlbmNlIHByb29mIHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gQ2hlY2sgaWYgcmVnaXN0ZXJlZCBkb2N1bWVudCB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJRCcsIC8vIENoZWNrIGlmIElEIGRvY3VtZW50IGNvcHkgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDMgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwnLCAvLyBHZXQgdXNlciBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRmVlUmF0ZScsIC8vIEdldCBmZWUgcmF0ZSBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBHZXQgdmVyaWYgbGV2ZWwgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1BlcnNvbmFsSW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDEgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGhvbmUnLCAvLyBHZXQgdXNlciBwaG9uZSBudW1iZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Byb2ZpbGUnLCAvLyBHZXQgdHJhZGVyIHByb2ZpbGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyBGaWxsIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbCcsIC8vIEdldCByZWZlcnJhbCBpbmZvcm1hdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxDb2RlJywgLy8gR2V0IHRoZSByZWZlcnJhbCBjb2RlIG9mIHRoZSBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxOYW1lcycsIC8vIEdldCBuYW1lcyBvZiByZWZlcnJlZCB0cmFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbFJld2FyZCcsIC8vIEdldCByZWZlcnJhbCByZXdhcmQgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmVkQ29kZScsIC8vIEdldCByZWZlcnJhbCBjb2RlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZXNpZGVudEluZm9ybWF0aW9uJywgLy8gR2V0IFN0ZXAyIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1NlY3VyaXR5U2V0dGluZ3MnLCAvLyBHZXQgdmVyaWYgZGV0YWlscyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvVXNlcicsIC8vIEdldCBhbGwgdXNlciBpbmZvXG4gICAgICAgICAg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YWxsIHN0b3Agb3JkZXJzIGZvciB0aGUgbG9nZ2VkIGluIHRyYWRlci4gTWF4IDEwMDAgcmVjb3JkLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnNIaXN0b3J5JywgLy8gR2V0cyBhbGwgc3RvcCBvcmRlcnMgZm9yIHRoZSBsb2dnZWQgaW4gdHJhZGVyLiBNYXggMTAwMCByZWNvcmQuXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvVHJhZGVzJywgLy8gR2V0cyBhbGwgdHJhbnNhY3Rpb25zIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvVXNlclRyYWRlcycsIC8vIEdldHMgYWxsIHRyYW5zYWN0aW9ucyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50QWRkcmVzcycsIC8vIFVwbG9hZCBhZGRyZXNzIHByb29mIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gVXBsb2FkIHJlZ2lzdGVyZWQgZG9jdW1lbnQgZG9jdW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGxvYWQgSUQgZG9jdW1lbnQgY29weVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvUmVxdWVzdFZlcmlmeScsIC8vIFJlcXVlc3QgZm9yIHZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvVmVyaWZ5JywgLy8gVmVyaWZpY2F0aW9uIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3Vud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Z2VkIGluIHVzZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnRWxlY3Ryb25pY1dhbGxldC9XaXRoZHJhd2Fscy97RGlnaUN1cnJlbmN5fScsIC8vIFJlcXVlc3QgYSB0cmFuc2ZlciBmcm9tIHRoZSB0cmFkZXJzIGFjY291bnQgdG8gYW4gZXh0ZXJuYWwgYWRkcmVzcy4gVGhpcyBpcyBvbmx5IGF2YWlsYWJsZSBmb3IgY3J5cHRvIGN1cnJlbmNpZXMuXG4gICAgICAgICAgICAgICAgICAgICAgICAnTm90aWZpY2F0aW9uL01lc3NhZ2VzJywgLy8gTWFyayBhbGwgYXMgcmVhZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05vdGlmaWNhdGlvbi9NZXNzYWdlcy97SUR9JywgLy8gTWFyayBhcyByZWFkXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvT3JkZXJzJywgLy8gUGxhY2UgYW4gb3JkZXIgYXQgdGhlIGV4Y2hhbmdlLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnMnLCAvLyBQbGFjZSBhIHN0b3Agb3JkZXIgYXQgdGhlIGV4Y2hhbmdlLlxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQ29ycG9yYXRlRGF0YScsIC8vIFVwZGF0ZSB1c2VyIGNvbXBhbnkgZGF0YSBmb3IgY29ycG9yYXRlIGFjY291bnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGRhdGUgSUQgZG9jdW1lbnQgbWV0YSBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0V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Rlcm5hbCBkaWdpdGFsIGN1cnJlbmN5IGFkZHJlc3NlcyByZWxhdGVkIHRvIHRoZSBsb2dnZWQgaW4gdXNlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9PcmRlcnMnLCAvLyBDYW5jZWxzIGFsbCBleGlzdGluZyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL09yZGVycy97T3JkZXJJRH0nLCAvLyBDYW5jZWxzIGFuIGV4aXN0aW5nIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvU3RvcE9yZGVycycsIC8vIENhbmNlbHMgYWxsIGV4aXN0aW5nIHN0b3Agb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvU3RvcE9yZGVycy97SUR9JywgLy8gQ2FuY2VscyBhbiBleGlzdGluZyBzdG9wIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTGl2ZVRpY2tlcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3RpY2tlcnMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeVBhaXInXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZUJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlQmFsYW5jZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdGhpcy5zdW0gKFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nSW5jb21pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsncGVuZGluZ091dGdvaW5nJ10sXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ29wZW5PcmRlciddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydiYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTWFya2V0RGVwdGhDdXJyZW5jeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnQ3VycmVuY3lQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ3ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW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sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTGl2ZVRpY2tlckN1cnJlbmN5UGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdDdXJyZW5jeVBhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHNpZGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBvcmRlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCd3YXknIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWyd3YXknXSA9PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgICAgIGxldCBvcmRlcklkID0gdHJhZGVbJ3dheSddICsgJ09yZGVySWQnO1xuICAgICAgICAgICAgb3JkZXIgPSB0cmFkZVtvcmRlcklkXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWyd0cmFuc2FjdGlvblRpbWUnXSkgKiAxMDAwO1xuICAgICAgICBpZiAoIW1hcmtldClcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt0cmFkZVsnY3VycmVuY3lQYWlyJ11dO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm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xlLmV4cG9ydHMgPSBjbGFzcyBnZGF4IGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2dkYXgnLFxuICAgICAgICAgICAgJ25hbWUnOiAnR0RBWCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1VTJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ3VzZXJBZ2VudCc6IHRoaXMudXNlckFnZW50c1snY2hyb21lJ10sXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAnaGFzRGVwb3NpdCc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6IDYwLFxuICAgICAgICAgICAgICAgICc1bSc6IDMwMCxcbiAgICAgICAgICAgICAgICAnMTVtJzogOTAwLFxuICAgICAgICAgICAgICAgICczMG0nOiAxODAwLFxuICAgICAgICAgICAgICAgICcxaCc6IDM2MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMTJoJzogNDMyMDAsXG4gICAgICAgICAgICAgICAgJzFkJzogODY0MDAsXG4gICAgICAgICAgICAgICAgJzF3JzogNjA0ODAwLFxuICAgICAgICAgICAgICAgICcxTSc6IDI1OTIwMDAsXG4gICAgICAgICAgICAgICAgJzF5JzogMzE1MzYwMDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ3Rlc3QnOiAnaHR0cHM6Ly9hcGktcHVibGljLnNhbmRib3guZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1MjctYjFiZTQxYzYtNWVkYi0xMWU3LTk1ZjYtNWI0OTZjNDY5ZTJjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RvY3MuZ2RheC5jb20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbmJhc2UtYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50LW1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJzL3NlbGYvdHJhaWxpbmctdm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvY29pbmJhc2UtYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvcmVwYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2ZpbGVzL21hcmdpbi10cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY29pbmJhc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLCAvLyBjb21wbGljYXRlZCB0aWVyIHN5c3RlbSBwZXIgY29pblxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4zMCAvIDEwMCwgLy8gd29yc3QtY2FzZSBzY2VuYXJpbzogaHR0cHM6Ly93d3cuZ2RheC5jb20vZmVlcy9CVEMtVVNEXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ2Jhc2VfbWluX3NpemUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydiYXNlX21heF9zaXplJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ3F1b3RlX2luY3JlbWVudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHByaWNlTGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKHBhcnNlRmxvYXQgKGFtb3VudExpbWl0c1snbWluJ10pKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiAtTWF0aC5sb2cxMCAocGFyc2VGbG9hdCAocHJpY2VMaW1pdHNbJ21pbiddKSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3Rha2VyJ107XG4gICAgICAgICAgICBpZiAoKGJhc2UgPT0gJ0VUSCcpIHx8IChiYXNlID09ICdMVEMnKSkge1xuICAgICAgICAgICAgICAgIHRha2VyID0gMC4wMDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0I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N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnc2l6ZSddKSxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHJvZHVjdHNJZFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSwgLy8gZml4ZXMgaXNzdWUgIzJcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5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ICAgICAgICAgaWYgKG9yZGVyWydwcm9kdWN0X2lkJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtvcmRlclsncHJvZHVjdF9pZCddXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdwcmljZScpO1xuICAgICAgICBsZXQgYW1vdW50ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnc2l6ZScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZmlsbGVkX3NpemUnKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZF92YWx1ZScpO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZlZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRPcmRlcnNJZCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlciAocmVzcG9uc2UpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJzIChzeW1ib2wgPSB1bmRlZmluZWQsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7XG4gICAgICAgICAgICAnc3RhdHVzJzogJ2FsbCcsXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wpIHtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsncHJvZHVjdF9pZCddID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF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sXG4gICAgICAgIH07XG4gICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wpIHtcbiAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsncHJvZHVjdF9pZCddID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVycyAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVycyAocmVzcG9uc2UsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAobWFya2V0LCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICAvLyBsZXQgb2lkID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3Byb2R1Y3RfaWQnOiB0aGlzLm1hcmtldElkIChtYXJrZXQpLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3NpemUnOiBhbW91bnQsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmRlclsncHJpY2UnXSA9IHByaWNlO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJzICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgIC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gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0V2l0aGRyYXdhbHMnO1xuICAgICAgICBpZiAoJ3BheW1lbnRfbWV0aG9kX2lkJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnUGF5bWVudE1ldGhvZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoJ2NvaW5iYXNlX2FjY291bnRfaWQnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdDb2luYmFzZUFjY291bnQnO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbWV0aG9kICs9ICdDcnlwdG8nO1xuICAgICAgICAgICAgcmVxdWVzdFsnY3J5cHRvX2FkZHJlc3MnXSA9IGFkZHJlc3M7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgd2l0aGRyYXcoKSBlcnJvcjogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICByZXF1ZXN0ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSAnJztcbiAgICAgICAgICAgIGlmIChtZXRob2QgIT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBwYXlsb2FkID0gYm9keTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBsZXQgcGF5bG9hZCA9IChib2R5KSA/IGJvZHkgOiAnJztcbiAgICAgICAgICAgIGxldCB3aGF0ID0gbm9uY2UgKyBtZXRob2QgKyByZXF1ZXN0ICsgcGF5bG9hZDtcbiAgICAgICAgICAgIG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ge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmljZSB0b28gcHJlY2lzZScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PSAnSW52YWxpZCBBUEkgS2V5Jykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJl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LTNjMjU3MjYzMjI5Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNl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YXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZXN0YW1wbXMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlc1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCwgc2luY2UsIGx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gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTU1LThlYWVjMjBlLTVlZGMtMTFlNy05YzViLTZkYzY5ZmM0MmY1ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cDovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaGl0YnRjLWNvbS9oaXRidGMtYXBpL2Jsb2IvbWFzdGVyL0FQSXYxLm1kJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdHJhZGVzL3JlY2VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lLCdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hY3RpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnkvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwYXltZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3RyYW5zYWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX3RyYWRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5b3V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogLTAuMDEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDk1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAxOC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAuMDAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAyNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiA1MDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogODYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAxMTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDEyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiA0NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMi41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiA0LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAxMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAuODgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogNTc0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDEyMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNjI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAuMDAxNzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMTYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogNS40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDQ1NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMTIzLjAwMTA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDIwMi45NTk4MzA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDEuODQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDY2LjEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAuMDAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDEuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAxNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAxMDgyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAxMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMC4zNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiA3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogNTkxMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMTMwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAuMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogNS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMS4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAxMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogOTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMy45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDE2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAzLjk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDk5OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAxMy4zOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMzM1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAyLjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMC41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAzLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMTE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAuODcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogNzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAzOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiA2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogNjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiA4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDEzOTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLjAzNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiA1MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMTQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogNjE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDIuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAzLjIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMC45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMTQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDE5MSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1NOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RJQ0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RMVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET1YnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQ0FUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVhOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVRUwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0JSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJTUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9u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ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3N0ZXAnOiBzdGVwLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbG90J10pLFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnc3RlcCddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHN0ZXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIG1ldGhvZCArPSAnR2V0QmFsYW5jZSc7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCAndHlwZScpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHF1ZXJ5KTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBiYWxhbmNlWydjdXJyZW5jeV9jb2RlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY29kZSk7XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlL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tcykpO1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGlja2VyWydtZXNzYWdlJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVswXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0cmFkZVszXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbM10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbNF0sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsxXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbMl0pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdze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4gICAgICAgIH1cbiAgICAgICAgaWYgKGFtb3VudCAmJiByZW1haW5pbmcpIHtcbiAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgIGNvc3QgPSBhdmVyYWdlUHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydjbGllbnRPcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudHJhZGluZ0dldE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NsaWV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AgICAgICAgJ2N1cnJlbmN5X2NvZGUnOiBjdXJyZW5jeVsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWyd0cmFuc2FjdGlvbiddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9ICcvJyArICdhcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgYXBpICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0geyAnbm9uY2UnOiBub25jZSwgJ2FwaWtleSc6IHRoaXMuYXBpS2V5IH07XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kIChwYXlsb2FkLCBxdWVyeSk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGF5bG9hZCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHVybDtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ1gtU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cb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vIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ00xJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnTTMnLFxuICAgICAgICAgICAgICAgICc1bSc6ICdNNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICdNMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnTTMwJywgLy8gZGVmYXVsdFxuICAgICAgICAgICAgICAgICcxaCc6ICdIMScsXG4gICAgICAgICAgICAgICAgJzRoJzogJ0g0JyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnRDEnLFxuICAgICAgICAgICAgICAgICcxdyc6ICdENycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTU1LThlYWVjMjBlLTVlZGMtMTFlNy05YzViLTZkYzY5ZmM0MmY1ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2hpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsIC8vIEF2YWlsYWJsZSBDdXJyZW5jeSBTeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tzeW1ib2x9JywgLy8gR2V0IHN5bWJvbCBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLCAvLyBBdmFpbGFibGUgQ3VycmVuY2llc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tjdXJyZW5jeX0nLCAvLyBHZXQgY3VycmVuY3kgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsIC8vIFRpY2tlciBsaXN0IGZvciBhbGwgc3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsIC8vIFRpY2tlciBmb3Igc3ltYm9sXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JywgLy8gVHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tzeW1ib2x9JywgLy8gT3JkZXJib29rXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy97c3ltYm9sfScsIC8vIENhbmRsZXNcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gTGlzdCB5b3VyIGN1cnJlbnQgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBHZXQgYSBzaW5nbGUgb3JkZXIgYnkgY2xpZW50T3JkZXJJZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvYmFsYW5jZScsIC8vIEdldCB0cmFkaW5nIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2ZlZS97c3ltYm9sfScsIC8vIEdldCB0cmFkaW5nIGZlZSByYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyJywgLy8gR2V0IGhpc3RvcmljYWwgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlci97aWR9L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlcyBieSBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLCAvLyBHZXQgbWFpbiBhY2Njb3VudCBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMnLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucy97aWR9JywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb24gYnkgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBHZXQgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdycsIC8vIFdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIENyZWF0ZSBuZXcgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNmZXInLCAvLyBUcmFuc2ZlciBhbW91bnQgdG8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gQ29tbWl0IHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ2FuY2VsIGFsbCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBSb2xsYmFjayB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBSZXBsYWNlIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAxIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDA5NTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLjg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMC4wMTAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiA1NjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiA2MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDguNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjAwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDYyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAuMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMC4yNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMC4wMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogNi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDIuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDU5MTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMTUuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDExMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMi4yNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMTY0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogNDA3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAuMDM3NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLjUxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjkxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDIuMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogNy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMzk1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1NOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RJQ0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RMVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET1YnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQ0FUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVhOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVRUwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0JSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJTUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY3VycmVuY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ldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10pLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsncXVhbnRpdHlJbmNyZW1lbnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0YWtlTGlxdWlkaXR5UmF0ZSddKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsncHJvdmlkZUxpcXVpZGl0eVJhdGUnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90ICogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5IChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwYXlpbiA9IGN1cnJlbmN5WydwYXlpbkVuYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBwYXlvdXQgPSBjdXJyZW5jeVsncGF5b3V0RW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IHRyYW5zZmVyID0gY3VycmVuY3lbJ3RyYW5zZmVyRW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHBheWluICYmIHBheW91dCAmJiB0cmFuc2ZlcjtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSAnb2snO1xuICAgICAgICAgICAgaWYgKCdkaXNhYmxlZCcgaW4gY3VycmVuY3kpXG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WydkaXNhYmxlZCddKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnZGlzYWJsZWQnO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSAoY3VycmVuY3lbJ2NyeXB0byddKSA/ICdjcnlwdG8nIDogJ2ZpYXQnO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAgICAgJ3BheWluJzogcGF5aW4sXG4gICAgICAgICAgICAgICAgJ3BheW91dCc6IHBheW91dCxcbiAgICAgICAgICAgICAgICAndHJhbnNmZXInOiB0cmFuc2ZlcixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ2Z1bGxOYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZUdldCcgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpICsgJ0JhbGFuY2UnO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzW21ldGhvZF0gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYXZhaWxhYmxlJ10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsncmVzZXJ2ZWQnXSksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogMC4wLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSB0aGlzL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vbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2x1bWVRdW90ZScpLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGlja2Vycy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSB0aWNrZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJTeW1ib2wgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiB0aWNrZXIpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRpY2tlclsnbWVzc2FnZSddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLnBhcnNlODYwMSAodHJhZGVbJ3RpbWVzdGFtcCddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGxldCBpZCA9IHRyYWRlWydzeW1ib2wnXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gbWFya2V0ID8gbWFya2V0WydxdW90ZSddIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY2xpZW50T3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlcklkID0gdHJhZGVbJ2NsaWVudE9yZGVySWQnXTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbJ3F1YW50aXR5J10pO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwg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XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2NsaWVudE9yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5vcmRlcnNbaWRdWydwcmljZSddO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgIT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiBjcmVhdGVkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxIChjcmVhdGVkKSxcbiAgICAgICAgICAgICdjcmVhdGVkJzogY3JlYXRlZCxcbiAgICAgICAgICAgICd1cGRhdGVkJzogdXBkYXRlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgIC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nKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAocGF5bG9hZCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogXCJCYXNpYyBcIiArIHRoaXMuZGVjb2RlIChhdXRoKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnZXJyb3InXVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT0gJ09yZGVyIG5vdCBmb3VuZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgb3JkZXIgbm90IGZvdW5kIGluIGFjdGl2ZSBvcmRlcnMnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZi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yxcbiAgICAgICAgICAgICAgICAnNW0nOiAnMDA1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzAxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICcwMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICcwNjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxMDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcyMDAnLFxuICAgICAgICAgICAgICAgICcxTSc6ICczMDAnLFxuICAgICAgICAgICAgICAgICcxeSc6ICc0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwOi8vYXBpLmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzX2VuL3dpa2knLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3N0YXRpY21hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZG1hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RyYWRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eV9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxfbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9uZXdfZGVhbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl9pZF9ieV90cmFkZV9pZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd19jb2luX3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2xvYW5fYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGMnLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ3R5cGUnOiAnc3RhdGljbWFya2V0JywgJ2NvaW5UeXBlJzogMSB9LFxuICAgICAgICAgICAgICAgICdMVEMvQ05ZJzogeyAnaWQnOiAnbHRjJywgJ3N5bWJvbCc6ICdMVEMvQ05ZJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0NOWScsICd0eXBlJzogJ3N0YXRpY21hcmtldCcsICdjb2luVHlwZSc6IDIgfSxcbiAgICAgICAgICAgICAgICAvLyAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0YycsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAndHlwZSc6ICd1c2RtYXJrZXQnLCAgICAnY29pblR5cGUnOiAxIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGx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pbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsndGltZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAg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LCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXTtcbiAgICAgICAgaWYgKGFwaSA9PSAndHJhZGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSAnL2FwaScgKyB0aGlzLnZlcnNpb247XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmtleXNvcnQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2FjY2Vzc19rZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnY3JlYXRlZCc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0cmluZyA9IHRoaXMudXJsZW5jb2RlICh0aGlzLm9taXQgKHF1ZXJ5LCAnbWFya2V0JykpO1xuICAgICAgICAgICAgLy8gc2VjcmV0IGtleSBtdXN0IGJlIGFwcGVuZGVkIHRvIHRoZSBxdWVyeSBiZWZvcmUgc2lnbmluZ1xuICAgICAgICAgICAgcXVlcnlTdHJpbmcgKz0gJyZzZWNyZXRfa2V5PScgKyB0aGlzLnNlY3JldDtcbiAgICAgICAgICAgIHF1ZXJ5WydzaWduJ10gPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChxdWVyeVN0cmluZykpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgIC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kuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAvLyBvYnNvbGV0ZSBtZXRhaW5mbyBzdHJ1Y3R1cmVcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBzdHJ1Y3R1cmVcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hDTFYnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjBtaW4nLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxbW9uJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5odW9iaS5wcm8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpL1JFU1RfYXBpX3JlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMvcGxhY2UnLCAvLyDliJvlu7rlubbmiafooYzkuIDkuKrmlrDorqLljZUgKOS4gOatpeS4i+WNle+8jCDmjqjojZDkvb/nlKgpXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzJywgLy8g5Yib5bu65LiA5Liq5paw55qE6K6i5Y2V6K+35rGCIO+8iOS7heWIm+W7uuiuouWNle+8jOS4jeaJp+ihjOS4i+WNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3BsYWNlJywgLy8g5omn6KGM5LiA5Liq6K6i5Y2VIO+8iOS7heaJp+ihjOW3suWIm+W7uueahOiuouWNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3N1Ym1pdGNhbmNlbCcsIC8vIOeUs+ivt+aSpOmUgOS4gOS4quiuouWNleivt+axglxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9iYXRjaGNhbmNlbCcsIC8vIOaJuemHj+aSpOmUgOiuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2JhbGFuY2UvdHJhbnNmZXInLCAvLyDotYTkuqfliJLovaxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDb21tb25TeW1ib2xzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBudW1NYXJrZXRzID0gbWFya2V0cy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1NYXJrZXRzIDwgMSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBwdWJsaWNHZXRDb21tb25TeW1ib2xzIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IChiYXNlID09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnbGFzdCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKHRpY2tlclsnYmlkJ10pXG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICB9XG4gICAgICAgIGlmICgnYXNrJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ2FzayddKVxuICAgICAgICAgICAgICAgIGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2FzayddLCAwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB0aWNrZXJbJ29wZW4nXSxcbiAgICAgICAgICAgICdjbG9zZSc6IHRpY2tlclsnY2xvc2UnXSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHRpY2t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gICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmFjY291bnRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWNjb3VudHM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuYWNjb3VudHMgPSBhd2FpdCB0aGlzLmZldGNoQWNjb3VudHMgKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50c0J5SWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuYWNjb3VudHMsICdpZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmFjY291bnRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQWNjb3VudHMgKCkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QWNjb3VudHMgKCk7XG4gICAgICAgIHJldHVybiByZXNwb25zZVsnZGF0YSddO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkQWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50c0lkQmFsYW5jZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuYWNjb3VudHNbMF1bJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddWydsaXN0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZ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zJzogb3BlbixcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlclN0YXR1cyAoc3RhdHVzKSB7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gJ3BhcnRpYWwtZmlsbGVkJykge1xuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ2ZpbGxlZCcpIHtcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT0gJ2NhbmNlbGVkJykge1xuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIH0gZWxzZSBpZiAoc3RhdHVzID09ICdzdWJtaXR0ZWQnKSB7XG4gICAgICAgICAgICByZXR1cm4gJ29wZW4nO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBzdGF0dXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddLnNwbGl0ICgnLScpO1xuICAgICAgICAgICAgc2lkZSA9IG9yZGVyVHlwZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSBvcmRlclR5cGVbMV07XG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0ZSddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkLWF0J107XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0IChvcmRlclsnYW1vdW50J10pO1xuICAgICAgICBsZXQgZmlsbGVkID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWFtb3VudCddKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWVsZC1jYXNoLWFtb3VudCddKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSAwO1xuICAgICAgICBpZiAoZmlsbGVkKVxuICAgICAgICAgICAgYXZlcmFnZSA9IHBhcnNlRmxvYXQgKGNvc3QgLyBmaWxsZWQpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdhY2NvdW50LWlkJzogdGhpcy5hY2NvdW50c1swXVsnaWQnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ3R5cGUnOiBzaWRlICsgJy0nICsgdHlwZSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKH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ICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRMaW1pdE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTWFya2V0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFRyYW5zYWN0aW9uVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UmVjZW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRGeFJhdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZUxpbWl0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZEZpbGxlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJEZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3luY2hEaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc1dpdGhCbG9ja2NoYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0RpZ2l0YWxDdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdEZpYXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgYmFzZUN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFZ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gICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5Q29kZSA9IGJhbGFuY2VbJ0N1cnJlbmN5Q29kZSddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5Q29kZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1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J1ByaWNlJywgJ1ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnQ3JlYXRlZFRpbWVzdGFtcFV0YyddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydEYXlIaWdoZXN0UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RheUxvd2VzdFByaWNlJ10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydDdXJyZW50SGlnaGVzdEJpZFByaWNlJ10sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydDdXJyZW50TG93ZXN0T2ZmZXJQcmljZSddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGlja2VyWydMYXN0UHJpY2UnXSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzog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cbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAoeyAnb3JkZXJHdWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFtcbiAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgJ2FwaUtleT0nICsgdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlPScgKyBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBsZXQga2V5c29ydGVkID0gdGhpcy5rZXlzb3J0IChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoa2V5c29ydGVkKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIGF1dGgucHVzaCAoa2V5ICsgJz0nICsgcGFyYW1zW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBhdXRoLmpvaW4gKCcsJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAobWVzc2FnZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1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jBhZC0xMWU3LTg5ZTctMDA1ZjZkN2YzZGUwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaXRiaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuaXRiaXQuY29tL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuaXRiaXQuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMve3N5bWJvbH0vb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vYmFsYW5jZXMve2N1cnJlbmN5Q29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9mdW5kaW5nX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9jcnlwdG9jdXJyZW5jeV9kZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXJlX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ1hCVFVTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9TR0QnOiB7ICdpZCc6ICdYQlRTR0QnLCAnc3ltYm9sJzogJ0JUQy9TR0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnU0dEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnWEJURVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzU3ltYm9sT3JkZXJCb29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzU3ltYm9sVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgc2VydmVyVGltZVVUQyA9ICgnc2VydmVyVGltZVVUQycgaW4gdGlja2VyKTtcbiAgICAgICAgaWYgKCFzZXJ2ZXJUaW1lVVRDKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2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bGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgaWQgPSB0cmFkZVsnbWF0Y2hOdW1iZXInXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IGlkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0g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c0ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHNCeUFsdG5hbWUnOiB7fSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMjE2MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1OTktMjI3MDkzMDQtNWVkZS0xMWU3LTlkZTEtOWYzMzczMmUxNTA5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5rcmFrZW4uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9ub3RoaW5naXNkZWFkL25wbS1rcmFrZW4tYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbS9lbi11cy9oZWxwL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmtyYWtlbi5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMjAxMzk2Nzc3LVdoYXQtYXJlLXRoZS1kZXBvc2l0LWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5rcmFrZW4uY29tL2hjL2VuLXVzL2FydGljbGVzLzIwMTg5MzYwOC1XaGF0LWFyZS10aGUtd2l0aGRyYXdhbC1mZWVzLScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4xOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMTYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4xNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMC4wIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTE0nOiAwLjAwMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiAxMCwgLy8gQ0FEIEVGVCBXaXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMzAwLCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01MTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCwgLy8gZnJlZSBkZXBvc2l0IGlmIEVVUiBTRVBBIERlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMCwgLy8gRG9tZXN0aWMgRGVwb3NpdCAoRnJlZSwgwqU1LDAwMCBkZXBvc2l0IG1pbmltdW0pXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0hMQycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3ByZWFkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRNZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXBvc2l0U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMZWRnZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuUG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeUxlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZXNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q2F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GFya3Bvb2wgPSBpZC5pbmRleE9mICgnLmQnKSA+PSAwO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGRhcmtwb29sID8gbWFya2V0WydhbHRuYW1lJ10gOiAoYmFzZSArICcvJyArIHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmICgnZmVlc19tYWtlcicgaW4gbWFya2V0KSB7XG4gICAgICAgICAgICAgICAgbWFrZXIgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ2ZlZXNfbWFrZXInXVswXVsxXSkgLyAxMDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ2xvdF9kZWNpbWFscyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncGFpcl9kZWNpbWFscyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Rhcmtwb29sJzogZGFya3Bvb2wsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2FsdG5hbWUnOiBtYXJrZXRbJ2FsdG5hbWUnXSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiBwYXJzZUZsb2F0IChtYXJrZXRbJ2ZlZXMnXVswXVsxXSkgLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdCA9IHRoaXMuYXBwZW5kSW5hY3RpdmVNYXJrZXRzIChyZXN1bHQpO1xuICAgICAgICB0aGlzLm1hcmtldHNCeUFsdG5hbWUgPSB0aGlzLmluZGV4QnkgKHJlc3VsdCwgJ2FsdG5hbWUnKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhcHBlbmRJbmFjdGl2ZU1hcmtldHMgKHJlc3VsdCA9IFtdKSB7XG4gICAgICAgIGxldCBwcmVjaXNpb24gPSB7ICdhbW91bn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AgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY29kZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBkYXJrcG9vbCA9IHN5bWJvbC5pbmRleE9mICgnLmQnKSA+PSAwO1xuICAgICAgICBpZiAoZGFya3Bvb2wpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZG9lcyBub3QgcHJvdmlkZSBhbiBvcmRlciBib29rIGZvciBkYXJrcG9vbCBzeW1ib2wgJyArIHN5bWJvbCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgLy8gJ2NvdW50JzogMTAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydyZXN1bHQnXVttYXJrZXRbJ2lkJ11dO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGJhc2VWb2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3YnXVsxXSk7XG4gICAgICAgIGxldCB2d2FwID0gcGFyc2VGbG9hdCAodGlja2VyWydwJ11bMV0pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2gnXVsxXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsJ11bMV0pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYiddWzBdKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2EnXVswXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnbyddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydjJ11bMF0pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHBhaXJzID0gW107XG4gICAgICAgIGZvciAobGV0IHMgPSAwOyBzIDwgdGhpcy5zeW1ib2xzLmxlbmd0aDsgcysrKSB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGhpcy5zeW1ib2xzW3NdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsnYWN0aXZlJ10pXG4gICAgICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rhcmtwb29sJ10pXG4gICAgICAgICAgICAgICAgICAgIHBhaXJzLnB1c2ggKG1hcmtldFsnaWQnXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZpbHRlciA9IHBhaXJzLmpvaW4gKCcsJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiBmaWx0ZXIsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VycyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaW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kge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsyXSAqIDEwMDApO1xuICAgICAgICAgICAgc2lkZSA9ICh0cmFkZVszXSA9PSAncycpID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgICAgICB0eXBlID0gKHRyYWRlWzRdID09ICdsJykgPyAnbGltaXQnIDogJ21hcmtldCc7XG4gICAgICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHRyYWRlWzBdKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWzFdKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gKG1hcmtldCkgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJ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YW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGN1cnJlbmN5O1xuICAgICAgICAgICAgLy8gWC1JU080MjE3LUEzIHN0YW5kYXJkIGN1cnJlbmN5IGNvZGVzXG4gICAgICAgICAgICBpZiAoY29kZVswXSA9PSAnWCcpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoMSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGVbMF0gPT0gJ1onKSB7XG4gICAgICAgICAgICAgICAgY29kZSA9IGNvZGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbY3VycmVuY3ldKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIG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wgJ3ByaWNlJyk7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoJ2ZlZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmxhZ3MgPSBvcmRlclsnb2ZsYWdzJ107XG4gICAgICAgICAgICAgICAgbGV0IGZlZUNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaXEnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZsYWdzLmluZGV4T2YgKCdmY2liJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogb3JkZXJbJ3N0YXR1cyddLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAg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FxuICAgICAgICAgICAgICAgICdBUEktU2lnbic6IHRoaXMuZGVjb2RlIChzaWduYXR1cmUpLFxuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHVybDtcbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBudW1FcnJvcnMgPSByZXNwb25zZVsnZXJyb3InXS5sZW5ndGg7XG4gICAgICAgICAgICBpZiAobnVtRXJyb3JzKSB7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByZXNwb25zZVsnZXJyb3InXS5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2Vycm9yJ11baV0gPT0gJ0VTZXJ2aWNlOlVuYXZhaWxhYmxlJylcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5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aWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAna3Vjb2luJyxcbiAgICAgICAgICAgICduYW1lJzogJ0t1Y29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0hLJywgLy8gSG9uZyBLb25nXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUnXSxcbiAgICAgICAgICAgIC8vIG9ic29sZXRlIG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IGZhbHNlLCAvLyBzZWUgdGhlIG1ldGhvZCBpbXBsZW1lbnRhdGlvbiBiZWxvd1xuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSwgLy8gc2VlIHRoZSBtZXRob2QgaW1wbGVtZW50YXRpb24gYmVsb3dcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzhoJzogJzQ4MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJ0QnLFxuICAgICAgICAgICAgICAgICcxdyc6ICdXJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMzNzk1NjU1LWIzYzQ2ZTQ4LWRjZjYtMTFlNy04YWJlLWRjNDU4OGJhNzkwMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkua3Vjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2t1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9rdWNvaW5hcGlkb2NzLmRvY3MuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL25ld3Mua3Vjb2luLmNvbS9lbi9mZWUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2NvbmZpZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2RlYWwtb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2xhbmctbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzLWJ1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMtc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2luLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL2NvaW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2lucy10cmVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dhbGxldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93YWxsZXQvcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vc3VtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWFsLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hY3RpdmUtbWFwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWFsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVmZXJyZXIvZGVzY2VuZGFudC9jb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2l0aGRyYXcvYXBwbHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dpdGhkcmF3L2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsLW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jaGFuZ2UtbGFuZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMTAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3BlblN5bWJvbHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydjb2luVHlwZSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0Wydjb2luVHlwZVBhaXInXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ3RyYWRpbmcnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5j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kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsnd2l0aGRyYXdGZWVSYXRlJ10sIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgIC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AgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG9yZGVyWydjb2luVHlwZSddICsgJy8nICsgb3JkZXJbJ2NvaW5UeXBlUGFpciddO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlclsnY3JlYXRlZEF0J107XG4gICAgICAgIGxldCBwcmljZSA9IG9yZGVyWydwcmljZSddO1xuICAgICAgICBsZXQgZmlsbGVkID0gb3JkZXJbJ2RlYWxBbW91bnQnXTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IG9yZGVyWydwZW5kaW5nQW1vdW50J107XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnN1bSAoZmlsbGVkLCByZW1haW5pbmcpO1xuICAgICAgICBsZXQgc2lkZSA9IG9yZGVyWydkaXJlY3Rpb24nXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnb2lkJyksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBmaWxsZWQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFp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ICAgICAgICdvcmRlck9pZCc6IGlkLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoJ3R5cGUnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgcmVxdWVzdFsndHlwZSddID0gcGFyYW1zWyd0eXBlJ10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIgcmVxdWlyZXMgdHlwZSAoQlVZIG9yIFNFTEwpIHBhcmFtJyk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsnZGF0ZXRpbWUnXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IHRpY2tlclsnY29pblR5cGUnXSArICcvJyArIHRpY2tlclsnY29pblR5cGVQYWlyJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCA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VuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9obGN2WydUJ10pO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgdGltZXN0YW1wLFxuICAgICAgICAgICAgb2hsY3ZbJ08nXSxcbiAgICAgICAgICAgIG9obGN2WydIJ10sXG4gICAgICAgICAgICBvaGxjdlsnTCddLFxuICAgICAgICAgICAgb2hsY3ZbJ0MnXSxcbiAgICAgICAgICAgIG9obGN2WydWJ10sXG4gICAgICAgIF07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPSExDViAoc3ltYm9sLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRvID0gdGhpcy5zZWNvbmRzICgpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHRoaXMudGltZWZyYW1lc1t0aW1lZnJhbWVdLFxuICAgICAgICAgICAgJ2Zyb20nOiB0byAtIDg2NDAwLFxuICAgICAgICAgICAgJ3RvJzogdG8sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChzaW5jZSkge1xuICAgICAgICAgICAgcmVxdWVzdFsnZnJvbSddID0gcGFyc2VJbnQgKHNpbmNlIC8gMTAwMCk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gbGltaXQgaXMgbm90IGRvY3VtZW50ZWQgaW4gYXBpIGNhbGwsIGFuZCBub3QgcmVzcGVjdGVkXG4gICAgICAgIGlmIChsaW1pdCkge1xuICAgICAgICAgICAgcmVxdWVz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c3RhbXBcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5U3RyaW5nID0gJyc7XG4gICAgICAgICAgICBub25jZSA9IG5vbmNlLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgcXVlcnlTdHJpbmcgPSB0aGlzLnJhd2VuY29kZSAodGhpcy5rZXlzb3J0IChxdWVyeSkpO1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgICAgICBpZiAobWV0aG9kICE9ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeVN0cmluZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IGVuZHBvaW50ICsgJy8nICsgbm9uY2UgKyAnLycgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKGF1dGgpKTtcbiAgICAgICAgICAgIC8vIHBheWxvYWQgc2hvdWxkIGJlIFwiZW5jb2RlZFwiIGFzIHJldHVybmVkIGZyb20gc3RyaW5nVG9CYXNlNjRcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnS0MtQVBJLU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PckVycm9yQ29kZSAocmVzcG9uc2UpIHtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtc2cnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydjb2RlJ10gPT0gJ1VOQVVUSCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09ICdJbnZhbGlkIG5vbmNlJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE5vbmNlICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXNwb25zZVsnY29kZSddID09ICdFUlJPUicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmVjaXNpb24gb2YgYW1vdW50JykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICA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aSc6ICdodHRwczovL2t1bmEuaW8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9rdW5hLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8va3VuYS5pby9kb2N1bWVudHMvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVsZXRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdC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biAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBsZXQgZGF0YSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgbGV0IGVycm9yID0gZGF0YVsnZXJyb3InXTtcbiAgICAgICAgICAgIGxldCBlcnJvckNvZGUgPSBlcnJvclsnY29kZSddO1xuICAgICAgICAgICAgaWYgKGVycm9yQ29kZSA9PSAyMDAyKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBjb2RlLCByZWFzb24sIGJvZHkgXS5qb2luICgnICcpKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3JDb2RlID09IDIwMDMpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgY29kZSwgcmVhc29uLCBib2R5IF0uam9pbiAoJyAnKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlckJvb2sgPSBhd2F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3d3Lmxha2VidGMuY29tL3MvYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmN0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEV4dGVybmFsQWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2tdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBh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1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbHVtZScpLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuIC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XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHBhcmFtcyA9IHBhcmFtcy5qb2luICgnLCcpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHBhcmFtcyA9ICcnO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHtcbiAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYWNjZXNza2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3JlcXVlc3RtZXRob2QnOiBtZXRob2QudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHBhcmFtcyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGExJyk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdKc29uLVJwYy1Ub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogXCJCYXNpYyBcIiArIHRoaXMuZGVjb2RlIC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ICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBpZiAoc2lkZSA9PSAnc2VsbCcpIHtcbiAgICAgICAgICAgIGNvc3QgKj0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSAnYmFzZSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0eXBlJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0W2tleV0sXG4gICAgICAgICAgICAncmF0ZSc6IHJhdGUsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoIXRoaXMuc3Vic3RpdHV0ZUNvbW1vbkN1cnJlbmN5Q29kZXMpXG4gICAgICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWEJUJylcbiAgICAgICAgICAgIHJldHVybiAnQlRDJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCQ0MnKVxuICAgICAgICAgICAgcmV0dXJuICdCQ0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RSSycpXG4gICAgICAgICAgICByZXR1cm4gJ0RBU0gnO1xuICAgICAgICAvLyB0aG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GV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdkZWNpbWFsX3BsYWNlcycpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfYW1vdW50JyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3ByaWNlJyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfcHJpY2UnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl90b3RhbCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ2hpZGRlbiddID09IDApO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogbWFya2V0WydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmV0dXJuJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGZ1bmRzID0gYmFsYW5jZXNbJ2Z1bmRzJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGZ1bmRzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgdXBwZXJjYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgdG90YWwgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlc1snb3Blbl9vcmRlcnMnXSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgdG90YWwgPSBmdW5kc1tjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgdXNlZCA9IDAuMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnVuZHNbY3VycmVuY3ldLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aFBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgIC8vICdsa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VmaW5lZDtcbiAgICAgICAgaWYgKCFzeW1ib2xzKSB7XG4gICAgICAgICAgICAvLyBsZXQgbnVtSWRzID0gdGhpcy5pZHMubGVuZ3RoO1xuICAgICAgICAgICAgLy8gaWYgKG51bUlkcyA+IDI1NilcbiAgICAgICAgICAgIC8vICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hUaWNrZXJzKCkgcmVxdWlyZXMgc3ltYm9scyBhcmd1bWVudCcpO1xuICAgICAgICAgICAgaWRzID0gdGhpcy5pZHM7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZHMgPSB0aGlzLm1hcmtldElkcyAoc3ltYm9scyk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IGlkcy5qb2luICgnLScpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzICh0aWNrZXJzKTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2tdO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZm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Y2VsT3JkZXIgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF1bJ3N0YXR1cyddID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnbm90IGZvdW5kJykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBzdGF0dXMgPSBvcmRlclsnc3RhdHVzJ107XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMCkge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAxKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2xvc2VkJztcbi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aW5nICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJzIChvcmRlcnMsIG1hcmtldCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAob3JkZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsg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HJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGNhY2hlZE9yZGVySWRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjYWNoZWRPcmRlcklkc1trXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY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ICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICAgICAgcmVxdWVzdFsncGFpciddID0gbWFya2V0WydpZCddO1xuICAgICAgICB9XG4gICAgICAgIGlmIChsaW1pdClcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvdW50J10gPSBwYXJzZUludCAobGltaXQpO1xuICAgICAgICBpZiAoc2luY2UpXG4gICAgICAgICAgICByZXF1ZXN0WydzaW5jZSddID0gcGFyc2VJbnQgKHNpbmNlIC8gMTAwMCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZUhpc3RvcnkgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRyYWRlcyA9IFtdO1xuICAgICAgICBpZiAoJ3JldHVybicgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICB0cmFkZXMgPSByZXNwb25zZVsncmV0dXJuJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzICh0cmFkZXMsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3Q29pbiAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb2luTmFtZSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHBhcnNlRmxvYXQgKGFtb3VudCksXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXR1cm4nXVsndElkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbkJvZHlXaXRoU2VjcmV0IChib2R5KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpO1xuICAgIH1cblxuICAgIGdldFZlcnNpb25TdHJpbmcgKCkge1xuICAgICAgICByZXR1cm4gJy8nICsgdGhpcy52ZXJzaW9uO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLnNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAg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gICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTgwNzY4LWYyMmZjNDI0LTYzOGEtMTFlNy04OWM5LTYwMTBhNTRmZjliZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGl2ZWNvaW4ubmV0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQvYXBpP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hbGwvb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21heGJpZF9taW5hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3Jlc3RyaWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdGlja2VyJywgLy8gb21pdCBwYXJhbXMgdG8gZ2V0IGFsbCB0aWNrZXJzIGF0IG9uY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2NvaW5JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NsaWVudF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb25Db21tb25JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvZ2V0L2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvaGlzdG9yeS9zaXplJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3RvcnkvdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvY2FuY2VsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvc2VsbG1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FwaXRhbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FyZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvb2twYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BheWVlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvcGVyZmVjdG1vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvbWFrZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZVRpY2tlciAoKTtcbiAgICAgICAgbGV0IHJlc3RyaWN0aW9ucyA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VSZXN0cmljdGlvbnMgKCk7XG4gICAgICAgIGxldCByZXN0cmljdGlvbnNCeUlkID0gdGhpcy5pbmRleEJ5IChyZXN0cmljdGlvbnNbJ3Jlc3RyaWN0aW9ucyddLCAnY3VycmVuY3lQYWlyJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGNvaW5SZXN0cmljdGlvbnMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzdHJpY3Rpb25zQnlJZCwgc3ltYm9sKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogNSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAnY29zdCc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNvaW5SZXN0cmljdGlvbnMpIHtcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ3ByaWNlJ10gPSB0aGlzLnNhZmVJbnRlZ2VyIChjb2luUmVzdHJpY3Rpb25zLCAncHJpY2VTY2FsZScsIDUpO1xuICAgICAgICAgICAgICAgIGxpbWl0c1snYW1vdW50J11bJ21pbiddID0gdGhpcy5zYWZlRmxvYXQgKGNvaW5SZXN0cmljdGlvbnMsICdtaW5MaW1pdFF1YW50aXR5JywgbGltaXRzWydhbW91bnQnXVsnbWluJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGltaXRzWydwcmljZSddID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbmZvQ29pbkluZm8gKHBhcmFtcyk7XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gcmVzcG9uc2VbJ2luZm8nXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHt9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgaWQgPSBjdXJyZW5jeVsnc3ltYm9sJ107XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IDg7IC8vIGRlZmF1bHQgcHJlY2lzaW9uLCB0b2RvOiBmaXggXCJtYWdpYyBjb25zdGFudHNcIlxuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChjdXJyZW5jeVsnd2FsbGV0U3RhdHVzJ10gPT0gJ25vcm1hbCcpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsnd2l0aGRyYXdGZWUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5PcmRlckFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5XaXRoZHJhd0Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbkRlcG9zaXRBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgI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AgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hGZWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY29tbWlzc2lvbkluZm8gPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRFeGNoYW5nZUNvbW1pc3Npb25Db21tb25JbmZvICgpO1xuICAgICAgICBsZXQgY29tbWlzc2lvbiA9IHRoaXMuc2FmZUZsb2F0IChjb21taXNzaW9uSW5mbywgJ2NvbW1pc3Npb24nKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogY29tbWlzc2lvbkluZm8sXG4gICAgICAgICAgICAnbWFrZXInOiBjb21taXNzaW9uLFxuICAgICAgICAgICAgJ3Rha2VyJzogY29tbWlzc2lvbixcbiAgICAgICAgICAgICd3aXRoZHJhdyc6IDAuMCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZU9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2dyb3VwQnlQcmljZSc6ICdmYWxzZScsXG4gICAgICAgICAgICAnZGVwdGgnOiAxMDAsXG4gICAgICA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gICB0eXBlID0gJ2xpbWl0JztcbiAgICAgICAgfVxuICAgICAgICBpZiAob3JkZXJbJ3R5cGUnXS5pbmRleE9mICgnU0VMTCcpID49IDApIHtcbiAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnLCAwLjApO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2NvbW1pc3Npb25CeVRyYWRlJywgMC4wKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3JlbWFpbmluZ1F1YW50aXR5JywgMC4wKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3F1YW50aXR5JywgcmVtYWluaW5nKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3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BuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIgcmVxdWlyZXMgYSBzeW1ib2wgYXJndW1lbnQnKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgY3VycmVuY3lQYWlyID0gbWFya2V0WydpZCddO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0RXhjaGFuZ2VDYW5jZWxsaW1pdCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdvcmRlcklkJzogaWQsXG4gICAgICAgICAgICAnY3VycmVuY3lQYWlyJzogY3VycmVuY3lQYWlyLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnbWVzc2FnZScsIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAobWVzc2FnZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCdjYW5jZWxsZWQnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydjYW5jZWxsZWQnXSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuIC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VuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKVxuICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FwaS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID49IDMwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yQ29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVycm9yID0gcmVzcG9uc2VbJ2Vycm9yQ29kZSddO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdlcnJvck1lc3NhZ2UnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydlcnJvck1lc3NhZ2UnXSA9PSAnVXNlciBub3QgZm91bmQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHJlc3BvbnNlWydlcnJvck1lc3NhZ2UnXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChlcnJvciA9PSAxMCkgfHwgKGVycm9yID09IDExKSB8fCAoZXJyb3IgPT0gMTIpIHx8IChlcnJvciA9PSAyMCkgfHwgKGVycm9yID09IDMwKSB8fCAoZXJyb3IgPT0gMTAxKSB8fCAoZXJyb3IgPT0gMTAyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBOb3RTdXBwb3J0ZWQgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDEwMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnOiBJbnZhbGlkIHBhcmFtZXRlcnMgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAxMDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnOiBJbnZhbGlkIGN1cnJlbmN5ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMTA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJzogSW52YWxpZCBhbW91bnQgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAxMDUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnOiBVbmFibG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ViOWJlMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLm15Yml0eC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx1bm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHVuby5jb20vZW4vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vbnBtanMub3JnL3BhY2thZ2UvYml0eCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYmF1c21laWVyL25vZGUtYml0eCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3RvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0b3BvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvYXV0aDIvZ3JhbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgIC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XIsICdmZWVfY291bnRlcicpO1xuICAgICAgICBsZXQgYmFzZUZlZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZV9iYXNlJyk7XG4gICAgICAgIGxldCBmZWUgPSB7ICdjdXJyZW5jeSc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBpZiAocXVvdGVGZWUpIHtcbiAgICAgICAgICAgIGZlZVsnc2lkZSddID0gJ3F1b3RlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gcXVvdGVGZWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmZWVbJ3NpZGUnXSA9ICdiYXNlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gYmFzZUZlZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyc0lkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZSk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVm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SAnYnV5JylcbiAgICAgICAgICAgICAgICBvcmRlclsnY291bnRlcl92b2x1bWUnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsnYmFzZV92b2x1bWUnXSA9IGFtb3VudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnT3JkZXInO1xuICAgICAgICAgICAgb3JkZXJbJ3ZvbHVtZSddID0gYW1vdW50O1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gPSAnQklEJztcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsndHlwZSddID0gJ0FTSyc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFN0b3BvcmRlciAoeyAnb3JkZXJfaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB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biAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODM3MDYwLWU3YzU4NzE0LTYwZWEtMTFlNy05MTkyLWYwNWU4NmFkYjgzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm1lcmNhZG9iaXRjb2luLm5ldC90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyL2FwaS1kb2MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyL3RyYWRlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L29yZGVyYm9vay8nLCAvLyBsYXN0IHNsYXNoIGNyaXRpY2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdHJhZGVzL3tmcm9tfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219L3t0b30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS9kYXktc3VtbWFyeS97eWVhcn0ve21vbnRofS97ZGF5fS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FjY291bnRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9zeXN0ZW1fbWVzc2FnZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VfYnV5X29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9zZWxsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvQlJMJzogeyAnaWQnOiAnQlJMQlRDJywgJ3N5bWJvbCc6ICdCVEMvQlJMJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0JSTCcsICdzdWZmaXgnOiAnQml0Y29pbicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL0JSTCc6IHsgJ2lkJzogJ0JSTExU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CAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDb2luVHJhZGVzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW4nOiBtYXJrZXRbJ2Jhc2UnXSxcb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ICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGFsbG93cyBsaW1pdCBvcmRlcnMgb25seScpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3ByaXZhdGVQb3N0UGxhY2UnICsgdGhpcy5jYXBpdGFsaXplIChzaWRlKSArICdPcmRlcic7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdjb2luX3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ3F1YW50aXR5JzogYW1vdW50LFxuICAgICAgICAgICAgJ2xpbWl0X3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsncmVzcG9uc2VfZGF0YSddWydvcmRlciddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAoIXN5bWJvbCl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zdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICghc3ltYm9sKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgcmVxdWlyZXMgYSBzeW1ib2wgYXJndW1lbnQnKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAg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UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL3RhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArICc/JyArIGJvZHk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnVEFQSS1JRCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdUQVBJLU1BQyc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnZXJyb3JfbWVzc2FnZScgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0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b20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9taXhjb2lucy5jb20vaGVscC9hcGkvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdidGNfdXNkJywgJ3N5bWJvbCc6ICdCVEMvVVNEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1VTRCcsICdtYWtlcic6IDAuMDAxNSwgJ3Rha2VyJzogMC4wMDI1IH0sXG4gICAgICAgICAgICAgICAgJ0VUSC9CVEMnOiB7ICdpZCc6ICdldGhfYnRjJywgJ3N5bWJvbCc6ICdFVEgvQlRDJywgJ2Jhc2UnOiAnRVRIJywgJ3F1b3RlJz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PcmRlckJvb2sgKHJlc3BvbnNlWydyZXN1bHQnXSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IH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mtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydyZXN1bHQnXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdtYXJrZXQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ29wJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKSB7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gMTtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0VHJhZGUgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ3Jlc3VsdCddWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbCAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGJvZHkpLCB0aGlzLnNlY3JldCwgJ3No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GUuZXhwb3J0cyA9IGNsYXNzIG5vdmEgZXh0ZW5kcyBFeGNoYW5nZSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnbm92YScsXG4gICAgICAgICAgICAnbmFtZSc6ICdOb3ZhZXhjaGFuZ2UnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdUWicsIC8vIFRhbnphbmlhXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwNTE4NTcxLTc4Y2EwYmNhLTliOGEtMTFlNy04ODQwLTY0YjgzYTRhOTRiMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9ub3ZhZXhjaGFuZ2UuY29tL3JlbW90ZScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL25vdmFleGNoYW5nZS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9ub3ZhZXhjaGFuZ2UuY29tL3JlbW90ZS9mYXEnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97YmFzZWN1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9pbmZvL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcmRlcmhpc3Rvcnkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L2J1eS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS9zZWxsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L2JvdGgvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0ve29yZGVydHlwZX0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2Uve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0d2l0aGRyYXdhbHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRuZXdkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGFkZHJlc3Mve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215b3Blbm9yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215b3Blbm9yZGVyc19tYXJrZXQve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2Vsb3JkZXIve29yZGVyaWR9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0d2l0aGRyYXdhbGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzdGF0dXMve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ21hcmtldHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rpc2FibGVkJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldG5hbWUnXTtcbiAgICAgICAgICAgICAgICBsZXQgWyBxdW90ZSwgYmFzZSBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVub3JkZXJzUGFpckJvdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXlvcmRlcnMnLCAnc2VsbG9yZGVycycsICdwcmljZScsICdhbW91bnQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldEluZm9QYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnN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TtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYW1vdW50ID0gYW1vdW50LnRvU3RyaW5nICgpO1xuICAgICAgICBwcmljZSA9IHByaWNlLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0cmFkZXR5cGUnOiBzaWRlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3RyYWRlYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3RyYWRlcHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0cmFkZWJhc2UnOiAxLFxuICAgICAgICAgICAgJ3BhaXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RUcmFkZVBhaXIgKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAg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c6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlX3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2VzdGltYXRlZF9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2hvbGRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaW5kZXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3ByaWNlX2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd3NfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2JvcnJvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9iYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2Rldm9sdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9leHBsb3NpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mb180Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3VibWl0X290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VucmVwYXltZW50c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NzkxLTg5ZmZiNTAyLTVlZTUtMTFlNy04YTViLWM1OTUwYjY4YWM2NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5va2NvaW4uY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL29rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldE1hcmtldHNQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0c1tpXVsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdXBwZXJjYXNlLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldHNbaV1bJ21heFNpemVEaWdpdCddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldHNbaV1bJ21heFByaWNlRGlnaXQnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXRzW2ldLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0c1tpXVsnbWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAobWFya2V0KTtcbiAgICAgICAgICAgIGlmICgodGhpcy5oYXNGdXR1cmVNYXJrZXRzKSAmJiAobWFya2V0WydxdW90ZSddID09ICdVU0RUJykpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKG1hcmtldCwge1xuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiAnVVNEJyxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnYmFzZSddICsgJy9VU0QnLFxuICAgICAgICAgICAgICAgICAgICAnaWQnOiBtYXJrZXRbJ2lkJ10ucmVwbGFjZSAoJ3VzZHQnLCAndXNkJyksXG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogJ2Z1dHVyZScsXG4gICAgICAgICAgICAgICAgICAgICdzcG90JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdmdXR1cmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwdWJsaWNHZXQnO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ10gPSAndGhpc193ZWVrJzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgIH1cbiAgICAgICAgbWV0aG9kICs9ICdEZXB0aCc7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2JpZHMnOiBvcmRlcmJvb2tbJ2JpZHMnXSxcbiAgICAgICAgICAgICdhc2tzJzogdGhpcy5zb3J0QnkgKG9yZGVyYm9va1snYXNrcyddLCAwKSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjb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iAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdCc7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICdjb250cmFjdF90eXBlJzogJ3RoaXNfd2VlaycsIC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICAgICAgICAgICdtYXRjaF9wcmljZSc6IDAsIC8vIG1hdGNoIGJlc3QgY291bnRlciBwYXJ0eSBwcmljZT8gMCBvciAxLCBpZ25vcmVzIHByaWNlIGlmIDFcbiAgICAgICAgICAgICAgICAnbGV2ZXJfcmF0ZSc6IDEwLCAvLyBsZXZlcmFnZSByYXRlIHZhbHVlOiAxMCBvciAyMCAoMTAgYnkgZGVmYXVsdClcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gKz0gJ19tYXJrZXQnO1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5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dWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAnb3JkZXJfaWQnOiBpZCxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdCc7XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZUNhbmNlbCc7XG4gICAgICAgICAgICByZXF1ZXN0Wydjb250cmFjdF90eXBlJ10gPSAndGhpc193ZWVrJzsgLy8gbmV4dF93ZWVrLCBxdWFydGVyXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0NhbmNlbE9yZGVyJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXJTdGF0dXMgKHN0YXR1cykge1xuICAgICAgICBpZiAoc3RhdHVzID09IC0xKVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMClcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMSlcbiAgICAgICAgICAgIHJldHVybiAncGFydGlhbCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMilcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGlmICgob3JkZXJbJ3R5cGUnXSA9PSAnYnV5JykgfHwgKG9yZGVyWyd0eXBlJ10gPT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gKG9yZGVyWyd0eXBlJ10gPT0gJ2J1eV9tYXJrZXQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbWFya2V0JztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKVxuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ3N5bWJvbCddXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNyZWF0ZURhdGVGaWVsZCA9IHRoaXMuZ2V0Q3JlYXRlRGF0ZUZpZWxkICgpO1xuICAgICAgICBpZiAoY3JlYXRlRGF0ZUZpZWxkIGluIG9yZGVyKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gb3JkZXJbY3JlYXRlRGF0ZUZpZWxkXTtcbiAgICAgICAgbGV0IGFtb3VudCA9IG9yZGVyWydhbW91bnQnXTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IG9yZGVyWydkZWFsX2Ftb3VudCddO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gYW1vdW50IC0gZmlsbGVkO1xuICAgICAgICBsZXQgYXZlcmFnZSA9IG9yZGVyWydhdmdfcHJpY2UnXTtcbiAgICAgICAgbGV0IGNvc3QgPSBhdmVyYWdlICogZmlsbGVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1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ciAodGhpcy5pZCArICcgZmV0Y2hPcmRlcnMoKSByZXF1aXJlcyB0eXBlIHBhcmFtIG9yIHN0YXR1cyBwYXJhbSBmb3Igc3BvdCBtYXJrZXQgJyArIHN5bWJvbCArICcgKDAgb3IgXCJvcGVuXCIgZm9yIHVuZmlsbGVkIG9yZGVycywgMSBvciBcImNsb3NlZFwiIGZvciBmaWxsZWQgb3JkZXJzKScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSAnb3BlbicpXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gMDtcbiAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gJ2Nsb3NlZCcpXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gMTtcbiAgICAgICAgICAgIGlmIChvcmRlcl9pZF9pbl9wYXJhbXMpIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVyc0luZm8nO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWV0aG9kICs9ICdPcmRlckhpc3RvcnknO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICAgICAnY3VycmVudF9wYWdlJzogMSwgLy8gY3VycmVudCBwYWdlIG51bWJlclxuICAgICAgICAgICAgICAgICAgICAncGFnZV9sZW5ndGgnOiAyMDAsIC8vIG51bWJlciBvZiBvcmRlcnMgcmV0dXJuZWQgcGVyIHBhZ2UsIG1heGltdW0gMjAwXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBwYXJ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ICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzkwNTY0LWE5NDVhOWQ0LTVmZjktMTFlNy05ZDJkLWI2MzU3NjNmMmYyNC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9wYXltaXVtLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucGF5bWl1bS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vUGF5bWl1bS9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5wYXltaXVtLmNvbS9wYWdlL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvdW50cmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2NoYXJ0cy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZXJjaGFudC9nZXRfcGF5bWVudC97VVVJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3Nlcy97YnRjX2FkZHJlc3N9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXltZW50X3JlcXVlc3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvY3JlYXRlX3BheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJpY2VfYWxlcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdldXInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA1OSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSAnYmFsYW5jZV8nICsgbG93ZXJjYXNlO1xuICAgICAgICAgICAgbGV0IGxvY2tlZCA9ICdsb2NrZWRfJyArIGxvd2VyY2FzZTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlIGluIGJhbGFuY2VzKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGJhbGFuY2VzW2JhbGFuY2VdO1xuICAgIC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CAndmFyaWF0aW9uJyksXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydjcmVhdGVkX2F0X2ludCddKSAqIDEwMDA7XG4gICAgICAgIGxldCB2b2x1bWUgPSAndHJhZGVkXycgKyBtYXJrZXRbJ2Jhc2UnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndXVpZCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVt2b2x1bWVdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERhdGFJZFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChtYXJrZXQsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5jYXBpdGFsaXplICh0eXBlKSArICdPcmRlcicsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChtYXJrZXQpLFxuICAgICAgICAgICAgJ2RpcmVjdGlvbic6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VyT3JkZXJzICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWyd1dWlkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt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C8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODE3LWU5NDU2MzEyLTVlZTYtMTFlNy05YjNjLWI2MjhjYTU2MjZhNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vdHJhZGluZ0FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcG9sb25pZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9wb2xvbmlleC5jb20vc3VwcG9ydC9hcGkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9wYXN0ZWJpbi5jb20vZE1YN21aRTAnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybjI0aFZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ2hhcnREYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Mb2FuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbExvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlTWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUxvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVOZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5TZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3ZlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkFjdGl2ZUxvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BdmFpbGFibGVBY2NvdW50QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Db21wbGV0ZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5GZWVJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5MZW5kaW5nSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTWFyZ2luQWNjb3VudFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5Mb2FuT2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlclRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGFibGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b2dnbGVBdXRvUmVuZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiAwLjAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgbGV0IHJhdGUgPSBtYXJrZXRbdGFrZXJPck1ha2VyXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiByYXRlKSk7XG4gICAgICAgIGlmIChzaWRlID09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb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hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgcXVvdGUsIGJhc2UgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IHRoaXMubGltaXRzWydhbW91bnQnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RSZXR1cm5Db21wbGV0ZUJhbGFuY2VzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2FjY291bnQnOiAnYWxsJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5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WtlckZlZSddKSxcbiAgICAgICAgICAgICd0YWtlcic6IHBhcnNlRmxvYXQgKGZlZXNbJ3Rha2VyRmVlJ10pLFxuICAgICAgICAgICAgJ3dpdGhkcmF3JzogMC4wLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFJldHVybk9yZGVyQm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeVBhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgLy8gJ2RlcHRoJzogMTAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoMjRociddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZ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AgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ2RlbGlzdGVkJ10gPT0gMCk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gKGN1cnJlbmN5WydkaXNhYmxlZCddKSA/ICdkaXNhYmxlZCcgOiAnb2snO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSAnb2snKVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd0eEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ3R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMucHVibGljR2V0UmV0dXJuVGlja2VyIChwYXJhbXMpO1xuICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1ttYXJrZXRbJ2lkJ11dO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCghbWFya2V0KSAmJiAoJ2N1cnJlbmN5UGFpcicgaW4gdHJhZGUpKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3lQYWlyID0gdHJhZGVbJ2N1cnJlbmN5UGFpciddO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5UGFpciBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbY3VycmVuY3lQYWlyXTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IHBhcnRzID0gY3VycmVuY3lQYWlyLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gcGFydHNbMF07XG4gICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3RvdGFsJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pO1xuICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGxldCByYXRlID0gcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKTtcbiAgICAgICAgICAgIGxldCBmZWVDb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGJhc2U7XG4gICAgICAgICAgICAgICAgZmVlQ29zdCA9IGFtb3VudCAqIHJhdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gcXVvdGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ICE9ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gY29zdCAqIHJhdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAg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AgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMuc2FmZUludGVnZXIgKG9yZGVyLCAndGltZXN0YW1wJyk7XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyWydkYXRlJ10pO1xuICAgICAgICBsZXQgdHJhZGVzID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3Jlc3VsdGluZ1RyYWRlcycgaW4gb3JkZXIpXG4gICAgICAgICAgICB0cmFkZXMgPSB0aGlzLnBhcnNlVHJhZGVzIChvcmRlclsncmVzdWx0aW5nVHJhZGVzJ10sIG1hcmtldCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSk7XG4gICAgICAgIGxldCBjb3N0ID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndG90YWwnLCAwLjApO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnYW1vdW50Jyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdzdGFydGluZ0Ftb3VudCcsIHJlbWFpbmluZyk7XG4gICAgICAgIGxldCBmaWxsZWQgPSBhbW91bnQgLSByZW1haW5pbmc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IG9yZGVyWydzdGF0dXMnXSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlT3Blbk9yZGVycyAob3JkZXJzLCBtYXJrZXQsIHJlc3VsdCA9IFtdKSB7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcnNbaV07XG4gICAgICAgICAgICBsZXQgZXh0ZW5kZWQgPSB0aGlzLmV4dGVuZCAob3JkZXIsIHtcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogb3JkZXJbJ3JhdGUnXSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMucGFyc2VPcmRlciAoZXh0ZW5kZWQsIG1hcmtldCkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlcnMgKHN5bWJvbCA9IHVuZGVmaW5lZCwgc2luY2UgPSB1bmRlZmluZW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ICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgb3Blbk9yZGVycy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbb3Blbk9yZGVyc1tqXVsnaWQnXV0gPSBvcGVuT3JkZXJzW2pdO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQgPSB0aGlzLmluZGV4QnkgKG9wZW5PcmRlcnMsICdpZCcpO1xuICAgICAgICBsZXQgY2FjaGVkT3JkZXJJZHMgPSBPYmplY3Qua2V5cyAodGhpcy5vcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgY2FjaGVkT3JkZXJJZHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGNhY2hlZE9yZGVySWRzW2tdO1xuICAgICAgICAgICAgaWYgKGlkIGluIG9wZW5PcmRlcnNJbmRleGVkQnlJZCkge1xuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIG9wZW5PcmRlcnNJbmRleGVkQnlJZFtpZF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnb3BlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ2Nsb3NlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IG9yZGVyWydhbW91bnQnXSAqIG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgICAgICA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odGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoaWQgaW4gdGhpcy5vcmRlcnMpIHtcbiAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXVsnc3RhdHVzJ10gPSAnY2FuY2VsZWQnO1xuICAgICAgICAgICAgbGV0IG5ld2lkID0gcmVzcG9uc2VbJ29yZGVyTnVtYmVyJ107XG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tuZXdpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogbmV3aWQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXN1bHQgPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbbmV3aWRdLCB7ICdpbmZvJzogcmVzcG9uc2UgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXN1bHQgPSB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnb3JkZXJOdW1iZXInXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzc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QnOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3Jlc3BvbnNlJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoeyAnY29tbWFuZCc6IHBhdGggfSwgcGFyYW1zKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHF1ZXJ5Wydub25jZSddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzL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yc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwOTUzOTE1LWIxNjExZGMwLWE0MzYtMTFlNy04OTQ3LWM5NWJkNWE0MjA4Ni5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kZXZlbG9wZXJzLnF1b2luZS5jb20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9wcmljZV9sZXZlbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2lyX2xhZGRlcnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9fYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9sb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcy97aWR9L2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2Fucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9jbG9zZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVkX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21ha2VyX2ZlZScpO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Rha2VyX2ZlZScpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9ICFtYXJrZXRbJ2Rpc2FibGVkJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHNCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogdG90YWwsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFByb2R1Y3RzSWRQcmljZUxldmVscyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXlfcHJpY2VfbGV2ZWxzJywgJ3NlbGxfcHJpY2VfbGV2ZWxzJyk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnbGFzdF90cmFkZWRfcHJpY2UnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKHRpY2tlclsnbGFzdF90cmFkZWRfcHJpY2UnXSkge1xuICAgICAgICAgICAgICAgIGxldCBsZW5ndGggPSB0aWNrZXJbJ2xhc3RfdHJhZGVkX3ByaWNlJ10ubGVuZ3RoO1xuICAgICAgICAgICAgICAgIGlmIChsZW5ndGggPiAwKVxuICAgICAgICAgICAgICAgICAgICBsYXN0ID0gcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3RyYWRlZF9wcmljZSddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1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aWQnOiBpZCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlciA9IHRoaXMucGFyc2VPcmRlciAocmVzdWx0KTtcbiAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnY2xvc2VkJylcbiAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChvcmRlcikpO1xuICAgICAgICByZXR1cm4gb3JkZXI7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkX2F0J10gKiAxMDAwO1xuICAgICAgICBsZXQgbWFya2V0SWQgPSBvcmRlclsncHJvZHVjdF9pZCddO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzQnlJZFttYXJrZXRJZF07XG4gICAgICAgIGxldCBzdGF0dXMgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnc3RhdHVzJyBpbiBvcmRlcikge1xuICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnbGl2ZScpIHtcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSAnb3Blbic7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdjbG9zZWQnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ2NhbmNlbGxlZCcpIHsgLy8gJ2xsJyBpbnRlbmRlZFxuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHBhcnNlRmxvYXQgKG9yZGVyWydxdWFudGl0eSddKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWxsZWRfcXVhbnRpdHknXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiBhbW91bnQgLSBmaWxsZWQsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlclsnb3JkZXJfZmVlJ10pLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0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zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBub3QgYSBKU09OIHJlc3BvbnNlXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGEgbm9uLUpTT04gcmVwbHk6ICcgKyBib2R5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoY29kZSA9PSA0MDQpIHtcbiAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09IDQyMikge1xuICAgICAgICAgICAgaWYgKCdlcnJvcnMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGVycm9ycyA9IHJlc3BvbnNlWydlcnJvcnMnXTtcbiAgICAgICAgICAgICAgICBpZiAoJ3VzZXInIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZXMgPSBlcnJvcnNbJ3VzZXInXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2VzLmluZGV4T2YgKCdub3RfZW5vdWdoX2ZyZWVfYmFsYW5jZScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgncXVhbnRpdHknIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZXMgPSBlcnJvcnNbJ3F1YW50aXR5J107XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlcy5pbmRleE9mICgnbGVzc190aGFuX29yZGVyX3NpemUnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICdYLVF1b2luZS1BUEktVmVyc2lvbic6IHRoaXMudmVyc2lvbixcbiAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgICAgICdwYXRoJzogdXJsLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICd0b2tlbl9pZCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdpYXQnOiBNYXRoLmZsb29yIChub25jZSAvIDEwMDApLCAvLyBpc3N1ZWQgYXRcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBoZWFkZXJzWydYLVF1b2luZS1BdXRoJ10gPSB0aGlzLmp3dCAocmVxdWVzdCwgdGhpcy5zZWNyZXQpO1xuICAgICAgICB9XG4gICAgICAgIHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyB1cmw7XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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dpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODI1LTk4YTZkMGRlLTVlZTctMTFlNy05ZmE0LTM4ZTExYTJjNmY1Mi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9va3VwX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DQUQnOiB7ICdpZCc6ICdidGNfY2FkJywgJ3N5bWJvbCc6ICdCVEMvQ0FEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NBRCcsICdtYWtlcic6IDAuMDA1LCAndGFrZXInOiAwLjAwNSB9LFxuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjX3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwNSwgJ3Rha2VyJzogMC4wMDUgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ2V0aF9idGMnLCAnc3ltYm9sJzogJ0VUSC9CVEMnLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnQlRDJywgJ21ha2VyJzogMC4wMDIsICd0YWtlcic6IDAuMDAyIH0sXG4gICAgICAgICAgICAgICAgJ0VUSC9DQUQnOiB7ICdpZCc6ICdldGhfY2FkJywgJ3N5bWJvbCc6ICdFVEgvQ0FEJywgJ2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ICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gWyBub25jZS50b1N0cmluZyAoKSwgdGhpcy51aWQsIHRoaXMuYXBpS2V5IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAodHlwZW9mIHJlc3BvbnNlID09ICd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DAwLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4Mzg5MTItNGY5NGVjOGEtNjBmNi0xMWU3LTllNWQtYmJmOWJkNTBhNTU5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnNvdXRoeGNoYW5nZS5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE1hcmtldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlbmV3YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbMF07XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbMV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmF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biAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnQmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ0xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnVmFyaWF0aW9uMjRIcicpLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ1ZvbHVtZTI0SHInKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcmljZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gdGhpcy5pbmRleEJ5IChyZXNwb25zZSwgJ01hcmtldCcpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcmljZVN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWydBdCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ1R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydQcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydBbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAg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uY29tLzEyOTQ0NTQvMjc3NjY4NjktNzUwNTdmYTItNWVlOS0xMWU3LTlhNmYtMTNlNjQxZmE0NzA3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90aGVyb2NrdHJhZGluZy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20vZG9jL3YxL2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkudGhlcm9ja3RyYWRpbmcuY29tL2RvYy8nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Rpc2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vcG9zaXRpb25fYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2xpbWl0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F0bXMvd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy9yZW1vdmVfYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAyIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc1RpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Z1bmRfaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBiYWxhbmNlWyd0cmFkaW5nX2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNJZE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyYm9va1snZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ2Ftb3VudCcpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ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SddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdXJsO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1UUlQtS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1gtVFJULU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ1gtVFJULVNJR04nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICdhcHBsaWNhdGlvbi9qc29uJztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2Q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JzogZmFsc2UsXG4gICAgICAgICAgICAvLyAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA3ODE3ODAtMDMxNDlkYzQtYTEyZS0xMWU3LTgyYmItMzEzYjI2OWQyNGQ0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS50aWRleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkudGlkZXguY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RpZGV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3RpZGV4LmNvbS9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3RpZGV4LmNvbS9wYWlycy1zcGVjJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgIC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ODA3NTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2U7XG4gICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGU7XG4gICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAnYmFzZUlkJzogYmFzZUlkLFxuICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgIC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F3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJzI0aEhpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWycyNGhMb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogYmlkWzBdLFxuICAgICAgICAgICAgJ2Fzayc6IGFza1swXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnTGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnMjRoVm9sdW1lJ10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICA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ywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSBwYXRoO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgICdYLVNpZ25hdHVyZSc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHVybCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxufVxu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TBhYS00MWYyNzExYjc0MDUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkudmlyd294LmNvbS9hcGkvanNvbi5waHAnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2FwaS90cmFkaW5nLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbS9kZXZlbG9wZXJzLnBocCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdsb2dpbic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3Bhc3N3b3JkJzogdHJ1ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5zdHJ1bWVudHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtrZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaW5zdHJ1bWVudElEJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydsb25nQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnc2hvcnRDdXJyZW5jeSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXVsnYWNjb3VudExpc3QnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogdG90YWwsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAg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ICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcklEJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnb3JkZXJJRCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGxldCBhdXRoID0ge307XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGF1dGhbJ2tleSddID0gdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBhdXRoWyd1c2VyJ10gPSB0aGlzLmxvZ2luO1xuICAgICAgICAgICAgYXV0aFsncGFzcyddID0gdGhpcy5wYXNzd29yZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAg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AgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd2V4Lm56L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3dleC5ueicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd2V4Lm56L2FwaS8zL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovdGFwaS9kb2NzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb2luRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWRlZW1Db3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbGFzdCcpLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXZnJyksXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2xfY3VyJyksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSAhPSAneycpIHtcbiAgICAgICAgICAgICAgICAvLyByZXNwb25zZSBpcyBub3QgSlNPTlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG5vbi1KU09OIHJlcGx5OiAnICsgYm9keSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGEgbWFsZm9ybWVkIGVycm9yOiAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gJ2JhZCBzdGF0dXMnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvci5pbmRleE9mICgnSXQgaXMgbm90IGVub3VnaCcpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnUmVxdWVzdHMgdG9vIG9mdGVuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdub3QgYXZhaWxhYmxlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnIC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AgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tL3RyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC54YnRjZS5pbmZvL0tub3dsZWRnZWJhc2UvQXJ0aWNsZS9WaWV3LzUyLzI1L3hidGNlLWV4Y2hhbmdlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2VydmVyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZC9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9wZXJpb2RpY2l0aWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcy9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS92ZXJzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFyZ2luQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnUHJvZml0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGlmIChiYXNlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgIGJhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydJc1RyYWRlQWxsb3dlZCddID8gc3ltYm9sIDogaWQ7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFzc2V0ICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgLy8geGJ0Y2UgbmFtZXMgREFTSCBpbmNvcnJlY3RseSBhcyBEU0hcbiAgICAgICAgICAgIGlmICh1cHBlcmNhc2UgPT0gJ0RTSCcpXG4gICAgICAgICAgICAgICAgdXBwZXJjYXNlID0gJ0RBU0gnO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydGcmVlQW1vdW50J10sXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydMb2NrZWRBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydBbW91bnQnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldExldmVsMkZpbHRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdmaWx0ZXInOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBvcmRlcmJvb2sgPSBvcmRlcmJvb2tbMF07XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlcmJvb2tbJ1RpbWVzdGFtcCddO1xuICAgICAgICBy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0dldFRpY2tlciAocGFyYW1zKTtcbiAgICAgICAgdGlja2VycyA9IHRoaXMuaW5kZXhCeSAodGlja2VycywgJ1N5bWJvbCcpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBpZiAoYmFzZSA9PSAnRFNIJylcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBpZiAocXVvdGUgPT0gJ0RTSCcpXG4gICAgICAgICAgICAgICAgICAgIHF1b3RlID0gJ0RBU0gnO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1x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xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbjtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJylcbiAgICAgICAgICAgIHVybCArPSAnLycgKyBhcGk7XG4gICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQWNjZXB0LUVuY29kaW5nJzogJ2d6aXAsIGRlZmxhdGUnIH07XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9XG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0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgeW9iaXQgZXh0ZW5kcyBsaXF1aSB7XG5cbiAgICBkZXNjcmliZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAneW9iaXQnLFxuICAgICAgICAgICAgJ25hbWUnOiAnWW9CaXQnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdSVScsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMzAwMCwgLy8gcmVzcG9uc2VzIGFyZSBjYWNoZWQgZXZlcnkgMiBzZWNvbmRzXG4gICAgICAgICAgICAndmVyc2lvbic6ICczJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IGZhbHNlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjkxMC1jZGNiZmRhZS01ZWVhLTExZTctOTg1OS0wM2ZlYTg3MzI3MmQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8veW9iaXQubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8veW9iaXQubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0L2VuL2FwaS8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbnNUb0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBsZXQgc3Vic3RpdHV0aW9ucyA9IHtcbiAgICAgICAgICAgICdBSVInOiAnQWlyQ29pbicsXG4gICAgICAgICAgICAnQU5JJzogJ0FOSUNvaW4nLFxuICAgICAgICAgICAgJ0FOVCc6ICdBbnRzQ29pbicsXG4gICAgICAgICAgICAnQVRNJzogJ0F1dHVtbmNvaW4nLFxuICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgJ0JUUyc6ICdCaXRzaGFyZXMyJyxcbiAgICAgICAgICAgICdEQ1QnOiAnRGlzY291bnQnLFxuICAgICAgICAgICAgJ0RHRCc6ICdEYXJrR29sZENvaW4nLFxuICAgICAgICAgICAgJ0lDTic6ICdpQ29pbicsXG4gICAgICAgICAgICAnTElaSSc6ICdMaVppJyxcbiAgICAgICAgICAgICdMVU4nOiAnTHVuYXJDb2luJyxcbiAgICAgICAgICAgICdOQVYnOiAnTmF2YWpvQ29pbicsXG4gICAgICAgICAgICAnT01HJzogJ09NR2FtZScsXG4gICAgICAgICAgICAnUEFZJzogJ0VQQVknLFxuICAgICAgICAgICAgJ1JFUCc6ICdSZXB1YmxpY29pbicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjdXJyZW5jeSBpbiBzdWJzdGl0dXRpb25zKVxuICAgICAgICAgICAgcmV0dXJuIHN1YnN0aXR1dGlvbnNbY3VycmVuY3ldO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgY3VycmVuY3lJZCAoY29tbW9uQ29kZSkge1xuICAgICAgICBsZXQgc3Vic3RpdHV0aW9ucyA9IHtcbiAgICAgICAgICAgICdBaXJDb2luJzogJ0FJUicsXG4gICAgICAgICAgICAnQU5JQ29pbic6ICdBTkknLFxuICAgICAgICAgICAgJ0FudHNDb2luJzogJ0FOVCcsXG4gICAgICAgICAgICAnQXV0dW1uY29pbic6ICdBVE0nLFxuICAgICAgICAgICAgJ0JDSCc6ICdCQ0MnLFxuICAgICAgICAgICAgJ0JpdHNoYXJlczInOiAnQlRTJyxcbiAgICAgICAgICAgICdEaXNjb3VudCc6ICdEQ1QnLFxuICAgICAgICAgICAgJ0RhcmtHb2xkQ29pbic6ICdER0QnLFxuICAgICAgICAgICAgJ2lDb2luJzogJ0lDTicsXG4gICAgICAgICAgICAnTGlaaSc6ICdMSVpJJyxcbiAgICAgICAgICAgICdMdW5hckNvaW4nOiAnTFVOJyxcbiAgICAgICAgICAgICdOYXZham9Db2luJzogJ05BVicsXG4gICAgICAgICAgICAnT01HYW1lJzogJ09NRycsXG4gICAgICAgICAgICAnRVBBWSc6ICdQQVknLFxuICAgICAgICAgICAgJ1JlcHVibGljb2luJzogJ1JFUCcsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjb21tb25Db2RlIGluIHN1YnN0aXR1dGlvbnMpXG4gICAgICAgICAgICByZXR1cm4gc3Vic3RpdHV0aW9uc1tjb21tb25Db2RlXTtcbiAgICAgICAgcmV0dXJuIGNvbW1vbkNvZGU7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBzaWRlcyA9IHsgJ2ZyZWUnOiAnZnVuZHMnLCAndG90YWwnOiAnZnVuZHNfaW5jbF9vcmRlcnMnIH07XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHNpZGVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gc2lkZXNba2V5XTtcbiAgICAgICAgICAgIGlmIChzaWRlIGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXNbc2lkZV0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY3VycmVuY2llcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY2llc1tqXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGxvd2VyY2FzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFtrZXldID0gYmFsYW5jZXNbc2lkZV1bbG93ZXJjYXNlXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10gJiYgYWNjb3VudFsnZnJlZSddKVxuICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVEZXBvc2l0QWRkcmVzcyAoY3VycmVuY3ksIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY3VycmVuY3ksIHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbmVlZF9uZXcnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiByZXNwb25zZVsnYWRkcmVzcyddLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlWydpbmZvJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY3VycmVuY3ksIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBjdXJyZW5jeUlkID0gdGhpcy5jdXJyZW5jeUlkIChjdXJyZW5jeSk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2NvaW5OYW1lJzogY3VycmVuY3lJZCxcbiAgICAgICAgICAgICduZWVkX25ldyc6IDAsXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoa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24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgYWN4ID0gcmVxdWlyZSAoJy4vYWN4LmpzJylcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgeXVuYmkgZXh0ZW5kcyBhY3gge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3l1bmJpJyxcbiAgICAgICAgICAgICduYW1lJzogJ1lVTkJJJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzJoJzogJzEyMCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICc3MjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnNDMyMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NTcwNTQ4LTRkNjQ2YzQwLTcxNDctMTFlNy05Y2Y2LTgzOWI5M2U2ZDYyMi5qcGcnLFxuICAgICAgICAgICAgICAgICdleHRlbnNpb24nOiAnLmpzb24nLCAvLyBkZWZhdWx0IGV4dGVuc2lvbiBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxzXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3l1bmJpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3l1bmJpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL2RvY3VtZW50cy9hcGkvZ3VpZGUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly95dW5iaS5jb20vc3dhZ2dlci8nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tfd2l0aF9wZW5kaW5nX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZXN0YW1wJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzZXMve2FkZHJlc3N9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXJ0bmVycy9vcmRlcnMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVsZXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9tdWx0aScsXG4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yc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTI3LTM5Y2EyYWRhLTVlZWItMTFlNy05NzJmLTFiNDE5OTUxOGNhNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vdGVjaGJ1cmVhdS1hcGktZG9jdW1lbnQucmVhZHRoZWRvY3MuaW8vamEvbGF0ZXN0L2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MvYXBpX2xpbmtzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL3lvdTIxOTc5L25vZGUtemFpZicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pZF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcGVyc29uYWxfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdlY2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZUlkc0J5T3JkZXJOdW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RsYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3Vwcy97Z3JvdXBfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlyc0FsbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzWydmdW5kcyddKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1snZnVuZHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoJ2RlcG9zaXQnIGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzWydkZXBvc2l0J10pIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzWydkZXBvc2l0J11bY3VycmVuY3ldO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFt1cHBlcmNhc2VdID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICA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gICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2FjdGlvbic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXR1cm4nXVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydhY3Rpb24nXSA9PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ2N1cnJlbmN5X3BhaXInXV07XG4gICAgICAgIGxldCBwcmljZSA9IG9yZGVyWydwcmljZSddO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ2Ftb3VudCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlcnMgKG9yZGVycywgbWFya2V0ID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChvcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx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ydhcGknXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICdhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ2ZhcGknKSB7XG4gICAgICAgICAgICB1cmwgKz0gJ2ZhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKGFwaSA9PSAnZWNhcGknKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICdlY2FwaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAndGxhcGknKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0bGFwaSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHVybCArPSAndGFwaSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0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3JzogJ2h0dHBzOi8vdHJhZGUuemIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy56Yi5jb20vaS9kZXZlbG9wZXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyc05ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzSWdub3JlVHJhZGVUeXBlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVbmZpbmlzaGVkT3JkZXJzSWdub3JlVHJhZGVUeXBlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VXNlckFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFdpdGhkcmF3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENoYXJnZVJlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255V2l0aGRyYXdSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENueUNoYXJnZVJlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZXRUcmFkaW5nRmVlRnJvbUJhc2VRdW90ZSAoYmFzZSwgcXVvdGUpIHtcbiAgICAgICAgLy8gYmFzZTogcXVvdGVcbiAgICAgICAgbGV0IGZlZXMgPSB7XG4gICAgICAgICAgICAnQlRDJzogeyAnVVNEVCc6IDAuMCB9LFxuICAgICAgICAgICAgJ0JDSCc6IHsgJ0JUQyc6IDAuMDAxLCAnVVNEVCc6IDAuMDAxIH0sXG4gICAgICAgICAgICAnTFRDJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnRVRIJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnRVRDJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnQlRTJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wMDEgfSxcbiAgICAgICAgICAgICdFT1MnOiB7ICdCVEMnOiAwLjAwMSwgJ1VTRFQnOiAwLjAwMSB9LFxuICAgICAgICAgICAgJ0hTUic6IHsgJ0JUQyc6IDAuMDAxLCAnVVNEVCc6IDAuMDAxIH0sXG4gICAgICAgICAgICAnUVRVTSc6IHsgJ0JUQyc6IDAuMDAxLCAnVVNEVCc6IDAuMDAxIH0sXG4gICA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gICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50U2NhbGUnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlU2NhbGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdtYWtlcic6IGZlZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBmZWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzWydiYWxhbmNlJ10pXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbJ2JhbGFuY2UnXVtjdXJyZW5jeV1bJ2Ftb3VudCddKTtcbiAgICAgICAgIC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B1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbCddKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCx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XVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcGFyYW1zTGVuZ3RoID0gcGFyYW1zLmxlbmd0aDsgLy8gcGFyYW1zIHNob3VsZCBiZSBhIHN0cmluZyBoZXJlXG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnbWV0aG9kPScgKyBwYXRoO1xuICAgICAgICAgICAgYXV0aCArPSAnJmFjY2Vzc2tleT0nICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBhdXRoICs9IHBhcmFtc0xlbmd0aCA/IHBhcmFtcyA6ICcnO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuaGFzaCAodGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTEnKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHNlY3JldCksICdtZDUnKTtcbiAgICAgICAgICAgIGxldCBzdWZmaXggPSAnc2lnbj0nICsgc2lnbmF0dXJlICsgJyZyZXFUaW1lPScgKyBub25jZS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyBwYXRoICsgJz8nICsgYXV0aCArICcmJyArIHN1ZmZpeDtcbiAgICAgICAgfVxuICAgICAgICByZXR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xMjgpIHtcblx0ICAgICAgICAgICAgICAgIGRbaV0gPSBpIDw8IDE7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICBkW2ldID0gKGkgPDwgMSkgXiAweDExYjtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIFdhbGsgR0YoMl44KVxuXHQgICAgICAgIHZhciB4ID0gMDtcblx0ICAgICAgICB2YXIgeGkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBzYm94XG5cdCAgICAgICAgICAgIHZhciBzeCA9IHhpIF4gKHhpIDw8IDEpIF4gKHhpIDw8IDIpIF4gKHhpIDw8IDMpIF4gKHhpIDw8IDQpO1xuXHQgICAgICAgICAgICBzeCA9IChzeCA+Pj4gOCkgXiAoc3ggJiAweGZmKSBeIDB4NjM7XG5cdCAgICAgICAgICAgIFNCT1hbeF0gPSBzeDtcblx0ICAgICAgICAgICAgSU5WX1NCT1hbc3hdID0geDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIG11bHRpcGxpY2F0aW9uXG5cdCAgICAgICAgICAgIHZhciB4MiA9IGRbeF07XG5cdCAgICAgICAgICAgIHZhciB4NCA9IGRbeDJdO1xuXHQgICAgICAgICAgICB2YXIgeDggPSBkW3g0XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIHN1YiBieXRlcywgbWl4IGNvbHVtbnMgdGFibGVzXG5cdCAgICAgICAgICAgIHZhciB0ID0gKGRbc3hdICogMHgxMDEpIF4gKHN4ICogMHgxMDEwMTAwKTtcblx0ICAgICAgICAgICAgU1VCX01JWF8wW3hdID0gKHQgPDwgMjQpIHwgKHQgPj4+IDgpO1xuXHQgICAgICAgICAgICBTVUJfTUlYXzFbeF0gPSAodCA8PCAxNikgfCAodCA+Pj4gMTYpO1xuXHQgICAgICAgICAgICB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93IDwga3NSb3dzOyBrc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAtIDRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICBpZiAoaW52S3NSb3cgPCA0IHx8IGtzUm93IDw9IDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSB0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICBpbnZLZXlTY2hlZHVsZVtpbnZLc1Jvd10gPSBJTlZfU1VCX01JWF8wW1NCT1hbdCA+Pj4gMjRdXSBeIElOVl9TVUJfTUlYXzFbU0JPWFsodCA+Pj4gMTYpICYgMHhmZl1dIF5cblx0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gICAgICAgICAgICAgaWYgKHR5cGVvZiBrZXkgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFzc3dvcmRCYXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkuZGVjcnlwdChjaXBoZXIsIGNpcGhlcnRleHQsIGtleSwgY2ZnKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9O1xuXHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0oKSlcblx0ICAgIH0pO1xuXG5cdCAgICAvKipcblx0ICAgICAqIEFic3RyYWN0IGJhc2Ugc3RyZWFtIGNpcGhlciB0ZW1wbGF0ZS5cblx0ICAgICAqXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gYmxvY2tTaXplIFRoZSBudW1iZXIgb2YgMzItYml0IHdvcm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GEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbWVtYmVyIHRoaXMgYmxvY2sgdG8gdXNlIHdpdGggbmV4dCBibG9ja1xuXHQgICAgICAgICAgICAgICAgdmFyIHRoaXNCbG9jayA9IHdvcmRzLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgYmxvY2tTaXplKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRGVjcnlwdCBhbmQgWE9SXG5cdCAgICAgICAgICAgICAgICBjaXBoZXIuZGVjcnlwdEJsb2NrKHdvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBUaGlzIGJsb2NrIGJlY29tZXMgdGhlIHByZXZpb3VzIGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB0aGlzQmxvY2s7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIGZ1bmN0aW9uIHhvckJsb2NrKHdvcmRzLCBvZmZzZXQsIGJsb2NrU2l6ZSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaXYgPSB0aGlzLl9pdjtcblxuXHQgICAgICAgICAgICAvLyBDaG9vc2UgbWl4aW5nIGJsb2NrXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaXY7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBJViBmb3Igc3Vic2VxdWVudCBibG9ja3Ncblx0ICAgICAgICAgICAgICAgIHRoaXMuX2l2ID0gdW5kZWZpbmVkO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gdGhpcy5fcHJldkJsb2NrO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gWE9SIGJsb2Nrc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tvZmZzZXQgKyBpXSBePSBibG9ja1tpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIHJldHVybiBDQkM7XG5cdCAgICB9KCkpO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFBhZGRpbmcgbmFtZXNwYWNlLlxuXHQgICAgICovXG5cdCAgICB2YXI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ICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXG5cdCAgICAgICAgICogICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUEtDUzcsXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIGNpcGhlciBwYXJhbXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAdGhyb3dzIEVycm9yIElmIG5laXRoZXIgdGhlIGZvcm1hdHRlciBub3IgdGhlIGRlZmF1bHQgZm9ybWF0dGVyIGlzIHNldC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IGNpcGhlclBhcmFtcyArICcnO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gY2lwaGVyUGFyYW1zLnRvU3RyaW5nKCk7XG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPS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1xuXHQgICAgdmFyIENfbGliID0gQy5saWIgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBCYXNlIG9iamVjdCBmb3IgcHJvdG90eXBhbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4gYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICpcblx0ICAgICAqIEBwcm9wZXJ0eSB7QXJyYXl9IHdvcmRzIFRoZSBhcnJheSBvZiAzMi1iaXQgd29yZHMuXG5cdCAgICAgKiBAcHJvcGVydHkge251bWJlcn0gc2lnQnl0ZXMgVGhlIG51bWJlciBvZiBzaWduaWZpY2FudCBieXRlcyBpbiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgKi9cblx0ICAgIHZhciBXb3JkQXJyYXkgPSBDX2xpYi5Xb3JkQXJyYXkgPSBCYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIHdvcmQgYXJyY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RoaXMgd29yZCBhcnJheSB0byBhIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7RW5jb2Rlcn0gZW5jb2RlciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgIC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SB3b3JkIGF0IGEgdGltZVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0aGF0U2lnQnl0ZXM7IGkgKz0gNCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHRoaXNXb3Jkc1sodGhpc1NpZ0J5dGVzICsgaSkgPj4+IDJdID0gdGhhdFdvcmRzW2kgPj4+IDJdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgKz0gdGhhdFNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENoYWluYWJsZVxuXHQgICAgICAgICAgICByZXR1cm4gdGhpcztcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVtb3ZlcyBpbnNpZ25pZmljYW50IGJpdHMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheS5jbGFtcCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsYW1wOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB0aGlzLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wXG5cdCAgICAgICAgICAgIHdvcmRzW3NpZ0J5dGVzID4+PiAyXSAmPSAweGZmZmZmZmZmIDw8ICgzMiAtIChzaWdCeXRlcyAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIHdvcmRzLmxlbmd0aCA9IE1hdGguY2VpbChzaWdCeXRlcyAvIDQpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0gd29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgd29yZCBhcnJheSBmaWxsZWQgd2l0aCByYW5kb20gYnl0ZXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbkJ5dGVzIFRoZSBudW1iZXIgb2YgcmFuZG9tIGJ5dGVzIHRvIGdlbmVyYXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKHV0ZjhTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAodXRmOFN0cikge1xuXHQgICAgICAgICAgICByZXR1cm4gTGF0aW4xLnBhcnNlKHVuZXNjYXBlKGVuY29kZVVSSUNvbXBvbmVudCh1dGY4U3RyKSkpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogQWJzdHJhY3QgYnVmZmVyZWQgYmxvY2sgY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pbmFsaXplKG1lc3NhZ2UpO1xuXHQgICAgICAgICAgICB9O1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgc2hvcnRjdXQgZnVuY3Rpb24gdG8gdGhlIEhNQUMncyBvYmplY3QgaW50ZXJmYWNlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtIYXNoZXJ9IGhhc2hlciBUaGUgaGFzaGVyIHRvIHVzZSBpbiB0aGlzIEhNQUMgaGVscGVyLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7RnVuY3Rpb259IFRoZSBzaG9ydGN1dCBmdW5jdGlvbi5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIEhtYWNTSEEyNTYgPSBDcnlwdG9KUy5saWIuSGFzaGVyLl9jcmVhdGVIbWFjSGVscGVyKENyeXB0b0pTLmFsZ28uU0hBMjU2KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBfY3JlYXRlSG1hY0hlbHBlcjogZnVuY3Rpb24gKGhhc2hlcikge1xuXHQgICAgICAgICAgICByZXR1cm4gZnVuY3Rpb24gKG1lc3NhZ2UsIGtleSkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBDX2FsZ28uSE1BQy5pbml0KGhhc2hlciwga2V5KS5maW5hbGl6ZShtZXNzYWdlKTtcblx0ICAgICAgICAgICAgfTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBBbGdvcml0aG0gbmFtZXNwYWNlLlxuXHQgICAgICovXG5cdCAgICB2YXIgQ19hbGdvID0gQy5hbGdvID0ge307XG5cblx0ICAgIHJldHVybiBDO1xuXHR9KE1hdGgpKTtcblxuXG5cdHJ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IEByZXR1cm4ge3N0cmluZ30gVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBiYXNlNjRTdHJpbmcgPSBDcnlwdG9KUy5lbmMuQmFzZTY0LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLl9tYXA7XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXAgZXhjZXNzIGJpdHNcblx0ICAgICAgICAgICAgd29yZEFycmF5LmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgYmFzZTY0Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAzKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTEgPSAod29yZHNbaSA+Pj4gMl0gICAgICAgPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgICAgICAgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUyID0gKHdvcmRzWyhpICsgMSkgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAxKSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMyA9ICh3b3Jkc1soaSArIDIpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMikgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0cmlwbGV0ID0gKGJ5dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYXAubGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV2ZXJzZU1hcFttYXAuY2hhckNvZGVBdChqKV0gPSBqO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIElnbm9yZSBwYWRkaW5nXG5cdCAgICAgICAgICAgIHZhciBwYWRkaW5nQ2hhciA9IG1hcC5jaGFyQXQoNjQpO1xuXHQgICAgICAgICAgICBpZiAocGFkZGluZ0NoYXIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBwYWRkaW5nSW5kZXggPSBiYXNlNjRTdHIuaW5kZXhPZihwYWRkaW5nQ2hhcik7XG5cdCAgICAgICAgICAgICAg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lcnRzIGEgd29yZCBhcnJheSB0byBhIFVURi0xNiBCRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTE2IEJFIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHV0ZjE2U3RyaW5nID0gQ3J5cHRvSlMuZW5jLlV0ZjE2LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xNiBMRSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgQ19lbmMuVXRmMTZMRSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi0xNiBMRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGYxNlN0ciA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSBzd2FwRW5kaWFuKCh3b3Jkc1tpID4+PiAyXSA+Pj4gKDE2IC0gKGkgJSA0KSAqIDgpKS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aGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxlXG5cdCAgICAgKlxuXHQgICAgICogICAgIHZhciBrZXkgPSBDcnlwdG9KUy5FdnBLREYocGFzc3dvcmQsIH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lzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA9IE1bb2Zmc2V0ICsgMTBdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTEgPSBNW29mZnNldCArIDExXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzEyID0gTVtvZmZzZXQgKyAxMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMyA9IE1bb2Zmc2V0ICsgMTNdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTQgPSBNW29mZnNldCArIDE0XTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzE1ID0gTVtvZmZzZXQgKyAxNV07XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWxiZXNcblx0ICAgICAgICAgICAgdmFyIGEgPSBIWzB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RzVG90YWxMIDw8IDI0KSB8IChuQml0c1RvdGFsTCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgI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AgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IEhNQUNcblx0ICAgICAgICAgICAgdmFyIGhtYWMgPSBITUFDLmNyZWF0ZShjZmcuaGFzaGVyLCBwYXNzd29yZCk7XG5cblx0ICAgICAgICAgICAgLy8gSW5pdGlhbCB2YWx1ZXNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXkgPSBXb3JkQXJyYXkuY3JlYXRlKCk7XG5cdCAgICAgICAgICAgIHZhciBibG9ja0luZGV4ID0gV29yZEFycmF5LmNyZWF0ZShbMHgwMDAwMDAwMV0pO1xuXG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleVdvcmRzID0gZGVyaXZlZEtleS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZVdvcmRzID0gaW50ZXJtZWRpYXRlLndvcmRzO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gWE9SIGludGVybWVkaWF0ZSB3aXRoIGJsb2NrXG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBibG9ja1dvcmRzTGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tXb3Jkc1tqXSBePSBpbnRlcm1lZGlhdGVXb3Jkc1tqXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRL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AgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1szXSA9IFhbNl0gXiAoWFszXSA+Pj4gMTYpIF4gKFhbM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gICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBLW2ldID0gKCgoS1tpXSA8PCA4KSAgfCAoS1tpXSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChLW2ldIDw8IDI0KSB8IChLW2ldID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBHZW5lcmF0ZSBpbml0aWFsIHN0YXRlIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgWCA9IHRoaXMuX1ggPSBbXG5cdCAgICAgICAgICAgICAgICBLWzBdLCAoS1szXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLFxuXHQgICAgICAgICAgICAgICAgS1sxXSwgKEtbMF0gPDwgMTYpIHwgKEtbM10gPj4+IDE2KSxcblx0ICAgICAgICAgICAgICAgIEtbMl0sIChLWzFdIDw8IDE2KSB8IChLWzBdID4+PiAxNiksXG5cdCAgICAgICAgICAgICAgICBLWzNdLCAoS1syXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpXG5cdCAgICAgICAgICAgIF07XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgaW5pdGlhbCBjb3VudGVyIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgQyA9IHRoaXMuX0MgPSBbXG5cdCAgICAgICAgICAgICAgICAoS1syXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLCAoS1swXSAmIDB4ZmZmZjAwMDApIHwgKEtbMV0gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzNdIDw8IDE2KSB8IChLWzNdID4+PiAxNiksIChLWzFdICYgMHhmZmZmMDAwMCkgfCAoS1syXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbMF0gPDwgMTYpIHwgKEtbMF0gPj4+IDE2KSwgKEtbMl0gJiAweGZmZmYwMDAwKSB8IChLWzNdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1szXSA9IFhbNl0gXiAoWFszXSA+Pj4gMTYpIF4gKFhbMV0gPDwgMTYpO1xuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgU1tpXSA9ICgoKFNbaV0gPDwgOCkgIHwgKFNbaV0gPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgICAgKCgoU1tpXSA8PCAyNCkgfCAoU1tpXSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgICAgICBNW29mZnNldCArIGldIF49IFNbaV07XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgYmxvY2tTaXplOiAxMjgvMzIsXG5cblx0ICAgICAgICBpdlNpemU6IDY0LzMyXG5cdCAgICB9KTtcblxuXHQgICAgZnVuY3Rpb24gbmV4dFN0YXRlK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Z28gPSBDLmFsZ287XG5cblx0ICAgIC8qKlxuXHQgICAgICogUkM0IHN0cmVhbSBjaXBoZXIgYWxnb3JpdGhtLlxuXHQgICAgICovXG5cdCAgICB2YXIgUkM0ID0gQ19hbGdvLlJDNCA9IFN0cmVhbUNpcGhlci5leHRlbmQoe1xuXHQgICAgICAgIF9kb1Jlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIga2V5ID0gdGhpcy5fa2V5O1xuXHQgICAgICAgICAgICB2YXIga2V5V29yZHMgPSBrZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaWdCeXRlcyA9IGtleS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBJbml0IHNib3hcblx0ICAgICAgICAgICAgdmFyIFMgPSB0aGlzLl9TID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIFNbaV0gPSBpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gS2V5IHNldHVwXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBqID0gMDsgaSA8IDI1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qnl0ZUluZGV4ID0gaSAlIGtleVNpZ0J5dGVzO1xuXHQgICAgICAgICAgICAgICAgdmFyIGtleUJ5dGUgPSAoa2V5V29yZHNba2V5Qnl0ZUluZGV4ID4+PiAyXSA+Pj4gKDI0IC0gKGtleUJ5dGVJbmRleCAlIDQpICogOCkpICYgMHhmZjtcblxuXHQgICAgICAgICAgICAgICAgaiA9IChqICsgU1tpXSArIGtleUJ5dGUpICUgMjU2O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwXG5cdCAgICAgICAgICAgICAgICB2YXIgdCA9IFNbaV07XG5cdCAgICAgICAgICAgICAgIC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gIHZhciBNX29mZnNldF9pID0gTVtvZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEhbM10gKyBlbCArIGFyKXwwO1xuX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l9wcm9jZXNzKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEhhc2hlci5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS5faGFzaCA9IHRoaXMuX2hhc2guY2xvbmUoKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gY2xvbmU7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblxuXHQgICAgZnVuY3Rpb24gZjEoeCwgeSwgeikge1xuXHQgICAgICAgIHJldHVybiAoKHgpIF4gKHkpIF4gKHopKTtcblxuXHQgICAgfVxuXG5cdCAgICBmdW5jdGlvbiBmMih4LCB5LCB6KSB7XG5cdCAgICA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gICAgdmFyIGIgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlIDMyKTtcblx0ICAgICAgICAgICAgZG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FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIEluaXRpYWxpemF0aW9uIGFuZCByb3VuZCBjb25zdGFudHMgdGFibGVzXG5cdCAgICB2YXIgSCA9IFtdO1xuXHQgICAgdmFyIEsgPSBbXTtcblxuXHQgICAgLy8gQ29tcHV0ZSBjb25zdGFudHNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgZnVuY3Rpb24gaXNQcmltZShuKSB7XG5cdCAgICAgICAgICAgIHZhciBzcXJ0TiA9IE1hdGguc3FydChuKTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgZmFjdG9yID0gMjsgZmFjdG9yIDw9IHNxcnROOyBmYWN0b3IrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKCEobiAlIGZhY3RvcikpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICBmdW5jdGlvbiBnZXRGcmFjdGlvbmFsQml0cyhuKSB7XG5cdCAgICAgICAgICAgIHJldHVybiAoKG4gLSAobiB8IDApKSAqIDB4MTAwMDAwMDAwKSB8IDA7XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgdmFyIG4gPSAyO1xuXHQgICAgICAgIHZhciBuUHJpbWUgPSAwO1xuXHQgICAgICAgIHdoaWxlIChuUHJpbWUgPCA2NCkge1xuXHQgICAgICAgICAgICBpZiAoaXNQcmltZShuKSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKG5QcmltZSA8IDgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBIW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgS1tuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDMpKTtcblxuXHQgICAgICAgICAgICAgICAgblByaW1lKys7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBuKys7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0yNTYgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEyNTYgPSBDX2FsZ28uU0hBMjU2ID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChILnNsaWNlKDApKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIWzBdID0gKEhbMF0gKyBhKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMV0gPSAoSFsxXSArIGIpIHwgMDtcblx0ICAgICAgICAgICAgSFsyXSA9IChIWzJdICsgYykgfCAwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbM10gKyBkKSB8IDA7XG5cdCAgICAgICAgICAgIEhbNF0gPSAoSFs0XSArIGUpIHwgMDtcblx0ICAgICAgICAgICAgSFs1XSA9IChIWzVdICsgZikgfCAwO1xuXHQgICAgICAgICAgICBIWzZdID0gKEhbNl0gKyBnKSB8IDA7XG5cdCAgICAgICA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mRBcnJheTtcblx0ICAgIHZhciBIYXNoZXIgPSBDX2xpYi5IYXNoZXI7XG5cdCAgICB2YXIgQ194NjQgPSBDLng2NDtcblx0ICAgIHZhciBYNjRXb3JkID0gQ194NjQuV29yZDtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIENvbnN0YW50cyB0YWJsZXNcblx0ICAgIHZhciBSSE9fT0ZGU0VUUyA9IFtdO1xuXHQgICAgdmFyIFBJX0lOREVYRVMgID0gW107XG5cdCAgICB2YXIgUk9VTkRfQ09OU1RBTlRTID0gW107XG5cblx0ICAgIC8vIENvbXB1dGUgQ29uc3RhbnRzXG5cdCAgICAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgIC8vIENvbXB1dGUgcmhvIG9mZnNldCBjb25zdGFudHNcblx0ICAgICAgICB2YXIgeCA9IDEsIHkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIHQgPSAwOyB0IDwgMjQ7IHQrKykge1xuXHQgICAgICAgICAgICBSSE9fT0ZGU0VUU1t4ICsgNSAqIHldID0gKCh0ICsgMSkgKiAodCArIDIpIC8gMikgJSA2NDtcblxuXHQgICAgICAgICAgICB2YXIgbmV3WCA9IHkgJSA1O1xuXHQgICAgICAgICAgICB2YXIgbmV3WSA9ICgyICogeCArIDMgKiB5KSAlIDU7XG5cdCAgICAgICAgICAgIHggPSBuZXdYO1xuXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPSAoTEZTUiA8PCAxKSBeIDB4NzE7XG5cdCAgICAgICAgICAgICAgICB9IG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ZW5ndGg6IDUxMlxuXHQgICAgICAgIH0pLFxuXG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGUgPSBbXVxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHN0YXRlW2ldID0gbmV3IFg2NFdvcmQuaW5pdCgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgdGhpcy5ibG9ja1NpemUgPSAoMTYwMCAtIDIgKiB0aGlzLmNmZy5vdXRwdXRMZW5ndGgpIC8gMzI7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGU7XG5cdCAgICAgICAgICAgIHZhciBuQmxvY2tTaXplTGFuZXMgPSB0aGlzLmJsb2NrU2l6ZSAvIDI7XG5cblx0ICAgICAgICAgICAgLy8gQWJzb3JiXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbkJsb2NrU2l6ZUxhbmVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3VuZF07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gcm91bmRDb25zdGFudC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5sb3cgIF49IHJvdW5kQ29uc3RhbnQubG93Oztcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID0gZGF0YS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIG5CaXRzVG90YWwgPSB0aGlzLl9uRGF0Y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0gc3RhdGVbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3F1ZWV6ZSBzdGF0ZSB0byByZXRyaWV2ZSBoYXNoXG5cdCAgICAgICAgICAgICAgICBoYXNoV29yZHMucHVzaChsYW5lTHN3KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hXb3Jkcy5wdXNoKGxhbmVNc3cpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdChoYXNoV29yZHMsIG91dHB1dExlbmd0aEJ5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY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OSwgMHgxMzdlMjE3OSlcblx0ICAgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpLmxvdyAgPSBNW29mZnNldCArIGkgKiAyICsgMV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTBcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweCAgPSBXW2kgLSAxNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHhoID0gZ2FtbWEweC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4bCA9IGdhbW1hMHgubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTBoICA9ICgoZ2FtbWEweGggPj4+IDEpIHwgKGdhbW1hMHhsIDw8IDMxKSkgXiAoKGdhbW1hMHhoID4+PiA4KSB8IChnYW1tYTB4bCA8PCAyNCkpIF4gKGdhbW1hMHhoID4+PiA3KTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEwbCAgPSAoKGdhbW1hMHhsID4+PiAxKSB8IChnYW1tYTB4aCA8PCAzMSkpIF4gKChnYW1tYTB4bCA+Pj4gOCkgfCAoZ2FtbWEweGggPDwgMjQpKSBeICgoZ2FtbWEweGwgPj4+IDcpIHwgKGdhbW1hMHhoIDw8IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTFcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeCAgPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeGggPSBnYW1tYTF4LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXhsID0gZ2FtbWExeC5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMWggID0gKChnYW1tYTF4aCA+Pj4gMTkpIHwgKGdhbW1hMXhsIDw8IDEzKSkgXiAoKGdhbW1hMXhoIDw8IDMpIHwgKGdhbW1hMXhsID4+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+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAg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IDB4MCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MD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MDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDAwMDA6IDB4NDAwODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDA6IDB4ODQwMTAsXG5cdCAgICAgICAgICAgIDB4MTE4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwMDA6IDB4NDAwODAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwMDA6IDB4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDAwMDogMHg0MDAwNDAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgxNzgwMDAwMDogMHg0MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxOTgwMDAwMDogMHg0MDAwMDAxMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxYjgwMDAwMDogMHg4MDAxMCxcblx0ICAgICAgICAgICAgMHgxYzgwMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDA6IDB4NDAwODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWY4MDAwMDA6IDB4ODQwMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgyMDAwMDA6IDB4NDAwMDEwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWQ6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFlOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFmOiAweDgwMjA4MDBcblx0ICAgICAgICB9XG5cdCAgICBdO1xuXG5cdCAgICAvLyBNYXNrcyB0aGF0IHNlbGVjdCB0aGUgU0JPWCBpbnB1dFxuXHQgICAgdmFyIFNCT1hfTUFTSyA9IFtcblx0ICAgICAgICAweGY4MDAwMDAxLCAweDFmODAwMDAwLCAweDAxZjgwMDAwLCAweDAwMWY4MDAwLFxuXHQgICAgICAgIDB4MDAwMWY4MDAsIDB4MDAwMDFmODAsIDB4MDAwMDAxZjgsIDB4ODAwMDAwMWZcblx0ICAgIF07XG5cblx0ICAgIC8qKlxuXHQgICAgICogREVTIGJsb2NrIGNpcGhlciBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBERVMgPSBDX2FsZ28uREVTID0gQmxvY2tDaXBoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGtleSA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFNlbGVjdCA1NiBiaXRzIGFjY29yZGluZyB0byBQQzFcblx0ICAgICAgICAgICAgdmFyIGtleUJpdHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qml0UG9zID0gUEMxW2ldIC0gMTtcblx0ICAgICAgICAgICAgICAgIGtleUJpdHNbaV0gPSAoa2V5V29yZHNba2V5Qml0UG9zID4+PiA1XSA+Pj4gKDMxIC0ga2V5Qml0UG9zICUgMzIpKSAmIDE7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgdGhpcy5fZG9DcnlwdEJsb2NrKE0sIG9mZnNldCwgdGhpcy5fc3ViS2V5cyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGRlY3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICB0aGlzLl9kb0NyeXB0QmxvY2soTSwgb2Zmc2V0LCB0aGlzLl9pbnZTdWJLZXlzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvQ3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCwgc3ViS2V5cykge1xuXHQgICAgICAgICAgICAvLyBHZXQgaW5wdXRcblx0ICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gTVtvZmZzZXRdO1xuXHQgICAgICAgICAgICB0aGlzLl9yQmxvY2sgPSBNW29mZnNldCArIDFdO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXRpYWwgcGVybXV0YXRpb25cblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDQsICAweDBmMGYwZjBmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDE2LCAweDAwMDBmZmZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDIsICAweDMzMzMzMzMzKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDgsICAweDAwZmYwMGZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDEsICAweDU1NTU1NTU1KTtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgcm91bmQgPSAwOyByb3VuZCA8IDE2OyByb3VuZCsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW3JvdW5kXTtcblx0ICAgICAgICAgICAgICAgIHZhciBsQmxvY2sgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgICAgICB2YXIgckJsb2NrID0gdGhpcy5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFVuZG8gc3dhcCBmcm9tIGxhc3Qgcm91bmRcblx0ICAgICAgICAgICAgdmFyIHQgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHRoaXMuX3JCbG9jaztcblx0ICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gdDtcblxuXHQgICAgICAgICAgICAvLyBGaW5hbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgNCwgIDB4MGYwZjBmMGYpO1xuXG5cdCAgICAgICAgICAgIC8vIFNldCBvdXRwdXRcblx0ICAgICAgICAgICAgTVtvZmZzZXRdID0gdGhpcy5fbEJsb2NrO1xuXHQgICAgICAgICAgICBNW29mZnNldCArIDFdID0gdGhpcy5fckJsb2NrO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBrZXlTaXplOiA2NC8zMixcblxuXHQgICAgICAgIGl2U2l6ZTogNjQvMzIsXG5cblx0ICAgICAgICBibG9ja1NpemU6IDY0LzMyXG5cdCAgICB9KTtcblxuXHQgICAgLy8gU3dhcCBiaXRzIGFjcm9zcyB0aGUgbGVmdCBhbmQgcmlnaHQgd29yZHNcblx0ICAgIGZ1bmN0aW9u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CAgICAgICAgLyoqXG5cdCAgICAgICAgICogQml0d2lzZSBYT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gWE9SIHdpdGggdGhpcyB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIFhPUmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHhvcmVkID0geDY0V29yZC54b3IoYW5vdGhlclg2NFdvcmQpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIC8vIHhvcjogZnVuY3Rpb24gKHdvcmQpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB0aGlzLmhpZ2ggXiB3b3JkLmhpZ2g7XG5cdCAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmxvdyBeIHdvcmQubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBTaGlmdHMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgbGVmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBuIFRoZSBudW1iZXIgb2YgYml0cyB0byBzaGlmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1g2NFdvcmR9IEEgbmV3IHg2NC1Xb3JkIG9iamVjdCBhZnRlciBzaGlmdGluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAg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SxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtYNjRXb3JkfSB3b3JkIFRoZSB4NjQtV29yZCB0byBhZGQgd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgYWRkaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYWRkZWQgPSB4NjRXb3JkLmFkZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gYWRkOiBmdW5jdGlv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aW4gdGhlIHdvcmRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY2ggWDY0V29yZCBvYmplY3Rcblx0ICAgICAgICAgICAgdmFyIHdvcmRzTGVuZ3RoID0gd29yZHMubGVuZ3RoO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2ldID0gd29yZHNbaV0uY2xvbmUoKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblx0fSgpKTtcblxuXG5cdHJldHVybiBDcnlwdG9KUztcblxufSkpOyIsIihmdW5jdGlvbiAoc2VsZikge1xuICAndXNlIHN0cmljdCc7XG5cbiAgZnVuY3Rpb24g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fSkoKSxcbiAgICAgICAgICBmb3JtRGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgICAgICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgRGF0YVZpZXcucHJvdG90eXBlLmlzUHJvdG90eXBlT2Yob2JqKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBpc0FycmF5QnVmZmVyVmlldyA9IEFycmF5QnVmZmVyLmlzVmlldyB8fCBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgdmlld0NsYXNzZXMuaW5kZXhPZihPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSkgPiAtMVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIG5vcm1hbGl6ZU5hb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dGVyYXRvcl0gPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGl0ZXJhdG9yXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIGl0ZXJhdG9yXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBIZWFkZXJzKGhlYWRlcnMpIHtcbiAgICAgICAgICB0aGlzLm1hcCA9IHt9XG5cbiAgICAgICAgICBpZiAoaGVhZGVycyBpbnN0YW5jZW9mIEhlYWRlcnMpIHtcbiAgICAgICAgICAgIGhlYWRlcnMuZm9yRWFjaChmdW5jdGlvbih2YWx1ZSwgbmFtZSkge1xuICAgICAgICAgICAgICB0aGlzLmFwcGVuZChuYW1lLCB2YWx1ZSlcbiAgICAgICAgICAgIH0sIHRoaXMpXG4gICAgICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KGhlYWRlcnMpKSB7XG4gICAgICAgICAgICBoZWFkZXJzLmZvckVhY2goZnVuY3Rpb24oaGVhZGVyKSB7XG4gICAgICAgICAgICAgIHRoaXMuYXBwZW5kKGhlYWRlclswXSwgaGVhZGVyWzFdKVxuICAgICAgICAgICAgfSwgdGhpcylcbiAgICAgICAgICB9IGVsc2UgaWYgKGhlYWRlcnMpIHtcbiAgICAgICAgICAgIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKGhlYWRlcnMpLmZvckVhY2goZnVuY3Rpb24obmFtZSkge1xuICAgICAgICAgICAgICB0aGlzLmFwcGVuZChuYW1lLCBoZWFkZXJzW25hbWVdKVxuICAgICAgICAgICAgfSwgdGhpcylcbiAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICBIZWFkZXJzLnByb3RvdHlwZS5hcHBlbmQgPSBmdW5jdGlvbihuYW1lLCB2YWx1ZSkge1xuICAgICAgICAgIG5hbWUgPSBub3JtYWxpemVOYW1lKG5hbWUpXG4gICAgICAgICAgdmFsdWUgPSBub3JtYWxpemVWY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gaWYgKGJvZHkuYm9keVVzZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgICAgICAgcmV0dXJuIHZpZXcuYnVmZmVyXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gQm9keSgpIHtcbiAgICAgICAgICB0aGlzLmJvZHlVc2VkID0gZmFsc2VcblxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5ID0gZnVuY3Rpb24oYm9keSkge1xuICAgICAgICAgICAgdGhpcy5fYm9keUluaXQgPSBib2R5XG4gICAgICAgICAgICBpZiAoIWJvZHkpIHtcbiAgICAgICAgICAgICAgdGhpcy5fYm9keVRleHQgPSAnJ1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgYm9keSA9PT0gJ3N0cm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gICAgICAgICAgICB0aGlzLl9ib2R5QXJyYXlCdWZmZXIgPSBidWZmZXJDbG9uZShib2R5KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bnN1cHBvcnRlZCBCb2R5SW5pdCB0eXBlJylcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLmhlYWRlcnMuZ2V0KCdjb250ZW50LXR5cGUnKSkge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIGJvZHkgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ3RleHQvcGxhaW47Y2hhcnNldD1VVEYtOCcpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUJsb2IgJiYgdGhpcy5fYm9keUJsb2IudHlwZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoJ2NvbnRlbnQtdHlwZScsIHRoaXMuX2JvZHlCbG9iLnR5cGUpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3VwcG9ydC5zZWFyY2hQYXJhbXMgJiYgVVJMU2VhcmNoUGFyYW1zLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpc1xuICAgICAgICB9XG5cbi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W9uKCkge1xuICAgICAgICAgIHJldHVybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGhlYWRlcnNcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICAgICAgICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgICAgICAgIGlmICghb3B0aW9ucykge1xuICAgICAgICAgICAgb3B0aW9ucyA9IHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgICAgICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICAgICAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgICAgICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKVxuICAgICAgICAgIHRoaXMudXJsID0gb3B0aW9ucy51cmwgfHwgJydcbiAgICAgICAgICB0aGlzLl9pbml0Qm9keShib2R5SW5pdClcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXNwb25zZS5wcm90b3R5cGUpXG5cbiAgICAgICAgUmVzcG9uc2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBSZXNwb25zZSh0aGlzLl9ib2R5SW5pdCwge1xuICAgICAgICAgICAgc3RhdHVzOiB0aGlzLnN0YXR1cyxcbiAgICAgICAgICAgIHN0YXR1c1RleHQ6IHRoa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mVqZWN0KSB7XG4gICAgICAgICAgICB2YXIgcmVxdWVzdCA9IG5ldyBSZXF1ZXN0KGlucHV0LCBpbml0KVxuICAgICAgICAgICAgdmFyIHhociA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpXG5cbiAgICAgICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzOiB4aHIuc3RhdHVzLFxuICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHhoci5zdGF0dXNUZXh0LFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHBhcnNlSGVhZGVycyh4aHIuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkgfHwgJycpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgb3B0aW9ucy51cmwgPSAncmVzcG9uc2VVUkwnIGluIHhociA/IHhoci5yZXNwb25zZVVSTCA6IG9wdGlvbnMuaGVhZGVycy5nZXQoJ1gtUmVxdWVzdC1VUkwnKVxuICAgICAgICAgICAgICB2YXIgYm9keSA9ICdyZXNwb25zZScgaW4geGhyID8geGhyLnJlc3BvbnNlIDogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgIC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W5kZXhPZignPScpIDogYnJhY2tldEVxdWFsc1BvcyArIDE7XG5cbiAgICAgICAgdmFyIGtleSwgdmFsO1xuICAgICAgICBpZiAocG9zID09PSAtMSkge1xuICAgICAgICAgICAga2V5ID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQsIGRlZmF1bHRzLmRlY29kZXIpO1xuICAgICAgICAgICAgdmFsID0gb3B0aW9ucy5zdHJpY3ROdWxsSGFuZGxpbmcgPyBudWxsIDogJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydC5zbGljZSgwLCBwb3MpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgICAgIHZhbCA9IG9wdGlvbnMuZGVjb2RlcihwYXJ0LnNsaWNlKHBvcyArIDEpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaGFzLmNhbGwob2JqLCBrZXkpKSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IFtdLmNvbmNhdChvYmpba2V5XSkuY29uY2F0KHZhbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IHZhbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JqW2NsZWFuUm9vdF0gPSBsZWFmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGVhZiA9IG9iajtcbiAgICB9XG5cbiAgICByZXR1cm4gbGVhZjtcbn07XG5cbnZhciBwYXJzZUtleXMgPSBmdW5jdGlvbiBwYXJzZVF1ZXJ5U3RyaW5nS2V5cyhnaXZlbktleSwgdmFsLCBvcHRpb25zKSB7XG4gICAgaWYgKCFnaXZlbktleSkge1xuICAgICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgLy8gVHJhbnNmb3JtIGRvdCBub3RhdGlvbiB0byBicmFja2V0I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ldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG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gICBpZiAoIW9iaktleXMpIHtcbiAgICAgICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgfVxuXG4gICAgaWYgKHNvcnQpIHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9ialtqXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGFjdGVkLnB1c2gob2JqW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGl0ZW0ub2JqW2l0ZW0ucHJvcF0gPSBjb21wYWN0ZWQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gb2JqO1xufTtcblxuZXhwb3J0cy5hcnJheVRvT2JqZWN0ID0gZnVuY3Rpb24gYXJyYXlUb09iamVjdChzb3VyY2UsIG9wdGlvbnMpIHtcbiAgICB2YXIgb2JqID0gb3B0aW9ucyAmJiBvcHRpb25zLnBsY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QgPSAnJztcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgYyA9IHN0cmluZy5jaGFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjY3h0LmJyb3dzZXIuanMiLCJjY3h0LmpzIiwianMvXzFicm9rZXIuanMiLCJqcy9fMWJ0Y3hlLmpzIiwianMvYWN4LmpzIiwianMvYWxsY29pbi5qcyIsImpzL2FueHByby5qcyIsImpzL2Jhc2UvRXhjaGFuZ2UuanMiLCJqcy9iYXNlL01hcmtldC5qcyIsImpzL2Jhc2UvZXJyb3JzLmpzIiwianMvYmFzZS9mdW5jdGlvbnMuanMiLCJqcy9iYXNlL3Rocm90dGxlLmpzIiwianMvYmluYW5jZS5qcyIsImpzL2JpdDJjLmpzIiwianMvYml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3aGVuIGJ1aWxkaW5nXG5cbmNvbnN0IHZlcnNpb24gPSAnMS4xMC41MjknXG5cbkV4Y2hhbmdlLmNjeHRWZXJzaW9uID0gdmVyc2lvblxuXG4vLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGV4Y2hhbmdlcyA9IHtcbiAgICAnXzFicm9rZXInOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9fMWJyb2tlci5qcycpLFxuICAgICdfMWJ0Y3hlJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL18xYnRjeGUuanMnKSxcbiAgICAnYWN4JzogICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9hY3guanMnKSxcbiAgICAnYWxsY29pbic6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9hbGxjb2luLmpzJyksXG4gICAgJ2FueHBybyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYW54cHJvLmpzJyksXG4gICAgJ2JpbmFuY2UnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYmluYW5jZS5qcycpLFxuICAgICdiaXQyYyc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdDJjLmpzJyksXG4gICAgJ2JpdGJheSc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0YmF5LmpzJyksXG4gICAgJ2JpdGNvaW5jb2lkJzogICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0Y29pbmNvaWQuanMnKSxcbiAgICAnYml0ZmluZXgnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRmaW5leC5qcycpLFxuICAgICdiaXRmaW5leDInOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZpbmV4Mi5qcycpLFxuICAgICdiaXRmbHllcic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGZseWVyLmpzJyksXG4gICAgJ2JpdGh1bWInOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0aHVtYi5qcycpLFxuICAgICdiaXRsaXNoJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdGxpc2guanMnKSxcbiAgICAnYml0bWFya2V0JzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtYXJrZXQuanMnKSxcbiAgICAnYml0bWV4JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRtZXguanMnKSxcbiAgICAnYml0c28nOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9iaXRzby5qcycpLFxuICAgICdiaXRzdGFtcCc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JpdHN0YW1wLmpzJyksXG4gICAgJ2JpdHN0YW1wMSc6ICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0c3RhbXAxLmpzJyksXG4gICAgJ2JpdHRyZXgnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYml0dHJleC5qcycpLFxuICAgICdibDNwJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2JsM3AuanMnKSxcbiAgICAnYmxldXRyYWRlJzogICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ibGV1dHJhZGUuanMnKSxcbiAgICAnYnRjYm94JzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNib3guanMnKSxcbiAgICAnYnRjY2hpbmEnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGNjaGluYS5qcycpLFxuICAgICdidGNleGNoYW5nZSc6ICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y2V4Y2hhbmdlLmpzJyksXG4gICAgJ2J0Y21hcmtldHMnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjbWFya2V0cy5qcycpLFxuICAgICdidGN0cmFkZXVhJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0Y3RyYWRldWEuanMnKSxcbiAgICAnYnRjdHVyayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9idGN0dXJrLmpzJyksXG4gICAgJ2J0Y3gnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvYnRjeC5qcycpLFxuICAgICdidGVyJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2J0ZXIuanMnKSxcbiAgICAnYnhpbnRoJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9ieGludGguanMnKSxcbiAgICAnY2NleCc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jY2V4LmpzJyksXG4gICAgJ2NleCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2V4LmpzJyksXG4gICAgJ2NoYnRjJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvY2hidGMuanMnKSxcbiAgICAnY2hpbGViaXQnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jaGlsZWJpdC5qcycpLFxuICAgICdjb2luY2hlY2snOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5jaGVjay5qcycpLFxuICAgICdjb2luZmxvb3InOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5mbG9vci5qcycpLFxuICAgICdjb2luZ2knOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5naS5qcycpLFxuICAgICdjb2lubWFya2V0Y2FwJzogICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5tYXJrZXRjYXAuanMnKSxcbiAgICAnY29pbm1hdGUnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2lubWF0ZS5qcycpLFxuICAgICdjb2luc2VjdXJlJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NvaW5zZWN1cmUuanMnKSxcbiAgICAnY29pbnNwb3QnOiAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9jb2luc3BvdC5qcycpLFxuICAgICdjcnlwdG9waWEnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2NyeXB0b3BpYS5qcycpLFxuICAgICdkc3gnOiAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2RzeC5qcycpLFxuICAgICdleG1vJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2V4bW8uanMnKSxcbiAgICAnZmxvd2J0Yyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9mbG93YnRjLmpzJyksXG4gICAgJ2ZveGJpdCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZm94Yml0LmpzJyksXG4gICAgJ2Z5YnNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZnlic2UuanMnKSxcbiAgICAnZnlic2cnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9meWJzZy5qcycpLFxuICAgICdnYXRlY29pbic6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dhdGVjb2luLmpzJyksXG4gICAgJ2dhdGVpbyc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2F0ZWlvLmpzJyksXG4gICAgJ2dkYXgnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvZ2RheC5qcycpLFxuICAgICdnZW1pbmknOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dlbWluaS5qcycpLFxuICAgICdnZXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2dldGJ0Yy5qcycpLFxuICAgICdoaXRidGMnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0Yy5qcycpLFxuICAgICdoaXRidGMyJzogICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2hpdGJ0YzIuanMnKSxcbiAgICAnaHVvYmknOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9odW9iaS5qcycpLFxuICAgICdodW9iaWNueSc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2h1b2JpY255LmpzJyksXG4gICAgJ2h1b2JpcHJvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvaHVvYmlwcm8uanMnKSxcbiAgICAnaW5kZXBlbmRlbnRyZXNlcnZlJzogICAgICByZXF1aXJlICgnLi9qcy9pbmRlcGVuZGVudHJlc2VydmUuanMnKSxcbiAgICAnaXRiaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9pdGJpdC5qcycpLFxuICAgICdqdWJpJzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2p1YmkuanMnKSxcbiAgICAna3Jha2VuJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rcmFrZW4uanMnKSxcbiAgICAna3Vjb2luJzogICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdWNvaW4uanMnKSxcbiAgICAna3VuYSc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9rdW5hLmpzJyksXG4gICAgJ2xha2VidGMnOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGFrZWJ0Yy5qcycpLFxuICAgICdsaXF1aSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL2xpcXVpLmpzJyksXG4gICAgJ2xpdmVjb2luJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbGl2ZWNvaW4uanMnKSxcbiAgICAnbHVubyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9sdW5vLmpzJyksXG4gICAgJ21lcmNhZG8nOiAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbWVyY2Fkby5qcycpLFxuICAgICdtaXhjb2lucyc6ICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL21peGNvaW5zLmpzJyksXG4gICAgJ25vdmEnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvbm92YS5qcycpLFxuICAgICdva2NvaW5jbnknOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rY29pbmNueS5qcycpLFxuICAgICdva2NvaW51c2QnOiAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rY29pbnVzZC5qcycpLFxuICAgICdva2V4JzogICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL29rZXguanMnKSxcbiAgICAncGF5bWl1bSc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9wYXltaXVtLmpzJyksXG4gICAgJ3BvbG9uaWV4JzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcG9sb25pZXguanMnKSxcbiAgICAncXJ5cHRvcyc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy9xcnlwdG9zLmpzJyksXG4gICAgJ3F1YWRyaWdhY3gnOiAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvcXVhZHJpZ2FjeC5qcycpLFxuICAgICdxdW9pbmUnOiAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3F1b2luZS5qcycpLFxuICAgICdzb3V0aHhjaGFuZ2UnOiAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3NvdXRoeGNoYW5nZS5qcycpLFxuICAgICdzdXJiaXRjb2luJzogICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3N1cmJpdGNvaW4uanMnKSxcbiAgICAndGhlcm9jayc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy90aGVyb2NrLmpzJyksXG4gICAgJ3RpZGV4JzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdGlkZXguanMnKSxcbiAgICAndXJkdWJpdCc6ICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy91cmR1Yml0LmpzJyksXG4gICAgJ3ZhdWx0b3JvJzogICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmF1bHRvcm8uanMnKSxcbiAgICAndmJ0Yyc6ICAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy92YnRjLmpzJyksXG4gICAgJ3ZpcndveCc6ICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvdmlyd294LmpzJyksXG4gICAgJ3dleCc6ICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvd2V4LmpzJyksXG4gICAgJ3hidGNlJzogICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMveGJ0Y2UuanMnKSxcbiAgICAneW9iaXQnOiAgICAgICAgICAgICAgICAgICByZXF1aXJlICgnLi9qcy95b2JpdC5qcycpLFxuICAgICd5dW5iaSc6ICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3l1bmJpLmpzJyksXG4gICAgJ3phaWYnOiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSAoJy4vanMvemFpZi5qcycpLFxuICAgICd6Yic6ICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUgKCcuL2pzL3piLmpzJyksICAgIFxufVxuXG4vLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gT2JqZWN0LmFzc2lnbiAoeyB2ZXJzaW9uLCBFeGNoYW5nZSwgZXhjaGFuZ2VzOiBPYmplY3Qua2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hc0ZldGNoVHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnNjAnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnOTAwJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnMzYwMCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJzg2NDAwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MDIxLTQyMGJkOWZjLTVlY2ItMTFlNy04ZWQ2LTU2ZDAwODFlZmVkMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly8xYnJva2VyLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly8xYnJva2VyLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFicm9rZXIuY29tLz9jPWVuL2NvbnRlbnQvYXBpLWRvY3VtZW50YXRpb24nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9iYXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvY2F0ZWdvcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvcXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY3JlYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2VfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9zaGFyZWQvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzb2NpYWwvcHJvZmlsZV9zdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzb2NpYWwvcHJvZmlsZV90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vdmVydmlldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9xdW90YV9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvdHJhbnNhY3Rpb25fbG9nJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcb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E1hcmtldExpc3QgKHtcbiAgICAgICAgICAgICAgICAnY2F0ZWdvcnknOiBjYXRlZ29yeS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXNwb25zZSddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3BvbnNlJ11bcF07XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAoKGNhdGVnb3J5ID09ICdGT1JFWCcpIHx8IChjYXRlZ29yeSA9PSAnQ1JZUFRPJykpIHtcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJ0cyA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9IHBhcnRzWzBdO1xuICAgICAgICAgICAgICAgICAgICBxdW90ZSA9IHBhcnRzWzFdO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICAgICAgcXVvdGUgPSAnVVNEJztcbiAgICAgICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpc18uY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXNfLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyT3ZlcnZpZXcgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGJhbGFuY2VbJ3Jlc3BvbnNlJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKHJlc3BvbnNlWydiYWxhbmNlJ10pO1xuICAgICAgICByZXN1bHRbJ0JUQ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b2tbJ2JpZHMnXVswXVswXSxcbiAgICAgICAgICAgICdhc2snOiBvcmRlcmJvb2tbJ2Fza3MnXVswXVswXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ28nXSksXG4gICAgICAgICAgICAnY2xvc2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2MnXSksXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID0gdW5kZWZpbmVkLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIHRoaXMucGFyc2U4NjAxIChvaGxjdlsnZGF0ZSddKSxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WydvJ10pLFxuICAgICAgICAgICAgcGFyc2VGbG9hdCAob2hsY3ZbJ2gnXSksXG4gICAgICAgICAgICBwYXJzZUZsb2F0IChvaGxjdlsnbCddKSxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WydjJ10pLFxuICAgICAgICAgICAgdW5kZWZpbmVkLFxuICAgICAgICBdO1xuICA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NvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYwNDktMmIyOTQ0MDgtNWVjYy0xMWU3LTg1Y2MtYWRhZmYwMTNkYzFhLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vMWJ0Y3hlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovLzFidGN4ZS5jb20vYXBpLWRvY3MucGhwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcmljYWwtcHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci1ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzLWFuZC1pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci10cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J0Yy1kZXBvc2l0LWFkZHJlc3MvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidGMtZGVwb3NpdC1hZGRyZXNzL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvZ2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9nZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9lZGl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0NOWSc6IHsgJ2lkJzogJ0NOWScsICdzeW1ib2wnOiAnQlRDL0NOWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdDTlknIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9SVUInOiB7ICdpZCc6ICdSVUInLCAnc3ltYm9sJzogJ0JUQy9SVUInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUlVCJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvQ0hGJzogeyAnaWQnOiAnQ0hGJywgJ3N5bWJvbCc6ICdCVEMvQ0hGJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NIRicgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0pQWSc6IHsgJ2lkJzogJ0pQWScsICdze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GljR2V0SGlzdG9yaWNhbFByaWNlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lZnJhbWUnOiB0aGlzLnRpbWVmcmFtZXNbdGltZWZyYW1lXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvaGxjdnMgPSB0aGlzLm9taXQgKHJlc3BvbnNlWydoaXN0b3JpY2FsLXByaWNlcyddLCAncmVxdWVzdF9jdXJyZW5jeScpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9ITENWcyAob2hsY3ZzLCBtYXJrZXQsIHRpbWVmcmFtZSwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ3RpbWVzdGFtcCddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ21ha2VyX3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIGFjeCBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdhY3gnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQUNYJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQVUnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MicsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzJoJzogJzEyMCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICc3MjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnNDMyMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwMjQ3NjE0LTFmZTYxYzc0LTk2MjEtMTFlNy05ZThjLWYxYTYyN2FmYTI3OS5qcGcnLFxuICAgICAgICAgICAgICAgICdleHRlbnNpb24nOiAnLmpzb24nLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hY3guaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYWN4LmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYWN4LmlvL2RvY3VtZW50cy9hcGlfdjInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJywgLy8gR2V0IGFsbCBhdmFpbGFibGUgbWFya2V0c1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLCAvLyBHZXQgdGlja2VyIG9mIGFsbCBtYXJrZXRzXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97bWFya2V0fScsIC8vIEdldCB0aWNrZXIgb2Ygc3BlY2lmaWMgbWFya2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJywgLy8gR2V0IHJlY2VudCB0cmFkZXMgb24gbWFya2V0LCBlYWNoIHRyYWRlIGlzIGluY2x1ZGVkIG9ubHkgb25jZSBUcmFkZXMgYXJlIHNvcnRlZCBpbiByZXZlcnNlIGNyZWF0aW9uIG9yZGVyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLCAvLyBHZXQgdGhlIG9yZGVyIGJvb2sgb2Ygc3BlY2lmaWVkIG1hcmtldFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJywgLy8gR2V0IGRlcHRoIG9yIHNwZWNpZmllZCBtYXJrZXQgQm90aCBhc2tzIGFuZCBiaWRzIGFyZSBzb3J0ZWQgZnJvbSBoaWdoZXN0IHByaWNlIHRvIGxvd2VzdC5cbiAgICAgICAgICAgICAgICAgICAgICAgICdrJywgLy8gR2V0IE9ITEMoayBsaW5lKSBvZiBzcGVjaWZpYyBtYXJrZXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdrX3dpdGhfcGVuZGluZ190cmFkZXMnLCAvLyBHZXQgSyBkYXRhIHdpdGggcGVuZGluZyB0cmFkZXMsIHdoaWNoIGFyZSB0aGUgdHJhZGVzIG5vdCBpbmNsdWRlZCBpbiBLIGRhdGEgeWV0LCBiZWNhdXNlIHRoZXJlJ3MgZGVsYXkgYmV0d2VlbiB0cmFkZSBnZW5lcmF0ZWQgYW5kIHByb2Nlc3NlZCBieSBLIGRhdGEgZ2VuZXJhdG9yXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZXN0YW1wJywgLy8gR2V0IHNlcnZlciBjdXJyZW50IHRpbWUsIGluIHNlY29uZHMgc2luY2UgVW5peCBlcG9jaFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVtYmVycy9tZScsIC8vIEdldCB5b3VyIHByb2ZpbGUgYW5kIGFjY291bnRzIGluZm9cbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0cycsIC8vIEdldCB5b3VyIGRlcG9zaXRzIGhpc3RvcnlcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JywgLy8gR2V0IGRldGFpbHMgb2Ygc3BlY2lmaWMgZGVwb3NpdFxuICAgICAgICAgICAgICAgICA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NcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWxldGUnLCAvLyBDYW5jZWwgYW4gb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsIC8vIENyZWF0ZSBhIHdpdGhkcmF3XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiAwLjAsIC8vIFRoZXJlIGlzIG9ubHkgMSUgZmVlIG9uIHdpdGhkcmF3YWxzIHRvIHlvdXIgYmFuayBhY2NvdW50LlxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE1lbWJlcnNNZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2FjY291bnRzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cn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m1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpZF07XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzTWFya2V0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyY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QnO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09ICd3YWl0Jykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXRlID09ICdjYW5jZWwnKSB7XG4gICAgICAgICAgICBzdGF0dXMgPSAnY2FuY2VsZWQnO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnaWQnXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZF90eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0IChvcmRlclsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAob3JkZXJbJ3ZvbHVtZSddKSxcbiAgICAgICAgICAgICdmaWxsZWQnOiBwYXJzZUZsb2F0IChvcmRlclsnZXhlY3V0ZWRfdm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHBhcnNlRmxvYXQgKG9yZGVyWydyZW1haW5pbmdfdm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZm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YmplY3Qua2V5cyAob3JkZXIpO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwga2V5cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0ga2V5c1trXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID0gb3JkZXJba2V5XTtcbiAgICAgICAgICAgICAgICAgICAgcXVlcnkgKz0gJyZvcmRlcnMlNUIlNUQlNUInICsga2V5ICsgJyU1RD0nICsgdmFsdWUudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHF1ZXJ5O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnVybGVuY29kZSAodGhpcy5rZXlzb3J0IChwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy9hcGknICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBpZiAoJ2V4dGVuc2lvbicgaW4gdGhpcy51cmxzKVxuICAgICAgICAgICAgcmVxdWVzdCArPSB0aGlzLnVybHNbJ2V4dGVuc2lvbiddO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgcmVxdWVzdDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmVuY29kZVBhcmFtcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnYWNjZXNzX2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0b25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArICd8JyArIHJlcXVlc3QgKyAnfCcgKyBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBsZXQgc3VmZml4ID0gcXVlcnkgKyAnJnNpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBzdWZmaXg7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSBzdWZmaXg7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ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uICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDQScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2V4dGVuc2lvbic6ICcnLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMTU2MTgwOS1jMzE2YjM3Yy1iMDYxLTExZTctOGQ1YS1iNTQ3YjRkNzMwZWIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnd2ViJzogJ2h0dHBzOi8vd3d3LmFsbGNvaW4uY29tJyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL2FwaS5hbGxjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5hbGxjb2luLmNvbS9BYm91dC9BUElSZWZlcmVuY2UnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdIb21lL01hcmtldE92ZXJWaWV3RGV0YWlsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhdGNoX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHVuZGVmaW5lZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldEhvbWVNYXJrZXRPdmVyVmlld0RldGFpbCAoKTtcbiAgICAgICAgbGV0IGNvaW5zID0gcmVzcG9uc2VbJ21hcmtldENvaW5zJ107XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY29pbnMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXRzID0gY29pbnNbal1bJ01hcmtldHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgbWFya2V0cy5sZW5ndGg7IGsrKykge1xuICAgICAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tdWydNYXJrZXQnXTtcbiAgICAgICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnUHJpbWFyeSddO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnU2Vjb25kYXJ5J107XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKSArICdfJyArIHF1b3RlLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICAgICAnc3BvdCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdmdXR1cmUnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAtMSlcbiAgICAgICAgICAgIHJldHVybiAnY2FuY2VsZWQnO1xuICAg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S0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgYW54cHJvIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2FueHBybycsXG4gICAgICAgICAgICAnbmFtZSc6ICdBTlhQcm8nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0pQJywgJ1NHJywgJ0hLJywgJ05aJyBdLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAnMicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUcmFkZXMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY1OTgzLWZkODU5NWRhLTVlYzktMTFlNy04MmUzLWFkYjNhYjhjMjYxMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hbnhwcm8uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2FueHByby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vZG9jcy5hbnh2Mi5hcGlhcnkuaW8nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hbnhwcm8uY29tL3BhZ2VzL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L2RlcHRoL2Z1bGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS90cmFkZS9mZXRjaCcsIC8vIGRpc2FibGVkIGJ5IEFOWFByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9hZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeV9wYWlyfS9tb25leS9vcmRlci9xdW90ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5X3BhaXJ9L21vbmV5L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbW9uZXkve2N1cnJlbmN5fS9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS97Y3VycmVuY3l9L3NlbmRfc2ltcGxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS90cmFkZS9saXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb25leS93YWx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YXNlJzogJ0RPR0UnLCAncXVvdGUnOiAnQlRDJywgJ211bHRpcGxpZXInOiAxMDAwMDAwMDAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4zIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjYgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdE1vbmV5SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlWydXYWxsZXRzJ10pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnV2FsbGV0cyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IHdhbGxldCA9IGJhbGFuY2VbJ1dhbGxldHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAod2FsbGV0WydBdmFpbGFibGVfQmFsYW5jZSddWyd2YWx1ZSddKTtcbiAgICA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2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gcmVxdWVzdCArIFwiXFwwXCIgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnUmVzdC1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnUmVzdC1TaWduJzogdGhpcy5kZWNvZGUgKHNpZ25hdHVyZSksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsncmVzdWx0J10gPT0gJ3N1Y2Nlc3MnKVxuICAgICAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNl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GZhbHNlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hPcmRlckJvb2sgICAgPSB0cnVlXG4gICAgICAgIHRoaXMuaGFzRmV0Y2hPcmRlcnMgICAgICAgPSBmYWxzZVxuICAgICAgICB0aGlzLmhhc0ZldGNoVGlja2VyICAgICAgID0gdHJ1ZVxuICAgICAgICB0aGlzLmhhc0ZldGNoVGlja2VycyAgICAgID0gZmFsc2VcbiAgICAgICAgdGhpcy5oYXNGZXRjaFRyYWRlcyAgICAgICA9IHRydWVcbiAgICAgICAgdGhpcy5oYXNXaXRoZHJhdyAgICAgICAgICA9IGZhbHNlXG4gICAgICAgIHRoaXMuaGFzQ3JlYXRlT3JkZXIgICAgICAgPSB0aGlzLmhhc1ByaXZhdGVBUElcbiAgICAgICAgdGhpcy5oYXNDYW5jZWxPcmRlciAgICAgICA9IHRoaXMuaGFzUHJpdmF0ZUFQSVxuXG4gICAgICAgIHRoaXMuYXBpS2V5ICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5zZWNyZXQgICA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLnVpZCAgICAgID0gdW5kZWZpbmVkXG4gICAgICAgIHRoaXMubG9naW4gICAgPSB1bmRlZmluZWRcbiAgICAgICAgdGhpcy5wYXNzd29yZCA9IHVuZGVmaW5lZFxuXG4gICAgICAgIHRoaXMucmVxdWlyZWRDcmVkZW50aWFscyA9IHtcbiAgICAgICAgICAgICdhcGlLZXknOiAgIHRydWUsXG4gICAgICAgICAgICAnc2VjcmV0JzogICB0cnVlLFxuICAgICAgICAgICAgJ3VpZCc6ICAgICAgZmFsc2UsXG4gICAgICAgICAgICAnbG9naW4nOiAgICBmYWxzZSxcbiAgICAgICAgICAgICdwYXNzd29yZCc6IGZhbHNlLFxuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy5iYWxhbmNlICAgID0ge31cbiAgICAgICAgdGhpcy5vcmRlcmJvb2tzID0ge31cbiAgICAgICAgdGhpcy50aWNrZXJzICAgID0ge31cbiAgICAgICAgdGhpcy5mZWVzICAgICAgID0ge31cbiAgICAgICAgdGhpcy5vcmRlcnMgICAgID0ge31cbiAgICAgICAgdGhpcy50cmFkZXMgICAgID0ge31cbiAgICAgICAgdGhpcy5jdXJyZW5jaWVzID0ge31cblxuICAgICAgICB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSA9IHVuZGVmaW5lZFxuICAgICAgICB0aGlzLmxhc3RfanNvbl9yZXNwb25zZSA9IHVuZGVmaW5lZFxuXG4gICAgICAgIHRoaXMuYXJyYXlDb25jYXQgPSAoYSwgYikgPT4gYS5jb25jYXQgKGIpXG5cbiAgICAgICAgLy8gVE9ETzogZ2VuZXJhdGVcbiAgICAgICAgdGhpcy5tYXJrZXRfaWQgICAgICAgICAgICAgICAgICAgPSB0aGlzLm1hcmtldElkXG4gICAgICAgIHRoaXMubWFya2V0X2lkcyAgICAgICAgICAgICAgICAgID0gdGhpcy5tYXJrZXRJZHNcbiAgICAgICAgdGhpcy5hcnJheV9jb25jYXQgICAgICAgICAgICAgICAgPSB0aGlzLmFycmF5Q29uY2F0XG4gICAgICAgIHRoaXMuaW1wbG9kZV9wYXJhbXMgICAgICAgICAgICAgID0gdGhpcy5pbXBsb2RlUGFyYW1zXG4gICAgICAgIHRoaXMuZXh0cmFjdF9wYXJhbXMgICAgICAgICAgICAgID0gdGhpcy5leHRyYWN0UGFyYW1zXG4gICAgICAgIHRoaXMuZmV0Y2hfYmFsYW5jZSAgICAgICAgICAgICAgID0gdGhpcy5mZXRjaEJhbGFuY2VcbiAgICAgICAgdGhpcy5mZXRjaF9mcmVlX2JhbGFuY2UgICAgICAgICAgPSB0aGlzLmZldGNoRnJlZUJhbGFuY2VcbiAgICAgICAgdGhpcy5mZXRjaF91c2VkX2JhbGFuY2UgICAgICAgICAgPSB0aGlzLmZldGNoVXNlZEJhbGFuY2VcbiAgICAgICAgdGhpcy5mZXRjaF90b3RhbF9iYWxhbmNlICAgICAgICAgPSB0aGlzLmZldGNo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GFyc2VfYmFsYW5jZSAgICAgICAgICAgICAgID0gdGhpcy5wYXJzZUJhbGFuY2VcbiAgICAgICAgdGhpcy5wYXJzZV9iaWRfYXNrICAgICAgICAgICAgICAgPSB0aGlzLnBhcnNlQmlkQXNrXG4gICAgICAgIHRoaXMucGFyc2VfYmlkc19hc2tzICAgICAgICAgICAgID0gdGhpcy5wYXJzZUJpZHNBc2tzXG4gICAgICAgIHRoaXMucGFyc2Vfb3JkZXJfYm9vayAgICAgICAgICAgID0gdGhpcy5wYXJzZU9yZGVyQm9va1xuICAgICAgICB0aGlzLnBhcnNlX3RyYWRlcyAgICAgICAgICAgICAgICA9IHRoaXMucGFyc2VUcmFkZXNcbiAgICAgICAgdGhpcy5wYXJzZV9vcmRlcnMgICAgICAgICAgICAgICAgPSB0aGlzLnBhcnNlT3JkZXJzXG4gICAgICAgIHRoaXMucGFyc2Vfb2hsY3YgICAgICAgICAgICAgICAgID0gdGhpcy5wYXJzZU9ITENWXG4gICAgICAgIHRoaXMucGFyc2Vfb2hsY3ZzICAgICAgICAgICAgICAgID0gdGhpcy5wYXJzZU9ITENWc1xuICAgICAgICB0aGlzLmVkaXRfbGltaXRfYnV5X29yZGVyICAgICAgICA9IHRoaXMuZWRpdExpbWl0QnV5T3JkZXJcbiAgICAgICAgdGhpcy5lZGl0X2xpbWl0X3NlbGxfb3JkZXIgICAgICAgPSB0aGlzLmVkaXRMaW1pdFNlbGxPcmRlclxuICAgICAgICB0aGlzLmVkaXRfbGltaXRfb3JkZXIgICAgICAgICAgICA9IHRoaXMuZWRpdExpbWl0T3JkZXJcbiAgICAgICAgdGhpcy5lZGl0X29yZGVyICAgICAgICAgICAgICAgICAgPSB0aGlzLmVkaXRPcmRlclxuICAgICAgICB0aGlzLmNyZWF0ZV9saW1pdF9idXlfb3JkZXIgICAgICA9IHRoaXMuY3JlYXRlTGltaXRCdXlPcmRlclxuICAgICAgICB0aGlzLmNyZWF0ZV9saW1pdF9zZWxsX29yZGVyICAgICA9IH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XRjaCAoZSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNOb2RlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZU5vdEF2YWlsYWJsZSAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgZS50eXBlLCBlLm1lc3NhZ2UgXS5qb2luICgnICcpKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgZSAvLyByZXRocm93IGFsbCB1bmtub3duIGVycm9yc1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAudGhlbiAocmVzcG9uc2UgPT4gdGhpcy5oYW5kbGVSZXN0RXJyb3JzIChyZXNwb25zZSwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpKVxuICAgICAgICAgICAgICAgICAgICAudGhlbiAocmVzcG9uc2UgPT4gdGhpcy5oYW5kbGVSZXN0UmVzcG9uc2UgKHJlc3BvbnNlLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkpXG5cbiAgICAgICAgICAgIHJldHVybiB0aW1lb3V0ICh0aGlzLnRpbWVvdXQsIHByb21pc2UpLmNhdGNoIChlID0+IHtcbiAgICAgICAgICAgICAgICBpZiAoZSBpbnN0YW5jZW9mIFJlcXVlc3RUaW1lb3V0KVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUmVxdWVzdFRpbWVvdXQgKHRoaXMuaWQgKyAnICcgKyBtZXRob2QgKyAnICcgKyB1cmwgKyAnICcgKyBlLm1lc3NhZ2UgKyAnICgnICsgdGhpcy50aW1lb3V0ICsgJyBtcyknKVxuICAgICAgICAgICAgICAgIHRocm93IGVcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBkZWZpbmVSZXN0QXBpIChhcGksIG1ldGhvZE5hbWUsIG9wdGlvbnMgPSB7fSkge1xuXG4gICAgICAgIGZvciAoY29uc3QgdHlwZSBvZiBPYmplY3Qua2V5cyAoYXBpKSkge1xuICAgICAgICAgICAgZm9yIChjb25zdCBodHRwTWV0aG9kIG9mIE9iamVjdC5rZXlzIChhcGlbdHlwZV0pKSB7XG5cbiAgICAgICAgICAgICAgICBsZXQgdXJscyA9IGFwaVt0eXBlXVtodHRwTWV0aG9kXVxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdXJscy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gdXJsc1tpXS50cmltICgpXG4gICAgICAgICAgICAgICAgICAgIGxldCBzcGxpdFBhdGggPSB1cmwuc3BsaXQgKC9bXmEtekEtWjAtOV0vKVxuXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2VNZXRob2QgID0gaHR0cE1ldGhvZC50b1VwcGVyQ2FzZSAoKVxuICAgICAgICAgICAgICAgICAgICBsZXQgbG93ZXJjYXNlTWV0aG9kICA9IGh0dHBNZXRob2QudG9Mb3dlckNhc2UgKClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZU1ldGhvZCAgPSB0aGlzLmNhcGl0YWxpemUgKGxvd2VyY2FzZU1ldGhvZClcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNhbWVsY2FzZVN1ZmZpeCAgPSBzcGxpdFBhdGgubWFwICh0aGlzLmNhcGl0YWxpemUpLmpvaW4gKCcnKVxuICAgICAgICAgICAgICAgICAgICBsZXQgdW5kZXJzY29yZVN1ZmZpeCA9IHNwbGl0UGF0aC5tYXAgKHggPT4geC50cmltICgpLnRvTG93ZXJDYXNlICgpKS5maWx0ZXIgKHggPT4geC5sZW5ndGggPiAwKS5qb2luICgnXycpXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhbWVsY2FzZVN1ZmZpeC5pbmRleE9mIChjYW1lbGNhc2VNZXRob2QpID09PSAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgY2FtZWxjYXNlU3VmZml4ID0gY2FtZWxjYXNlU3VmZml4LnNsaWNlIChjYW1lbGNhc2VNZXRob2QubGVuZ3RoKVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICh1bmRlcnNjb3JlU3VmZml4LmluZGV4T2YgKGxvd2VyY2FzZU1ldGhvZCkgPT09IDApXG4gICAgICAgICAgICAgICAgICAgICAgICB1bmRlcnNjb3JlU3VmZml4ID0gdW5kZXJzY29yZVN1ZmZpeC5zbGljZSAobG93ZXJjYXNlTWV0aG9kLmxlbmd0aClcblxuICAgICAgICAgICAgICAgICAgICBsZXQgY2FtZWxjYXNlICA9IHR5cGUgKyBjYW1lbGNhc2VNZXRob2QgKyB0aGlzLmNhcGl0YWxpemUgKGNhbWVsY2FzZVN1ZmZpeClcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVuZGVyc2NvcmUgPSB0eXBlICsgJ18nICsgbG93ZXJjYXNlTWV0aG9kICsgJ18nICsgdW5kZXJzY29yZVN1ZmZpeFxuXG4gICAgICAgICAgICAgICAgICAgIGlmICgnc3VmZml4ZXMnIGluIG9wdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnY2FtZWxjYXNlJyBpbiBvcHRpb25zWydzdWZmaXhlcyddKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbWVsY2FzZSArPSBvcHRpb25zWydzdWZmaXhlcyddWydjYW1lbGNhc2UnXVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCd1bmRlcnNjb3JlJyBpbiBvcHRpb25zLnN1ZmZpeGVzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuZGVyc2NvcmUgKz0gb3B0aW9uc1snc3VmZml4ZXMnXVsndW5kZXJzY29yZSddXG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBpZiAoJ3VuZGVyc2NvcmVfc3VmZml4JyBpbiBvcHRpb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgdW5kZXJzY29yZSArPSBvcHRpb25z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XMucHJveHkgPT0gJ2Z1bmN0aW9uJykge1xuXG4gICAgICAgICAgICB1cmwgPSB0aGlzLnByb3h5ICh1cmwpXG4gICAgICAgICAgICBpZiAoaXNOb2RlKVxuICAgICAgICAgICAgICAgIGhlYWRlcnMgPSBleHRlbmQgKHsgJ09yaWdpbic6IHRoaXMub3JpZ2luIH0sIGhlYWRlcnMpXG5cbiAgICAgICAgfSBlbHNlIGlmICh0eXBlb2YgdGhpcy5wcm94eSA9PSAnc3RyaW5nJykge1xuXG4gICAgICAgICAgICBpZiAodGhpcy5wcm94eS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgaWYgKGlzTm9kZSlcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAoeyAnT3JpZ2luJzogdGhpcy5vcmlnaW4gfSwgaGVhZGVycylcblxuICAgICAgICAgICAgdXJsID0gdGhpcy5wcm94eSArIHVybFxuICAgICAgICB9XG5cbiAgICAgICAgaGVhZGVycyA9IGV4dGVuZCAodGhpcy5oZWFkZXJzLCBoZWFkZXJzKVxuXG4gICAgICAgIGlmICh0aGlzLnZlcmJvc2UpXG4gICAgICAgICAgICBjb25zb2xlLmxvZyAodGhpcy5pZCwgbWV0aG9kLCB1cmwsIFwiXFxuUmVxdWVzdDpcXG5cIiwgaGVhZGVycywgYm9keSlcblxuICAgICAgICByZXR1cm4gdGhpcy5leGVjdXRlUmVzdFJlcXVlc3QgKHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KVxuICAgIH1cblxuICAgIGFzeW5jIGZldGNoMiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgIGlmICh0aGlzLmVuYWJsZVJhdGVMaW1pdClcbiAgICAgICAgICAgIGF3YWl0IHRoaXMudGhyb3R0bGUgKClcblxuICAgICAgICBsZ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vZHlcbiAgICAgICAgbGV0IG1hdGNoID0gYm9keS5tYXRjaCAoL1xcPHRpdGxlXFw+KFtePF0rKS9pKVxuICAgICAgICBpZiAobWF0Y2gpXG4gICAgICAgICAgICBkZXRhaWxzID0gbWF0Y2hbMV0udHJpbSAoKTtcbiAgICAgICAgaWYgKFsgNDE4LCA0MjkgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gRERvU1Byb3RlY3Rpb25cbiAgICAgICAgfSBlbHNlIGlmIChbIDQwNCwgNDA5LCA0MjIsIDUwMCwgNTAxLCA1MDIsIDUyMCwgNTIxLCA1MjIsIDUyNSBdLmluY2x1ZGVzIChjb2RlKSkge1xuICAgICAgICAgICAgZXJyb3IgPSBFeGNoYW5nZU5vdEF2YWlsYWJsZVxuICAgICAgICB9IGVsc2UgaWYgKFsgNDAwLCA0MDMsIDQwNSwgNTAzLCA1MzAgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGxldCBkZG9zUHJvdGVjdGlvbiA9IGJvZHkubWF0Y2ggKC9jbG91ZGZsYXJlfGluY2Fwc3VsYS9pKVxuICAgICAgICAgICAgaWYgKGRkb3NQcm90ZWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgZXJyb3IgPSBERG9TUHJvdGVjdGlvblxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBlcnJvciA9IEV4Y2hhbmdlTm90QXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgZGV0YWlscyArPSAnIChwb3NzaWJsZSByZWFzb25zOiAnICsgW1xuICAgICAgICAgICAgICAgICAgICAnaW52YWxpZCBBUEkga2V5cycsXG4gICAgICAgICAgICAgICAgICAgICdiYWQgb3Igb2xkIG5vbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlIGlzIGRvd24gb3Igb2ZmbGluZScsXG4gICAgICAgICAgICAgICAgICAgICdvbiBtYWludGVuYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICdERG9TIHByb3RlY3Rpb24nLFxuICAgICAgICAgICAgICAgICAgICAncmF0ZS1saW1pdGluZycsXG4gICAgICAgICAgICAgICAgXS5qb2luICgnLCAnKSArICcpJ1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2UgaWYgKFsgNDA4LCA1MDQgXS5pbmNsdWRlcyAoY29kZSkpIHtcbiAgICAgICAgICAgIGVycm9yID0gUmVxdWVzdFRpbWVvdXRcbiAgICAgICAgfSBlbHNlIGlmIChbIDQwMSwgNTExIF0uaW5jbHVkZXMgKGNvZGUpKSB7XG4gICAgICAgICAgICBlcnJvciA9IEF1dGhlbnRpY2F0aW9uRXJyb3JcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGVycm9yID0gRXhjaGFuZ2VFcnJvclxuICAgICAgICB9XG4gICAgICAgIHRocm93IG5ldyBlcnJvciAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgY29kZSwgcmVhc29uLCBkZXRhaWxzIF0uam9pbiAoJyAnKSlcbiAgICB9XG5cbiAgICBoYW5kbGVSZXN0RXJyb3JzIChyZXNwb25zZSwgdXJsLCBtZXRob2QgPSAnR0VUJywgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuXG4gICAgICAgIGlmICh0eXBlb2YgcmVzcG9uc2UgPT0gJ3N0cmluZycpXG4gICAgICAgICAgICByZXR1cm4gcmVzcG9uc2VcblxuICAgICAgICByZXR1cm4gcmVzcG9uc2UudGV4dCAoKS50aGVuICh0ZXh0ID0+IHtcblxuICAgICAgICAgICAgY29uc3QgYXJncyA9IFsgcmVzcG9uc2Uuc3RhdHVzLCByZXNwb25zZS5zdGF0dXNUZXh0LCB1cmwsIG1ldGhvZCwgaGVhZGVycywgdGV4dCBdXG5cbiAgICAgICAgICAgIHRoaXMuaGFuZGxlRXJyb3JzICguLi5hcmdzKVxuICAgICAgICAgICAgcmV0dXJuIHRoaXMu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EV4Y2hhbmdlTm90QXZhaWxhYmxlXG4gICAgICAgICAgICAgICAgbGV0IGRldGFpbHMgPSAnbm90IGFjY2Vzc2libGUgZnJvbSB0aGlzIGxvY2F0aW9uIGF0IHRoZSBtb21lbnQnXG4gICAgICAgICAgICAgICAgaWYgKG1haW50ZW5hbmNlKVxuICAgICAgICAgICAgICAgICAgICBkZXRhaWxzID0gJ29mZmxpbmUsIG9uIG1haW50ZW5hbmNlIG9yIHVucmVhY2hhYmxlIGZyb20gdGhpcyBsb2NhdGlvbiBhdCB0aGUgbW9tZW50J1xuICAgICAgICAgICAgICAgIGlmIChkZG9zUHJvdGVjdGlvbilcbiAgICAgICAgICAgICAgICAgICAgZXJyb3IgPSBERG9TUHJvdGVjdGlvblxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBlcnJvciAoWyB0aGlzLmlkLCBtZXRob2QsIHVybCwgZGV0YWlscyBdLmpvaW4gKCcgJykpXG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLnZlcmJvc2UpXG4gICAgICAgICAgICAgICAgY29uc29sZS5sb2cgKHRoaXMuaWQsIG1ldGhvZCwgdXJsLCAnZXJyb3InLCBlLCBcInJlc3BvbnNlIGJvZHk6XFxuJ1wiICsgcmVzcG9uc2UgKyBcIidcIilcblxuICAgICAgICAgICAgdGhyb3cgZVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgc2V0TWFya2V0cyAobWFya2V0cywgY3VycmVuY2llcyA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdmFsdWVzID0gT2JqZWN0LnZhbHVlcyAobWFya2V0cykubWFwIChtYXJrZXQgPT4gZGVlcEV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0cyc6IHRoaXMubGltaXRzLFxuICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHRoaXMucHJlY2lzaW9uLFxuICAgICAgICB9LCB0aGlzLmZlZXNbJ3RyYWRpbmcnXSwgbWFya2V0KSlcbiAgICAgICAgdGhpcy5tYXJrZXRzID0gZGVlcEV4dGVuZCAodGhpcy5tYXJrZXRzLCBpbmRleEJ5ICh2YWx1ZXMsICdzeW1ib2wnKSlcbiAgICAgICAgdGhpcy5tYXJrZXRzQnlJZCA9IGluZGV4QnkgKG1hcmtldHMsICdpZCcpXG4gICAgICAgIHRoaXMubWFya2V0c19ieV9pZCA9IHRoaXMubWFya2V0c0J5SWRcbiAgICAgICAgdGhpcy5zeW1ib2xzID0gT2JqZWN0LmtleXMgKHRoaXMubWFya2V0cykuc29ydCAoKVxuICAgICAgICB0aGlzLmlkcyA9IE9iamVjdC5rZXlzICh0aGlzLm1hcmtldHNfYnlfaWQpLnNvcnQgKClcbiAgICAgICAgaWYgKGN1cnJlbmNpZXMpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVuY2llcyA9IGRlZXBFeHRlbmQgKGN1cnJlbmNpZXMsIHRoaXMuY3VycmVuY2llcylcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGJhc2VDdXJyZW5jaWVzID1cbiAgICAgICAgICAgICAgICB2YWx1ZXMuZmlsdGVyIChtYXJrZXQgPT4gJ2Jhc2UnIGluIG1hcmtldClcbiAgICAgICAgICAgICAgICAgICAgLm1hcCAobWFya2V0ID0+ICh7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogbWFya2V0LmJhc2VJZCB8fCBtYXJrZXQuYmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvZGU6IG1hcmtldC5iYXNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJlY2lzaW9uOiBtYXJrZXQucHJlY2lzaW9uID8gKG1hcmtldC5wcmVjaXNpb24uYmFzZSB8fCBtYXJrZXQucHJlY2lzaW9uLmFtb3VudCkgOiA4LFxuICAgICAgICAgICAgICAgICAgICB9KSlcbiAgICAgICAgICAgIGNvbnN0IHF1b3RlQ3VycmVuY2llcyA9XG4gICAgICAgICAgICAgICAgdmFsdWVzLmZpbHRlciAobWFya2V0ID0+ICdxdW90ZScgaW4gbWFya2V0KVxuICAgICAgICAgICAgICAgICAgICAubWFwIChtYXJrZXQgPT4gKHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBtYXJrZXQucXVvdGVJZCB8fCBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2RlOiBtYXJrZXQucXVvdGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBwcmVjaXNpb246IG1hcmtldC5wcmVjaXNpb24gPyAobWFya2V0LnByZWNpc2lvbi5xdW90ZSB8fCBtYXJrZXQucHJlY2lzaW9uLnByaWNlKSA6IDgsXG4gICAgICAgICAgICAgICAgICAgIH0pKVxuICAgICAgICAgICAgY29uc3QgYWxsQ3VycmVuY2llcyA9IGJhc2VDdXJyZW5jaWVzLmNvbmNhdCAocXVvdGVDdXJyZW5jaWVzKVxuICAgICAgICAgICAgY29uc3QgZ3JvdXBlZEN1cnJlbmNpZXMgPSBncm91cEJ5IChhbGxDdXJyZW5jaWVzLCAnY29kZScpXG4gICAgICAgICAgICBjb25zdCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGdyb3VwZWRDdXJyZW5jaWVzKS5tYXAgKGNvZGUgPT5cbiAgICAgICAgICAgICAgICBncm91cGVkQ3VycmVuY2llc1tjb2RlXS5yZWR1Y2UgKChwcmV2aW91cywgY3VycmVudCkgPT5cbiAgICAgICAgICAgICAgICAgICAgKChwcmV2aW91cy5wcmVjaXNpb24gPiBjdXJyZW50LnByZWNpc2lvbikgPyBwcmV2aW91cyA6IGN1cnJlbnQpLCBncm91cGVkQ3VycmVuY2llc1tjb2RlXVswXSkpXG4gICAgICAgICAgICBjb25zdCBzb3J0ZWRDdXJyZW5jaWVzID0gc29ydEJ5IChmbGF0dGVuIChjdXJyZW5jaWVzKSwgJ2NvZGUnKVxuICAgICAgICAgICAgdGhpcy5jdXJyZW5jaWVzID0gZGVlcEV4dGVuZCAoaW5kZXhCeSAoc29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SA9PSAnYnV5Jykge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbCArIChvcmRlclsnY29zdCddIHx8IChvcmRlclsncHJpY2UnXSAqIGFtb3VudCkpXG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiB0b3RhbFxuICAgICAgICAgICAgfVxuICAgICAgICB9LCAwKVxuICAgIH1cblxuICAgIHBhcnNlQmFsYW5jZSAoYmFsYW5jZSkge1xuXG4gICAgICAgIGNvbnN0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5vbWl0IChiYWxhbmNlLCAnaW5mbycpKTtcblxuICAgICAgICBjdXJyZW5jaWVzLmZvckVhY2ggKGN1cnJlbmN5ID0+IHtcblxuICAgICAgICAgICAgaWYgKHR5cGVvZiBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID09ICd1bmRlZmluZWQnKSB7XG5cbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXJzZUJhbGFuY2VGcm9tT3Blbk9yZGVycyAmJiAoJ29wZW5fb3JkZXJzJyBpbiBiYWxhbmNlWydpbmZvJ10pKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGV4Y2hhbmdlT3JkZXJzQ291bnQgPSBiYWxhbmNlWydpbmZvJ11bJ29wZW5fb3JkZXJzJ107XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNhY2hlZE9yZGVyc0NvdW50ID0gT2JqZWN0LnZhbHVlcyAodGhpcy5vcmRlcnMpLmZpbHRlciAob3JkZXIgPT4gKG9yZGVyWydzdGF0dXMnXSA9PSAnb3BlbicpKS5sZW5ndGg7XG4gICAgICAgICAgICAgICAgICAgIGlmIChjYWNoZWRPcmRlcnNDb3VudCA9PSBleGNoYW5nZU9yZGVyc0NvdW50KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XS51c2VkID0gdGhpcy5nZXRDdXJyZW5jeVVzZWRPbk9wZW5PcmRlcnMgKGN1cnJlbmN5KVxuICAgICAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udXNlZCA9IHRoaXMuZ2V0Q3VycmVuY3lVc2VkT25PcGVuT3JkZXJzIChjdXJyZW5jeSlcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVtjdXJyZW5jeV0udG90YWwgPSBiYWxhbmNlW2N1cnJlbmN5XS51c2VkICsgYmFsYW5jZVtjdXJyZW5jeV0uZnJlZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgWyAnZnJlZScsICd1c2VkJywgJ3RvdGFsJyBdLmZvckVhY2ggKGFjY291bnQgPT4ge1xuICAgICAgICAgICAgICAgIGJhbGFuY2VbYWNjb3VudF0gPSBiYWxhbmNlW2FjY291bnRdIHx8IHt9XG4gICAgICAgICAgICAgICAgYmFsYW5jZVthY2NvdW50XVtjdXJyZW5jeV0gPSBiYWxhbmNlW2N1cnJlbmN5XVthY2NvdW50XVxuICAgICAgICAgICAgfSlcbiAgICAgICAgfSlcbiAgICAgICAgcmV0dXJuIGJhbGFuY2U7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hQYXJ0aWFsQmFsYW5jZSAocGFydCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLmZldGNoQmFsYW5jZSAocGFyYW1zKVxuICAgICAgICByZXR1cm4gYmFsYW5jZVtwYXJ0XVxuICAgIH1cblxuICAgIGZldGNoRnJlZUJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiB0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pXG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAndHlwZSc6IHRha2VyT3JNYWtlcixcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCByYXRlICogY29zdCkpLFxuICAgICAgICB9XG4gICAgfVxuXG4gICAgWW1kICh0aW1lc3RhbXAsIGluZml4ID0gJyAnKSB7XG4gICAgICAgIGxldCBkYXRlID0gbmV3IERhdGUgKHRpbWVzdGFtcClcbiAgICAgICAgbGV0IFkgPSBkYXRlLmdldFVUQ0Z1bGxZZWFyICgpXG4gICAgICAgIGxldCBtID0gZGF0ZS5nZXRVVENNb250aCAoKSArIDFcbiAgICAgICAgbGV0IGQgPSBkYXRlLmdldFVUQ0RhdGUgKClcbiAgICAgICAgbSA9IG0gPCAxMCA/ICgnMCcgKyBtKSA6IG1cbiAgICAgICAgZCA9IGQgPCAxMCA/ICgnMCcgKyBkKSA6IGRcbiAgICAgICAgcmV0dXJuIFkgKyAnLScgKyBtICsgJy0nICsgZFxuICAgIH1cblxuICAgIFltZEhNUyAodGltZXN0YW1wLCBpbmZpeCA9ICcgJykge1xuICAgICAgICBsZXQgZGF0ZSA9IG5ldyBEYXRlICh0aW1lc3RhbXApXG4gICAgICAgIGxldCBZID0gZGF0ZS5nZXRVVENGdWxsWWVhciAoKVxuICAgICAgICBsZXQgbSA9IGRhdGUuZ2V0VVRDTW9udGggKCkgKyAxXG4gICAgICAgIGxldCBkID0gZGF0ZS5nZXRVVENEYXRlICgpXG4gICAgICAgIGxldCBIID0gZGF0ZS5nZXRVVENIb3VycyAoKVxuICAgICAgICBsZXQgTSA9IGRhdGUuZ2V0VVRDTWludXRlcyAoKVxuICAgICAgICBsZXQgUyA9IGRhdGUuZ2V0VVRDU2Vjb25kcyAoKVxuICAgICAgICBtID0gbSA8IDEwID8gKCcwJyArIG0pIDogbVxuICAgICAgICBkID0gZCA8IDEwID8gKCcwJyArIGQpIDogZFxuICAgICAgICBIID0gSCA8IDEwID8gKCcwJyArIEgpIDogSFxuICAgICAgICBNID0gTSA8IDEwID8gKCcwJyArIE0pIDogTVxuICAgICAgICBTID0gUyA8IDEwID8gKCcwJyArIFMpIDogU1xuICAgICAgICByZXR1cm4gWSArICctJyArIG0gKyAnLScgKyBkICsgaW5maXggKyBIICsgJzonICsgTSArICc6JyArIFNcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBNYXJrZXQge1xuXG4gICAgY29uc3RydWN0b3IgKGV4Y2hhbmdlLCBzeW1ib2wpIHtcbiAgICAgICAgdGhpcy5leGNoYW5nZSA9IGV4Y2hhbmdlO1xuICAgICAgICB0aGlzLnN5bWJvbCA9IHN5bWJvbDtcbiAgICAgICAgdGhpcy5tYXJrZXQgPSBleGNoYW5nZS5tYXJrZXRzW3N5bWJvbF07XG4gICAgfVxuXG4gICAgYW1vdW50VG9QcmVjaXNpb24gKGFtb3VudCkge1xuICAgICAgICByZXR1cm4gdGhpcy5leGNoYW5nZS5hbW91bnRUb1ByZWNpc2lvbiAodGhpcy5zeW1ib2wsIGFtb3VudClcbiAgICB9XG5cbiAgICBjcmVhdGVMaW1pdEJ1eU9yZGVyKGFtb3VudCwgcHJpY2UpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXhjaGFuZ2UuY3JlYXRlTGltaXRCdXlPcmRlciAodGhpcy5zeW1ib2wsIGFtb3VudCwgcHJpY2UpXG4gICAgfVxuXG4gICAgY3JlYXRlTGltaXRTZWxsT3JkZXIoYW1vdW50LCBwcmljZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5leGNoYW5nZS5jcmVhdGVMaW1pdFNlbGxPcmRlciAodGhpcy5zeW1ib2wsIGFtb3VudCwgcHJpY2UpXG4g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GFyZ1trZXldKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgIHJlc3VsdCA9IGFyZ1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHJlc3VsdFxufVxuXG5jb25zdCBvbWl0ID0gKG9iamVjdCwgLi4uYXJncykgPT4ge1xuICAgIGNvbnN0IHJlc3VsdCA9IGV4dGVuZCAob2JqZWN0KVxuICAgIGZvciAoY29uc3QgeCBvZiBhcmdzKSB7XG4gICAgICAgIGlmICh0eXBlb2YgeCA9PT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgIGRlbGV0ZSByZXN1bHRbeF1cbiAgICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5ICh4KSkge1xuICAgICAgICAgICAgZm9yIChjb25zdCBrIG9mIHgpXG4gICAgICAgICAgICAgICAgZGVsZXRlIHJlc3VsdFtrXVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXN1bHRcbn1cblxuY29uc3QgZ3JvdXBCeSA9IChhcnJheSwga2V5KSA9PiB7XG4gICAgY29uc3QgcmVzdWx0ID0ge31cbiAgICBPYmplY3RcbiAgICAgICAgLnZhbHVlcyAoYXJyYXkpXG4gICAgICAgIC5maWx0ZXIgKGVudHJ5ID0+IGVudHJ5W2tleV0gIT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgIC5mb3JFYWNoIChlbnRyeSA9PiB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdFtlbnRyeVtrZXldXSA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICByZXN1bHRbZW50cnlba2V5XV0gPSBbXVxuICAgICAgICAgICAgcmVzdWx0W2VudHJ5W2tleV1dLnB1c2ggKGVudHJ5KVxuICAgICAgICB9KVxuICAgIHJldHVybiByZXN1bHRcbn1cblxuY29uc3QgZmlsdGVyQnkgPSAoYXJyYXksIGtleSwgdmFsdWUgPSB1bmRlZmluZWQpID0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ICAgICAsIGNvdW50ZXIgPSAwXG5cbiAgICByZXR1cm4gT2JqZWN0LmFzc2lnbiAoY29zdCA9PiB7XG5cbiAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IGNmZy5tYXhDYXBhY2l0eSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvciAoJ0JhY2tsb2cgaXMgb3ZlciBtYXggY2FwYWNpdHkgb2YgJyArIGNmZy5tYXhDYXBhY2l0eSlcblxuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UgKGFzeW5jIChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgICAgICAgdHJ5IHtcblxuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2ggKHsgY29zdCwgcmVzb2x2ZSwgcmVqZWN0IH0pXG5cbiAgICAgICAgICAgICAgICBpZiAoIXJ1bm5pbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgcnVubmluZyA9IHRydWVcbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGhhc0Vub3VnaFRva2VucyA9IGNmZy5jYXBhY2l0eSA/IChudW1Ub2tlbnMgPiAwKSA6IChudW1Ub2tlbnMgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChoYXNFbm91Z2hUb2tlbnMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocXVldWUubGVuZ3RoID4gMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgeyBjb3N0LCByZXNvbHZlLCByZWplY3QgfSA9IHF1ZXVlWzBdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvc3QgPSAoY29zdCB8fCBjZmcuZGVmYXVsdENvc3QpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChudW1Ub2tlbnMgPj0gTWF0aC5taW4gKGNvc3QsIGNmZy5jYXBhY2l0eSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVRva2VucyAtPSBjb3N0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWV1ZS5zaGlmdCAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSAoKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vdyA9IERhdGUubm93ICgpXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZWxhcHNlZCA9IG5vdyAtIGxhc3RUaW1lc3RhbXBcbiAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RUaW1lc3RhbXAgPSBub3dcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bVRva2VucyA9IE1hdGgubWluIChjZmcuY2FwYWNpdHksIG51bVRva2VucyArIGVsYXBzZWQgKiBjZmcucmVmaWxsUmF0ZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IHNsZWVwIChjZmcuZGVsYXkpXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcnVubmluZyA9IGZhbHNlXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG5cbiAgICAgICAgICAgICAgICByZWplY3QgKGUpXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG5cbiAgICB9LCBjZmcsIHtcbiAgICAgICAgY29uZmlndXJlOiBuZXdDZmcgPT4gdGhyb3R0bGUgKE9iamVjdC5hc3NpZ24gKHt9LCBjZmcsIG5ld0NmZykpXG4gICAgfSlcbn1cblxubW9kdWxlLmV4cG9ydHMgPSB0aHJvdHRsZVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tL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2hhc0ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzNtJzogJzNtJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNW0nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMmgnOiAnMmgnLFxuICAgICAgICAgICAgICAgICc0aCc6ICc0aCcsXG4gICAgICAgICAgICAgICAgJzZoJzogJzZoJyxcbiAgICAgICAgICAgICAgICAnOGgnOiAnOGgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgICAgICczZCc6ICczZCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3JyxcbiAgICAgICAgICAgICAgICAnMU0nOiAnMU0nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjk2MDQwMjAtZDU0ODNjZGMtODdlZS0xMWU3LTk0YzctZDFhOGQ5MTY5MjkzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3dlYic6ICdodHRwczovL3d3dy5iaW5hbmNlLmNvbScsXG4gICAgICAgICAgICAgICAgICAgICd3YXBpJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL3dhcGkvdjMnLFxuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpbmFuY2UuY29tL2FwaS92MycsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpbmFuY2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9iaW5hbmNlLWV4Y2hhbmdlL2JpbmFuY2Utb2ZmaWNpYWwtYXBpLWRvY3MvYmxvYi9tYXN0ZXIvcmVzdC1hcGkubWQnLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaW5hbmNlLnplbmRlc2suY29tL2hjL2VuLXVzL2FydGljbGVzLzExNTAwMDQyOTMzMicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3N1cHBvcnQuYmluYW5jZS5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMTE1MDAwNTgzMzExJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3dlYic6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9wdWJsaWMvcHJvZHVjdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2VJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWdnVHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci8yNGhyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYWxsUHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIvYWxsQm9va1RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXlUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlckRhdGFTdHJlYW0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJEYXRhU3RyZWFtJ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyRGF0YVN0cmVhbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTkInOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05FTyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiA1MC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBUyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0RUJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAzMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dUQyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogOC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDIuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLTkMnOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVOJzogNTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAxMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xJTksnOiA1LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFZHJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NUUic6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQUxUJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTURBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01UTCc6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDEwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5HJzogMi4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDQuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVEnOiAzMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDcuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiA3LjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFNSJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDUwMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPV1InOiAxNS4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSSyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPJzogMzAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01PRCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAxLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RPUkonOiAyLjAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOQic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0FYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01DTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05HTFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JRWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS05DJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElOSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFZHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NBTFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01EQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVlgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hTUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1dSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUksnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU9EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTkonOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUT1JKJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZUluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3N5bWJvbHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsnYmFzZUFzc2V0J10pO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKG1hcmtldFsncXVvdGVBc3NldCddKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgZmlsdGVycyA9IHRoaXMuaW5kZXhCeSAobWFya2V0WydmaWx0ZXJzJ10sICdmaWx0ZXJUeXBlJyk7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdiYXNlJzogbWFya2V0WydiYXNlQXNzZXRQcmVjaXNpb24nXSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBtYXJrZXRbJ3F1b3RlUHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYmFzZUFzc2V0UHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogbWFya2V0WydxdW90ZVByZWNpc2lvbiddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAobWFya2V0WydzdGF0dXMnXSA9PSAnVFJBRElORycpO1xuICAgICAgICAgICAgbGV0IGxvdCA9IC0xICogTWF0aC5sb2cxMCAocHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgZW50cnkgPSB0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogbG90LFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAtMSAqIE1hdGgubG9nMTAgKHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBsb3QsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICgnUFJJQ0VfRklMVEVSJyBpbiBmaWx0ZXJzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGZpbHRlciA9IGZpbHRlcnNbJ1BSSUNFX0ZJTFRFUiddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsncHJpY2UnXSA9IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAoZmlsdGVyWyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ3ByaWNlJ10gPSB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogcGFyc2VGbG9hdCAoZmlsdGVyWydtYXhQcmljZSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdMT1RfU0laRScgaW4gZmlsdGVycykge1xuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBmaWx0ZXJzWydMT1RfU0laRSddO1xuICAgICAgICAgICAgICAgIGVudHJ5WydwcmVjaXNpb24nXVsnYW1vdW50J10gPSB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKGZpbHRlclsnc3RlcFNpemUnXSk7XG4gICAgICAgICAgICAgICAgZW50cnlbJ2xvdCddID0gcGFyc2VGbG9hdCAoZmlsdGVyWydzdGVwU2l6ZSddKTtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Ftb3VudCddID0ge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAoZmlsdGVyWydtaW5RdHknXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChmaWx0ZXJbJ21heFF0eSddKSxcbiAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdNSU5fTk9USU9OQUwnIGluIGZpbHRlcnMpIHtcbiAgICAgICAgICAgICAgICBlbnRyeVsnbGltaXRzJ11bJ2Nvc3QnXVsnbWluJ10gPSBwYXJzZUZsb2F0IChmaWx0ZXJzWydNSU5fTk9USU9OQUwnXVsnbWluTm90aW9uYWwnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoZW50cnkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAg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ICBsZXQgdGltZXN0YW1wID0gdGhpcy5zYWZlSW50ZWdlciAodGlja2VyLCAnY2xvc2VUaW1lJyk7XG4gICAgICAgIGlmICh0eXBlb2YgdGltZXN0YW1wID09ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB0aWNrZXJbJ3N5bWJvbCddO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKHN5bWJvbCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbc3ltYm9sXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaFByaWNlJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd1ByaWNlJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZFByaWNlJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2Fza1ByaWNlJyksXG4gICAgICAgICAgICAndndhcCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd3ZWlnaHRlZEF2Z1ByaWNlJyksXG4gICAgICAgICAgICAnb3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J10gPyAnc2VsbCcgOiAnYnV5JzsgLy8gdGhpcyBpcyByZXZlcnNlZCBpbnRlbnRpb25hbGx5XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBzaWRlID0gKHRyYWRlWydpc0J1eWVyJ10pID8gJ2J1eScgOiAnc2VsbCc7IC8vIHRoaXMgaXMgYSB0cnVlIHNpZGVcbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2NvbW1pc3Npb24nIGluIHRyYWRlKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0ICh0cmFkZVsnY29tbWlzc2lvbiddKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodHJhZGVbJ2NvbW1pc3Npb25Bc3NldCddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IG9yZGVyLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZlZSc6IGZlZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgIC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ICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyU3RhdHVzIChzdGF0dXMpIHtcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAnTkVXJylcbiAgICAgICAgICAgIHJldHVybiAnb3Blbic7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gJ1BBUlRJQUxMWV9GSUxMRUQnKVxuICAgICAgICAgICAgcmV0dXJuICdvcGVuJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAnRklMTEVEJylcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSAnQ0FOQ0VMRUQnKVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXMudG9Mb3dlckNhc2UgKCk7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGlkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gb3JkZXJbJ3RpbWUnXTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAob3JkZXJbJ29yaWdRdHknXSk7XG4gICAgICAgIGxldCBmaWxsZWQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdleGVjdXRlZFF0eScsIDAuMCk7XG4gICAgICAgIGxldCByZW1haW5pbmcgPSBNYXRoLm1heCAoYW1vdW50IC0gZmlsbGVkLCAwLjApO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ3R5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFz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UNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQkNDJylcbiAgICAgICAgICAgIHJldHVybiAnQkNIJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGN1cnJlbmN5SWQgKGN1cnJlbmN5KSB7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQkNIJylcbiAgICAgICAgICAgIHJldHVybiAnQkNDJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoRGVwb3NpdEFkZHJlc3MgKGN1cnJlbmN5LCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndhcGlHZXREZXBvc2l0QWRkcmVzcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdhc3NldCc6IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpLFxuICAgICAgICAgICAgJ3JlY3ZXaW5kb3cnOiAxMDAwMDAwMCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGlmIChyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgbGV0IGFkZHJlc3MgPSB0aGlzLnNhZmVTdHJpbmcgKHJlc3BvbnNlLCAnYWRkcmVzcycpO1xuICAgICAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1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mNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7ICd0aW1lc3RhbXAnOiBub25jZSB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgcXVlcnkgKz0gJyYnICsgJ3NpZ25hdHVyZT0nICsgc2lnbmF0dXJlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1NQlgtQVBJS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKChtZXRob2QgPT0gJ0dFVCcpIHx8IChhcGkgPT0gJ3dhcGknKSkge1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHF1ZXJ5O1xuICAgICAgICAgICAgICAgIGhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA+PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChjb2RlID09IDQxOClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyBjb2RlLnRvU3RyaW5nICgpICsgJyAnICsgcmVhc29uICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICBpZiAoYm9keS5pbmRleE9mICgnTUlOX05PVElPTkFMJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBjb3N0ID0gYW1vdW50ICogcHJpY2Ugc2hvdWxkIGJlID4gKDAuMDAxIEJUQyBvciAwLjAxIEVUSCBvciAxIEJOQiBvciAxIFVTRFQpJyArIGJvZHkpO1xuICAgICAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0xPVF9TSVpFJykgPj0gMClcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyBvcmRlciBhbW91bnQgc2hvdWxkIGJlIGV2ZW5seSBkaXZpc2libGUgYnkgbG90IHNpemUsIHVzZSB0aGlzLmFtb3VudFRvTG90cyAoc3ltYm9sLCBhbW91bnQpICcgKyBib2R5KTtcbiAgICAgICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdQUklDRV9GSUxURVInKSA+PSAwKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnIG9yZGVyIHByaWNlIGV4Y2VlZHMgYWxsb3dlZCBwcmljZSBwcmVjaXNpb24gb3IgaW52YWxpZCwgdXNlIHRoaXMucHJpY2VUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQpICcgKyBib2R5KTtcbiAgICAgICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdPcmRlciBkb2VzIG5vdCBleGlzdCcpID49IDApXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICBsZXQgZXJyb3IgPSB0aGlzLnNhZmVWYWx1ZSAocmVzcG9uc2UsICdjb2RlJyk7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGVycm9yICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKGVycm9yID09IC0yMDEwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IC0yMDExKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPCAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IEV4Y2hhbmdlID0gcmVxdWlyZSAoJy4vYmFzZS9FeGNoYW5nZScpXG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBiaXQyYyBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXQyYycsXG4gICAgICAgICAgICAnbmFtZSc6ICdCaXQyQycsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0lMJywgLy8gSXNyYWVsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMzAwMCxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MTE5LTM1OTMyMjBlLTVlY2UtMTFlNy04YjNhLTVhMDQxZjZiY2MzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0MmMuY28uaWwnLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0MmMuY28uaWwnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXQyYy5jby5pbC9ob21lL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vT2ZlckUvYml0MmMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0V4Y2hhbmdlcy97cGFpcn0vVGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFeGNoYW5nZXMve3BhaXJ9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRXhjaGFuZ2VzL3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9CYWxhbmNlL3YyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNZXJjaGFudC9DcmVhdGVDaGVja291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQWNjb3VudEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZENvaW5GdW5kc1JlcXVlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZEZ1bmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL0FkZE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlci9BZGRPcmRlck1hcmtldFByaWNlU2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXIvQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVyL015T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQYXltZW50L0dldE15SWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BheW1lbnQvU2VuZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL05JUyc6IHsgJ2lkJzogJ0J0Y05pcycsICdzeW1ib2wnOiAnQlRDL05JUycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9OSVMnOiB7ICdpZCc6ICdCY2hOaXMnLCAnc3ltYm9sJzogJ0JDSC9OSVMnLCAnYmFzZSc6ICdCQ0gnLCAncXVvdGUnOiAnTklTJyB9LFxuICAgICAgICAgICAgICAgICdMVEMvTklTJzogeyAnaWQnOiAnTHRjTmlzJywgJ3N5bWJvbCc6ICdMVEMvTklTJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ05JUycgfSxcbiAgICAgICAgICAgICAgICAnQlRHL05JUyc6IHsgJ2lkJzogJ0J0Z05pcycsICdzeW1ib2wnOiAnQlRHL05JUycsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdOSVMnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC41IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEFjY291bnRCYWxhbmNlVjIgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGF2YWlsYWJsZSA9ICdBVkFJTEFCTEVfJyArIGN1cnJlbmN5O1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGJhbGFuY2VbYXZhaWxhYmxlXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gYmFsYW5jZVtjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZXNQYWlyT3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJ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c2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGwnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IGF2ZXJhZ2VQcmljZSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdW5kZWZpbmVkLFxuICAgICAgICAgIC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HVybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnYml0YmF5JyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdEJheScsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnUEwnLCAnRVUnIF0sIC8vIFBvbGFuZFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjEzMi05NzhhN2JkOC01ZWNlLTExZTctOTU0MC1iYzk2ZDFlOWJiYjguanBnJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0YmF5Lm5ldCcsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2JpdGJheS5uZXQvQVBJL1B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYml0YmF5Lm5ldC9BUEkvVHJhZGluZy90cmFkaW5nQXBpLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRiYXkubmV0L3B1YmxpYy1hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRiYXkubmV0L2FjY291bnQvdGFiLWFwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vQml0QmF5TmV0L0FQSScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnOiB7ICdpZCc6ICdCVENVU0QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVVNEJywgJ2Jhc2VJZCc6ICd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ICdHQU1FQlRDJywgJ3N5bWJvbCc6ICdHQU1FL0JUQycsICdiYXNlJzogJ0dBTUUnLCAncXVvdGUnOiAnQlRDJywgJ2Jhc2VJZCc6ICdHQU1FJywgJ3F1b3RlSWQnOiAnQlRDJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjMgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA0MyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0SW5mbyAoKTtcbiAgICAgICAgaWYgKCdiYWxhbmNlcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbJ2JhbGFuY2VzJ107XG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2UgfTtcbiAgICAgICAgICAgIGxldCBjb2RlcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb2Rlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBjb2RlID0gY29kZXNbaV07XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jaWVzW2NvZGVdO1xuICAgICAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGlm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gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgYmFzZVZvbHVtZSA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICd2b2x1bWUnKTtcbiAgICAgICAgbGV0IHZ3YXAgPSB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndndhcCcpO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbicpLFxuICAgICAgICAgICAgJ2JpZCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdiaWQnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYXNrJyksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZW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4gICAgICAgIH07XG4gICAgICAgIGlmIChjdXJyZW5jeSBpbiBmaWF0Q3VycmVuY2llcylcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgYXN5bmMgd2l0aGRyYXcgKGNvZGUsIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jdXJyZW5jeSAoY29kZSk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3lbJ2lkJ10sXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0aGlzLmlzRmlhdCAoY29kZSkpIHtcbiAgICAgICAgICAgIG1ldGhvZCA9ICdwcml2YXRlUG9zdFdpdGhkcmF3JztcbiAgICAgICAgICAgIC8vIHJlcXVlc3RbJ2FjY291bnQnXSA9IHBhcmFtc1snYWNjb3VudCddOyAvLyB0aGV5IGRlbWFuZCBhbiBhY2NvdW50IG51bWJlclxuICAgICAgICAgICAgLy8gcmVxdWVzdFsnZXhwcmVzcyddID0gcGFyYW1zWydleHByZXNzJ107IC8vIHdoYXRldmVyIGl0IG1lYW5zLCB0aGV5IGRvbid0IGV4cGxhaW5cbiAgICAgICAgICAgIC8vIHJlcXVlc3RbJ2JpYyddID0gJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBtZXRob2QgPSAncHJpdmF0ZVBvc3RUcmFuc2Zlcic7XG4gICAgICAgICAgICByZXF1ZXN0WydhZGRyZXNzJ10gPSBhZGRyZXNzO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXNbbWV0aG9kXSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV07XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcykgKyAnLmpzb24nO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ21vbWVudCc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdBUEktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FQSS1IYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgIC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nRlbnQuY29tLzEyOTQ0NTQvMjc3NjYxMzgtMDQzYzc3ODYtNWVjZi0xMWU3LTg4MmItODA5YzE0ZjM4YjUzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdmlwLmJpdGNvaW4uY28uaWQvdGFwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGNvaW4uY28uaWQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3ZpcC5iaXRjb2luLmNvLmlkL2Rvd25sb2Fkcy9CSVRDT0lOQ09JRC1BUEktRE9DVU1FTlRBVElPTi5wZGYnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly92aXAuYml0Y29pbi5jby5pZC90cmFkZV9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3twYWlyfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0lEUic6IHsgJ2lkJzogJ2J0Y19pZHInLCAnc3ltYm9sJzogJ0JUQy9JRFInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSURSJywgJ2Jhc2VJZCc6ICdidGMnLCAncXVvdGVJZCc6ICdpZHInIH0sXG4gICAgICAgICAgICAgICAgJ0JDSC9JRFInOiB7ICdpZCc6ICdiY2hfaWRyJywgJ3N5bWJvbCc6ICdCQ0gvSURSJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ0lEUicsICdiYXNlSWQnOiAnYmNoJywgJ3F1b3RlSWQnOiAnaWRyJyB9LFxuICAgICAgICAgICAgICAgICdCVEcvSURSJzogeyAnaWQnOiAnYnRnX2lkcicsICdzeW1ib2wnOiAnQlRHL0lEUicsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdJRFInLCAnYmFzZUlkJzogJ2J0ZycsICdxdW90ZUlkJzogJ2lkcicgfSxcbiAgICAgICAgICAgICAgICAnRVRIL0lEUic6IHsgJ2lkJzogJ2V0aF9pZHInLCAnc3ltYm9sJzogJ0VUSC9JRFInLCAnYmFzZSc6ICdFVEgnLCAncXVvdGUnOiAnSURSJywgJ2Jhc2VJZCc6ICdldGgnLCAncXVvdGVJZCc6ICdpZHInIH0sXG4gICAgICAgICAgICAgICAgJ0VUQy9JRFInOiB7ICdpZCc6ICdldGNfaWRyJywg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RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjb2RlID0gY29kZXNbaV07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSB0aGlzLmN1cnJlbmNpZXNbY29kZV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3lbJ2lkJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10sIGxvd2VyY2FzZSwgMC4wKTtcbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlX2hvbGQnXSwgbG93ZXJjYXNlLCAwLjApO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyRGVwdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9I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ybiddWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IHRoaXMubm9uY2UgKCksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgICAgICdLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHRoaXM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3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MjQ0LWUzMjhhNTBjLTVlZDItMTFlNy05NDdiLTA0MTQxNjU3OWJiMy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdGZpbmV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0ZmluZXgucmVhZG1lLmlvL3YxL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL2JpdGZpbmV4Y29tL2JpdGZpbmV4LWFwaS1ub2RlJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2xhc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmRsZXMvdHJhZGU6e3RpbWVmcmFtZX06e3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ2NhbmRsZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRzL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3B1YnRpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudF9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFza2V0X21hbmFnZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlZGl0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnkvbW92ZW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrZXlfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luX2luZm9zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXNfZnVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29mZmVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvZmZlcnMvaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWwvbXVsdGknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9yZXBsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL25ldy9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi9jbGFpbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdW1tYXJ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0YWtlbl9mdW5kcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndG90YWxfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bnVzZWRfdGFrZW5fZnVuZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzc1MDAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjE4IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTUwMDAwMDAsIDAuMTYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI1MDAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMzAwMDAwMDAsIDAuMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAsIDAuMDggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjA2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMCwgMC4wNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMDAsIDAuMDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs3NTAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxNTAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwMDAsIDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFszMDAwMDAwMCwgMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSwgLy8gdHJ1ZSBmb3IgdGllci1iYXNlZC9wcm9ncmVzc2l2ZVxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLCAvLyBmaXhlZCBjb21taXNzaW9uXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1RBJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hNUic6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFBSJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdZWVcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFUQSc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUUFTSCc6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRVFVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFRE8nOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVZUJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lPVEEnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUFInOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lZVyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORU8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVRBJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVNIJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgLy8gaXNzdWUgIzQgQml0ZmluZXggbmFtZXMgRGFzaCBhcyBEU0gsIGluc3RlYWQgb2YgREFTSFxuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RTSCcpXG4gICAgICAgICAgICByZXR1cm4gJ0RBU0gnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1FUTScpXG4gICAgICAgICAgICByZXR1cm4gJ1FUVU0nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JDQycpXG4gICAgICAgICAgICByZXR1cm4gJ0NTVF9CQ0MnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JDVScpXG4gICAgICAgICAgICByZXR1cm4gJ0NTVF9CQ1UnO1xuICAgICAgICAvLyBpc3N1ZSAjNzk2XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnSU9UJylcbiAgICAgICAgICAgIHJldHVybiAnSU9UQSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0U3ltYm9sc0RldGFpbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncGFpciddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsncHJpY2VfcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fb3JkZXJfc2l6ZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fb3JkZXJfc2l6ZSddKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlVHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICdleGNoYW5nZScpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT0gYmFsYW5jZVR5cGUpIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodXBwZ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PSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlcnMgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aWNrZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1tpXTtcbiAgICAgICAgICAgIGlmICgncGFpcicgaW4gdGlja2VyKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkID0gdGlja2VyWydwYWlyJ107XG4gICAgICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBmZXRjaFRpY2tlcnMoKSBmYWlsZWQgdG8gcmVjb2duaXplIHN5bWJvbCAnICsgaWQgKyAnICcgKyB0aGlzLmpzb24gKHRpY2tlcikpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoVGlja2VycygpIHJlc3BvbnNlIG5vdCByZWNvZ25pemVkICcgKyB0aGlzLmpzb24gKHRpY2tlcnMpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5j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2wgJyArIGlkICsgJyAnICsgdGhpcy5qc29uICh0aWNrZXIpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnaGlnaCddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdyddKSxcbiAgICAgICAgICAgICdiaWQnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2JpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2FzayddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF9wcmljZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogcGFyc2VGbG9hdCAodGlja2VyWydtaWQnXSksXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHBhcnNlRmxvYXQgKHRyYWRlWyd0aW1lc3RhbXAnXSkpICogMTAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICBsZXQgb3JkZXJJZCA9IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICdvcmRlcl9pZCcpO1xuICAgICAgICBsZXQgcHJpY2UgPSBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSk7XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB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JldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBvcmRlclR5cGUgPSB0eXBlO1xuICAgICAgICBpZiAoKHR5cGUgPT0gJ2xpbWl0JykgfHwgKHR5cGUgPT0gJ21hcmtldCcpKVxuICAgICAgICAgICAgb3JkZXJUeXBlID0gJ2V4Y2hhbmdlICcgKyB0eXBlO1xuICAgICAgICAvLyBhbW91bnQgPSB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudC50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ29jb29yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAnYnV5X3ByaWNlX29jbyc6IDAsXG4gICAgICAgICAgICAnc2VsbF9wcmljZV9vY28nOiAwLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgLy8gcHJpY2UgPSB0aGlzLnByaWNlVG9QcmVjaXNpb24gKHN5bWJvbCwgcHJpY2UpO1xuICAgICAgICAgICA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hbmdlID0gb3JkZXJbJ3N5bWJvbCddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgaWYgKGV4Y2hhbmdlIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtleGNoYW5nZV07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIGxldCBvcmRlclR5cGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICBsZXQgZXhjaGFuZ2UgPSBvcmRlclR5cGUuaW5kZXhPZiAoJ2V4Y2hhbmdlICcpID49IDA7XG4gICAgICAgIGlmIChleGNoYW5nZSkge1xuICAgICAgICAgICAgbGV0IFsgcHJlZml4LCBvcmRlclR5cGUgXSA9IG9yZGVyWyd0eXBlJ10uc3BsaXQgKCcgJyk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChwYXJzZUZsb2F0IChvcmRlclsndGltZXN0YW1wJ10pICogMTAwMCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJUeXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pLFxuICAgICAgICAgICAgJ2F2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cbiAgICAgICAgICAgICd3YWxsZXRfbmFtZSc6ICdleGNoYW5nZScsXG4gICAgICAgICAgICAncmVuZXcnOiAwLCAvLyBhIHZhbHVlIG9mIDEgd2lsbCBnZW5lcmF0ZSBhIG5ldyBhZGRyZXNzXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3REZXBvc2l0TmV3ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogcmVzcG9uc2VbJ2FkZHJlc3MnXSxcbiAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyB3aXRoZHJhdyAoY3VycmVuY3ksIGFtb3VudCwgYWRkcmVzcywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG5hbWUgPSB0aGlzLmdldEN1cnJlbmN5TmFtZSAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICd3aXRoZHJhd190eXBlJzogbmFtZSxcbiAgICAgICAgICAgICd3YWxsZXRzZWxlY3RlZCc6ICdleGNoYW5nZScsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiBhZGRyZXNzLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgcmVzcG9uc2VzID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHJlc3BvbnNlc1swXTtcbiAgICAgICAgcmV0dXJuIHtcbi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gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAgICAgJ3JlcXVlc3QnOiByZXF1ZXN0LFxuICAgICAgICAgICAgfSwgcXVlcnkpO1xuICAgICAgICAgICAgcXVlcnkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5lbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAocXVlcnkpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjIChwYXlsb2FkLCBzZWNyZXQsICdzaGEzODQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ1gtQkZYLUFQSUtFWSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdYLUJGWC1QQVlMT0FEJzogdGhpcy5kZWNvZGUgKHBheWxvYWQpLFxuICAgICAgICAgICAgICAgICdYLUJGWC1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID09IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ0tleSBwcmljZSBzaG91bGQgYmUgYSBkZWNpbWFsIG51bWJlcicpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZS5pbmRleE9mICgnSW52YWxpZCBvcmRlcjogbm90IGVub3VnaCBleGNoYW5nZSBiYWxhbmNlJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ0ludmFsaWQgb3JkZXInKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnICcgKyBtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1lc3NhZ2UuaW5kZXhPZiAoJ09yZGVyIGNvdWxkIG5vdCBiZSBjYW5jZWxsZWQuJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIG1lc3Nh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4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IGZhbHNlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMG0nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaCcsXG4gICAgICAgICAgICAgICAgJzNoJzogJzNoJyxcbiAgICAgICAgICAgICAgICAnNmgnOiAnNmgnLFxuICAgICAgICAgICAgICAgICcxMmgnOiAnMTJoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMUQnLFxuICAgICAgICAgICAgICAgICcxdyc6ICc3RCcsXG4gICAgICAgICAgICAgICAgJzJ3JzogJzE0RCcsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTUwMCxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjYyNDQtZTMyOGE1MGMtNWVkMi0xMWU3LTk0N2ItMDQxNDE2NTc5YmIzLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5iaXRmaW5leC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRmaW5leC5yZWFkbWUuaW8vdjIvZG9jcycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0ZmluZXhjb20vYml0ZmluZXgtYXBpLW5vZGUnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly93d3cuYml0ZmluZXguY29tL2ZlZXMnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGF0Zm9ybS9zdGF0dXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0ve3ByZWNpc2lvbn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUDMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0vUjAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbHNfZGV0YWlscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS97c2lkZX0ve3NlY3Rpb259JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0czEve2tleX06e3NpemV9OntzeW1ib2x9L2xvbmcvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9sb25nL2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXRzMS97a2V5fTp7c2l6ZX06e3N5bWJvbH0vc2hvcnQvbGFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMxL3trZXl9OntzaXplfTp7c3ltYm9sfS9zaG9ydC9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L3tzZWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy90cmFkZTp7dGltZWZyYW1lfTp7c3ltYm9sfS9sYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5kbGVzL3RyYWRlOnt0aW1lZnJhbWV9OntzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYWxjL3RyYWRlL2F2ZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlcnMve3N5bWJvbH0vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3Ivb3JkZXJzL3tzeW1ib2x9L2hpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9vcmRlci97c3ltYm9sfTp7aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3RyYWRlcy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9vZmZlcnMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgvci9mdW5kaW5nL29mZmVycy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy9sb2Fucy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvbG9hbnMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2Z1bmRpbmcvY3JlZGl0cy97c3ltYm9sfS9oaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvZnVuZGluZy90cmFkZXMve3N5bWJvbH0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2luZm8vbWFyZ2luL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvaW5mby9mdW5kaW5nL3trZXl9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhdXRoL3IvbW92ZW1lbnRzL3tjdXJyZW5jeX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL3N0YXRzL3BlcmY6e3RpbWVmcmFtZX0vaGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC9yL2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0L3NldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXV0aC93L2FsZXJ0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CxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJT1QnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVPJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUTSc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBVCc6IDEuMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1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KGFjY291bnRUeXBlID09IGJhbGFuY2VUeXBlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WzBdID09ICd0JylcbiAgICAgICAgICAgICAgICAgICAgY3VycmVuY3kgPSBjdXJyZW5jeS5zbGljZSAoMSk7XG4gICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgICAgIHVwcGVyY2FzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlICh1cHBlcmNhc2UpO1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGF2YWlsYWJsZTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdG90YWw7XG4gICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ2ZyZWUnXSlcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEJvb2tTeW1ib2xQcmVjaXNpb24gKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdwcmVjaXNpb24nOiAnUjAnLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2JpZHMnOiBbXSxcbiAgICAgICAgICAgICdhc2tzJzogW10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG9yZGVyYm9vay5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG9yZGVyID0gb3JkZXJib29rW2ldO1xuICAgICAgICAgICAgbGV0IHByaWNlID0gb3JkZXJbMV07XG4gICAgICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbMl07XG4gICAgICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPiAwKSA/ICdiaWRzJyA6ICdhc2tzJztcbiAgICAgICAgICAgIGFtb3VudCA9IE1hdGguYWJzIChhbW91bnQpO1xuICAgICAgICAgICAgcmVzdWx0W3NpZGVdLnB1c2ggKFsgcHJpY2UsIGFtb3VudCBdKTtcbiAgICAgICAgfVxuICAgICAgICByZXN1bHRbJ2JpZHMnXSA9IHRoaXMuc29ydEJ5IChyZXN1bHRbJ2JpZHMnXSwgMCwgdHJ1ZSk7XG4gICAgICAgIHJlc3VsdFsnYXNrcyddID0gdGhpcy5zb3J0QnkgKHJlc3VsdFsnYXNrcyddLCAwKTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxlbmd0aCA9IHRpY2tlci5sZW5ndGg7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyW2xlbmd0aCAtIDJdLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlcltsZW5ndGggLSAxXSxcbiAgICAgICAgICAgICdiaWQnOiB0aWNrZXJbbGVuZ3RoIC0gMTBdLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlcltsZW5ndGggLSA4XSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRpY2tlcltsZW5ndGggLSA0XSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB0aWNrZXJbbGVuZ3RoIC0gNl0sXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHRpY2tlcltsZW5ndGggLSA1XSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aWNrZXJbbGVuZ3RoIC0gM10sXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlcnMgKHN5bWJvbHMgPSB1bmRlZ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0aW1lc3RhbXAsIGFtb3VudCwgcHJpY2UgXSA9IHRyYWRlO1xuICAgICAgICBsZXQgc2lkZSA9IChhbW91bnQgPCAwKSA/ICdzZWxsJyA6ICdidXknO1xuICAgICAgICBpZiAoYW1vdW50IDwgMCkge1xuICAgICAgICAgICAgYW1vdW50ID0gLWFtb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQudG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHNpbmNlKSB7XG4gICAgICAgICAgICByZXF1ZXN0WydzdGFydCddID0gc2luY2U7XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGxpbWl0KSB7XG4gICAgICAgICAgICByZXF1ZXN0WydsaW1pdCddID0gbGltaXQ7XG4gICAgICAgIH1cbi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M6Ly9iaXRmbHllci5qcC9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRtYXJrZXRzJywgICAgLy8gb3IgJ21hcmtldHMnXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Ym9hcmQnLCAgICAgIC8vIG9yICdib2FyZCdcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR0aWNrZXInLCAgICAgLy8gb3IgJ3RpY2tlcidcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRleGVjdXRpb25zJywgLy8gb3IgJ2V4ZWN1dGlvbnMnXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0aGVhbHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRjaGF0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRwZXJtaXNzaW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0YmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y29sbGF0ZXJhbGFjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRhZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5pbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGNvaW5vdXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYW5rYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXR3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Y2hpbGRvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBhcmVudG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0cGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGV4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBvc2l0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0dHJhZGluZ2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbmRjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxjaGlsZG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kcGFyZW50b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbHBhcmVudG9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxhbGxjaGlsZG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsncHJvZHVjdF9jb2RlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbnVtQ3VycmVuY2llcyA9IGN1cnJlbmNpZXMubGVuZ3RoO1xuICAgICAgICAgICAgaWYgKG51bUN1cnJlbmNpZXMgPT0gMSkge1xuICAgICAgICAgICAgICAgIGJhc2UgPSBzeW1ib2wuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gc3ltYm9sLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobnVtQ3VycmVuY2llcyA9PSAyKSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGN1cnJlbmNpZXNbMF07XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBjdXJyZW5jaWVzWzFdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgYmFzZSA9IGN1cnJlbmNpZXNbMV07XG4gICAgICAgICAgICAgICAgcXVvdGUgPSBjdXJyZW5jaWVzWzJdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCByZXNwb25zZS5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSByZXNwb25zZVtiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGFjY291bnRbJ2N1cnJlbmN5X2NvZGUnXTtcbiAgICAgICAgICAgIGJhbGFuY2VzW2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAg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J10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG9yZGVyID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ3NpZGUnIGluIHRyYWRlKVxuICAgICAgICAgICAgaWYgKHRyYWRlWydzaWRlJ10pIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gdHJhZGVbJ3NpZGUnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBzaWRlICsgJ19jaGlsZF9vcmRlcl9hY2NlcHRhbmNlX2lkJztcbiAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdHJhZGUpXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyID0gdHJhZGVbaWRdO1xuICAgICAgICAgICAgfVxuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydleGVjX2RhdGUnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3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dlX2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVxdWVzdCA9ICcvJyArIHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpXG4gICAgICAgICAgICByZXF1ZXN0ICs9ICdtZS8nO1xuICAgICAgICByZXF1ZXN0ICs9IHBhdGg7XG4gICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgcmVxdWVzdCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArIHJlcXVlc3Q7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBbIG5vbmNlLCBtZXRob2QsIHJlcXVlc3QsIGJvZHkgXS5qb2luICgnJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBQ0NFU1MtS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FDQ0VTUy1USU1FU1RBTVAnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQUNDRVNTLVNJR04nOiB0a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gICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDU5NzE3Ny1lYTgwMDE3Mi05ZDVlLTExZTctODA0Yy1iOWQ0ZmE5YjU2YjAuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tL3B1YmxpYycsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJpdGh1bWIuY29tJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuYml0aHVtYi5jb20vdTEvVVMxMjcnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tjdXJyZW5jeX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vay9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY2VudF90cmFuc2FjdGlvbnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVjZW50X3RyYW5zYWN0aW9ucy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3dhbGxldF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mby9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8vdXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3BsYWNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL29yZGVyX2RldGFpbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9idGNfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUva3J3X2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2tyd193aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZS9tYXJrZXRfc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlckFsbCAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAobWFya2V0c1snZGF0YSddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBpZiAoaWQgIT0gJ2RhdGUnKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVtpZF07XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBpZDtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSAnS1JXJztcbiAgICAgICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAgICAgJ2xvdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm9CYWxhbmNlICh0aGlzLmV4dGVuZCAoe1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GwgKHBhcmFtcyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHJlc3BvbnNlWydkYXRhJ11bJ2RhdGUnXTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSB0aGlzLm9taXQgKHJlc3BvbnNlWydkYXRhJ10sICdkYXRlJyk7XG4gICAgICAgIGxldCBpZHMgPSBPYmplY3Qua2V5cyAodGlja2Vycyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHRpY2tlclsnZGF0ZSddID0gdGltZXN0YW1wO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGlj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ubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZVBvc3QnO1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgICAgICdvcmRlcl9jdXJyZW5jeSc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgICAgICAgICAnUGF5bWVudF9jdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAndW5pdHMnOiBhbW91bnQsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAgICAgJ3R5cGUnOiAoc2lkZSA9PSAnYnV5JykgPyAnYmlkJyA6ICdhc2snLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnVHJhZGVQbGFjZSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAgICAgJ3VuaXRzJzogYW1vdW50LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0JyArIHRoaXMuY2FwaXRhbGl6ZSAoc2lkZSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdvcmRlcl9pZCcgaW4gcmVzcG9uc2UpIHtcbiAgICAgIC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ZTctODM5ZC0wMGE4NDYzODVkMGIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYml0bGlzaC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0bGlzaC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9iaXRsaXNoLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMyAvIDEwMCwgLy8gYW5vbnltb3VzIDAuMyUsIHZlcmlmaWVkIDAuMiVcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb2hsY3YnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29obGN2JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXNfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHNfb3BlcmF0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfdHJhZGVzX2J5X2lkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2FsbF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZV9iY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RlbXBsYXRlX3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlX3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2FjY291bnRzX29wZXJhdGlvbnNfZnJvbV90cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9hY3RpdmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X2Jjb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9teV9tYXRjaGVzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfbXlfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X215X3RyYWRzX2Zyb21fdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3RfcGF5bWVudF9tZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X3BheW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW1fY29kZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVzaWduJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzaWduaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NpZ25vdXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2RldGFpbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX29wdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19ieV9pZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKCF0aGlzLnN1YnN0aXR1dGVDb21tb25DdXJyZW5jeUNvZGVzKVxuICAgICAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hCVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JUQyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQkNDJylcbiAgICAgICAgICAgIHJldHVybiAnQkNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEUksnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEU0gnKVxuICAgICAgICAgICAgY3VycmVuY3kgPSAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWERHJylcbiAgICAgICAgICAgIGN1cnJlbmN5ID0gJ0RPR0UnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2tleXNbcF1dO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWF4JyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21pbicpLFxuICAgICAgICAgICAgJ2JpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhc2snOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2ZpcnN0JyksXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAncHJjJyksXG4gICAgICAgICAgIC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ICAgICAgbGV0IGFjY291bnQgPSByZXNwb25zZVtjdXJyZW5jeV07XG4gICAgICAgICAgICBjdXJyZW5jeSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgLy8gaXNzdWUgIzQgYml0bGlzaCBuYW1lcyBEYXNoIGFzIERTSCwgaW5zdGVhZCBvZiBEQVNIXG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0RTSCcpXG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSAnREFTSCc7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hERycpXG4gICAgICAgICAgICAgICAgY3VycmVuY3kgPSAnRE9HRSc7XG4gICAgICAgICAgICBiYWxhbmNlW2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2Z1bmRzJ10pO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbY3VycmVuY3ldWydob2xkZWQnXSk7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgc2lnbkluICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMucHJpdmF0ZVBvc3RTaWduaW4gKHtcbiAgICAgICAgICAgICdsb2dpbic6IHRoaXMubG9naW4sXG4gICAgICAgICAgICAncGFzc3dkJzogdGhpcy5wYXNzd29yZCxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgY3JlYXRlT3JkZXIgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ3BhaXJfaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2Rpcic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKVxuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDcmVhdGVUcmFkZSAodGhpcy5leHRlbmQgKG9yZGVyLCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzdWx0LFxuICAgICAgICAgICAgJ2lkJzogcmVzdWx0WydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPS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Z2VfaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy52ZXJzaW9uICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgaGVhZGVycyA9IHsgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyB9O1xuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh0aGlzLmV4dGVuZCAoeyAndG9rZW4nOiB0aGlzLmFwaUtleSB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn1c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zFtJyxcbiAgICAgICAgICAgICAgICAnM00nOiAnM20nLFxuICAgICAgICAgICAgICAgICc2TSc6ICc2bScsXG4gICAgICAgICAgICAgICAgJzF5JzogJzF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY3MjU2LWE4NTU1MjAwLTVlZjktMTFlNy05NmZkLTQ2OWE2NWUyYjBiZC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmJpdG1hcmtldC5wbC9hcGkyLycsIC8vIGxhc3Qgc2xhc2ggaXMgY3JpdGljYWxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQucGwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWFya2V0Lm5ldC9kb2NzLnBocD9maWxlPWFwaV9wdWJsaWMuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5iaXRtYXJrZXQubmV0L2RvY3MucGhwP2ZpbGU9YXBpX3ByaXZhdGUuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYml0bWFya2V0LW5ldC9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24ve21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqc29uL3ttYXJrZXR9L29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnanNvbi97bWFya2V0fS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2pzb24vY3RyYW5zZmVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vOTBtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vNmgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8xZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzdkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyYXBocy97bWFya2V0fS8zbScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ3JhcGhzL3ttYXJrZXR9LzZtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdncmFwaHMve21hcmtldH0vMXknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ2Rlc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdkZXNrU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nZGVza0NvbmZpcm0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyeXB0b3RyYWRpbmdkZXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG90cmFkaW5nZGVza1N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3J5cHRvdHJhZGluZ2Rlc2tDb25maXJtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdGaWF0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd1BMTlBQJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd0ZpYXRGYXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5MaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5PcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5DbG9zZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQ2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5Nb2RpZnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VBZGQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmdpbkJhbGFuY2VSZW1vdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N3YXBMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzd2FwT3BlbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3dhcENsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCQ0gvUExOJzogeyAnaWQnOiAnQkNDUExOJywgJ3N5bWJvbCc6ICdCQ0gvUExOJywgJ2Jhc2UnOiAnQkNIJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQlRHL1BMTic6IHsgJ2lkJzogJ0JUR1BMTicsICdzeW1ib2wnOiAnQlRHL1BMTicsICdiYXNlJzogJ0JURycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdCVENQTE4nLCAnc3ltYm9sJzogJ0JUQy9QTE4nLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnUExOJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicgfSxcbiAgICAgICAgICAgICAgICAnTFRDL1BMTic6IHsgJ2lkJzogJ0xUQ1BMTicsICdzeW1ib2wnOiAnTFRDL1BMTicsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdQTE4nIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9CVEMnOiB7ICdpZCc6ICdMVENCVEMnLCAnc3ltYm9sJzogJ0xUQy9CVEMnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQlRDJyB9LFxuICAgICAgICAgICAgICAgICdMaXRlTWluZVgvQlRDJzogeyAnaWQnOiAnTGl0ZU1pbmVYQlRDJywgJ3N5bWJvbCc6ICdMaXRlTWluZVgvQlRDJywgJ2Jhc2UnOiAnTGl0ZU1pbmVYJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40NSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjQ1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuNDQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuNDMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuNDIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuNDEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjQwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC4zOSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTkuOTksIDAuMzggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTk5Ljk5LCAwLjM3IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuMzYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OS45OSwgMC4zNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQ5OTk5Ljk5LCAwLjM0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMzMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5OTkuOTksIDAuMzIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTk5OTkuOTksIDAuMzEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjE1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTkuOTksIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyOTkuOTksIDAuMTMgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTkuOTksIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs5OTkuOTksIDAuMTEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxOTk5Ljk5LCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OS45OSwgMC45IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDk5OS45OSwgMC44IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OS45OSwgMC43IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTk5OTkuOTksIDAuNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzI5OTk5Ljk5LCAwLjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OS45OSwgMC40IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbOTk5OTkuOTksIDAuMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzE5OTk5OS45OSwgMC4yIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjk5OTk5Ljk5LCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0OTk5OTkuOTksIDAuMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExOJzogMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMiwgLy8gU0VQQS4gVHJhbnNmZXIgSU5UIChTSEEpOiA1IEVVUlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMTic6IDAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEluZm8gKCk7XG4gICAgICAgIGxldCBkYXRhID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBkYXRhWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGRhdGEgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZVsnYXZhaWxhYmxlJ10pXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZVsnYXZhaWxhYmxlJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2Jsb2NrZWQnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlWydibG9ja2VkJ11bY3VycmVuY3ldO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0SnNvbk1hcmtldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2JpZHMnOiBvcmRlcmJvb2tbJ2JpZHMnXSxcbiAgICAgICAgICAgICdhc2tzJzogb3JkZXJib29rWydhc2tzJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmF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QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsndHlwZSddID09ICdiaWQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZm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WlyZXMgYWNjb3VudCBwYXJhbWV0ZXIgdG8gd2l0aGRyYXcgZmlhdCBjdXJyZW5jeScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdhY2NvdW50MicgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICAgICAgcmVxdWVzdFsnYWNjb3VudDInXSA9IHBhcmFtc1snYWNjb3VudDInXTsgLy8gYmFuayBTV0lGVCBjb2RlIChFVVIgb25seSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdFVVInKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgYWNjb3VudDIgcGFyYW1ldGVyIHRvIHdpdGhkcmF3IEVVUicpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCd3aXRoZHJhd2FsX25vdGUnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHJlcXVlc3RbJ3dpdGhkcmF3YWxfbm90ZSddID0gcGFyYW1zWyd3aXRoZHJhd2FsX25vdGUnXTsgLy8gYSAxMC1jaGFyYWN0ZXIgdXNlci1zcGVjaWZpZWQgd2l0aGRyYXdhbCBub3RlIChQTE4gb25seSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdQTE4nKVxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgd2l0aGRyYXdhbF9ub3RlIHBhcmFtZXRlciB0byB3aXRoZHJhdyBQTE4nKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1ldGhvZCA9ICdwcml2YXRlUG9zdFdpdGhkcmF3JztcbiAgICAgICAgICAgIHJlcXVlc3RbJ2FkZHJlc3MnXSA9IGFkZHJlc3M7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAocmVxdWVzdCwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2UsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwdWJsaWMnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoICsgJy5qc29uJywgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ3RvbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUEktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FQSS1IYXNoJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXM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YXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMW0nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bScsXG4gICAgICAgICAgICAgICAgJzFoJzogJzFoJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICd0ZXN0JzogJ2h0dHBzOi8vdGVzdG5ldC5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzE5LWY2NTNjNmU2LTVlZDQtMTFlNy05MzNkLWYwYmMzNjk5YWU4Zi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5iaXRtZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuYml0bWV4LmNvbS9hcHAvYXBpT3ZlcnZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdE1FWC9hcGktY29ubmVjdG9ycy90cmVlL21hc3Rlci9vZmZpY2lhbC1odHRwJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhbm5vdW5jZW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fubm91bmNlbWVudC91cmdlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2FjdGl2ZUFuZEluZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3RydW1lbnQvYWN0aXZlSW50ZXJ2YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2NvbXBvc2l0ZUluZGV4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbnN0cnVtZW50L2luZGljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luc3VyYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGVhZGVyYm9hcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vay9MMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzY2hlbWEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NjaGVtYS93ZWJzb2NrZXRIZWxwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZXR0bGVtZW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL2J1Y2tldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jaGFubmVscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2hhdC9jb25uZWN0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhlY3V0aW9uL3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbm90aWZpY2F0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWZmaWxpYXRlU3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NoZWNrUmVmZXJyYWxDb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWFyZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21pbldpdGhkcmF3YWxGZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldEhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXBpS2V5L2Rpc2FibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9idWxrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jYW5jZWxBbGxBZnRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2xvc2VQb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vaXNvbGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uL3Jpc2tMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vdHJhbnNmZXJNYXJnaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY2FuY2VsV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtRW1haWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvY29uZmlybUVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jb25maXJtV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9kaXNhYmxlVEZBJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dvdXRBbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJlZmVyZW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcmVxdWVzdEVuYWJsZVRGQScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9yZXF1ZXN0V2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2J1bGsnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FwaUtleScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRJbnN0cnVtZW50QWN0aXZlQW5kSW5kaWNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ3N0YXRlJ10gIT0gJ1VubGlzdGVkJyk7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3VuZGVybHlpbmcnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgZnV0dXJlID0gZmFsc2U7XG4gICAgICAgICAgICBsZXQgcHJlZGljdGlvbiA9IGZhbHNlO1xuICAgICAgICAgICAgbGV0IGJhc2VxdW90ZSA9IGJhc2UgKyBxdW90ZTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3dhcCA9IChpZCA9PSBiYXNlcXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWYgKHN3YXApIHtcbiAgICAgICAgICAgICAgICB0eXBlID0gJ3N3YXAnO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaWQuaW5kZXhPZiAoJ0JfJykgPj0gMCkge1xuICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gPSB0cnVlO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAncHJlZGljdGlvbic7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZ1dHVyZSA9IHRydWU7XG4gICAgICAgICAgICAgICAgdHlwZSA9ICdmdXR1cmUnO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1ha2VyID0gbWFya2V0WydtYWtlckZlZSddO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gbWFya2V0Wyd0YWtlckZlZSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICAgICAnc3BvdCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdzd2FwJzogc3dhcCxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZnV0dXJlLFxuICAgICAgICAgICAgICAgICdwcmVkaWN0aW9uJzogcHJlZGljdGlvbixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyTWFyZ2luICh7ICdjdXJyZW5jeSc6ICdhbGwnIH0pO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgcmVzcG9uc2UubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcmVzcG9uc2VbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgY3VycmVuY3kgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVNYXJnaW4nXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydhbW91bnQnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JUQycpIHtcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBhY2NvdW50WydmcmVlJ10gKiAwLjAwMDAwMDAxO1xuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBhY2NvdW50Wyd0b3RhbCddICogMC4wMDAwMDAwMTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rTDIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnc3ltYm9sJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICA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ddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0IChxdW90ZVsnYXNrUHJpY2UnXSksXG4gICAgICAgICAgICAndndhcCc6IHBhcnNlRmxvYXQgKHRpY2tlclsndndhcCddKSxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogcGFyc2VGbG9hdCAodGlja2VyWydjbG9zZSddKSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnaG9tZU5vdGlvbmFsJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWydmb3JlaWduTm90aW9uYWwnXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID0gdW5kZWZpbmVkLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxIChvaGxjdlsndGltZXN0YW1wJ10pO1xuICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgdGltZXN0YW1wLFxuICAgICAgICAgICAgb2hsY3ZbJ29wZW4nXSxcbiAgICAgICAgICAgIG9obGN2WydoaWdoJ10sXG4gICAgICAgICAgICBvaGxjdlsnbG93J10sXG4gICAgICAgICAgICBvaGxjdl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1NicsIC8vIHJlcXVpcmVzIGlmIHR3by1mYWN0b3IgYXV0aCAoT1RQKSBpcyBlbmFibGVkXG4gICAgICAgICAgICAvLyAnZmVlJzogMC4wMDEsIC8vIGJpdGNvaW4gbmV0d29yayBmZWVcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFVzZXJSZXF1ZXN0V2l0aGRyYXdhbCAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWyd0cmFuc2FjdElEJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID49IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHkpIHtcbiAgICAgICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2VbJ2Vycm9yJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGFuIGVtcHR5IHJlc3BvbnNlJyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBxdWVyeSA9ICcvYXBpJyArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICBxdWVyeSArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyBxdWVyeTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbWV0aG9kICsgcXVlcnkgKyBub25jZTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7X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kJzogJ2JpdHNvJyxcbiAgICAgICAgICAgICduYW1lJzogJ0JpdHNvJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnTVgnLCAvLyBNZXhpY29cbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAyMDAwLCAvLyAzMCByZXF1ZXN0cyBwZXIgbWludXRlXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MycsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzM1LTcxNWNlN2FhLTVlZDUtMTFlNy04OGE4LTE3M2EyN2JiMzBmZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuYml0c28uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYml0c28uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYml0c28uY29tL2FwaV9pbmZvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXZhaWxhYmxlX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50X3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmVlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmdzL3tmaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nX2Rlc3RpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdreWNfZG9jdW1lbnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci9mZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZWRnZXIvZnVuZGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlZGdlci93aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXhfYmFua19jb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3RyYWRlcy97b2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tvaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFkZXMve3RpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve3dpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlYml0X2NhcmRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwaG9uZV9udW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bob25lX3ZlcmlmaWNhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGhvbmVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3BlaV93aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve29pZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0QXZhaWxhYmxlQm9va3MgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzWydwYXlsb2FkJ10ubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydwYXlsb2FkJ11baV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Jvb2snXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC50b1VwcGVyQ2FzZSAoKS5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogcGFyc2VGbG9hdCAobWFya2V0WydtaW5pbXVtX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV9hbW91bnQnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pbmltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21heGltdW1fcHJpY2UnXSksXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21pbic6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWluaW11bV92YWx1ZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4aW11bV92YWx1ZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHRoaXMucHJlY2lzaW9uRnJvbVN0cmluZyAobWFya2V0WydtaW5pbXVtX2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluaW11bV9wcmljZSddKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gbGltaXRzWydhbW91bnQnXVsnbWluJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydwYXlsb2FkJ11bJ2JhbGFuY2VzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGJhbGFuY2VbJ2N1cnJlbmN5J10udG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddKSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IHBhcnNlRmxvYXQgK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lcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydjcmVhdGVkX2F0J10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdib29rJyBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2Jvb2snXV07XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ21ha2VyX3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdib29rJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydwYXlsb2FkJ10sIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnYm9vayc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnbWFqb3InOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdsaW1pdCcpXG4gICAgICAgICAgICBvcmR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2ZXJzaW9uJzogJ3YyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAnaGFzV2l0aGRyYXcnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc4NjM3Ny04YzhhYjU3ZS01ZmU5LTExZTctOGVhNC0yYjA1YjZiY2NlZWMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldC9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYml0c3RhbXAubmV0JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldC9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcl9ob3VyL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZy1wYWlycy1pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2Uve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmNoX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY2hfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMvYWxsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfc3RhdHVzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS9tYXJrZXQve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL21hcmtldC97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsdGNfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2x0Y19hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoX3dpdGhkcmF3YWwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldGhfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyLXRvLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2Zlci1mcm9tLW1haW4vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JpcHBsZV9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9vcGVuLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbC9zdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FsL2NhbmNlbC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpcXVpZGF0aW9uX2FkZHJlc3MvbmV3LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlxdWlkYXRpb25fYWRkcmVzcy9pbmZvLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAndjEnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fZGVwb3NpdF9hZGRyZXNzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl93aXRoZHJhd2FsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI1IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs0MDAwMDAsIDAuMjAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs2MDAwMDAsIDAuMTUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMCwgMC4xMyAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMDAsIDAuMTIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwMCwgMC4xMSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAxLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAsIDAuMjUgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMCwgMC4yNCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMCwgMC4yMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzQwMDAwMCwgMC4yMCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzYwMDAwMCwgMC4xNSAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMTQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyMDAwMDAwLCAwLjEzIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNDAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzIwMDAwMDAwLCAwLjExIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjAwMDAwMDEsIDAuMTAgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuOTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hSUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRpbmdQYWlyc0luZm8gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBtYXJrZXRbJ25hbWUnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gYmFzZS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sSWQgPSBiYXNlSWQgKyAnXycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0Wyd1cmxfc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ2Jhc2VfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ2NvdW50ZXJfZGVjaW1hbHMnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgWyBjb3N0LCBjdXJyZW5jeSBdID0gbWFya2V0WydtaW5pbXVtX29yZGVyJ10uc3BsaXQgKCcgJyk7XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gKG1hcmtldFsndHJhZGluZyddID09ICdFbmFibGVkJyk7XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2xJZCc6IHN5bWJvbElkLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChjb3N0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJCb29rUGFpciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAob3JkZXJib29rWyd0aW1lc3RhbXAnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB0aW1lc3RhbXApO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICA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7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5lbmNvZGUgKHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSk7XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLC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IGNsYXNzIGJpdHN0YW1wMSBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdiaXRzdGFtcDEnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQml0c3RhbXAgdjEnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdHQicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3ODYzNzctOGM4YWI1N2UtNWZlOS0xMWU3LThlYTQtMmIwNWI2YmNjZWVjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJpdHN0YW1wLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5iaXRzdGFtcC5uZXQvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfaG91cicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdldXJfdXNkJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfYWxsX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndW5jb25maXJtZWRfYnRjJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyaXBwbGVfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmlwcGxlX2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxfcmVxdWVzdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgIC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RlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnb25lTWluJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnZml2ZU1pbicsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICd0aGlydHlNaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICdob3VyJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnZGF5JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2MzUyLWNmMGIzYzI2LTVlZDUtMTFlNy04MmI3LWYzODI2YjdhOTdkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JpdHRyZXguY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdtYXJrZXQnOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAndjInOiAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9hcGkvdjIuMC9wdWInLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2JpdHRyZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9Ib21lL0FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5ucG1qcy5vcmcvcGFja2FnZS9ub2RlLmJpdHRyZXguYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXR0cmV4LmNvbS9GZWVzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5iaXR0cmV4LmNvbS9oYy9lbi11cy9hcnRpY2xlcy8xMTUwMDAxOTk2NTEtV2hhdC1mZWVzLWRvZXMtQml0dHJleC1jaGFyZ2UtJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3YyJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMvR2V0QlRDUHJpY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9HZXRUaWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L0dldExhdGVzdFRpY2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01hcmtldHMvR2V0TWFya2V0U3VtbWFyaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvR2V0TGF0ZXN0VGljaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHN1bW1hcmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0c3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2FjY291bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRhZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0aGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbGhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdtYXJrZXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVub3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxtYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0cnVlLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwMjUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkREJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JERCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgY29zdCkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoY29zdCksIHRoaXMubWFya2V0c1tzeW1ib2xdWydwcmVjaXNpb24nXVsncHJpY2UnXSk7XG4gICAgfVxuXG4gICAgZmVlVG9QcmVjaXNpb24gKHN5bWJvbCwgZmVlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnRydW5jYXRlIChwYXJzZUZsb2F0IChmZWUpLCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudjJHZXRNYXJrZXRzR2V0TWFya2V0U3VtbWFyaWVzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVzcG9uc2VbJ3Jlc3VsdCddLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gcmVzcG9uc2VbJ3Jlc3VsdCddW2ldWydNYXJrZXQnXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ01hcmtldEN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ0Jhc2VDdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IG1hcmtldFsnSXNBY3RpdmUnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydNaW5UcmFkZVNpemUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuYWNjb3VudEdldEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGluZGV4ZWQgPSB0aGlzLmluZGV4QnkgKGJhbGFuY2VzLCAnQ3VycmVuY3knKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoaW5kZXhlZCk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChpZCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gaW5kZXhlZFtpZF07XG4gICAgICAgICAgICBsZXQgZnJlZSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0F2YWlsYWJsZSddKTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ0JhbGFuY2UnXSk7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHRvdGFsIC0gZnJlZTtcbiAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IGZyZWU7XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSB1c2VkO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRvdGFsO1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGlmICgndHlwZScgaW4gcGFyYW1zKSB7XG4gICAgICAgICAgICBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAgICAgICAgICdidXknOiByZXNwb25zZVsncmVzdWx0J10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogW10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyYW1zWyd0eXBlJ10gPT0gJ3NlbGwnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJib29rID0ge1xuICAgICAgICAgICAgICAgICAgICAnYnV5JzogW10sXG4gICAgICAgICAgICAgICAgICAgICdzZWxsJzogcmVzcG9uc2VbJ3Jlc3VsdCddLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYnV5JywgJ3NlbGwnLCAnUmF0ZScsICdRdWFudGl0eScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnVGltZVN0YW1wJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnSGlnaCcpLFxuICAgICAgICAgIC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ZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydDdXJyZW5jeSddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlXSA9IHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnY29kZSc6IGNvZGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICAgICAnbmFtZSc6IGN1cnJlbmN5WydDdXJyZW5jeUxvbmcnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogY3VycmVuY3lbJ0lzQWN0aXZlJ10sXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5WydUeEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ1R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXJzIChzeW1ib2xzID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHN1bW1hcmllcyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCB0aWNrZXJzLmxlbmd0aDsgdCsrKSB7XG4gICAgICAgICAgICBsZXQgdGlja2VyID0gdGlja2Vyc1t0XTtcbiAgICAgICAgICAgIGxldCBpZCA9IHRpY2tlclsnTWFya2V0TmFtZSddO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBbIHF1b3RlLCBiYXNlIF0gPSBpZC5zcGxpdCAoJy0nKTtcbiAgICAgICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgICAgICBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzdW1tYXJ5ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J11bMF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lU3RhbXAnXSk7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdCVVknKSB7XG4gICAgICAgICAgICBzaWRlID0gJ2J1eSc7XG4gICAgICAgIH0gZWxzZSBpZiAodHJhZGVbJ09yZGVyVHlwZSddID09ICdTRUxMJykge1xuICAgICAgICAgICAgc2lkZSA9ICdzZWxsJztcbiAgICAgICAgfVxuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnSWQnIGluIHRyYWRlKVxuICAgICAgICAgICAgaWQgPSB0cmFkZVsnSWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0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CxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdtZXNzYWdlJyk7XG4gICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT0gJ09SREVSX05PVF9PUEVOJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSA9PSAnVVVJRF9JTlZBTElEJylcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE9yZGVyTm90Rm91bmQgKHRoaXMuaWQgKyAnIGNhbmNlbE9yZGVyKCkgZXJyb3I6ICcgKyB0aGlzLmxhc3RfaHR0cF9yZXNwb25zZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ09yZGVyVHlwZScgaW4gb3JkZXIpXG4gICAgICAgICAgICBzaWRlID0gKG9yZGVyWydPcmRlclR5cGUnXSA9PSAnTElNSVRfQlVZJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgaWYgKCdUeXBlJyBpbiBvcmRlcilcbiAgICAgICAgICAgIHNpZGUgPSAob3JkZXJbJ1R5cGUnXSA9PSAnTElNSVRfQlVZJykgPyAnYn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ICBjb21taXNzaW9uID0gJ0NvbW1pc3Npb24nO1xuICAgICAgICB9IGVsc2UgaWYgKCdDb21taXNzaW9uUGFpZCcgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGNvbW1pc3Npb24gPSAnQ29tbWlzc2lvblBhaWQnO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb21taXNzaW9uKSB7XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBwYXJzZUZsb2F0IChvcmRlcltjb21taXNzaW9uXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgcHJpY2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdMaW1pdCcpO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ1ByaWNlJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdRdWFudGl0eScpO1xuICAgICAgICBsZXQgcmVtYWluaW5nID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnUXVhbnRpdHlSZW1haW5pbmcnLCAwLjApO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBpZiAoIWNvc3QpIHtcbiAgICAgICAgICAgIGlmIChwcmljZSAmJiBhbW91bnQpXG4gICAgICAgICAgICAgICAgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICB9XG4gICAgICAgIGlmICghcHJpY2UpIHtcbiAgICAgICAgICAgIGlmIChjb3N0ICYmIGZpbGxlZClcbiAgICAgICAgICAgICAgICBwcmljZSA9IGNvc3QgLyBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdQcmljZVBlclVuaXQnKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiBvcmRlclsnT3JkZXJVdWlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBhdmVyYWdlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRPcmRlciAodGhpcy5leHRlbmQgKHsgJ3V1aWQnOiBpZCB9LCBwYXJhbXMpKTtcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKHRoa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JpbmcgKHJlc3BvbnNlLCAnbWVzc2FnZScpO1xuICAgICAgICBsZXQgc3RhdHVzID0gJ29rJztcbiAgICAgICAgaWYgKCFhZGRyZXNzIHx8IG1lc3NhZ2UgPT0gJ0FERFJFU1NfR0VORVJBVElORycpXG4gICAgICAgICAgICBzdGF0dXMgPSAncGVuZGluZyc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgICdhZGRyZXNzJzogYWRkcmVzcyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIHdpdGhkcmF3IChjdXJyZW5jeSwgYW1vdW50LCBhZGRyZXNzLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgY3VycmVuY3lJZCA9IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmFjY291bnRHZXRXaXRoZHJhdyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5SWQsXG4gICAgICAgICAgICAncXVhbnRpdHknOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgncmVzdWx0JyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCd1dWlkJyBpbiByZXNwb25zZVsncmVzdWx0J10pXG4gICAgICAgICAgICAgICAgaWQgPSByZXNwb25zZVsncmVzdWx0J11bJ3V1aWQnXTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ11bYXBpXSArICcvJztcbiAgICAgICAgaWYgKGFwaSAhPSAndjInKVxuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9IGFwaSArICcvJyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArIHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ3YyJykge1xuICAgICAgICAgICAgdXJsICs9IHBhdGg7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHVybCArPSBhcGkgKyAnLyc7XG4gICAgICAgICAgICBpZiAoKChhcGkgPT0gJ2FjY291bnQnKSAmJiAocGF0aCAhPSAnd2l0aGRyYXcnKSkgfHwgKHBhdGggPT0gJ29wZW5vcmRlcnMnKSlcbiAgICAgICAgICAgICAgICB1cmwgKz0gbWV0aG9kLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnPycgKyB0aGlzLnVybGVuY29kZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlICh1cmwpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnYXBpc2lnbic6IHNpZ25hdHVyZSB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID49IDQwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcmVzcG9uc2VbJ3N1Y2Nlc3MnXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZVsnbWVzc2FnZSddID09ICdJTlNVRkZJQ0lFTlRfRlVORFMnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydtZXNzYWdlJ10gPT0gJ01JTl9UUkFERV9SRVFVSVJFTUVOVF9OT1RfTUVUJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnQVBJS0VZX0lOVkFMSUQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmhhc0FscmVhZHlBdXRoZW50aWNhdGVkU3VjY2Vzc2Z1bGx5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRERvU1Byb3RlY3Rpb24gKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnRFVTVF9UUkFERV9ESVNBTExPV0VEX01JTl9WQUxVRV81MEtfU0FUJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgb3JkZXIgY29zdCBzaG91bGQgYmUgb3ZlciA1MGsgc2F0b3NoaSAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAvLyBhIHdvcmthcm91bmQgZm9yIEFQSUtFWV9JTlZBTElEXG4gICAgICAgICAgICAgICAgaWYgKChhcGkgPT0gJ2FjY291bnQnKSB8fCAoYXBpID09ICdtYXJrZXQnKSlcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5oYXNBbHJlYWR5QXV0aGVudGljYXRlZFN1Y2Nlc3NmdWxseSA9IHRydWU7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAg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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBibDNwIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2JsM3AnLFxuICAgICAgICAgICAgJ25hbWUnOiAnQkwzUCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnTkwnLCAnRVUnIF0sIC8vIE5ldGhlcmxhbmRzLCBFVVxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdjb21tZW50JzogJ0FuIGV4Y2hhbmdlIG1hcmtldCBieSBCaXRvbmljTkwnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjg1MDE3NTItNjBjMjFiODItNmZlYi0xMWU3LTgxOGItMDU1ZWU2ZDBlNzU0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9ibDNwLmV1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYml0b25pYy5ubCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL0JpdG9uaWNOTC9ibDNwLWFwaS90cmVlL21hc3Rlci9kb2NzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vYmwzcC5ldS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9iaXRvbmljLm5sL2VuL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvZGVwdGgvZnVsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXIvYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlci9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ttYXJrZXR9L21vbmV5L29yZGVyL3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7bWFya2V0fS9tb25leS9vcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0vbW9uZXkvdHJhZGVzL2ZldGNoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHRU5NS1QvbW9uZXkvaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L25ld19kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dFTk1LVC9tb25leS93YWxsZXQvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR0VOTUtUL21vbmV5L3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvRVVSJzogeyAnaWQnOiAnQlRDRVVSJywgJ3N5bWJvbCc6ICdCVEMvRVVSJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0VVUicsICdtYWtlcic6IDAuMDAyNSwgJ3Rha2VyJzogMC4wMDI1IH0sXG4gICAgICAgICAgICAgICAgLy8gJ0xUQy9FVVInOiB7ICdpZCc6ICdMVENFVVInLCAnc3ltYm9sJzogJ0xUQy9FVVInLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R0VOTUtUTW9uZXlJbmZvICgpO1xuICAgICAgICBsZXQgZGF0YSA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBiYWxhbmNlID0gZGF0YVsnd2FsbGV0cyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGRhdGEgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjdXJyZW5jaWVzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gYmFsYW5jZSkge1xuICAgICAgICAgICAgICAgIGlmICgnYXZhaWxhYmxlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlW2N1cnJlbmN5XVsnYXZhaWxhYmxlJ11bJ3ZhbHVlJ10pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdiYWxhbmNlJyBpbiBiYWxhbmNlW2N1cnJlbmN5XSkge1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVtjdXJyZW5jeV1bJ2JhbGFuY2UnXVsndmFsdWUnXSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10pIHtcbiAgICAgICAgICAgICAgICBpZiAoYWNjb3VudFsnZnJlZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ3VzZWQnXSA9IGFjY291bnRbJ3RvdGFsJ10gLSBhY2NvdW50WydmcmVlJ107XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9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V0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVsnMjRoJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10sXG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W1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHJlcXVlc3Q7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoeyAnbm9uY2UnOiBub25jZSB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gcmVxdWVzdCArIFwiXFwwXCIgKyBib2R5O1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCBzZWNyZXQsICdzaGE1MTInLCAnYmFzZTY0Jyk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnUmVzdC1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnUmVzdC1TaWduJzogc2lnbmF0dXJlLFxuIC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udGVudC5jb20vMTI5NDQ1NC8zMDMwMzAwMC1iNjAyZGJlNi05NzZkLTExZTctOTU2ZC0zNmM1MDQ5YzAxZTcuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ21hcmtldCc6ICdodHRwczovL2JsZXV0cmFkZS5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9ibGV1dHJhZGUuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYmxldXRyYWRlLmNvbS9oZWxwL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ3Jlc3VsdCddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sncmVzdWx0J11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ01hcmtldE5hbWUnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydNYXJrZXRDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0WydCYXNlQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ0lzQWN0aXZlJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbG90JzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdBTEwnLFxuICAgICAgICAgICAgJ2RlcHRoJzogNTAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXknLCAnc2VsbCcsICdSYXRlJywgJ1F1YW50aXR5Jyk7XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2UgPSByZXF1aXJlICgnLi9iYXNlL0V4Y2hhbmdlJylcbmNvbnN0IHsgRXhjaGF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AgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FsbHRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVfYWRkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2xpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX3ZpZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0pQWSc6IHsgJ2lkJzogJ0JUQy9KUFknLCAnc3ltYm9sJzogJ0JUQy9KUFknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnSlBZJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY3kudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAobG93ZXJjYXNlID09ICdkYXNoJylcbiAgICAgICAgICAgICAgICBsb3dlcmNhc2UgPSAnZHJrJztcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBsb3dlcmNhc2UgKyAnX2JhbGFuY2UnO1xuICAgICAgICAgICAgbGV0IHVzZWQgPSBsb3dlcmNhc2UgKyAnX2xvY2snO1xuICAgICAgICAgICAgaWYgKGZyZWUgaW4gYmFsYW5jZXMpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbZnJlZV0pO1xuICAgICAgICAgICAgaWYgKHVzZWQgaW4gYmFsYW5jZXMpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbdXNlZF0pO1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICA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gICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmJ0Y2NoaW5hLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5idGNjaGluYS5jb20vYXBpZG9jcydcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwbHVzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnlkYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCdXlPcmRlcjInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0J1eVN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsSWNlYmVyZ09yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsU3RvcE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QXJjaGl2ZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEljZWJlcmdPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXREZXB0aDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0U3RvcE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRXaXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVxdWVzdFdpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxJY2ViZXJnT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlbGxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbE9yZGVyMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU2VsbFN0b3BPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sX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AgICAgICAgICAgICdtYXJrZXQnOiAnYWxsJyxcbiAgICAgICAgfSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGtleSA9IGtleXNbcF07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1trZXldO1xuICAgICAgICAgICAgbGV0IHBhcnRzID0ga2V5LnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IGlkID0gcGFydHNbMV07XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSBiYXNlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgcXVvdGUgPSBxdW90ZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9I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KSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlUGx1cyAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWyd0aW1lc3RhbXAnXSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnc2l6ZSddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGVzUGx1cyAodHJhZGVzLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRyYWRlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoa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sgLy8gVE9ETyBmaXhtZVxuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhcmFtcyc6IFsgaWQsIG1hcmtldCBdLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pY3Jvc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddW2FwaV0gKyAnLycgKyBwYXRoO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgcCA9IFtdO1xuICAgICAgICAgICAgaWYgKCdwYXJhbXMnIGluIHBhcmFtcylcbiAgICAgICAgICAgICAgICBwID0gcGFyYW1zWydwYXJhbXMnXTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnaWQnOiBub25jZSxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogcCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBwID0gcC5qb2luICgnLCcpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBsZXQgcXVlcnkgPSAoXG4gICAgICAgICAgICAgICAgJ3RvbmNlPScgKyBub25jZSArXG4gICAgICAgICAgICAgICAgJyZhY2Nlc3NrZXk9JyArIHRoaXMuYXBpS2V5ICtcbiAgICAgICAgICAgICAgICAnJnJlcXVlc3RtZXRob2Q9JyArIG1ldGhvZC50b0xvd2VyQ2FzZSAoKSArXG4gICAgICAgICAgICAgICAgJyZpZD0nICsgbm9uY2UgK1xuICAgICAgICAgICAgICAgICcmbWV0aG9kPScgKyBwYXRoICtcbiAgICAgICAgICAgICAgICAnJnBhcmFtcz0nICsgcFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGExJyk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogJ0Jhc2ljICcgKyB0aGlzLnN0cmluZ1RvQmFzZTY0IChhdXRoKSxcbiAgICAgICAgICAgICAgICAnSnNvbi1ScGMtVG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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cbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjkxNDI5MTEtMGUxYWNmYzItN2Q1Yy0xMWU3LTk4YzQtMDdkOTUzMmIyOWQ3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5idGNtYXJrZXRzLm5ldCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Y21hcmtldHMubmV0LycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vQlRDTWFya2V0cy9BUEknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQve2lkfS9vcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2lkfS90cmFkaW5nZmVlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHRyYW5zZmVyL3dpdGhkcmF3Q3J5cHRvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kdHJhbnNmZXIvd2l0aGRyYXdFRlQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcGVuJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci90cmFkZS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9jcmVhdGVCYXRjaCcsIC8vIHRoZXkgcHJvbWlzZSBpdCdzIGNvbWluZyBzb29uLi4uXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGV0YWlsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgf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VmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0UHJpY2UnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGgnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldElkVGljayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbJ2RhdGUnXSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAg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JlbWFpbmluZztcbiAgICAgICAgbGV0IGNvc3QgPSBwcmljZSAqIGFtb3VudDtcbiAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VNeVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB0eXBlLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHRyYWRlcyxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgIH07XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGlkcyA9IFsgaWQgXTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy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gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICd0aW1lc3RhbXAnOiBub25jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgYXV0aCArPSBib2R5O1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IHNlY3JldCA9IHRoaXMuYmFzZTY0VG9CaW5hcnkgKHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgc2VjcmV0LCAnc2hhNTEyJywgJ2Jhc2U2NCcpO1xuICAgICAgICAgICAgaGVhZGVyc1snc2lnbmF0dXJlJ10gPSB0aGlzLmRlY29kZSAoc2lnbmF0dXJlKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgIC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UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTQxNDgzLTc5ZmM3MzUwLTYyZDktMTFlNy05ZjYxLWFjNDdmMjhmY2Q5Ni5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9idGMtdHJhZGUuY29tLnVhL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Yy10cmFkZS5jb20udWEnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZG9jdW1lbnQvZC8xb2NZQTB5TXlfUlhkNTYxc2ZHM3FFUFo4MGt5bGwzNkhVeHZDUmU1R2JoRS9lZGl0JyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVhbHMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9zZWxsL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnV5L3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdqYXBhbl9zdGF0L2hpZ2gve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F1dGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzay97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXkve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215X29yZGVycy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvc3RhdHVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlbW92ZS9vcmRlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvVUFIJzogeyAnaWQnOiAnYnRjX3VhaCcsICdzeW1ib2wnOiAnQlRDL1VBSCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVQUgnLCAncHJlY2lzaW9uJzogeyAncHJpY2UnOiAxIH0sICdsaW1pdHMnOiB7ICdhbW91bnQnOiB7ICdtaW4nOiAwLjAwMDAwMDAwMDEgfX19LFxuICAgICAgICAgICAgICAgICdFVEgvVUFIJzogeyAnaWQnOiAnZXRoX3VhaCcsICdzeW1ib2wnOiAnRVRIL1VBSCcsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdVQUgnIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9VQUgnOiB7ICdpZCc6ICdsdGNfdWFoJywgJ3N5bWJvbCc6ICdMVEMvVUFIJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ1VBSCcgfSxcbiAgICAgICAgICAgICAgICAnRE9HRS9VQUgnOiB7ICdpZCc6ICdkb2dlX3VhaCcsICdzeW1ib2wnOiAnRE9HRS9VQUgnLCAnYmFzZSc6ICdET0dFJywgJ3F1b3RlJzogJ1VBSCcgfSxcbiAgICAgICAgICAgICAgICA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nREFTSC9CVEMnOiB7ICdpZCc6ICdkYXNoX2J0YycsICdzeW1ib2wnOiAnREFTSC9CVEMnLCAnYmFzZSc6ICdEQVNIJywgJ3F1b3RlJzogJ0JUQycgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNpZ25JbiAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLnByaXZhdGVQb3N0QXV0aCAoKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGlmICgnYWNjb3VudHMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBsZXQgYWNjb3VudHMgPSByZXNwb25zZVsnYWNjb3VudHMnXTtcbiAgICAgICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYWNjb3VudHMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IGFjY291bnRzW2JdO1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGFjY291bnRbJ2N1cnJlbmN5J107XG4gICAgICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBwYXJzZUZsb2F0IChhY2NvdW50WydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSB7XG4gICAgICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgYmlkcyA9IGF3YWl0IHRoaXMucHVibGljR2V0VHJhZGVzQnV5U3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBhc2tzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXNTZWxsU3ltYm9sICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSB7XG4gICAgICAgICAgICAnYmlkcyc6IFtdLFxuICAgICAgICAgICAgJ2Fza3MnOiBbXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKGJpZHMpIHtcbiAgICAgICAgICAgIGlmICgnbGlzdCcgaW4gYmlkcylcbiAgICAgICAgICAgICAgICBvcmRlcmJvb2tbJ2JpZHMnXSA9IGJpZHNbJ2xpc3QnXTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoYXNrcykge1xuICAgICAgICAgICAgaWYgKCdsaXN0JyBpbiBhc2tzKVxuICAgICAgICAgICAgICAgIG9yZGVyYm9va1snYXNrcyddID0gYXNrc1snbGlzdCddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2JpZHMnLCAnYXNrcycsICdwcmljZScsICdjdXJyZW5jeV90cmFkZScpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0SmFwYW5TdGF0SGlnaFN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMuZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCk7XG4gICAgICAgIGxldCBiaWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBudW1CaWRzID0gb3JkZXJib29rWydiaWRzJ10ubGVuZ3RoO1xuICAgICAgICBpZiAobnVtQmlkcyA+IDApXG4gICAgICAgICAgICBiaWQgPSBvcmRlcmJvb2tbJ2JpZHMnXVswXVswXTtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IG51bUFza3MgPSBvcmRlcmJvb2tbJ2Fza3MnXS5sZW5ndGg7XG4gICAgICAgIGlmIChudW1Bc2tzID4gMClcbiAgICAgICAgICAgIGFzayA9IG9yZGVyYm9va1snYXNrcyddWzBdWzBdO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RyYWRlcyddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xvdyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiaWQnOiBiaWQsXG4gICAgICAgICAgICAnYXNrJzogYXNrLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgICAgICBsZXQgdGlja2VyTGVuZ3RoID0gdGlja2VyLmxlbmd0aDtcbiAgICAgICAgaWYgKHRpY2tlckxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGxldCBzdGFydCA9IE1hdGgubWF4ICh0aWNrZXJMZW5ndGggLSA0OCwgMCk7XG4gICAgICAgICAgICBmb3IgKGxldCB0ID0gc3RhcnQ7IHQgPCB0aWNrZXIubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY2FuZGxlID0gdGlja2VyW3RdO1xuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVzdWx0WydvcGVuJ10gPT0gJ3VuZGVmaW5lZCcpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnb3BlbiddID0gY2FuZGxlWzFdO1xuICAgICAgICAgICAgICAgIGlmICgodHlwZW9mIHJlc3VsdFsnaGlnaCddID09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0WydoaWdoJ10gPCBjYW5kbGVbMl0pKVxuICAgICAgICAgICAgICAgICAgICByZXN1bHRbJ2hpZ2gnXSA9IGNhbmRsZVsyXTtcbiAgICAgICAgICAgICAgICBpZiAoKHR5cGVvZiByZXN1bHRbJ2xvdyddID09ICd1bmRlZmluZWQnKSB8fCAocmVzdWx0Wydsb3cnXSA+IGNhbmRsZVszXSkpXG4gICAgICAgICAgICAgICAgICAgIHJlc3VsdFsnbG93J10gPSBjYW5kbGVbM107XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZXN1bHRbJ2Jhc2VWb2x1bWUnXSA9PSAndW5kZWZpbmVkJylcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtY2FuZGxlWzVdO1xuICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gLT0gY2FuZGxlWzVdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IGxhc3QgPSB0aWNrZXJMZW5ndGggLSAxO1xuICAgICAgICAgICAgcmVzdWx0WydjbG9zZSddID0gdGlja2VyW2xhc3RdWzRdO1xuICAgICAgICAgICAgcmVzdWx0WydiYXNlVm9sdW1lJ10gPSAtMSAqIHJlc3VsdFsnYmFzZVZvbHVtZSddO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgY29udmVydEN5cmlsbGljTW9udGhOYW1lVG9TdHJpbmcgKGN5cmlsbGljKSB7XG4gICAgICAgIGxldCBtb250aHMgPSBbXG4gICAgICAgICAgICAn0Y/QvdCy0LDRgNGPJyxcbiAgICAgICAgICAgICfRhNC10LLRgNCw0LvRjycsXG4gICAgICAgICAgICAn0LzQsNGA0YLQsCcsXG4gICAgICAgICAgICAn0LDQv9GA0LXQu9GPJyxcbiAgICAgICAgICAgICfQvNCw0Y8nLFxuICAgICAgICAgICAgJ9C40Y7QvdGPJyxcbiAgICAgICAgICAgICfQuNGO0LvRjycsXG4gICAgICAgICAgICAn0LDQstCz0YPRgdGC0LAnLFxuICAgICAgICAgICAgJ9GB0LXQvdGC0Y/QsdGA0Y8nLFxuICAgICAgICAgICAgJ9C+0LrRgtGP0LHRgNGPJyxcbiAgICAgICAgICAgICfQvdC+0Y/QsdGA0Y8nLFxuICAgICAgICAgICAgJ9C00LXQutCw0LHRgNGPJyxcbiAgICAgICAgXTtcbiAgICAgICAgbGV0IG1vbnRoID0gdW5kZWZpbmVkO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1vbnRocy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgaWYgKGN5cmlsbGljID09IG1vbnRoc1tpXSkge1xuICAgICAgICAgICAgICAgIG1vbnRoID0gaSArIDE7XG4gICAgICAgICAgICAgICAgbW9udGggPSBtb250aC50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICBpZiAoaSA8IDkpXG4gICAgICAgICAgICAgICAgICAgIG1vbnRoID0gJzAnICsgbW9udGg7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIG1vbnRoO1xuICAgIH1cblxuICAgIHBhcnNlQ3lyaWxsaWNEYXRldGltZSAoY3lyaWxsaWMpIHtcbiAgICAgICAgbGV0IHBhcnRzID0gY3lyaWxsaWMuc3BsaXQgKCcgJyk7XG4gICAgICAgIGxldCBkYXkgPSBwYXJ0c1swXTtcbiAgICAgICAgbGV0IG1vbnRoID0gdGhpcy5jb252ZXJ0Q3lyaWxsaWNNb250aE5hbWVUb1N0cmluZyAocGFydHNbMV0pO1xuICAgICA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JkZXJzJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJzIChvcmRlcnMsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ291dF9vcmRlcl9pZCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gYm9keSArIHRoaXMuc2VjcmV0O1xuICAgICAgICAgICAgaGVhZGVyc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vLyBUdXJrZXlcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMWQnOiAnMWQnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc5OTI3MDktMThlMTU2NDYtNjRhMy0xMWU3LTlmYTItYjA5NTBlYzc3MTJmLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5idGN0dXJrLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuYnRjdHVyay5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL0JUQ1RyYWRlci9icm9rZXItYXBpLWRvY3MnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjZGF0YScsIC8vID9sYXN0PUNPVU5UXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsICAgLy8gP2xhc3Q9Q09VTlQgKG1heCA1MClcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJUcmFuc2FjdGlvbnMnLCAvLyA/b2Zmc2V0PTAmbGltaXQ9MjUmc29ydD1hc2NcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1RSWSc6IHsgJ2lkJzogJ0JUQ1RSWScsICdzeW1ib2wnOiAnQlRDL1RSWScsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdUUlknLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic6IDAuMDAzNSAqIDEuMTggfSxcbiAgICAgICAgICAgICAgICAnRVRIL1RSWSc6IHsgJ2lkJzogJ0VUSFRSWScsICdzeW1ib2wnOiAnRVRIL1RSWScsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdUUlknLCAnbWFrZXInOiAwLjAwMiAqIDEuMTgsICd0YWtlcic6IDAuMDAzNSAqIDEuMTggfSxcbiAgICAgICAgICAgICAgICAnRVRIL0JUQyc6IHsgJ2lkJzogJ0VUSEJUQycsICdzeW1ib2wnOiAnRVRIL0JUQycsICdiYXNlJzogJ0VUSCcsICdxdW90ZSc6ICdCVEMnLCAnbWFrZXInOiAwLjAwMiAqID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MgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyU3ltYm9sJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlcmJvb2tbJ3RpbWVzdGFtcCddICogMTAwMCk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHRpbWVzdGFtcCk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRpY2tlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2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ICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtzeW1ib2xdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHRbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gYXdhaXQgdGhpcy5mZXRjaFRpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wgaW4gdGlja2VycylcbiAgICAgICAgICAgIHJlc3VsdCA9IHRpY2tlcnNbc3ltYm9sXTtcbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVma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gICAgICAgICAgIG9yZGVyWydUb3RhbCddID0gYW1vdW50O1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIG9yZGVyWydBbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9yZGVyWydQcmljZSddID0gcHJpY2U7XG4gICAgICAgICAgICBvcmRlclsnQW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdpZCc6IGlkIH0pO1xuICAgIH1cblxuICAgIG5vbmNlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKHRoaXMuaWQgPT0gJ2J0Y3RyYWRlcicpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgaXMgYW4gYWJzdHJhY3QgYmFzZSBBUEkgZm9yIEJUQ0V4Y2hhbmdlLCBCVENUdXJrJyk7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCkudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgc2VjcmV0ID0gdGhpcy5iYXNlNjRUb0JpbmFyeSAodGhpcy5zZWNyZXQpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSB0aGlzLmFwaUtleSArIG5vbmNlO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnWC1QQ0snOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnWC1TdGFtcCc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdYLVNpZ25hdHVyZSc6IHRoaXMuc3RyaW5nVG9CYXNlNjQodGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHNlY3JldCwgJ3NoYTI1NicsICdiaW5hcnknKSksXG4gICAgICAgICAgICAgICAgJ0NvbnRlbnQtVHlwZSc6ICdhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQnLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4v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AgICAgJ2FwaSc6ICdodHRwczovL2J0Yy14LmlzL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2J0Yy14LmlzJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnRjLXguaXMvY3VzdG9tL2FwaS1kb2N1bWVudC5odG1sJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfS97bGltaXR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZWRlZW0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1VTRCc6IHsgJ2lkJzogJ2J0Yy91c2QnLCAnc3ltYm9sJzogJ0JUQy9VU0QnLCAnYmFzZSc6ICdCVEMnLCAncX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VyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RGVwdGhJZExpbWl0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogdGhpcy5tYXJrZXRJZCAoc3ltYm9sKSxcbiAgICAgICAgICAgICdsaW1pdCc6IDEwMDAsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdiaWRzJywgJ2Fza3MnLCAncHJpY2UnLCAnYW1vdW50Jyk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VySWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndGltZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sdW1lJ10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgbGV0IHNpZGUgPSAodHJhZGVbJ3R5cGUnXSA9PSAnYXNrJykgPyAnc2VsbCcgOiAnYnV5JztcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogdHJhZ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J11bJ2lkJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHJldHVybiBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsICh7ICdvcmRlcic6IGlkIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICB1cmwgKz0gYXBpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdNZXRob2QnOiBwYXRoLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgICAgICdOb25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAg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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxubW9kdWxlLmV4cG9ydHMgPSBjbGFzcyBidGVyIGV4dGVuZHMgRXhjaGFuZ2Uge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2J0ZXInLFxuICAgICAgICAgICAgJ25hbWUnOiAnQnRlcicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogWyAnVkcnLCAnQ04nIF0sIC8vIEJyaXRpc2ggVmlyZ2luIElzbGFuZHMsIENoaW5hXG4gICAgICAgICAgICAndmVyc2lvbic6ICcyJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTgwNDc5LWNmYTMxODhjLTYzODctMTFlNy04MTkxLTkzZmM0MTg0YmE1Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kYXRhLmJ0ZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmJ0ZXIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vYnRlci5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9idGVyLmNvbS9hcGkyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAncGFpcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldGxpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlckJvb2sve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeS97aWR9L3t0aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRzV2l0aGRyYXdhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEFsbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5PcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldGluZm8gKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAncGFpcnMnKTtcbiAgICAgICAgaWYgKCFtYXJrZXRzKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoTWFya2V0cyBnb3QgYW4gdW5yZWNvZ25pemVkIHJlc3BvbnNlJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBtYXJrZXRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1tpXTtcbiAgICAgICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldCk7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzWzBdO1xuICAgICAgICAgICAgbGV0IGRldGFpbHMgPSBtYXJrZXRbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IGJhc2UudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBkZXRhaWxzWydkZWNpbWFsX3BsYWNlcyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IGRldGFpbHNbJ2RlY2ltYWxfcGxhY2VzJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFtb3VudExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogZGV0YWlsc1snbWluX2Ftb3VudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnRMaW1pdHMsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2VMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBkZXRhaWxzWydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmICgnYXZhaWxhYmxlJyBpbiBiYWxhbmNlKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VbJ2F2YWlsYWJsZSddKSB7XG4gICAgICAgICAgICAgICAgICAgIGFjY291bnRbJ2ZyZWUnXSA9IHBhcnNlRmxvYXQgKGJhbGFuY2VbJ2F2YWlsYWJsZSddW2N1cnJlbmN5XSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKCdsb2NrZW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ICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoMjRociddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdzI0aHInXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoZXN0QmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93ZXN0QXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsncGVyY2VudENoYW5nZSddKSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsncXVvdGVWb2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZs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JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vYnguaW4udGgvaW5mby9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLCAvLyB0aWNrZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb25ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZWhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpbGxlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlsbGdyb3VwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaWxscGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWlzc3VlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15aXNzdWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wdGlvbi1teWJpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLW15b3B0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3B0aW9uLWV4ZXJjaXNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24tY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcHRpb24taGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWwtaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yNSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFBhaXJpbmcgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNba2V5c1twXV07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3BhaXJpbmdfaWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydzZWNvbmRhcnlfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJpbWFyeV9jdXJyZW5jeSddO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBjb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5KSB7XG4gICAgICAgIC8vIHdoeSB3b3VsZCB0aGV5IHVzZSB0aHJlZSBsZXR0ZXJzIGluc3RlYWQgb2YgZm91ciBmb3IgY3VycmVuY3kgY29kZXNcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdEQVMnKVxuICAgICAgICAgICAgcmV0dXJuICdEQVNIJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdET0cnKVxuICAgICAgICAgICAgcmV0dXJuICdET0dFJztcbiAgICAgICAgcmV0dXJuIGN1cnJlbmN5O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW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ICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcmRlcmJvb2sgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcmluZyc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnb3JkZXJib29rJ11bJ2JpZHMnXVsnaGlnaGJpZCddKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ29yZGVyYm9vayddWydhc2tzJ11bJ2hpZ2hiaWQnXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJ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gICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdyYXRlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcGFpcmluZyA9IHVuZGVmaW5lZDsgLy8gVE9ETyBmaXhtZVxuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbCAoe1xuICAgICAgICAgICAgJ29yZGVyX2lkJzogaWQsXG4gICAgICAgICAgICAncGFpcmluZyc6IHBhaXJpbmcsXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChwYXRoKVxuICAgICAgICAgICAgdXJsICs9IHBhdGggKyAnLyc7XG4gICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoK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jaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQzMy0xNjg4MWY5MC01ZWQ4LTExZTctOTJmOC0zZDkyY2M3NDdhNmMuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAndGlja2Vycyc6ICdodHRwczovL2MtY2V4LmNvbS90JyxcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2MtY2V4LmNvbS90L2FwaV9wdWIuaHRtbCcsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYy1jZXguY29tL3QvYXBpLmh0bWwnLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2MtY2V4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2MtY2V4LmNvbS8/aWQ9YXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd0aWNrZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvaW5uYW1lcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3ZvbHVtZV97Y29pbn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlZGlzdHJpYnV0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRoaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzdW1tYXJpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3Blbm9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGNvbW1vbkN1cnJlbmN5Q29kZSAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdJT1QnKVxuICAgICAgICAgICAgcmV0dXJuICdJb1Rjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCTEMnKVxuICAgICAgICAgICAgcmV0dXJuICdDcnlwdG9idWxsY29pbic7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnWElEJylcbiAgICAgICAgICAgIHJldHVybiAnSW50ZXJuYXRpb25hbERpYW1vbmQnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydyZXN1bHQnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydNYXJrZXROYW1lJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBiYWxhbmNlWydDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGNvZGUpO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydBdmFpbGFibGUnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ1BlbmRpbmcnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydCYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0T3JkZXJib29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ21hcmtldCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgICAgICAndHlwZSc6ICdib3RoJyxcbiAgICAgICAgICAgICdkZXB0aCc6IDEwMCxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ2J1eScsICdzZWxsJywgJ1JhdGUnLCAnUXVhbnRpdHknKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSx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7ICdpbmZvJzogdGlja2VycyB9O1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbaWRdO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAodXBwZXJjYXNlIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFt1cHBlcmNhc2VdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSB1cHBlcmNhc2Uuc3BsaXQgKCctJyk7XG4gICAgICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMudGlja2Vyc0dldE1hcmtldCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdtYXJrZXQnOiBtYXJrZXRbJ2lkJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsnVGltZVN0YW1wJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ0lkJ10sXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydPcmRlclR5cGUnXS50b0xvd2VyQ2FzZSAoKSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydQcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydRdWFudGl0eSddLFxuICAgIC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cykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXN1bHQnXVsndXVpZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlR2V0Q2FuY2VsICh7ICd1dWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhJzogcGF0aCxcbiAgICAgICAgICAgICAgICAnYXBpa2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHsgJ2FwaXNpZ24nOiB0aGlzLmhtYWMgKHRoaXM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ybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjQ0Mi04ZGRjMzNiMC01ZWQ4LTExZTctOGI5OC1mNzg2YWVmMGYzYzkuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vY2V4LmlvL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NleC5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2NleC5pby9jZXgtYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfbGltaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdF9wcmljZS97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlcy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvaGxjdi9oZC97eXl5eW1tZGR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97Y3VycmVuY2llc30vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZV9oaXN0b3J5L3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb252ZXJ0L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2Vfc3RhdHMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfb3JkZXJzX3N0YXR1cy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FyY2hpdmVkX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVycy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfcmVwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjbG9zZV9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWRkcmVzcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9teWZlZS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl90eC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW5fb3JkZXJzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbl9wb3NpdGlvbi97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX3Bvc2l0aW9ucy97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9vcmRlci97cGFpcn0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeUxpbWl0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXS5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ2RhdGEnXVsncGFpcnMnXVtwXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sMSddICsgJy8nICsgbWFya2V0WydzeW1ib2wyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbWluUHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiAtMSAqIE1hdGgubG9nMTAgKG1hcmtldFsnbWluTG90U2l6ZSddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5Mb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhMb3RTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBwYXJzZUZsb2F0IChtYXJrZXRbJ21pblByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHBhcnNlRmxvYXQgKG1hcmtldFsnbWF4UHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluTG90U2l6ZVMyJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2UgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgbGV0IG9tbWl0ZWQgPSBbICd1c2VybmFtZScsICd0aW1lc3RhbXAnIF07XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHRoaXMub21pdCAocmVzcG9uc2UsIG9tbWl0ZWQpO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiBiYWxhbmNlcykge1xuICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICAgICAnZnJlZSc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdhdmFpbGFibGUnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndXNlZCc6IHRoaXMuc2FmZUZsb2F0IChiYWxhbmNlc1tjdXJyZW5jeV0sICdvcmRlcnMnLCAwLjApLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd0b3RhbCddID0gdGhpcy5zdW0gKGFjY291bnRbJ2ZyZWUnXSwgYWNjb3VudFsndXNlZCddKTtcbiAgICAgICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpc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5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAodGhpcy5jdXJyZW5jaWVzKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzQ3VycmVuY2llcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jaWVzJzogY3VycmVuY2llcy5qb2luICgnLycpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgdGlja2Vycy5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHRpY2tlcnNbdF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGlja2VyWydwYWlyJ10ucmVwbGFjZSAoJzonLCAnLycpO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlclBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgIC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KG9yZGVyLCAncmVtYWlucycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0YTonICsgbWFya2V0WydxdW90ZSddKTtcbiAgICAgICAgICAgIGxldCBiYXNlRmVlID0gJ2ZhOicgKyBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZUZlZSA9ICdmYTonICsgbWFya2V0WydxdW90ZSddO1xuICAgICAgICAgICAgbGV0IGZlZVJhdGUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICd0cmFkaW5nRmVlTWFrZXInKTtcbiAgICAgICAgICAgIGlmICghZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAndHJhZGluZ0ZlZVRha2VyJywgZmVlUmF0ZSk7XG4gICAgICAgICAgICBpZiAoZmVlUmF0ZSlcbiAgICAgICAgICAgICAgICBmZWVSYXRlIC89IDEwMC4wOyAvLyBjb252ZXJ0IHRvIG1hdGhlbWF0aWNhbGx5LWNvcnJlY3QgcGVyY2VudGFnZSBjb2VmZmljaWVudHM6IDEuMCA9IDEwMCVcbiAgICAgICAgICAgIGlmIChiYXNlRmVlIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgYmFzZUZlZSksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocXVvdGVGZWUgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiBmZWVSYXRlLFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgcXVvdGVGZWUpLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKCFjb3N0KVxuICAgICAgICAgICAgY29zdCA9IHByaWNlICogZmlsbGVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogb3JkZXJbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICA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lIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUudG9VcHBlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICghcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICB9IGVsc2UgaWYgKHJlc3BvbnNlID09IHRydWUpIHtcbiAgICAgICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICAgICAgfSBlbHNlIGl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NjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2NoYnRjJyxcbiAgICAgICAgICAgICduYW1lJzogJ0NIQlRDJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQ04nLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDEwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODU1NTY1OS1mMDA0MGRjMi03MTA5LTExZTctOWQ5OS02ODhhNDM4YmY5ZjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkuY2hidGMuY29tL2RhdGEnLCAvLyBubyBodHRwcyBmb3IgcHVibGljIEFQSVxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RyYWRlLmNoYnRjLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY2hidGMuY29tL2kvZGV2ZWxvcGVyJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGdldE1hcmtldEZpZWxkTmFtZSAoKSB7XG4gICAgICAgIHJldHVybiAnY3VycmVuY3knO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnQlRDL0NOW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mNvbS9kb2N1bWVudHMvZXhjaGFuZ2UvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2tzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyYXRlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL2xldmVyYWdlX2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfbW9uZXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVycy9vcGVucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3RyYW5zYWN0aW9uc19wYWdpbmF0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9sZXZlcmFnZS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy9tYXRjaGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYW5rX2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X21vbmV5L3tpZH0vZmFzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFuc2ZlcnMvdG9fbGV2ZXJhZ2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3RyYW5zZmVycy9mcm9tX2xldmVyYWdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kaW5nL2JvcnJvd3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xlbmRpbmcvYm9ycm93cy97aWR9L3JlcGF5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZW5kX21vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbmtfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICA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ge1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0Jykge1xuICAgICAgICAgICAgbGV0IG9yZGVyX3R5cGUgPSB0eXBlICsgJ18nICsgc2lkZTtcbiAgICAgICAgICAgIG9yZGVyWydvcmRlcl90eXBlJ10gPSBvcmRlcl90eXBlO1xuICAgICAgICAgICAgbGV0IHByZWZpeCA9IChzaWRlID09ICdidXknKSA/IChvcmRlcl90eXBlICsgJ18nKSA6ICcnO1xuICAgICAgICAgICAgb3JkZXJbcHJlZml4ICsgJ2Ftb3VudCddID0gYW1vdW50O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgb3JkZXJbJ29yZGVyX3R5cGUnXSA9IHNpZGU7XG4gICAgICAgICAgICBvcmRlclsncmF0ZSddID0gcHJpY2U7XG4gICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEV4Y2hhbmdlT3JkZXJzICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlRGVsZXRlRXhjaGFuZ2VPcmRlcnNJZCAoeyAnaWQnOiBpZCB9KTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgIGxldCBxdWVyeVN0cmluZyA9ICcnO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHF1ZXJ5KSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aCkge1xuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy51cmxlbmNvZGUgKHRoaXMua2V5c29ydCAocXVlcnkpKTtcbiAgICAgICAgICAgICAgICAgICAgcXVlcnlTdHJpbmcgPSBib2R5O1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH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dlYmFwaS5jb2luZmxvb3IuY28udWs6ODA5MC9iaXN0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51aycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9jb2luZmxvb3IvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNvaW5mbG9vci5jby51ay9hcGknLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vdGlja2VyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcmRlcl9ib29rLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS90cmFuc2FjdGlvbnMvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2JhbGFuY2UvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3VzZXJfdHJhbnNhY3Rpb25zLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9vcGVuX29yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vY2FuY2VsX29yZGVyLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9idXkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGwvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L2J1eV9tYXJrZXQvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9L3NlbGxfbWFya2V0LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2lkfS9lc3RpbWF0ZV9zZWxsX21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tpZH0vZXN0aW1hdGVfYnV5X21hcmtldC8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9HQlAnOiB7ICdpZCc6ICdYQlQvR0JQJywgJ3N5bWJvbCc6ICdCVEMvR0JQJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0dCUCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ1hCVC9FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnWEJUL1VTRCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnIH0sXG4gICAgICAgICAgICAgICAgJ0JUQy9QTE4nOiB7ICdpZCc6ICdYQlQvUExOJywgJ3N5bWJvbCc6ICdCVEMvUExOJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1BMTicgfSxcbiAgICAgICAgICAgICAgICAnQkNIL0dCUCc6IHsgJ2lkJzogJ0JDSC9HQlAnLCAnc3ltYm9sJzogJ0JDSC9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c2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldElkVGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1w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nLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2NvaW5naS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cDovL2RvY3MuY29pbmdpLmFwaWFyeS5pby8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3d3dyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2N1cnJlbnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXItYm9vay97cGFpcn0ve2Fza0NvdW50fS97YmlkQ291bnR9L3tkZXB0aH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy97cGFpcn0ve21heENvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnMjRob3VyLXJvbGxpbmctYWdncmVnYXRpb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZXInOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZC1vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsLW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlLWNyeXB0by13aXRoZHJhd2FsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUEMnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZUQyc6IDAuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOTUMnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLjAwMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAxMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0Un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ICAgICBsZXQgaWQgPSBpZFBhcnRzWzBdO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgaWQgPSBpZC5yZXBsYWNlICgnLycsICctJyk7XG4gICAgICAgICAgICBpZCA9IGlkLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHN5bWJvbC5zcGxpdCAoJy8nKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IDgsXG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbG93ZXJjYXNlQ3VycmVuY2llcyA9IFtdO1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsb3dlcmNhc2VDdXJyZW5jaWVzLnB1c2ggKGN1cnJlbmN5LnRvTG93ZXJDYXNlICgpKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnVzZXJQb3N0QmFsYW5jZSAoe1xuICAgICAgICAgICAgJ2N1cnJlbmNpZXMnOiBsb3dlcmNhc2VDdXJyZW5jaWVzLmpvaW4gKCcsJylcbiAgICAgICAgfSk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZ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gICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGlja2VyWydiYXNlVm9sdW1lJ10sXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aWNrZXJbJ2NvdW50ZXJWb2x1bWUnXSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gdGlja2VyO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5jdXJyZW50R2V0MjRob3VyUm9sbGluZ0FnZ3JlZ2F0aW9uIChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IHQgPSAwOyB0IDwgcmVzcG9uc2UubGVuZ3RoOyB0KyspIHtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVt0XTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdGlja2VyWydjdXJyZW5jeVBhaXInXVsnYmFzZSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gdGlja2VyWydjdXJyZW5jeVBhaXInXVsnY291bnRlciddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBpZiAoc3ltYm9sIGluIHRoaXMubWFya2V0cykge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmVzdWx0W3N5bWJvbF0gPSB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdGlja2VycyA9IGF3YWl0IHRoaXMuZmV0Y2hUaWNrZXJzICh1bmRlZmluZWQsIHBhcmFtcyk7XG4gICAgICAgIGlmIChzeW1ib2wgaW4gdGlja2VycylcbiAgICAgICAgICAgIHJldHVybiB0aWNrZXJzW3N5bWJvbF07XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm4gZGlkIG5vdCBjb250YWluICcgKyBzeW1ib2wpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ2N1cnJlbmN5UGFpciddXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZS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ICAgICAgIH1cbiAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpO1xuICAgICAgICBpZiAoYXBpID09ICdjdXJyZW50Jykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAndXNlcicpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAndG9rZW4nOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHF1ZXJ5KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gbm9uY2UudG9TdHJpbmcgKCkgKyAnJCcgKyB0aGlzLmFwaUtleTtcbiAgICAgICAgICAgIHJlcXVlc3RbJ3NpZ25hdHVyZSddID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4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ybiB0aGlzLmRlZXBFeHRlbmQgKHN1cGVyLmRlc2NyaWJlICgpLCB7XG4gICAgICAgICAgICAnaWQnOiAnY29pbm1hcmtldGNhcCcsXG4gICAgICAgICAgICAnbmFtZSc6ICdDb2luTWFya2V0Q2FwJyxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVVMnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1ByaXZhdGVBUEknOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNDcmVhdGVPcmRlcic6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0NhbmNlbE9yZGVyJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hCYWxhbmNlJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcmRlckJvb2snOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRyYWRlcyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yODI0NDI0NC05YmU2MzEyYS02OWVkLTExZTctOTljMS03YzE3OTcyNzUyNjUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmNvaW5tYXJrZXRjYXAuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vY29pbm1hcmtldGNhcC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9jb2lubWFya2V0Y2FwLmNvbS9hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogZmFsc2UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97aWR9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2xvYmFsLycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY3VycmVuY3lDb2Rlcyc6IFtcbiAgICAgICAgICAgICAgICAnQVVEJyxcbiAgICAgICAgICAgICAgICAnQlJMJyxcbiAgICAgICAgICAgICAgICAnQ0FEJyxcbiAgICAgICAgICAgICAgICAnQ0hGJyxcbiAgICAgICAgICAgICAgICAnQ05ZJyxcbiAgICAgICAgICAgICAgICAnRVVSJyxcbiAgICAgICAgICAgICAgICAnR0JQJyxcbiAgICAgICAgICAgICAgICAnSEtEJyxcbiAgICAgICAgICAgICAgICAnSURSJyxcbiAgICAgICAgICAgICAgICAnSU5SJyxcbiAgICAgICAgICAgICAgICAnSlBZJyxcbiAgICAgICAgICAgICAgICAnS1JXJyxcbiAgICAgICAgICAgICAgICAnTVhOJyxcbiAgICAgICAgICAgICAgICAnUlVCJyxcbiAgICAgICAgICAgICAgICAnVVNEJyxcbiAgICAgICAgICAgIF0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICgnRmV0Y2hpbmcgb3JkZXIgYm9va3MgaXMgbm90IHN1cHBvcnRlZCBieSB0aGUgQVBJIG9mICcgKyB0aGlzLmlkKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh7XG4gICAgICAgICAgICAnbGltaXQnOiAwLFxuICAgICAgICB9KTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSB0aGlzLmN1cnJlbmN5Q29kZXM7XG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgcXVvdGUgPSBjdXJyZW5jaWVzW2ldO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGUudG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgIGxldCBiYXNlSWQgPSBtYXJrZXRbJ2lkJ107XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoR2xvYmFsIChjdXJyZW5jeSA9ICdVU0QnKSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGlmIChjdXJyZW5jeSlcbiAgICAgICAgICAgIHJlcXVlc3RbJ2NvbnZlcnQnXSA9IGN1cnJlbmN5O1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wdWJsaWNHZXRHbG9iYWwgKHJlcXVlc3QpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgnbGFzdF91cGRhdGVkJyBpbiB0aWNrZXIpXG4gICAgICAgICAgICBpZiAodGlja2VyWydsYXN0X3VwZGF0ZWQnXSlcbiAgICAgICAgICAgICAgICB0aW1lc3RhbXAgPSBwYXJzZUludCAodGlja2VyWydsYXN0X3VwZGF0ZWQnXSkgKiAxMDAwO1xuICAgICAgICBsZXQgY2hhbmdlID0gdW5kZWZpbmVkO1xuICAgIC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LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSB7fTtcbiAgICAgICAgZm9yIChsZXQgdCA9IDA7IHQgPCByZXNwb25zZS5sZW5ndGg7IHQrKykge1xuICAgICAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlW3RdO1xuICAgICAgICAgICAgbGV0IGlkID0gdGlja2VyWydpZCddICsgJy8nICsgY3VycmVuY3k7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRpY2tlcnNbc3ltYm9sXSA9IHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGlja2VycztcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjb252ZXJ0JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydiYXNlSWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJJZCAocmVxdWVzdCk7XG4gICAgICAgIGxldCB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ZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnbmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAg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WMxZWZiNTEwLTYwNmMtMTFlNy05YTM2LTg0YmEyY2U0MTJkOC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9jb2lubWF0ZS5pby9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9jb2lubWF0ZS5pbycsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9kb2NzLmNvaW5tYXRlLmFwaWFyeS5pbycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2NvaW5tYXRlLmlvL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luV2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbkRlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eUxpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXJXaXRoSW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbk9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVkZWVtVm91Y2hlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbEluc3RhbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxMaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25IaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1bmNvbmZpcm1lZEJpdGNvaW5EZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0VVUic6IHsgJ2lkJzogJ0JUQ19FVVInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJywgJ3ByZWNpc2lvbic6IHsgJ2Ftb3VudCc6IDQsICdwcmljZSc6IDIgfX0sXG4gICAgICAgICAgICAgICAgJ0JUQy9DWksnOiB7ICdpZCc6ICdCVENfQ1pLJywgJ3N5bWJvbCc6ICdCVEMvQ1pLJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NaSycsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA0LCAncHJpY2UnOiAyIH19LFxuICAgICAgICAgICAgICAgICdMVEMvQlRDJzogeyAnaWQnOiAnTFRDX0JUQycsICdzeW1ib2wnOiAnTFRDL0JUQycsICdiYXNlJzogJ0xUQycsICdxdW90ZSc6ICdCVEMnLCAncHJlY2lzaW9uJzogeyAnYW1vdW50JzogNCwgJ3ByaWNlJzogNSB9fSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gYmFsYW5jZXNbY3VycmVuY3ldWydhdmFpbGFibGUnXTtcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBiYWxhbmNlc1tjdXJyZW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gICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnZGF0YSddLnRvU3RyaW5nICgpLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbE9yZGVyICh7ICdvcmRlcklkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocGFyYW1zKS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChwYXJhbXMpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHRoaXMudWlkICsgdGhpcy5hcGlLZXk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd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ICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuY29pbnNlY3VyZS5pbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vY29pbnNlY3VyZS9wbHVnaW5zJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiBmYWxzZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbi9zZWFyY2gvY29uZmlybWF0aW9uL3t0eGlkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYXNrL2xvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYXNrL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYmlkL2hpZ2gnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2JpZC9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2xhc3RUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbWF4MjRIcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbWluMjRIcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWZhL2F1dGh5L2NhbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9hdXRoeS9zbXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25ldGtpL3NlYXJjaC97bmV0a2lOYW1lfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9iYW5rL290cC97bnVtYmVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9reWMvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Byb2ZpbGUvcGhvbmUvb3RwL3tudW1iZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL2FkZHJlc3Mve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L2NvbmZpcm1lZC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vZGVwb3NpdC9jb25maXJtZWQve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L3VuY29uZmlybWVkL2FsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi9kZXBvc2l0L3VuY29uZmlybWVkL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9iYWxhbmNlL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2JhbGFuY2UvdG90YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L2RlcG9zaXQvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2Fzay9jb21wbGV0ZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmlkL2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JpZC9wZW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9hZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9iYWxhbmNlL3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2JhbGFuY2UvdG90YWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvY2FuY2VsbGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi9kZXBvc2l0L3VudmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL2RlcG9zaXQvdmVyaWZpZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvY29pbi93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvY29pbi9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvZmlhdC9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2Uva3ljcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbC9jb2luL3BhaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvcmVmZXJyYWwvY29pbi9zdWNjZXNzZnVsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL3JlZmVycmFsL2ZpYXQvcGFpZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9yZWZlcnJhbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvdHJhZGUvc3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9sb2dpbi90b2tlbi97dG9rZW59JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L3N1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldC9jb2luL3dpdGhkcmF3L2NhbmNlbGxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvY29tcGxldGVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy91bnZlcmlmaWVkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXQvY29pbi93aXRoZHJhdy92ZXJpZmllZCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvZ2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2dpbi9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9naW4vcGFzc3dvcmQvZm9yZ290JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZmEvYXV0aHkvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21mYS9nYS9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbnVwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL25ldGtpL3VwZGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wcm9maWxlL2ltYWdlL3VwZGF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvaW5pdGlhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9jb2luL3dpdGhkcmF3L25ld1ZlcmlmeWNvZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYmFuay9maWF0L3dpdGhkcmF3L2luaXRpYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC93aXRoZHJhdy9uZXdWZXJpZnljb2RlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3Bhc3N3b3JkL2NoYW5nZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXNzd29yZC9yZXNldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci93YWxsZXQvY29pbi93aXRoZHJhdy9pbml0aWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0L2NvaW4vd2l0aGRyYXcvbmV3VmVyaWZ5Y29kZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2lnbnVwL3ZlcmlmeS97dG9rZW59JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2t5YycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvZGVwb3NpdC9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvZXhjaGFuZ2UvYXNrL25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2luc3RhbnQvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2luc3RhbnQvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9hY2NvdW50L25ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdmVyaWZ5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9hdXRoeS9pbml0aWF0ZS9lbmFibGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvbWZhL2dhL2luaXRpYXRlL2VuYWJsZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9uZXRraS9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vYWRkcmVzcy9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vbmV3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3NlbmRUb0V4Y2hhbmdlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3dhbGxldC9jb2luL3dpdGhkcmF3L3ZlcmlmeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdkZWxldGUnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9nY20ve2NvZGV9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2xvZ291dCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2V4Y2hhbmdlL2JhbmsvZmlhdC9kZXBvc2l0L2NhbmNlbC97ZGVwb3NpdElEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9hc2svY2FuY2VsL3tvcmRlcklEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iaWQvY2FuY2VsL3tvcmRlcklEfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9leGNoYW5nZS9iYW5rL2ZpYXQvd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL21mYS9hdXRoeS9kaXNhYmxlL3tjb2RlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9tZmEvZ2EvZGlzYWJsZS97Y29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9waG9uZS9kZWxldGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJvZmlsZS9pbWFnZS9kZWxldGUve25ldGtpTmFtZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvd2FsbGV0L2NvaW4vd2l0aGRyYXcvdW52ZXJpZmllZC9jYW5jZWwve3dpdGhkcmF3SUR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdtYXJrZXRzJzoge1xuICAgICAgICAgICAgICAgICdCVEMvSU5SJzogeyAnaWQnOiAnQlRDL0lOUicsICdzeW1ib2wnOiAnQlRDL0lOUicsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdJTlInIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuNCAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC40IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFVzZXJFeGNoYW5nZUJhbmtTdW1tYXJ5ICgpO1xuICAgICAgICBsZXQgYmFsYW5jZSA9IHJlc3BvbnNlWydtZXNzYWdlJ107XG4gICAgICAgIGxldCBjb2luID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlWydhdmFpbGFibGVDb2luQmFsYW5jZSddLFxuICAgICAgICAgICAgJ3VzZWQnOiBiYWxhbmNlWydwZW5kaW5nQ29pbkJhbGFuY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HtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4MjA4NDI5LTNjYWNkZjlhLTY4OTYtMTFlNy04NTRlLTRjNzlhNzcyYTMwZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L3B1YmFwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3LmNvaW5zcG90LmNvbS5hdS9hcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5jb2luc3BvdC5jb20uYXUnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cuY29pbnNwb3QuY29tLmF1L2FwaScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMvaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvY29pbi9kZXBvc2l0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9jb2luL3NlbmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlL2J1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGUvc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXkvYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9zZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9idXkvY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteS9zZWxsL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL0FVRCc6IHsgJ2lkJzogJ0JUQycsICdzeW1ib2wnOiAnQlRDL0FVRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICAgICAgJ0xUQy9BVUQnOiB7ICdpZCc6ICdMVEMnLCAnc3ltYm9sJzogJ0xUQy9BVUQnLCAnYmFzZSc6ICdMVEMnLCAncXVvdGUnOiAnQVVEJyB9LFxuICAgICAgICAgICAgICAgICdET0dFL0FVRCc6IHsgJ2lkJzogJ0RPR0UnLCAnc3ltYm9sJzogJ0RPR0UvQVVEJywgJ2Jhc2UnOiAnRE9HRScsICdxdW90ZSc6ICdBVUQnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RNeUJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGlmICgnYmFsYW5jZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlJ107XG4gICAgICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzIChiYWxhbmNlcyk7XG4gICAgICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBjdXJyZW5jeS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAgICAgJ2ZyZWUnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlc1tjdXJyZW5jeV0sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAodXBwZXJjYXNlID09ICdEUksnKVxuICAgICAgICAgICAgICAgICAgICB1cHBlcmNhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlcmJvb2sgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0T3JkZXJzICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2NvaW50eXBlJzogbWFya2V0WydpZCddLFxuICAgICAgICB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QnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hNeVRyYWRlcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yOTQ4NDM5NC03YjRlYTZlMi04NGM2LTExZTctODNlNS0xZmNjZjRiMmRjODEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56JyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuY3J5cHRvcGlhLmNvLm56L0ZvcnVtL0NhdGVnb3J5LzQ1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU1JyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3LmNyeXB0b3BpYS5jby5uei9Gb3J1bS9UaHJlYWQvMjU2JyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZVBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldHMve2hvdXJzfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0cy97aWR9L3tob3Vyc30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXQve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRIaXN0b3J5L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldEhpc3Rvcnkve2lkfS97aG91cnN9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRNYXJrZXRPcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJzL3tpZH0ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0TWFya2V0T3JkZXJHcm91cHMve2lkc30ve2NvdW50fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEJhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VGlwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTdWJtaXRUcmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3VibWl0VHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1N1Ym1pdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NDJylcbiAgICAgICAgICAgIHJldHVybiAnQ0NYJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdGQ04nKVxuICAgICAgICAgICAgcmV0dXJuICdGYWNpbGVjb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdORVQnKVxuICAgICAgICAgICAgcmV0dXJuICdOZXRDb2luJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCVEcnKVxuICAgICAgICAgICAgcmV0dXJuICdCaXRnZW0nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZVRUwnKVxuICAgICAgICAgICAgcmV0dXJuICdGQzInOyAvLyBGdWVsQ29pbiAhPSBGVUVMXG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnV1JDJylcbiAgICAgICAgICAgIHJldHVybiAnV2FyQ29pbic7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBjdXJyZW5jeUlkIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0NDWCcpXG4gICAgICAgICAgICByZXR1cm4gJ0NDJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdGYWNpbGVjb2luJylcbiAgICAgICAgICAgIHJldHVybiAnRkNOJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdOZXRDb2luJylcbiAgICAgICAgICAgIHJldHVybiAnTkVUJztcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCaXRnZW0nKVxuICAgICAgICAgICAgcmV0dXJuICdCVEcnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0ZDMicpXG4gICAgICAgICAgICByZXR1cm4gJ0ZVRUwnOyAvLyBGdWVsQ29pbiAhPSBGVUVMXG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRyYWRlUGFpcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnRGF0YSddO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydJZCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IG1hcmtldFsnTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBbIGJhc2UsIHF1b3RlIF0gPSBzeW1ib2wuc3BsaXQgKCcvJyk7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bVRyYWRlJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4aW11bVRyYWRlJ11cbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgcHJpY2VMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnTWluaW11bVByaWNlJ10sXG4gICAgICAgICAgICAgICAgJ21heCc6IG1hcmtldFsnTWF4aW11bVByaWNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50TGltaXRzLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IHByaWNlTGltaXRzLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ1N0YXR1cyddID09ICdPSyc7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1hcmtldFsnVHJhZGVGZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBtYXJrZXRbJ1RyYWRlRmVlJ10gLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGFtb3VudExpbWl0c1snbWluJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3JkZXJzSWQgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnaWQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydEYXRhJ107XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlT3JkZXJCb29rIChvcmRlcmJvb2ssIHVuZGVmaW5lZCwgJ0J1eScsICdTZWxsJywgJ1ByaWNlJywgJ1ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ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yBpbiB0cmFkZSlcbiAgICAgICAgICAgICAgICBpZiAodHJhZGVbJ1RyYWRlUGFpcklkJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbdHJhZGVbJ1RyYWRlUGFpcklkJ11dO1xuICAgICAgICB9XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoJ0ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB0cmFkZVsnRmVlJ10sXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydUeXBlJ10udG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91b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lbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChjdXJyZW5jeVsnTGlzdGluZ1N0YXR1cyddID09ICdBY3RpdmUnKTtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSBjdXJyZW5jeVsnU3RhdHVzJ10udG9Mb3dlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoc3RhdHVzICE9ICdvaycpXG4gICAgICAgICAgICAgICAgYWN0aXZlID0gZmFsc2U7XG4gICAgICAgICAgICByZXN1bHRbY29kZV0gPSB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ2NvZGUnOiBjb2RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgJ25hbWUnOiBjdXJyZW5jeVsnTmFtZSddLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICAnZmVlJzogY3VycmVuY3lbJ1dpdGhkcmF3RmVlJ10sXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5CYXNlVHJhZGUnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydNaW5XaXRoZHJhdyddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IGN1cnJlbmN5WydNYXhXaXRoZHJhdyddLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QmFsYW5jZSAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ0RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2ldO1xuICAgICAgICAgICAgbGV0IGNvZGUgPSBiYWxhbmNlWydTeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldC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SxcbiAgICAgICAgICAgICdBbW91bnQnOiB0aGlzLmFtb3VudFRvUHJlY2lzaW9uIChzeW1ib2wsIGFtb3VudCksXG4gICAgICAgIH07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RTdWJtaXRUcmFkZSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBpZiAoIXJlc3BvbnNlKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGNyZWF0ZU9yZGVyIHJldHVybmVkIHVua25vd24gZXJyb3I6ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgIGxldCBpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGZpbGxlZCA9IDAuMDtcbiAgICAgICAgaWYgKCdEYXRhJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCdPcmRlcklkJyBpbiByZXNwb25zZVsnRGF0YSddKSB7XG4gICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXSkge1xuICAgICAgICAgICAgICAgICAgICBpZCA9IHJlc3BvbnNlWydEYXRhJ11bJ09yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAoJ0ZpbGxlZE9yZGVycycgaW4gcmVzcG9uc2VbJ0RhdGEnXSkge1xuICAgICAgICAgICAgICAgIGxldCBmaWxsZWRPcmRlcnMgPSByZXNwb25zZVsnRGF0YSddWydGaWxsZWRPcmRlcnMnXTtcbiAgICAgICAgICAgICAgICBsZXQgZmlsbGVkT3JkZXJzTGVuZ3RoID0gZmlsbGVkT3JkZXJzLmxlbmd0aDtcbiAgICAgICAgICAgICAgICBpZiAoZmlsbGVkT3JkZXJzTGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGxlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgb3JkZXIgPSB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBwcmljZSAqIGFtb3VudCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAvLyAndHJhZGVzJzogdGhpcy5wYXJzZVRyYWRlcyAob3JkZXJbJ3RyYWRlcyddLCBtYXJrZXQpLFxuICAgICAgICB9O1xuICAgICAgICBpZiAoaWQpXG4gICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSBvcmRlcjtcbiAgICAgICAgcmV0dXJuIHRoaXMuZXh0ZW5kICh7ICdpbmZvJzogcmVzcG9uc2UgfSwgb3JkZXIpO1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSB1bmRlZmluZWQ7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxUcmFkZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAnVHlwZSc6ICdUcmFkZScsXG4gICAgICAgICAgICAgICAgJ09yZGVySWQnOiBpZCxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXVsnc3RhdHVzJ10gPSAnY2FuY2VsZWQnO1xuICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAodGhpcy5sYXN0X2pzb25fcmVzcG9uc2UsICdFcnJvcicpO1xuICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdkb2VzIG5vdCBleGlzdCcpID49IDApXG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgY2FuY2VsT3JkZXIoKSBlcnJvcjogJyArIHRoaXMubGFzdF9odHRwX3Jlc3BvbnNlKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBlO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXNwb25zZTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmlu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NbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wLFxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAob3JkZXIpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmZpbHRlckJ5U2luY2VMaW1pdCAocmVzdWx0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlkID0gaWQudG9TdHJpbmcgKCk7XG4gICAgICAgIGxldCBvcmRlcnMgPSBhd2FpdCB0aGlzLmZldGNoT3JkZXJzIChzeW1ib2wsIHBhcmFtcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSA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gICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9kc3gudWsvbWFwaScsIC8vIG1hcmtldCBkYXRhXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vZHN4LnVrL3RhcGknLCAvLyB0cmFkaW5nXG4gICAgICAgICAgICAgICAgICAgICdkd2FwaSc6ICdodHRwczovL2RzeC51ay9kd2FwaScsIC8vIGRlcG9zaXQvd2l0aGRyYXdcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9kc3gudWsnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS5kc3gudWsnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9kc3gudWsvYXBpX2RvY3MvcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZHN4LnVrL2FwaV9kb2NzL3ByaXZhdGUnLFxuICAgICAgICAgICAgICAgICAgICAnJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgLy8gbWFya2V0IGRhdGEgKHB1YmxpYylcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhcnNGcm9tTW9tZW50L3tpZH0ve3BlcmlvZH0ve3N0YXJ0fScsIC8vIGVtcHR5IHJlcGx5IDpcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGFzdEJhcnMve2lkfS97cGVyaW9kfS97YW1vdW50fScsIC8vIHBlcmlvZCBpcyAobSwgaCBvciBkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BlcmlvZEJhcnMve2lkfS97cGVyaW9kfS97c3RhcnR9L3tlbmR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIHRyYWRpbmcgKHByaXZhdGUpXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYW5zSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIC8vIGRlcG9zaXQgLyB3aXRoZHJhdyAocHJpdmF0ZSlcbiAgICAgICAgICAgICAgICAnZHdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENyeXB0b0RlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9XaXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdFdpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvblN0Y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bmNpZXNbY107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICB1cHBlcmNhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAodXBwZXJjYXNlKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnVuZHNbY3VycmVuY3ldLFxuICAgICAgICAgICAgICAgICd1c2VkJzogMC4wLFxuICAgICAgICAgICAgICAgICd0b3RhbCc6IGJhbGFuY2VzWyd0b3RhbCddW2N1cnJlbmN5XSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gYWNjb3VudFsnZnJlZSddO1xuICAgICAgICAgICAgcmVzdWx0W3VwcGVyY2FzZV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSx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uICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY0OTEtMWIwZWE5NTYtNWVkYS0xMWU3LTkyMjUtNDBkNjdiNDgxYjhkLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5leG1vLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2V4bW8ubWUnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2V4bW8ubWUvZW4vYXBpX2RvYycsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vZXhtby1kZXYvZXhtb19hcGlfbGliL3RyZWUvbWFzdGVyL25vZGVqcycsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BhaXJfc2V0dGluZ3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2NyZWF0ZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX29wZW5fb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl9jYW5jZWxsZWRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcXVpcmVkX2Ftb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdF9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jcnlwdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfZ2V0X3R4aWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y29kZV9jcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y29kZV9sb2FkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQYWlyU2V0dGluZ3MgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwga2V5cy5sZW5ndGg7IHArKykge1xuICAgICAgICAgICAgbGV0IGlkID0ga2V5c1twXTtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2lkXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBpZC5yZXBsYWNlICgnXycsICcvJyk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3F1YW50aXR5J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcXVhbnRpdHknXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IG1hcmtldFsnbWluX3ByaWNlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfcHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0WydtaW5fYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydtYXhfYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzogOCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RVc2VySW5mbyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiByZXNwb25zZSB9O1xuICAgICAgICBsZXQgY3VycmVuY2llcyA9IE9iamVjdC5rZXlzICh0aGlzLmN1cnJlbmNpZXMpO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGN1cnJlbmNpZXMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbaV07XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXNwb25zZVsnYmFsYW5jZXMnXSlcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChyZXNwb25zZVsnYm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9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXlfcHJpY2UnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsX3ByaWNlJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0X3RyYWRlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2F2ZyddKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbF9jdXJyJ10pLFxuICA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LzI4MTYyNDY1LWNkODE1ZDRjLTY3Y2YtMTFlNy04ZTU3LTQzOGJlYTA1MjNhMi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZmxvd2J0Yy5jb206ODQwMC9hamF4JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdHJhZGVyLmZsb3didGMuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHA6Ly93d3cuZmxvd2J0Yy5jb20uYnIvYXBpLycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3VpZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVzQnlEYXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFByb2R1Y3RQYWlycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UHJvZHVjdHMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0NyZWF0ZUFjY291bnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFVzZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTZXRVc2VySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRUcmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTW9kaWZ5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxBbGxPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldEFjY291bnRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcmRlckZlZScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldFByb2R1Y3RQYWlycyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsncHJvZHVjdFBhaXJzJ107XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnbmFtZSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ3Byb2R1Y3QxTGFiZWwnXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncHJvZHVjdDJMYWJlbCddO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldEFjY291bnRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnY3VycmVuY2llcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWyduYW1lJ107XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2VbJ2JhbGFuY2UnXSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IGJhbGFuY2VbJ2hvbGQnXSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiAwLjAsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IHRoaXMuc3VtIChhY2NvdW50WydmcmVlJ10sIGFjY291bnRbJ3VzZWQnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0T3JkZXJCb29rICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3Byb2R1Y3RQYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3B4JywgJ3F0eScpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwcm9kdWN0UGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydiaWQnXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydhc2snXSksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Nsb3NlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZpcnN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGhyJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUyNGhyUHJvZHVjdDInXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndW5peHRpbWUnXSAqIDEwMDA7XG4gICAgICAgIGxldCBzaWRlID0gKHRyYWRlWydpbmNvbWluZ09yZGVyU2lkZSddID09IDApID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHgnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsncXR5J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljUG9zdEdldFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpbnMnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICA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gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnYXBpTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYXBpU2lnJzogc2lnbmF0dXJlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnaXNBY2NlcHRlZCcgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ2lzQWNjZXB0ZWQnXSlcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2U7XG4gICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgIH1cbn0iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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ibGlua3RyYWRlLmNvbS90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9mb3hiaXQuZXhjaGFuZ2UnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9ibGlua3RyYWRlLmNvbS9kb2NzJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnY29tbWVudCc6ICdCbGlua3RyYWRlIEFQSScsXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2N1cnJlbmN5fS90aWNrZXInLCAgICAvLyA/Y3J5cHRvX2N1cnJlbmN5PUJUQ1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjdXJyZW5jeX0vb3JkZXJib29rJywgLy8gP2NyeXB0b19jdXJyZW5jeT1CVENcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y3VycmVuY3l9L3RyYWRlcycsICAgIC8vID9jcnlwdG9fY3VycmVuY3k9QlRDJnNpbmNlPTxUSU1FU1RBTVA+JmxpbWl0PTxOVU1CRVI+XG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnRCcsICAgLy8gb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdGJywgICAvLyBjYW5jZWwgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMicsICAvLyBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTQnLCAgLy8gbXkgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTYnLCAgLy8gd2l0aGRyYXdcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMTgnLCAvLyBkZXBvc2l0XG4gICAgICAgICAgICAgICAgICAgICAgICAnVTI0JywgLy8gY29uZmlybSB3aXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVTI2JywgLy8gbGlzdCB3aXRoZHJhd2Fsc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ1UzMCcsIC8vIGxpc3QgZGVwb3NpdHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdVMzQnLCAvLyBsZWRnZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdVNzAnLCAvLyBjYW5jZWwgd2l0aGRyYXdhbFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9WRUYnOiB7ICdpZCc6ICdCVENWRUYnLCAnc3ltYm9sJzogJ0JUQy9WRUYnLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnVkVGJywgJ2Jyb2tlcklkJzogMSwgJ2Jyb2tlcic6ICdTdXJCaXRjb2luJyB9LFxuICAgICAgICAgICAgICAgICdCVEMvVk5EJzogeyAnaWQnOiAnQlRDVk5EJywgJ3N5bWJvbCc6ICdCVEMvVk5EJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ1ZORCcsICdicm9rZXJJZCc6IDMsICdicm9rZXInOiAnVkJUQycgfSxcbiAgICAgICAgICAgICAgICAnQlRDL0JSTCc6IHsgJ2lkJzogJ0JUQ0JSTCcsICdzeW1ib2wnOiAnQlRDL0JSTCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdCUkwnLCAnYnJva2VySWQnOiA0LCAnYnJva2VyJzogJ0ZveEJpdCcgfSxcbiAgICAgICAgICAgICAgICAnQlRDL1BLUic6IHsgJ2lkJzogJ0JUQ1BLUicsICdzeW1ib2wnOiAnQlRDL1BLUicsICdiYXNlJzogJ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eW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDdXJyZW5jeVRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IG1hcmtldFsncXVvdGUnXSxcbiAgICAgICAgICAgICdjcnlwdG9fY3VycmVuY3knOiBtYXJrZXRbJ2Jhc2UnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgbGV0IGxvd2VyY2FzZVF1b3RlID0gbWFya2V0WydxdW90ZSddLnRvTG93ZXJDYXNlICgpO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSAndm9sXycgKyBsb3dlcmNhc2VRdW90ZTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyW3F1b3RlVm9sdW1lXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3NpZGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJ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ZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAoeyAnTXNnVHlwZSc6IHBhdGggfSwgcXVlcnkpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocmVxdWVzdCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBUElLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAobm9uY2UpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcn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gICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTEyLTMxMDE5NzcyLTVlZGItMTFlNy04MjQxLTJlNjc1ZTY3OTdmMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly93d3cuZnlic2Uuc2UvYXBpL1NFSycsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5meWJzZS5zZScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwOi8vZG9jcy5meWIuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJkZXRhaWxlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rlc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGFjY2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldHBlbmRpbmdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldG9yZGVyaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VscGVuZGluZ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQlRDL1NFSyc6IHsgJ2lkJzogJ1NFSycsICdzeW1ib2wnOiAnQlRDL1NFSycsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdTRUsnIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBiYWxhbmNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdEdldGFjY2luZm8gKCk7XG4gICAgICAgIGxldCBidGMgPSBwYXJzZUZsb2F0IChiYWxhbmNlWydidGNCYWwnXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB0aGlzLnN5bWJvbHNbMF07XG4gICAgICAgIGxldCBxdW90ZSA9IHRoaXMubWFya2V0c1tzeW1ib2xdWydxdW90ZSddO1xuICAgICAgICBsZXQgbG93ZXJjYXNlID0gcXVvdGUudG9Mb3dlckNhc2UgKCkgKyAnQmFsJztcbiAgICAgICAgbGV0IGZpYXQgPSBwYXJzZUZsb2F0IChiYWxhbmNlW2xvd2VyY2FzZV0pO1xuICAgICAgICBsZXQgY3J5cHRvID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBidGMsXG4gICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICd0b3RhbCc6IGJ0YyxcbiAgICAgICAgfTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ0JUQyc6IGNyeXB0byB9O1xuICAgICAgICByZXN1bHRbcXVvdGVdID0ge1xuICAgICAgICAgICAgJ2ZyZWUnOiBmaWF0LFxuICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAndG90YWwnOiBmaWF0L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nbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB2b2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSx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DQ1NC8yODY0NjgxNy01MDg0NTdmMi03MjZjLTExZTctOWVlYi0zNTI4ZDI0MTNhNTguanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLmdhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dhdGVjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2F0ZWNvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vR2F0ZWNvaW4vUkVTVGZ1bC1BUEktSW1wbGVtZW50YXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuZ2F0ZWNvaW4uY29tL3N3YWdnZXItdWkvaW5kZXguaHRtbCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0V4Y2hhbmdlUmF0ZScsIC8vIEdldCB0aGUgZXhjaGFuZ2UgcmF0ZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlcicsIC8vIEdldCBsaXZlIHRpY2tlciBmb3IgYWxsIGN1cnJlbmN5XG4gICAgICAgICAgICAgICAgICAgICAgICAnUHVibGljL0xpdmVUaWNrZXIve0N1cnJlbmN5UGFpcn0nLCAvLyBHZXQgbGl2ZSB0aWNrZXIgYnkgY3VycmVuY3lcbiAgICAgICAgICAgICAgICAgICAgICAgICdQdWJsaWMvTGl2ZVRpY2tlcnMnLCAvLyBHZXQgbGl2ZSB0aWNrZXIgZm9yIGFsbCBjdXJyZW5jeVxuICAgICAgICAgICAgICAgICAgICAgICAgJ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GFydCBkYXRlIGFuZCBlbmQgZGF0ZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BpbmcnLCAvLyBQb3N0IGEgc3RyaW5nLCB0aGVuIGdldCBpdCBiYWNrLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1B1YmxpYy9VbnN1YnNjcmliZS97RW1haWxDb2RlfScsIC8vIExldHMgdGhlIHVzZXIgdW5zdWJzY3JpYmUgZnJvbSBlbWFpbHNcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWdpc3RlclVzZXInLCAvLyBJbml0aWFsIHRyYWRlciByZWdpc3RyYXRpb24uXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0NvcnBvcmF0ZURhdGEnLCAvLyBHZXQgY29ycG9yYXRlIGFjY291bnQgZGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRBZGRyZXNzJywgLy8gQ2hlY2sgaWYgcmVzaWRlbmNlIHByb29mIHVwbG9hZGVkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gQ2hlY2sgaWYgcmVnaXN0ZXJlZCBkb2N1bWVudCB1cGxvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRG9jdW1lbnRJRCcsIC8vIENoZWNrIGlmIElEIGRvY3VtZW50IGNvcHkgdXBsb2FkZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDMgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwnLCAvLyBHZXQgdXNlciBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRmVlUmF0ZScsIC8vIEdldCBmZWUgcmF0ZSBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvTGV2ZWwnLCAvLyBHZXQgdmVyaWYgbGV2ZWwgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1BlcnNvbmFsSW5mb3JtYXRpb24nLCAvLyBHZXQgU3RlcDEgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGhvbmUnLCAvLyBHZXQgdXNlciBwaG9uZSBudW1iZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1Byb2ZpbGUnLCAvLyBHZXQgdHJhZGVyIHByb2ZpbGVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyBGaWxsIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbCcsIC8vIEdldCByZWZlcnJhbCBpbmZvcm1hdGlvblxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxDb2RlJywgLy8gR2V0IHRoZSByZWZlcnJhbCBjb2RlIG9mIHRoZSBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUmVmZXJyYWxOYW1lcycsIC8vIEdldCBuYW1lcyBvZiByZWZlcnJlZCB0cmFkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbFJld2FyZCcsIC8vIEdldCByZWZlcnJhbCByZXdhcmQgaW5mb3JtYXRpb25cbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmVkQ29kZScsIC8vIEdldCByZWZlcnJhbCBjb2RlXG4gICAgICAgICAgICAgICAgICAgIC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AgICAgICdUcmFkZS9PcmRlcnMnLCAvLyBHZXRzIG9wZW4gb3JkZXJzIGZvciB0aGUgbG9nZ2VkIGluIHRyYWRlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9PcmRlcnMve09yZGVySUR9JywgLy8gR2V0cyBhbiBvcmRlciBmb3IgdGhlIGxvZ2dlZCBpbiB0cmFkZXIuXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvU3RvcE9yZGVycycsIC8vIEdldHMgYWxsIHN0b3Agb3JkZXJzIGZvciB0aGUgbG9nZ2VkIGluIHRyYWRlci4gTWF4IDEwMDAgcmVjb3JkLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL1N0b3BPcmRlcnNIaXN0b3J5JywgLy8gR2V0cyBhbGwgc3RvcCBvcmRlcnMgZm9yIHRoZSBsb2dnZWQgaW4gdHJhZGVyLiBNYXggMTAwMCByZWNvcmQuXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvVHJhZGVzJywgLy8gR2V0cyBhbGwgdHJhbnNhY3Rpb25zIG9mIGxvZ2dlZCBpbiB1c2VyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvVXNlclRyYWRlcycsIC8vIEdldHMgYWxsIHRyYW5zYWN0aW9ucyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50QWRkcmVzcycsIC8vIFVwbG9hZCBhZGRyZXNzIHByb29mIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudENvcnBvcmF0aW9uJywgLy8gVXBsb2FkIHJlZ2lzdGVyZWQgZG9jdW1lbnQgZG9jdW1lbnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGxvYWQgSUQgZG9jdW1lbnQgY29weVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvUmVxdWVzdFZlcmlmeScsIC8vIFJlcXVlc3QgZm9yIHZlcmlmaWNhdGlvbiBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvRW1haWwvVmVyaWZ5JywgLy8gVmVyaWZpY2F0aW9uIGVtYWlsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Hb29nbGVBdXRoJywgLy8gRW5hYmxlIGdvb2dsZSBhdXRoXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9MZXZlbCcsIC8vIFJlcXVlc3QgdmVyaWYgbGV2ZWwgb2YgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyBGaWxsIHRoZSBxdWVzdGlvbm5haXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZWZlcnJhbCcsIC8vIFBvc3QgYSByZWZlcnJhbCBlbWFpbFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FQSUtleS9BUElLZXknLCAvLyBDcmVhdGUgYSBuZXcgQVBJIGtleSBmb3IgbG9nZ2VkIGluIHVzZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0NoYW5nZVBhc3N3b3JkJywgLy8gQ2hhbmdlIHBhc3N3b3JkLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0F1dGgvRm9yZ290UGFzc3dvcmQnLCAvLyBSZXF1ZXN0IHJlc2V0IHBhc3N3b3JkXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXV0aC9Gb3Jnb3RVc2VySUQnLCAvLyBSZXF1ZXN0IHVzZXIgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBdXRoL0xvZ2luJywgLy8gVHJhZGVyIHNlc3Npb24gbG9nIGluLlxuICAgICA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gZGF0YSBmb3IgY29ycG9yYXRlIGFjY291bnRcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0RvY3VtZW50SUQnLCAvLyBVcGRhdGUgSUQgZG9jdW1lbnQgbWV0YSBkYXRhXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9Eb2N1bWVudEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAzIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L0VtYWlsJywgLy8gVXBkYXRlIHVzZXIgZW1haWxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1BlcnNvbmFsSW5mb3JtYXRpb24nLCAvLyBVcGRhdGUgU3RlcDEgRGF0YVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvUGhvbmUnLCAvLyBVcGRhdGUgdXNlciBwaG9uZSBudW1iZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1F1ZXN0aW9ubmFpcmUnLCAvLyB1cGRhdGUgdGhlIHF1ZXN0aW9ubmFpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1JlZmVycmVkQ29kZScsIC8vIFVwZGF0ZSByZWZlcnJhbCBjb2RlXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWNjb3VudC9SZXNpZGVudEluZm9ybWF0aW9uJywgLy8gVXBkYXRlIFN0ZXAyIERhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY2NvdW50L1NlY3VyaXR5U2V0dGluZ3MnLCAvLyBVcGRhdGUgdmVyaWYgZGV0YWlscyBvZiBsb2dnZWQgaW4gdXNlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjY291bnQvVXNlcicsIC8vIFVwZGF0ZSBhbGwgdXNlciBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnQmFuay9Vc2VyQWNjb3VudHMnLCAvLyBVcGRhdGUgdGhlIGxhYmVsIG9mIGV4aXN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97RGlnaUN1cnJlbmN5fS97QWRkcmVzc05hbWV9JywgLy8gRGVsZXRlIGFuIGRpZ2l0YWwgY3VycmVuY3kgYWRkcmVzc2VzIHJlbGF0ZWQgdG8gdGhlIGxvZ2dlZCBpbiB1c2VyLlxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VsZWN0cm9uaWNXYWxsZXQvVXNlcldhbGxldHMve0RpZ2lDdXJyZW5jeX0ve0FkZHJlc3NOYW1lfScsIC8vIERlbGV0ZSBhbiBleHRlcm5hbCBkaWdpdGFsIGN1cnJlbmN5IGFkZHJlc3NlcyByZWxhdGVkIHRvIHRoZSBsb2dnZWQgaW4gdXNlci5cbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZS9PcmRlcnMnLCAvLyBDYW5jZWxzIGFsbCBleGlzdGluZyBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlL09yZGVycy97T3JkZXJJRH0nLCAvLyBDYW5jZWxzIGFuIGV4aXN0aW5nIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvU3RvcE9yZGVycycsIC8vIENhbmNlbHMgYWxsIGV4aXN0aW5nIHN0b3Agb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUvU3RvcE9yZGVycy97SUR9JywgLy8gQ2FuY2VscyBhbiBleGlzdGluZyBzdG9wIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMzUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTGl2ZVRpY2tlcnMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ3RpY2tlcnMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeVBhaXInXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZUJhbGFuY2VzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnYmFsYW5jZXMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZVsnYXZhaWxhYmxlQmFsYW5jZSddLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdGhpcy5zdW0gKFxuICAgICAgICAgICAgICAgICAgICBiYWxhbmNlWydwZW5kaW5nSW5jb21pbmcnXSxcbiAgICAgICAgICAgICAgICAgICAgYmFsYW5jZVsncGVuZGluZ091dGdvaW5nJ10sXG4gICAgICAgICAgICAgICAgICAgIGJhbGFuY2VbJ29wZW5PcmRlciddKSxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlWydiYWxhbmNlJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0UHVibGljTWFya2V0RGVwdGhDdXJyZW5jeVBhaXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnQ3VycmVuY3lQYW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gICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBjb250ZW50VHlwZSA9IChtZXRob2QgPT0gJ0dFVCcpID8gJycgOiAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG1ldGhvZCArIHVybCArIGNvbnRlbnRUeXBlICsgbm9uY2UudG9TdHJpbmcgKCk7XG4gICAgICAgICAgICBhdXRoID0gYXV0aC50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FQSV9QVUJMSUNfS0VZJzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FQSV9SRVFVRVNUX1NJR05BVFVSRSc6IHNpZ25hdHVyZSxcbiAgICAgICAgICAgICAgICAnQVBJX1JFUVVFU1RfREFURSc6IG5vbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgIT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzWydDb250ZW50LVR5cGUnXSA9IGNvbnRlbnRUeXBlO1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHRoaXMuZXh0ZW5kICh7ICdub25jZSc6IG5vbmNlIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHV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6IDYwLFxuICAgICAgICAgICAgICAgICc1bSc6IDMwMCxcbiAgICAgICAgICAgICAgICAnMTVtJzogOTAwLFxuICAgICAgICAgICAgICAgICczMG0nOiAxODAwLFxuICAgICAgICAgICAgICAgICcxaCc6IDM2MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMTJoJzogNDMyMDAsXG4gICAgICAgICAgICAgICAgJzFkJzogODY0MDAsXG4gICAgICAgICAgICAgICAgJzF3JzogNjA0ODAwLFxuICAgICAgICAgICAgICAgICcxTSc6IDI1OTIwMDAsXG4gICAgICAgICAgICAgICAgJzF5JzogMzE1MzYwMDAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ3Rlc3QnOiAnaHR0cHM6Ly9hcGktcHVibGljLnNhbmRib3guZ2RheC5jb20nLFxuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1MjctYjFiZTQxYzYtNWVkYi0xMWU3LTk1ZjYtNWI0OTZjNDY5ZTJjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5nZGF4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2RvY3MuZ2RheC5jb20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdwYXNzd29yZCc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmNpZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cy97aWR9L2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vY2FuZGxlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9zdGF0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2R1Y3RzL3tpZH0vdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2hvbGRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L2xlZGdlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29pbmJhc2UtYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kaW5nJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50LW1ldGhvZHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXBvcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXJzL3NlbGYvdHJhaWxpbmctdm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvY29pbmJhc2UtYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRpbmcvcmVwYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncG9zaXRpb24vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2ZpbGVzL21hcmdpbi10cmFuc2ZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVwb3J0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvY29pbmJhc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzL2NyeXB0bycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMvcGF5bWVudC1tZXRob2QnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiB0cnVlLCAvLyBjb21wbGljYXRlZCB0aWVyIHN5c3RlbSBwZXIgY29pblxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4zMCAvIDEwMCwgLy8gd29yc3QtY2FzZSBzY2VuYXJpbzogaHR0cHM6Ly93d3cuZ2RheC5jb20vZmVlcy9CVEMtVVNEXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVVInOiAwLjE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRCc6IDI1LFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDAuMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogMTAsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgYW1vdW50TGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ2Jhc2VfbWluX3NpemUnXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogbWFya2V0WydiYXNlX21heF9zaXplJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBtYXJrZXRbJ3F1b3RlX2luY3JlbWVudCddLFxuICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGNvc3RMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHByaWNlTGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogLU1hdGgubG9nMTAgKHBhcnNlRmxvYXQgKGFtb3VudExpbWl0c1snbWluJ10pKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiAtTWF0aC5sb2cxMCAocGFyc2VGbG9hdCAocHJpY2VMaW1pdHNbJ21pbiddKSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5mZWVzWyd0cmFkaW5nJ11bJ3Rha2VyJ107XG4gICAgICAgICAgICBpZiAoKGJhc2UgPT0gJ0VUSCcpIHx8IChiYXNlID09ICdMVEMnKSkge1xuICAgICAgICAgICAgICAgIHRha2VyID0gMC4wMDM7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzogbGltaXRzLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha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tYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoJ2ZpbGxfZmVlcycgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGZlZSA9IHtcbiAgICAgICAgICAgICAgICAnY29zdCc6IHBhcnNlRmxvYXQgKHRyYWRlWydmaWxsX2ZlZXMnXSksXG4gICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0WydxdW90ZSddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdHJhZGVbJ3RyYWRlX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnc2l6ZSddKSxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5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l0aGRyYXcoKSBlcnJvcjogJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogcmVzcG9uc2UsXG4gICAgICAgICAgICAnaWQnOiByZXNwb25zZVsnaWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXF1ZXN0ID0gJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLm9taXQgKHBhcmFtcywgdGhpcy5leHRyYWN0UGFyYW1zIChwYXRoKSk7XG4gICAgICAgIGlmIChtZXRob2QgPT0gJ0dFVCcpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICByZXF1ZXN0ICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyByZXF1ZXN0O1xuICAgICAgICBpZiAoYXBpID09ICdwcml2YXRlJykge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IHBheWxvYWQgPSAnJztcbiAgICAgICAgICAgIGlmIChtZXRob2QgIT0gJ0dFVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICA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YgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSA9PSBcIntcIikge1xuICAgICAgICAgICAgICAgIGxldCByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgICAgIGxldCBtZXNzYWdlID0gcmVzcG9uc2VbJ21lc3NhZ2UnXTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgncHJpY2UgdG9vIHNtYWxsJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmljZSB0b28gcHJlY2lzZScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PSAnSW52YWxpZCBBUEkgS2V5Jykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5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IwMCBmb3IgcHJpdmF0ZSBBUElcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODE2ODU3LWNlN2JlNjQ0LTYwOTYtMTFlNy04MmQ2LTNjMjU3MjYzMjI5Yy5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuZ2VtaW5pLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2dlbWluaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kb2NzLmdlbWluaS5jb20vcmVzdC1hcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2xzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwdWJ0aWNrZXIve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Jvb2sve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXVjdGlvbi97c3ltYm9sfS9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9uZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvY2FuY2VsL3Nlc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL2NhbmNlbC9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3N0YXR1cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdteXRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGV2b2x1bWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0L3tjdXJyZW5jeX0vbmV3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGVhcnRiZWF0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IGlkO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IG1hcmtldC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gdXBwZXJjYXNlLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHVwcGVyY2FzZS5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMjVcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0Qm9va1N5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdW5kZWZpbmVkLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ2Ftb3VudCcpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VyIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgIC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6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2x1bWUnXVtiYXNlVm9sdW1lXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ3ZvbHVtZSddW3F1b3RlVm9sdW1lXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndGltZXN0YW1wbXMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydwcmljZSddKSxcbiAgICAgICAgICAgICdhbW91bnQnOiBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaX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XBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ2hpdGJ0YycsXG4gICAgICAgICAgICAnbmFtZSc6ICdIaXRCVEMnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdISycsIC8vIEhvbmcgS29uZ1xuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDE1MDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICcxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTU1LThlYWVjMjBlLTVlZGMtMTFlNy05YzViLTZkYzY5ZmM0MmY1ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cDovL2FwaS5oaXRidGMuY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL2dpdGh1Yi5jb20vaGl0YnRjLWNvbS9oaXRidGMtYXBpL2Jsb2IvbWFzdGVyL0FQSXYxLm1kJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tzeW1ib2x9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAne3N5bWJvbH0vdHJhZGVzL3JlY2VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aW1lLCdcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9hY3RpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9yZWNlbnQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMvYnkvb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ25ld19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwYXltZW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve3RyYW5zYWN0aW9ufScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX3RyYWRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyX3RvX21haW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FkZHJlc3Mve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5b3V0JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogLTAuMDEgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGllckJhc2VkJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLjAwMDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDk1OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLjAwMTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMC4wMDA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAuMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTVInOiAwLjA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJzFTVCc6IDAuODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQURYJzogNS43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFJzogNi43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLjAxMDA2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDU2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTVAnOiA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FOVCc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUkRSJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUk4nOiAxOC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSVCc6IDI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUQic6IDAuMDAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEwnOiAyNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVE0nOiA1MDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRTJzogODYwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDEuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQVMnOiAxMTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNOJzogMC4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDEyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCS0InOiA0NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTVQnOiAxMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMi41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiA0LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRNJzogNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQ1QnOiAxMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEWCc6IDMwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDYxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NMRCc6IDAuODgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ05EJzogNTc0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDY1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NTTk8nOiAxNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFInOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAxNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1ZDJzogOC40NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQklYJzogMC4wMTY4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RDTic6IDEyMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDM0MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdERU5UJzogNjI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0InOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdEJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdESUNFJzogMC4zMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETFQnOiAwLjI2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ROVCc6IDAuMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9WJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFJQVSc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDI0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEU0gnOiAwLjAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJUQyc6IDIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVENPTEQnOiA2LjYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUNBVCc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VERyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRURPJzogMi45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMRSc6IDAuMDAxNzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxNJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1DJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTUdPJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMTYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDEuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFUk8nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEJTJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRQJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVZYJzogNS40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VYTic6IDQ1NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVUVMJzogMTIzLjAwMTA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDIwMi45NTk4MzA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZTic6IDEuODQ5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZZUCc6IDY2LjEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAuMDAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVVAnOiA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dWVCc6IDEuMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIQUMnOiAxNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAxMDgyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIVk4nOiAxMjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNOJzogMC41NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ08nOiAzNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ09TJzogMC4zNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkQnOiA3NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogNTkxMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAxNS4wMDEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDExLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0tCUic6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMTEyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMTMwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFJDJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFNLJzogMC4zLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xVTic6IDAuMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFJRCc6IDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUFOQSc6IDE0MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogNS40NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTU5FJzogMS4zMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNU1AnOiAxMjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogOTIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVlCJzogMy45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDE2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORUJMJzogMC4wNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdORVQnOiAzLjk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05UTyc6IDk5OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWEMnOiAxMy4zOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOWFQnOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09BWCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09NRyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1BUJzogMzM1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAyLjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT1ROJzogMC41NyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQQVknOiAzLjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUElYJzogOTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExCVCc6IDAuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExSJzogMTE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMVSc6IDAuODcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUE9FJzogNzg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAzLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFBUJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkUnOiAzMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAzOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUk8nOiA0MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUlMnOiA2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMC41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FBVSc6IDYzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogNjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdSS0MnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSVlQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAyLjI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NJU0EnOiAxNjQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NLSU4nOiA0MDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01BUlQnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMC4wMzc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOQyc6IDM2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiA0OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTlQnOiAyMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFgnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVUInOiAxNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAuNTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAuOTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMi4zNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSU1FJzogMC4wMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUSVgnOiA3LjEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiA4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUTlQnOiA5MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlNUJzogMS42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RSWCc6IDEzOTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVUVUJzogNDgwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFTic6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZFUkknOiAwLjAzNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiA1MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUJFJzogMTQ1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogNjE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dFQUxUSCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXSU5HUyc6IDIuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLjc1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAzLjIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFVDJzogMC45LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMTQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pBUCc6IDI0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDIzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pTQyc6IDE5MSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1NOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RJQ0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RMVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET1YnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQ0FUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVhOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVRUwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0JSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJTUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hCVCcpXG4gICAgICAgICAgICByZXR1cm4gJ0JUQyc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnRFJLJylcbiAgICAgICAgICAgIHJldHVybiAnREFTSCc7XG4gICAgICAgIGlmIChjdXJyZW5jeSA9PSAnQ0FUJylcbiAgICAgICAgICAgIHJldHVybiAnQml0Q2xhdmUnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1VTRCcpXG4gICAgICAgICAgICByZXR1cm4gJ1VTRFQnO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbHMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWydzeW1ib2xzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydzeW1ib2xzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnY29tbW9kaXR5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ2xvdCddKTtcbiAgICAgICAgICAgIGxldCBzdGVwID0gcGFyc2VGbG9hdCAobWFya2V0WydzdGVwJ10pO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdiYXNlSWQnOiBiYXNlSWQsXG4gICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3N0ZXAnOiBzdGVwLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnbG90J10pLFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsnc3RlcCddKSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHN0ZXAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIG1ldGhvZCArPSAnR2V0QmFsYW5jZSc7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCAndHlwZScpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHF1ZXJ5KTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxl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bXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vayk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYmlkJyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdvcGVuJyksXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAg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7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCB0aWNrZXIgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbFRpY2tlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBpZiAoJ21lc3NhZ2UnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGlja2VyWydtZXNzYWdlJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVswXSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0cmFkZVszXSxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodHJhZGVbM10pLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbNF0sXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsxXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbMl0pLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZ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Gl0eUxlYXZlcycpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGFtb3VudCAqPSBtYXJrZXRbJ2xvdCddO1xuICAgICAgICAgICAgcmVtYWluaW5nICo9IG1hcmtldFsnbG90J107XG4gICAgICAgIH1cbiAgICAgICAgaWYgKGFtb3VudCAmJiByZW1haW5pbmcpIHtcbiAgICAgICAgICAgIGZpbGxlZCA9IGFtb3VudCAtIHJlbWFpbmluZztcbiAgICAgICAgICAgIGNvc3QgPSBhdmVyYWdlUHJpY2UgKiBmaWxsZWQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydjbGllbnRPcmRlcklkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogdW5kZ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PYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0geyAnbm9uY2UnOiBub25jZSwgJ2FwaWtleSc6IHRoaXMuYXBpS2V5IH07XG4gICAgICAgICAgICBxdWVyeSA9IHRoaXMuZXh0ZW5kIChwYXlsb2FkLCBxdWVyeSk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGF5bG9hZCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IHVybDtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgICAgICAgICBhdXRoICs9IGJvZHk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ1gtU2lnbmF0dXJlJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYXV0aCksI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ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJ00xJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnTTMnLFxuICAgICAgICAgICAgICAgICc1bSc6ICdNNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICdNMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnTTMwJywgLy8gZGVmYXVsdFxuICAgICAgICAgICAgICAgICcxaCc6ICdIMScsXG4gICAgICAgICAgICAgICAgJzRoJzogJ0g0JyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnRDEnLFxuICAgICAgICAgICAgICAgICcxdyc6ICdENycsXG4gICAgICAgICAgICAgICAgJzFNJzogJzFNJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NTU1LThlYWVjMjBlLTVlZGMtMTFlNy05YzViLTZkYzY5ZmM0MmY1ZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2hpdGJ0Yy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkuaGl0YnRjLmNvbScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsIC8vIEF2YWlsYWJsZSBDdXJyZW5jeSBTeW1ib2xzXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tzeW1ib2x9JywgLy8gR2V0IHN5bWJvbCBpbmZvXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLCAvLyBBdmFpbGFibGUgQ3VycmVuY2llc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tjdXJyZW5jeX0nLCAvLyBHZXQgY3VycmVuY3kgaW5mb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsIC8vIFRpY2tlciBsaXN0IGZvciBhbGwgc3ltYm9sc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97c3ltYm9sfScsIC8vIFRpY2tlciBmb3Igc3ltYm9sXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tzeW1ib2x9JywgLy8gVHJhZGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rL3tzeW1ib2x9JywgLy8gT3JkZXJib29rXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuZGxlcy97c3ltYm9sfScsIC8vIENhbmRsZXNcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gTGlzdCB5b3VyIGN1cnJlbnQgb3BlbiBvcmRlcnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci97Y2xpZW50T3JkZXJJZH0nLCAvLyBHZXQgYSBzaW5nbGUgb3JkZXIgYnkgY2xpZW50T3JkZXJJZFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmcvYmFsYW5jZScsIC8vIEdldCB0cmFkaW5nIGJhbGFuY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkaW5nL2ZlZS97c3ltYm9sfScsIC8vIEdldCB0cmFkaW5nIGZlZSByYXRlXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS90cmFkZXMnLCAvLyBHZXQgaGlzdG9yaWNhbCB0cmFkZXNcbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L29yZGVyJywgLy8gR2V0IGhpc3RvcmljYWwgb3JkZXJzXG4gICAgICAgICAgICAgICAgICAgICAgICAnaGlzdG9yeS9vcmRlci97aWR9L3RyYWRlcycsIC8vIEdldCBoaXN0b3JpY2FsIHRyYWRlcyBieSBzcGVjaWZpZWQgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLCAvLyBHZXQgbWFpbiBhY2Njb3VudCBiYWxhbmNlXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC90cmFuc2FjdGlvbnMnLCAvLyBHZXQgYWNjb3VudCB0cmFuc2FjdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3RyYW5zYWN0aW9ucy97aWR9JywgLy8gR2V0IGFjY291bnQgdHJhbnNhY3Rpb24gYnkgaWRcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by9hZGRyZXNzL3tjdXJyZW5jeX0nLCAvLyBHZXQgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdycsIC8vIFdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL2FkZHJlc3Mve2N1cnJlbmN5fScsIC8vIENyZWF0ZSBuZXcgZGVwb3NpdCBjcnlwcm8gYWRkcmVzc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvdHJhbnNmZXInLCAvLyBUcmFuc2ZlciBhbW91bnQgdG8gdHJhZGluZ1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENyZWF0ZSBuZXcgb3JkZXJcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2NyeXB0by93aXRoZHJhdy97aWR9JywgLy8gQ29tbWl0IHdpdGhkcmF3IGNyeXByb1xuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyJywgLy8gQ2FuY2VsIGFsbCBvcGVuIG9yZGVyc1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBvcmRlclxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvY3J5cHRvL3dpdGhkcmF3L3tpZH0nLCAvLyBSb2xsYmFjayB3aXRoZHJhdyBjcnlwcm9cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3BhdGNoJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL3tjbGllbnRPcmRlcklkfScsIC8vIENhbmNlbCBSZXBsYWNlIG9yZGVyXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IC0wLjAxIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjEgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDA5LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAuMDA5NTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDE4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JURyc6IDAuMDAwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLjAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLjAwMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLjg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDUuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRSc6IDYuNyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBRU9OJzogMC4wMTAwNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBSVInOiA1NjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiA2LjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJEUic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJOJzogMTguNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBUlQnOiAyNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLjAwMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRMJzogMjcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogNTA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUUyc6IDg2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVlQnOiAxLjksXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMTEzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDTic6IDAuMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCRVQnOiAxMjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1DJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk1UJzogMTAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JOVCc6IDIuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlFYJzogNC43LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDQwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUWCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlVTJzogMC4wMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0NUJzogMTE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NEVCc6IDEwMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAzMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRkknOiA2MSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTEQnOiAwLjg4LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NORCc6IDU3NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTlgnOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NPU1MnOiA2NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDU05PJzogMTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RYJzogMTQ2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDguNDYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAuMDE2OCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ04nOiAxMjAwMDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENUJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdEREYnOiAzNDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDYyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RHRCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRElDRSc6IDAuMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRExUJzogMC4yNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdETlQnOiAwLjIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPVic6IDM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEUlQnOiAyNDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMC4wMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUJFVCc6IDg0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VCVEMnOiAyMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogNi42LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VDQVQnOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDIuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTEUnOiAwLjAwMTcyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VMTSc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDE0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VOSic6IDE2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAxLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVJPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUQyc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUUCc6IDAuMDA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDUuNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFWE4nOiA0NTYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlJEJzogNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRlVFTCc6IDEyMy4wMDEwNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGVU4nOiAyMDIuOTU5ODMwOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWU4nOiAxLjg0OSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiA2Ni4xMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLjAwMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAxLjIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEFDJzogMTQ0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hERyc6IDcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSEdUJzogMTA4MixcbiAgICAgICAgICAgICAgICAgICAgICAgICdIUEMnOiAwLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMTIwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAuNTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPJzogMzQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAuMzUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogNzYsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5ESSc6IDU5MTMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSVRTJzogMTUuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdJWFQnOiAxMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLQlInOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0lDSyc6IDExMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDQxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xBVCc6IDEuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTElGRSc6IDEzMDAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xSQyc6IDI3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAuMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVU4nOiAwLjM0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BSUQnOiA1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01BTkEnOiAxNDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUNBUCc6IDUuNDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUlQUyc6IDQzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ORSc6IDEuMzMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVNQJzogMTIxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01USCc6IDkyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01ZQic6IDMuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOREMnOiAxNjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAuMDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMy45NixcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiA5OTgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhDJzogMTMuMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPRE4nOiAwLjAwNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPTUcnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09QVCc6IDMzNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUk1FJzogMi44LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAuNTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BJWCc6IDk2LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDExNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQTFUnOiAwLjg3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPRSc6IDc4NCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0xMJzogMy41LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMzIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJHJzogMzksXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJPJzogNDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogNjAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFRPWSc6IDAuNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiA2MyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQ04nOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FUVU0nOiAwLjA0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FWVCc6IDY0LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUktDJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0FOJzogMi4yNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQkQnOiAwLjAzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NDTCc6IDIuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMTY0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogNDA3LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNQVJUJzogMC40LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NNUyc6IDAuMDM3NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAzNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkdMUyc6IDQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05NJzogNDgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU05UJzogMjMzLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NURUVNJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFJBVCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RVJzogMTQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RYJzogMTEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMTcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VSJzogMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTV1QnOiAwLjUxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RBQVMnOiAwLjkxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RCVCc6IDIuMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEZMJzogMTUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElNRSc6IDAuMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVElYJzogNy4xLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RLTic6IDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtSJzogODQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVE5UJzogOTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDEuNixcbiAgICAgICAgICAgICAgICAgICAgICAgICdUUlgnOiAxMzk1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VFVCc6IDQ4MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVR1QnOiAxNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRU4nOiAxNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMC4wMzcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCJzogNTAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVklCRSc6IDE0NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWT0lTRSc6IDYxOCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLjAxNjgsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV0lOR1MnOiAyLjQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV1RDJzogMC43NSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYQVVSJzogMy4yMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYRE4nOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hFTSc6IDE1LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hVQyc6IDAuOSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdZT1lPVyc6IDE0MCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAyNCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaUlgnOiAyMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaU0MnOiAxOTEsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAwMyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JDSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pFQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICcxU1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FEWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FFT04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FJUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQU1QJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBTlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSRFInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FSTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVEInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FUTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQVRNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FWVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkFTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JFVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQktCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCTUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JNVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQk5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCUVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVVMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NDVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0RUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDRFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NGSSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDTkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NOWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ09TUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1NOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ1RSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDVFgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NWQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREJJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRENOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQ1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RERic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREVOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREdCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdER0QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RJQ0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RMVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE5UJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET1YnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSUFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRFNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQlRDT0xEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFQ0FUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFREcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VETyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRUxFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFTE0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VNQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU1HTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU5KJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRCUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVFAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VWWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVhOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGUkQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVRUwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0ZVTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRllOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdGWVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR1VQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHVlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hBQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSERHJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdIR1QnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0hQQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSFZOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSUNPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSU5EJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJTkRJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJVFMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lYVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnS0JSJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdLSUNLJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMQSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTEFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMSUZFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMUkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xTSyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQUlEJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQU5BJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNQ0FQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNSVBTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNTkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01TUCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdNWUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05EQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVCTCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTkVUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdOVE8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ05YQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTlhUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPQVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09ETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT01HJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPUFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09STUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09UTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUEFZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQSVgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMQlQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BMUic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUExVJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQT0UnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BPTEwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BQVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQUkcnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BSTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUFJTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdQVE9ZJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRQVUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1FDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVRVTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUVZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSRVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JLQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUlZUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTQU4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NCRCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU0NMJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTSVNBJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTS0lOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTUFSVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU01TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTkMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOR0xTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTTk0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NOVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1RFRU0nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUUkFUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVFUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NUWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU1VCJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdTVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NXVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEFBUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEJUJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdURkwnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJTUUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RJWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVEtOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUS1InOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ROVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJTVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVFJYJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVRVQnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VHVCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVkVOJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWRVJJJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdWSUInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZJQkUnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1ZPSVNFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXRUFMVEgnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dJTkdTJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hBVVInOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hETic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWEVNJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYVUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1lPWU9XJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaQVAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1pSWCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWlNDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY3VycmVuY3lJZCAoY3VycmVuY3kpIHtcbiAgICAgICAgaWYgKGN1cnJlbmN5ID09ICdCaXRDbGF2ZScpXG4gICAgICAgICAgICByZXR1cm4gJ0NBVCc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBmZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBmZWUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1bmNhdGUgKGZlZSwgOCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFN5bWJvbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2VJZCA9IG1hcmtldFsnYmFzZUN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGVDdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZUlkKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZUlkKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICBsZXQgbG90ID0gcGFyc2VGbG9hdCAobWFya2V0WydxdWFudGl0eUluY3JlbWVudCddKTtcbiAgICAgICAgICAgIGxldCBzdGVwID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0aWNrU2l6ZSddKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogdGhpcy5wcmVjaXNpb25Gcm9tU3RyaW5nIChtYXJrZXRbJ3RpY2tTaXplJ10pLFxuICAgICAgICAgICAgICAgICdhbW91bnQnOiB0aGlzLnByZWNpc2lvbkZyb21TdHJpbmcgKG1hcmtldFsncXVhbnRpdHlJbmNyZW1lbnQnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHRha2VyID0gcGFyc2VGbG9hdCAobWFya2V0Wyd0YWtlTGlxdWlkaXR5UmF0ZSddKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHBhcnNlRmxvYXQgKG1hcmtldFsncHJvdmlkZUxpcXVpZGl0eVJhdGUnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnc3RlcCc6IHN0ZXAsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogdGFrZXIsXG4gICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBzdGVwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90ICogc3RlcCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQ3VycmVuY2llcyAocGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldEN1cnJlbmN5IChwYXJhbXMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5WydpZCddO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBwYXlpbiA9IGN1cnJlbmN5WydwYXlpbkVuYWJsZWQnXTtcbiAgICAgICAgICAgIGxldCBwYXlvdXQgPSBjdXJyZW5jeVsncGF5b3V0RW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IHRyYW5zZmVyID0gY3VycmVuY3lbJ3RyYW5zZmVyRW5hYmxlZCddO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IHBheWluICYmIHBheW91dCAmJiB0cmFuc2ZlcjtcbiAgICAgICAgICAgIGxldCBzdGF0dXMgPSAnb2snO1xuICAgICAgICAgICAgaWYgKCdkaXNhYmxlZCcgaW4gY3VycmVuY3kpXG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5WydkaXNhYmxlZCddKVxuICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAnZGlzYWJsZWQnO1xuICAgICAgICAgICAgbGV0IHR5cGUgPSAoY3VycmVuY3lbJ2NyeXB0byddKSA/ICdjcnlwdG8nIDogJ2ZpYXQnO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAgICAgJ3BheWluJzogcGF5aW4sXG4gICAgICAgICAgICAgICAgJ3BheW91dCc6IHBheW91dCxcbiAgICAgICAgICAgICAgICAndHJhbnNmZXInOiB0cmFuc2ZlcixcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ2Z1bGxOYW1lJ10sXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IGFjdGl2ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgICAgICdmZWUnOiB1bmRlZmluZWQsIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgdHlwZSA9IHRoaXMuc2FmZVN0cmluZyAocGFyYW1zLCAndHlwZScsICd0cmFkaW5nJyk7XG4gICAgICAgIGxldCBtZXRob2QgPSAncHJpdmF0ZUdldCcgKyB0aGlzLmNhcGl0YWxpemUgKHR5cGUpICsgJ0JhbGFuY2UnO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzW21ldGhvZF0gKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNlcy5sZW5ndGg7IGIrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tiXTtcbiAgICAgICAgICAgIGxldCBjb2RlID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldC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IHN5bWJvbCA9IGlkO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGxldCBmZWUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gbWFya2V0ID8gbWFya2V0WydxdW90ZSddIDogdW5kZWZpbmVkO1xuICAgICAgICAgICAgZmVlID0ge1xuICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKSxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgbGV0IG9yZGVySWQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnY2xpZW50T3JkZXJJZCcgaW4gdHJhZGUpXG4gICAgICAgICAgICBvcmRlcklkID0gdHJhZGVbJ2NsaWVudE9yZGVySWQnXTtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbJ3F1YW50aXR5J10pO1xuICAgICAgICBsZXQgY29zdCA9IHByaWNlICogYW1vdW50O1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ29yZGVyJzogb3JkZXJJZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6I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UgaWYgKHN0YXR1cyA9PSAnc3VzcGVuZGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAncGFydGlhbGx5RmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ29wZW4nO1xuICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PSAnZmlsbGVkJykge1xuICAgICAgICAgICAgc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGlkID0gb3JkZXJbJ2NsaWVudE9yZGVySWQnXS50b1N0cmluZyAoKTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncHJpY2UnKTtcbiAgICAgICAgaWYgKHR5cGVvZiBwcmljZSA9PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMub3JkZXJzKVxuICAgICAgICAgICAgICAgIHByaWNlID0gdGhpcy5vcmRlcnNbaWRdWydwcmljZSddO1xuICAgICAgICB9XG4gICAgICAgIGxldCByZW1haW5pbmcgPSB1bmRlZmluZWQ7XG4gICAgICAgIGxldCBjb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHlwZW9mIGFtb3VudCAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgaWYgKHR5cGVvZiBmaWxsZWQgIT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICByZW1haW5pbmcgPSBhbW91bnQgLSBmaWxsZWQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwcmljZSAhPSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgICAgICAgICBjb3N0ID0gZmlsbGVkICogcHJpY2U7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiBjcmVhdGVkLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxIChjcmVhdGVkKSxcbiAgICAgICAgICAgICdjcmVhdGVkJzogY3JlYXRlZCxcbiAgICAgICAgICAgICd1cGRhdGVkJzogdXBkYXRlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3R5cGUnOiBvcmRlclsndHlwZSddLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiByZW1haW5pbmcsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRIaXN0b3J5T3JkZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnY2xpZW50T3JkZXJJZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG51bU9yZGVycyA9IHJlc3BvbnNlLmxlbmd0aDtcbiAgICAgICAgaWYgKG51bU9yZGVycyA+IDApXG4gICAgICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZG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5KS5sZW5ndGgpXG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcGF5bG9hZCA9IHRoaXMuZW5jb2RlICh0aGlzLmFwaUtleSArICc6JyArIHRoaXMuc2VjcmV0KTtcbiAgICAgICAgICAgIGxldCBhdXRoID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAocGF5bG9hZCk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBdXRob3JpemF0aW9uJzogXCJCYXNpYyBcIiArIHRoaXMuZGVjb2RlIChhdXRoKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGhhbmRsZUVycm9ycyAoY29kZSwgcmVhc29uLCB1cmwsIG1ldGhvZCwgaGVhZGVycywgYm9keSkge1xuICAgICAgICBpZiAoY29kZSA9PSA0MDApIHtcbiAgICAgICAgICAgIGlmIChib2R5WzBdID09IFwie1wiKSB7XG4gICAgICAgICAgICAgICAgbGV0IHJlc3BvbnNlID0gSlNPTi5wYXJzZSAoYm9keSk7XG4gICAgICAgICAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCdtZXNzYWdlJyBpbiByZXNwb25zZVsnZXJyb3InXSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSByZXNwb25zZVsnZXJyb3InXVsnbWVzc2FnZSddO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2UgPT0gJ09yZGVyIG5vdCBmb3VuZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgb3JkZXIgbm90IGZvdW5kIGluIGFjdGl2ZSBvcmRlcnMnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWVzc2FnZSA9PSAnSW5zdWZmaWNpZW50IGZ1bmRzJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGF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mknLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdDTicsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMDAxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnMDA1JyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzAxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICcwMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICcwNjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxMDAnLFxuICAgICAgICAgICAgICAgICcxdyc6ICcyMDAnLFxuICAgICAgICAgICAgICAgICcxTSc6ICczMDAnLFxuICAgICAgICAgICAgICAgICcxeSc6ICc0MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwOi8vYXBpLmh1b2JpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5odW9iaS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9naXRodWIuY29tL2h1b2JpYXBpL0FQSV9Eb2NzX2VuL3dpa2knLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3N0YXRpY21hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3VzZG1hcmtldCc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICd7aWR9X2tsaW5lX3twZXJpb2R9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXJfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGhfe2lkfV97bGVuZ3RofScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsX3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RyYWRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfYWNjb3VudF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eV9tYXJrZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxfbWFya2V0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9uZXdfZGVhbF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9vcmRlcl9pZF9ieV90cmFkZV9pZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3dpdGhkcmF3X2NvaW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF93aXRoZHJhd19jb2luX3Jlc3VsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNmZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW4nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2xvYW5fYXZhaWxhYmxlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DTlknOiB7ICdpZCc6ICdidGMnLCAnc3ltYm9sJzogJ0JUQy9DTlknLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnQ05ZJywgJ3R5cGUnOiAnc3RhdGljbWFya2V0JywgJ2NvaW5UeXBlJzogMSB9LFxuICAgICAgICAgICAgICAgICdMVEMvQ05ZJzogeyAnaWQnOiAnbHRjJywgJ3N5bWJvbCc6ICdMVEMvQ05ZJywgJ2Jhc2UnOiAnTFRDJywgJ3F1b3RlJzogJ0NOWScsICd0eXBlJzogJ3N0YXRpY21hcmtldCcsICdjb2luVHlwZSc6IDIgfSxcbiAgICAgICAgICAgICAgICAv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GV0IG1ldGhvZCA9IG1hcmtldFsndHlwZSddICsgJ0dldFRpY2tlcklkJztcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWyd0aWNrZXInXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChyZXNwb25zZVsndGltZSddKSAqIDEwMDA7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2hpZ2gnKSxcbiAgICAgICAgICAgICdsb3cnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbG93JyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2J1eScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdzZWxsJyksXG4gICAgICAgICAgICAndndhcCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdvcGVuJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ29wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xhc3QnKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sJyksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsndHMnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsnaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnZGlyZWN0aW9uJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVsnYW1vdW50J10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbC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ICAgIHF1ZXJ5WydzaWduJ10gPSB0aGlzLmhhc2ggKHRoaXMuZW5jb2RlIChxdWVyeVN0cmluZykpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB1cmwgKz0gJy8nICsgYXBpICsgJy8nICsgdGhpcy5pbXBsb2RlUGFyYW1zIChwYXRoLCBwYXJhbXMpICsgJ19qc29uLmpzJztcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICd0cmFkZScsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhcmFtcywgaGVhZGVycywgYm9keSk7XG4gICAgICAgIGlmICgnc3RhdHVzJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIGlmIChyZXNwb25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AgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndXNlckFnZW50JzogdGhpcy51c2VyQWdlbnRzWydjaHJvbWUzOSddLFxuICAgICAgICAgICAgJ3ZlcnNpb24nOiAndjEnLFxuICAgICAgICAgICAgJ2FjY291bnRzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2FjY291bnRzQnlJZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdob3N0bmFtZSc6ICdhcGkuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAvLyBvYnNvbGV0ZSBtZXRhaW5mbyBzdHJ1Y3R1cmVcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBzdHJ1Y3R1cmVcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hDTFYnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzFtJzogJzFtaW4nLFxuICAgICAgICAgICAgICAgICc1bSc6ICc1bWluJyxcbiAgICAgICAgICAgICAgICAnMTVtJzogJzE1bWluJyxcbiAgICAgICAgICAgICAgICAnMzBtJzogJzMwbWluJyxcbiAgICAgICAgICAgICAgICAnMWgnOiAnNjBtaW4nLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnMXcnOiAnMXdlZWsnLFxuICAgICAgICAgICAgICAgICcxTSc6ICcxbW9uJyxcbiAgICAgICAgICAgICAgICAnMXknOiAnMXllYXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1NjktMTVhYTdiOWEtNWVkZC0xMWU3LTllN2YtNDQ3OTFmNGVlNDljLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5odW9iaS5wcm8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaHVvYmkucHJvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vZ2l0aHViLmNvbS9odW9iaWFwaS9BUElfRG9jcy93aWtpL1JFU1RfYXBpX3JlZmVyZW5jZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAnbWFya2V0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2hpc3Rvcnkva2xpbmUnLCAvLyDojrflj5ZL57q/5pWw5o2uXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsL21lcmdlZCcsIC8vIOiOt+WPluiBmuWQiOihjOaDhShUaWNrZXIpXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLCAvLyDojrflj5YgTWFya2V0IERlcHRoIOaVsOaNrlxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJywgLy8g6I635Y+WIFRyYWRlIERldGFpbCDmlbDmja5cbiAgICAgICAgICAgICAgICAgICAgICAgICdoaXN0b3J5L3RyYWRlJywgLy8g5om56YeP6I635Y+W5pyA6L+R55qE5Lqk5piT6K6w5b2VXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGV0YWlsJywgLy8g6I635Y+WIE1hcmtldCBEZXRhaWwgMjTlsI/ml7bmiJDkuqTph4/mlbDmja5cbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3N5bWJvbHMnLCAvLyDmn6Xor6Lns7vnu5/mlK/mjIHnmoTmiYDmnInkuqTmmJPlr7lcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb21tb24vY3VycmVuY3lzJywgLy8g5p+l6K+i57O757uf5pSv5oyB55qE5omA5pyJ5biB56eNXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29tbW9uL3RpbWVzdGFtcCcsIC8vIOafpeivouezu+e7n+W9k+WJjeaXtumXtFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9hY2NvdW50cycsIC8vIOafpeivouW9k+WJjeeUqOaIt+eahOaJgOaciei0puaItyjljbNhY2NvdW50LWlkKVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQvYWNjb3VudHMve2lkfS9iYWxhbmNlJywgLy8g5p+l6K+i5oyH5a6a6LSm5oi355qE5L2Z6aKdXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzL3tpZH0nLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXor6bmg4VcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMve2lkfS9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6Lmn5DkuKrorqLljZXnmoTmiJDkuqTmmI7nu4ZcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMnLCAvLyDmn6Xor6LlvZPliY3lp5TmiZjjgIHljoblj7Llp5TmiZhcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9tYXRjaHJlc3VsdHMnLCAvLyDmn6Xor6LlvZPliY3miJDkuqTjgIHljoblj7LmiJDkuqRcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2FkZHJlc3NlcycsIC8vIOafpeivouiZmuaLn+W4geaPkOeOsOWcsOWdgFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9vcmRlcnMvcGxhY2UnLCAvLyDliJvlu7rlubbmiafooYzkuIDkuKrmlrDorqLljZUgKOS4gOatpeS4i+WNle+8jCDmjqjojZDkvb/nlKgpXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvb3JkZXJzJywgLy8g5Yib5bu65LiA5Liq5paw55qE6K6i5Y2V6K+35rGCIO+8iOS7heWIm+W7uuiuouWNle+8jOS4jeaJp+ihjOS4i+WNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3BsYWNlJywgLy8g5omn6KGM5LiA5Liq6K6i5Y2VIO+8iOS7heaJp+ihjOW3suWIm+W7uueahOiuouWNle+8iVxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy97aWR9L3N1Ym1pdGNhbmNlbCcsIC8vIOeUs+ivt+aSpOmUgOS4gOS4quiuouWNleivt+axglxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyL29yZGVycy9iYXRjaGNhbmNlbCcsIC8vIOaJuemHj+aSpOmUgOiuouWNlVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L2JhbGFuY2UvdHJhbnNmZXInLCAvLyDotYTkuqfliJLovaxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkdy93aXRoZHJhdy12aXJ0dWFsL2NyZWF0ZScsIC8vIOeUs+ivt+aPkOeOsOiZmuaLn+W4gVxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9wbGFjZScsIC8vIOehruiupOeUs+ivt+iZmuaLn+W4geaPkOeOsFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2R3L3dpdGhkcmF3LXZpcnR1YWwve2lkfS9jYW5jZWwnLCAvLyDnlLPor7flj5bmtojmj5DnjrDomZrmi5/luIFcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRDb21tb25TeW1ib2xzICgpO1xuICAgICAgICBsZXQgbWFya2V0cyA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCBudW1NYXJrZXRzID0gbWFya2V0cy5sZW5ndGg7XG4gICAgICAgIGlmIChudW1NYXJrZXRzIDwgMSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBwdWJsaWNHZXRDb21tb25TeW1ib2xzIHJldHVybmVkIGVtcHR5IHJlc3BvbnNlOiAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaV07XG4gICAgICAgICAgICBsZXQgYmFzZUlkID0gbWFya2V0WydiYXNlLWN1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgcXVvdGVJZCA9IG1hcmtldFsncXVvdGUtY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gYmFzZUlkLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gcXVvdGVJZC50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBpZCA9IGJhc2VJZCArIHF1b3RlSWQ7XG4gICAgICAgICAgICBiYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGJhc2UpO1xuICAgICAgICAgICAgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGUpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50LXByZWNpc2lvbiddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncHJpY2UtcHJlY2lzaW9uJ10sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxvdCA9IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsnYW1vdW50J10pO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gKGJhc2UgPT0gJ09NRycpID8gMCA6IDAuMiAvIDEwMDtcbiAgICAgICAgICAgIGxldCB0YWtlciA9IChiYXNlID09ICdPTUcnKSA/IDAgOiAwLjIgLyAxMDA7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdsb3QnOiBsb3QsXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGxvdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydwcmljZSddKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGxhc3QgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgnbGFzdCcgaW4gdGlja2VyKVxuICAgICAgICAgICAgbGFzdCA9IHRpY2tlclsnbGFzdCddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGlmICgndHMnIGluIHRpY2tlcilcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHRpY2tlclsndHMnXTtcbiAgICAgICAgbGV0IGJpZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGFzayA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKCdiaWQnIGluIHRpY2tlcikge1xuICAgICAgICAgICAgaWYgKHRpY2tlclsnYmlkJ10pXG4gICAgICAgICAgICAgICAgYmlkID0gdGhpcy5zYWZlRmxvYXQgKHRpY2tlclsnYmlkJ10sIDApO1xuICAgICAgICB9XG4gICAgICAgIGlmICgnYXNrJyBpbiB0aWNrZXIpIHtcbiAgICAgICAgICAgIGlmICh0aWNrZXJbJ2FzayddKVxuICAgICAgICAgICAgICAgIGFzayA9IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXJbJ2FzayddLCAwKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnaGlnaCddLFxuICAgICAgICAgICAgJ2xvdyc6IHRpY2tlclsnbG93J10sXG4gICAgICAgICAgICAnYmlkJzogYmlkLFxuICAgICAgICAgICAgJ2Fzayc6IGFzayxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB0aWNrZXJbJ29wZW4nXSxcbiAgICAgICAgICAgICdjbG9zZSc6IHRpY2tlclsnY2xvc2UnXSxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgIC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uIHRoaXMucGFyc2VPSExDVnMgKHJlc3BvbnNlWydkYXRhJ10sIG1hcmtldCwgdGltZWZyYW1lLCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGxvYWRBY2NvdW50cyAocmVsb2FkID0gZmFsc2UpIHtcbiAgICAgICAgaWYgKHJlbG9hZCkge1xuICAgICAgICAgICAgdGhpcy5hY2NvdW50cyA9IGF3YWl0IHRoaXMuZmV0Y2hBY2NvdW50cyAoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGlmICh0aGlzLmFjY291bnRzKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYWNjb3VudHM7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHRoaXMuYWNjb3VudHMgPSBhd2FpdCB0aGlzLmZldGNoQWNjb3VudHMgKCk7XG4gICAgICAgICAgICAgICAgdGhpcy5hY2NvdW50c0J5SWQgPSB0aGlzLmluZGV4QnkgKHRoaXMuYWNjb3VudHMsICdpZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLmFjY291bnRzO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQWNjb3VudHMgKCkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRBY2NvdW50QWNjb3VudHMgKCk7XG4gICAgICAgIHJldHVybiByZXNwb25zZVsnZGF0YSddO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkQWNjb3VudHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRBY2NvdW50c0lkQmFsYW5jZSAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMuYWNjb3VudHNbMF1bJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsnZGF0YSddWydsaXN0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogcmVzcG9uc2UgfTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBiYWxhbmNlcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1tpXTtcbiAgICAgICAgICAgIGxldCB1cHBlcmNhc2UgPSBiYWxhbmNlWydjdXJyZW5jeSddLnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChjdXJyZW5jeSBpbiByZXN1bHQpXG4gICAgICAgICAgICAgICAgYWNjb3VudCA9IHJlc3VsdFtjdXJyZW5jeV07XG4gICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgYWNjb3VudCA9IHRoaXMuYWNjb3VudCAoKTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT0gJ3RyYWRlJylcbiAgICAgICAgICAgICAgICBhY2NvdW50WydmcmVlJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R5cGUnXSA9PSAnZnJvemVuJylcbiAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWydiYWxhbmNlJ10pO1xuICAgICAgICAgICAgYW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0ICgnLScpO1xuICAgICAgICAgICAgc2lkZSA9IG9yZGVyVHlwZVswXTtcbiAgICAgICAgICAgIHR5cGUgPSBvcmRlclR5cGVbMV07XG4gICAgICAgICAgICBzdGF0dXMgPSB0aGlzLnBhcnNlT3JkZXJTdGF0dXMgKG9yZGVyWydzdGF0ZSddKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKSB7XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzeW1ib2wnXSBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmtldElkID0gb3JkZXJbJ3N5bWJvbCddO1xuICAgICAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbbWFya2V0SWRdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IG9yZGVyWydjcmVhdGVkLWF0J107XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0IChvcmRlclsnYW1vdW50J10pO1xuICAgICAgICBsZXQgZmlsbGVkID0gcGFyc2VGbG9hdCAob3JkZXJbJ2ZpZWxkLWFtb3VudCddKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IHByaWNlID0gcGFyc2VGbG9hdCAob3JkZXJbJ3ByaWNlJ10pO1xuICAgICAgICBsZXQgY29zdCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWVsZC1jYXNoLWFtb3VudCddKTtcbiAgICAgICAgbGV0IGF2ZXJhZ2UgPSAwO1xuICAgICAgICBpZiAoZmlsbGVkKVxuICAgICAgICAgICAgYXZlcmFnZSA9IHBhcnNlRmxvYXQgKGNvc3QgLyBmaWxsZWQpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZEFjY291bnRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9I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gICAgICAgYXV0aCArPSAnJicgKyB0aGlzLnVybGVuY29kZSAoeyAnU2lnbmF0dXJlJzogc2lnbmF0dXJlIH0pO1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIGF1dGg7XG4gICAgICAgICAgICBpZiAobWV0aG9kID09ICdQT1NUJykge1xuICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfVxuICAgICAgICB1cmwgPSB0aGlzLnVybHNbJ2FwaSddICsgdXJsO1xuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ3N0YXR1cycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICBpZiAocmVzcG9uc2VbJ3N0YXR1cyddID09ICdlcnJvcicpXG4gICAgICAgICAgICAgIC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iLTExZTctODliYy1kMWFjODUwMTJlZGEuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmluZGVwZW5kZW50cmVzZXJ2ZS5jb20vUHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbS9Qcml2YXRlJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaW5kZXBlbmRlbnRyZXNlcnZlLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5pbmRlcGVuZGVudHJlc2VydmUuY29tL0FQSScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkUHJpbWFyeUN1cnJlbmN5Q29kZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkU2Vjb25kYXJ5Q3VycmVuY3lDb2RlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRMaW1pdE9yZGVyVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldFZhbGlkTWFya2V0T3JkZXJUeXBlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VmFsaWRPcmRlclR5cGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRWYWxpZFRyYW5zYWN0aW9uVHlwZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE1hcmtldFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldE9yZGVyQm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhZGVIaXN0b3J5U3VtbWFyeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0UmVjZW50VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRGeFJhdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdQbGFjZUxpbWl0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1BsYWNlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldENsb3NlZEZpbGxlZE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0T3JkZXJEZXRhaWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXRBY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0VHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHZXREaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR2V0RGlnaXRhbEN1cnJlbmN5RGVwb3NpdEFkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3luY2hEaWdpdGFsQ3VycmVuY3lEZXBvc2l0QWRkcmVzc1dpdGhCbG9ja2NoYWluJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0RpZ2l0YWxDdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUmVx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NlKTtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBiYXNlSWQgKyAnLycgKyBxdW90ZUlkO1xuICAgICAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICAgICAgbGV0IHRha2VyID0gMC41IC8gMTAwO1xuICAgICAgICAgICAgICAgIGxldCBtYWtlciA9IDAuNSAvIDEwMDtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAgICAgJ3F1b3RlSWQnOiBxdW90ZUlkLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiB0YWtlcixcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogbWFrZXIsXG4gICAgICAgICAgICAgICAgICAgICdpbmZvJzogaWQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJhbGFuY2VzLmxlbmd0aDsgaSsrKSB7XG4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uY3lDb2RlJzogbWFya2V0WydxdW90ZUlkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHJlc3BvbnNlWydDcmVhdGVkVGltZXN0YW1wVXRjJ10pO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAocmVzcG9uc2UsIHRpbWVzdGFtcCwgJ0J1eU9yZGVycycsICdTZWxsT3JkZXJzJywgJ1ByaWNlJywgJ1ZvbHVtZScpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnQ3JlYXRlZFRpbWVzdGFtcFV0YyddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogdGlja2VyWydEYXlIaWdoZXN0UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RheUxvd2VzdFByaWNlJ10sXG4gICAgICAgICAgICAnYmlkJzogdGlja2VyWydDdXJyZW50SGlnaGVzdEJpZFByaWNlJ10sXG4gICAgICAgICAgICAnYXNrJzogdGlja2VyWydDdXJyZW50TG93ZXN0T2ZmZXJQcmljZSddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic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Y2U7XG4gICAgICAgIG9yZGVyWyd2b2x1bWUnXSA9IGFtb3VudDtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydPcmRlckd1aWQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAoeyAnb3JkZXJHdWlkJzogaWQgfSk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldICsgJy8nICsgcGF0aDtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBsZXQgYXV0aCA9IFtcbiAgICAgICAgICAgICAgICB1cmwsXG4gICAgICAgICAgICAgICAgJ2FwaUtleT0nICsgdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlPScgKyBub25jZS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBsZXQga2V5c29ydGVkID0gdGhpcy5rZXlzb3J0IChwYXJhbXMpO1xuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAoa2V5c29ydGVkKTtcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgICAgIGxldCBrZXkgPSBrZXlzW2ldO1xuICAgICAgICAgICAgICAgIGF1dGgucHVzaCAoa2V5ICsgJz0nICsgcGFyYW1zW2tleV0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSBhdXRoLmpvaW4gKCcsJyk7XG4gICAgICAgICAgICBsZXQgc2lnbmF0dXJlID0gdGhpcy5obWFjICh0aGlzLmVuY29kZSAobWVzc2FnZSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCkpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy5rZXlzb3J0ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnc2lnbmF0dXJlJzogc2lnbmF0dXJlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZ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ycsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4MjIxNTktNjYxNTM2MjAtNjBhZC0xMWU3LTg5ZTctMDA1ZjZkN2YzZGUwLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5pdGJpdC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cuaXRiaXQuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkuaXRiaXQuY29tL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cuaXRiaXQuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMve3N5bWJvbH0vb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97c3ltYm9sfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vYmFsYW5jZXMve2N1cnJlbmN5Q29kZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9mdW5kaW5nX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldF90cmFuc2ZlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9jcnlwdG9jdXJyZW5jeV9kZXBvc2l0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2FsbGV0cy97d2FsbGV0SWR9L2NyeXB0b2N1cnJlbmN5X3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzL3t3YWxsZXRJZH0vb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXJlX3dpdGhkcmF3YWwnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3dhbGxldHMve3dhbGxldElkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnbWFya2V0cyc6IHtcbiAgICAgICAgICAgICAgICAnQ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aXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICd2d2FwJzogdndhcCxcbiAgICAgICAgICAgICdvcGVuJzogcGFyc2VGbG9hdCAodGlja2VyWydvcGVuVG9kYXknXSksXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMucGFyc2U4NjAxICh0cmFkZVsndGltZXN0YW1wJ10pO1xuICAgICAgICBsZXQgaWQgPSB0cmFkZVsnbWF0Y2hOdW1iZXInXS50b1N0cmluZyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICdvcmRlcic6IGlkLFxuICAgICAgICAgICAgJ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UsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHNCeUFsdG5hbWUnOiB7fSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxJyxcbiAgICAgICAgICAgICAgICAnNW0nOiAnNScsXG4gICAgICAgICAgICAgICAgJzE1bSc6ICcxNScsXG4gICAgICAgICAgICAgICAgJzMwbSc6ICczMCcsXG4gICAgICAgICAgICAgICAgJzFoJzogJzYwJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnMjQwJyxcbiAgICAgICAgICAgICAgICAnMWQnOiAnMTQ0MCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgICAgICAnMncnOiAnMjE2MDAnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY1OTktMjI3MDkzMDQtNWVkZS0xMWU3LTlkZTEtOWYzMzczMmUxNTA5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5rcmFrZW4uY29tJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmtyYWtlbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5rcmFrZW4uY29tL2VuLXVzL2hlbHAvYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9ub3RoaW5naXNkZWFkL25wbS1rcmFrZW4tYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICdmZWVzJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cua3Jha2VuLmNvbS9lbi11cy9oZWxwL2ZlZXMnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9zdXBwb3J0LmtyYWtlbi5jb20vaGMvZW4tdXMvYXJ0aWNsZXMvMjAxMzk2Nzc3LVdoYXQtYXJlLXRoZS1kZXBvc2l0LWZlZXMtJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC5rcmFrZW4uY29tL2hjL2VuLXVzL2FydGljbGVzLzIwMTg5MzYwOC1XaGF0LWFyZS10aGUtd2l0aGRyYXdhbC1mZWVzLScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdwZXJjZW50YWdlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xNiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJzJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLCAwLjI2IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAsIDAuMjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAsIDAuMjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAsIDAuMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwMCwgMC4xOCAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAsIDAuMTYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwMCwgMC4xMiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzEwMDAwMDAwLCAwLjEgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYWtlcic6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMCwgMC4xNiAvIDEwMF0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgWzUwMDAwLCAwLjE0IC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMTAwMDAwLCAwLjEyIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMjUwMDAwLCAwLjEwIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbNTAwMDAwLCAwLjggLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwLCAwLjYgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsyNTAwMDAwLCAwLjQgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFs1MDAwMDAwLCAwLjIgLyAxMDBdLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFsxMDAwMDAwMCwgMC4wIC8gMTAwXSxcbiAgICAgICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnZnVuZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnQlRDJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWFJQJzogMC4wMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdYTE0nOiAwLjAwMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRE9HRSc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWkVDJzogMC4wMDAxMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLjAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JFUCc6IDAuMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRDJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTUxOJzogMC4wMDMsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMC4wNSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMC4wMDUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnR05PJzogMC4wMSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFT1MnOiAwLjUsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVVNEJzogNSwgLy8gaWYgZG9tZXN0aWMgd2lyZVxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VVUic6IDUsIC8vIGlmIGRvbWVzdGljIHdpcmVcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiAxMCwgLy8gQ0FEIEVGVCBXaXRoZHJhd2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMzAwLCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdkZXBvc2l0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVRIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdYUlAnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1hMTSc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdaRUMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnUkVQJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ01MTic6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnWE1SJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEQVNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdHTk8nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VPUyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQkNIJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdVU0QnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnRVVSJzogMCwgLy8gZnJlZSBkZXBvc2l0IGlmIEVVUiBTRVBBIERlcG9zaXRcbiAgICAgICAgICAgICAgICAgICAgICAgICdDQUQnOiA1LCAvLyBpZiBkb21lc3RpYyB3aXJlXG4gICAgICAgICAgICAgICAgICAgICAgICAnSlBZJzogMCwgLy8gRG9tZXN0aWMgRGVwb3NpdCAoRnJlZSwgwqU1LDAwMCBkZXBvc2l0IG1pbmltdW0pXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQXNzZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBc3NldFBhaXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT0hMQycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnU3ByZWFkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUaWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RpbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnQWRkT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NhbmNlbE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDbG9zZWRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRBZGRyZXNzZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RlcG9zaXRNZXRob2RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdEZXBvc2l0U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdMZWRnZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcGVuUG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeUxlZGdlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1F1ZXJ5T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdRdWVyeVRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVCYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZXNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdXaXRoZHJhd0luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3U3RhdHVzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29zdFRvUHJlY2lzaW9uIChzeW1ib2wsIGNvc3QpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMudHJ1bmNhdGUgKHBhcnNlRmxvYXQgKGNvc3QpLCB0aGlzLm1hcmtldHNbc3ltYm9sXVsncHJlY2lzaW9uJ11bJ3ByaWNlJ10pO1xuICAgIH1cblxuICAgIGZlZVRvUHJlY2lzaW9uIChzeW1ib2wsIGZlZSkge1xuICAgICAgICByZXR1cm4gdGhpcy50cnVuY2F0ZSAocGFyc2VGbG9hdCAoZmVlKSwgdGhpcy5tYXJrZXRzW3N5bWJvbF1bJ3ByZWNpc2lvbiddWydhbW91bnQnXSk7XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdJbnZhbGlkIG5vbmNlJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkTm9uY2UgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0luc3VmZmljaWVudCBmdW5kcycpID49IDApXG4gICAgICAgICAgICB0aHJvdyBuZXcgSW5zdWZmaWNpZW50RnVuZHMgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgaWYgKGJvZHkuaW5kZXhPZiAoJ0NhbmNlbCBwZW5kaW5nJykgPj0gMClcbiAgICAgICAgICAgIHRocm93IG5ldyBDYW5jZWxQZW5kaW5nICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgIGlmIChib2R5LmluZGV4T2YgKCdJbnZhbGlkIGFyZ3VtZW50czp2b2x1bWUnKSA+PSAwKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEludmFsaWRPcmRlciAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRBc3NldFBhaXJzICgpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzWydyZXN1bHQnXSk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbJ3Jlc3VsdCddW2lkXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0WydiYXNlJ107XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgICAgICBpZiAoKGJhc2VbMF0gPT0gJ1gnKSB8fCAoYmFzZVswXSA9PSAnWicpKVxuICAgICAgICAgICAgICAgIGJhc2UgPSBiYXNlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIGlmICgocXVvdGVbMF0gPT0gJ1gnKSB8fCAocXVvdGVbMF0gPT0gJ1onKSlcbiAgICAgICAgICAgICAgICBxdW90ZSA9IHF1b3RlLnNsaWNlICgxKTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgZGFya3Bvb2wgPSBpZC5pbmRleE9mICgnLmQnKSA+PSAwO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGRhcmtwb29sID8gbWFya2V0WydhbHRuYW1lJ10gOiAoYmFzZSArICcvJyArIHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBtYWtlciA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmICgnZmVlc19tYWtlcicgaW4gbWFya2V0KSB7XG4gICAgICAgICAgICAgICAgbWFrZXIgPSBwYXJzZUZsb2F0IChtYXJrZXRbJ2ZlZXNfbWFrZXInXVswXVsxXSkgLyAxMDA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcHJlY2lzaW9uID0ge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiBtYXJrZXRbJ2xvdF9kZWNpbWFscyddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldFsncGFpcl9kZWNpbWFscyddLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsb3QgPSBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2Rhcmtwb29sJzogZGFya3Bvb2wsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgJ2FsdG5hbWUnOiBtYXJrZXRbJ2FsdG5hbWUnXSxcbiAgICAgICAgICAgICAgICAnbWFrZXInOiBtYWtlcixcbiAgICAgICAgICAgICAgICAndGFrZXInOiBwYXJzZUZsb2F0IChtYXJrZXRbJ2ZlZXMnXVswXVsxXSkgLyAxMDAsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdwcmljZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJlc3VsdCA9IHRoaXMuYXBwZ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ICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGN1cnJlbmN5WydhbHRuYW1lJ10pO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IGN1cnJlbmN5WydkZWNpbWFscyddO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY29kZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29rJyxcbiAgICAgICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBkYXJrcG9vbCA9IHN5bWJvbC5pbmRleE9mICgnLmQnKSA+PSAwO1xuICAgICAgICBpZiAoZGFya3Bvb2wpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZG9lcyBub3QgcHJvdmlkZSBhbiBvcmRlciBib29rIGZvciBkYXJrcG9vbCBzeW1ib2wgJyArIHN5bWJvbCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXREZXB0aCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgLy8gJ2NvdW50JzogMTAwLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IHJlc3BvbnNlWydyZXN1bHQnXVttYXJrZXRbJ2lkJ11dO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rKTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IGJhc2VWb2x1bWUgPSBwYXJzZUZsb2F0ICh0aWNrZXJbJ3YnXVsxXSk7XG4gICAgICAgIGxldCB2d2FwID0gcGFyc2VGbG9hdCAodGlja2VyWydwJ11bMV0pO1xuICAgICAgICBsZXQgcXVvdGVWb2x1bWUgPSBiYXNlVm9sdW1lICogdndhcDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2gnXVsxXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsJ11bMV0pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYiddWzBdKSxcbiAgICAgICAgICAgICdhc2snOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2EnXVswXSksXG4gICAgICAgICAgICAndndhcCc6IHZ3YXAsXG4gICAgICAgICAgICAnb3Blbic6IHBhcnNlRmxvYXQgKHRpY2tlclsnbyddKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydjJ11bMF0pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IGJhc2VWb2x1bWUsXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBxdW90ZVZvbHVtZSxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHBhaXJzID0gW107XG4gICAgICAgIGZvciAobGV0IHMgPSAwOyBzIDwgdGhpcy5zeW1ib2xzLmxlbmd0aDsgcysrKSB7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gdGhpcy5zeW1ib2xzW3NdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICAgICAgaWYgKG1hcmtldFsnYWN0aXZlJ10pXG4gICAgICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rhcmtwb29sJ10pXG4gICAgICAgICAgICAgICAgICAgIHBhaXJzLnB1c2ggKG1hcmtldFsnaWQnXSk7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGZpbHRlciA9IHBhaXJzLmpvaW4gKCcsJyk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0VGlja2VyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInO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G4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCB0aWNrZXIgPSByZXNwb25zZVsncmVzdWx0J11bbWFya2V0WydpZCddXTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0KTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID0gdW5kZWZpbmVkLCB0aW1lZnJhbWUgPSAnMW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIG9obGN2WzBdICogMTAwMCxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WzFdKSxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WzJdKSxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WzNdKSxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WzRdKSxcbiAgICAgICAgICAgIHBhcnNlRmxvYXQgKG9obGN2WzZdKSxcbiAgICAgICAgXTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9ITENWIChzeW1ib2wsIHRpbWVmcmFtZSA9ICcxbScsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdwYWlyJzogbWFya2V0WydpZCddLFxuICAgICAgICAgICAgJ2ludGVydmFsJzogdGhpcy50aW1lZnJhbWVzW3RpbWVmcmFtZV0sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChz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xMDAwKTtcbiAgICAgICAgICAgIHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICAgICAgdHlwZSA9IHRyYWRlWydvcmRlcnR5cGUnXTtcbiAgICAgICAgICAgIHByaWNlID0gcGFyc2VGbG9hdCAodHJhZGVbJ3ByaWNlJ10pO1xuICAgICAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAodHJhZGVbJ3ZvbCddKTtcbiAgICAgICAgICAgIGlmICgnZmVlJyBpbiB0cmFkZSkge1xuICAgICAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKSxcbiAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3ksXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRpbWVzdGFtcCA9IHBhcnNlSW50ICh0cmFkZVsyXSAqIDEwMDApO1xuICAgICAgICAgICAgc2lkZSA9ICh0cmFkZVszXSA9PSAncycpID8gJ3NlbGwnIDogJ2J1eSc7XG4gICAgICAgICAgICB0eXBlID0gKHRyYWRlWzRdID09ICdsJykgPyAnbGltaXQnIDogJ21hcmtldCc7XG4gICAgICAgICAgICBwcmljZSA9IHBhcnNlRmxvYXQgKHRyYWRlWzBdKTtcbiAgICAgICAgICAgIGFtb3VudCA9IHBhcnNlRmxvYXQgKHRyYWRlWzFdKTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gKG1hcmtldCkgPyBtYXJrZXRbJ3N5bWJvbCddIDogdW5kZWZpbmVkO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAnb3JkZXInOiBvcmRlcixcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBpZCA9IG1hcmtldFsnaWQnXTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRyYWRlcyA9IHJlc3BvbnNlWydyZXN1bHQnXVtpZF07XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzICh0cmFkZXMsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RCYWxhbmNlICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXMpO1xuICAgICAgICBmb3IgKGxldCBjID0gMDsgYyA8IGN1cnJlbmNpZXMubGVuZ3RoOyBjKyspIHtcbiAgICAgICAgICAgIGxldCBjdXJyZW5jeSA9IGN1cnJlbmNpZXNbY107XG4gICAgICAgICAgICBsZXQgY29kZSA9IGN1cnJlbmN5O1xuICAgICAgICAgICAgLy8gWC1JU080MjE3LUEzIHN0YW5kYXJkIGN1cnJlbmN5IGNvZGVzXG4gICAgICAgICAgICBpZiAoY29kZVswXSA9PSAnWCcpIHtcbiAgICAgICAgICAgICAgICBjb2RlID0gY29kZS5zbGljZSAoMSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGNvZGVbMF0gPT0gJ1onKSB7XG4gICAgICAgICAgICAgICAgY29kZSA9IGNvZGUuc2xpY2UgKDEpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgY29kZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChjb2RlKTtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gcGFyc2VGbG9hdCAoYmFsYW5jZXNbY3VycmVuY3ldKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogYmFsYW5jZSxcbiAgICAgICAgICAgICAgICAndXNlZCc6IDAuMCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiBiYWxhbmNlLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjb2RlX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lZDtcbiAgICAgICAgbGV0IGZlZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IGNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdjb3N0Jyk7XG4gICAgICAgIGxldCBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChkZXNjcmlwdGlvbiwgJ3ByaWNlJyk7XG4gICAgICAgIGlmICghcHJpY2UpXG4gICAgICAgICAgICBwcmljZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ3ByaWNlJyk7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBpZiAoJ2ZlZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmxhZ3MgPSBvcmRlclsnb2ZsYWdzJ107XG4gICAgICAgICAgICAgICAgbGV0IGZlZUNvc3QgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWUnKTtcbiAgICAgICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAgICAgJ3JhdGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICBpZiAoZmxhZ3MuaW5kZXhPZiAoJ2ZjaXEnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIGZlZVsnY3VycmVuY3knXSA9IG1hcmtldFsncXVvdGUnXTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZsYWdzLmluZGV4T2YgKCdmY2liJykgPj0gMCkge1xuICAgICAgICAgICAgICAgICAgICBmZWVbJ2N1cnJlbmN5J10gPSBtYXJrZXRbJ2Jhc2UnXTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdp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dXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9ITENWJzogdHJ1ZSwgLy8gc2VlIHRoZSBtZXRob2QgaW1wbGVtZW50YXRpb24gYmVsb3dcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ3VycmVuY2llcyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzhoJzogJzQ4MCcsXG4gICAgICAgICAgICAgICAgJzFkJzogJ0QnLFxuICAgICAgICAgICAgICAgICcxdyc6ICdXJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMzNzk1NjU1LWIzYzQ2ZTQ4LWRjZjYtMTFlNy04YWJlLWRjNDU4OGJhNzkwMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkua3Vjb2luLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2t1Y29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9rdWNvaW5hcGlkb2NzLmRvY3MuYXBpYXJ5LmlvJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL25ld3Mua3Vjb2luLmNvbS9lbi9mZWUnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L2NvbmZpZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jaGFydC9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2NoYXJ0L3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2RlYWwtb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuL2xhbmctbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29wZW4vb3JkZXJzLWJ1eScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi9vcmRlcnMtc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3Blbi90aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2luLWluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVuL2NvaW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbi9jb2lucy10cmVuZGluZycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW4vc3ltYm9scycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dhbGxldC9hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50L3tjb2lufS93YWxsZXQvcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC9wcm9tb3Rpb24vc3VtJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZWFsLW9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvYWN0aXZlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9hY3RpdmUtbWFwJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlci9kZWFsdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVmZXJyZXIvZGVzY2VuZGFudC9jb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudC97Y29pbn0vd2l0aGRyYXcvYXBwbHknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnQve2NvaW59L3dpdGhkcmF3L2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsLW9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9jaGFuZ2UtbGFuZycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMTAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0T3BlblN5bWJvbHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydjb2luVHlwZSddO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gbWFya2V0Wydjb2luVHlwZVBhaXInXTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiA4LFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSBtYXJrZXRbJ3RyYWRpbmcnXTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0aGlzLmV4dGVuZCAodGhpcy5mZWVzWyd0cmFkaW5nJ10sIHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdsb3QnOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ2Ftb3VudCddKSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSkpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hDdXJyZW5jaWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldE9wZW5Db2lucyAocGFyYW1zKTtcbiAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBpZCA9IGN1cnJlbmN5Wydjb2luJ107XG4gICAgICAgICAgICAvLyB0b2RvOiB3aWxsIG5lZWQgdG8gcmV0aGluayB0aGUgZmVlc1xuICAgICAgICAgICAgLy8gdG8gYWRkIHN1cHBvcnQgZm9yIG11bHRpcGxlIHdpdGhkcmF3YWwvZGVwb3NpdCBtZXRob2RzIGFuZFxuICAgICAgICAgICAgLy8gZGlmZmVyZW50aWF0ZWQgZmVlcyBmb3IgZWFjaCBwYXJ0aWN1bGFyIG1ldGhvZFxuICAgICAgICAgICAgbGV0IGNvZGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoaWQpO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IGN1cnJlbmN5Wyd0cmFkZVByZWNpc2lvbiddO1xuICAgICAgICAgICAgbGV0IGRlcG9zaXQgPSBjdXJyZW5jeVsnZW5hYmxlRGVwb3NpdCddO1xuICAgICAgICAgICAgbGV0IHdpdGhkcmF3ID0gY3VycmVuY3lbJ2VuYWJsZVdpdGhkcmF3J107XG4gICAgICAgICAgICBsZXQgYWN0aXZlID0gKGRlcG9zaXQgJiYgd2l0aGRyYXcpO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsnd2l0aGRyYXdGZWVSYXRlJ10sIC8vIHRvZG86IHJlZGVzaWduXG4gICAgICAgICAgICAgICAgJ3ByZWNpc2lvbic6IHByZWNpc2lvbixcbiAgICAgICAgICAgICAgICAnbGltaXRzJzoge1xuICAgICAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBjdXJyZW5jeVsnd2l0aGRyYXdNaW5BbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldEFjY291bnRCYWxhbmNlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2xpbWl0JzogMjAsIC8vIGRlZmF1bHQgMTIsIG1heCAyMFxuICAgICAgICAgICAgJ3BhZ2UnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ2RhdGEnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBsZXQgaW5kZXhlZCA9IHRoaXMuaW5kZXhCeSAoYmFsYW5jZXMsICdjb2luVHlwZScpO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChpbmRleGVkKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4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Jvb2sgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdCVVknLCAnU0VMTCcpO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldCkge1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG9yZGVyWydjb2luVHlwZSddICsgJy8nICsgb3JkZXJbJ2NvaW5UeXBlUGFpciddO1xuICAgICAgICB9XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBvcmRlclsnY3JlYXRlZEF0J107XG4gICAgICAgIGxldCBwcmljZSA9IG9yZGVyWydwcmljZSddO1xuICAgICAgICBsZXQgZmlsbGVkID0gb3JkZXJbJ2RlYWxBbW91bnQnXTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IG9yZGVyWydwZW5kaW5nQW1vdW50J107XG4gICAgICAgIGxldCBhbW91bnQgPSB0aGlzLnN1bSAoZmlsbGVkLCByZW1haW5pbmcpO1xuICAgICAgICBsZXQgc2lkZSA9IG9yZGVyWydkaXJlY3Rpb24nXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICdpbmZvJzogb3JkZXIsXG4gICAgICAgICAgICAnaWQnOiB0aGlzLnNhZmVTdHJpbmcgKG9yZGVyLCAnb2lkJyksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJv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1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdHJhZGVbMF07XG4gICAgICAgIGxldCBzaWRlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAodHJhZGVbMV0gPT0gJ0JVWScpIHtcbiAgICAgICAgICAgIHNpZGUgPSAnYnV5JztcbiAgICAgICAgfSBlbHNlIGlmICh0cmFkZVsxXSA9PSAnU0VMTCcpIHtcbiAgICAgICAgICAgIHNpZGUgPSAnc2VsbCc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsyXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVszXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRPcGVuRGVhbE9yZGVycyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZX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lcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgLy8gdGhlaXIgbm9uY2UgaXMgYWx3YXlzIGEgY2FsaWJyYXRlZCBzeW5jaGVkIG1pbGxpc2Vjb25kcy10aW1lc3RhbXBcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubWlsbGlzZWNvbmRzICgpO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5U3RyaW5nID0gJyc7XG4gICAgICAgICAgICBub25jZSA9IG5vbmNlLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgcXVlcnlTdHJpbmcgPSB0aGlzLnJhd2VuY29kZSAodGhpcy5rZXlzb3J0IChxdWVyeSkpO1xuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgICAgICBpZiAobWV0aG9kICE9ICdHRVQnKSB7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeVN0cmluZztcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IGVuZHBvaW50ICsgJy8nICsgbm9uY2UgKyAnLycgKyBxdWVyeVN0cmluZztcbiAgICAgICAgICAgIGxldCBwYXlsb2FkID0gdGhpcy5zdHJpbmdUb0Jhc2U2NCAodGhpcy5lbmNvZGUgKGF1dGgpKTtcbiAgICAgICAgICAgIC8vIHBheWxvYWQgc2hvdWxkIGJlIFwiZW5jb2RlZFwiIGFzIHJldHVybmVkIGZyb20gc3RyaW5nVG9CYXNlNjRcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHBheWxvYWQsIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1LRVknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnS0MtQVBJLU5PTkNFJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ0tDLUFQSS1TSUdOQVRVUkUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgdGhyb3dFeGNlcHRpb25PckVycm9yQ29kZSAocmVzcG9uc2UpIHtcbiAgICAgICAgaWYgKCdzdWNjZXNzJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKSB7XG4gICAgICAgICAgICAgICAgaWYgKCdjb2RlJyBpbiByZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZSA9IHRoaXMuc2FmZVN0cmluZyAocmVzcG9uc2UsICdtc2cnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydjb2RlJ10gPT0gJ1VOQVVUSCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlID09ICdJbnZhbGlkIG5vbmNlJylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE5vbmNlICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZXNwb25zZVsnY29kZSddID09ICdFUlJPUicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlLmluZGV4T2YgKCdwcmVjaXNpb24gb2YgYW1vdW50JykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGJvZHkgJiYgKGJvZHlbMF0gPT0gXCJ7XCIpKSB7XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIHRoaXMudGhyb3dFeGNlcHRpb25PckVycm9yQ29kZSAocmVzcG9uc2UpO1xuICAgICAgICB9XG4gICAgICAgIGlmIChjb2RlID49IDQwMCkge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBjb2RlLnRvU3RyaW5nICgpICsgJyAnICsgcmVhc29uKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgIC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uICAgICAgICAgICAgJ2hhc0ZldGNoT0hMQ1YnOiBmYWxzZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzE2OTc2MzgtOTEyODI0ZmEtYjNjMS0xMWU3LThjMzYtY2Y5NjA2ZWI5NGFjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2t1bmEuaW8nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9rdW5hLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8va3VuYS5pby9kb2N1bWVudHMvYXBpJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2Vycy97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJfYm9vay97bWFya2V0fScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpbWVzdGFtcCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZW1iZXJzL21lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9teSc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ogJ1dBVkVTJywgJ3F1b3RlJzogJ1VBSCcsICdwcmVjaXNpb24nOiB7ICdhbW91bnQnOiA2LCAncHJpY2UnOiAwIH0sICdsb3QnOiAwLjAwMDAwMSwgJ2xpbWl0cyc6IHsgJ2Ftb3VudCc6IHsgJ21pbic6IDAuMDAwMDAxLCAnbWF4JzogdW5kZWZpbmVkIH0sICdwcmljZSc6IHsgJ21pbic6IDEsICdtYXgnOiB1bmRlZmluZWQgfX19LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjI1IC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBoYW5kbGVFcnJvcnMgKGNvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgaWYgKGNvZGUgPT0gNDAwKSB7XG4gICAgICAgICAgICBsZXQgZGF0YSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgbGV0IGVycm9yID0gZGF0YVsnZXJyb3InXTtcbiAgICAgICAgICAgIGxldCBlcnJvckNvZGUgPSBlcnJvclsnY29kZSddO1xuICAgICAgICAgICAgaWYgKGVycm9yQ29kZSA9PSAyMDAyKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEluc3VmZmljaWVudEZ1bmRzIChbIHRoaXMuaWQsIG1ldGhvZCwgdXJsLCBjb2RlLCByZWFzb24sIGJvZHkgXS5qb2luICgnICcpKTtcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3JDb2RlID09IDIwMDMpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAoWyB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ycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS5sYWtlYnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5sYWtlYnRjLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmxha2VidGMuY29tL3MvYXBpX3YyJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lmxha2VidGMuY29tL3MvYXBpJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdiY29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmN0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QWNjb3VudEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEV4dGVybmFsQWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTUgLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzIChtYXJrZXRzKTtcbiAgICAgICAgZm9yIChsZXQgayA9IDA7IGsgPCBrZXlzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW2tdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBpZC5zbGljZSAoMCwgMyk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBpZC5zbGljZSAoMywgNik7XG4gICAgICAgICAgICBiYXNlID0gYmFzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgIHF1b3RlID0gcXVvdGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAg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nLycgKyBwYXRoO1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChwYXJhbXMpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHBhcmFtcyk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGxldCBub25jZSA9IHRoaXMubm9uY2UgKCk7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHBhcmFtcyA9IHBhcmFtcy5qb2luICgnLCcpO1xuICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgIHBhcmFtcyA9ICcnO1xuICAgICAgICAgICAgbGV0IHF1ZXJ5ID0gdGhpcy51cmxlbmNvZGUgKHtcbiAgICAgICAgICAgICAgICAndG9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnYWNjZXNza2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ3JlcXVlc3RtZXRob2QnOiBtZXRob2QudG9Mb3dlckNhc2UgKCksXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3BhcmFtcyc6IHBhcmFtcyxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdwYXJhbXMnOiBwYXJhbXMsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2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ICAgICAgICAgICdoYXNGZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAvLyBuZXcgbWV0YWluZm8gaW50ZXJmYWNlXG4gICAgICAgICAgICAnaGFzJzoge1xuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVyJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaENsb3NlZE9yZGVycyc6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoTXlUcmFkZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzk4MjAyMi03NWFlYTgyOC02M2EwLTExZTctOTUxMS1jYTU4NGE4ZWRkNzQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vYXBpLmxpcXVpLmlvL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL2xpcXVpLmlvJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vbGlxdWkuaW8vYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL2xpcXVpLmlvL2ZlZScsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnT3JkZXJJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFuc0hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0NvaW5EZXBvc2l0QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnV2l0aGRyYXdDb2luJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDcmVhdGVDb3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1JlZGVlbUNvdXBvbicsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4wMDEsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDAyNSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY2FsY3VsYXRlRmVlIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UsIHRha2VyT3JNYWtlciA9ICd0YWtlcicsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldHNbc3ltYm9sXTtcbiAgICAgICAgbGV0IGtleSA9ICdxdW90ZSc7XG4gICAgICAgIGxldCByYXRlID0gbWFya2V0W3Rha2VyT3JNYWtlcl07XG4gICAgICAgIGxldCBjb3N0ID0gcGFyc2VGbG9hdCAodGhpcy5jb3N0VG9QcmVjaXNpb24gKHN5bWJvbCwgYW1vdW50ICogcmF0ZSkpO1xuICAgICAgICBpZiAoc2lkZSA9PSAnc2VsbCcpIHtcbiAgICAgICAgICAgIGNvc3QgKj0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSAnYmFzZSc7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICd0eXBlJzogdGFrZXJPck1ha2VyLFxuICAgICAgICAgICAgJ2N1cnJlbmN5JzogbWFya2V0W2tleV0sXG4gICAgICAgICAgICAncmF0ZSc6IHJhdGUsXG4gICAgICAgICAgICAnY29zdCc6IGNvc3QsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoIXRoaXMuc3Vic3RpdHV0ZUNvbW1vbkN1cnJlbmN5Q29kZXMpXG4gICA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xlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgYmFzZSwgcXVvdGUgXSA9IHRoaXMuZ2V0QmFzZVF1b3RlRnJvbU1hcmtldElkIChpZCk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IHByZWNpc2lvbiA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogdGhpcy5zYWZlSW50ZWdlciAobWFya2V0LCAnZGVjaW1hbF9wbGFjZXMnKSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB0aGlzLnNhZmVJbnRlZ2VyIChtYXJrZXQsICdkZWNpbWFsX3BsYWNlcycpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBhbW91bnRMaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ21pbic6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtaW5fYW1vdW50JyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfYW1vdW50JyksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IHByaWNlTGltaXRzID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiB0aGlzLnNhZmVGbG9hdCAobWFya2V0LCAnbWluX3ByaWNlJyksXG4gICAgICAgICAgICAgICAgJ21heCc6IHRoaXMuc2FmZUZsb2F0IChtYXJrZXQsICdtYXhfcHJpY2UnKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgY29zdExpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnbWluJzogdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21pbl90b3RhbCcpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIGxldCBsaW1pdHMgPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudExpbWl0cyxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZUxpbWl0cyxcbiAgICAgICAgICAgICAgICAnY29zdCc6IGNvc3RMaW1pdHMsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9IChtYXJrZXRbJ2hpZGRlbiddID09IDApO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ3Rha2VyJzogbWFya2V0WydmZWUnXSAvIDEwMCxcbiAgICAgICAgICAgICAgICAnbG90JzogYW1vdW50TGltaXRzWydtaW4nXSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiBsaW1pdHMsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRJbmZvICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSByZXNwb25zZVsncmV0dXJuJ107XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgbGV0IGZ1bmRzID0gYmFsYW5jZXNbJ2Z1bmRzJ107XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGZ1bmRzKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGN1cnJlbmN5LnRvVXBwZXJDYXNlICgpO1xuICAgICAgICAgICAgdXBwZXJjYXNlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICBsZXQgdG90YWwgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgICBsZXQgdXNlZCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlc1snb3Blbl9vcmRlcnMnXSA9PSAwKSB7XG4gICAgICAgICAgICAgICAgdG90YWwgPSBmdW5kc1tjdXJyZW5jeV07XG4gICAgICAgICAgICAgICAgdXNlZCA9IDAuMDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogZnVuZHNbY3VycmVuY3ldLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbdXBwZXJjYXNlXSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA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GVkJ10gKiAxMDAwO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaCcpLFxuICAgICAgICAgICAgJ2xvdyc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsb3cnKSxcbiAgICAgICAgICAgICdiaWQnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnYnV5JyksXG4gICAgICAgICAgICAnYXNrJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3NlbGwnKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdsYXN0JyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhdmcnKSxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ZvbF9jdXInKSxcbiAgICAgICAgICAgICdxdW90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ljZSA9IHBhcnNlRmxvYXQgKHByaWNlKTtcbiAgICAgICAgYW1vdW50ID0gcGFyc2VGbG9hdCAoYW1vdW50KTtcbiAgICAgICAgbGV0IG9yZGVyID0ge1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHR5cGUsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogcHJpY2UgKiBhbW91bnQsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiAwLjAsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgLy8gJ3RyYWRlcyc6IHRoaXMucGFyc2VUcmFkZXMgKG9yZGVyWyd0cmFkZXMnXSwgbWFya2V0KSxcbiAgICAgICAgfTtcbiAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gb3JkZXI7XG4gICAgICAgIHJldHVybiB0aGlzLmV4dGVuZCAoeyAnaW5mbyc6IHJlc3BvbnNlIH0sIG9yZGVyKTtcbiAgICB9XG5cbiAgICBnZXRPcmRlcklkS2V5ICgpIHtcbiAgICAgICAgcmV0dXJuICdvcmRlcl9pZCc7XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgICAgICBsZXQgaWRLZXkgPSB0aGlzLmdldE9yZGVySWRLZXkgKCk7XG4gICAgICAgICAgICByZXF1ZXN0W2lkS2V5XSA9IGlkO1xuICAgICAgICAgICAgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0Q2FuY2VsT3JkZXIgKHRoaXMuZXh0ZW5kIChyZXF1ZXN0LCBwYXJhbXMpKTtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm9yZGVycylcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF1bJ3N0YXR1cyddID0gJ2NhbmNlbGVkJztcbiAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IG1lc3NhZ2UgPSB0aGlzLnNhZmVTdHJpbmcgKHRoaXMubGFzdF9qc29uX3Jlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICBpZiAobWVzc2FnZSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAobWVzc2FnZS5pbmRleE9mICgnbm90IGZvdW5kJykgPj0gMClcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBPcmRlck5vdEZvdW5kICh0aGlzLmlkICsgJyBjYW5jZWxPcmRlcigpIGVycm9yOiAnICsgdGhpcy5sYXN0X2h0dHBfcmVzcG9uc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRocm93IGU7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cblxuICAgIHBhcnNlT3JkZXIgKG9yZGVyLCBtYXJrZXQgPSB1bmRlZmluZW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ICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAncmF0ZScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKHR5cGVvZiBhbW91bnQgIT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmVtYWluaW5nICE9ICd1bmRlZmluZWQnKSB7XG4gICAgICAgICAgICAgICAgZmlsbGVkID0gYW1vdW50IC0gcmVtYWluaW5nO1xuICAgICAgICAgICAgICAgIGNvc3QgPSBwcmljZSAqIGZpbGxlZDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1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AgICAgICAgIHRoaXMub3JkZXJzW29wZW5PcmRlcnNbal1bJ2lkJ11dID0gb3Blbk9yZGVyc1tqXTtcbiAgICAgICAgfVxuICAgICAgICBsZXQgb3Blbk9yZGVyc0luZGV4ZWRCeUlkID0gdGhpcy5pbmRleEJ5IChvcGVuT3JkZXJzLCAnaWQnKTtcbiAgICAgICAgbGV0IGNhY2hlZE9yZGVySWRzID0gT2JqZWN0LmtleXMgKHRoaXMub3JkZXJzKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBrID0gMDsgayA8IGNhY2hlZE9yZGVySWRzLmxlbmd0aDsgaysrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBjYWNoZWRPcmRlcklkc1trXTtcbiAgICAgICAgICAgIGlmIChpZCBpbiBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyc1tpZF0gPSB0aGlzLmV4dGVuZCAodGhpcy5vcmRlcnNbaWRdLCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWRbaWRdKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVyID0gdGhpcy5vcmRlcnNbaWRdO1xuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ29wZW4nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0YXR1cyc6ICdjbG9zZWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiBvcmRlclsnYW1vdW50J10gKiBvcmRlclsncHJpY2UnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmaWxsZWQnOiBvcmRlclsnYW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAncmVtYWluaW5nJzogMC4wL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gYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgfSwgcXVlcnkpKTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLnNpZ25Cb2R5V2l0aFNlY3JldCAoYm9keSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdXJsICs9IHRoaXMuZ2V0VmVyc2lvblN0cmluZyAoKSArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0a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XRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgLy8gbmV3IG1ldGFpbmZvIGludGVyZmFjZVxuICAgICAgICAgICAgJ2hhcyc6IHtcbiAgICAgICAgICAgICAgICAnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDdXJyZW5jaWVzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTgwNzY4LWYyMmZjNDI0LTYzOGEtMTFlNy04OWM5LTYwMTBhNTRmZjliZS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkubGl2ZWNvaW4ubmV0JyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LmxpdmVjb2luLm5ldCcsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy5saXZlY29pbi5uZXQvYXBpP2xhbmc9ZW4nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS9hbGwvb3JkZXJfYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvbGFzdF90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL21heGJpZF9taW5hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3Jlc3RyaWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvdGlja2VyJywgLy8gb21pdCBwYXJhbXMgdG8gZ2V0IGFsbCB0aWNrZXJzIGF0IG9uY2VcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvL2NvaW5JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NsaWVudF9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdleGNoYW5nZS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2NvbW1pc3Npb25Db21tb25JbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2JhbGFuY2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvZ2V0L2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvaGlzdG9yeS9zaXplJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L2hpc3RvcnkvdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvYnV5bGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL2J1eW1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2UvY2FuY2VsbGltaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlL3NlbGxsaW1pdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXhjaGFuZ2Uvc2VsbG1hcmtldCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FwaXRhbGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY2FyZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvY29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvb2twYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BheW1lbnQvb3V0L3BheWVlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC9vdXQvcGVyZmVjdG1vbmV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXltZW50L3ZvdWNoZXIvbWFrZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGF5bWVudC92b3VjaGVyL3JlZGVlbScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMTggLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRFeGNoYW5nZVRpY2tlciAoKTtcbiAgICAgICAgbGV0IHJlc3RyaWN0aW9ucyA9IGF3YWl0IHRoaXMucHVibGljR2V0RXhjaGFuZ2VSZXN0cmljdGlvbnMgKCk7XG4gICAgICAgIGxldCByZXN0cmljdGlvbnNCeUlkID0gdGhpcy5pbmRleEJ5IChyZXN0cmljdGlvbnNbJ3Jlc3RyaWN0aW9ucyddLCAnY3VycmVuY3lQYWlyJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgbGV0IGNvaW5SZXN0cmljdGlvbnMgPSB0aGlzLnNhZmVWYWx1ZSAocmVzdHJpY3Rpb25zQnlJZCwgc3ltYm9sKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ3ByaWNlJzogNSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogOCxcbiAgICAgICAgICAgICAgICAnY29zdCc6IDgsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgbGV0IGxpbWl0cyA9IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSksXG4gICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgaWYgKGNvaW5SZXN0cmljdGlvbnMpIHtcbiAgICAgICAgICAgICAgICBwcmVjaXNpb25bJ3ByaWNlJ10gPSB0aGlzLnNhZmVJbnRlZ2VyIChjb2luUmVzdHJpY3Rpb25zLCAncHJpY2VTY2FsZScsIDUpO1xuICAgICAgICAgICAgICAgIGxpbWl0c1snYW1vdW50J11bJ21pbiddID0gdGhpcy5zYWZlRmxvYXQgKGNvaW5SZXN0cmljdGlvbnMsICdtaW5MaW1pdFF1YW50aXR5JywgbGltaXRzWydhbW91bnQnXVsnbWluJ10pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGltaXRzWydwcmljZSddID0ge1xuICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb25bJ3ByaWNlJ10pLFxuICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHRoaXMuZXh0ZW5kICh0aGlzLmZlZXNbJ3RyYWRpbmcnXSwge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IGxpbWl0cyxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIG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ICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiAnb2snLFxuICAgICAgICAgICAgICAgICdmZWUnOiBjdXJyZW5jeVsnd2l0aGRyYXdGZWUnXSwgLy8gdG9kbzogcmVkZXNpZ25cbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbk9yZGVyQW1vdW50J10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiBNYXRoLnBvdyAoMTAsIHByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5PcmRlckFtb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IGN1cnJlbmN5WydtaW5XaXRoZHJhd0Ftb3VudCddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ21pbkRlcG9zaXRBbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXgnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldFBheW1lbnRCYWxhbmNlcyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIHJlc3VsdClcbiAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBhY2NvdW50ID0gdGhpcy5hY2NvdW50ICgpO1xuICAgICAgICAgICAgaWYgKGJhbGFuY2VbJ3R5cGUnXSA9PSAndG90YWwnKVxuICAgICAgICAgICAgICAgIGFjY291bnRbJ3RvdGFsJ10gPSBwYXJzZUZsb2F0IChiYWxhbmNlWyd2YWx1ZSddKTtcbiAgICAgICAgICAgIGlmIChiYWxhbmNlWyd0eXBlJ10gPT0gJ2F2YWlsYWJsZScpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsnZnJlZSddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICBpZiAoYmFsYW5jZVsndHlwZSddID09ICd0cmFkZScpXG4gICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsndmFsdWUnXSk7XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hGZWVzIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY29tbWlzc2lvbkluZm8gPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRFeGNoYW5nZUNvbW1pc3Npb25Db21tb25JbmZvICgpO1xuICAgICAgICBsZXQgY29tbWlzc2lvbiA9IHRoaXMuc2FmZUZsb2F0IChjb21taXNzaW9uSW5mbywgJ2NvbW1pc3Npb24nKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogY29tbWlzc2lvbkluZm8sXG4gICAgICAgICAgICAnbWFrZXInOiBjb21taXNzaW9uLFxuICAgICAgICAgICAgJ3Rha2VyJzogY29tbWlzc2lvbixcbiAgICAgICAgICAgICd3aXRoZHJhdyc6IDAuMCxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWR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zg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3RhdHVzJzogc3RhdHVzLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0eXBlJzogdHlwZSxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiBmaWxsZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogcmVtYWluaW5nLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHRyYWRlcyxcbiAgICAgICAgICAgICdmZWUnOiB7XG4gICAgICAgICAgICAgICAgJ2Nvc3QnOiBjb3N0LFxuICAgICAgICAgICAgICAgICdjdXJyZW5jeSc6IHF1b3RlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVycyAoc3ltYm9sID0gdW5kZWZpbmVkLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChzeW1ib2wpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHBhaXIgPSBtYXJrZXQgPyBtYXJrZXRbJ2lkJ10gOiB1bmRlZmluZWQ7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge307XG4gICAgICAgIGlmIChwYWlyKVxuICAgICAgICAgICAgcmVxdWVzdFsnY3VycmVuY3lQYWlyJ10gPSBwYWlyO1xuICAgICAgICBpZiAoc2luY2UpXG4gICA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VycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHBhdGg7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmtleXNvcnQgKHBhcmFtcykpO1xuICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHBhcmFtcykubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHF1ZXJ5O1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChhcGkgPT0gJ3ByaXZhdGUnKSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIGlmIChtZXRob2QgPT0gJ1BPU1QnKVxuICAgICAgICAgICAgICAgIGJvZHkgPSBxdWVyeTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChxdWVyeSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGEyNTYnKTtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7XG4gICAgICAgICAgICAgICAgJ0FwaS1LZXknOiB0aGlzLmFwaUtleSxcbiAgICAgICAgICAgICAgICAnU2lnbic6IHNpZ25hdHVyZS50b1VwcGVyQ2FzZSAoKSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgaGFuZGxlRXJyb3JzIChjb2RlLCByZWFzb24sIHVybCwgbWV0aG9kLCBoZWFkZXJzLCBib2R5KSB7XG4gICAgICAgIGlmIChjb2RlID49IDMwMCkge1xuICAgICAgICAgICAgaWYgKGJvZHlbMF0gPT0gXCJ7XCIpIHtcbiAgICAgICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgICAgICBpZiAoJ2Vycm9yQ29kZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVycm9yID0gcmVzcG9uc2VbJ2Vycm9yQ29kZSddO1xuICAgICAgICAgICAgICAgICAgICBpZiAoZXJyb3IgPT0gMSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCdlcnJvck1lc3NhZ2UnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlWydlcnJvck1lc3NhZ2UnXSA9PSAnVXNlciBub3QgZm91bmQnKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgJyArIHJlc3BvbnNlWydlcnJvck1lc3NhZ2UnXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKChlcnJvciA9PSAxMCkgfHwgKGVycm9yID09IDExKSB8fCAoZXJyb3IgPT0gMTIpIHx8IChlcnJvciA9PSAyMCkgfHwgKGVycm9yID09IDMwKSB8fCAoZXJyb3IgPT0gMTAxKSB8fCAoZXJyb3IgPT0gMTAyKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEF1dGhlbnRpY2F0aW9uRXJyb3IgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMzEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBOb3RTdXBwb3J0ZWQgKHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMzIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09IDEwMCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnOiBJbnZhbGlkIHBhcmFtZXRlcnMgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAxMDMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnOiBJbnZhbGlkIGN1cnJlbmN5ICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gMTA0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJzogSW52YWxpZCBhbW91bnQgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAxMDUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnZhbGlkT3JkZXIgKHRoaXMuaWQgKyAnOiBVbmFibGUgdG8gYmxvY2sgZnVuZHMgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgdGhpcy5qc29uIChyZXNwb25zZSkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnICcgKyBib2R5KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCAr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AnZmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2NjYwNy04YzFhNjlkOC01ZWRlLTExZTctOTMwYy01NDBiNWViOWJlMjQuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLm15Yml0eC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lmx1bm8uY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubHVuby5jb20vZW4vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vbnBtanMub3JnL3BhY2thZ2UvYml0eCcsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vYmF1c21laWVyL25vZGUtYml0eCcsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy97aWR9L3BlbmRpbmcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRzL3tpZH0vdHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmZWVfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0b3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2Fscy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc3RvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0b3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N0b3BvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZGluZ19hZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd2FscycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VuZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvYXV0aDIvZ3JhbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3Rlcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ2RlbGV0ZSc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdhbHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXJzICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IHAgPSAwOyBwIDwgbWFya2V0c1sndGlja2VycyddLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1sndGlja2VycyddW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydwYWlyJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IGlkLnNsaWNlICgwLCAzKTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgIGJhc2UgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAoYmFzZSk7XG4gICAgICAgICAgICBxdW90ZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChxdW90ZSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXN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V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgbGV0IHByaWNlID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnbGltaXRfcHJpY2UnKTtcbiAgICAgICAgbGV0IGFtb3VudCA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2xpbWl0X3ZvbHVtZScpO1xuICAgICAgICBsZXQgcXVvdGVGZWUgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdmZWVfY291bnRlcicpO1xuICAgICAgICBsZXQgYmFzZUZlZSA9IHRoaXMuc2FmZUZsb2F0IChvcmRlciwgJ2ZlZV9iYXNlJyk7XG4gICAgICAgIGxldCBmZWUgPSB7ICdjdXJyZW5jeSc6IHVuZGVmaW5lZCB9O1xuICAgICAgICBpZiAocXVvdGVGZWUpIHtcbiAgICAgICAgICAgIGZlZVsnc2lkZSddID0gJ3F1b3RlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gcXVvdGVGZWU7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmZWVbJ3NpZGUnXSA9ICdiYXNlJztcbiAgICAgICAgICAgIGZlZVsnY29zdCddID0gYmFzZUZlZTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyX2lkJ10sXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IHN0YXR1cyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHByaWNlLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcyc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZUdldE9yZGVyc0lkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyIChyZXNwb25zZSk7XG4gICAgfVxuXG4gICAgcGFyc2VUaWNrZXIgKHRpY2tlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aWNrZXJbJ3RpbWVzdGFtcCddO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbG93JzogdW5kZWZpbmVkLFxuICAgICAgICAg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9O1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGlkcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUaWNrZXIgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCk7XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgc2lkZSA9ICh0cmFkZVsnaXNfYnV5J10pID8gJ2J1eScgOiAnc2VsbCc7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHRyYWRlLFxuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVz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ByaXZhdGVQb3N0JztcbiAgICAgICAgbGV0IG9yZGVyID0geyAncGFpcic6IHRoaXMubWFya2V0SWQgKG1hcmtldCkgfTtcbiAgICAgICAgaWYgKHR5cGUgPT0gJ21hcmtldCcpIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnTWFya2V0b3JkZXInO1xuICAgICAgICAgICAgb3JkZXJbJ3R5cGUnXSA9IHNpZGUudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBpZiAoc2lkZSA9PSAnYnV5JylcbiAgICAgICAgICAgICAgICBvcmRlclsnY291bnRlcl92b2x1bWUnXSA9IGFtb3VudDtcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsnYmFzZV92b2x1bWUnXSA9IGFtb3VudDtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG1ldGhvZCArPSAnT3JkZXInO1xuICAgICAgICAgICAgb3JkZXJbJ3ZvbHVtZSddID0gYW1vdW50O1xuICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKVxuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gPSAnQklEJztcbiAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICBvcmRlclsndHlwZSddID0gJ0FTSyc7XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpc1ttZXRob2RdICh0aGlzLmV4dGVuZCAob3JkZXIsIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydvcmRlcl9pZCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGNhbmNlbE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICB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AgICduYW1lJzogJ01lcmNhZG8gQml0Y29pbicsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ0JSJywgLy8gQnJhemlsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YzJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3ODM3MDYwLWU3YzU4NzE0LTYwZWEtMTFlNy05MTkyLWYwNWU4NmFkYjgzZi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4ubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd3d3Lm1lcmNhZG9iaXRjb2luLm5ldC90YXBpJyxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyL2FwaS1kb2MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cubWVyY2Fkb2JpdGNvaW4uY29tLmJyL3RyYWRlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L29yZGVyYm9vay8nLCAvLyBsYXN0IHNsYXNoIGNyaXRpY2FsXG4gICAgICAgICAgICAgICAgICAgICAgICAne2NvaW59L3RpY2tlci8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd7Y29pbn0vdHJhZGVzL3tmcm9tfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS90cmFkZXMve2Zyb219L3t0b30nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3tjb2lufS9kYXktc3VtbWFyeS97eWVhcn0ve21vbnRofS97ZGF5fS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbF9vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2FjY291bnRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdF9zeXN0ZW1fbWVzc2FnZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xpc3Rfb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsaXN0X29yZGVyYm9vaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncGxhY2VfYnV5X29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZV9zZWxsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19jb2luJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAg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nN0JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2xhc3QnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xhc3QnXSksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogcGFyc2VGbG9hdCAodGlja2VyWyd2b2wnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0cmFkZVsnZGF0ZSddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndGlkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ3R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydwcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydhbW91bnQnXSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW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CBhbW91bnQgPSB0aGlzLnNhZmVGbG9hdCAob3JkZXIsICdxdWFudGl0eScpO1xuICAgICAgICBsZXQgZmlsbGVkID0gdGhpcy5zYWZlRmxvYXQgKG9yZGVyLCAnZXhlY3V0ZWRfcXVhbnRpdHknKTtcbiAgICAgICAgbGV0IHJlbWFpbmluZyA9IGFtb3VudCAtIGZpbGxlZDtcbiAgICAgICAgbGV0IGNvc3QgPSBhbW91bnQgKiBhdmVyYWdlO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgJ2luZm8nOiBvcmRlcixcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydvcmRlcl9pZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6ICdsaW1pdCcsXG4gICAgICAgICAgICAnc2lkZSc6IHNpZGUsXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogYXZlcmFnZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnZmVlJzogZmVlLFxuICAgICAgICB9O1xuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXIgKGlkLCBzeW1ib2wgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGlmICghc3ltYm9sKVxuICAgICAgICAgICA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dWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHVybCArPSB0aGlzLnZlcnNpb24gKyAnLyc7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICd0YXBpX21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ3RhcGlfbm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSAnL3RhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArICc/JyArIGJvZHk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnVEFQSS1JRCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdUQVBJLU1BQyc6IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKGF1dGgpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpLCAnc2hhNTEyJyksXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB7ICd1cmwnOiB1cmwsICdtZXRob2QnOiBtZXRob2QsICdib2R5JzogYm9keSwgJ2hlYWRlcnMnOiBoZWFkZXJzIH07XG4gICAgfVxuXG4gICAgYXN5bmMgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLmZldGNoMiAocGF0aCwgYXBpLCBtZXRob2QsIHBhc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gICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzAyMzcyMTItZWQyOTMwM2MtOTUzNS0xMWU3LThhZjgtZmNkMzgxY2ZhMjBjLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL21peGNvaW5zLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly9taXhjb2lucy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9taXhjb2lucy5jb20vaGVscC9hcGkvJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9VU0QnO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VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydkYXRlJ10pICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWydpZCddLnRvU3RyaW5nICgpLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiBwYXJzZUZsb2F0ICh0cmFkZVsncHJpY2UnXSksXG4gICAgICAgICAgICAnYW1vdW50JzogcGFyc2VGbG9hdCAodHJhZGVbJ2Ftb3VudCddKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRyYWRlcyAoc3ltYm9sLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRUcmFkZXMgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbWFya2V0JzogbWFya2V0WydpZCddLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlWydyZXN1bHQnXSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdtYXJrZXQnOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ29wJzogc2lkZSxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgIH07XG4gICAgICAgIGlmICh0eXBlID09ICdtYXJrZXQnKSB7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gMTtcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvcmRlclsnb3JkZXJfdHlwZSddID0gMDtcbiAgICAgICAgfVxuICAgICAgICBsZXQ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Y29tL3JlbW90ZS9mYXEnLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy97YmFzZWN1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9pbmZvL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcmRlcmhpc3Rvcnkve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L2J1eS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldC9vcGVub3JkZXJzL3twYWlyfS9zZWxsLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0L29wZW5vcmRlcnMve3BhaXJ9L2JvdGgvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXQvb3Blbm9yZGVycy97cGFpcn0ve29yZGVydHlwZX0vJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRiYWxhbmNlcy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGJhbGFuY2Uve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRzLycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0d2l0aGRyYXdhbHMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRuZXdkZXBvc2l0YWRkcmVzcy97Y3VycmVuY3l9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0ZGVwb3NpdGFkZHJlc3Mve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215b3Blbm9yZGVycy8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ215b3Blbm9yZGVyc19tYXJrZXQve3BhaXJ9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2Vsb3JkZXIve29yZGVyaWR9LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlL3twYWlyfS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeS8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldGRlcG9zaXRoaXN0b3J5LycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0d2l0aGRyYXdhbGhpc3RvcnkvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzdGF0dXMvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3YWxsZXRzdGF0dXMve2N1cnJlbmN5fS8nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXRzID0gcmVzcG9uc2VbJ21hcmtldHMnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IG1hcmtldHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW2ldO1xuICAgICAgICAgICAgaWYgKCFtYXJrZXRbJ2Rpc2FibGVkJ10pIHtcbiAgICAgICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ21hcmtldG5hbWUnXTtcbiAgICAgICAgICAgICAgICBsZXQgWyBxdW90ZSwgYmFzZSBdID0gaWQuc3BsaXQgKCdfJyk7XG4gICAgICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyQm9vayAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgb3JkZXJib29rID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRPcGVub3JkZXJzUGFpckJvdGggKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAncGFpcic6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZU9yZGVyQm9vayAob3JkZXJib29rLCB1bmRlZmluZWQsICdidXlvcmRlcnMnLCAnc2VsbG9yZGVycycsICdwcmljZScsICdhbW91bnQnKTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaFRpY2tlciAoc3ltYm9sLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldE1hcmtldEluZm9QYWlyICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWydtYXJrZXRzJ11bMF07XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2hpZ2gyNGgnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cyNGgnXSksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2JpZCcpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0ICh0aWNrZXIsICdhc2snKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdF9wcmljZSddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiBwYXJzZUZsb2F0ICh0aW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TtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYW1vdW50J10pLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdGhpcy5zdW0gKGxvY2tib3gsIHRyYWRlcyksXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogcGFyc2VGbG9hdCAoYmFsYW5jZVsnYW1vdW50X3RvdGFsJ10pLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgICAgIHJlc3VsdFtjdXJyZW5jeV0gPSBhY2NvdW50O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgYW1vdW50ID0gYW1vdW50LnRvU3RyaW5nICgpO1xuICAgICAgICBwcmljZSA9IHByaWNlLnRvU3RyaW5nICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0cmFkZXR5cGUnOiBzaWRlLnRvVXBwZXJDYXNlICgpLFxuICAgICAgICAgICAgJ3RyYWRlYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3RyYWRlcHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICd0cmFkZWJhc2UnOiAxLFxuICAgICAgIC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yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZXh0ZW5zaW9uJzogJy5kbycsIC8vIGFwcGVuZGVkIHRvIGVuZHBvaW50IFVSTFxuICAgICAgICAgICAgJ2hhc0Z1dHVyZU1hcmtldHMnOiBmYWxzZSxcbiAgICAgICAgICAgICd0aW1lZnJhbWVzJzoge1xuICAgICAgICAgICAgICAgICcxbSc6ICcxbWluJyxcbiAgICAgICAgICAgICAgICAnM20nOiAnM21pbicsXG4gICAgICAgICAgICAgICAgJzVtJzogJzVtaW4nLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTVtaW4nLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzBtaW4nLFxuICAgICAgICAgICAgICAgICcxaCc6ICcxaG91cicsXG4gICAgICAgICAgICAgICAgJzJoJzogJzJob3VyJyxcbiAgICAgICAgICAgICAgICAnNGgnOiAnNGhvdXInLFxuICAgICAgICAgICAgICAgICc2aCc6ICc2aG91cicsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICcxMmhvdXInLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxZGF5JyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnM2RheScsXG4gICAgICAgICAgICAgICAgJzF3JzogJzF3ZWVrJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICd3ZWInOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFya2V0cy9jdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzL3Byb2R1Y3RzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4Y2hhbmdlX3JhdGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2VzdGltYXRlZF9wcmljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2hvbGRfYW1vdW50JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfaW5kZXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9rbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3ByaWNlX2xpbWl0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdrbGluZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2FjY291bnRfcmVjb3JkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmF0Y2hfdHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd19tb25leScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYm9ycm93X29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JvcnJvd3NfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX2JvcnJvdycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3RjX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9iYXRjaF90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2NhbmNlbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX2Rldm9sdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9leHBsb3NpdmUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9vcmRlcl9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfb3JkZXJzX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3Bvc2l0aW9uXzRmaXgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV90cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnV0dXJlX3RyYWRlc19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdXR1cmVfdXNlcmluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1dHVyZV91c2VyaW5mb180Zml4JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZW5kX2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9mZWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyc19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvdGNfb3JkZXJfaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3RjX29yZGVyX2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlcGF5bWVudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3VibWl0X290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX290Y19vcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VucmVwYXltZW50c19pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2NzkxLTg5ZmZiNTAyLTVlZTUtMTFlNy04YTViLWM1OTUwYjY4YWM2NS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICd3ZWInOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS92MicsXG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly93d3cub2tjb2luLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy5va2NvaW4uY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3Lm9rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5va2NvaW4uY29tL3Jlc3RfZ2V0U3RhcnRlZC5odG1sJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL29rY29pbi5jb20nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLndlYkdldE1hcmtldHNQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldHMgPSByZXNwb25zZVsnZGF0YSddO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbWFya2V0cy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0c1tpXVsnc3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gaWQudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gdXBwZXJjYXNlLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldHNbaV1bJ21heFNpemVEaWdpdCddLFxuICAgICAgICAgICAgICAgICdwcmljZSc6IG1hcmtldHNbaV1bJ21heFByaWNlRGlnaXQnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXRzW2ldLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ3Nwb3QnLFxuICAgICAgICAgICAgICAgICdzcG90JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZnV0dXJlJzogZmFsc2UsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbWFya2V0c1tpXVsnbWluVHJhZGVTaXplJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ2Nvc3QnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAobWFya2V0KTtcbiAgICAgICAgICAgIGlmICgodGhpcy5oYXNGdXR1cmVNYXJrZXRzKSAmJiAobWFya2V0WydxdW90ZSddID09ICdVU0RUJykpIHtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKG1hcmtldCwge1xuICAgICAgICAgICAgICAgICAgICAncXVvdGUnOiAnVVNEJyxcbiAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnYmFzZSddICsgJy9VU0QnLFxuICAgICAgICAgICAgICAgICAgICAnaWQnOiBtYXJrZXRbJ2lkJ10ucmVwbGFjZSAoJ3VzZHQnLCAndXNkJyksXG4gICAgICAgICAgICAgICAgICAgICd0eXBlJzogJ2Z1dHVyZScsXG4gICAgICAgICAgICAgICAgICAgICdzcG90JzogZmFsc2UsXG4gICAgICAgICAgICAgICAgICAgICdmdXR1cmUnOiB0cnVlLFxuICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoT3JkZXJCb29rIChzeW1ib2wsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwdWJsaWNHZXQnO1xuICAgICAgICBsZXQgcmVxdWVzdCA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7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G4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWydsb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydidXknXSksXG4gICAgICAgICAgICAnYXNrJzogcGFyc2VGbG9hdCAodGlja2VyWydzZWxsJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsndm9sJ10pLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgbWV0aG9kID0gJ3B1YmxpY0dldCc7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKG1hcmtldFsnZnV0dXJlJ10pIHtcbiAgICAg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uIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChzeW1ib2wsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBtYXJrZXQgPSB0aGlzLm1hcmtldCAoc3ltYm9sKTtcbiAgICAgICAgbGV0IG1ldGhvZCA9ICdwcml2YXRlUG9zdCc7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgICAgICAndHlwZSc6IHNpZGUsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChtYXJrZXRbJ2Z1dHVyZSddKSB7XG4gICAgICAgICAgICBtZXRob2QgKz0gJ0Z1dHVyZSc7XG4gICAgICAgICAgICBvcmRlciA9IHRoaXMuZXh0ZW5kIChvcmRlciwge1xuICAgICAgICAgICAgICAgICdjb250cmFjdF90eXBlJzogJ3RoaXNfd2VlaycsIC8vIG5leHRfd2VlaywgcXVhcnRlclxuICAgICAgICAgICAgICAgICdtYXRjaF9wcmljZSc6IDAsIC8vIG1hdGNoIGJlc3QgY291bnRlciBwYXJ0eSBwcmljZT8gMCBvciAxLCBpZ25vcmVzIHByaWNlIGlmIDFcbiAgICAgICAgICAgICAgICAnbGV2ZXJfcmF0ZSc6IDEwLCAvLyBsZXZlcmFnZSByYXRlIHZhbHVlOiAxMCBvciAyMCAoMTAgYnkgZGVmYXVsdClcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAodHlwZSA9PSAnbGltaXQnKSB7XG4gICAgICAgICAgICAgICAgb3JkZXJbJ3ByaWNlJ10gPSBwcmljZTtcbiAgICAgICAgICAgICAgICBvcmRlclsnYW1vdW50J10gPSBhbW91bnQ7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG9yZGVyWyd0eXBlJ10gKz0gJ19tYXJrZXQnO1xuICAgICAgICAgICAgICAgIGlmIChzaWRlID09ICdidXknKSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gdGhpcy5zYWZlRmxvYXQgKHBhcmFtcywgJ2Nvc3QnKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFvcmRlclsncHJpY2UnXSlcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBtYXJrZXQgYnV5IG9yZGVycyByZXF1aXJlIGFuIGFkZGl0aW9uYWwgY29zdCBwYXJhbWV0ZXIsIGNvc3QgPSBwcmljZSAqIGFtb3VudCcpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIG9yZGVyWydhbW91bnQnXSA9IGFtb3VudDtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgcGFyYW1zID0gdGhpcy5vbWl0IChwYXJhbXMsICdjb3N0Jyk7XG4gICAgICAgIG1ldGhvZCArPSAnVHJhZGUnO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzW21ldGhvZF0gKHRoaXMuZXh0ZW5kIChvcmRlciwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlLFxuICAgICAgICAgICAgJ2lkJzogcmVzcG9uc2VbJ29yZGVyX2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgY2FuY2VsT3JkZXIgKGlkLCBzeW1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gICAgICAgIHJldHVybiAncGFydGlhbCc7XG4gICAgICAgIGlmIChzdGF0dXMgPT0gMilcbiAgICAgICAgICAgIHJldHVybiAnY2xvc2VkJztcbiAgICAgICAgaWYgKHN0YXR1cyA9PSA0KVxuICAgICAgICAgICAgcmV0dXJuICdjYW5jZWxlZCc7XG4gICAgICAgIHJldHVybiBzdGF0dXM7XG4gICAgfVxuXG4gICAgcGFyc2VPcmRlciAob3JkZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgc2lkZSA9IHVuZGVmaW5lZDtcbiAgICAgICAgbGV0IHR5cGUgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICgndHlwZScgaW4gb3JkZXIpIHtcbiAgICAgICAgICAgIGlmICgob3JkZXJbJ3R5cGUnXSA9PSAnYnV5JykgfHwgKG9yZGVyWyd0eXBlJ10gPT0gJ3NlbGwnKSkge1xuICAgICAgICAgICAgICAgIHNpZGUgPSBvcmRlclsndHlwZSddO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbGltaXQnO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzaWRlID0gKG9yZGVyWyd0eXBlJ10gPT0gJ2J1eV9tYXJrZXQnKSA/ICdidXknIDogJ3NlbGwnO1xuICAgICAgICAgICAgICAgIHR5cGUgPSAnbWFya2V0JztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3RhdHVzID0gdGhpcy5wYXJzZU9yZGVyU3RhdHVzIChvcmRlclsnc3RhdHVzJ10pO1xuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoIW1hcmtldCkge1xuICAgICAgICAgICAgaWYgKCdzeW1ib2wnIGluIG9yZGVyKVxuICAgICAgICAgICAgICAgIGlmIChvcmRlclsnc3ltYm9sJ10gaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICBtYXJrZX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AoJ3R5cGUnIGluIHBhcmFtcykge1xuICAgICAgICAgICAgICAgIHN0YXR1cyA9IHBhcmFtc1sndHlwZSddO1xuICAgICAgICAgICAgfSBlbHNlIGlmICgnc3RhdHVzJyBpbiBwYXJhbXMpIHtcbiAgICAgICAgICAgICAgICBzdGF0dXMgPSBwYXJhbXNbJ3N0YXR1cyddO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgZmV0Y2hPcmRlcnMoKSByZXF1aXJlcyB0eXBlIHBhcmFtIG9yIHN0YXR1cyBwYXJhbSBmb3Igc3BvdCBtYXJrZXQgJyArIHN5bWJvbCArICcgKDAgb3IgXCJvcGVuXCIgZm9yIHVuZmlsbGVkIG9yZGVycywgMSBvciBcImNsb3NlZFwiIGZvciBmaWxsZWQgb3JkZXJzKScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSAnb3BlbicpXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gMDtcbiAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gJ2Nsb3NlZCcpXG4gICAgICAgICAgICAgICAgc3RhdHVzID0gMTtcbiAgICAgICAgICAgIGlmIChvcmRlcl9pZF9pbl9wYXJhbXMpIHtcbiAgICAgICAgICAgICAgICBtZXRob2QgKz0gJ09yZGVyc0luZm8nO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHN0YXR1cyxcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgbWV0aG9kICs9ICdPcmRlckhpc3RvcnknO1xuICAgICAgICAgICAgICAgIHJlcXVlc3QgPSB0aGlzLmV4dGVuZCAocmVxdWVzdCwge1xuICAgICAgICAgICAgICAgICAgICAnc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GVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdwYXltaXVtJyxcbiAgICAgICAgICAgICduYW1lJzogJ1BheW1pdW0nLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6IFsgJ0ZSJywgJ0VVJyBdLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICd2MScsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzkwNTY0LWE5NDVhOWQ0LTVmZjktMTFlNy05ZDJkLWI2MzU3NjNmMmYyNC5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9wYXltaXVtLmNvbS9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucGF5bWl1bS5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2dpdGh1Yi5jb20vUGF5bWl1bS9hcGktZG9jdW1lbnRhdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL3d3dy5wYXltaXVtLmNvbS9wYWdlL2RldmVsb3BlcnMnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvdW50cmllcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGF0YS97aWR9L2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdiaXRjb2luX2NoYXJ0cy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9jaGFydHMve2lkfS9kZXB0aCcsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtZXJjaGFudC9nZXRfcGF5bWVudC97VVVJRH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvYWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3Nlcy97YnRjX2FkZHJlc3N9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9vcmRlcnMve1VVSUR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL2FkZHJlc3NlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlci9wYXltZW50X3JlcXVlc3RzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyL3ByaWNlX2FsZXJ0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWVyY2hhbnQvY3JlYXRlX3BheW1lbnQnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvb3JkZXJzL3tVVUlEfS9jYW5jZWwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VzZXIvcHJpY2VfYWxlcnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9FVVInOiB7ICdpZCc6ICdldXInLCAnc3ltYm9sJzogJ0JUQy9FVVInLCAnYmFzZSc6ICdCVEMnLCAncXVvdGUnOiAnRVVSJyB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAwNTksXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMDA1OSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRVc2VyICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gY3VycmVuY2llc1tpXTtcbiAgICAgICAgICAgIGxldCBsb3dlcmNhc2UgPSBjdXJyZW5jeS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdGhp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wZW4nKSxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ3ByaWNlJyksXG4gICAgICAgICAgICAnY2hhbmdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndmFyaWF0aW9uJyksXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogYmFzZVZvbHVtZSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHF1b3RlVm9sdW1lLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gcGFyc2VJbnQgKHRyYWRlWydjcmVhdGVkX2F0X2ludCddKSAqIDEwMDA7XG4gICAgICAgIGxldCB2b2x1bWUgPSAndHJhZGVkXycgKyBtYXJrZXRbJ2Jhc2UnXS50b0xvd2VyQ2FzZSAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAnaWQnOiB0cmFkZVsndXVpZCddLFxuICAgICAgICAgICAgJ29yZGVyJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnc2lkZSc6IHRyYWRlWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsncHJpY2UnXSxcbiAgICAgICAgICAgICdhbW91bnQnOiB0cmFkZVt2b2x1bWVdLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldERhdGFJZFRyYWRlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlVHJhZGVzIChyZXNwb25zZSwgbWFya2V0LCBzaW5jZSwgbGltaXQpO1xuICAgIH1cblxuICAgIGFzeW5jIGNyZWF0ZU9yZGVyIChtYXJrZXQsIHR5cGUsIHNpZGUsIGFtb3VudCwgcHJpY2UgPSB1bmRlZmluZWQsIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCBvcmRlciA9IHtcbiAgICAgICAgICAgICd0eXBlJzogdGhpcy5jYXBpdGFsaXplICh0eXBlKSArICdPcmRlcicsXG4gICAgICAgICAgICAnY3VycmVuY3knOiB0aGlzLm1hcmtldElkIChtYXJrZXQpLFxuICAgICAgICAgICAgJ2RpcmVjdGlvbic6IHNpZGUsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICB9O1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIG9yZGVyWydwcmljZSddID0gcHJpY2U7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0Z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0aGlzLmpzb24gKHBhcmFtcyk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgbGV0IGF1dGggPSBub25jZSArIHVybCArIGJvZHk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdBcGktS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ0FwaS1TaWduYXR1cmUnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5zZWNyZXQpLFxuICAgICAgICAgICAgICAgICdBcGktTm9uY2UnOiBub25jZSxcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9ycycgaW4gcmVzcG9uc2UpXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXhjaGFuZ2VFcnJvciAodGhpcy5pZCArICcgJyArIHRoaXMuanNvbiAocmVzcG9uc2UpKTtcbiAgICAgICAgcmV0dXJuIHJlc3BvbnNlO1xuICAgIH1cbn1cbiIsIlwidXNlIHN0cmljdFwiO1xuXG4vLyAgLS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J1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaENsb3NlZE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9ITENWJzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ2ZldGNoT0hMQ1YnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE15VHJhZGVzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcmRlcic6ICdlbXVsYXRlZCcsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXJzJzogJ2VtdWxhdGVkJyxcbiAgICAgICAgICAgICAgICAnZmV0Y2hPcGVuT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnZmV0Y2hDbG9zZWRPcmRlcnMnOiAnZW11bGF0ZWQnLFxuICAgICAgICAgICAgICAgICdmZXRjaFRpY2tlcnMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaEN1cnJlbmNpZXMnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd3aXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3RpbWVmcmFtZXMnOiB7XG4gICAgICAgICAgICAgICAgJzVtJzogMzAwLFxuICAgICAgICAgICAgICAgICcxNW0nOiA5MDAsXG4gICAgICAgICAgICAgICAgJzMwbSc6IDE4MDAsXG4gICAgICAgICAgICAgICAgJzJoJzogNzIwMCxcbiAgICAgICAgICAgICAgICAnNGgnOiAxNDQwMCxcbiAgICAgICAgICAgICAgICAnMWQnOiA4NjQwMCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODE3LWU5NDU2MzEyLTVlZTYtMTFlNy05YjNjLWI2MjhjYTU2MjZhNS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vcHVibGljJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vdHJhZGluZ0FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vcG9sb25pZXguY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9wb2xvbmlleC5jb20vc3VwcG9ydC9hcGkvJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHA6Ly9wYXN0ZWJpbi5jb20vZE1YN21aRTAnLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgJ2ZlZXMnOiAnaHR0cHM6Ly9wb2xvbmlleC5jb20vZmVlcycsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybjI0aFZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuQ2hhcnREYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5DdXJyZW5jaWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Mb2FuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlckJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVyblRpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbExvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Nsb3NlTWFyZ2luUG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NyZWF0ZUxvYW5PZmZlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2VuZXJhdGVOZXdBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRNYXJnaW5Qb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWFyZ2luQnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJnaW5TZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtb3ZlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkFjdGl2ZUxvYW5zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5BdmFpbGFibGVBY2NvdW50QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybkJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5Db21wbGV0ZUJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0QWRkcmVzc2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5EZXBvc2l0c1dpdGhkcmF3YWxzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5GZWVJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5MZW5kaW5nSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuTWFyZ2luQWNjb3VudFN1bW1hcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JldHVybk9wZW5Mb2FuT2ZmZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcGVuT3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZXR1cm5PcmRlclRyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGFibGVCYWxhbmNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncmV0dXJuVHJhZGVIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0b2dnbGVBdXRvUmVuZXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zZmVyQmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAxNSxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4wMDI1LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiAwLjAsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAnYW1vdW50Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMSxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLjAwMDAwMDAxLFxuICAgICAgICAgICAgICAgICAgICAnbWF4JzogMTAwMDAwMDAwMCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdjb3N0Jzoge1xuICAgICAgICAgICAgICAgICAgICAnbWluJzogMC4wMDAwMDAwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21heCc6IDEwMDAwMDAwMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncHJlY2lzaW9uJzoge1xuICAgICAgICAgICAgICAgICdhbW91bnQnOiA4LFxuICAgICAgICAgICAgICAgICdwcmljZSc6IDgsXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBjYWxjdWxhdGVGZWUgKHN5bWJvbCwgdHlwZSwgc2lkZSwgYW1vdW50LCBwcmljZSwgdGFrZXJPck1ha2VyID0gJ3Rha2VyJywgcGFyYW1zID0ge30pIHtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0c1tzeW1ib2xdO1xuICAgICAgICBsZXQga2V5ID0gJ3F1b3RlJztcbiAgICAgICAgbGV0IHJhdGUgPSBtYXJrZXRbdGFrZXJPck1ha2VyXTtcbiAgICAgICAgbGV0IGNvc3QgPSBwYXJzZUZsb2F0ICh0aGlzLmNvc3RUb1ByZWNpc2lvbiAoc3ltYm9sLCBhbW91bnQgKiByYXRlKSk7XG4gICAgICAgIGlmIChzaWRlID09ICdzZWxsJykge1xuICAgICAgICAgICAgY29zdCAqPSBwcmljZTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGtleSA9ICdiYXNlJztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3R5cGUnOiB0YWtlck9yTWFrZXIsXG4gICAgICAgICAgICAnY3VycmVuY3knOiBtYXJrZXRba2V5XSxcbiAgICAgICAgICAgICdyYXRlJzogcmF0ZSxcbiAgICAgICAgICAgICdjb3N0JzogcGFyc2VGbG9hdCAodGhpcy5mZWVUb1ByZWNpc2lvbiAoc3ltYm9sLCBjb3N0KSksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JUTScpXG4gICAgICAgICAgICByZXR1cm4gJ0JpdG1hcmsnO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1NUUicpXG4gICAgICAgICAgICByZXR1cm4gJ1hMTSc7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBjdXJyZW5jeUlkIChjdXJyZW5jeSkge1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ0JpdG1hcmsnKVxuICAgICAgICAgICAgcmV0dXJuICdCVE0nO1xuICAgICAgICBpZiAoY3VycmVuY3kgPT0gJ1hMTScpXG4gICAgICAgICAgICByZXR1cm4gJ1NUUic7XG4gICAgICAgIHJldHVybiBjdXJyZW5jeTtcbiAgICB9XG5cbiAgICBwYXJzZU9ITENWIChvaGxjdiwgbWFya2V0ID0gdW5kZWZpbmVkLCB0aW1lZnJhbWUgPSAnNW0nLCBzaW5jZSA9IHVuZGVmaW5lZCwgbGltaXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgIG9obGN2WydkYXRlJ10gKiAxMDAwLFxuICAgICAgICAgICAgb2hsY3ZbJ29wZW4nXSxcbiAgICAgICAgICAgIG9obGN2WydoaWdoJ10sXG4gICAgICAgICAgICBvaG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1hcmtldHMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFJldHVyblRpY2tlciAoKTtcbiAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyAobWFya2V0cyk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBrZXlzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBrZXlzW3BdO1xuICAgICAgICAgICAgbGV0IG1hcmtldCA9IG1hcmtldHNbaWRdO1xuICAgICAgICAgICAgbGV0IFsgcXVvdGUsIGJhc2UgXSA9IGlkLnNwbGl0ICgnXycpO1xuICAgICAgICAgICAgYmFzZSA9IHRoaXMuY29tbW9uQ3VycmVuY3lDb2RlIChiYXNlKTtcbiAgICAgICAgICAgIHF1b3RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBzeW1ib2wgPSBiYXNlICsgJy8nICsgcXVvdGU7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAodGhpcy5leHRlbmQgKHRoaXMuZmVlc1sndHJhZGluZyddLCB7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2FjdGl2ZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IHRoaXMubGltaXRzWydhbW91bnQnXVsnbWluJ10sXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4g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sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoMjRociddKSxcbiAgICAgICAgICAgICdsb3cnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2xvdzI0aHInXSksXG4gICAgICAgICAgICAnYmlkJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoZXN0QmlkJ10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93ZXN0QXNrJ10pLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogcGFyc2VGbG9hdCAodGlja2VyWydsYXN0J10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsncGVyY2VudENoYW5nZSddKSxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsncXVvdGVWb2x1bWUnXSksXG4gICAgICAgICAgICAncXVvdGVWb2x1bWUnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJ2Jhc2VWb2x1bWUnXSksXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgIC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GN1cnJlbmNpZXNbaWRdO1xuICAgICAgICAgICAgLy8gdG9kbzogd2lsbCBuZWVkIHRvIHJldGhpbmsgdGhlIGZlZXNcbiAgICAgICAgICAgIC8vIHRvIGFkZCBzdXBwb3J0IGZvciBtdWx0aXBsZSB3aXRoZHJhd2FsL2RlcG9zaXQgbWV0aG9kcyBhbmRcbiAgICAgICAgICAgIC8vIGRpZmZlcmVudGlhdGVkIGZlZXMgZm9yIGVhY2ggcGFydGljdWxhciBtZXRob2RcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSA4OyAvLyBkZWZhdWx0IHByZWNpc2lvbiwgdG9kbzogZml4IFwibWFnaWMgY29uc3RhbnRzXCJcbiAgICAgICAgICAgIGxldCBjb2RlID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKGlkKTtcbiAgICAgICAgICAgIGxldCBhY3RpdmUgPSAoY3VycmVuY3lbJ2RlbGlzdGVkJ10gPT0gMCk7XG4gICAgICAgICAgICBsZXQgc3RhdHVzID0gKGN1cnJlbmN5WydkaXNhYmxlZCddKSA/ICdkaXNhYmxlZCcgOiAnb2snO1xuICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSAnb2snKVxuICAgICAgICAgICAgICAgIGFjdGl2ZSA9IGZhbHNlO1xuICAgICAgICAgICAgcmVzdWx0W2NvZGVdID0ge1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdjb2RlJzogY29kZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgICAgICduYW1lJzogY3VycmVuY3lbJ25hbWUnXSxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogYWN0aXZlLFxuICAgICAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAgICAgJ2ZlZSc6IGN1cnJlbmN5Wyd0eEZlZSddLCAvLyB0b2RvOiByZWRlc2lnblxuICAgICAgICAgICAgICAgICdwcmVjaXNpb24nOiBwcmVjaXNpb24sXG4gICAgICAgICAgICAgICAgJ2xpbWl0cyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2Ftb3VudCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiBNYXRoLnBvdyAoMTAsIC1wcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IE1hdGgucG93ICgxMCwgcHJlY2lzaW9uKSxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvbiksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogY3VycmVuY3lbJ3R4RmVlJ10sXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogTWF0aC5wb3cgKDEwLCBwcmVjaXNpb24pLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9O1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IH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pZiAobWFya2V0KSB7XG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICAgICAgYmFzZSA9IG1hcmtldFsnYmFzZSddO1xuICAgICAgICAgICAgcXVvdGUgPSBtYXJrZXRbJ3F1b3RlJ107XG4gICAgICAgIH1cbiAgICAgICAgbGV0IHNpZGUgPSB0cmFkZVsndHlwZSddO1xuICAgICAgICBsZXQgZmVlID0gdW5kZWZpbmVkO1xuICAgICAgICBsZXQgY29zdCA9IHRoaXMuc2FmZUZsb2F0ICh0cmFkZSwgJ3RvdGFsJyk7XG4gICAgICAgIGxldCBhbW91bnQgPSBwYXJzZUZsb2F0ICh0cmFkZVsnYW1vdW50J10pO1xuICAgICAgICBpZiAoJ2ZlZScgaW4gdHJhZGUpIHtcbiAgICAgICAgICAgIGxldCByYXRlID0gcGFyc2VGbG9hdCAodHJhZGVbJ2ZlZSddKTtcbiAgICAgICAgICAgIGxldCBmZWVDb3N0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKHNpZGUgPT0gJ2J1eScpIHtcbiAgICAgICAgICAgICAgICBjdXJyZW5jeSA9IGJhc2U7XG4gICAgICAgICAgICAgICAgZmVlQ29zdCA9IGFtb3VudCAqIHJhdGU7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGN1cnJlbmN5ID0gcXVvdGU7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBjb3N0ICE9ICd1bmRlZmluZWQnKVxuICAgICAgICAgICAgICAgICAgICBmZWVDb3N0ID0gY29zdCAqIHJhdGU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBmZWUgPSB7XG4gICAgICAgICAgICAgICAgJ3R5cGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAgICAgJ3JhdGUnOiByYXRlLFxuICAgICAgICAgICAgICAgICdjb3N0JzogZmVlQ29zdCxcbiAgICAgICAgICAgICAgICAnY3VycmVuY3knOiBjdXJyZW5jeSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICdpZCc6IHRoaXMuc2FmZVN0cmluZyAodHJhZGUsICd0cmFkZUlEJyksXG4gICAgICAgICAgICAnb3JkZXInOiB0aGlzLnNhZmVTdHJpbmcgKHRyYWRlLCAnb3JkZXJOdW1iZXInKSxcbiAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICdzaWRlJzogc2lkZSxcbiAgICAgICAgICAgICdwcmljZSc6IHBhcnNlRmxvYXQgKHRyYWRlWydyYXRlJ10pLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdmZWUnOiBmZWUsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUcmFkZXMgKHN5bWJvbCwgc2luY2UgPSB1bmRlZmluZWQsIGxpbWl0ID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgJ2N1cnJlbmN5UGFpcic6IG1hcmtldFsnaWQnXSxcbiAgICAgICAgfTtcbiAgICAgICAgaWYgKHNpbmNlKSB7XG4gICAgICAgICAgICByZXF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IGV4cGVjdGVkKVxuICAgICAgICAvLyBpZiAobGltaXQpXG4gICAgICAgIC8vICAgICByZXF1ZXN0WydsaW1pdCddID0gcGFyc2VJbnQgKGxpbWl0KTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFJldHVyblRyYWRlSGlzdG9yeSAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHJlc3VsdCA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlLCBtYXJrZXQpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgaWYgKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGlkcyA9IE9iamVjdC5rZXlzIChyZXNwb25zZSk7XG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBpZHMubGVuZ3RoOyBpKyspIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gaWRzW2ldO1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoaWQgaW4gdGhpcy5tYXJrZXRzX2J5X2lkKVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0ID0gdGhpcy5tYXJrZXRzX2J5X2lkW2lkXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRyYWRlcyA9IHRoaXMucGFyc2VUcmFkZXMgKHJlc3BvbnNlW2lkXSwgbWFya2V0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaiA9IDA7IGogPCB0cmFkZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5wdXNoICh0cmFkZXNbal0pO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgIC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VybiB7XG4gICAgICAgICAgICAnaW5mbyc6IG9yZGVyLFxuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ29yZGVyTnVtYmVyJ10sXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6IG9yZGVyWydzdGF0dXMnXSxcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndHlwZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAnc2lkZSc6IG9yZGVyWydzaWRlJ10sXG4gICAgICAgICAgICAncHJpY2UnOiBwcmljZSxcbiAgICAgICAgICAgICdjb3N0JzogY29zdCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnZmlsbGVkJzogZmlsbGVkLFxuICAgICAgICAgICAgJ3JlbWFpbmluZyc6IHJlbWFpbmluZyxcbiAgICAgICAgICAgICd0cmFkZXMnOiB0cmFkZXMsXG4gICAgICAgICAgICAnZmVlJzogdW5kZWZpbmVkLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIHBhcnNlT3Blbk9yZGVycyAob3JkZXJzLCBtYXJrZXQsIHJlc3VsdCA9IFtdKSB7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgb3JkZXJzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgb3JkZXIgPSBvcmRlcnNbaV07XG4gICAgICAgICAgICBsZXQgZXh0ZW5kZWQgPSB0aGlzLmV4dGVuZCAob3JkZXIsIHtcbiAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ29wZW4nLFxuICAgICAgICAgICAgICAgICd0eXBlJzogJ2xpbWl0JyxcbiAgICAgICAgICAgICAgICAnc2lkZSc6IG9yZGVyWyd0eXBlJ10sXG4gICAgICAgICAgICAgICAgJ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BsZXQgbWFya2V0SWQgPSBtYXJrZXRJZHNbaV07XG4gICAgICAgICAgICAgICAgbGV0IG9yZGVycyA9IHJlc3BvbnNlW21hcmtldElkXTtcbiAgICAgICAgICAgICAgICBsZXQgbSA9IHRoaXMubWFya2V0c19ieV9pZFttYXJrZXRJZF07XG4gICAgICAgICAgICAgICAgb3Blbk9yZGVycyA9IHRoaXMucGFyc2VPcGVuT3JkZXJzIChvcmRlcnMsIG0sIG9wZW5PcmRlcnMpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgb3Blbk9yZGVycy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgdGhpcy5vcmRlcnNbb3Blbk9yZGVyc1tqXVsnaWQnXV0gPSBvcGVuT3JkZXJzW2pdO1xuICAgICAgICB9XG4gICAgICAgIGxldCBvcGVuT3JkZXJzSW5kZXhlZEJ5SWQgPSB0aGlzLmluZGV4QnkgKG9wZW5PcmRlcnMsICdpZCcpO1xuICAgICAgICBsZXQgY2FjaGVkT3JkZXJJZHMgPSBPYmplY3Qua2V5cyAodGhpcy5vcmRlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGZvciAobGV0IGsgPSAwOyBrIDwgY2FjaGVkT3JkZXJJZHMubGVuZ3RoOyBrKyspIHtcbiAgICAgICAgICAgIGxldCBpZCA9IGNhY2hlZE9yZGVySWRzW2tdO1xuICAgICAgICAgICAgaWYgKGlkIGluIG9wZW5PcmRlcnNJbmRleGVkQnlJZCkge1xuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJzW2lkXSA9IHRoaXMuZXh0ZW5kICh0aGlzLm9yZGVyc1tpZF0sIG9wZW5PcmRlcnNJbmRleGVkQnlJZFtpZF0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXIgPSB0aGlzLm9yZGVyc1tpZF07XG4gICAgICAgICAgICAgICAgaWYgKG9yZGVyWydzdGF0dXMnXSA9PSAnb3BlbicpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5vcmRlcnNbaWRdID0gdGhpcy5leHRlbmQgKG9yZGVyLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnc3RhdHVzJzogJ2Nsb3NlZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29zdCc6IG9yZGVyWydhbW91bnQnXSAqIG9yZGVyWydwcmljZSddLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpbGxlZCc6IG9yZGVyWydhbW91bnQnXSxcbiAgICAgICAgICAgICAgICAgICAgICAgICdyZW1haW5pbmcnOiAwLjAsXG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCBvcmRlciA9IHRoaXMub3JkZXJzW2lkXTtcbiAgICAgICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgICAgICBpZiAob3JkZXJbJ3N5bWJvbCddID09IHN5bWJvbClcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmVzdWx0LnB1c2ggKG9yZGVyKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5maWx0ZXJCeVNpbmNlTGltaXQgKHJlc3VsdCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE9yZGVyIChpZCwgc3ltYm9sID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBsZXQgc2luY2UgPSB0aGlzLnNhZmVWYWx1ZSAocGFyYW1zLCAnc2luY2UnKTtcbiAgICAgICAgbGV0IGxpbWl0ID0gdGhpcy5zYWZlVmFsdWUgKHBhcmFtcywgJ2xpbWl0Jyk7XG4gICAgICAgIGx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ICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgY3VycmVuY3lJZCA9IHRoaXMuY3VycmVuY3lJZCAoY3VycmVuY3kpO1xuICAgICAgICBsZXQgcmVzdWx0ID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFdpdGhkcmF3ICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5JzogY3VycmVuY3lJZCxcbiAgICAgICAgICAgICdhbW91bnQnOiBhbW91bnQsXG4gICAgICAgICAgICAnYWRkcmVzcyc6IGFkZHJlc3MsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXN1bHQsXG4gICAgICAgICAgICAnaWQnOiByZXN1bHRbJ3Jlc3BvbnNlJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgbm9uY2UgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXVthcGldO1xuICAgICAgICBsZXQgcXVlcnkgPSB0aGlzLmV4dGVuZCAoeyAnY29tbWFuZCc6IHBhdGggfSwgcGFyYW1zKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLmNoZWNrUmVxdWlyZWRDcmVkZW50aWFscyAoKTtcbiAgICAgICAgICAgIHF1ZXJ5Wydub25jZSddID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcsXG4gICAgICAgICAgICAgICAgJ0tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdTaWduJzogdGhpcy5obWFjICh0aGlzLmVuY29kZSAoYm9keSksIHRoaXMuZW5jb2RlICh0aGlzLnNlY3JldCksICdzaGE1MTInKSxcbiAgICAgICAgICAgIH07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG5cbiAgICBhc3luYyByZXF1ZXN0IChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2gyIChwYXRoLCBhcGksIG1ldGhvZCwgcGFyYW1zLCBoZWFkZXJzLCBib2R5KTtcbiAgICAgICAgaWYgKCdlcnJvcicgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgIGxldCBlcnJvciA9IHRoaXMuaWQgKyAnICcgKyB0aGlzLmpzb24gKHJlc3BvbnNlKTtcbiAgICAgICAgICAgIGxldCBmYWlsZWQgPSByZXNwb25zZVsnZXJyb3InXS5pbmRleE9mICgnTm90IGVub3VnaCcpID49IDA7XG4gICAgICAgICAgICBpZiAoZmFpbGVkKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAoZXJyb3IpO1xuICAgIC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gICAgICAgICAgICAgICAgJ2ZldGNoT3JkZXInOiB0cnVlLFxuICAgICAgICAgICAgICAgICdmZXRjaE9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoT3Blbk9yZGVycyc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ2ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzMwOTUzOTE1LWIxNjExZGMwLWE0MzYtMTFlNy04OTQ3LWM5NWJkNWE0MjA4Ni5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXJ5cHRvcy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9kZXZlbG9wZXJzLnF1b2luZS5jb20nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcm9kdWN0cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJvZHVjdHMve2lkfS9wcmljZV9sZXZlbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2lyX2xhZGRlcnMve2N1cnJlbmN5fScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY2NvdW50cy9iYWxhbmNlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcnlwdG9fYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4ZWN1dGlvbnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2ZpYXRfYWNjb3VudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfS9sb2FucycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGluZ19hY2NvdW50cy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZmlhdF9hY2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9hbl9iaWRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncHV0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2xvYW5fYmlkcy97aWR9L2Nsb3NlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsb2Fucy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL3tpZH0vY2FuY2VsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3tpZH0vY2xvc2UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy9jbG9zZV9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRpbmdfYWNjb3VudHMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcm9kdWN0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydpZCddO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbJ2Jhc2VfY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsncXVvdGVkX2N1cnJlbmN5J107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IG1ha2VyID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ21ha2VyX2ZlZScpO1xuICAgICAgICAgICAgbGV0IHRha2VyID0gdGhpcy5zYWZlRmxvYXQgKG1hcmtldCwgJ3Rha2VyX2ZlZScpO1xuICAgICAgICAgICAgbGV0IGFjdGl2ZSA9ICFtYXJrZXRbJ2Rpc2FibGVkJ107XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdtYWtlcic6IG1ha2VyLFxuICAgICAgICAgICAgICAgICd0YWtlcic6IHRha2VyLFxuICAgICAgICAgICAgICAgICdhY3RpdmUnOiBhY3RpdmUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QWNjb3VudHNCYWxhbmNlICgpO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IHRvdGFsID0gcGFyc2VGbG9hdCAoYmFsYW5jZVsnYmFsYW5jZSddKTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogdG90YWwsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzog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0X3RyYWRlZF9wcmljZSddKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBsZXQgc3ltYm9sID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAobWFya2V0KVxuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnaGlnaF9tYXJrZXRfYXNrJyksXG4gICAgICAgICAgICAnbG93JzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ2xvd19tYXJrZXRfYmlkJyksXG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ21hcmtldF9iaWQnKSxcbiAgICAgICAgICAgICdhc2snOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAnbWFya2V0X2FzaycpLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aGlzLnNhZmVGbG9hdCAodGlja2VyLCAndm9sdW1lXzI0aCcpLFxuICA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QnO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChvcmRlclsnc3RhdHVzJ10gPT0gJ2NhbmNlbGxlZCcpIHsgLy8gJ2xsJyBpbnRlbmRlZFxuICAgICAgICAgICAgICAgIHN0YXR1cyA9ICdjYW5jZWxlZCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgbGV0IGFtb3VudCA9IHBhcnNlRmxvYXQgKG9yZGVyWydxdWFudGl0eSddKTtcbiAgICAgICAgbGV0IGZpbGxlZCA9IHBhcnNlRmxvYXQgKG9yZGVyWydmaWxsZWRfcXVhbnRpdHknXSk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpIHtcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpZCc6IG9yZGVyWydpZCddLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICd0eXBlJzogb3JkZXJbJ29yZGVyX3R5cGUnXSxcbiAgICAgICAgICAgICdzdGF0dXMnOiBzdGF0dXMsXG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3NpZGUnOiBvcmRlclsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogb3JkZXJbJ3ByaWNlJ10sXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ2ZpbGxlZCc6IGZpbGxlZCxcbiAgICAgICAgICAgICdyZW1haW5pbmcnOiBhbW91bnQgLSBmaWxsZWQsXG4gICAgICAgICAgICAndHJhZGVzJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2ZlZSc6IHtcbiAgIC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NvZGUsIHJlYXNvbiwgdXJsLCBtZXRob2QsIGhlYWRlcnMsIGJvZHkpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gdW5kZWZpbmVkO1xuICAgICAgICBpZiAoY29kZSA9PSAyMDAgfHwgY29kZSA9PSA0MDQgfHwgY29kZSA9PSA0MjIpIHtcbiAgICAgICAgICAgIGlmICgoYm9keVswXSA9PSAneycpIHx8IChib2R5WzBdID09ICdbJykpIHtcbiAgICAgICAgICAgICAgICByZXNwb25zZSA9IEpTT04ucGFyc2UgKGJvZHkpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAvLyBpZiBub3QgYSBKU09OIHJlc3BvbnNlXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGEgbm9uLUpTT04gcmVwbHk6ICcgKyBib2R5KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBpZiAoY29kZSA9PSA0MDQpIHtcbiAgICAgICAgICAgIGlmICgnbWVzc2FnZScgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2VbJ21lc3NhZ2UnXSA9PSAnT3JkZXIgbm90IGZvdW5kJykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIGlmIChjb2RlID09IDQyMikge1xuICAgICAgICAgICAgaWYgKCdlcnJvcnMnIGluIHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgbGV0IGVycm9ycyA9IHJlc3BvbnNlWydlcnJvcnMnXTtcbiAgICAgICAgICAgICAgICBpZiAoJ3VzZXInIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZXMgPSBlcnJvcnNbJ3VzZXInXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1lc3NhZ2VzLmluZGV4T2YgKCdub3RfZW5vdWdoX2ZyZWVfYmFsYW5jZScpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGJvZHkpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgncXVhbnRpdHknIGluIGVycm9ycykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbWVzc2FnZXMgPSBlcnJvcnNbJ3F1YW50aXR5J107XG4gICAgICAgICAgICAgICAgICAgIGlmIChtZXNzYWdlcy5pbmRleE9mICgnbGVzc190aGFuX29yZGVyX3NpemUnKSA+PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSW52YWxpZE9yZGVyICh0aGlzLmlkICsgJyAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBub25jZSAoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICB9XG5cbiAgICBzaWduIChwYXRoLCBhcGkgPSAncHVibGljJywgbWV0aG9kID0gJ0dFVCcsIHBhcmFtcyA9IHt9LCBoZWFkZXJzID0gdW5kZWZpbmVkLCBib2R5ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCB1cmwgPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICdYLVF1b2luZS1BUEktVmVyc2lvbic6IHRoaXMudmVyc2lvbixcbiAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnR0VUJykge1xuICAgICAgICAgICAgICAgIGlmIChPYmplY3Qua2V5cyAocXVlcnkpLmxlbmd0aClcbiAgICAgICAgICAgICAgICAgICAgdXJsICs9ICc/JyArIHRoaXMudXJsZW5jb2RlIChxdWVyeSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKSB7XG4gICAgICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0ge1xuICAgICAgICAgICAgICAgICdwYXRoJzogdXJsLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICd0b2tlbl9pZCc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdpYXQnOiBNYXRoLmZsb29yIChub25jZSAvIDEwMDApLCAvLyBpc3N1ZWQgYXRcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBoZWFkZXJzWydYLVF1b2luZS1BdXRoJ10gPSB0aGlzLmp3dCAocmVxdWVzdCwgdGhpcy5zZWNyZXQpO1xuIC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xuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIC8vIG5ldyBtZXRhaW5mbyBpbnRlcmZhY2VcbiAgICAgICAgICAgICdoYXMnOiB7XG4gICAgICAgICAgICAgICAgJ3dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2ODI1LTk4YTZkMGRlLTVlZTctMTFlNy05ZmE0LTM4ZTExYTJjNmY1Mi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cucXVhZHJpZ2FjeC5jb20vYXBpX2luZm8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdyZXF1aXJlZENyZWRlbnRpYWxzJzoge1xuICAgICAgICAgICAgICAgICdhcGlLZXknOiB0cnVlLFxuICAgICAgICAgICAgICAgICdzZWNyZXQnOiB0cnVlLFxuICAgICAgICAgICAgICAgICd1aWQnOiB0cnVlLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcl9ib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYml0Y29pbl9kZXBvc2l0X2FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JpdGNvaW5fd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYnV5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxfb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V0aGVyX2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZXRoZXJfd2l0aGRyYXdhbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbG9va3VwX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcGVuX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc2VsbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAndXNlcl90cmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ21hcmtldHMnOiB7XG4gICAgICAgICAgICAgICAgJ0JUQy9DQUQnOiB7ICdpZCc6ICdidGNfY2FkJywgJ3N5bWJvbCc6ICdCVEMvQ0FEJywgJ2Jhc2UnOiAnQlRDJywgJ3F1b3RlJzogJ0NBRCcsICdtYWtlcic6IDAuMDA1LCAndGFrZXInOiAwLjAwNSB9LFxuICAgICAgICAgICAgICAgICdCVEMvVVNEJzogeyAnaWQnOiAnYnRjX3VzZCcsICdzeW1ib2wnOiAnQlRDL1VTRCcsICdiYXNlJzogJ0JUQycsICdxdW90ZSc6ICdVU0QnLCAnbWFrZXInOiAwLjAwNSwgJ3Rha2VyJzogMC4wMDUgfS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AnOiB2d2FwLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbGFzdCddKSxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiBiYXNlVm9sdW1lLFxuICAgICAgICAgICAgJ3F1b3RlVm9sdW1lJzogcXVvdGVWb2x1bWUsXG4gICAgICAgICAgICAnaW5mbyc6IHRpY2tlcixcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBwYXJzZVRyYWRlICh0cmFkZSwgbWFya2V0KSB7XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSBwYXJzZUludCAodHJhZGVbJ2RhdGUnXSkgKiAxMDAwO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdpZCc6IHRyYWRlWyd0aWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB0cmFkZVsnc2lkZSddLFxuICAgICAgICAgICAgJ3ByaWNlJzogcGFyc2VGbG9hdCAodHJhZGVb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ZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHBhdGg7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIGxldCByZXF1ZXN0ID0gWyBub25jZS50b1N0cmluZyAoKSwgdGhpcy51aWQsIHRoaXMuYXBpS2V5IF0uam9pbiAoJycpO1xuICAgICAgICAgICAgbGV0IHNpZ25hdHVyZSA9IHRoaXMuaG1hYyAodGhpcy5lbmNvZGUgKHJlcXVlc3QpLCB0aGlzLmVuY29kZSAodGhpcy5zZWNyZXQpKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ2tleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgICAgICdzaWduYXR1cmUnOiBzaWduYXR1cmUsXG4gICAgICAgICAgICB9LCBwYXJhbXMpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMuanNvbiAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsI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Rlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICdzb3V0aHhjaGFuZ2UnLFxuICAgICAgICAgICAgJ25hbWUnOiAnU291dGhYY2hhbmdlJyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnQVInLCAvLyBBcmdlbnRpbmFcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzQ09SUyc6IGZhbHNlLFxuICAgICAgICAgICAgJ2hhc1dpdGhkcmF3JzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc4Mzg5MTItNGY5NGVjOGEtNjBmNi0xMWU3LTllNWQtYmJmOWJkNTBhNTU5LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy5zb3V0aHhjaGFuZ2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogJ2h0dHBzOi8vd3d3LnNvdXRoeGNoYW5nZS5jb20vSG9tZS9BcGknLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwcmljZS97c3ltYm9sfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncHJpY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdib29rL3tzeW1ib2x9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMve3N5bWJvbH0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbE1hcmtldE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dlbmVyYXRlbmV3YWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdE9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGlzdEJhbGFuY2VzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwbGFjZU9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhdycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGJhc2UgPSBtYXJrZXRbMF07XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSBtYXJrZXRbMV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGlkID0gc3ltYm9sO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgYmFsYW5jZXMgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0TGlzdEJhbGFuY2VzICgpO1xuICAgICAgICBpZiAoIWJhbGFuY2VzKVxuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIGZldGNoQmFsYW5jZSBnb3QgYW4gdW5yZWNvZ25pemVkIHJlc3BvbnNlJyk7XG4gICAgICAgIGxldCByZXN1bHQgPSB7ICdpbmZvJzogYmFsYW5jZXMgfTtcbiAgICAgICAgZm9yIChsZXQgYiA9IDA7IGIgPCBiYWxhbmNl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RhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYXZlcmFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdiYXNlVm9sdW1lJzogdGhpcy5zYWZlRmxvYXQgKHRpY2tlciwgJ1ZvbHVtZTI0SHInKSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcmljZXMgKHBhcmFtcyk7XG4gICAgICAgIGxldCB0aWNrZXJzID0gdGhpcy5pbmRleEJ5IChyZXNwb25zZSwgJ01hcmtldCcpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gaWQ7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgaWYgKGlkIGluIHRoaXMubWFya2V0c19ieV9pZCkge1xuICAgICAgICAgICAgICAgIG1hcmtldCA9IHRoaXMubWFya2V0c19ieV9pZFtpZF07XG4gICAgICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGxldCB0aWNrZXIgPSB0aWNrZXJzW2lkXTtcbiAgICAgICAgICAgIHJlc3VsdFtzeW1ib2xdID0gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hUaWNrZXIgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG1hcmtldCA9IHRoaXMubWFya2V0IChzeW1ib2wpO1xuICAgICAgICBsZXQgdGlja2VyID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRQcmljZVN5bWJvbCAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ2lkJ10sXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQpO1xuICAgIH1cblxuICAgIHBhcnNlVHJhZGUgKHRyYWRlLCBtYXJrZXQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRyYWRlWydBdCddICogMTAwMDtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdpbmZvJzogdHJhZGUsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N5bWJvbCc6IG1hcmtldFsnc3ltYm9sJ10sXG4gICAgICAgICAgICAnaWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3JkZXInOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAndHlwZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdzaWRlJzogdHJhZGVbJ1R5cGUnXSxcbiAgICAgICAgICAgICdwcmljZSc6IHRyYWRlWydQcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHR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gcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHJpdmF0ZScpIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgbGV0IG5vbmNlID0gdGhpcy5ub25jZSAoKTtcbiAgICAgICAgICAgIHF1ZXJ5ID0gdGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICAgICAna2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBxdWVyeSk7XG4gICAgICAgICAgICBib2R5ID0gdGhpcy5qc29uIChxdWVyeSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXG4gICAgICAgICAgICAgICAgJ0hhc2gnOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1z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AgICAgICAgICAncmF0ZUxpbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJ3YxJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjc3NjY4NjktNzUwNTdmYTItNWVlOS0xMWU3LTlhNmYtMTNlNjQxZmE0NzA3LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20nLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly90aGVyb2NrdHJhZGluZy5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwczovL2FwaS50aGVyb2NrdHJhZGluZy5jb20vZG9jL3YxL2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9hcGkudGhlcm9ja3RyYWRpbmcuY29tL2RvYy8nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tpZH0vb3JkZXJib29rJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RpY2tlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2JhbGFuY2VzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Rpc2NvdW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGlzY291bnRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97aWR9L3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdmdW5kcy97ZnVuZF9pZH0vcG9zaXRpb25fYmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9wb3NpdGlvbnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhbnNhY3Rpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXdfbGltaXRzL3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3X2xpbWl0cycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2F0bXMvd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2Z1bmRzL3tmdW5kX2lkfS9vcmRlcnMve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZnVuZHMve2Z1bmRfaWR9L29yZGVycy9yZW1vdmVfYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdmZWVzJzoge1xuICAgICAgICAgICAgICAgICd0cmFkaW5nJzoge1xuICAgICAgICAgICAgICAgICAgICAnbWFrZXInOiAwLjAyIC8gMTAwLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjIgLyAxMDAsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0cyAoKSB7XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRGdW5kc1RpY2tlcnMgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzWyd0aWNrZXJzJ10ubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWyd0aWNrZXJzJ11bcF07XG4gICAgICAgICAgICBsZXQgaWQgPSBtYXJrZXRbJ2Z1bmRfaWQnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgbGV0IHF1b3RlID0gaWQuc2xpY2UgKDMsIDYpO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgICAgIHJlc3VsdC5wdXNoICh7XG4gICAgICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICAgICAnYmFzZSc6IGJhc2UsXG4gICAgICAgICAgICAgICAgJ3F1b3RlJzogcXVvdGUsXG4gICAgICAgICAgICAgICAgJ2luZm8nOiBtYXJrZXQsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gcmVzdWx0O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoQmFsYW5jZSAocGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlR2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydiYWxhbmNlcyddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IHJlc3BvbnNlIH07XG4gICAgICAgIGZvciAobGV0IGIgPSAwOyBiIDwgYmFsYW5jZXMubGVuZ3RoOyBiKyspIHtcbiAgICAgICAgICAgIGxldCBiYWxhbmNlID0gYmFsYW5jZXNbYl07XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBiYWxhbmNlWydjdXJyZW5jeSddO1xuICAgICAgICAgICAgbGV0IGZyZWUgPSBiYWxhbmNlWyd0cmFkaW5nX2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCB1c2VkID0gdG90YWwgLSBmcmVlO1xuICAgICAgICAgICAgbGV0IGFjY291bnQgPSB7XG4gICAgICAgICAgICAgICAgJ2ZyZWUnOiBmcmVlLFxuICAgICAgICAgICAgICAgICd1c2VkJzogdXNlZCxcbiAgICAgICAgICAgICAgICAndG90YWwnOiB0b3RhbCxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICByZXN1bHRbY3VycmVuY3ldID0gYWNjb3VudDtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZUJhbGFuY2UgKHJlc3VsdCk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IG9yZGVyYm9vayA9IGF3YWl0IHRoaXMucHVibGljR2V0RnVuZHNJZE9yZGVyYm9vayAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdpZCc6IHRoaXMubWFya2V0SWQgKHN5bWJvbCksXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKG9yZGVyYm9va1snZGF0ZSddKTtcbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VPcmRlckJvb2sgKG9yZGVyYm9vaywgdGltZXN0YW1wLCAnYmlkcycsICdhc2tzJywgJ3ByaWNlJywgJ2Ftb3VudCcpO1xuICAgIH1cblxuICAgIHBhcnNlVGlja2VyICh0aWNrZXIsIG1hcmtldCA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRpY2tlclsnZGF0ZSddKTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWV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1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3RpZGV4JyxcbiAgICAgICAgICAgICduYW1lJzogJ1RpZGV4JyxcbiAgICAgICAgICAgICdjb3VudHJpZXMnOiAnVUsnLFxuICAgICAgICAgICAgJ3JhdGVMaW1pdCc6IDIwMDAsXG4gICAgICAgICAgICAndmVyc2lvbic6ICczJyxcbiAgICAgICAgICAgIC8vICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAvLyAnaGFzRmV0Y2hUaWNrZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICd1cmxzJzoge1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMzA3ODE3ODAtMDMxNDlkYzQtYTEyZS0xMWU3LTgyYmItMzEzYjI2OWQyNGQ0LmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3B1YmxpYyc6ICdodHRwczovL2FwaS50aWRleC5jb20vYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiAnaHR0cHM6Ly9hcGkudGlkZXguY29tL3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3RpZGV4LmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3RpZGV4LmNvbS9wdWJsaWMtYXBpJyxcbiAgICAgICAgICAgICAgICAnZmVlcyc6ICdodHRwczovL3RpZGV4LmNvbS9wYWlycy1zcGVjJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnZmVlcyc6IHtcbiAgICAgICAgICAgICAgICAndHJhZGluZyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3RpZXJCYXNlZCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICAgICAncGVyY2VudGFnZSc6IHRydWUsXG4gICAgICAgICAgICAgICAgICAgICd0YWtlcic6IDAuMSAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ21ha2VyJzogMC4xIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ2Z1bmRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICd0aWVyQmFzZWQnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3BlcmNlbnRhZ2UnOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3Jzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0JUQyc6IDAuMDAxMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdFVEgnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0xUQyc6IDAuMDAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RPR0UnOiAwLjAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0lDTic6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnREFTSCc6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDIsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMixcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAyLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdCVEMnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0VUSCc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnTFRDJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdET0dFJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdJQ04nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0RBU0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dOTyc6IDAsXG4gICAgICAgICAgICAgICAgICAgICAgICAnRU9TJzogMCxcbiAgICAgICAgICAgICAgICAgICAgICAgICdCQ0gnOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VTRFQnOiAwLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbmNvbnN0IGZveGJpdCA9IHJlcXVpcmUgKCcuL2ZveGJpdC5qcycpXG5cbi8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVxuXG5tb2R1bGUuZXhwb3J0cyA9IGNsYXNzIHVyZHViaXQgZXh0ZW5kcyBmb3hiaXQge1xuXG4gICAgZGVzY3JpYmUgKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5kZWVwRXh0ZW5kIChzdXBlci5kZXNjcmliZSAoKSwge1xuICAgICAgICAgICAgJ2lkJzogJ3VyZHViaXQnLFxuICAgICAgICAgICAgJ25hbWUnOiAnVXJkdUJpdCcsXG4gICAgICAgICAgICAnY291bnRyaWVzJzogJ1BLJyxcbiAgICAgICAgICAgICdoYXNDT1JTJzogZmFsc2UsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3OTkxNDUzLTE1NmJmM2FlLTY0OD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pbWl0JzogMTAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg4MC1mMjA1ZTg3MC01ZWU5LTExZTctOGZlMi0wZDViMTU4ODA3NTIuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzogJ2h0dHBzOi8vYXBpLnZhdWx0b3JvLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy52YXVsdG9yby5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly9hcGkudmF1bHRvcm8uY29tJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmlkYW5kYXNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdidXlvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xhdGVzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGF0ZXN0dHJhZGVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcmJvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3NlbGxvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9kYXknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYW5zYWN0aW9ucy9ob3VyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFuc2FjdGlvbnMvbW9udGgnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYmFsYW5jZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbXl0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2J1eS97c3ltYm9sfS97dHlwZX0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbC97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzZWxsL3tzeW1ib2x9L3t0eXBlfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgcmVzdWx0ID0gW107XG4gICAgICAgIGxldCBtYXJrZXRzID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1snZGF0YSddO1xuICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnQmFzZUN1cnJlbmN5J107XG4gICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnTWFya2V0Q3VycmVuY3knXTtcbiAgICAgICAgbGV0IHN5bWJvbCA9IGJhc2UgKyAnLycgKyBxdW90ZTtcbiAgICAgICAgbGV0IGJhc2VJZCA9IGJhc2U7XG4gICAgICAgIGxldCBxdW90ZUlkID0gcXVvdGU7XG4gICAgICAgIGxldCBpZCA9IG1hcmtldFsnTW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HF1b3RlID0gYXdhaXQgdGhpcy5wdWJsaWNHZXRCaWRhbmRhc2sgKHBhcmFtcyk7XG4gICAgICAgIGxldCBiaWRzTGVuZ3RoID0gcXVvdGVbJ2JpZHMnXS5sZW5ndGg7XG4gICAgICAgIGxldCBiaWQgPSBxdW90ZVsnYmlkcyddW2JpZHNMZW5ndGggLSAxXTtcbiAgICAgICAgbGV0IGFzayA9IHF1b3RlWydhc2tzJ11bMF07XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHVibGljR2V0TWFya2V0cyAocGFyYW1zKTtcbiAgICAgICAgbGV0IHRpY2tlciA9IHJlc3BvbnNlWydkYXRhJ107XG4gICAgICAgIGxldCB0aW1lc3RhbXAgPSB0aGlzLm1pbGxpc2Vjb25kcyAoKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ2hpZ2gnOiBwYXJzZUZsb2F0ICh0aWNrZXJbJzI0aEhpZ2gnXSksXG4gICAgICAgICAgICAnbG93JzogcGFyc2VGbG9hdCAodGlja2VyWycyNGhMb3cnXSksXG4gICAgICAgICAgICAnYmlkJzogYmlkWzBdLFxuICAgICAgICAgICAgJ2Fzayc6IGFza1swXSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnTGFzdFByaWNlJ10pLFxuICAgICAgICAgICAgJ2NoYW5nZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdwZXJjZW50YWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2F2ZXJhZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnYmFzZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHBhcnNlRmxvYXQgKHRpY2tlclsnMjRoVm9sdW1lJ10pLFxuICAgICAgICAgICAgJ2luZm8nOiB0aWNrZXIsXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcGFyc2VUcmFkZSAodHJhZGUsIG1hcmtldCkge1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5wYXJzZTg2MDEgKHRyYWRlWydUaW1lJ10pO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2luZm8nOiB0cmFkZSxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnc3ltYm9sJzogbWFya2V0WydzeW1ib2wnXSxcbiAgICAgICAgICAgICdvcmRlcic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICd0eXBlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3NpZGUnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncHJpY2UnOiB0cmFkZVsnR29sZF9QcmljZSddLFxuICAgICAgICAgICAgJ2Ftb3VudCc6IHRyYWRlWydHb2xkX0Ftb3VudCddLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVHJhZGVzIChzeW1ib2wsIHNpbmNlID0gdW5kZWZpbmVkLCBsaW1pdCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAo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JhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICByZXR1cm4gYXdhaXQgdGhpcy5wcml2YXRlUG9zdENhbmNlbElkICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2lkJzogaWQsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgIH1cblxuICAgIHNpZ24gKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHVybCA9IHRoaXMudXJsc1snYXBpJ10gKyAnLyc7XG4gICAgICAgIGlmIChhcGkgPT0gJ3B1YmxpYycpIHtcbiAgICAgICAgICAgIHVybCArPSBwYXRoO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgdXJsICs9IHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgICAgIGxldCBxdWVyeSA9IHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ25vbmNlJzogbm9uY2UsXG4gICAgICAgICAgICAgICAgJ2FwaWtleSc6IHRoaXMuYXBpS2V5LFxuICAgICAgICAgICAgfSwgdGhpcy5vbWl0IChwYXJhbXMsIHRoaXMuZXh0cmFjdFBhcmFtcyAocGF0aCkpKTtcbiAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICAgICAgaGVhZGVycyA9IHtcbiAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL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HJpZXMnOiBbICdBVCcsICdFVScgXSxcbiAgICAgICAgICAgICdyYXRlTGltaXQnOiAxMDAwLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiB0cnVlLFxuICAgICAgICAgICAgJ3VybHMnOiB7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8yNzc2Njg5NC02ZGE5ZDM2MC01ZWVhLTExZTctOTBhYS00MWYyNzExYjc0MDUuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHA6Ly9hcGkudmlyd294LmNvbS9hcGkvanNvbi5waHAnLFxuICAgICAgICAgICAgICAgICAgICAncHJpdmF0ZSc6ICdodHRwczovL3d3dy52aXJ3b3guY29tL2FwaS90cmFkaW5nLnBocCcsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vd3d3LnZpcndveC5jb20nLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cudmlyd294LmNvbS9kZXZlbG9wZXJzLnBocCcsXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ3JlcXVpcmVkQ3JlZGVudGlhbHMnOiB7XG4gICAgICAgICAgICAgICAgJ2FwaUtleSc6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3NlY3JldCc6IGZhbHNlLFxuICAgICAgICAgICAgICAgICdsb2dpbic6IHRydWUsXG4gICAgICAgICAgICAgICAgJ3Bhc3N3b3JkJzogdHJ1ZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbnN0cnVtZW50cycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmVzdFByaWNlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0TWFya2V0RGVwdGgnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2VzdGltYXRlTWFya2V0T3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRyYWRlZFByaWNlVm9sdW1lJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRSYXdUcmFkZURhdGEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFN0YXRpc3RpY3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFRlcm1pbmFsTGlzdCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0R3JpZExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW5zdHJ1bWVudHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEJlc3RQcmljZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE1hcmtldERlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdlc3RpbWF0ZU1hcmtldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFkZWRQcmljZVZvbHVtZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0UmF3VHJhZGVEYXRhJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRTdGF0aXN0aWNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUZXJtaW5hbExpc3QnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEdyaWRMaXN0JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRHcmlkU3RhdGlzdGljcycsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdjYW5jZWxPcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0QmFsYW5jZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENvbW1pc3Npb25EaXNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRUcmFuc2FjdGlvbnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3BsYWNlT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0SW5zdHJ1bWVudHMgKCk7XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKG1hcmtldHNbJ3Jlc3VsdCddKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IGtleXMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzWydyZXN1bHQnXVtrZXlzW3BdXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnaW5zdHJ1bWVudElEJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WydzeW1ib2wnXTtcbiAgICAgICAgICAgIGxldCBiYXNlID0gbWFya2V0Wydsb25nQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnc2hvcnRDdXJyZW5jeSddO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0QmFsYW5jZXMgKCk7XG4gICAgICAgIGxldCBiYWxhbmNlcyA9IHJlc3BvbnNlWydyZXN1bHQnXVsnYWNjb3VudExpc3QnXTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IHsgJ2luZm8nOiBiYWxhbmNlcyB9O1xuICAgICAgICBmb3IgKGxldCBiID0gMDsgYiA8IGJhbGFuY2VzLmxlbmd0aDsgYisrKSB7XG4gICAgICAgICAgICBsZXQgYmFsYW5jZSA9IGJhbGFuY2VzW2JdO1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gYmFsYW5jZVsnY3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCB0b3RhbCA9IGJhbGFuY2VbJ2JhbGFuY2UnXTtcbiAgICAgICAgICAgIGxldCBhY2NvdW50ID0ge1xuICAgICAgICAgICAgICAgICdmcmVlJzogdG90YWwsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogdG90YWwsXG4gICAgICAgICAgICB9O1xuICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMucGFyc2VCYWxhbmNlIChyZXN1bHQpO1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoTWFya2V0UHJpY2UgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wdWJsaWNQb3N0R2V0QmVzdFByaWNlcyAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdzeW1ib2xzJzogWyBzeW1ib2wgXSxcbiAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgIGxldCByZXN1bHQgPSByZXNwb25zZVsncmVzdWx0J107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnYmlkJzogdGhpcy5zYWZlRmxvYXQgKHJlc3VsdFswXSwgJ2Jlc3RCdXlQcmljZScpLFxuICAgICAgICAgICAgJ2Fzayc6IHRoaXMuc2FmZUZsb2F0IChyZXN1bHRbMF0sICdiZXN0U2VsbFByaWNlJyksXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hPcmRlckJvb2sgKHN5bWJvbCwgcGFyYW1zID0ge30pIHtcbiAgICAg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ICAgICAgYXV0aFsncGFzcyddID0gdGhpcy5wYXNzd29yZDtcbiAgICAgICAgfVxuICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICBpZiAobWV0aG9kID09ICdHRVQnKSB7XG4gICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAgICAgJ21ldGhvZCc6IHBhdGgsXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICB9LCBhdXRoLCBwYXJhbXMpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGhlYWRlcnMgPSB7ICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24vanNvbicgfTtcbiAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHtcbiAgICAgICAgICAgICAgICAnbWV0aG9kJzogcGF0aCxcbiAgICAgICAgICAgICAgICAncGFyYW1zJzogdGhpcy5leHRlbmQgKGF1dGgsIHBhcmFtcyksXG4gICAgICAgICAgICAgICAgJ2lkJzogbm9uY2UsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdwdWJsaWMnLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25z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7XG4gICAgICAgICAgICAgICAgJ2xvZ28nOiAnaHR0cHM6Ly91c2VyLWltYWdlcy5naXRodWJ1c2VyY29udGVudC5jb20vMTI5NDQ1NC8zMDY1Mjc1MS1kNzRlYzhmOC05ZTMxLTExZTctOThjNS03MTQ2OWZjZWYwM2UuanBnJyxcbiAgICAgICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncHVibGljJzogJ2h0dHBzOi8vd2V4Lm56L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vd2V4Lm56L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3dleC5ueicsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd2V4Lm56L2FwaS8zL2RvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93ZXgubnovdGFwaS9kb2NzJyxcbiAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdpbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldEluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdBY3RpdmVPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ09yZGVySW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlSGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnVHJhbnNIaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb2luRGVwb3NpdEFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ3JlYXRlQ291cG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWRlZW1Db3Vwb24nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMiAvIDEwMCxcbiAgICAgICAgICAgICAgICAgICAgJ3Rha2VyJzogMC4yIC8gMTAwLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwYXJzZVRpY2tlciAodGlja2VyLCBtYXJrZXQgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHRpY2tlclsndXBkYXRlZCddICogMTAwMDtcbiAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgaWYgKG1hcmtldClcbiAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ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gICAgaWYgKGNvZGUgPT0gMjAwKSB7XG4gICAgICAgICAgICBpZiAoYm9keVswXSAhPSAneycpIHtcbiAgICAgICAgICAgICAgICAvLyByZXNwb25zZSBpcyBub3QgSlNPTlxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyByZXR1cm5lZCBhIG5vbi1KU09OIHJlcGx5OiAnICsgYm9keSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgcmVzcG9uc2UgPSBKU09OLnBhcnNlIChib2R5KTtcbiAgICAgICAgICAgIGlmICgnc3VjY2VzcycgaW4gcmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICBpZiAoIXJlc3BvbnNlWydzdWNjZXNzJ10pIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVycm9yID0gdGhpcy5zYWZlVmFsdWUgKHJlc3BvbnNlLCAnZXJyb3InKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2hhbmdlRXJyb3IgKHRoaXMuaWQgKyAnIHJldHVybmVkIGEgbWFsZm9ybWVkIGVycm9yOiAnICsgYm9keSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgPT0gJ2JhZCBzdGF0dXMnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgT3JkZXJOb3RGb3VuZCAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvci5pbmRleE9mICgnSXQgaXMgbm90IGVub3VnaCcpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbnN1ZmZpY2llbnRGdW5kcyAodGhpcy5pZCArICcgJyArIGVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSAnUmVxdWVzdHMgdG9vIG9mdGVuJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdub3QgYXZhaWxhYmxlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVycm9yID09ICdleHRlcm5hbCBzZXJ2aWNlIHVuYXZhaWxhYmxlJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEREb1NQcm90ZWN0aW9uICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAvLyB0aGF0J3Mgd2hhdCBmZXRjaE9wZW5PcmRlcnMgcmV0dXJuIGlmIG5vIG9wZW4gb3JkZXJzIChmaXggZm9yICM0ODkpXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyb3IgIT0gJ25vIG9yZGVycycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmVxdWVzdCAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICByZXR1cm4gdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1x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1xuICAgICAgICAgICAgICAgICdsb2dvJzogJ2h0dHBzOi8vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyOTQ0NTQvMjgwNTk0MTQtZTIzNTk3MGMtNjYyYy0xMWU3LThjM2EtMDhlMzFmNzg2ODRiLmpwZycsXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL2NyeXB0b3R0bGl2ZXdlYmFwaS54YnRjZS5uZXQ6ODQ0My9hcGknLFxuICAgICAgICAgICAgICAgICd3d3cnOiAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tJyxcbiAgICAgICAgICAgICAgICAnZG9jJzogW1xuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly93d3cueGJ0Y2UuY29tL3RyYWRlYXBpJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vc3VwcG9ydC54YnRjZS5pbmZvL0tub3dsZWRnZWJhc2UvQXJ0aWNsZS9WaWV3LzUyLzI1L3hidGNlLWV4Y2hhbmdlLWFwaScsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAncmVxdWlyZWRDcmVkZW50aWFscyc6IHtcbiAgICAgICAgICAgICAgICAnYXBpS2V5JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAnc2VjcmV0JzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAndWlkJzogdHJ1ZSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3knLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5L3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMi97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnc3ltYm9sL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlc2VydmVyaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzZXNzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jeScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3kve2ZpbHRlcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2xldmVsMicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnbGV2ZWwyL3tmaWx0ZXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdzeW1ib2wnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3N5bWJvbC97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGljay97ZmlsdGVyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWNjb3VudCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnYXNzZXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2Fzc2V0L3tpZH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbi97aWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUve2lkfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9hc2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYXNrL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS97cGVyaW9kaWNpdHl9L2JhcnMvYmlkJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2JpZC9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vbGV2ZWwyL2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS9wZXJpb2RpY2l0aWVzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3Rvcnkve3N5bWJvbH0vdGlja3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS97c3ltYm9sfS90aWNrcy9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdxdW90ZWhpc3RvcnkvY2FjaGUve3N5bWJvbH0ve3BlcmlvZGljaXR5fS9iYXJzL2FzaycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L2NhY2hlL3tzeW1ib2x9L3twZXJpb2RpY2l0eX0vYmFycy9iaWQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS9sZXZlbDInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS9jYWNoZS97c3ltYm9sfS90aWNrcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAncXVvdGVoaXN0b3J5L3N5bWJvbHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3F1b3RlaGlzdG9yeS92ZXJzaW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlaGlzdG9yeScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgICAgICdwdXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgICAgICAnZGVsZXRlJzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hNYXJrZXRzICgpIHtcbiAgICAgICAgbGV0IG1hcmtldHMgPSBhd2FpdCB0aGlzLnByaXZhdGVHZXRTeW1ib2wgKCk7XG4gICAgICAgIGxldCByZXN1bHQgPSBbXTtcbiAgICAgICAgZm9yIChsZXQgcCA9IDA7IHAgPCBtYXJrZXRzLmxlbmd0aDsgcCsrKSB7XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gbWFya2V0c1twXTtcbiAgICAgICAgICAgIGxldCBpZCA9IG1hcmtldFsnU3ltYm9sJ107XG4gICAgICAgICAgICBsZXQgYmFzZSA9IG1hcmtldFsnTWFyZ2luQ3VycmVuY3knXTtcbiAgICAgICAgICAgIGxldCBxdW90ZSA9IG1hcmtldFsnUHJvZml0Q3VycmVuY3knXTtcbiAgICAgICAgICAgIGlmIChiYXNlID09ICdEU0gnKVxuICAgICAgICAgICAgICAgIGJhc2UgPSAnREFTSCc7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgc3ltYm9sID0gbWFya2V0WydJc1RyYWRlQWxsb3dlZCddID8gc3ltYm9sIDogaWQ7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCBiYWxh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U2VsbFByaWNlJ107XG4gICAgICAgICAgICB9XG4gICAgICAgIGlmICghdGltZXN0YW1wKVxuICAgICAgICAgICAgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIGxldCBzeW1ib2wgPSB1bmRlZmluZWQ7XG4gICAgICAgIGlmIChtYXJrZXQpXG4gICAgICAgICAgICBzeW1ib2wgPSBtYXJrZXRbJ3N5bWJvbCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ3N5bWJvbCc6IHN5bWJvbCxcbiAgICAgICAgICAgICd0aW1lc3RhbXAnOiB0aW1lc3RhbXAsXG4gICAgICAgICAgICAnZGF0ZXRpbWUnOiB0aGlzLmlzbzg2MDEgKHRpbWVzdGFtcCksXG4gICAgICAgICAgICAnaGlnaCc6IHRpY2tlclsnRGFpbHlCZXN0QnV5UHJpY2UnXSxcbiAgICAgICAgICAgICdsb3cnOiB0aWNrZXJbJ0RhaWx5QmVzdFNlbGxQcmljZSddLFxuICAgICAgICAgICAgJ2JpZCc6IHRpY2tlclsnQmVzdEJpZCddLFxuICAgICAgICAgICAgJ2Fzayc6IHRpY2tlclsnQmVzdEFzayddLFxuICAgICAgICAgICAgJ3Z3YXAnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnb3Blbic6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdjbG9zZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdmaXJzdCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdsYXN0JzogbGFzdCxcbiAgICAgICAgICAgICdjaGFuZ2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncGVyY2VudGFnZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdhdmVyYWdlJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ2Jhc2VWb2x1bWUnOiB0aWNrZXJbJ0RhaWx5VHJhZGVkVG90YWxWb2x1bWUnXSxcbiAgICAgICAgICAgICdxdW90ZVZvbHVtZSc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICdpbmZvJzogdGlja2VyLFxuICAgICAgICB9O1xuICAgIH1cblxuICAgIGFzeW5jIGZldGNoVGlja2VycyAoc3ltYm9scyA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgYXdhaXQgdGhpcy5sb2FkTWFya2V0cyAoKTtcbiAgICAgICAgbGV0IHRpY2tlcnMgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAocGFyYW1zKTtcbiAgICAgICAgdGlja2VycyA9IHRoaXMuaW5kZXhCeSAodGlja2VycywgJ1N5bWJvbCcpO1xuICAgICAgICBsZXQgaWRzID0gT2JqZWN0LmtleXMgKHRpY2tlcnMpO1xuICAgICAgICBsZXQgcmVzdWx0ID0ge307XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaWRzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQgaWQgPSBpZHNbaV07XG4gICAgICAgICAgICBsZXQgbWFya2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgbGV0IHN5bWJvbCA9IHVuZGVmaW5lZDtcbiAgICAgICAgICAgIGlmIChpZCBpbiB0aGlzLm1hcmtldHNfYnlfaWQpIHtcbiAgICAgICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbaWRdO1xuICAgICAgICAgICAgICAgIHN5bWJvbCA9IG1hcmtldFsnc3ltYm9sJ107XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGxldCBiYXNlID0gaWQuc2xpY2UgKDAsIDMpO1xuICAgICAgICAgICAgICAgIGxldCBxdW90ZSA9IGlkLnNsaWNlICgzLCA2KTtcbiAgICAgICAgICAgICAgICBpZiAoYmFzZSA9PSAnRFNIJylcbiAgICAgICAgICAgICAgICAgICAgYmFzZSA9ICdEQVNIJztcbiAgICAgICAgICAgICAgICBpZiAocXVvdGU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HJlcXVlc3RzLCB0aGVpciBwdWJsaWMgQVBJIGlzIGFsd2F5cyBidXN5Jyk7XG4gICAgICAgIGlmICghdGhpcy51aWQpXG4gICAgICAgICAgICB0aHJvdyBuZXcgQXV0aGVudGljYXRpb25FcnJvciAodGhpcy5pZCArICcgcmVxdWlyZXMgdWlkIHByb3BlcnR5IGZvciBhdXRoZW50aWNhdGlvbiBhbmQgdHJhZGluZywgdGhlaXIgcHVibGljIEFQSSBpcyBhbHdheXMgYnVzeScpO1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJyArIHRoaXMudmVyc2lvbjtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJylcbiAgICAgICAgICAgIHVybCArPSAnLycgKyBhcGk7XG4gICAgICAgIHVybCArPSAnLycgKyB0aGlzLmltcGxvZGVQYXJhbXMgKHBhdGgsIHBhcmFtcyk7XG4gICAgICAgIGxldCBxdWVyeSA9IHRoaXMub21pdCAocGFyYW1zLCB0aGlzLmV4dHJhY3RQYXJhbXMgKHBhdGgpKTtcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzIChxdWVyeSkubGVuZ3RoKVxuICAgICAgICAgICAgICAgIHVybCArPSAnPycgKyB0aGlzLnVybGVuY29kZSAocXVlcnkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy5jaGVja1JlcXVpcmVkQ3JlZGVudGlhbHMgKCk7XG4gICAgICAgICAgICBoZWFkZXJzID0geyAnQWNjZXB0LUVuY29kaW5nJzogJ2d6aXAsIGRlZmxhdGUnIH07XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpLnRvU3RyaW5nICgpO1xuICAgICAgICAgICAgaWYgKG1ldGhvZCA9PSAnUE9TVCcpIHtcbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMgKHF1ZXJ5KS5sZW5ndGgpIHtcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAnYXBwbGljYXRpb24vanNvbic7XG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSB0aGlzLmpzb24gKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB1cmwgKz0gJz8nICsgdGhpcy51cmxlbmNvZGUgKHF1ZXJ5KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgYXV0aCA9IG5vbmNlICsgdGhpcy51aWQgKyB0aGlzLmFwaUtleSArIG1ldGhvZCArIHVybDtcbiAgICAgICAgICAgIGlmIChib2R5KVxuICAgICAgICAgICAgICAgIGF1dGggKz0gYm9keTtcbiAgICAgICAgICAgIGxldCBzaWduYXR1cmUgPSB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChhdXRoKSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTI1NicsICdiYXNlNjQnKTtcbiAgICAgICAgICAgIGxldCBjcmVkZW50aWFscyA9IHRoaXMudWlkICsgJzonICsgdGhpcy5hcGlLZXkgKyAnOicgKyBub25jZSArICc6JyArIHRoaXMuYmluYXJ5VG9TdHJpbmcgKHNpZ25hdHVyZSk7XG4gICAgICAgICAgICBoZWFkZXJzWydBdXRob3JpemF0aW9uJ10gPSAnSE1BQyAnICsgY3JlZGVudGlhbHM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHsgJ3VybCc6IHVybCwgJ21ldGhvZCc6IG1ldGhvZCwgJ2JvZHknOiBib2R5LCAnaGVhZGVycyc6IGhlYWRlcnMgfTtcbiAgICB9XG59XG4iLCJcInVzZSBzdHJpY3RcIjtcblxuLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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AgICAncHVibGljJzogJ2h0dHBzOi8veW9iaXQubmV0L2FwaScsXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8veW9iaXQubmV0L3RhcGknLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3d3dy55b2JpdC5uZXQnLFxuICAgICAgICAgICAgICAgICdkb2MnOiAnaHR0cHM6Ly93d3cueW9iaXQubmV0L2VuL2FwaS8nLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXB0aC97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2luZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlci97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdwb3N0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ0FjdGl2ZU9yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ0dldERlcG9zaXRBZGRyZXNzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRJbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdPcmRlckluZm8nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1RyYWRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdUcmFkZUhpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1dpdGhkcmF3Q29pbnNUb0FkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2ZlZXMnOiB7XG4gICAgICAgICAgICAgICAgJ3RyYWRpbmcnOiB7XG4gICAgICAgICAgICAgICAgICAgICdtYWtlcic6IDAuMDAyLFxuICAgICAgICAgICAgICAgICAgICAndGFrZXInOiAwLjAwMixcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmdW5kaW5nJzogMC4wLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgY29tbW9uQ3VycmVuY3lDb2RlIChjdXJyZW5jeSkge1xuICAgICAgICBsZXQgc3Vic3RpdHV0aW9ucyA9IHtcbiAgICAgICAgICAgICdBSVInOiAnQWlyQ29pbicsXG4gICAgICAgICAgICAnQU5JJzogJ0FOSUNvaW4nLFxuICAgICAgICAgICAgJ0FOVCc6ICdBbnRzQ29pbicsXG4gICAgICAgICAgICAnQVRNJzogJ0F1dHVtbmNvaW4nLFxuICAgICAgICAgICAgJ0JDQyc6ICdCQ0gnLFxuICAgICAgICAgICAgJ0JUUyc6ICdCaXRzaGFyZXMyJyxcbiAgICAgICAgICAgICdEQ1QnOiAnRGlzY291bnQnLFxuICAgICAgICAgICAgJ0RHRCc6ICdEYXJrR29sZENvaW4nLFxuICAgICAgICAgICAgJ0lDTic6ICdpQ29pbicsXG4gICAgICAgICAgICAnTElaSSc6ICdMaVppJyxcbiAgICAgICAgICAgICdMVU4nOiAnTHVuYXJDb2luJyxcbiAgICAgICAgICAgICdOQVYnOiAnTmF2YWpvQ29pbicsXG4gICAgICAgICAgICAnT01HJzogJ09NR2FtZScsXG4gICAgICAgICAgICAnUEFZJzogJ0VQQVknLFxuICAgICAgICAgICAgJ1JFUCc6ICdSZXB1YmxpY29pbicsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjdXJyZW5jeSBpbiBzdWJzdGl0dXRpb25zKVxuICAgICAgICAgICAgcmV0dXJuIHN1YnN0aXR1dGlvbnNbY3VycmVuY3ldO1xuICAgICAgICByZXR1cm4gY3VycmVuY3k7XG4gICAgfVxuXG4gICAgY3VycmVuY3lJZCAoY29tbW9uQ29kZSkge1xuICAgICAgICBsZXQgc3Vic3RpdHV0aW9ucyA9IHtcbiAgICAgICAgICAgICdBaXJDb2luJzogJ0FJUicsXG4gICAgICAgICAgICAnQU5JQ29pbic6ICdBTkknLFxuICAgICAgICAgICAgJ0FudHNDb2luJzogJ0FOVCcsXG4gICAgICAgICAgICAnQXV0dW1uY29pbic6ICdBVE0nLFxuICAgICAgICAgICAgJ0JDSCc6ICdCQ0MnLFxuICAgICAgICAgICAgJ0JpdHNoYXJlczInOiAnQlRTJyxcbiAgICAgICAgICAgICdEaXNjb3VudCc6ICdEQ1QnLFxuICAgICAgICAgICAgJ0RhcmtHb2xkQ29pbic6ICdER0QnLFxuICAgICAgICAgICAgJ2lDb2luJzogJ0lDTicsXG4gICAgICAgICAgICAnTGlaaSc6ICdMSVpJJyxcbiAgICAgICAgICAgICdMdW5hckNvaW4nOiAnTFVOJyxcbiAgICAgICAgICAgICdOYXZham9Db2luJzogJ05BVicsXG4gICAgICAgICAgICAnT01HYW1lJzogJ09NRycsXG4gICAgICAgICAgICAnRVBBWSc6ICdQQVknLFxuICAgICAgICAgICAgJ1JlcHVibGljb2luJzogJ1JFUCcsXG4gICAgICAgIH07XG4gICAgICAgIGlmIChjb21tb25Db2RlIGluIHN1YnN0aXR1dGlvbnMpXG4gICAgICAgICAgICByZXR1cm4gc3Vic3RpdHV0aW9uc1tjb21tb25Db2RlXTtcbiAgICAgICAgcmV0dXJuIGNvbW1vbkNvZGU7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBzaWRlcyA9IHsgJ2ZyZWUnOiAnZnVuZHMnLCAndG90YWwnOiAnZnVuZHNfaW5jbF9vcmRlcnMnIH07XG4gICAgICAgIGxldCBrZXlzID0gT2JqZWN0LmtleXMgKHNpZGVzKTtcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBrZXlzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBsZXQga2V5ID0ga2V5c1tpXTtcbiAgICAgICAgICAgIGxldCBzaWRlID0gc2lkZXNba2V5XTtcbiAgICAgICAgICAgIGlmIChzaWRlIGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbmNpZXMgPSBPYmplY3Qua2V5cyAoYmFsYW5jZXNbc2lkZV0pO1xuICAgICAgICAgICAgICAgIGZvciAobGV0IGogPSAwOyBqIDwgY3VycmVuY2llcy5sZW5ndGg7IGorKykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgbG93ZXJjYXNlID0gY3VycmVuY2llc1tqXTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVwcGVyY2FzZSA9IGxvd2VyY2FzZS50b1VwcGVyQ2FzZSAoKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGN1cnJlbmN5ID0gdGhpcy5jb21tb25DdXJyZW5jeUNvZGUgKHVwcGVyY2FzZSk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBhY2NvdW50ID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgICAgICBpZiAoY3VycmVuY3kgaW4gcmVzdWx0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBhY2NvdW50ID0gcmVzdWx0W2N1cnJlbmN5XTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGFjY291bnQgPSB0aGlzLmFjY291bnQgKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFtrZXldID0gYmFsYW5jZXNbc2lkZV1bbG93ZXJjYXNlXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGFjY291bnRbJ3RvdGFsJ10gJiYgYWNjb3VudFsnZnJlZSddKVxuICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndXNlZCddID0gYWNjb3VudFsndG90YWwnXSAtIGFjY291bnRbJ2ZyZWUnXTtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0W2N1cnJlbmN5XSA9IGFjY291bnQ7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLnBhcnNlQmFsYW5jZSAocmVzdWx0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVEZXBvc2l0QWRkcmVzcyAoY3VycmVuY3ksIHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMuZmV0Y2hEZXBvc2l0QWRkcmVzcyAoY3VycmVuY3ksIHRoaXMuZXh0ZW5kICh7XG4gICAgICAgICAgICAnbmVlZF9uZXcnOiAxLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICdjdXJyZW5jeSc6IGN1cnJlbmN5LFxuICAgICAgICAgICAgJ2FkZHJlc3MnOiByZXNwb25zZVsnYWRkcmVzcyddLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvaycsXG4gICAgICAgICAgICAnaW5mbyc6IHJlc3BvbnNlWydpbmZvJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hEZXBvc2l0QWRkcmVzcy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xuICAgICAgICAgICAgJ2hhc0ZldGNoVGlja2Vycyc6IHRydWUsXG4gICAgICAgICAgICAnaGFzRmV0Y2hPSExDVic6IHRydWUsXG4gICAgICAgICAgICAndGltZWZyYW1lcyc6IHtcbiAgICAgICAgICAgICAgICAnMW0nOiAnMScsXG4gICAgICAgICAgICAgICAgJzVtJzogJzUnLFxuICAgICAgICAgICAgICAgICcxNW0nOiAnMTUnLFxuICAgICAgICAgICAgICAgICczMG0nOiAnMzAnLFxuICAgICAgICAgICAgICAgICcxaCc6ICc2MCcsXG4gICAgICAgICAgICAgICAgJzJoJzogJzEyMCcsXG4gICAgICAgICAgICAgICAgJzRoJzogJzI0MCcsXG4gICAgICAgICAgICAgICAgJzEyaCc6ICc3MjAnLFxuICAgICAgICAgICAgICAgICcxZCc6ICcxNDQwJyxcbiAgICAgICAgICAgICAgICAnM2QnOiAnNDMyMCcsXG4gICAgICAgICAgICAgICAgJzF3JzogJzEwMDgwJyxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI4NTcwNTQ4LTRkNjQ2YzQwLTcxNDctMTFlNy05Y2Y2LTgzOWI5M2U2ZDYyMi5qcGcnLFxuICAgICAgICAgICAgICAgICdleHRlbnNpb24nOiAnLmpzb24nLCAvLyBkZWZhdWx0IGV4dGVuc2lvbiBhcHBlbmRlZCB0byBlbmRwb2ludCBVUkxzXG4gICAgICAgICAgICAgICAgJ2FwaSc6ICdodHRwczovL3l1bmJpLmNvbScsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3l1bmJpLmNvbScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6IFtcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8veXVuYmkuY29tL2RvY3VtZW50cy9hcGkvZ3VpZGUnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly95dW5iaS5jb20vc3dhZ2dlci8nLFxuICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgJ2FwaSc6IHtcbiAgICAgICAgICAgICAgICAncHVibGljJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RpY2tlcnMve21hcmtldH0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21hcmtldHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVyX2Jvb2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2snLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tfd2l0aF9wZW5kaW5nX3RyYWRlcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGltZXN0YW1wJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhZGRyZXNzZXMve2FkZHJlc3N9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwYXJ0bmVycy9vcmRlcnMve2lkfS90cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3ByaXZhdGUnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwb3NpdHMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21lbWJlcnMvbWUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcG9zaXRfYWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL215JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXIvZGVsZXRlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ29yZGVycy9tdWx0aScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnb3JkZXJzL2NsZWFyJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSk7XG4gICAgfVxufVxuIiwiXCJ1c2Ugc3RyaWN0XCI7XG5cbi8vICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1cblxuY29uc3QgRXhjaGFuZ2UgPSByZXF1aXJlICgnLi9iYXNlL0V4Y2hhbmdlJylcbmNvbnN0IHsgRXhjaGFuZ2VFcnJvciB9ID0gcmVxdWlyZSAoJy4vYmFzZS9lcnJvcnMnKVxuXG4vLyAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tXG5cbm1vZHVsZS5leHBvcnRzID0gY2xhc3MgemFpZiBleHRlbmRzIEV4Y2hhbmdlIHtcblxuICAgIGRlc2NyaWJlICgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZGVlcEV4dGVuZCAoc3VwZXIuZGVzY3JpYmUgKCksIHtcbiAgICAgICAgICAgICdpZCc6ICd6YWlmJyxcbiAgICAgICAgICAgICduYW1lJzogJ1phaWYnLFxuICAgICAgICAgICAgJ2NvdW50cmllcyc6ICdKUCcsXG4gICAgICAgICAgICAncmF0ZUxpbWl0JzogMjAwMCxcbiAgICAgICAgICAgICd2ZXJzaW9uJzogJzEnLFxuICAgICAgICAgICAgJ2hhc0NPUlMnOiBmYWxzZSxcbiAgICAgICAgICAgICdoYXNGZXRjaE9wZW5PcmRlcnMnOiB0cnVlLFxuICAgICAgICAgICAgJ2hhc0ZldGNoQ2xvc2VkT3JkZXJzJzogdHJ1ZSxcbiAgICAgICAgICAgICdoYXNXaXRoZHJhdyc6IHRydWUsXG4gICAgICAgICAgICAndXJscyc6IHtcbiAgICAgICAgICAgICAgICAnbG9nbyc6ICdodHRwczovL3VzZXItaW1hZ2VzLmdpdGh1YnVzZXJjb250ZW50LmNvbS8xMjk0NDU0LzI3NzY2OTI3LTM5Y2EyYWRhLTVlZWItMTFlNy05NzJmLTFiNDE5OTUxOGNhNi5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiAnaHR0cHM6Ly9hcGkuemFpZi5qcCcsXG4gICAgICAgICAgICAgICAgJ3d3dyc6ICdodHRwczovL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICdkb2MnOiBbXG4gICAgICAgICAgICAgICAgICAgICdodHRwOi8vdGVjaGJ1cmVhdS1hcGktZG9jdW1lbnQucmVhZHRoZWRvY3MuaW8vamEvbGF0ZXN0L2luZGV4Lmh0bWwnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9jb3JwLnphaWYuanAvYXBpLWRvY3MvYXBpX2xpbmtzJyxcbiAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vd3d3Lm5wbWpzLmNvbS9wYWNrYWdlL3phaWYuanAnLFxuICAgICAgICAgICAgICAgICAgICAnaHR0cHM6Ly9naXRodWIuY29tL3lvdTIxOTc5L25vZGUtemFpZicsXG4gICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAnYXBpJzoge1xuICAgICAgICAgICAgICAgICdwdWJsaWMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdnZXQnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjdXJyZW5jaWVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY2llcy9hbGwnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXJzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3VycmVuY3lfcGFpcnMvYWxsJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndGlja2VyL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGVzL3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgIF0sXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAncHJpdmF0ZSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnYWN0aXZlX29yZGVycycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX29yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdkZXBvc2l0X2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldF9pZF9pbmZvJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0X2luZm8yJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcGVyc29uYWxfaW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAndHJhZGUnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlX2hpc3RvcnknLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3dpdGhkcmF3JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd3aXRoZHJhd19oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdlY2FwaSc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ3Bvc3QnOiBbXG4gICAgICAgICAgICAgICAgICAgICAgICAnY3JlYXRlSW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0SW52b2ljZUlkc0J5T3JkZXJOdW1iZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NhbmNlbEludm9pY2UnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgJ3RsYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdwb3NpdGlvbl9oaXN0b3J5JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdhY3RpdmVfcG9zaXRpb25zJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdjcmVhdGVfcG9zaXRpb24nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NoYW5nZV9wb3NpdGlvbicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsX3Bvc2l0aW9uJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdmYXBpJzoge1xuICAgICAgICAgICAgICAgICAgICAnZ2V0JzogW1xuICAgICAgICAgICAgICAgICAgICAgICAgJ2dyb3Vwcy97Z3JvdXBfaWR9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdsYXN0X3ByaWNlL3tncm91cF9pZH0ve3BhaXJ9JyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXIve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3RyYWRlcy97Z3JvdXBfaWR9L3twYWlyfScsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZGVwdGgve2dyb3VwX2lkfS97cGFpcn0nLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaE1hcmtldHMgKCkge1xuICAgICAgICBsZXQgbWFya2V0cyA9IGF3YWl0IHRoaXMucHVibGljR2V0Q3VycmVuY3lQYWlyc0FsbCAoKTtcbiAgICAgICAgbGV0IHJlc3VsdCA9IFtdO1xuICAgICAgICBmb3IgKGxldCBwID0gMDsgcCA8IG1hcmtldHMubGVuZ3RoOyBwKyspIHtcbiAgICAgICAgICAgIGxldCBtYXJrZXQgPSBtYXJrZXRzW3BdO1xuICAgICAgICAgICAgbGV0IGlkID0gbWFya2V0WydjdXJyZW5jeV9wYWlyJ107XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gbWFya2V0WyduYW1lJ107XG4gICAgICAgICAgICBsZXQgWyBiYXNlLCBxdW90ZSBdID0gc3ltYm9sLnNwbGl0ICgnLycpO1xuICAgICAgICAgICAgcmVzdWx0LnB1c2ggKHtcbiAgICAgICAgICAgICAgICAnaWQnOiBpZCxcbiAgICAgICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgICAgICdiYXNlJzogYmFzZSxcbiAgICAgICAgICAgICAgICAncXVvdGUnOiBxdW90ZSxcbiAgICAgICAgICAgICAgICAnaW5mbyc6IG1hcmtldCxcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgfVxuXG4gICAgYXN5bmMgZmV0Y2hCYWxhbmNlIChwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnByaXZhdGVQb3N0R2V0SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3JldHVybiddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKGJhbGFuY2VzWydmdW5kcyddKTtcbiAgICAgICAgZm9yIChsZXQgYyA9IDA7IGMgPCBjdXJyZW5jaWVzLmxlbmd0aDsgYysrKSB7XG4gICAgICAgICAgICBsZXQgY3VycmVuY3kgPSBjdXJyZW5jaWVzW2NdO1xuICAgICAgICAgICAgbGV0IGJhbGFuY2UgPSBiYWxhbmNlc1snZnVuZHMnXVtjdXJyZW5jeV07XG4gICAgICAgICAgICBsZXQgdXBwZXJjYXNlID0gY3VycmVuY3kudG9VcHBlckNhc2UgKCk7XG4gICAgICAgICAgICBsZXQgYWNjb3VudCA9IHtcbiAgICAgICAgICAgICAgICAnZnJlZSc6IGJhbGFuY2UsXG4gICAgICAgICAgICAgICAgJ3VzZWQnOiAwLjAsXG4gICAgICAgICAgICAgICAgJ3RvdGFsJzogYmFsYW5jZSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBpZiAoJ2RlcG9zaXQnIGluIGJhbGFuY2VzKSB7XG4gICAgICAgICAgICAgICAgaWYgKGN1cnJlbmN5IGluIGJhbGFuY2VzWydkZXBvc2l0J10pIHtcbiAgICAgICAgICAgICAgICAgICAgYWNjb3VudFsndG90YWwnXSA9IGJhbGFuY2VzWydkZXBvc2l0J11bY3VycmVuY3ldO1xuICAgICAgICAgICAgICAgICAgICBhY2NvdW50Wyd1c2VkJ10gPSBhY2NvdW50Wyd0b3RhbCddIC0gY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FtcykpO1xuICAgICAgICByZXR1cm4gdGhpcy5wYXJzZVRyYWRlcyAocmVzcG9uc2UsIG1hcmtldCwgc2luY2UsIGxpbWl0KTtcbiAgICB9XG5cbiAgICBhc3luYyBjcmVhdGVPcmRlciAoc3ltYm9sLCB0eXBlLCBzaWRlLCBhbW91bnQsIHByaWNlID0gdW5kZWZpbmVkLCBwYXJhbXMgPSB7fSkge1xuICAgICAgICBhd2FpdCB0aGlzLmxvYWRNYXJrZXRzICgpO1xuICAgICAgICBpZiAodHlwZSA9PSAnbWFya2V0JylcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyBhbGxvd3MgbGltaXQgb3JkZXJzIG9ubHknKTtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5wcml2YXRlUG9zdFRyYWRlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgJ2N1cnJlbmN5X3BhaXInOiB0aGlzLm1hcmtldElkIChzeW1ib2wpLFxuICAgICAgICAgICAgJ2FjdGlvbic6IChzaWRlID09ICdidXknKSA/ICdiaWQnIDogJ2FzaycsXG4gICAgICAgICAgICAnYW1vdW50JzogYW1vdW50LFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgIH0sIHBhcmFtcykpO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2luZm8nOiByZXNwb25zZSxcbiAgICAgICAgICAgICdpZCc6IHJlc3BvbnNlWydyZXR1cm4nXVsnb3JkZXJfaWQnXS50b1N0cmluZyAoKSxcbiAgICAgICAgfTtcbiAgICB9XG5cbiAgICBhc3luYyBjYW5jZWxPcmRlciAoaWQsIHN5bWJvbCA9IHVuZGVmaW5lZCwgcGFyYW1zID0ge30pIHtcbiAgICAgICAgcmV0dXJuIGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RDYW5jZWxPcmRlciAodGhpcy5leHRlbmQgKHtcbiAgICAgICAgICAgICdvcmRlcl9pZCc6IGlkLFxuICAgICAgICB9LCBwYXJhbXMpKTtcbiAgICB9XG5cbiAgICBwYXJzZU9yZGVyIChvcmRlciwgbWFya2V0ID0gdW5kZWZpbmVkKSB7XG4gICAgICAgIGxldCBzaWRlID0gKG9yZGVyWydhY3Rpb24nXSA9PSAnYmlkJykgPyAnYnV5JyA6ICdzZWxsJztcbiAgICAgICAgbGV0IHRpbWVzdGFtcCA9IHBhcnNlSW50IChvcmRlclsndGltZXN0YW1wJ10pICogMTAwMDtcbiAgICAgICAgaWYgKCFtYXJrZXQpXG4gICAgICAgICAgICBtYXJrZXQgPSB0aGlzLm1hcmtldHNfYnlfaWRbb3JkZXJbJ2N1cnJlbmN5X3BhaXInXV07XG4gICAgICAgIGxldCBwcmljZSA9IG9yZGVyWydwcmljZSddO1xuICAgICAgICBsZXQgYW1vdW50ID0gb3JkZXJbJ2Ftb3VudCddO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgJ2lkJzogb3JkZXJbJ2lkJ10udG9TdHJpbmcgKCksXG4gICAgICAgICAgICAndGltZXN0YW1wJzogdGltZXN0YW1wLFxuICAgICAgICAgICAgJ2RhdGV0aW1lJzogdGhpcy5pc284NjAxICh0aW1lc3RhbXApLFxuICAgICAgICAgICAgJ3N0YXR1cyc6ICdvcGVuJyxcbiAgICAgICAgICAgICdzeW1ib2wnOiBtYXJrZXRbJ3N5bWJvbCddLFxuICAgICAgICAgICAgJ3R5cGUnOiAnbGltaXQnLFxuICAgICAgICAgICAgJ3NpZGUnOiBzaWRlLFxuICAgICAgICAgICAgJ3ByaWNlJzogcHJpY2UsXG4gICAgICAgICAgICAnY29zdCc6IHByaWNlICogYW1vdW50LFxuICAgICAgICAgICAgJ2Ftb3VudCc6IGFtb3VudCxcbiAgICAgICAgICAgICdmaWxsZWQnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAncmVtYWluaW5nJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ3RyYWRlcy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ybiddWyd0eGlkJ10sXG4gICAgICAgICAgICAnZmVlJzogcmVzdWx0WydyZXR1cm4nXVsnZmVlJ10sXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2lnbiAocGF0aCwgYXBpID0gJ3B1YmxpYycsIG1ldGhvZCA9ICdHRVQnLCBwYXJhbXMgPSB7fSwgaGVhZGVycyA9IHVuZGVmaW5lZCwgYm9keSA9IHVuZGVmaW5lZCkge1xuICAgICAgICBsZXQgdXJsID0gdGhpcy51cmxzWydhcGknXSArICcvJztcbiAgICAgICAgaWYgKGFwaSA9PSAncHVibGljJykge1xuICAgICAgICAgICAgdXJsICs9ICdhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIGlmIChhcGkgPT0gJ2ZhcGknKSB7XG4gICAgICAgICAgICB1cmwgKz0gJ2ZhcGkvJyArIHRoaXMudmVyc2lvbiArICcvJyArIHRoaXMuaW1wbG9kZVBhcmFtcyAocGF0aCwgcGFyYW1zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMuY2hlY2tSZXF1aXJlZENyZWRlbnRpYWxzICgpO1xuICAgICAgICAgICAgaWYgKGFwaSA9PSAnZWNhcGknKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICdlY2FwaSc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGFwaSA9PSAndGxhcGknKSB7XG4gICAgICAgICAgICAgICAgdXJsICs9ICd0bGFwaSc7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHVybCArPSAndGFwaSc7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBsZXQgbm9uY2UgPSB0aGlzLm5vbmNlICgpO1xuICAgICAgICAgICAgYm9keSA9IHRoaXMudXJsZW5jb2RlICh0aGlzLmV4dGVuZCAoe1xuICAgICAgICAgICAgICAgICdtZXRob2QnOiBwYXRoLFxuICAgICAgICAgICAgICAgICdub25jZSc6IG5vbmNlLFxuICAgICAgICAgICAgfSwgcGFyYW1zKSk7XG4gICAgICAgICAgICBoZWFkZXJzID0ge1xuICAgICAgICAgICAgICAgICdDb250ZW50LVR5cGUnOiAnYXBwbGljYXRpb24veC13d3ctZm9ybS11cmxlbmNvZGVkJyxcbiAgICAgICAgICAgICAgICAnS2V5JzogdGhpcy5hcGlLZXksXG4gICAgICAgICAgICAgICAgJ1NpZ24nOiB0aGlzLmhtYWMgKHRoaXMuZW5jb2RlIChib2R5KSwgdGhpcy5lbmNvZGUgKHRoaXMuc2VjcmV0KSwgJ3NoYTUxMicpLFxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4geyAndXJsJzogdXJsLCAnbWV0aG9kJzogbWV0aG9kLCAnYm9keSc6IGJvZHksICdoZWFkZXJzJzogaGVhZGVycyB9O1xuICAgIH1cblxuICAgIGFzeW5jIHJlcXVlc3QgKHBhdGgsIGFwaSA9ICdhcGknLCBtZXRob2QgPSAnR0VUJywgcGFyYW1zID0ge30sIGhlYWRlcnMgPSB1bmRlZmluZWQsIGJvZHkgPSB1bmRlZmluZWQpIHtcbiAgICAgICAgbGV0IHJlc3BvbnNlID0gYXdhaXQgdGhpcy5mZXRjaDIgKHBhdGgsIGFwaSwgbWV0aG9kLCBwYXJhbXMsIGhlYWRlcnMsIGJvZHkpO1xuICAgICAgICBpZiAoJ2Vycm9yJyBpbiByZXNwb25zZSlcbiAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAnICsgcmVzcG9uc2VbJ2Vycm9yJ10pO1xuICAgICAgICBpZiAoJ3N1Y2Nlc3MnIGluIHJlc3BvbnNlKVxuICAgICAgICAgICAgaWYgKCFyZXNwb25zZVsnc3VjY2VzcyddKVxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFeGNoYW5nZUVycm9yICh0aGlzLmlkICsgJyAn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TJlMmJkMS5qcGcnLFxuICAgICAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgICAgICdwdWJsaWMnOiAnaHR0cDovL2FwaS56Yi5jb20vZGF0YScsIC8vIG5vIGh0dHBzIGZvciBwdWJsaWMgQVBJXG4gICAgICAgICAgICAgICAgICAgICdwcml2YXRlJzogJ2h0dHBzOi8vdHJhZGUuemIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAnd3d3JzogJ2h0dHBzOi8vdHJhZGUuemIuY29tL2FwaScsXG4gICAgICAgICAgICAgICAgJ2RvYyc6ICdodHRwczovL3d3dy56Yi5jb20vaS9kZXZlbG9wZXInLFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICdhcGknOiB7XG4gICAgICAgICAgICAgICAgJ3B1YmxpYyc6IHtcbiAgICAgICAgICAgICAgICAgICAgJ2dldCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtYXJrZXRzJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0aWNrZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2RlcHRoJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0cmFkZXMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2tsaW5lJyxcbiAgICAgICAgICAgICAgICAgICAgXSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICdwcml2YXRlJzoge1xuICAgICAgICAgICAgICAgICAgICAncG9zdCc6IFtcbiAgICAgICAgICAgICAgICAgICAgICAgICdvcmRlcicsXG4gICAgICAgICAgICAgICAgICAgICAgICAnY2FuY2VsT3JkZXInLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRPcmRlcnMnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldE9yZGVyc05ldycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0T3JkZXJzSWdub3JlVHJhZGVUeXBlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRVbmZpbmlzaGVkT3JkZXJzSWdub3JlVHJhZGVUeXBlJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICdnZXRBY2NvdW50SW5mbycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0VXNlckFkZHJlc3MnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldFdpdGhkcmF3QWRkcmVzcycsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0V2l0aGRyYXdSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENoYXJnZVJlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnZ2V0Q255V2l0aGRyYXdSZWNvcmQnLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2dldENueUNoYXJnZVJlY29yZCcsXG4gICAgICAgICAgICAgICAgICAgICAgICAnd2l0aGRyYXcnLFxuICAgICAgICAgICAgICAgICAgICBdLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB9LFxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZXRUcmFkaW5nRmVlRnJvbUJhc2VRdW90ZSAoYmFzZSwgcXVvdGUpIHtcbiAgICAgICAgLy8gYmFzZTogcXVvdGVcbiAgICAgICAgbGV0IGZlZXMgPSB7XG4gICAgICAgICAgICAnQlRDJzogeyAnVVNEVCc6IDAuMCB9LFxuICAgICAgICAgICAgJ0JDSCc6IHsgJ0JUQyc6IDAuMDAxLCAnVVNEVCc6IDAuMDAxIH0sXG4gICAgICAgICAgICAnTFRDJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnRVRIJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgICAnRVRDJzogeyAnQlRDJzogMC4wMDEsICdVU0RUJzogMC4wIH0sXG4gICAgICAgICAgIC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Q2FzZSAoKSk7XG4gICAgICAgICAgICBsZXQgcXVvdGUgPSB0aGlzLmNvbW1vbkN1cnJlbmN5Q29kZSAocXVvdGVJZC50b1VwcGVyQ2FzZSAoKSk7XG4gICAgICAgICAgICBsZXQgc3ltYm9sID0gYmFzZSArICcvJyArIHF1b3RlO1xuICAgICAgICAgICAgbGV0IGZlZSA9IHRoaXMuZ2V0VHJhZGluZ0ZlZUZyb21CYXNlUXVvdGUgKGJhc2UsIHF1b3RlKTtcbiAgICAgICAgICAgIGxldCBwcmVjaXNpb24gPSB7XG4gICAgICAgICAgICAgICAgJ2Ftb3VudCc6IG1hcmtldFsnYW1vdW50U2NhbGUnXSxcbiAgICAgICAgICAgICAgICAncHJpY2UnOiBtYXJrZXRbJ3ByaWNlU2NhbGUnXSxcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICBsZXQgbG90ID0gTWF0aC5wb3cgKDEwLCAtcHJlY2lzaW9uWydhbW91bnQnXSk7XG4gICAgICAgICAgICByZXN1bHQucHVzaCAoe1xuICAgICAgICAgICAgICAgICdpZCc6IGlkLFxuICAgICAgICAgICAgICAgICdzeW1ib2wnOiBzeW1ib2wsXG4gICAgICAgICAgICAgICAgJ2Jhc2VJZCc6IGJhc2VJZCxcbiAgICAgICAgICAgICAgICAncXVvdGVJZCc6IHF1b3RlSWQsXG4gICAgICAgICAgICAgICAgJ2Jhc2UnOiBiYXNlLFxuICAgICAgICAgICAgICAgICdxdW90ZSc6IHF1b3RlLFxuICAgICAgICAgICAgICAgICdpbmZvJzogbWFya2V0LFxuICAgICAgICAgICAgICAgICdtYWtlcic6IGZlZSxcbiAgICAgICAgICAgICAgICAndGFrZXInOiBmZWUsXG4gICAgICAgICAgICAgICAgJ2xvdCc6IGxvdCxcbiAgICAgICAgICAgICAgICAnYWN0aXZlJzogdHJ1ZSxcbiAgICAgICAgICAgICAgICAncHJlY2lzaW9uJzogcHJlY2lzaW9uLFxuICAgICAgICAgICAgICAgICdsaW1pdHMnOiB7XG4gICAgICAgICAgICAgICAgICAgICdhbW91bnQnOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAnbWluJzogbG90LFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgJ3ByaWNlJzoge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ21pbic6IE1hdGgucG93ICgxMCwgLXByZWNpc2lvblsncHJpY2UnXSksXG4gICAgICAgICAgICAgICAgICAgICAgICAnbWF4JzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAnY29zdCc6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICdtaW4nOiAwLFxuICAgICAgICAgICAgICAgICAgICAgICAgJ21heCc6IHVuZGVmaW5lZCxcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdDtcbiAgICB9XG5cbiAgICBhc3luYyBmZXRjaEJhbGFuY2UgKHBhcmFtcyA9IHt9KSB7XG4gICAgICAgIGF3YWl0IHRoaXMubG9hZE1hcmtldHMgKCk7XG4gICAgICAgIGxldCByZXNwb25zZSA9IGF3YWl0IHRoaXMucHJpdmF0ZVBvc3RHZXRBY2NvdW50SW5mbyAoKTtcbiAgICAgICAgbGV0IGJhbGFuY2VzID0gcmVzcG9uc2VbJ3Jlc3VsdCddO1xuICAgICAgICBsZXQgcmVzdWx0ID0geyAnaW5mbyc6IGJhbGFuY2VzIH07XG4gICAgICAgIGxldCBjdXJyZW5jaWVzID0gT2JqZWN0LmtleXMgKHRoaXMuY3VycmVuY2llcyk7XG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY3VycmVuY2llcy5sZW5ndGg7IGkrKykge1xuICAgICAgICAgICAgbGV0IGN1cnJlbmN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ICBsZXQgbWFya2V0ID0gdGhpcy5tYXJrZXQgKHN5bWJvbCk7XG4gICAgICAgIGxldCBtYXJrZXRGaWVsZE5hbWUgPSB0aGlzLmdldE1hcmtldEZpZWxkTmFtZSAoKTtcbiAgICAgICAgbGV0IHJlcXVlc3QgPSB7fTtcbiAgICAgICAgcmVxdWVzdFttYXJrZXRGaWVsZE5hbWVdID0gbWFya2V0WydpZCddO1xuICAgICAgICBsZXQgcmVzcG9uc2UgPSBhd2FpdCB0aGlzLnB1YmxpY0dldFRpY2tlciAodGhpcy5leHRlbmQgKHJlcXVlc3QsIHBhcmFtcykpO1xuICAgICAgICBsZXQgdGlja2VyID0gcmVzcG9uc2VbJ3RpY2tlciddO1xuICAgICAgICBsZXQgdGltZXN0YW1wID0gdGhpcy5taWxsaXNlY29uZHMgKCk7XG4gICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAnc3ltYm9sJzogc3ltYm9sLFxuICAgICAgICAgICAgJ3RpbWVzdGFtcCc6IHRpbWVzdGFtcCxcbiAgICAgICAgICAgICdkYXRldGltZSc6IHRoaXMuaXNvODYwMSAodGltZXN0YW1wKSxcbiAgICAgICAgICAgICdoaWdoJzogcGFyc2VGbG9hdCAodGlja2VyWydoaWdoJ10pLFxuICAgICAgICAgICAgJ2xvdyc6IHBhcnNlRmxvYXQgKHRpY2tlclsnbG93J10pLFxuICAgICAgICAgICAgJ2JpZCc6IHBhcnNlRmxvYXQgKHRpY2tlclsnYnV5J10pLFxuICAgICAgICAgICAgJ2Fzayc6IHBhcnNlRmxvYXQgKHRpY2tlclsnc2VsbCddKSxcbiAgICAgICAgICAgICd2d2FwJzogdW5kZWZpbmVkLFxuICAgICAgICAgICAgJ29wZW4nOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnY2xvc2UnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnZmlyc3QnOiB1bmRlZmluZWQsXG4gICAgICAgICAgICAnbGFzdCc6IHBhcnNlRmxvYXQgKHRpY2tlcls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dCAgICB2YXIgSU5WX1NVQl9NSVhfMyA9IFtdO1xuXG5cdCAgICAvLyBDb21wdXRlIGxvb2t1cCB0YWJsZXNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgLy8gQ29tcHV0ZSBkb3VibGUgdGFibGVcblx0ICAgICAgICB2YXIgZCA9IFtdO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgaWYgKGkgPCAxMjgpIHtcblx0ICAgICAgICAgICAgICAgIGRbaV0gPSBpIDw8IDE7XG5cdCAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICBkW2ldID0gKGkgPDwgMSkgXiAweDExYjtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIFdhbGsgR0YoMl44KVxuXHQgICAgICAgIHZhciB4ID0gMDtcblx0ICAgICAgICB2YXIgeGkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBzYm94XG5cdCAgICAgICAgICAgIHZhciBzeCA9IHhpIF4gKHhpIDw8IDEpIF4gKHhpIDw8IDIpIF4gKHhpIDw8IDMpIF4gKHhpIDw8IDQpO1xuXHQgICAgICAgICAgICBzeCA9IChzeCA+Pj4gOCkgXiAoc3ggJiAweGZmKSBeIDB4NjM7XG5cdCAgICAgICAgICAgIFNCT1hbeF0gPSBzeDtcblx0ICAgICAgICAgICAgSU5WX1NCT1hbc3hdID0geDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIG11bHRpcGxpY2F0aW9uXG5cdCAgICAgICAgICAgIHZhciB4MiA9IGRbeF07XG5cdCAgICAgICAgICAgIHZhciB4NCA9IGRbeDJdO1xuXHQgICAgICAgICAgICB2YXIgeDggPSBkW3g0XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdX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GUgbnVtYmVyIG9mIGtleSBzY2hlZHVsZSByb3dzXG5cdCAgICAgICAgICAgIHZhciBrc1Jvd3MgPSAoblJvdW5kcyArIDEpICogNDtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGtleSBzY2hlZHVsZVxuXHQgICAgICAgICAgICB2YXIga2V5U2NoZWR1bGUgPSB0aGlzLl9rZXlTY2hlZHVsZSA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBrc1JvdyA9IDA7IGtzUm93IDwga3NSb3dzOyBrc1JvdysrKSB7XG5cdCAgICAgICAgICAgICAgICBpZiAoa3NSb3cgPCBrZXlTaXplKSB7XG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5V29yZHNba3NSb3ddO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93IC0gMV07XG5cblx0ICAgICAgICAgICAgICAgICAgICBpZiAoIShrc1JvdyAlIGtleVNpemUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJvdCB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAodCA8PCA4KSB8ICh0ID4+PiAyNCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3ViIHdvcmRcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdCA9IChTQk9YW3QgPj4+IDI0XSA8PCAyNCkgfCAoU0JPWFsodCA+Pj4gMTYpICYgMHhmZl0gPDwgMTYpIHwgKFNCT1hbKHQgPj4+IDgpICYgMHhmZl0gPDwgOCkgfCBTQk9YW3QgJiAweGZmXTtcblxuXHQgICAgICAgICAgICAgICAgICAgICAgICAvLyBNaXggUmNvblxuXHQgICAgICAgICAgICAgICAgICAgICAgICB0IF49IFJDT05bKGtzUm93IC8ga2V5U2l6ZSkgfCAwXSA8PCAyNDtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGtleVNpemUgPiA2ICYmIGtzUm93ICUga2V5U2l6ZSA9PSA0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFN1YiB3b3JkXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHQgPSAoU0JPWFt0ID4+PiAyNF0gPDwgMjQpIHwgKFNCT1hbKHQgPj4+IDE2KSAmIDB4ZmZdIDw8IDE2KSB8IChTQk9YWyh0ID4+PiA4KSAmIDB4ZmZdIDw8IDgpIHwgU0JPWFt0ICYgMHhmZl07XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAgICAga2V5U2NoZWR1bGVba3NSb3ddID0ga2V5U2NoZWR1bGVba3NSb3cgLSBrZXlTaXplXSBeIHQ7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDb21wdXRlIGludiBrZXkgc2NoZWR1bGVcblx0ICAgICAgICAgICAgdmFyIGludktleVNjaGVkdWxlID0gdGhpcy5faW52S2V5U2NoZWR1bGUgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaW52S3NSb3cgPSAwOyBpbnZLc1JvdyA8IGtzUm93czsgaW52S3NSb3crKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGtzUm93ID0ga3NSb3dzIC0gaW52S3NSb3c7XG5cblx0ICAgICAgICAgICAgICAgIGlmIChpbnZLc1JvdyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGtleVNjaGVkdWxlW2tzUm93XTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBrZXlTY2hlZHVsZVtrc1JvdyAtIDRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICBpZiAoaW52S3NSb3cgPCA0IHx8IGtzUm93IDw9IDQp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lLCBJTlZfU1VCX01JWF8wLCBJTlZfU1VCX01JWF8xLCBJTlZfU1VCX01JWF8yLCBJTlZfU1VCX01JWF8zLCBJTlZfU0JPWCk7XG5cblx0ICAgICAgICAgICAgLy8gSW52IHN3YXAgMm5kIGFuZCA0dGggcm93c1xuXHQgICAgICAgICAgICB2YXIgdCA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIE1bb2Zmc2V0ICsgMV0gPSBNW29mZnNldCArIDNdO1xuXHQgICAgICAgICAgICBNW29mZnNldCArIDNdID0gdDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvQ3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCwga2V5U2NoZWR1bGUsIFNVQl9NSVhfMCwgU1VCX01JWF8xLCBTVUJfTUlYXzIsIFNVQl9NSVhfMywgU0JPWCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgblJvdW5kcyA9IHRoaXMuX25Sb3VuZHM7XG5cblx0ICAgICAgICAgICAgLy8gR2V0IGlucHV0LCBhZGQgcm91bmQga2V5XG5cdCAgICAgICAgICAgIHZhciBzMCA9IE1bb2Zmc2V0XSAgICAgXiBrZXlTY2hlZHVsZVswXTtcblx0ICAgICAgICAgICAgdmFyIHMxID0gTVtvZmZzZXQgKyAxXSBeIGtleVNjaGVkdWxlWzFdO1xuXHQgICAgICAgICAgICB2YXIgczIgPSBNW29mZnNldCArIDJdIF4ga2V5U2NoZWR1bGVbMl07XG5cdCAgICAgICAgICAgIHZhciBzMyA9IE1bb2Zmc2V0ICsgM10gXiBrZXlTY2hlZHVsZVszXTtcblxuXHQgICAgICAgICAgICAvLyBLZXkgc2NoZWR1bGUgcm93IGNvdW50ZXJcblx0ICAgICAgICAgICAgdmFyIGtzUm93ID0gNDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgcm91bmQgPSAxOyByb3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uXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBBRVMgPSBDcnlwdG9KUy5saWIuQ2lwaGVyLl9jcmVhdGVIZWxwZXIoQ3J5cHRvSlMuYWxnby5BRVMpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIF9jcmVhdGVIZWxwZXI6IChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIGZ1bmN0aW9uIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBrZXkgPT0gJ3N0cmluZycpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFzc3dvcmRCYXNlZENpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFNlcmlhbGl6YWJsZUNpcGhlcjtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbiAoY2lwaGVyKSB7XG5cdCAgICAgICAgICAgICAgICByZXR1cm4ge1xuXHQgICAgICAgICAgICAgICAgICAgIGVuY3J5cHQ6IGZ1bmN0aW9uIChtZXNzYWdlLCBrZXksIGNmZykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0Q2lwaGVyU3RyYXRlZ3koa2V5KS5lbmNyeXB0KGNpcGhlciwgbWVzc2FnZSwga2V5LCBjZmcpO1xuXHQgICAgICAgICAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgICAgICAgICBkZWNyeXB0OiBmdW5jdGlvbiAoY2lwaGVydGV4dCwga2V5LCBjZmcpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNlbGVjdENpcGhlclN0cmF0ZWd5KGtleSkuZGVjcnlwdChjaXBoZXIsIGNpcGhlcnRleHQsIGtleSwgY2ZnKTtcblx0ICAgICAg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xuXHQgICAgICAgICAqIENCQyBlbmNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkVuY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFhPUiBhbmQgZW5jcnlwdFxuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXHQgICAgICAgICAgICAgICAgY2lwaGVyLmVuY3J5cHRCbG9jayh3b3Jkcywgb2Zmc2V0KTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtZW1iZXIgdGhpcyBibG9jayB0byB1c2Ugd2l0aCBuZXh0IGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB3b3Jkcy5zbGljZShvZmZzZXQsIG9mZnNldCArIGJsb2NrU2l6ZSk7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENCQyBkZWNyeXB0b3IuXG5cdCAgICAgICAgICovXG5cdCAgICAgICAgQ0JDLkRlY3J5cHRvciA9IENCQy5leHRlbmQoe1xuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogUHJvY2Vzc2VzIHRoZSBkYXRhIGJsb2NrIGF0IG9mZnNldC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtBcnJheX0gd29yZHMgVGhlIGRhdGEgd29yZHMgdG8gb3BlcmF0ZSBvbi5cblx0ICAgICAgICAgICAgICogQHBhcmFtIHtudW1iZXJ9IG9mZnNldCBUaGUgb2Zmc2V0IHdoZXJlIHRoZSBibG9jayBzdGFydHMuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBtb2RlLnByb2Nlc3NCbG9jayhkYXRhLndvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICB2YXIgY2lwaGVyID0gdGhpcy5fY2lwaGVyO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbWVtYmVyIHRoaXMgYmxvY2sgdG8gdXNlIHdpdGggbmV4dCBibG9ja1xuXHQgICAgICAgICAgICAgICAgdmFyIHRoaXNCbG9jayA9IHdvcmRzLnNsaWNlKG9mZnNldCwgb2Zmc2V0ICsgYmxvY2tTaXplKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRGVjcnlwdCBhbmQgWE9SXG5cdCAgICAgICAgICAgICAgICBjaXBoZXIuZGVjcnlwdEJsb2NrKHdvcmRzLCBvZmZzZXQpO1xuXHQgICAgICAgICAgICAgICAgeG9yQmxvY2suY2FsbCh0aGlzLCB3b3Jkcywgb2Zmc2V0LCBibG9ja1NpemUpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBUaGlzIGJsb2NrIGJlY29tZXMgdGhlIHByZXZpb3VzIGJsb2NrXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9wcmV2QmxvY2sgPSB0aGlzQmxvY2s7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9KTtcblxuXHQgICAgICAgIGZ1bmN0aW9uIHhvckJsb2NrKHdvcmRzLCBvZmZzZXQsIGJsb2NrU2l6ZSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgaXYgPSB0aGlzLl9pdjtcblxuXHQgICAgICAgICAgICAvLyBDaG9vc2UgbWl4aW5nIGJsb2NrXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaXY7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBJViBmb3Igc3Vic2VxdWVudCBibG9ja3Ncblx0ICAgICAgICAgICAgICAgIHRoaXMuX2l2ID0gdW5kZWZpbmVkO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gdGhpcy5fcHJldkJsb2NrO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gWE9SIGJsb2Nrc1xuXHQgICAgICAgICAgICBmb3IgK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cGhlcnRleHQ6IGNpcGhlcnRleHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBrZXk6IGtleVdvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIGl2OiBpdldvcmRBcnJheSxcblx0ICAgICAgICAgKiAgICAgICAgIHNhbHQ6IHNhbHRXb3JkQXJyYXksXG5cdCAgICAgICAgICogICAgICAgICBhbGdvcml0aG06IENyeXB0b0pTLmFsZ28uQUVTLFxuXHQgICAgICAgICAqICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXG5cdCAgICAgICAgICogICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUEtDUzcsXG5cdCAgICAgICAgICogICAgICAgICBibG9ja1NpemU6IDQsXG5cdCAgICAgICAgICogICAgICAgICBmb3JtYXR0ZXI6IENyeXB0b0pTLmZvcm1hdC5PcGVuU1NMXG5cdCAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uIChjaXBoZXJQYXJhbXMpIHtcblx0ICAgICAgICAgICAgdGhpcy5taXhJbihjaXBoZXJQYXJhbXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyB0aGlzIGNpcGhlciBwYXJhbXMgb2JqZWN0IHRvIGEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtGb3JtYXR9IGZvcm1hdHRlciAoT3B0aW9uYWwpIFRoZSBmb3JtYXR0aW5nIHN0cmF0ZWd5IHRvIHVzZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIGNpcGhlciBwYXJhbXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAdGhyb3dzIEVycm9yIElmIG5laXRoZXIgdGhlIGZvcm1hdHRlciBub3Ig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CAgICAgICAgICAgIEYucHJvdG90eXBlID0gbnVsbDtcblxuXHQgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICB9O1xuXHQgICAgfSgpKVxuXG5cdCAgICAvKipcblx0ICAgICAqIENyeXB0b0pTIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBMaWJyYXJ5IG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfbGliID0gQy5saWIgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBCYXNlIG9iamVjdCBmb3IgcHJvdG90eXBhbCBpbmhlcml0YW5jZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIEJhc2UgPSBDX2xpYi5CYXNlID0gKGZ1bmN0aW9uICgpIHtcblxuXG5cdCAgICAgICAgcmV0dXJuIHtcblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBuZXcgb2JqZWN0IHRoYXQgaW5oZXJpdHMgZnJvbSB0aGlzIG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHBhcmFtIHtPYmplY3R9IG92ZXJyaWRlcyBQcm9wZXJ0aWVzIHRvIGNvcHkgaW50byB0aGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHJldHVybiB7T2JqZWN0fSBUaGUgbmV3IG9iamVjdC5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiAgICAgdmFyIE15VHlwZSA9IENyeXB0b0pTLmxpYi5CYXNlLmV4dGVuZCh7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgZmllbGQ6ICd2YWx1ZScsXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICAgICAgbWV0aG9kOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgfVxuXHQgICAgICAgICAgICAgKiAgICAgfSk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBleHRlbmQ6IGZ1bmN0aW9uIChvdmVycmlkZXMpIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNwYXduXG5cdCAgICAgICAgICAgICAgICB2YXIgc3VidHlwZSA9IGNyZWF0ZSh0aGlzKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gQXVnbWVudFxuXHQgICAgICAgICAgICAgICAgaWYgKG92ZXJyaWRlcykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YnR5cGUubWl4SW4ob3ZlcnJpZGVzKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGRlZmF1bHQgaW5pdGlhbGl6ZXJcblx0ICAgICAgICAgICAgICAgIGlmICghc3VidHlwZS5oYXNPd25Qcm9wZXJ0eSgnaW5pdCcpIHx8IHRoaXMuaW5pdCA9PT0gc3VidHlwZS5pbml0KSB7XG5cdCAgICAgICAgICAgICAgICAgICAgc3VidHlwZS5pbml0ID0gZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBzdWJ0eXBlLiRzdXBlci5pbml0LmFwcGx5KHRoaXMsIGFyZ3VtZW50cyk7XG5cdCAgICAgICAgICAgICAgICAgICAgfTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gSW5pdGlhbGl6ZXIncyBwcm90b3R5cGUgaXMgdGhlIHN1YnR5cGUgb2JqZWN0XG5cdCAgICAgICAgICAgICAgICBzdWJ0eXBlLmluaXQucHJvdG90eXBlID0gc3VidHlwZTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVmZXJlbmNlIHN1cGVydHlwZVxuXHQgICAgICAgICAgICAgICAgc3VidHlwZS4kc3VwZXIgPSB0aGlzO1xuXG5cdCAgICAgICAgICAgICAgICByZXR1cm4gc3VidHlwZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogRXh0ZW5kcyB0aGlzIG9iamVjdCBhbmQgcnVucyB0aGUgaW5pdCBtZXRob2QuXG5cdCAgICAgICAgICAgICAqIEFyZ3VtZW50cyB0byBjcmVhdGUoKSB3aWxsIGJlIHBhc3NlZCB0byBpbml0KCkuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEByZXR1cm4ge09iamVjdH0gVGhlIG5ldyBvYmplY3QuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBpbnN0YW5jZSA9IE15VHlwZS5jcmVhdGUoKTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIGNyZWF0ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGluc3RhbmNlID0gdGhpcy5leHRlbmQoKTtcblx0ICAgICAgICAgICAgICAgIGluc3RhbmNlLmluaXQuYXBwbHkoaW5zdGFuY2UsIGFyZ3VtZW50cyk7XG5cblx0ICAgICAgICAgICAgICAgIHJldHVybiBpbnN0YW5jZTtcblx0ICAgICAgICAgICAgfSxcblxuXHQgICAgICAgICAgICAvKipcblx0ICAgICAgICAgICAgICogSW5pdGlhbGl6ZXMgYSBuZXdseSBjcmVhdGVkIG9iamVjdC5cblx0ICAgICAgICAgICAgICogT3ZlcnJpZGUgdGhpcyBtZXRob2QgdG8gYWRkIHNvbWUgbG9naWMgd2hlbiB5b3VyIG9iamVjdHMgYXJlIGNyZWF0ZWQuXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICB2YXIgTXlUeXBlID0gQ3J5cHRvSlMubGliLkJhc2UuZXh0ZW5kKHtcblx0ICAgICAgICAgICAgICogICAgICAgICBpbml0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgICAqICAgICAgICAgICAgIC8vIC4uLlxuXHQgICAgICAgICAgICAgKiAgICAgICAgIH1cblx0ICAgICAgICAgICAgICogICAgIH0pO1xuXHQgICAgICAgICAgICAgKi9cblx0ICAgICAgICAgICAgaW5pdDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICB9LFxuXG5cdCAgICAgICAgICAgIC8qKlxuXHQgICAgICAgICAgICAgKiBDb3BpZXMgcHJvcGVydGllcyBpbnRvIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcGFyYW0ge09iamVjdH0gcHJvcGVydGllcyBUaGUgcHJvcGVydGllcyB0byBtaXggaW4uXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICAgICAqXG5cdCAgICAgICAgICAgICAqICAgICBNeVR5cGUubWl4SW4oe1xuXHQgICAgICAgICAgICAgKiAgICAgICAgIGZpZWxkOiAndmFsdWUnXG5cdCAgICAgICAgICAgICAqICAgICB9KTtcblx0ICAgICAgICAgICAgICovXG5cdCAgICAgICAgICAgIG1peEluOiBmdW5jdGlvbiAocHJvcGVydGllcykge1xuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgcHJvcGVydHlOYW1lIGluIHByb3BlcnRpZXMpIHtcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocHJvcGVydGllcy5oYXNPd25Qcm9wZXJ0eShwcm9wZXJ0eU5hbWUpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHlOYW1lXSA9IHByb3BlcnRpZXNbcHJvcGVydHlOYW1lXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElFIHdvbid0IGNvcHkgdG9TdHJpbmcgdXNpbmcgdGhlIGxvb3AgYWJvdmVcblx0ICAgICAgICAgICAgICAgIGlmIChwcm9wZXJ0aWVzLmhhc093blByb3BlcnR5KCd0b1N0cmluZycpKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdGhpcy50b1N0cmluZyA9IHByb3BlcnRpZXMudG9TdHJpbmc7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH0sXG5cblx0ICAgICAgICAgICAgLyoqXG5cdCAgICAgICAgICAgICAqIENyZWF0ZXMgYSBjb3B5IG9mIHRoaXMgb2JqZWN0LlxuXHQgICAgICAgICAgICAgKlxuXHQgICAgICAgICAgICAgKiBAcmV0dXJuIHtPYmplY3R9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgICAgICpcblx0ICAgICAgICAgICAgICogICAgIHZhciBjbG9uZSA9IGluc3RhbmNlLmNsb25lKCk7XG5cdCAgICAgICAgICAgICAqL1xuXHQgICAgICAgICAgICBjbG9uZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuaW5pdC5wcm90b3R5cGUuZXh0ZW5kKHRoaXMpO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfTtcblx0ICAgIH0oKSk7XG5cblx0ICAgIC8qKlxuXHQgICAgICogQW4gYXJyYXkgb2YgMzItYml0IHdvcmRzLlxuXHQgICAgICpcblx0ICAgICAqIEBwcm9wZXJ0eSB7QXJyYXl9IHdvcmRzIFRoZSBhcnJheSBvZiAzMi1iaXQgd29yZHMuXG5cdCAgICAgKiBAcHJvcG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eXRlcyAhPSB1bmRlZmluZWQpIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSBzaWdCeXRlcztcblx0ICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIHRoaXMuc2lnQnl0ZXMgPSB3b3Jkcy5sZW5ndGggKiA0O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIHRoaXMgd29yZCBhcnJheSB0byBhIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7RW5jb2Rlcn0gZW5jb2RlciAoT3B0aW9uYWwpIFRoZSBlbmNvZGluZyBzdHJhdGVneSB0byB1c2UuIERlZmF1bHQ6IENyeXB0b0pTLmVuYy5IZXhcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIHN0cmluZ2lmaWVkIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBzdHJpbmcgPSB3b3JkQXJyYXkgKyAnJztcblx0ICAgICAgICAgKiAgICAgdmFyIHN0cmluZyA9IHdvcmRBcnJheS50b1N0cmluZygpO1xuXHQgICAgICAgICAqICAgICB2YXIgc3RyaW5nID0gd29yZEFycmF5LnRvU3RyaW5nKENyeXB0b0pTLmVuYy5VdGY4KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB0b1N0cmluZzogZnVuY3Rpb24gKGVuY29kZXIpIHtcblx0ICAgICAgICAgICAgcmV0dXJuIChlbmNvZGVyIHx8IEhleCkuc3RyaW5naWZ5KHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb25jYXRlbmF0ZXMgYSB3b3JkIGFycmF5IHRvIHRoaXMgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkgdG8gYXBwZW5kLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHdvcmRBcnJheTEuY29uY2F0KHdvcmRBcnJheTIpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNvbmNhdDogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHRoaXNXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGF0V29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB0aGlzU2lnQnl0ZXMgPSB0aGlzLnNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB2YXIgdGhhdFNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENsYW1wIGV4Y2VzcyBiaXRzXG5cdCAgICAgICAgICAgIHRoaXMuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDb25jYXRcblx0ICAgICAgICAgICAgaWYgKHRoaXNTaWdCeXRlcyAlIDQpIHtcblx0ICAgICAgICAgICAgICAgIC8vIENvcHkgb25lIGJ5dGUgYXQgYSB0aW1lXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHRoYXRTaWdCeXRlczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRoYXRCeXRlID0gKHRoYXRXb3Jkc1tpID4+PiAyXSA+Pj4gKDI0IC0gKG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gICAgICAgIC8vIENsYW1wXG5cdCAgICAgICAgICAgIHdvcmRzW3NpZ0J5dGVzID4+PiAyXSAmPSAweGZmZmZmZmZmIDw8ICgzMiAtIChzaWdCeXRlcyAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIHdvcmRzLmxlbmd0aCA9IE1hdGguY2VpbChzaWdCeXRlcyAvIDQpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgY29weSBvZiB0aGlzIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSBjbG9uZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGNsb25lID0gd29yZEFycmF5LmNsb25lKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gQmFzZS5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS53b3JkcyA9IHRoaXMud29yZHMuc2xpY2UoMCk7XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGNsb25lO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDcmVhdGVzIGEgd29yZCBhcnJheSBmaWxsZWQgd2l0aCByYW5kb20gYnl0ZXMuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbkJ5dGVzIFRoZSBudW1iZXIgb2YgcmFuZG9tIGJ5dGVzIHRvIGdlbmVyYXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgcmFuZG9tIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5saWIuV29yZEFycmF5LnJhbmRvbSgxNik7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcmFuZG9tOiBmdW5jdGlvbiAobkJ5dGVzKSB7XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXG5cdCAgICAgICAgICAgIHZhciByID0gKGZ1bmN0aW9uIChtX3cpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBtX3cgPSBtX3c7XG5cdCAgICAgICAgICAgICAgICB2YXIgbV96ID0gMHgzYWRlNjhiMTtcblx0ICAgICAgICAgICAgICAgIHZhciBtYXNrID0gMHhmZmZmZmZmZjtcblxuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBtX3ogPSAoMHg5MDY5ICogKG1feiAmIDB4RkZGRikgKyAobV96ID4+IDB4MTApKSAmIG1hc2s7XG5cdCAgICAgICAgICAgICAgICAgICAgbV93ID0gKDB4NDY1MCAqIChtX3cgJiAweEZGRkYpICsgKG1fdyA+PiAweDEwKSkgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSAoKG1feiA8PCAweDEwKSArIG1fdykgJiBtYXNrO1xuXHQgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAvPSAweDEwMDAwMDAwMDtcblx0ICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gMC41O1xuXHQgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQgKiAoTWF0aC5yYW5kb20oKSA+IC41ID8gMSA6IC0xKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfSk7XG5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDAsIHJjYWNoZTsgaSA8IG5CeXRlczsgaSArPSA0KSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgX3IgPSByKChyY2FjaGUgfHwgTWF0aC5yYW5kb20oKSkgKiAweDEwMDAwMDAwMCk7XG5cblx0ICAgICAgICAgICAgICAgIHJjYWNoZSA9IF9yKCkgKiAweDNhZGU2N2I3O1xuXHQgICAgICAgICAgICAgICAgd29yZHMucHVzaCgoX3IoKSAqIDB4MTAwMDAwMDAwKSB8IDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdCh3b3JkcywgbkJ5dGVzKTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBFbmNvZGVyIG5hbWVzcGFjZS5cblx0ICAgICAqL1xuXHQgICAgdmFyIENfZW5jID0gQy5lbmMgPSB7fTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBIZXggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBIZXggPSBDX2VuYy5IZXggPSB7XG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSB3b3JkIGFycmF5IHRvIGEgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7V29yZEFycmF5fSB3b3JkQXJyYXkgVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtzdHJpbmd9IFRoZSBoZXggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgaGV4U3RyaW5nID0gQ3J5cHRvSlMuZW5jLkhleC5zdHJpbmdpZnkod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBzdHJpbmdpZnk6IGZ1bmN0aW9uICh3b3JkQXJyYXkpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IHdvcmRBcnJheS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNpZ0J5dGVzID0gd29yZEFycmF5LnNpZ0J5dGVzO1xuXG5cdCAgICAgICAgICAgIC8vIENvbnZlcnRcblx0ICAgICAgICAgICAgdmFyIGhleENoYXJzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2lnQnl0ZXM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJpdGUgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgaGV4Q2hhcnMucHVzaCgoYml0ZSA+Pj4gNCkudG9TdHJpbmcoMTYpKTtcblx0ICAgICAgICAgICAgICAgIGhleENoYXJzLnB1c2goKGJpdGUgJiAweDBmKS50b1N0cmluZygxNikpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgcmV0dXJuIGhleENoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIGhleCBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IGhleFN0ciBUaGUgaGV4IHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1dvcmRBcnJheX0gVGhlIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy5lbmMuSGV4LnBhcnNlKGhleFN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uIChoZXhTdHIpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRcblx0ICAgICAgICAgICAgdmFyIGhleFN0ckxlbmd0aCA9IGhleFN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBoZXhTdHJMZW5ndGg7IGkgKz0gMikge1xuXHQgICAgICAgICAgICAgICAgd29yZHNbaSA+Pj4gM10gfD0gcGFyc2VJbnQoaGV4U3RyLnN1YnN0cihpLCAyKSwgMTYpIDw8ICgyNCAtIChpICUgOCkgKiA0KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBuZXcgV29yZEFycmF5LmluaXQod29yZHMsIGhleFN0ckxlbmd0aCAvIDIpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogTGF0aW4xIGVuY29kaW5nIHN0cmF0ZWd5LlxuXHQgICAgICovXG5cdCAgICB2YXIgTGF0aW4xID0gQ19lbmMuTGF0aW4xID0ge1xuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgd29yZCBhcnJheSB0byBhIExhdGluMSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgTGF0aW4xIHN0cmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIGxhdGluMVN0cmluZyA9IENyeXB0b0pTLmVuYy5MYXRpbjEuc3RyaW5naWZ5KHdvcmRBcnJheSk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgc3RyaW5naWZ5OiBmdW5jdGlvbiAod29yZEFycmF5KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSB3b3JkQXJyYXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBzaWdCeXRlcyA9IHdvcmRBcnJheS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciBsYXRpbjFDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciBiaXRlID0gKHdvcmRzW2kgPj4+IDJdID4+PiAoMjQgLSAoaSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIGxhdGluMUNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShiaXRlKSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbGF0aW4xQ2hhcnMuam9pbignJyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIENvbnZlcnRzIGEgTGF0aW4xIHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gbGF0aW4xU3RyIFRoZSBMYXRpbjEgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5MYXRpbjEucGFyc2UobGF0aW4xU3RyaW5nKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKGxhdGluMVN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgbGF0aW4xU3RyTGVuZ3RoID0gbGF0aW4xU3RyLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB3b3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxhdGluMVN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAyXSB8PSAobGF0aW4xU3RyLmNoYXJDb2RlQXQoaSkgJiAweGZmKSA8PCAoMjQgLSAoaSAlIDQpICogOCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gbmV3IFdvcmRBcnJheS5pbml0KHdvcmRzLCBsYXRpbjFTdHJMZW5ndGgpO1xuXHQgICAgICAgIH1cblx0ICAgIH07XG5cblx0ICAgIC8qKlxuXHQgICAgICogVVRGLTggZW5jb2Rpbmcgc3RyYXRlZ3kuXG5cdCAgICAgKi9cblx0ICAgIHZhciBVdGY4ID0gQ19lbmMuVXRmOCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtOCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheX0gd29yZEFycmF5IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7c3RyaW5nfSBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgdXRmOFN0cmluZyA9IENyeXB0b0pTLmVuYy5VdGY4LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICB0cnkge1xuXHQgICAgICAgICAgICAgICAgcmV0dXJuIGRlY29kZVVSSUNvbXBvbmVudChlc2NhcGUoTGF0aW4xLnN0cmluZ2lmeSh3b3JkQXJyYXkpKSk7XG5cdCAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcblx0ICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignTWFsZm9ybWVkIFVURi04IGRhdGEnKTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi04IHN0cmluZyB0byBhIHdvcmQgYXJyYXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gdXRmOFN0ciBUaGUgVVRGLTggc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKHV0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gICAqL1xuXHQgICAgdmFyIEJhc2U2NCA9IENfZW5jLkJhc2U2NCA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBCYXNlNjQgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBiYXNlNjRTdHJpbmcgPSBDcnlwdG9KUy5lbmMuQmFzZTY0LnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cdCAgICAgICAgICAgIHZhciBtYXAgPSB0aGlzLl9tYXA7XG5cblx0ICAgICAgICAgICAgLy8gQ2xhbXAgZXhjZXNzIGJpdHNcblx0ICAgICAgICAgICAgd29yZEFycmF5LmNsYW1wKCk7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgYmFzZTY0Q2hhcnMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaWdCeXRlczsgaSArPSAzKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIgYnl0ZTEgPSAod29yZHNbaSA+Pj4gMl0gICAgICAgPj4+ICgyNCAtIChpICUgNCkgKiA4KSkgICAgICAgJiAweGZmO1xuXHQgICAgICAgICAgICAgICAgdmFyIGJ5dGUyID0gKHdvcmRzWyhpICsgMSkgPj4+IDJdID4+PiAoMjQgLSAoKGkgKyAxKSAlIDQpICogOCkpICYgMHhmZjtcblx0ICAgICAgICAgICAgICAgIHZhciBieXRlMyA9ICh3b3Jkc1soaSArIDIpID4+PiAyXSA+Pj4gKDI0IC0gKChpICsgMikgJSA0KSAqIDgpKSAmIDB4ZmY7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0cmlwbGV0ID0gKGJ5dGUxIDw8IDE2KSB8IChieXRlMiA8PCA4KSB8IGJ5dGUzO1xuXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgKGogPCA0KSAmJiAoaSArIGogKiAwLjc1IDwgc2lnQnl0ZXMpOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKG1hcC5jaGFyQXQoKHRyaXBsZXQgPj4+ICg2ICogKDMgLSBqKSkpICYgMHgzZikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQWRkIHBhZGRpbmdcblx0ICAgICAgICAgICAgdmFyIHBhZGRpbmdDaGFyID0gbWFwLmNoYXJBdCg2NCk7XG5cdCAgICAgICAgICAgIGlmIChwYWRkaW5nQ2hhcikge1xuXHQgICAgICAgICAgICAgICAgd2hpbGUgKGJhc2U2NENoYXJzLmxlbmd0aCAlIDQpIHtcblx0ICAgICAgICAgICAgICAgICAgICBiYXNlNjRDaGFycy5wdXNoKHBhZGRpbmdDaGFyKTtcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBiYXNlNjRDaGFycy5qb2luKCcnKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgYSBCYXNlNjQgc3RyaW5nIHRvIGEgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7c3RyaW5nfSBiYXNlNjRTdHIgVGhlIEJhc2U2NCBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtXb3JkQXJyYXl9IFRoZSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHN0YXRpY1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMuZW5jLkJhc2U2NC5wYXJzZShiYXNlNjRTdHJpbmcpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHBhcnNlOiBmdW5jdGlvbiAoYmFzZTY0U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgYmFzZTY0U3RyTGVuZ3RoID0gYmFzZTY0U3RyLmxlbmd0aDtcblx0ICAgICAgICAgICAgdmFyIG1hcCA9IHRoaXMuX21hcDtcblx0ICAgICAgICAgICAgdmFyIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwO1xuXG5cdCAgICAgICAgICAgIGlmICghcmV2ZXJzZU1hcCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHJldmVyc2VNYXAgPSB0aGlzLl9yZXZlcnNlTWFwID0gW107XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBtYXAubGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgcmV2ZXJzZU1hcFttYXAuY2hhckNvZGVBdChqKV0gPSBqO1xuXHQgICAgICAgICAgICAgICAgICAgIH1cblx0ICAgIC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OyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSAod29yZHNbaSA+Pj4gMl0gPj4+ICgxNiAtIChpICUgNCkgKiA4KSkgJiAweGZmZmY7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBCRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgQkUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNi5wYXJzZSh1dGYxNlN0cmluZyk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgcGFyc2U6IGZ1bmN0aW9uICh1dGYxNlN0cikge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZTdHJMZW5ndGggPSB1dGYxNlN0ci5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgd29yZHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB1dGYxNlN0ckxlbmd0aDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB3b3Jkc1tpID4+PiAxXSB8PSB1dGYxNlN0ci5jaGFyQ29kZUF0KGkpIDw8ICgxNiAtIChpICUgMikgKiAxNik7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gV29yZEFycmF5LmNyZWF0ZSh3b3JkcywgdXRmMTZTdHJMZW5ndGggKiAyKTtcblx0ICAgICAgICB9XG5cdCAgICB9O1xuXG5cdCAgICAvKipcblx0ICAgICAqIFVURi0xNiBMRSBlbmNvZGluZyBzdHJhdGVneS5cblx0ICAgICAqL1xuXHQgICAgQ19lbmMuVXRmMTZMRSA9IHtcblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIHdvcmQgYXJyYXkgdG8gYSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl9IHdvcmRBcnJheSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge3N0cmluZ30gVGhlIFVURi0xNiBMRSBzdHJpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAc3RhdGljXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB1dGYxNlN0ciA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnN0cmluZ2lmeSh3b3JkQXJyYXkpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHN0cmluZ2lmeTogZnVuY3Rpb24gKHdvcmRBcnJheSkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gd29yZEFycmF5LndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc2lnQnl0ZXMgPSB3b3JkQXJyYXkuc2lnQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gQ29udmVydFxuXHQgICAgICAgICAgICB2YXIgdXRmMTZDaGFycyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHNpZ0J5dGVzOyBpICs9IDIpIHtcblx0ICAgICAgICAgICAgICAgIHZhciBjb2RlUG9pbnQgPSBzd2FwRW5kaWFuKCh3b3Jkc1tpID4+PiAyXSA+Pj4gKDE2IC0gKGkgJSA0KSAqIDgpKSAmIDB4ZmZmZik7XG5cdCAgICAgICAgICAgICAgICB1dGYxNkNoYXJzLnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShjb2RlUG9pbnQpKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiB1dGYxNkNoYXJzLmpvaW4oJycpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBDb252ZXJ0cyBhIFVURi0xNiBMRSBzdHJpbmcgdG8gYSB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtzdHJpbmd9IHV0ZjE2U3RyIFRoZSBVVEYtMTYgTEUgc3RyaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgd29yZCBhcnJheS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBzdGF0aWNcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHdvcmRBcnJheSA9IENyeXB0b0pTLmVuYy5VdGYxNkxFLnBhcnNlKHV0ZjE2U3RyKTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICBwYXJzZTogZnVuY3Rpb24gKHV0ZjE2U3RyKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciB1dGYxN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gICogRGVyaXZlcyBhIGtleSBmcm9tIGEgcGFzc3dvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHNhbHQgQSBzYWx0LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBrZXkgPSBrZGYuY29tcHV0ZShwYXNzd29yZCwgc2FsdCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgY29tcHV0ZTogZnVuY3Rpb24gKHBhc3N3b3JkLCBzYWx0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBjZmcgPSB0aGlzLmNmZztcblxuXHQgICAgICAgICAgICAvLyBJbml0IGhhc2hlclxuXHQgICAgICAgICAgICB2YXIgaGFzaGVyID0gY2ZnLmhhc2hlci5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBJbml0aWFsIHZhbHVlc1xuXHQgICAgICAgICAgICB2YXIgZGVyaXZlZEtleSA9IFdvcmRBcnJheS5jcmVhdGUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRlcml2ZWRLZXlXb3JkcyA9IGRlcml2ZWRLZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKGJsb2NrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaGFzaGVyLnVwZGF0ZShibG9jayk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB2YXIgYmxvY2sgPSBoYXNoZXIudXBkYXRlKHBhc3N3b3JkKS5maW5hbGl6ZShzYWx0KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hlci5yZXNldCgpO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBJdGVyYXRpb25zXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IGl0ZXJhdGlvbnM7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGJsb2NrID0gaGFzaGVyLmZpbmFsaXplKGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgICAgICBoYXNoZXIucmVzZXQoKTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZGVyaXZlZEtleS5jb25jYXQoYmxvY2spO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBEZXJpdmVzIGEga2V5IGZyb20gYSBwYXNzd29yZC5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYX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gICAgICAgICAgICAga2V5ID0gaGFzaGVyLmZpbmFsaXplKGtleSk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBDbGFtcCBleGNlc3MgYml0c1xuXHQgICAgICAgICAgICBrZXkuY2xhbXAoKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBrZXkgZm9yIGlubmVyIGFuZCBvdXRlciBwYWRzXG5cdCAgICAgICAgICAgIHZhciBvS2V5ID0gdGhpcy5fb0tleSA9IGtleS5jbG9uZSgpO1xuXHQgICAgICAgICAgICB2YXIgaUtleSA9IHRoaXMuX2lLZXkgPSBrZXkuY2xvbmUoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIG9LZXlXb3JkcyA9IG9LZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBpS2V5V29yZHMgPSBpS2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFhPUiBrZXlzIHdpdGggcGFkIGNvbnN0YW50c1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGhhc2hlckJsb2NrU2l6ZTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBvS2V5V29yZHNbaV0gXj0gMHg1YzVjNWM1Yztcblx0ICAgICAgICAgICAgICAgIGlLZXlXb3Jkc1tpXSBePSAweDM2MzYzNjM2O1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIG9LZXkuc2lnQnl0ZXMgPSBpS2V5LnNpZ0J5dGVzID0gaGFzaGVyQmxvY2tTaXplQnl0ZXM7XG5cblx0ICAgICAgICAgICAgLy8gU2V0IGluaXRpYWwgdmFsdWVzXG5cdCAgICAgICAgICAgIHRoaXMucmVzZXQoKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogUmVzZXRzIHRoaXMgSE1BQyB0byBpdHMgaW5pdGlhbCBzdGF0ZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci5yZXNldCgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIHJlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBoYXNoZXIgPSB0aGlzLl9oYXNoZXI7XG5cblx0ICAgICAgICAgICAgLy8gUmVzZXRcblx0ICAgICAgICAgICAgaGFzaGVyLnJlc2V0KCk7XG5cdCAgICAgICAgICAgIGhhc2hlci51cGRhdGUodGhpcy5faUtleSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFVwZGF0ZXMgdGhpcyBITUFDIHdpdGggYSBtZXNzYWdlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtXb3JkQXJyYXl8c3RyaW5nfSBtZXNzYWdlVXBkYXRlIFRoZSBtZXNzYWdlIHRvIGFwcGVuZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge0hNQUN9IFRoaXMgSE1BQyBpbnN0YW5jZS5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUoJ21lc3NhZ2UnKTtcblx0ICAgICAgICAgKiAgICAgaG1hY0hhc2hlci51cGRhdGUod29yZEFycmF5KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICB1cGRhdGU6IGZ1bmN0aW9uIChtZXNzYWdlVXBkYXRlKSB7XG5cdCAgICAgICAgICAgIHRoaXMuX2hhc2hlci51cGRhdGUobWVzc2FnZVVwZGF0ZSk7XG5cblx0ICAgICAgICAgICAgLy8gQ2hhaW5hYmxlXG5cdCAgICAgICAgICAgIHJldHVybiB0aGlzO1xuXHQg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CA4KSAgfCAoTV9vZmZzZXRfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAoKChNX29mZnNldF9pIDw8IDI0KSB8IChNX29mZnNldF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8wICA9IE1bb2Zmc2V0ICsgMF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xICA9IE1bb2Zmc2V0ICsgMV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8yICA9IE1bb2Zmc2V0ICsgMl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8zICA9IE1bb2Zmc2V0ICsgM107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF80ICA9IE1bb2Zmc2V0ICsgNF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF81ICA9IE1bb2Zmc2V0ICsgNV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF82ICA9IE1bb2Zmc2V0ICsgNl07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF83ICA9IE1bb2Zmc2V0ICsgN107XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF84ICA9IE1bb2Zmc2V0ICsgOF07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF85ICA9IE1bb2Zmc2V0ICsgOV07XG5cdCAgICAgICAgICAgIHZhciBNX29mZnNldF8xMCA9IE1bb2Zmc2V0ICsgMTBdO1xuXHQgICAgICAgICAgICB2YXIgTV9vZmZzZXRfMTEgPSBNW29mZnNldCArIDExXTtcblx0ICAgICAgICAgICAgdmFyIE1fb2Zmc2V0XzEyID0gTVtvZmZzZXQgKyAxM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EggPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbKCgobkJpdHNMZWZ0ICsgNjQpID4+PiA5KSA8PCA0KSArIDE0XSA9IChcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDgpICB8IChuQml0c1RvdGFsTCA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICgoKG5CaXRzVG90YWxMIDw8IDI0KSB8IChuQml0c1RvdGFsTCA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICk7XG5cblx0ICAgICAgICAgICAgZGF0YS5zaWdCeXRlcyA9IChkYXRhV29yZHMubGVuZ3RoICsgMSkgKiA0O1xuXG5cdCAgICAgICAgICAgIC8vIEhhc2ggZmluYWwgYmxvY2tzXG5cdCAgICAgICAgICAgIHRoaXMuX3Byb2Nlc3MoKTtcblxuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGhhc2ggPSB0aGlzLl9oYXNoO1xuXHQgICAgICAgICAgICB2YXIgSCA9IGhhc2gud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcCBlbmRpYW5cblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgSF9pID0gSFtpXTtcblxuXHQgICAgICAgICAgICAgICAgSFtpXSA9ICgoKEhfaSA8PCA4KSAgfCAoSF9pID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICAgICgoKEhfaSA8PCAyNCkgfCAoSF9pID4+PiA4KSkgICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBSZXR1cm4gZmluYWwgY29tcHV0ZWQgaGFzaFxuXHQgICAgICAgICAgICByZXR1cm4gaGFzaDtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgY2xvbmU6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIGNsb25lID0gSGFzaGVyLmNsb25lLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIGNsb25lLl9oYXNoID0gdGhpcy5faGFzaC5jbG9uZSgpO1xuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgZnVuY3Rpb24gRkYoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGMpIHwgKH5iICYgZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gR0coYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArICgoYiAmIGQpIHwgKGMgJiB+ZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gSEgoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArIChiIF4gYyBeIGQpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMzIgLSBzKSkpICsgYjtcblx0ICAgIH1cblxuXHQgICAgZnVuY3Rpb24gSUkoYSwgYiwgYywgZCwgeCwgcywgdCkge1xuXHQgICAgICAgIHZhciBuID0gYSArIChjIF4gKGIgfCB+ZCkpICsgeCArIHQ7XG5cdCAgICAgICAgcmV0dXJuICgobiA8PCBzKSB8IChuID4+PiAoMz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dFx0fVxuXG5cdCAgICB2YXIgRW5jcnlwdG9yID0gQ1RSR2xhZG1hbi5FbmNyeXB0b3IgPSBDVFJHbGFkbWFuLmV4dGVuZCh7XG5cdCAgICAgICAgcHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAod29yZHMsIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGNpcGhlciA9IHRoaXMuX2NpcGhlclxuXHQgICAgICAgICAgICB2YXIgYmxvY2tTaXplID0gY2lwaGVyLmJsb2NrU2l6ZTtcblx0ICAgICAgICAgICAgdmFyIGl2ID0gdGhpcy5faXY7XG5cdCAgICAgICAgICAgIHZhciBjb3VudGVyID0gdGhpcy5fY291bnRlcjtcblxuXHQgICAgICAgICAgICAvLyBHZW5lcmF0ZSBrZXlzdHJlYW1cblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICBjb3VudGVyID0gdGhpcy5fY291bnRlciA9IGl2LnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBSZW1vdmUgSVYgZm9yIHN1YnNlcXVlbnQgYmxvY2tzXG5cdCAgICAgICAgICAgICAgICB0aGlzLl9pdiA9IHVuZGVmaW5lZDtcblx0ICAgICAgICAgICAgfVxuXG5cdFx0XHRcdGluY0NvdW50ZXIoY291bnRlcik7XG5cblx0XHRcdFx0dmFyIGtleXN0cmVhbSA9IGNvdW50ZXIuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2soa2V5c3RyZWFtLCAwKTtcblxuXHQgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW29mZnNldCArIGldIF49IGtleXN0cmVhbVtpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH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blx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBjaXBoZXIgPSB0aGlzLl9jaXBoZXJcblx0ICAgICAgICAgICAgdmFyIGJsb2NrU2l6ZSA9IGNpcGhlci5ibG9ja1NpemU7XG5cdCAgICAgICAgICAgIHZhciBpdiA9IHRoaXMuX2l2O1xuXHQgICAgICAgICAgICB2YXIgY291bnRlciA9IHRoaXMuX2NvdW50ZXI7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5c3RyZWFtXG5cdCAgICAgICAgICAgIGlmIChpdikge1xuXHQgICAgICAgICAgICAgICAgY291bnRlciA9IHRoaXMuX2NvdW50ZXIgPSBpdi5zbGljZSgwKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gUmVtb3ZlIElWIGZvciBzdWJzZXF1ZW50IGJsb2Nrc1xuXHQgICAgICAgICAgICAgICAgdGhpcy5faXYgPSB1bmRlZmluZWQ7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgdmFyIGtleXN0cmVhbSA9IGNvdW50ZXIuc2xpY2UoMCk7XG5cdCAgICAgICAgICAgIGNpcGhlci5lbmNyeXB0QmxvY2soa2V5c3RyZWFtLCAwKTtcblxuXHQgICAgICAgICAgICAvLyBJbmNyZW1lbnQgY291bnRlclxuXHQgICAgICAgICAgICBjb3VudGVyW2Jsb2NrU2l6ZSAtIDFdID0gKGNvdW50ZXJbYmxvY2tTaXplIC0gMV0gKyAxKSB8IDBcblxuXHQgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYmxvY2tTaXplOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW29mZnNldCArIGldIF49IGtleXN0cmVhbVtpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblx0ICAgIH0pO1xuXG5cdCAgICBDVFIuRGVjcnlwdG9yID0gRW5jcnlwdG9yO1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yIGJsb2NrSW5kZXhXb3JkcyA9IGJsb2NrSW5kZXgud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaXplID0gY2ZnLmtleVNpemU7XG5cdCAgICAgICAgICAgIHZhciBpdGVyYXRpb25zID0gY2ZnLml0ZXJhdGlvbnM7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUga2V5XG5cdCAgICAgICAgICAgIHdoaWxlIChkZXJpdmVkS2V5V29yZHMubGVuZ3RoIDwga2V5U2l6ZSkge1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrID0gaG1hYy51cGRhdGUoc2FsdCkuZmluYWxpemUoYmxvY2tJbmRleCk7XG5cdCAgICAgICAgICAgICAgICBobWFjLnJlc2V0KCk7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIGJsb2NrV29yZHMgPSBibG9jay53b3Jkcztcblx0ICAgICAgICAgICAgICAgIHZhciBibG9ja1dvcmRzTGVuZ3RoID0gYmxvY2tXb3Jkcy5sZW5ndGg7XG5cblx0ICAgICAgICAgICAgICAgIC8vIEl0ZXJhdGlvbnNcblx0ICAgICAgICAgICAgICAgIHZhciBpbnRlcm1lZGlhdGUgPSBibG9jaztcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAxOyBpIDwgaXRlcmF0aW9uczsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgaW50ZXJtZWRpYXRlID0gaG1hYy5maW5hbGl6ZShpbnRlcm1lZGlhdGUpO1xuXHQgICAgICAgICAgICAgICAgICAgIGhtYWMucmVzZXQoKTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGludGVybWVkaWF0ZVdvcmRzID0gaW50ZXJtZWRpYXRlLndvcmRzO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgLy8gWE9SIGludGVybWVkaWF0ZSB3aXRoIGJsb2NrXG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBibG9ja1dvcmRzTGVuZ3RoOyBqKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tXb3Jkc1tqXSBePSBpbnRlcm1lZGlhdGVXb3Jkc1tqXTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIGRlcml2ZWRLZXkuY29uY2F0KGJsb2NrKTtcblx0ICAgICAgICAgICAgICAgIGJsb2NrSW5kZXhXb3Jkc1swXSsrO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIGRlcml2ZWRLZXkuc2lnQnl0ZXMgPSBrZXlTaXplICogNDtcblxuXHQgICAgICAgICAgICByZXR1cm4gZGVyaXZlZEtleTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblxuXHQgICAgLyoqXG5cdCAgICAgKiBDb21wdXRlcyB0aGUgUGFzc3dvcmQtQmFzZWQgS2V5IERlcml2YXRpb24gRnVuY3Rpb24gMi5cblx0ICAgICAqXG5cdCAgICAgKiBAcGFyYW0ge1dvcmRBcnJheXxzdHJpbmd9IHBhc3N3b3JkIFRoZSBwYXNzd29yZC5cblx0ICAgICAqIEBwYXJhbSB7V29yZEFycmF5fHN0cmluZ30gc2FsdCBBIHNhbHQuXG5cdCAgICAgKiBAcGFyYW0ge09iamVjdH0gY2ZnIChPcHRpb25hbCkgVGhlIGNvbmZpZ3VyYXRpb24gb3B0aW9ucyB0byB1c2UgZm9yIHRoaXMgY29tcHV0YXRpb24uXG5cdCAgICAgKlxuXHQgICAgICogQHJldHVybiB7V29yZEFycmF5fSBUaGUgZGVyaXZlZCBrZXkuXG5cdCAgICAgKlxuXHQgICAgICogQHN0YXRpY1xuXHQgICAgICpcblx0ICAgICAqIEBleGFtcGxlXG5cdCAgICAgKlxuXHQgICAgICogICAgIHZhciBrZXkgPSBDcn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cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU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RoaXMuX0MgPSBbXG5cdCAgICAgICAgICAgICAgICAoS1syXSA8PCAxNikgfCAoS1syXSA+Pj4gMTYpLCAoS1swXSAmIDB4ZmZmZjAwMDApIHwgKEtbMV0gJiAweDAwMDBmZmZmKSxcblx0ICAgICAgICAgICAgICAgIChLWzNdIDw8IDE2KSB8IChLWzNdID4+PiAxNiksIChLWzFdICYgMHhmZmZmMDAwMCkgfCAoS1syXSAmIDB4MDAwMGZmZmYpLFxuXHQgICAgICAgICAgICAgICAgKEtbMF0gPDwgMTYpIHwgKEtbMF0gPj4+IDE2KSwgKEtbMl0gJiAweGZmZmYwMDAwKSB8IChLWzNdICYgMHgwMDAwZmZmZiksXG5cdCAgICAgICAgICAgICAgICAoS1sxXSA8PCAxNikgfCAoS1sxXSA+Pj4gMTYpLCAoS1szXSAmIDB4ZmZmZjAwMDApIHwgKEtbMF0gJiAweDAwMDBmZmZmKVxuXHQgICAgICAgICAgICBdO1xuXG5cdCAgICAgICAgICAgIC8vIENhcnJ5IGJpdFxuXHQgICAgICAgICAgICB0aGlzLl9iID0gMDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW0gZm91ciB0aW1lc1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDQ7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBNb2RpZnkgdGhlIGNvdW50ZXJzXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICBDW2ldIF49IFhbKGkgKyA0KSAmIDddO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSVYgc2V0dXBcblx0ICAgICAgICAgICAgaWYgKGl2KSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBJViA9IGl2LndvcmRzO1xuXHQgICAgICAgICAgICAgICAgdmFyIElWXzAgPSBJVlswXTtcblx0ICAgICAgICAgICAgICAgIHZhciBJVl8xID0gSVZbMV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIEdlbmVyYXRlIGZvdXIgc3VidmVjdG9yc1xuXHQgICAgICAgICAgICAgICAgdmFyIGkwID0gKCgoSVZfMCA8PCA4KSB8IChJVl8wID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfCAoKChJVl8wIDw8IDI0KSB8IChJVl8wID4+PiA4KSkgJiAweGZmMDBmZjAwKTtcblx0ICAgICAgICAgICAgICAgIHZhciBpMiA9ICgoKElWXzEgPDwgOCkgfCAoSVZfMSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHwgKCgoSVZfMSA8PCAyNCkgfCAoSVZfMSA+Pj4gOCkpICYgMHhmZjAwZmYwMCk7XG5cdCAgICAgICAgICAgICAgICB2YXIgaTEgPSAoaTAgPj4+IDE2KSB8IChpMiAmIDB4ZmZmZjAwMDApO1xuXHQgICAgICAgICAgICAgICAgdmFyIGkzID0gKGkyIDw8IDE2KSAgfCAoaTAgJiAweDAwMDBmZmZmKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IGNvdW50ZXIgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICBDWzBdIF49IGkwO1xuXHQgICAgICAgICAgICAgICAgQ1sxXSBePSBpMTtcblx0ICAgICAgICAgICAgICAgIENbMl0gXj0gaTI7XG5cdCAgICAgICAgICAgICAgICBDWzNdIF49IGkzO1xuXHQgICAgICAgICAgICAgICAgQ1s0XSBePSBpMDtcblx0ICAgICAgICAgICAgICAgIENbNV0gXj0gaTE7XG5cdCAgICAgICAgICAgICAgICBDWzZdIF49IGkyO1xuXHQgICAgICAgICAgICAgICAgQ1s3XSBePSBpMztcblxuXHQgICAgICAgICAgICAgICAgLy8gSXRlcmF0ZSB0aGUgc3lzdGVtIGZvdXIgdGltZXNcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBYID0gdGhpcy5fWDtcblxuXHQgICAgICAgICAgICAvLyBJdGVyYXRlIHRoZSBzeXN0ZW1cblx0ICAgICAgICAgICAgbmV4dFN0YXRlLmNhbGwodGhpcyk7XG5cblx0ICAgICAgICAgICAgLy8gR2VuZXJhdGUgZm91ciBrZXlzdHJlYW0gd29yZHNcblx0ICAgICAgICAgICAgU1swXSA9IFhbMF0gXiAoWFs1XSA+Pj4gMTYpIF4gKFhbM10gPDwgMTYpO1xuXHQgICAgICAgICAgICBTWzFdID0gWFsyXSBeIChYWzddID4+PiAxNikgXiAoWFs1XSA8PCAxNik7XG5cdCAgICAgICAgICAgIFNbMl0gPSBYWzRdIF4gKFhbMV0gPj4+IDE2KSBeIChYWzddIDw8IDE2KTtcblx0ICAgICAgICAgICAgU1szXSA9IFhbNl0gXiAoWFszXSA+Pj4gMTYpIF4gKFhbMV0gPDwgMTYpO1xuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgU1tpXSA9ICgoKFNbaV0gPDwgOCkgIHwgKFNbaV0gPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgICAgKCgoU1tpXSA8PCAyNCkgfCAoU1tpXSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBFbmNyeXB0XG5cdCAgICAgICAgICAgICAgICBNW29mZnNldCArIGldIF49IFNbaV07XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgYmxvY2tTaXplOiAxMjgvMzIsXG5cblx0ICAgICAgICBpdlNpemU6IDY0LzMyXG5cdCAgICB9KTtcblxuXHQgICAgZ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hlcjtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8qKlxuXHQgICAgICogUkM0IHN0cmVhbSBjaXBoZXIgYWxnb3JpdGhtLlxuXHQgICAgICovXG5cdCAgICB2YXIgUkM0ID0gQ19hbGdvLlJDNCA9IFN0cmVhbUNpcGhlci5leHRlbmQoe1xuXHQgICAgICAgIF9kb1Jlc2V0OiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIga2V5ID0gdGhpcy5fa2V5O1xuXHQgICAgICAgICAgICB2YXIga2V5V29yZHMgPSBrZXkud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBrZXlTaWdCeXRlcyA9IGtleS5zaWdCeXRlcztcblxuXHQgICAgICAgICAgICAvLyBJbml0IHNib3hcblx0ICAgICAgICAgICAgdmFyIFMgPSB0aGlzLl9TID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjU2OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIFNbaV0gPSBpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gS2V5IHNldHVwXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwLCBqID0gMDsgaSA8IDI1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qnl0ZUluZGV4ID0gaSAlIGtleVNpZ0J5dGVzO1xuXHQgICAgICAgICAgICAgICAgdmFyIGtleUJ5dGUgPSAoa2V5V29yZHNba2V5Qnl0ZUluZGV4ID4+PiAyXSA+Pj4gKDI0IC0gKGtleUJ5dGVJbmRleCAlIDQpICogOCkpICYgMHhmZjtcblxuXHQgICAgICAgICAgICAgICAgaiA9IChqICsgU1tpXSArIGtleUJ5dGUpICUgMjU2O1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwXG5cdCAgICAgICAgICAgICAgICB2YXIgdCA9IFNbaV07XG5cdCAgICAgICAgICAgICAgICBTW2ldID0gU1tqXTtcblx0ICAgICAgICAgICAgICAgIFNbal0gPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ291bnRlcnNcblx0ICAgICAgICAgICAgdGhpcy5faSA9IHRoaXMuX2ogPSAwO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9Qcm9jZXNzQmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgTVtvZmZzZXRdIF49IGdlbmVyYXRlS2V5c3RyZWFtV29yZC5jYWxsKHRoaXMpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBrZXlTaXplOiAyNTYvMzIsXG5cblx0ICAgICAgICBpdlNpemU6IDBcblx0ICAgIH0pO1xuXG5cdCAgICBmdW5jdGlvbiBnZW5lcmF0ZUtleXN0cmVhbVdvcmQoKSB7XG5cdCAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgdmFyIFMgPSB0aGlzLl9TO1xuXHQgICAgICAgIHZhciBpID0gdGhpcy5faTtcblx0ICAgICAgICB2YXIgaiA9IHRoaXMuX2o7XG5cblx0ICAgICAgICAvLyBHZW5lcmF0ZSBrZXlzdHJlYW0gd29yZFxuXHQgICAgICAgIHZhciBrZXlzdHJlYW1Xb3JkID0gMDtcblx0ICAgICAgICBmb3IgKHZhciBuID0gMDsgbiA8IDQ7IG4rKykge1xuXHQgICAgICAgICAgICBpID0gKGkgKyAxKSAlIDI1Njtcblx0ICAgICAgICAgICAgaiA9IChqICsgU1tpXSkgJSAyNTY7XG5cblx0ICAgICAgICAgICAgLy8gU3dhcFxuXHQgICAgICAgICAgICB2YXIgdCA9IFNbaV07XG5cdCAgICAgICAgICAgIFNbaV0gPSBTW2pdO1xuXHQgICAgICAgICAgICBTW2pdID0gdDtcblxuXHQgICAgICAgICAgICBrZXlzdHJlYW1Xb3JkIHw9IFNbKFNbaV0gKyBTW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sgaTtcblx0ICAgICAgICAgICAgICAgIHZhciBNX29mZnNldF9pID0gTVtvZmZzZXRfaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIE1bb2Zmc2V0X2ldID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE1fb2Zmc2V0X2kgPDwgOCkgIHwgKE1fb2Zmc2V0X2kgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTV9vZmZzZXRfaSA8PCAyNCkgfCAoTV9vZmZzZXRfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIICA9IHRoaXMuX2hhc2gud29yZHM7XG5cdCAgICAgICAgICAgIHZhciBobCA9IF9obC53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIGhyID0gX2hyLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgemwgPSBfemwud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB6ciA9IF96ci53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIHNsID0gX3NsLndvcmRzO1xuXHQgICAgICAgICAgICB2YXIgc3IgPSBfc3Iud29yZHM7XG5cblx0ICAgICAgICAgICAgLy8gV29ya2luZyB2YXJpYWJsZXNcblx0ICAgICAgICAgICAgdmFyIGFsLCBibCwgY2wsIGRsLCBlbDtcblx0ICAgICAgICAgICAgdmFyIGFyLCBiciwgY3IsIGRyLCBlcjtcblxuXHQgICAgICAgICAgICBhciA9IGFsID0gSFswXTtcblx0ICAgICAgICAgICAgYnIgPSBibCA9IEhbMV07XG5cdCAgICAgICAgICAgIGNyID0gY2wgPSBIWzJdO1xuXHQgICAgICAgICAgICBkciA9IGRsID0gSFszXTtcblx0ICAgICAgICAgICAgZXIgPSBlbCA9IEhbNF07XG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIHZhciB0O1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDgwOyBpICs9IDEpIHtcblx0ICAgICAgICAgICAgICAgIHQgPSAoYWwgKyAgTVtvZmZzZXQremxbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJsLGNsLGRsKSArIGhsWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjIoYmwsY2wsZGwpICsgaGxbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhibCxjbCxkbCkgKyBobFsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY0KGJsLGNsLGRsKSArIGhsWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJsLGNsLGRsKSArIGhsWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNsW2ldKTtcblx0ICAgICAgICAgICAgICAgIHQgPSAodCtlbCl8MDtcblx0ICAgICAgICAgICAgICAgIGFsID0gZWw7XG5cdCAgICAgICAgICAgICAgICBlbCA9IGRsO1xuXHQgICAgICAgICAgICAgICAgZGwgPSByb3RsKGNsLCAxMCk7XG5cdCAgICAgICAgICAgICAgICBjbCA9IGJsO1xuXHQgICAgICAgICAgICAgICAgYmwgPSB0O1xuXG5cdCAgICAgICAgICAgICAgICB0ID0gKGFyICsgTVtvZmZzZXQrenJbaV1dKXwwO1xuXHQgICAgICAgICAgICAgICAgaWYgKGk8MTYpe1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGY1KGJyLGNyLGRyKSArIGhyWzBdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpPDMyKSB7XG5cdFx0ICAgICAgICAgICAgdCArPSAgZjQoYnIsY3IsZHIpICsgaHJbMV07XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGk8NDgpIHtcblx0XHQgICAgICAgICAgICB0ICs9ICBmMyhicixjcixkcikgKyBoclsyXTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaTw2NCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYyKGJyLGNyLGRyKSArIGhyWzNdO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHsvLyBpZiAoaTw4MCkge1xuXHRcdCAgICAgICAgICAgIHQgKz0gIGYxKGJyLGNyLGRyKSArIGhyWzRdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdCA9IHR8MDtcblx0ICAgICAgICAgICAgICAgIHQgPSAgcm90bCh0LHNyW2ldKSA7XG5cdCAgICAgICAgICAgICAgICB0ID0gKHQrZXIpfDA7XG5cdCAgICAgICAgICAgICAgICBhciA9IGVyO1xuXHQgICAgICAgICAgICAgICAgZXIgPSBkcjtcblx0ICAgICAgICAgICAgICAgIGRyID0gcm90bChjciwgMTApO1xuXHQgICAgICAgICAgICAgICAgY3IgPSBicjtcblx0ICAgICAgICAgICAgICAgIGJyID0gdDtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICB0ICAgID0gKEhbMV0gKyBjbCArIGRyKXwwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMl0gKyBkbCArIGVyKXwwO1xuXHQgICAgICAgICAgICBIWzJdID0gKEh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1xuXHQgICAgICAgICAgICB0aGlzLl9wcm9jZXNzKCk7XG5cblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciBoYXNoID0gdGhpcy5faGFzaDtcblx0ICAgICAgICAgICAgdmFyIEggPSBoYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgNTsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIEhfaSA9IEhbaV07XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXBcblx0ICAgICAgICAgICAgICAgIEhbaV0gPSAoKChIX2kgPDwgOCkgIHwgKEhfaSA+Pj4gMjQpKSAmIDB4MDBmZjAwZmYpIHxcblx0ICAgICAgICAgICAgICAgICAgICAgICAoKChIX2kgPDwgMjQpIHwgKEhfaSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIGhhc2g7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEhhc2hlci5jbG9uZS5jYWxsKHRoaXMpO1xuXHQgICAgICAgICAgICBjbG9uZS5faGFzaCA9IHRoaXMuX2hhc2guY2xvbmUoKTtcblxuXHQgICAgICAgICAgICByZXR1cm4gY2xvbmU7XG5cdCAgICAgICAgfVxuXHQgICAgfSk7XG5cblxuXHQgICAgZnVuY3Rpb24gZjEoeCwgeSwgeikge1xuXHQgICAgICAgIHJldHVybiAoKHgpIF4gKHkpIF4gKHopKTtcblxuXHQgICAgfVxuXG5cdCAgICBmdW5jdGlvbiBmM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BhID0gSFswXTtcblx0ICAgICAgICAgICAgdmFyIGIgPSBIWzFdO1xuXHQgICAgICAgICAgICB2YXIgYyA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBkID0gSFszXTtcblx0ICAgICAgICAgICAgdmFyIGUgPSBIWzRdO1xuXG5cdCAgICAgICAgICAgIC8vIENvbXB1dGF0aW9uXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgODA7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKGkgPCAxNikge1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSBNW29mZnNldCArIGldIHwgMDtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIG4gPSBXW2kgLSAzXSBeIFdbaSAtIDhdIF4gV1tpIC0gMTRdIF4gV1tpIC0gMTZdO1xuXHQgICAgICAgICAgICAgICAgICAgIFdbaV0gPSAobiA8PCAxKSB8IChuID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0ID0gKChhIDw8IDUpIHwgKGEgPj4+IDI3KSkgKyBlICsgV1tpXTtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMjApIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9ICgoYiAmIGMpIHwgKH5iICYgZCkpICsgMHg1YTgyNzk5OTtcblx0ICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaSA8IDQwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdCArPSAoYiBeIGMgXiBkKSArIDB4NmVkOWViYTE7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGkgPCA2MCkge1xuXHQgICAgICAgICAgICAgICAgICAgIHQgKz0gKChiICYgYykgfCAoYiAmIGQpIHwgKGMgJiBkKSkgLSAweDcwZTQ0MzI0O1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChpIDwgODApICovIHtcblx0ICAgICAgICAgICAgICAgICAgICB0ICs9IChiIF4gYyBeIGQpIC0gMHgzNTlkM2UyYTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgZSA9IGQ7XG5cdCAgICAgICAgICAgICAgICBkID0gYztcblx0ICAgICAgICAgICAgICAgIGMgPSAoYiA8PCAzMCkgfCAoYiA+Pj4gMik7XG5cdCAgICAgICAgICAgICAgICBiID0gYTtcblx0ICAgICAgICAgICAgICAgIGEgPSB0O1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gSW50ZXJtZWRpYXRlIGhhc2ggdmFsdWVcblx0ICAgICAgICAgICAgSFswXSA9IChIWzBdICsgYSkgfCAwO1xuXHQgICAgICAgICAgICBIWzFdID0gKEhbMV0gKyBiKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMl0gPSAoSFsyXSArIGMpIHwgMDtcblx0ICAgICAgICAgICAgSFszXSA9IChIWzNdICsgZCkgfCAwO1xuXHQgICAgICAgICAgICBIWzRdID0gKEhbNF0gKyBlKSB8IDA7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb0ZpbmFsaXplOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICB2YXIgZGF0YSA9IHRoaXMuX2RhdGE7XG5cdCAgICAgICAgICAgIHZhciBkYXRhV29yZHMgPSBkYXRhLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBuQml0c1RvdGFsID0gdGhpcy5fbkRhdGFCeXRlcyAqIDg7XG5cdCAgICAgICAgICAgIHZhciBuQml0c0xlZnQgPSBkYXRhLnNpZ0J5dGVzICogODtcblxuXHQgICAgICAgICAgICAvLyBBZGQgcGFkZGluZ1xuXHQgICAgICAgICAgICBkYXRhV29yZHNbbkJpdHNMZWZ0ID4+PiA1XSB8PSAweDgwIDw8ICgyNCAtIG5CaXRzTGVmdCAlID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c2hlcjtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIEluaXRpYWxpemF0aW9uIGFuZCByb3VuZCBjb25zdGFudHMgdGFibGVzXG5cdCAgICB2YXIgSCA9IFtdO1xuXHQgICAgdmFyIEsgPSBbXTtcblxuXHQgICAgLy8gQ29tcHV0ZSBjb25zdGFudHNcblx0ICAgIChmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgZnVuY3Rpb24gaXNQcmltZShuKSB7XG5cdCAgICAgICAgICAgIHZhciBzcXJ0TiA9IE1hdGguc3FydChuKTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgZmFjdG9yID0gMjsgZmFjdG9yIDw9IHNxcnROOyBmYWN0b3IrKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKCEobiAlIGZhY3RvcikpIHtcblx0ICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICBmdW5jdGlvbiBnZXRGcmFjdGlvbmFsQml0cyhuKSB7XG5cdCAgICAgICAgICAgIHJldHVybiAoKG4gLSAobiB8IDApKSAqIDB4MTAwMDAwMDAwKSB8IDA7XG5cdCAgICAgICAgfVxuXG5cdCAgICAgICAgdmFyIG4gPSAyO1xuXHQgICAgICAgIHZhciBuUHJpbWUgPSAwO1xuXHQgICAgICAgIHdoaWxlIChuUHJpbWUgPCA2NCkge1xuXHQgICAgICAgICAgICBpZiAoaXNQcmltZShuKSkge1xuXHQgICAgICAgICAgICAgICAgaWYgKG5QcmltZSA8IDgpIHtcblx0ICAgICAgICAgICAgICAgICAgICBIW25QcmltZV0gPSBnZXRGcmFjdGlvbmFsQml0cyhNYXRoLnBvdyhuLCAxIC8gMikpO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgS1tuUHJpbWVdID0gZ2V0RnJhY3Rpb25hbEJpdHMoTWF0aC5wb3cobiwgMSAvIDMpKTtcblxuXHQgICAgICAgICAgICAgICAgblByaW1lKys7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICBuKys7XG5cdCAgICAgICAgfVxuXHQgICAgfSgpKTtcblxuXHQgICAgLy8gUmV1c2FibGUgb2JqZWN0XG5cdCAgICB2YXIgVyA9IFtdO1xuXG5cdCAgICAvKipcblx0ICAgICAqIFNIQS0yNTYgaGFzaCBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBTSEEyNTYgPSBDX2FsZ28uU0hBMjU2ID0gSGFzaGVyLmV4dGVuZCh7XG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdGhpcy5faGFzaCA9IG5ldyBXb3JkQXJyYXkuaW5pdChILnNsaWNlKDApKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvUHJvY2Vzc0Jsb2NrOiBmdW5jdGlvbiAoTSwgb2Zmc2V0KSB7XG5cdCAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgIHZhciBIID0gdGhpcy5faGFzaC53b3JkcztcblxuXHQgICAgICAgICAgICAvLyBXb3JraW5nIHZhcmlhYmxlc1xuXHQgICAgICAgICAgICB2YXIgYSA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBiID0gSFsxXTtcblx0ICAgICAgICAgICAgdmFyIGMgPSBIWzJdO1xuXHQgICAgICAgICAgICB2YXIgZCA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBlID0gSFs0XTtcblx0ICAgICAgICAgICAgdmFyIGYgPSBIWzVdO1xuXHQgICAgICAgICAgICB2YXIgZyA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBoID0gSFs3XTtcblxuXHQgICAgICAgICAgICAvLyBDb21wdXRhdGlvblxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDY0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gTVtvZmZzZXQgKyBpXSB8IDA7XG5cdCAgICAgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4ID0gV1tpIC0gMTVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTAgID0gKChnYW1tYTB4IDw8IDI1KSB8IChnYW1tYTB4ID4+PiA3KSkgIF5cblx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoZ2FtbWEweCA8PCAxNCkgfCAoZ2FtbWEweCA+Pj4gMTgpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdhbW1hMHggPj4+IDMpO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXggPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExICA9ICgoZ2FtbWExeCA8PCAxNSkgfCAoZ2FtbWExeCA+Pj4gMTcpKSBeXG5cdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGdhbW1hMXggPDwgMTMpIHwgKGdhbW1hMXggPj4+IDE5KSkgXlxuXHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnYW1tYTF4ID4+PiAxMCk7XG5cblx0ICAgICAgICAgICAgICAgICAgICBXW2ldID0gZ2FtbWEwICsgV1tpIC0gN10gKyBnYW1tYTEgKyBXW2kgLSAxNl07XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIHZhciBjaCAgPSAoZSAmIGYpIF4gKH5lICYgZyk7XG5cdCAgICAgICAgICAgICAgICB2YXIgbWFqID0gKGEgJiBiKSBeIChhICYgYykgXiAoYiAmIGMpO1xuXG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWEwID0gKChhIDw8IDMwKSB8IChhID4+PiAyKSkgXiAoKGEgPDwgMTkpIHwgKGEgPj4+IDEzKSkgXiAoKGEgPDwgMTApIHwgKGEgPj4+IDIyKSk7XG5cdCAgICAgICAgICAgICAgICB2YXIgc2lnbWExID0gKChlIDw8IDI2KSB8IChlID4+PiA2KSkgXiAoKGUgPDwgMjEpIHwgKGUgPj4+IDExKSkgXiAoKGUgPDwgNykgIHwgKGUgPj4+IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgIHZhciB0MSA9IGggKyBzaWdtYTEgKyBjaCArIEtbaV0gKyBXW2ldO1xuXHQgICAgICAgICAgICAgICAgdmFyIHQyID0gc2lnbWEwICsgbWFqO1xuXG5cdCAgICAgICAgICAgICAgICBoID0gZztcblx0ICAgICAgICAgICAgICAgIGcgPSBmO1xuXHQgICAgICAgICAgICAgICAgZiA9IGU7XG5cdCAgICAgICAgICAgICAgICBlID0gKGQgKyB0MSkgfCAwO1xuXHQgICAgICAgICAgICAgICAgZCA9IGM7XG5cdCAgICAgICAgICAgICAgICBjID0gYjtcblx0ICAgICAgICAgICAgICAgIGIgPSBhO1xuXHQgICAgICAgICAgICAgICAgYSA9ICh0MSArIHQyKSB8IDA7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBJbnRlcm1lZGlhdGUgaGFzaCB2YWx1ZVxuXHQgICAgICAgICAgICBIWzBdID0gKEhbMF0gKyBhKSB8IDA7XG5cdCAgICAgICAgICAgIEhbMV0gPSAoSFsxXSArIGIpIHwgMDtcblx0ICAgICAgICAgICAgSFsyXSA9IChIWzJdICsgYykgfCAwO1xuXHQgICAgICAgICAgICBIWzNdID0gKEhbM10gKyBkKSB8IDA7XG5cdCAgICAgICAgICAgIEhbNF0gPSAoSFs0XSArIGUpIHwgMDtcblx0ICAgICAgICAgICAgSFs1XSA9IChIWzVdICsgZikgfCAwO1xuXHQgICAgICAgICAgICBIWzZdID0gKEhbNl0gK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FdvcmRBcnJheSA9IENfbGliLldvcmRBcnJheTtcblx0ICAgIHZhciBIYXNoZXIgPSBDX2xpYi5IYXNoZXI7XG5cdCAgICB2YXIgQ194NjQgPSBDLng2NDtcblx0ICAgIHZhciBYNjRXb3JkID0gQ194NjQuV29yZDtcblx0ICAgIHZhciBDX2FsZ28gPSBDLmFsZ287XG5cblx0ICAgIC8vIENvbnN0YW50cyB0YWJsZXNcblx0ICAgIHZhciBSSE9fT0ZGU0VUUyA9IFtdO1xuXHQgICAgdmFyIFBJX0lOREVYRVMgID0gW107XG5cdCAgICB2YXIgUk9VTkRfQ09OU1RBTlRTID0gW107XG5cblx0ICAgIC8vIENvbXB1dGUgQ29uc3RhbnRzXG5cdCAgICAoZnVuY3Rpb24gKCkge1xuXHQgICAgICAgIC8vIENvbXB1dGUgcmhvIG9mZnNldCBjb25zdGFudHNcblx0ICAgICAgICB2YXIgeCA9IDEsIHkgPSAwO1xuXHQgICAgICAgIGZvciAodmFyIHQgPSAwOyB0IDwgMjQ7IHQrKykge1xuXHQgICAgICAgICAgICBSSE9fT0ZGU0VUU1t4ICsgNSAqIHldID0gKCh0ICsgMSkgKiAodCArIDIpIC8gMikgJSA2NDtcblxuXHQgICAgICAgICAgICB2YXIgbmV3WCA9IHkgJSA1O1xuXHQgICAgICAgICAgICB2YXIgbmV3WSA9ICgyICogeCArIDMgKiB5KSAlIDU7XG5cdCAgICAgICAgICAgIHggPSBuZXdYO1xuXHQgICAgICAgICAgICB5ID0gbmV3WTtcblx0ICAgICAgICB9XG5cblx0ICAgICAgICAvLyBDb21wdXRlIHBpIGluZGV4IGNvbnN0YW50c1xuXHQgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICBQSV9JTkRFWEVTW3ggKyA1ICogeV0gPSB5ICsgKCgyICogeCArIDMgKiB5KSAlIDUpICogNTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH1cblxuXHQgICAgICAgIC8vIENvbXB1dGUgcm91bmQgY29uc3RhbnRzXG5cdCAgICAgICAgdmFyIExGU1IgPSAweDAxO1xuXHQgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMjQ7IGkrKykge1xuXHQgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudE1zdyA9IDA7XG5cdCAgICAgICAgICAgIHZhciByb3VuZENvbnN0YW50THN3ID0gMDtcblxuXHQgICAgICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IDc7IGorKykge1xuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDAxKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGJpdFBvc2l0aW9uID0gKDEgPDwgaikgLSAxO1xuXHQgICAgICAgICAgICAgICAgICAgIGlmIChiaXRQb3NpdGlvbiA8IDMyKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRMc3cgXj0gMSA8PCBiaXRQb3NpdGlvbjtcblx0ICAgICAgICAgICAgICAgICAgICB9IGVsc2UgLyogaWYgKGJpdFBvc2l0aW9uID49IDMyKSAqLyB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHJvdW5kQ29uc3RhbnRNc3cgXj0gMSA8PCAoYml0UG9zaXRpb24gLSAzMik7XG5cdCAgICAgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgICAgICAvLyBDb21wdXRlIG5leHQgTEZTUlxuXHQgICAgICAgICAgICAgICAgaWYgKExGU1IgJiAweDgwKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gUHJpbWl0aXZlIHBvbHlub21pYWwgb3ZlciBHRigyKTogeF44ICsgeF42ICsgeF41ICsgeF40ICsgMVxuXHQgICAgICAgICAgICAgICAgICAgIExGU1IgPSAoTEZTUiA8PCAxKSBeIDB4NzE7X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XHQgICAgICAgICAgICBvdXRwdXRMZW5ndGg6IDUxMlxuXHQgICAgICAgIH0pLFxuXG5cdCAgICAgICAgX2RvUmVzZXQ6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGUgPSBbXVxuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI1OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHN0YXRlW2ldID0gbmV3IFg2NFdvcmQuaW5pdCgpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgdGhpcy5ibG9ja1NpemUgPSAoMTYwMCAtIDIgKiB0aGlzLmNmZy5vdXRwdXRMZW5ndGgpIC8gMzI7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIHN0YXRlID0gdGhpcy5fc3RhdGU7XG5cdCAgICAgICAgICAgIHZhciBuQmxvY2tTaXplTGFuZXMgPSB0aGlzLmJsb2NrU2l6ZSAvIDI7XG5cblx0ICAgICAgICAgICAgLy8gQWJzb3JiXG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbkJsb2NrU2l6ZUxhbmVzOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgdmFyIE0yaSAgPSBNW29mZnNldCArIDIgKiBpXTtcblx0ICAgICAgICAgICAgICAgIHZhciBNMmkxID0gTVtvZmZzZXQgKyAyICogaSArIDFdO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTd2FwIGVuZGlhblxuXHQgICAgICAgICAgICAgICAgTTJpID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCA4KSAgfCAoTTJpID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaSA8PCAyNCkgfCAoTTJpID4+PiA4KSkgICYgMHhmZjAwZmYwMClcblx0ICAgICAgICAgICAgICAgICk7XG5cdCAgICAgICAgICAgICAgICBNMmkxID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKE0yaTEgPDwgOCkgIHwgKE0yaTEgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgoTTJpMSA8PCAyNCkgfCAoTTJpMSA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBBYnNvcmIgbWVzc2FnZSBpbnRvIHN0YXRlXG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2ldO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5oaWdoIF49IE0yaTE7XG5cdCAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gTTJpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUm91bmRzXG5cdCAgICAgICAgICAgIGZvciAodmFyIHJvdW5kID0gMDsgcm91bmQgPCAyNDsgcm91bmQrKykge1xuXHQgICAgICAgICAgICAgICAgLy8gVGhldGFcblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gTWl4IGNvbHVtbiBsYW5lc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gMCwgdExzdyA9IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgeSA9IDA7IHkgPCA1OyB5KyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVt4ICsgNSAqIHldO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB0TXN3IF49IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdExzdyBePSBsYW5lLmxvdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUZW1wb3JhcnkgdmFsdWVzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4ID0gVFt4XTtcblx0ICAgICAgICAgICAgICAgICAgICBUeC5oaWdoID0gdE1zdztcblx0ICAgICAgICAgICAgICAgICAgICBUeC5sb3cgID0gdExzdztcblx0ICAgICAgICAgICAgICAgIH1cblx0ICAgICAgICAgICAgICAgIGZvciAodmFyIHggPSAwOyB4IDwgNTsgeCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4NCA9IFRbKHggKyA0KSAlIDVdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBUeDEgPSBUWyh4ICsgMSkgJSA1XTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVHgxTXN3ID0gVHgxLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxzdyA9IFR4MS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBNaXggc3Vycm91bmRpbmcgY29sdW1uc1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciB0TXN3ID0gVHg0LmhpZ2ggXiAoKFR4MU1zdyA8PCAxKSB8IChUeDFMc3cgPj4+IDMxKSk7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSBUeDQubG93ICBeICgoVHgxTHN3IDw8IDEpIHwgKFR4MU1zdyA+Pj4gMzEpKTtcblx0ICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciB5ID0gMDsgeSA8IDU7IHkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW3ggKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCBePSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICBsYW5lLmxvdyAgXj0gdExzdztcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBQaVxuXHQgICAgICAgICAgICAgICAgZm9yICh2YXIgbGFuZUluZGV4ID0gMTsgbGFuZUluZGV4IDwgMjU7IGxhbmVJbmRleCsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmUgPSBzdGF0ZVtsYW5lSW5kZXhdO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTXN3ID0gbGFuZS5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIHJob09mZnNldCA9IFJIT19PRkZTRVRTW2xhbmVJbmRleF07XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBSb3RhdGUgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICBpZiAocmhvT2Zmc2V0IDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZU1zdyA8PCByaG9PZmZzZXQpIHwgKGxhbmVMc3cgPj4+ICgzMiAtIHJob09mZnNldCkpO1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdExzdyA9IChsYW5lTHN3IDw8IHJob09mZnNldCkgfCAobGFuZU1zdyA+Pj4gKDMyIC0gcmhvT2Zmc2V0KSk7XG5cdCAgICAgICAgICAgICAgICAgICAgfSBlbHNlIC8qIGlmIChyaG9PZmZzZXQgPj0gMzIpICovIHtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRNc3cgPSAobGFuZUxzdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTXN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRMc3cgPSAobGFuZU1zdyA8PCAocmhvT2Zmc2V0IC0gMzIpKSB8IChsYW5lTHN3ID4+PiAoNjQgLSByaG9PZmZzZXQpKTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBUcmFuc3Bvc2UgbGFuZXNcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgVFBpTGFuZSA9IFRbUElfSU5ERVhFU1tsYW5lSW5kZXhdXTtcblx0ICAgICAgICAgICAgICAgICAgICBUUGlMYW5lLmhpZ2ggPSB0TXN3O1xuXHQgICAgICAgICAgICAgICAgICAgIFRQaUxhbmUubG93ICA9IHRMc3c7XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIFJobyBwaSBhdCB4ID0geSA9IDBcblx0ICAgICAgICAgICAgICAgIHZhciBUMCA9IFRbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgc3RhdGUwID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICBUMC5oaWdoID0gc3RhdGUwLmhpZ2g7XG5cdCAgICAgICAgICAgICAgICBUMC5sb3cgID0gc3RhdGUwLmxvdztcblxuXHQgICAgICAgICAgICAgICAgLy8gQ2hpXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciB4ID0gMDsgeCA8IDU7IHgrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgNTsgeSsrKSB7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0c1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZUluZGV4ID0geCArIDUgKiB5O1xuXHQgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGFuZSA9IHN0YXRlW2xhbmVJbmRleF07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUTGFuZSA9IFRbbGFuZUluZGV4XTtcblx0ICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFR4MUxhbmUgPSBUWygoeCArIDEpICUgNSkgKyA1ICogeV07XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIHZhciBUeDJMYW5lID0gVFsoKHggKyAyKSAlIDUpICsgNSAqIHldO1xuXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1peCByb3dzXG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUuaGlnaCA9IFRMYW5lLmhpZ2ggXiAoflR4MUxhbmUuaGlnaCAmIFR4MkxhbmUuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICAgICAgICAgIGxhbmUubG93ICA9IFRMYW5lLmxvdyAgXiAoflR4MUxhbmUubG93ICAmIFR4MkxhbmUubG93KTtcblx0ICAgICAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgICAgIC8vIElvdGFcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbMF07XG5cdCAgICAgICAgICAgICAgICB2YXIgcm91bmRDb25zdGFudCA9IFJPVU5EX0NPTlNUQU5UU1tyb3VuZF07XG5cdCAgICAgICAgICAgICAgICBsYW5lLmhpZ2ggXj0gcm91bmRDb25zdGFudC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgbGFuZS5sb3cgIF49IHJvdW5kQ29uc3RhbnQubG93Oztcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGRhdGEgPSB0aGlzLl9kYXRhO1xuXHQgICAgICAgICAgICB2YXIgZGF0YVdvcmRzID0gZGF0YS53b3Jkcztcblx0ICAgICAgICAgICAgdmFyIG5CaXRz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ICAgICAgICAgICAgIHZhciBsYW5lID0gc3RhdGVbaV07XG5cdCAgICAgICAgICAgICAgICB2YXIgbGFuZU1zdyA9IGxhbmUuaGlnaDtcblx0ICAgICAgICAgICAgICAgIHZhciBsYW5lTHN3ID0gbGFuZS5sb3c7XG5cblx0ICAgICAgICAgICAgICAgIC8vIFN3YXAgZW5kaWFuXG5cdCAgICAgICAgICAgICAgICBsYW5lTXN3ID0gKFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVNc3cgPDwgOCkgIHwgKGxhbmVNc3cgPj4+IDI0KSkgJiAweDAwZmYwMGZmKSB8XG5cdCAgICAgICAgICAgICAgICAgICAgKCgobGFuZU1zdyA8PCAyNCkgfCAobGFuZU1zdyA+Pj4gOCkpICAmIDB4ZmYwMGZmMDApXG5cdCAgICAgICAgICAgICAgICApO1xuXHQgICAgICAgICAgICAgICAgbGFuZUxzdyA9IChcblx0ICAgICAgICAgICAgICAgICAgICAoKChsYW5lTHN3IDw8IDgpICB8IChsYW5lTHN3ID4+PiAyNCkpICYgMHgwMGZmMDBmZikgfFxuXHQgICAgICAgICAgICAgICAgICAgICgoKGxhbmVMc3cgPDwgMjQpIHwgKGxhbmVMc3cgPj4+IDgpKSAgJiAweGZmMDBmZjAwKVxuXHQgICAgICAgICAgICAgICAgKTtcblxuXHQgICAgICAgICAgICAgICAgLy8gU3F1ZWV6ZSBzdGF0ZSB0byByZXRyaWV2ZSBoYXNoXG5cdCAgICAgICAgICAgICAgICBoYXNoV29yZHMucHVzaChsYW5lTHN3KTtcblx0ICAgICAgICAgICAgICAgIGhhc2hXb3Jkcy5wdXNoKGxhbmVNc3cpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gUmV0dXJuIGZpbmFsIGNvbXB1dGVkIGhhc2hcblx0ICAgICAgICAgICAgcmV0dXJuIG5ldyBXb3JkQXJyYXkuaW5pdChoYXNoV29yZHMsIG91dHB1dExlbmd0aEJ5dGVzKTtcblx0ICAgIC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Xb3JkLmluaXQoMHg1YmUwY2QxOSwgMHgxMzdlMjE3OSlcblx0ICAgICAgICAgICAgXSk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIF9kb1Byb2Nlc3NCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIEggPSB0aGlzLl9oYXNoLndvcmRzO1xuXG5cdCAgICAgICAgICAgIHZhciBIMCA9IEhbMF07XG5cdCAgICAgICAgICAgIHZhciBIMSA9IEhbMV07XG5cdCAgICAgICAgICAgIHZhciBIMiA9IEhbMl07XG5cdCAgICAgICAgICAgIHZhciBIMyA9IEhbM107XG5cdCAgICAgICAgICAgIHZhciBINCA9IEhbNF07XG5cdCAgICAgICAgICAgIHZhciBINSA9IEhbNV07XG5cdCAgICAgICAgICAgIHZhciBINiA9IEhbNl07XG5cdCAgICAgICAgICAgIHZhciBINyA9IEhbN107XG5cblx0ICAgICAgICAgICAgdmFyIEgwaCA9IEgwLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIMGwgPSBIMC5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIMWggPSBIMS5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDFsID0gSDEubG93O1xuXHQgICAgICAgICAgICB2YXIgSDJoID0gSDIuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEgybCA9IEgyLmxvdztcblx0ICAgICAgICAgICAgdmFyIEgzaCA9IEgzLmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBIM2wgPSBIMy5sb3c7XG5cdCAgICAgICAgICAgIHZhciBINGggPSBINC5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDRsID0gSDQubG93O1xuXHQgICAgICAgICAgICB2YXIgSDVoID0gSDUuaGlnaDtcblx0ICAgICAgICAgICAgdmFyIEg1bCA9IEg1Lmxvdztcblx0ICAgICAgICAgICAgdmFyIEg2aCA9IEg2LmhpZ2g7XG5cdCAgICAgICAgICAgIHZhciBINmwgPSBINi5sb3c7XG5cdCAgICAgICAgICAgIHZhciBIN2ggPSBINy5oaWdoO1xuXHQgICAgICAgICAgICB2YXIgSDdsID0gSDcubG93O1xuXG5cdCAgICAgICAgICAgIC8vIFdvcmtpbmcgdmFyaWFibGVzXG5cdCAgICAgICAgICAgIHZhciBhaCA9IEgwaDtcblx0ICAgICAgICAgICAgdmFyIGFsID0gSDBsO1xuXHQgICAgICAgICAgICB2YXIgYmggPSBIMWg7XG5cdCAgICAgICAgICAgIHZhciBibCA9IEgxbDtcblx0ICAgICAgICAgICAgdmFyIGNoID0gSDJoO1xuXHQgICAgICAgICAgICB2YXIgY2wgPSBIMmw7XG5cdCAgICAgICAgICAgIHZhciBkaCA9IEgzaDtcblx0ICAgICAgICAgICAgdmFyIGRsID0gSDNsO1xuXHQgICAgICAgICAgICB2YXIgZWggPSBINGg7XG5cdCAgICAgICAgICAgIHZhciBlbCA9IEg0bDtcblx0ICAgICAgICAgICAgdmFyIGZoID0gSDVoO1xuXHQgICAgICAgICAgICB2YXIgZmwgPSBINWw7XG5cdCAgICAgICAgICAgIHZhciBnaCA9IEg2aDtcblx0ICAgICAgICAgICAgdmFyIGdsID0gSDZsO1xuXHQgICAgICAgICAgICB2YXIgaGggPSBIN2g7XG5cdCAgICAgICAgICAgIHZhciBobCA9IEg3bDtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA4MDsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dFxuXHQgICAgICAgICAgICAgICAgdmFyIFdpID0gV1tpXTtcblxuXHQgICAgICAgICAgICAgICAgLy8gRXh0ZW5kIG1lc3NhZ2Vcblx0ICAgICAgICAgICAgICAgIGlmIChpIDwgMTYpIHtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgV2loID0gV2kuaGlnaCA9IE1bb2Zmc2V0ICsgaSAqIDJdICAgICB8IDA7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIFdpbCA9IFdpLmxvdyAgPSBNW29mZnNldCArIGkgKiAyICsgMV0gfCAwO1xuXHQgICAgICAgICAgICAgICAgfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTBcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEweCAgPSBXW2kgLSAxNV07XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMHhoID0gZ2FtbWEweC5oaWdoO1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTB4bCA9IGdhbW1hMHgubG93O1xuXHQgICAgICAgICAgICAgICAgICAgIHZhciBnYW1tYTBoICA9ICgoZ2FtbWEweGggPj4+IDEpIHwgKGdhbW1hMHhsIDw8IDMxKSkgXiAoKGdhbW1hMHhoID4+PiA4KSB8IChnYW1tYTB4bCA8PCAyNCkpIF4gKGdhbW1hMHhoID4+PiA3KTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWEwbCAgPSAoKGdhbW1hMHhsID4+PiAxKSB8IChnYW1tYTB4aCA8PCAzMSkpIF4gKChnYW1tYTB4bCA+Pj4gOCkgfCAoZ2FtbWEweGggPDwgMjQpKSBeICgoZ2FtbWEweGwgPj4+IDcpIHwgKGdhbW1hMHhoIDw8IDI1KSk7XG5cblx0ICAgICAgICAgICAgICAgICAgICAvLyBHYW1tYTFcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeCAgPSBXW2kgLSAyXTtcblx0ICAgICAgICAgICAgICAgICAgICB2YXIgZ2FtbWExeGggPSBnYW1tYTF4LmhpZ2g7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMXhsID0gZ2FtbWExeC5sb3c7XG5cdCAgICAgICAgICAgICAgICAgICAgdmFyIGdhbW1hMWggID0gKChnYW1tYTF4aCA+Pj4gMTkpIHwgKGdhbW1hMXhsIDw8IDEzKSkgXiAoKGdhbW1hMXhoIDw8IDMpIHwgKGdhbW1hMXhsID4+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+Pj4gMCkgPyAxIDogMCkpO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBfZG9GaW5hbGl6ZTogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLy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gICAgICAgIDB4ZTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMDogMHg4MjAyLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxODAwMDAwMDogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4MjgwMDAwMDA6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHgzODAwMDAwMDogMHg4MDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAwOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwMDogMHgyMDAsXG5cdCAgICAgICAgICAgIDB4NjgwMDAwMDA6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDc4MDAwMDAwOiAweDIsXG5cdCAgICAgICAgICAgIDB4ODgwMDAwMDA6IDB4ODAwMjAwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAwOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDAwMDA6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDAwOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhjODAwMDAwMDogMHg4MDAwMDIsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwMDA6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhlODAwMDAwMDogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDA6IDB4ODAwMDAwLFxuXHQgICAgICAgICAgICAweDE6IDB4ODAwMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwMTogMHgyLFxuXHQgICAgICAgICAgICAweDIwMDAwMDAxOiAweDgwODIwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDAwMDE6IDB4ODA4MDAyLFxuXHQgICAgICAgICAgICAweDUwMDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4NjAwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMTogMHg4MDgyMDIsXG5cdCAgICAgICAgICAgIDB4OTAwMDAwMDE6IDB4ODA4MDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDAxOiAweDgwMDAwMixcblx0ICAgICAgICAgICAgMHhiMDAwMDAwMTogMHg4MjAyLFxuXHQgICAgICAgICAgICAweGMwMDAwMDAxOiAweDIwMixcblx0ICAgICAgICAgICAgMHhkMDAwMDAwMTogMHg4MDAyMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwMDE6IDB4ODAwMixcblx0ICAgICAgICAgICAgMHhmMDAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE6IDB4ODA4MjAyLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAxOiAweDgwODAwMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwMTogMHg4MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzgwMDAwMDE6IDB4MjAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDAxOiAweDgwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDAwMDE6IDB4ODAwMDAyLFxuXHQgICAgICAgICAgICAweDY4MDAwMDAxOiAweDIsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDE6IDB4ODIwMixcblx0ICAgICAgICAgICAgMHg4ODAwMDAwMTogMHg4MDAyLFxuXHQgICAgICAgICAgICAweDk4MDAwMDAxOiAweDgwMDIwMixcblx0ICAgICAgICAgICAgMHhhODAwMDAwMTogMHgyMDIsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDE6IDB4ODA4MjAwLFxuXHQgICAgICAgICAgICAweGM4MDAwMDAxOiAweDgwMDIwMCxcblx0ICAgICAgICAgICAgMHhkODAwMDAwMTogMHgwLFxuXHQgICAgICAgICAgICAweGU4MDAwMDAxOiAweDgyMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwMDE6IDB4ODA4MDAyXG5cdCAgICAgICAgfSxcblx0ICAgICAgICB7XG5cdCAgICAgICAgICAgIDB4MDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHgxMDAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4MjAwMDAwMDogMHg4MDAwMCxcblx0ICAgICAgICAgICAgMHgzMDAwMDAwOiAweDQwMDgwMDEwLFxuXHQgICAgICAgICAgICAweDQwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4NTAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDAwOiAweDQwMDA0MDAwLFxuXHQgICAgICAgICAgICAweDcwMDAwMDA6IDB4MTAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDogMHg4NDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwMDAwOiAweDQwMDA0MDEwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDA6IDB4NDAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHhjMDAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweGQwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDA6IDB4NDAwMDQwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgyODAwMDAwOiAweDEwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDA6IDB4NDAwMDQwMTAsXG5cdCAgICAgICAgICAgIDB4NDgwMDAwMDogMHg0MDA4NDAxMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDAwOiAweDQwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDY4MDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHg4ODAwMDAwOiAweDgwMDEwLFxuXHQgICAgICAgICAgICAweDk4MDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhhODAwMDAwOiAweDQwMDAsXG5cdCAgICAgICAgICAgIDB4YjgwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHhjODAwMDAwOiAweDQwMDAwMDEwLFxuXHQgICAgICAgICAgICAweGQ4MDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHgxMTAwMDAwMDogMHg0MDA4MDAxMCxcblx0ICAgICAgICAgICAgMHgxMjAwMDAwMDogMHg0MDAwNDAxMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwMDogMHg0MDA4NDAwMCxcblx0ICAgICAgICAgICAgMHgxNDAwMDAwMDogMHg0MDA4MDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwMDAwMDogMHgxMCxcblx0ICAgICAgICAgICAgMHgxNjAwMDAwMDogMHg4NDAxMCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwMDogMHg0MDAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDAwOiAweDQwMTAsXG5cdCAgICAgICAgICAgIDB4MTkwMDAwMDA6IDB4ODAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwMDA6IDB4ODAwMTAsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDA6IDB4NDAwMDAwMTAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwMDA6IDB4ODQwMDAsXG5cdCAgICAgICAgICAgIDB4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5cdCAgICAgICAgICAgIDB4NDAwMDAwOiAweDEwMDA0LFxuXHQgICAgICAgICAgICAweDUwMDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDYwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDcwMDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDkwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweGEwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHhiMDAwMDA6IDB4NDAxMDAwNCxcblx0ICAgICAgICAgICAgMHhjMDAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHhkMDAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4ZjAwMDAwOiAweDEwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDI4MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDM4MDAwMDogMHg0MDAwMTAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDU4MDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHg2ODAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4NzgwMDAwOiAweDEwNCxcblx0ICAgICAgICAgICAgMHg4ODAwMDA6IDB4NCxcblx0ICAgICAgICAgICAgMHg5ODAwMDA6IDB4MTAwLFxuXHQgICAgICAgICAgICAweGE4MDAwMDogMHg0MDEwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHhjODAwMDA6IDB4MTAxMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDAwOiAweDQwMDAxMDQsXG5cdCAgICAgICAgICAgIDB4ZTgwMDAwOiAweDQwMTAxMDQsXG5cdCAgICAgICAgICAgIDB4ZjgwMDAwOiAweDQwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTAwMDAwMDogMHg0MDEwMTAwLFxuXHQgICAgICAgICAgICAweDExMDAwMDA6IDB4MTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwMDogMHgxMDAwMCxcblx0ICAgICAgICAgICAgMHgxMzAwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTQwMDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTUwMDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDE2MDAwMDA6IDB4NDAwMDAwNCxcblx0ICAgICAgICAgICAgMHgxNzAwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDAwMDogMHg0MDAwMTA0LFxuXHQgICAgICAgICAgICAweDE5MDAwMDA6IDB4NDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDAwOiAweDQsXG5cdCAgICAgICAgICAgIDB4MWIwMDAwMDogMHgxMDEwMCxcblx0ICAgICAgICAgICAgMHgxYzAwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWQwMDAwMDogMHgxMDQsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwMDogMHgxMDEwNCxcblx0ICAgICAgICAgICAgMHgxZjAwMDAwOiAweDQwMTAwMDQsXG5cdCAgICAgICAgICAgIDB4MTA4MDAwMDogMHg0MDAwMDAwLFxuXHQgICAgICAgICAgICAweDExODAwMDA6IDB4MTA0LFxuXHQgICAgICAgICAgICAweDEyODAwMDA6IDB4NDAxMDEwMCxcblx0ICAgICAgICAgICAgMHgxMzgwMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDAwMDogMHgxMDAwNCxcblx0ICAgICAgICAgICAgMHgxNTgwMDAwOiAweDQwMDAxMDAsXG5cdCAgICAgICAgICAgIDB4MTY4MDAwMDogMHgxMDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwMDogMHg0MDEwMDA0LFxuXHQgICAgICAgICAgICAweDE4ODAwMDA6IDB4MTAwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDAwMDogMHg0MDEwMTA0LFxuXHQgICAgICAgICAgICAweDFhODAwMDA6IDB4MTAxMDQsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwMDogMHg0MDAwMDA0LFxuXHQgICAgICAgICAgICAweDFjODAwMDA6IDB4NDAwMDEwNCxcblx0ICAgICAgICAgICAgMHgxZDgwMDAwOiAweDQwMTAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDAwMDogMHg0LFxuXHQgICAgICAgICAgICAweDFmODAwMDA6IDB4MTAxMDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwNDAxMDAwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDIwMDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgzMDAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHg0MDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDUwMDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg2MDAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHg3MDAwMDogMHg0MDAwNDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4OTAwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweGIwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweGMwMDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweGQwMDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4ZTAwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHhmMDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg4MDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDM4MDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHg1ODAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHg2ODAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDc4MDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDg4MDAwOiAweDEwMDAsXG5cdCAgICAgICAgICAgIDB4OTgwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweGI4MDAwOiAweDEwNDAsXG5cdCAgICAgICAgICAgIDB4YzgwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ZDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweGU4MDAwOiAweDQwMTA0MCxcblx0ICAgICAgICAgICAgMHhmODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxMDAwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDExMDAwMDogMHg0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTIwMDAwOiAweDgwMDAwMDQwLFxuXHQgICAgICAgICAgICAweDEzMDAwMDogMHgwLFxuXHQgICAgICAgICAgICAweDE0MDAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDE1MDAwMDogMHg4MDQwMDA0MCxcblx0ICAgICAgICAgICAgMHgxNjAwMDA6IDB4ODA0MDEwMDAsXG5cdCAgICAgICAgICAgIDB4MTcwMDAwOiAweDgwMDAxMDQwLFxuXHQgICAgICAgICAgICAweDE4MDAwMDogMHg4MDQwMTA0MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDA6IDB4ODAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWEwMDAwOiAweDgwNDAwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwMDogMHg0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MWMwMDAwOiAweDgwMDAxMDAwLFxuXHQgICAgICAgICAgICAweDFkMDAwMDogMHg0MDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWUwMDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDFmMDAwMDogMHgxMDAwLFxuXHQgICAgICAgICAgICAweDEwODAwMDogMHg4MDQwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMTgwMDA6IDB4ODA0MDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTI4MDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDAwOiAweDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxNDgwMDA6IDB4NDAwMDQwLFxuXHQgICAgICAgICAgICAweDE1ODAwMDogMHg4MDAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNjgwMDA6IDB4ODAwMDEwNDAsXG5cdCAgICAgICAgICAgIDB4MTc4MDAwOiAweDQwLFxuXHQgICAgICAgICAgICAweDE4ODAwMDogMHg4MDAwMDA0MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDA6IDB4MTAwMCxcblx0ICAgICAgICAgICAgMHgxYTgwMDA6IDB4ODAwMDEwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDAwOiAweDgwNDAwMDQwLFxuXHQgICAgICAgICAgICAweDFjODAwMDogMHgxMDQwLFxuXHQgICAgICAgICAgICAweDFkODAwMDogMHg4MDQwMTAwMCxcblx0ICAgICAgICAgICAgMHgxZTgwMDA6IDB4NDAwMDAwLFxuXHQgICAgICAgICAgICAweDFmODAwMDogMHg0MDEwNDBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgyMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDMwMDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NDAwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg1MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4NjAwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHg3MDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDgwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg5MDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweGEwMDA6IDB4MjAwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YjAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhjMDAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweGQwMDA6IDB4MCxcblx0ICAgICAgICAgICAgMHhlMDAwOiAweDEwNDAwODAsXG5cdCAgICAgICAgICAgIDB4ZjAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxODAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDI4MDA6IDB4ODAsXG5cdCAgICAgICAgICAgIDB4MzgwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4NTgwMDogMHgyMDA0MDA4MCxcblx0ICAgICAgICAgICAgMHg2ODAwOiAweDIxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDc4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODgwMDogMHgyMDA0MDAwMCxcblx0ICAgICAgICAgICAgMHg5ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4YTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHhiODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4YzgwMDogMHgyMDAwMDA4MCxcblx0ICAgICAgICAgICAgMHhkODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweGU4MDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHhmODAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDEwMDAwOiAweDQwMDAwLFxuXHQgICAgICAgICAgICAweDExMDAwOiAweDgwLFxuXHQgICAgICAgICAgICAweDEyMDAwOiAweDIwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEzMDAwOiAweDIxMDAwMDgwLFxuXHQgICAgICAgICAgICAweDE0MDAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MTUwMDA6IDB4MjEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTYwMDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTcwMDA6IDB4MTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxODAwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTAwMDogMHgyMTAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxYTAwMDogMHgxMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFiMDAwOiAweDIwMDQwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDAwOiAweDQwMDgwLFxuXHQgICAgICAgICAgICAweDFkMDAwOiAweDIwMDAwMDgwLFxuXHQgICAgICAgICAgICAweDFlMDAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxMDgwMDogMHgyMTAwMDA4MCxcblx0ICAgICAgICAgICAgMHgxMTgwMDogMHgxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEyODAwOiAweDEwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTM4MDA6IDB4MjAwNDAwODAsXG5cdCAgICAgICAgICAgIDB4MTQ4MDA6IDB4MjAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTU4MDA6IDB4MTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxNjgwMDogMHg4MCxcblx0ICAgICAgICAgICAgMHgxNzgwMDogMHgyMTA0MDAwMCxcblx0ICAgICAgICAgICAgMHgxODgwMDogMHg0MDA4MCxcblx0ICAgICAgICAgICAgMHgxOTgwMDogMHgyMTA0MDA4MCxcblx0ICAgICAgICAgICAgMHgxYTgwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFiODAwOiAweDIxMDAwMDAwLFxuXHQgICAgICAgICAgICAweDFjODAwOiAweDEwMDAwODAsXG5cdCAgICAgICAgICAgIDB4MWQ4MDA6IDB4NDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWU4MDA6IDB4MjAwNDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDA6IDB4MjAwMDAwODBcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDEwMDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweDIwMDogMHgxMDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgzMDA6IDB4MTAyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NDAwOiAweDEwMDAyMDAwLFxuXHQgICAgICAgICAgICAweDUwMDogMHgyMDAwMDAsXG5cdCAgICAgICAgICAgIDB4NjAwOiAweDIwMDAwOCxcblx0ICAgICAgICAgICAgMHg3MDA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwOiAweDAsXG5cdCAgICAgICAgICAgIDB4OTAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweGEwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4YjAwOiAweDgsXG5cdCAgICAgICAgICAgIDB4YzAwOiAweDEwMjAwMDA4LFxuXHQgICAgICAgICAgICAweGQwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZTAwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4ZjAwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweDgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgyODA6IDB4OCxcblx0ICAgICAgICAgICAgMHgzODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDQ4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4NTgwOiAweDEwMDAwMDA4LFxuXHQgICAgICAgICAgICAweDY4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHg3ODA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHg4ODA6IDB4MjAwMDA4LFxuXHQgICAgICAgICAgICAweDk4MDogMHgyMDAwLFxuXHQgICAgICAgICAgICAweGE4MDogMHgxMDAwMjAwOCxcblx0ICAgICAgICAgICAgMHhiODA6IDB4MTAyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4YzgwOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZDgwOiAweDEwMjAyMDAwLFxuXHQgICAgICAgICAgICAweGU4MDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4ZjgwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDEwMDA6IDB4MTAwMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwMDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxMjAwOiAweDEwMjAyMDA4LFxuXHQgICAgICAgICAgICAweDEzMDA6IDB4MjAwOCxcblx0ICAgICAgICAgICAgMHgxNDAwOiAweDIwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTAwOiAweDEwMDAwMDAwLFxuXHQgICAgICAgICAgICAweDE2MDA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTcwMDogMHgyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTgwMDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTkwMDogMHgwLFxuXHQgICAgICAgICAgICAweDFhMDA6IDB4OCxcblx0ICAgICAgICAgICAgMHgxYjAwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDFjMDA6IDB4MjAwMCxcblx0ICAgICAgICAgICAgMHgxZDAwOiAweDEwMDAyMDA4LFxuXHQgICAgICAgICAgICAweDFlMDA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWYwMDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTA4MDogMHg4LFxuXHQgICAgICAgICAgICAweDExODA6IDB4MjAyMDAwLFxuXHQgICAgICAgICAgICAweDEyODA6IDB4MjAwMDAwLFxuXHQgICAgICAgICAgICAweDEzODA6IDB4MTAwMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MTQ4MDogMHgxMDAwMjAwMCxcblx0ICAgICAgICAgICAgMHgxNTgwOiAweDIwMDgsXG5cdCAgICAgICAgICAgIDB4MTY4MDogMHgxMDIwMjAwOCxcblx0ICAgICAgICAgICAgMHgxNzgwOiAweDEwMjAwMDAwLFxuXHQgICAgICAgICAgICAweDE4ODA6IDB4MTAyMDIwMDAsXG5cdCAgICAgICAgICAgIDB4MTk4MDogMHgxMDIwMDAwOCxcblx0ICAgICAgICAgICAgMHgxYTgwOiAweDIwMDAsXG5cdCAgICAgICAgICAgIDB4MWI4MDogMHgyMDIwMDgsXG5cdCAgICAgICAgICAgIDB4MWM4MDogMHgyMDAwMDgsXG5cdCAgICAgICAgICAgIDB4MWQ4MDogMHgwLFxuXHQgICAgICAgICAgICAweDFlODA6IDB4MTAwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWY4MDogMHgxMDAwMjAwOFxuXHQgICAgICAgIH0sXG5cdCAgICAgICAge1xuXHQgICAgICAgICAgICAweDA6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDEwOiAweDIwMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MjA6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDMwOiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHg0MDogMHgyMTAwNDAxLFxuXHQgICAgICAgICAgICAweDUwOiAweDAsXG5cdCAgICAgICAgICAgIDB4NjA6IDB4MSxcblx0ICAgICAgICAgICAgMHg3MDogMHgyMTAwMDAxLFxuXHQgICAgICAgICAgICAweDgwOiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4OTA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweGEwOiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4YjA6IDB4MjEwMDQwMCxcblx0ICAgICAgICAgICAgMHhjMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweGQwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHhlMDogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4ZjA6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4OiAweDIxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTg6IDB4MCxcblx0ICAgICAgICAgICAgMHgyODogMHgyMDAwNDAxLFxuXHQgICAgICAgICAgICAweDM4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4NDg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDU4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Njg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHg3ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4ODg6IDB4MTAwNDAxLFxuXHQgICAgICAgICAgICAweDk4OiAweDIwMDA0MDAsXG5cdCAgICAgICAgICAgIDB4YTg6IDB4MjEwMDAwMCxcblx0ICAgICAgICAgICAgMHhiODogMHgxMDAwMDEsXG5cdCAgICAgICAgICAgIDB4Yzg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweGQ4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4ZTg6IDB4MSxcblx0ICAgICAgICAgICAgMHhmODogMHgxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTAwOiAweDIwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MTEwOiAweDEwMDAwMCxcblx0ICAgICAgICAgICAgMHgxMjA6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMzA6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxNDA6IDB4MTAwMDAxLFxuXHQgICAgICAgICAgICAweDE1MDogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDE2MDogMHgyMTAwNDAwLFxuXHQgICAgICAgICAgICAweDE3MDogMHgxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MTgwOiAweDQwMSxcblx0ICAgICAgICAgICAgMHgxOTA6IDB4MjEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxYTA6IDB4MTAwNDAwLFxuXHQgICAgICAgICAgICAweDFiMDogMHgxLFxuXHQgICAgICAgICAgICAweDFjMDogMHgwLFxuXHQgICAgICAgICAgICAweDFkMDogMHgyMTAwMDAwLFxuXHQgICAgICAgICAgICAweDFlMDogMHgyMDAwMDAxLFxuXHQgICAgICAgICAgICAweDFmMDogMHg0MDAsXG5cdCAgICAgICAgICAgIDB4MTA4OiAweDEwMDQwMCxcblx0ICAgICAgICAgICAgMHgxMTg6IDB4MjAwMDQwMSxcblx0ICAgICAgICAgICAgMHgxMjg6IDB4MjEwMDAwMSxcblx0ICAgICAgICAgICAgMHgxMzg6IDB4MSxcblx0ICAgICAgICAgICAgMHgxNDg6IDB4MjAwMDAwMCxcblx0ICAgICAgICAgICAgMHgxNTg6IDB4MTAwMDAwLFxuXHQgICAgICAgICAgICAweDE2ODogMHg0MDEsXG5cdCAgICAgICAgICAgIDB4MTc4OiAweDIxMDA0MDAsXG5cdCAgICAgICAgICAgIDB4MTg4OiAweDIwMDAwMDEsXG5cdCAgICAgICAgICAgIDB4MTk4OiAweDIxMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MWE4OiAweDAsXG5cdCAgICAgICAgICAgIDB4MWI4OiAweDIxMDA0MDEsXG5cdCAgICAgICAgICAgIDB4MWM4OiAweDEwMDQwMSxcblx0ICAgICAgICAgICAgMHgxZDg6IDB4NDAwLFxuXHQgICAgICAgICAgICAweDFlODogMHgyMDAwNDAwLFxuXHQgICAgICAgICAgICAweDFmODogMHgxMDAwMDFcblx0ICAgICAgICB9LFxuXHQgICAgICAgIHtcblx0ICAgICAgICAgICAgMHgwOiAweDgwMDA4MjAsXG5cdCAgICAgICAgICAgIDB4MTogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgyOiAweDgwMDAwMDAsXG5cdCAgICAgICAgICAgIDB4MzogMHgyMCxcblx0ICAgICAgICAgICAgMHg0OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDU6IDB4ODAyMDgyMCxcblx0ICAgICAgICAgICAgMHg2OiAweDgwMjA4MDAsXG5cdCAgICAgICAgICAgIDB4NzogMHg4MDAsXG5cdCAgICAgICAgICAgIDB4ODogMHg4MDIwMDAwLFxuXHQgICAgICAgICAgICAweDk6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHhhOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweGI6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHhjOiAweDgyMCxcblx0ICAgICAgICAgICAgMHhkOiAweDAsXG5cdCAgICAgICAgICAgIDB4ZTogMHg4MDAwMDIwLFxuXHQgICAgICAgICAgICAweGY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDA6IDB4ODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDAxOiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwMzogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDA0OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDU6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDY6IDB4MjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDc6IDB4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMDg6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwOTogMHg4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGE6IDB4MjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGI6IDB4ODAyMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwYzogMHgwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDBkOiAweDgwMjAwMjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMGU6IDB4ODAwMDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAwZjogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxMDogMHgyMDgyMCxcblx0ICAgICAgICAgICAgMHgxMTogMHg4MDIwODAwLFxuXHQgICAgICAgICAgICAweDEyOiAweDIwLFxuXHQgICAgICAgICAgICAweDEzOiAweDgwMCxcblx0ICAgICAgICAgICAgMHgxNDogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDE1OiAweDgwMDAwMjAsXG5cdCAgICAgICAgICAgIDB4MTY6IDB4ODAyMDAyMCxcblx0ICAgICAgICAgICAgMHgxNzogMHgyMDAwMCxcblx0ICAgICAgICAgICAgMHgxODogMHgwLFxuXHQgICAgICAgICAgICAweDE5OiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDFhOiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4MWI6IDB4ODAwMDgyMCxcblx0ICAgICAgICAgICAgMHgxYzogMHg4MDIwODIwLFxuXHQgICAgICAgICAgICAweDFkOiAweDIwODAwLFxuXHQgICAgICAgICAgICAweDFlOiAweDgyMCxcblx0ICAgICAgICAgICAgMHgxZjogMHg4MDAwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEwOiAweDIwMDAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDExOiAweDgwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxMjogMHg4MDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDEzOiAweDIwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE0OiAweDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE1OiAweDgwMjAwMDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTY6IDB4ODAwMDAwMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxNzogMHg4MDAwODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDE4OiAweDgwMjA4MjAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMTk6IDB4ODAwMDAyMCxcblx0ICAgICAgICAgICAgMHg4MDAwMDAxYTogMHg4MDAwODAwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFiOiAweDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWM6IDB4MjA4MDAsXG5cdCAgICAgICAgICAgIDB4ODAwMDAwMWQ6IDB4ODIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFlOiAweDIwMDIwLFxuXHQgICAgICAgICAgICAweDgwMDAwMDFmOiAweDgwMjA4MDBcblx0ICAgICAgICB9XG5cdCAgICBdO1xuXG5cdCAgICAvLyBNYXNrcyB0aGF0IHNlbGVjdCB0aGUgU0JPWCBpbnB1dFxuXHQgICAgdmFyIFNCT1hfTUFTSyA9IFtcblx0ICAgICAgICAweGY4MDAwMDAxLCAweDFmODAwMDAwLCAweDAxZjgwMDAwLCAweDAwMWY4MDAwLFxuXHQgICAgICAgIDB4MDAwMWY4MDAsIDB4MDAwMDFmODAsIDB4MDAwMDAxZjgsIDB4ODAwMDAwMWZcblx0ICAgIF07XG5cblx0ICAgIC8qKlxuXHQgICAgICogREVTIGJsb2NrIGNpcGhlciBhbGdvcml0aG0uXG5cdCAgICAgKi9cblx0ICAgIHZhciBERVMgPSBDX2FsZ28uREVTID0gQmxvY2tDaXBoZXIuZXh0ZW5kKHtcblx0ICAgICAgICBfZG9SZXNldDogZnVuY3Rpb24gKCkge1xuXHQgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgdmFyIGtleSA9IHRoaXMuX2tleTtcblx0ICAgICAgICAgICAgdmFyIGtleVdvcmRzID0ga2V5LndvcmRzO1xuXG5cdCAgICAgICAgICAgIC8vIFNlbGVjdCA1NiBiaXRzIGFjY29yZGluZyB0byBQQzFcblx0ICAgICAgICAgICAgdmFyIGtleUJpdHMgPSBbXTtcblx0ICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCA1NjsgaSsrKSB7XG5cdCAgICAgICAgICAgICAgICB2YXIga2V5Qml0UG9zID0gUEMxW2ldIC0gMTtcblx0ICAgICAgICAgICAgICAgIGtleUJpdHNbaV0gPSAoa2V5V29yZHNba2V5Qml0UG9zID4+PiA1XSA+Pj4gKDMxIC0ga2V5Qml0UG9zICUgMzIpKSAmIDE7XG5cdCAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAvLyBBc3NlbWJsZSAxNiBzdWJrZXlzXG5cdCAgICAgICAgICAgIHZhciBzdWJLZXlzID0gdGhpcy5fc3ViS2V5cyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBuU3ViS2V5ID0gMDsgblN1YktleSA8IDE2OyBuU3ViS2V5KyspIHtcblx0ICAgICAgICAgICAgICAgIC8vIENyZWF0ZSBzdWJrZXlcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW25TdWJLZXldID0gW107XG5cblx0ICAgICAgICAgICAgICAgIC8vIFNob3J0Y3V0XG5cdCAgICAgICAgICAgICAgICB2YXIgYml0U2hpZnQgPSBCSVRfU0hJRlRTW25TdWJLZXldO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBTZWxlY3QgNDggYml0cyBhY2NvcmRpbmcgdG8gUEMyXG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDI0OyBpKyspIHtcblx0ICAgICAgICAgICAgICAgICAgICAvLyBTZWxlY3QgZnJvbSB0aGUgbGVmdCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVsoaSAvIDYpIHwgMF0gfD0ga2V5Qml0c1soKFBDMltpXSAtIDEpICsgYml0U2hpZnQpICUgMjhdIDw8ICgzMSAtIGkgJSA2KTtcblxuXHQgICAgICAgICAgICAgICAgICAgIC8vIFNlbGVjdCBmcm9tIHRoZSByaWdodCAyOCBrZXkgYml0c1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVs0ICsgKChpIC8gNikgfCAwKV0gfD0ga2V5Qml0c1syOCArICgoKFBDMltpICsgMjRdIC0gMSkgKyBiaXRTaGlmdCkgJSAyOCldIDw8ICgzMSAtIGkgJSA2KTtcblx0ICAgICAgICAgICAgICAgIH1cblxuXHQgICAgICAgICAgICAgICAgLy8gU2luY2UgZWFjaCBzdWJrZXkgaXMgYXBwbGllZCB0byBhbiBleHBhbmRlZCAzMi1iaXQgaW5wdXQsXG5cdCAgICAgICAgICAgICAgICAvLyB0aGUgc3Via2V5IGNhbiBiZSBicm9rZW4gaW50byA4IHZhbHVlcyBzY2FsZWQgdG8gMzItYml0cyxcblx0ICAgICAgICAgICAgICAgIC8vIHdoaWNoIGFsbG93cyB0aGUga2V5IHRvIGJlIHVzZWQgd2l0aG91dCBleHBhbnNpb25cblx0ICAgICAgICAgICAgICAgIHN1YktleVswXSA9IChzdWJLZXlbMF0gPDwgMSkgfCAoc3ViS2V5WzBdID4+PiAzMSk7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMTsgaSA8IDc7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIHN1YktleVtpXSA9IHN1YktleVtpXSA+Pj4gKChpIC0gMSkgKiA0ICsgMyk7XG5cdCAgICAgICAgICAgICAgICB9XG5cdCAgICAgICAgICAgICAgICBzdWJLZXlbN10gPSAoc3ViS2V5WzddIDw8IDUpIHwgKHN1YktleVs3XSA+Pj4gMjcpO1xuXHQgICAgICAgICAgICB9XG5cblx0ICAgICAgICAgICAgLy8gQ29tcHV0ZSBpbnZlcnNlIHN1YmtleXNcblx0ICAgICAgICAgICAgdmFyIGludlN1YktleXMgPSB0aGlzLl9pbnZTdWJLZXlzID0gW107XG5cdCAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgMTY7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgaW52U3ViS2V5c1tpXSA9IHN1YktleXNbMTUgLSBpXTtcblx0ICAgICAgICAgICAgfVxuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBlbmNyeXB0QmxvY2s6IGZ1bmN0aW9uIChNLCBvZmZzZXQpIHtcblx0ICAgICAgICAgICAgdGhpcy5fZG9DcnlwdEJsb2NrKE0sIG9mZnNldCwgdGhpcy5fc3ViS2V5cyk7XG5cdCAgICAgICAgfSxcblxuXHQgICAgICAgIGRlY3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCkge1xuXHQgICAgICAgICAgICB0aGlzLl9kb0NyeXB0QmxvY2soTSwgb2Zmc2V0LCB0aGlzLl9pbnZTdWJLZXlzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgX2RvQ3J5cHRCbG9jazogZnVuY3Rpb24gKE0sIG9mZnNldCwgc3ViS2V5cykge1xuXHQgICAgICAgICAgICAvLyBHZXQgaW5wdXRcblx0ICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gTVtvZmZzZXRdO1xuXHQgICAgICAgICAgICB0aGlzLl9yQmxvY2sgPSBNW29mZnNldCArIDFdO1xuXG5cdCAgICAgICAgICAgIC8vIEluaXRpYWwgcGVybXV0YXRpb25cblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDQsICAweDBmMGYwZjBmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDE2LCAweDAwMDBmZmZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDIsICAweDMzMzMzMzMzKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VSTC5jYWxsKHRoaXMsIDgsICAweDAwZmYwMGZmKTtcblx0ICAgICAgICAgICAgZXhjaGFuZ2VMUi5jYWxsKHRoaXMsIDEsICAweDU1NTU1NTU1KTtcblxuXHQgICAgICAgICAgICAvLyBSb3VuZHNcblx0ICAgICAgICAgICAgZm9yICh2YXIgcm91bmQgPSAwOyByb3VuZCA8IDE2OyByb3VuZCsrKSB7XG5cdCAgICAgICAgICAgICAgICAvLyBTaG9ydGN1dHNcblx0ICAgICAgICAgICAgICAgIHZhciBzdWJLZXkgPSBzdWJLZXlzW3JvdW5kXTtcblx0ICAgICAgICAgICAgICAgIHZhciBsQmxvY2sgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgICAgICB2YXIgckJsb2NrID0gdGhpcy5fckJsb2NrO1xuXG5cdCAgICAgICAgICAgICAgICAvLyBGZWlzdGVsIGZ1bmN0aW9uXG5cdCAgICAgICAgICAgICAgICB2YXIgZiA9IDA7XG5cdCAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IDg7IGkrKykge1xuXHQgICAgICAgICAgICAgICAgICAgIGYgfD0gU0JPWF9QW2ldWygockJsb2NrIF4gc3ViS2V5W2ldKSAmIFNCT1hfTUFTS1tpXSkgPj4+IDBdO1xuXHQgICAgICAgICAgICAgICAgfVxuXHQgICAgICAgICAgICAgICAgdGhpcy5fbEJsb2NrID0gckJsb2NrO1xuXHQgICAgICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gbEJsb2NrIF4gZjtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIC8vIFVuZG8gc3dhcCBmcm9tIGxhc3Qgcm91bmRcblx0ICAgICAgICAgICAgdmFyIHQgPSB0aGlzLl9sQmxvY2s7XG5cdCAgICAgICAgICAgIHRoaXMuX2xCbG9jayA9IHRoaXMuX3JCbG9jaztcblx0ICAgICAgICAgICAgdGhpcy5fckJsb2NrID0gdDtcblxuXHQgICAgICAgICAgICAvLyBGaW5hbCBwZXJtdXRhdGlvblxuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMSwgIDB4NTU1NTU1NTUpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgOCwgIDB4MDBmZjAwZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZVJMLmNhbGwodGhpcywgMiwgIDB4MzMzMzMzMzMpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgMTYsIDB4MDAwMGZmZmYpO1xuXHQgICAgICAgICAgICBleGNoYW5nZUxSLmNhbGwodGhpcywgNCwgIDB4MGYwZjBmMGYpO1xuXG5cdCAgICAgICAgICAgIC8vIFNldCBvdXRwdXRcblx0ICAgICAgICAgICAgTVtvZmZzZXRdID0gdGhpcy5fbEJsb2NrO1xuXHQgICAgICAgICAgICBNW29mZnNldCArIDFdID0gdGhpcy5fckJsb2NrO1xuXHQgICAgICAgIH0sXG5cblx0ICAgICAgICBrZXlTaXplOiA2NC8zMixcblxuXHQgICAgICAgIGl2U2l6ZTogNjQvMzIsXG5cblx0ICAgICAgICBibG9ja1NpemU6IDY0LzMyXG5cdCAgICB9KTtcblxuXHQgICAgLy8gU3dhcCBiaXRzIGFjcm9zcyB0aGUgbGVmdCBhbmQgcmlnaHQgd29y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gICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYW5kZWQgPSB4NjRXb3JkLmFuZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gYW5kOiBmdW5jdGlvbiAod29yZCkge1xuXHQgICAgICAgICAgICAvLyB2YXIgaGlnaCA9IHRoaXMuaGlnaCAmIHdvcmQuaGlnaDtcblx0ICAgICAgICAgICAgLy8gdmFyIGxvdyA9IHRoaXMubG93ICYgd29yZC5sb3c7XG5cblx0ICAgICAgICAgICAgLy8gcmV0dXJuIFg2NFdvcmQuY3JlYXRlKGhpZ2gsIGxvdyk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEJpdHdpc2UgT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gT1Igd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgT1JpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBvcmVkID0geDY0V29yZC5vcihhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgLy8gb3I6IGZ1bmN0aW9uICh3b3JkKSB7XG5cdCAgICAgICAgICAgIC8vIHZhciBoaWdoID0gdGhpcy5oaWdoIHwgd29yZC5oaWdoO1xuXHQgICAgICAgICAgICAvLyB2YXIgbG93ID0gdGhpcy5sb3cgfCB3b3JkLmxvdztcblxuXHQgICAgICAgICAgICAvLyByZXR1cm4gWDY0V29yZC5jcmVhdGUoaGlnaCwgbG93KTtcblx0ICAgICAgICAvLyB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQml0d2lzZSBYT1JzIHRoaXMgd29yZCB3aXRoIHRoZSBwYXNzZWQgd29yZC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7WDY0V29yZH0gd29yZCBUaGUgeDY0LVdvcmQgdG8gWE9SIHdpdGggdGhpcyB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIFhPUmluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBleGFtcGxlXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiAgICAgdmFyIHhvcmVkID0geDY0V29yZC54b3IoYW5vdGhlclg2NFdvcmQpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIC8vIHhvcjogZnVuY3Rpb24gKHdvcmQpIHtcblx0ICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSB0aGlzLmhpZ2ggXiB3b3JkLmhpZ2g7XG5cdCAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmxvdyBeIHdvcmQubG93O1xuXG5cdCAgICAgICAgICAgIC8vIHJldHVybiBYNjRXb3JkLmNyZWF0ZShoaWdoLCBsb3cpO1xuXHQgICAgICAgIC8vIH0sXG5cblx0ICAgICAgICAvKipcblx0ICAgICAgICAgKiBTaGlmdHMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgbGVmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBuIFRoZSBudW1iZXIgb2YgYml0cyB0byBzaGlmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEByZXR1cm4ge1g2NFdvcmR9IEEgbmV3IHg2NC1Xb3JkIG9iamVjdCBhZnRlciBzaGlmdGluZy5cblx0ICAgICAgICAgKlxuXHQgICAgICAgIC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blx0ICAgICAgICAvLyBzaGlmdFI6IGZ1bmN0aW9uIChuKSB7XG5cdCAgICAgICAgICAgIC8vIGlmIChuIDwgMzIpIHtcblx0ICAgICAgICAgICAgICAgIC8vIHZhciBsb3cgPSAodGhpcy5sb3cgPj4+IG4pIHwgKHRoaXMuaGlnaCA8PCAoMzIgLSBuKSk7XG5cdCAgICAgICAgICAgICAgICAvLyB2YXIgaGlnaCA9IHRoaXMuaGlnaCA+Pj4gbjtcblx0ICAgICAgICAgICAgLy8gfSBlbHNlIHtcblx0ICAgICAgICAgICAgICAgIC8vIHZhciBsb3cgPSB0aGlzLmhpZ2ggPj4+IChuIC0gMzIpO1xuXHQgICAgICAgICAgICAgICAgLy8gdmFyIGhpZ2ggPSAwO1xuXHQgICAgICAgICAgICAvLyB9XG5cblx0ICAgICAgICAgICAgLy8gcmV0dXJuIFg2NFdvcmQuY3JlYXRlKGhpZ2gsIGxvdyk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgbGVmdC5cblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqIEBwYXJhbSB7bnVtYmVyfSBuIFRoZSBudW1iZXIgb2YgYml0cyB0byByb3RhdGUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgcm90YXRpbmcuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciByb3RhdGVkID0geDY0V29yZC5yb3RMKDI1KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RMOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdEwobikub3IodGhpcy5zaGlmdFIoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIFJvdGF0ZXMgdGhpcyB3b3JkIG4gYml0cyB0byB0aGUgcmlnaHQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcGFyYW0ge251bWJlcn0gbiBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gcm90YXRlLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZH0gQSBuZXcgeDY0LVdvcmQgb2JqZWN0IGFmdGVyIHJvdGF0aW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgcm90YXRlZCA9IHg2NFdvcmQucm90Uig3KTtcblx0ICAgICAgICAgKi9cblx0ICAgICAgICAvLyByb3RSOiBmdW5jdGlvbiAobikge1xuXHQgICAgICAgICAgICAvLyByZXR1cm4gdGhpcy5zaGlmdFIobikub3IodGhpcy5zaGlmdEwoNjQgLSBuKSk7XG5cdCAgICAgICAgLy8gfSxcblxuXHQgICAgICAgIC8qKlxuXHQgICAgICAgICAqIEFkZHMgdGhpcyB3b3JkIHdpdGggdGhlIHBhc3NlZCB3b3JkLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHBhcmFtIHtYNjRXb3JkfSB3b3JkIFRoZSB4NjQtV29yZCB0byBhZGQgd2l0aCB0aGlzIHdvcmQuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAcmV0dXJuIHtYNjRXb3JkfSBBIG5ldyB4NjQtV29yZCBvYmplY3QgYWZ0ZXIgYWRkaW5nLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgYWRkZWQgPSB4NjRXb3JkLmFkZChhbm90aGVyWDY0V29yZCk7XG5cdCAgICAgICAgICovXG5cdCAgICA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2lnbmlmaWNhbnQgYnl0ZXMgaW4gdGhlIHdvcmRzLlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoKTtcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgd29yZEFycmF5ID0gQ3J5cHRvSlMueDY0LldvcmRBcnJheS5jcmVhdGUoW1xuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MDAwMTAyMDMsIDB4MDQwNTA2MDcpLFxuXHQgICAgICAgICAqICAgICAgICAgQ3J5cHRvSlMueDY0LldvcmQuY3JlYXRlKDB4MTgxOTFhMWIsIDB4MWMxZDFlMWYpXG5cdCAgICAgICAgICogICAgIF0pO1xuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciB3b3JkQXJyYXkgPSBDcnlwdG9KUy54NjQuV29yZEFycmF5LmNyZWF0ZShbXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgwMDAxMDIwMywgMHgwNDA1MDYwNyksXG5cdCAgICAgICAgICogICAgICAgICBDcnlwdG9KUy54NjQuV29yZC5jcmVhdGUoMHgxODE5MWExYiwgMHgxYzFkMWUxZilcblx0ICAgICAgICAgKiAgICAgXSwgMTApO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGluaXQ6IGZ1bmN0aW9uICh3b3Jkcywgc2lnQnl0ZXMpIHtcblx0ICAgICAgICAgICAgd29yZHMgPSB0aGlzLndvcmRzID0gd29yZHMgfHwgW107XG5cblx0ICAgICAgICAgICAgaWYgKHNpZ0J5dGVzICE9IHVuZGVmaW5lZCkge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHNpZ0J5dGVzO1xuXHQgICAgICAgICAgICB9IGVsc2Uge1xuXHQgICAgICAgICAgICAgICAgdGhpcy5zaWdCeXRlcyA9IHdvcmRzLmxlbmd0aCAqIDg7XG5cdCAgICAgICAgICAgIH1cblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ29udmVydHMgdGhpcyA2NC1iaXQgd29yZCBhcnJheSB0byBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7Q3J5cHRvSlMubGliLldvcmRBcnJheX0gVGhpcyB3b3JkIGFycmF5J3MgZGF0YSBhcyBhIDMyLWJpdCB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQGV4YW1wbGVcblx0ICAgICAgICAgKlxuXHQgICAgICAgICAqICAgICB2YXIgeDMyV29yZEFycmF5ID0geDY0V29yZEFycmF5LnRvWDMyKCk7XG5cdCAgICAgICAgICovXG5cdCAgICAgICAgdG9YMzI6IGZ1bmN0aW9uICgpIHtcblx0ICAgICAgICAgICAgLy8gU2hvcnRjdXRzXG5cdCAgICAgICAgICAgIHZhciB4NjRXb3JkcyA9IHRoaXMud29yZHM7XG5cdCAgICAgICAgICAgIHZhciB4NjRXb3Jkc0xlbmd0aCA9IHg2NFdvcmRzLmxlbmd0aDtcblxuXHQgICAgICAgICAgICAvLyBDb252ZXJ0XG5cdCAgICAgICAgICAgIHZhciB4MzJXb3JkcyA9IFtdO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHg2NFdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHZhciB4NjRXb3JkID0geDY0V29yZHNbaV07XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQuaGlnaCk7XG5cdCAgICAgICAgICAgICAgICB4MzJXb3Jkcy5wdXNoKHg2NFdvcmQubG93KTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBYMzJXb3JkQXJyYXkuY3JlYXRlKHgzMldvcmRzLCB0aGlzLnNpZ0J5dGVzKTtcblx0ICAgICAgICB9LFxuXG5cdCAgICAgICAgLyoqXG5cdCAgICAgICAgICogQ3JlYXRlcyBhIGNvcHkgb2YgdGhpcyB3b3JkIGFycmF5LlxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogQHJldHVybiB7WDY0V29yZEFycmF5fSBUaGUgY2xvbmUuXG5cdCAgICAgICAgICpcblx0ICAgICAgICAgKiBAZXhhbXBsZVxuXHQgICAgICAgICAqXG5cdCAgICAgICAgICogICAgIHZhciBjbG9uZSA9IHg2NFdvcmRBcnJheS5jbG9uZSgpO1xuXHQgICAgICAgICAqL1xuXHQgICAgICAgIGNsb25lOiBmdW5jdGlvbiAoKSB7XG5cdCAgICAgICAgICAgIHZhciBjbG9uZSA9IEJhc2UuY2xvbmUuY2FsbCh0aGlzKTtcblxuXHQgICAgICAgICAgICAvLyBDbG9uZSBcIndvcmRzXCIgYXJyYXlcblx0ICAgICAgICAgICAgdmFyIHdvcmRzID0gY2xvbmUud29yZHMgPSB0aGlzLndvcmRzLnNsaWNlKDApO1xuXG5cdCAgICAgICAgICAgIC8vIENsb25lIGVhY2ggWDY0V29yZCBvYmplY3Rcblx0ICAgICAgICAgICAgdmFyIHdvcmRzTGVuZ3RoID0gd29yZHMubGVuZ3RoO1xuXHQgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHdvcmRzTGVuZ3RoOyBpKyspIHtcblx0ICAgICAgICAgICAgICAgIHdvcmRzW2ldID0gd29yZHNbaV0uY2xvbmUoKTtcblx0ICAgICAgICAgICAgfVxuXG5cdCAgICAgICAgICAgIHJldHVybiBjbG9uZTtcblx0ICAgICAgICB9XG5cdCAgICB9KTtcblx0fSgpKTtcblxuXG5cdHJldHVybiBDcnlwdG9KUztcblxufSkpOyIsIihmdW5jdGlvbiAoc2VsZikge1xuICAndXNlIHN0cmlj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AgICAgICAgICB9XG4gICAgICAgICAgfSkoKSxcbiAgICAgICAgICBmb3JtRGF0YTogJ0Zvcm1EYXRhJyBpbiBzZWxmLFxuICAgICAgICAgIGFycmF5QnVmZmVyOiAnQXJyYXlCdWZmZXInIGluIHNlbGZcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChzdXBwb3J0LmFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgdmFyIHZpZXdDbGFzc2VzID0gW1xuICAgICAgICAgICAgJ1tvYmplY3QgSW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OEFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBVaW50OENsYW1wZWRBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgSW50MTZBcnJheV0nLFxuICAgICAgICAgICAgJ1tvYmplY3QgVWludDE2QXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEludDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IFVpbnQzMkFycmF5XScsXG4gICAgICAgICAgICAnW29iamVjdCBGbG9hdDMyQXJyYXldJyxcbiAgICAgICAgICAgICdbb2JqZWN0IEZsb2F0NjRBcnJheV0nXG4gICAgICAgICAgXVxuXG4gICAgICAgICAgdmFyIGlzRGF0YVZpZXcgPSBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgRGF0YVZpZXcucHJvdG90eXBlLmlzUHJvdG90eXBlT2Yob2JqKVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHZhciBpc0FycmF5QnVmZmVyVmlldyA9IEFycmF5QnVmZmVyLmlzVmlldyB8fCBmdW5jdGlvbihvYmopIHtcbiAgICAgICAgICAgIHJldHVybiBvYmogJiYgdmlld0NsYXNzZXMuaW5kZXhPZihPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwob2JqKSkgPiAtMVxuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bm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1lZChib2R5KSB7XG4gICAgICAgICAgaWYgKGJvZHkuYm9keVVzZWQpIHtcbiAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgVHlwZUVycm9yKCdBbHJlYWR5IHJlYWQnKSlcbiAgICAgICAgICB9XG4gICAgICAgICAgYm9keS5ib2R5VXNlZCA9IHRydWVcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpIHtcbiAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlc29sdmUocmVhZGVyLnJlc3VsdClcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJlYWRlci5vbmVycm9yID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIHJlamVjdChyZWFkZXIuZXJyb3IpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNBcnJheUJ1ZmZlcihibG9iKSB7XG4gICAgICAgICAgdmFyIHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKClcbiAgICAgICAgICB2YXIgcHJvbWlzZSA9IGZpbGVSZWFkZXJSZWFkeShyZWFkZXIpXG4gICAgICAgICAgcmVhZGVyLnJlYWRBc0FycmF5QnVmZmVyKGJsb2IpXG4gICAgICAgICAgcmV0dXJuIHByb21pc2VcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHJlYWRCbG9iQXNUZXh0KGJsb2IpIHtcbiAgICAgICAgICB2YXIgcmVhZGVyID0gbmV3IEZpbGVSZWFkZXIoKVxuICAgICAgICAgIHZhciBwcm9taXNlID0gZmlsZVJlYWRlclJlYWR5KHJlYWRlcilcbiAgICAgICAgICByZWFkZXIucmVhZEFzVGV4dChibG9iKVxuICAgICAgICAgIHJldHVybiBwcm9taXNlXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiByZWFkQXJyYXlCdWZmZXJBc1RleHQoYnVmKSB7XG4gICAgICAgICAgdmFyIHZpZXcgPSBuZXcgVWludDhBcnJheShidWYpXG4gICAgICAgICAgdmFyIGNoYXJzID0gbmV3IEFycmF5KHZpZXcubGVuZ3RoKVxuXG4gICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB2aWV3Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBjaGFyc1tpXSA9IFN0cmluZy5mcm9tQ2hhckNvZGUodmlld1tpXSlcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBidWZmZXJDbG9uZShidWYpIHtcbiAgICAgICAgICBpZiAoYnVmLnNsaWNlKSB7XG4gICAgICAgICAgICByZXR1cm4gYnVmLnNsaWNlKDApXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciB2aWV3ID0gbmV3IFVpbnQ4QXJyYXkoYnVmLmJ5dGVMZW5ndGgpXG4gICAgICAgICAgICB2aWV3LnNldChuZXcgVWludDhBcnJheShidWYpKVxuICAgICAgICAgICAgcmV0dXJuIHZpZXcuYnVmZmVyXG4gICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gQm9keSgpIHtcbiAgICAgICAgICB0aGlzLmJvZHlVc2VkID0gZmFsc2VcblxuICAgICAgICAgIHRoaXMuX2luaXRCb2R5ID0gZnVuY3Rpb24oYm9keSkge1xuICAgICAgICAgICAgdGhpcy5fYm9keUluaXQgPSBib2R5XG4gICAgICAgICAgICBpZiAoIWJvZHkpIHtcbiAgICAgICAgICAgICAgdGhpcy5fYm9keVRleHQgPSAnJ1xuICAgICAgICAgICAgfSBlbHNlIGlmICh0eX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XJWaWV3KGJvZHkpKSkge1xuICAgICAgICAgICAgICB0aGlzLl9ib2R5QXJyYXlCdWZmZXIgPSBidWZmZXJDbG9uZShib2R5KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1bnN1cHBvcnRlZCBCb2R5SW5pdCB0eXBlJylcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCF0aGlzLmhlYWRlcnMuZ2V0KCdjb250ZW50LXR5cGUnKSkge1xuICAgICAgICAgICAgICBpZiAodHlwZW9mIGJvZHkgPT09ICdzdHJpbmcnKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ3RleHQvcGxhaW47Y2hhcnNldD1VVEYtOCcpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUJsb2IgJiYgdGhpcy5fYm9keUJsb2IudHlwZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuaGVhZGVycy5zZXQoJ2NvbnRlbnQtdHlwZScsIHRoaXMuX2JvZHlCbG9iLnR5cGUpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3VwcG9ydC5zZWFyY2hQYXJhbXMgJiYgVVJMU2VhcmNoUGFyYW1zLnByb3RvdHlwZS5pc1Byb3RvdHlwZU9mKGJvZHkpKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5oZWFkZXJzLnNldCgnY29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZDtjaGFyc2V0PVVURi04JylcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChzdXBwb3J0LmJsb2IpIHtcbiAgICAgICAgICAgIHRoaXMuYmxvYiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgICBpZiAocmVqZWN0ZWQpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0ZWRcbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgIGlmICh0aGlzLl9ib2R5QmxvYikge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keUJsb2IpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShuZXcgQmxvYihbdGhpcy5fYm9keUFycmF5QnVmZmVyXSkpXG4gICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdjb3VsZCBub3QgcmVhZCBGb3JtRGF0YSBib2R5IGFzIGJsb2InKVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUobmV3IEJsb2IoW3RoaXMuX2JvZHlUZXh0XSkpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy5hcnJheUJ1ZmZlciA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICBpZiAodGhpcy5fYm9keUFycmF5QnVmZmVyKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvbnN1bWVkKHRoaXMpIHx8IFByb21pc2UucmVzb2x2ZSh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpXG4gICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuYmxvYigpLnRoZW4ocmVhZEJsb2JBc0FycmF5QnVmZmVyKVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50ZXh0ID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICB2YXIgcmVqZWN0ZWQgPSBjb25zdW1lZCh0aGlzKVxuICAgICAgICAgICAgaWYgKHJlamVjdGVkKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZWplY3RlZFxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5fYm9keUJsb2IpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlYWRCbG9iQXNUZXh0KHRoaXMuX2JvZHlCbG9iKVxuICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzLl9ib2R5QXJyYXlCdWZmZXIpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIFByb21pc2UucmVzb2x2ZShyZWFkQXJyYXlCdWZmZXJBc1RleHQodGhpcy5fYm9keUFycmF5QnVmZmVyKSlcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy5fYm9keUZvcm1EYXRhKSB7XG4gICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignY291bGQgbm90IHJlYWQgRm9ybURhdGEgYm9keSBhcyB0ZXh0JylcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUodGhpcy5fYm9keVRleHQpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKHN1cHBvcnQuZm9ybURhdGEpIHtcbiAgICAgICAgICAgIHRoaXMuZm9ybURhdGEgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oZGVjb2RlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cblxuICAgICAgICAgIHRoaXMuanNvbiA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgcmV0dXJuIHRoaXMudGV4dCgpLnRoZW4oSlNPTi5wYXJzZSlcbiAgICAgICAgICB9XG5cbiAgICAgICAgICByZXR1cm4gdGhpc1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gSFRUUCBtZXRob2RzIHdob3NlIGNhcGl0YWxpemF0aW9uIHNob3VsZCBiZSBub3JtYWxpemVkXG4gICAgICAgIHZhciBtZXRob2RzID0gWydERUxFVEUnLCAnR0VUJywgJ0hFQUQnLCAnT1BUSU9OUycsICdQT1NUJywgJ1BVVCddXG5cbiAgICAgICAgZnVuY3Rpb24gbm9ybWFsaXplTWV0aG9kKG1ldGhvZCkge1xuICAgICAgICAgIHZhciB1cGNhc2VkID0gbWV0aG9kLnRvVXBwZXJDYXNlKClcbiAgICAgICAgICByZXR1cm4gKG1ldGhvZHMuaW5kZXhPZih1cGNhc2VkKSA+IC0xKSA/IHVwY2FzZWQgOiBtZXRob2RcbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIFJlcXVlc3QoaW5wdXQsIG9wdGlvbnMpIHtcbiAgICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fVxuICAgICAgICAgIHZhciBib2R5ID0gb3B0aW9ucy5ib2R5XG5cbiAgICAgICAgICBpZiAoaW5wdXQgaW5zdGFuY2VvZiBSZXF1ZXN0KSB7XG4gICAgICAgICAgICBpZiAoaW5wdXQuYm9keVVzZWQpIHtcbiAgICAgICAgICAgICAgdGhyb3cgbmV3IFR5cGVFcnJvcignQWxyZWFkeSByZWFkJylcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudXJsID0gaW5wdXQudXJsXG4gICAgICAgICAgICB0aGlzLmNyZWRlbnRpYWxzID0gaW5wdXQuY3JlZGVudGlhbHNcbiAgICAgICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzKSB7XG4gICAgICAgICAgICAgIHRoaXMuaGVhZGVycyA9IG5ldyBIZWFkZXJzKGlucHV0LmhlYWRlcnMpXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aGlzLm1ldGhvZCA9IGlucHV0Lm1ldGhvZFxuICAgICAgICAgICAgdGhpcy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lwZS5jbG9uZSA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgIHJldHVybiBuZXcgUmVxdWVzdCh0aGlzLCB7IGJvZHk6IHRoaXMuX2JvZHlJbml0IH0pXG4gICAgICAgIH1cblxuICAgICAgICBmdW5jdGlvbiBkZWNvZGUoYm9keSkge1xuICAgICAgICAgIHZhciBmb3JtID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICBib2R5LnRyaW0oKS5zcGxpdCgnJicpLmZvckVhY2goZnVuY3Rpb24oYnl0ZXMpIHtcbiAgICAgICAgICAgIGlmIChieXRlcykge1xuICAgICAgICAgICAgICB2YXIgc3BsaXQgPSBieXRlcy5zcGxpdCgnPScpXG4gICAgICAgICAgICAgIHZhciBuYW1lID0gc3BsaXQuc2hpZnQoKS5yZXBsYWNlKC9cXCsvZywgJyAnKVxuICAgICAgICAgICAgICB2YXIgdmFsdWUgPSBzcGxpdC5qb2luKCc9JykucmVwbGFjZSgvXFwrL2csICcgJylcbiAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoZGVjb2RlVVJJQ29tcG9uZW50KG5hbWUpLCBkZWNvZGVVUklDb21wb25lbnQodmFsdWUpKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGZvcm1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIHBhcnNlSGVhZGVycyhyYXdIZWFkZXJzKSB7XG4gICAgICAgICAgdmFyIGhlYWRlcnMgPSBuZXcgSGVhZGVycygpXG4gICAgICAgICAgcmF3SGVhZGVycy5zcGxpdCgvXFxyP1xcbi8pLmZvckVhY2goZnVuY3Rpb24obGluZSkge1xuICAgICAgICAgICAgdmFyIHBhcnRzID0gbGluZS5zcGxpdCgnOicpXG4gICAgICAgICAgICB2YXIga2V5ID0gcGFydHMuc2hpZnQoKS50cmltKClcbiAgICAgICAgICAgIGlmIChrZXkpIHtcbiAgICAgICAgICAgICAgdmFyIHZhbHVlID0gcGFydHMuam9pbignOicpLnRyaW0oKVxuICAgICAgICAgICAgICBoZWFkZXJzLmFwcGVuZChrZXksIHZhbHVlKVxuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG4gICAgICAgICAgcmV0dXJuIGhlYWRlcnNcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXF1ZXN0LnByb3RvdHlwZSlcblxuICAgICAgICBmdW5jdGlvbiBSZXNwb25zZShib2R5SW5pdCwgb3B0aW9ucykge1xuICAgICAgICAgIGlmICghb3B0aW9ucykge1xuICAgICAgICAgICAgb3B0aW9ucyA9IHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgdGhpcy50eXBlID0gJ2RlZmF1bHQnXG4gICAgICAgICAgdGhpcy5zdGF0dXMgPSAnc3RhdHVzJyBpbiBvcHRpb25zID8gb3B0aW9ucy5zdGF0dXMgOiAyMDBcbiAgICAgICAgICB0aGlzLm9rID0gdGhpcy5zdGF0dXMgPj0gMjAwICYmIHRoaXMuc3RhdHVzIDwgMzAwXG4gICAgICAgICAgdGhpcy5zdGF0dXNUZXh0ID0gJ3N0YXR1c1RleHQnIGluIG9wdGlvbnMgPyBvcHRpb25zLnN0YXR1c1RleHQgOiAnT0snXG4gICAgICAgICAgdGhpcy5oZWFkZXJzID0gbmV3IEhlYWRlcnMob3B0aW9ucy5oZWFkZXJzKVxuICAgICAgICAgIHRoaXMudXJsID0gb3B0aW9ucy51cmwgfHwgJydcbiAgICAgICAgICB0aGlzLl9pbml0Qm9keShib2R5SW5pdClcbiAgICAgICAgfVxuXG4gICAgICAgIEJvZHkuY2FsbChSZXNwb25zZS5wcm90b3R5cGUpXG5cbiAgICAgICAgUmVzcG9uc2UucHJvdG90eXBlLmNsb25lID0gZnVuY3Rpb24oKSB7XG4gICAgICAgICAgcmV0dXJuIG5ldyBSZXNwb25zZSh0aGlzLl9ib2R5SW5pdCwge1xuICAgICAgICAgICAgc3RhdHVzOiB0aGlzLnN0YXR1cyxcbiAgICAgICAg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VuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICB2YXIgcmVxdWVzdCA9IG5ldyBSZXF1ZXN0KGlucHV0LCBpbml0KVxuICAgICAgICAgICAgdmFyIHhociA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpXG5cbiAgICAgICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgdmFyIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgc3RhdHVzOiB4aHIuc3RhdHVzLFxuICAgICAgICAgICAgICAgIHN0YXR1c1RleHQ6IHhoci5zdGF0dXNUZXh0LFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHBhcnNlSGVhZGVycyh4aHIuZ2V0QWxsUmVzcG9uc2VIZWFkZXJzKCkgfHwgJycpXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgb3B0aW9ucy51cmwgPSAncmVzcG9uc2VVUkwnIGluIHhociA/IHhoci5yZXNwb25zZVVSTCA6IG9wdGlvbnMuaGVhZGVycy5nZXQoJ1gtUmVxdWVzdC1VUkwnKVxuICAgICAgICAgICAgICB2YXIgYm9keSA9ICdyZXNwb25zZScgaW4geGhyID8geGhyLnJlc3BvbnNlIDogeGhyLnJlc3BvbnNlVGV4dFxuICAgICAgICAgICAgICByZXNvbHZlKG5ldyBSZXNwb25zZShib2R5LCBvcHRpb25zKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9uZXJyb3IgPSBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgcmVqZWN0KG5ldyBUeXBlRXJyb3IoJ05ldHdvcmsgcmVxdWVzdCBmYWlsZWQnKSlcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgeGhyLm9udGltZW91dCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICByZWplY3QobmV3IFR5cGVFcnJvcignTmV0d29yayByZXF1ZXN0IGZhaWxlZCcpKVxuICAg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zUG9zID09PSAtMSA/IHBhcnQuaW5kZXhPZignPScpIDogYnJhY2tldEVxdWFsc1BvcyArIDE7XG5cbiAgICAgICAgdmFyIGtleSwgdmFsO1xuICAgICAgICBpZiAocG9zID09PSAtMSkge1xuICAgICAgICAgICAga2V5ID0gb3B0aW9ucy5kZWNvZGVyKHBhcnQsIGRlZmF1bHRzLmRlY29kZXIpO1xuICAgICAgICAgICAgdmFsID0gb3B0aW9ucy5zdHJpY3ROdWxsSGFuZGxpbmcgPyBudWxsIDogJyc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBrZXkgPSBvcHRpb25zLmRlY29kZXIocGFydC5zbGljZSgwLCBwb3MpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgICAgIHZhbCA9IG9wdGlvbnMuZGVjb2RlcihwYXJ0LnNsaWNlKHBvcyArIDEpLCBkZWZhdWx0cy5kZWNvZGVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAoaGFzLmNhbGwob2JqLCBrZXkpKSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IFtdLmNvbmNhdChvYmpba2V5XSkuY29uY2F0KHZhbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBvYmpba2V5XSA9IHZhbDtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBvYmo7XG59O1xuXG52YXIgcGFyc2VPYmplY3QgPSBmdW5jdGlvbiAoY2hhaW4sIHZhbCwgb3B0aW9ucykge1xuICAgIHZhciBsZWFmID0gdmFsO1xuXG4gICAgZm9yICh2YXIgaSA9IGNoYWluLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBvYmo7XG4gICAgICAgIHZhciByb290ID0gY2hhaW5baV07XG5cbiAgICAgICAgaWYgKHJvb3QgPT09ICdbXScpIHtcbiAgICAgICAgICAgIG9iaiA9IFtdO1xuICAgICAgICAgICAgb2JqID0gb2JqLmNvbmNhdChsZWFmKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9iaiA9IG9wdGlvbnMucGxhaW5PYmplY3RzID8gT2JqZWN0LmNyZWF0ZShudWxsKSA6IHt9O1xuICAgICAgICAgICAgdmFyIGNsZWFuUm9vdCA9IHJvb3QuY2hhckF0KDApID09PSAnWycgJiYgcm9vdC5jaGFyQXQocm9vdC5sZW5ndGggLSAxKSA9PT0gJ10nID8gcm9vdC5zbGljZSgxLCAtMSkgOiByb290O1xuICAgICAgICAgICAgdmFyIGluZGV4ID0gcGFyc2VJbnQoY2xlYW5Sb290LCAxMCk7XG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgIWlzTmFOKGluZGV4KVxuICAgICAgICAgICAgICAgICYmIHJvb3QgIT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIFN0cmluZyhpbmRleCkgPT09IGNsZWFuUm9vdFxuICAgICAgICAgICAgICAgICYmIGluZGV4ID49IDBcbiAgICAgICAgICAgICAgICAmJiAob3B0aW9ucy5wYXJzZUFycmF5cyAmJiBpbmRleCA8PSBvcHRpb25zLmFycmF5TGltaXQpXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgICAgICBvYmpbaW5kZXhdID0gbGVhZjtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgb2JqW2NsZWFuUm9vdF0gPSBsZWFmO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgbGVhZiA9IG9iajtcbiAgICB9XG5cbiAgICByZXR1cm4gbGVhZjtcbn07XG5cbnZhciBwYXJzZUtleXMgPSBmdW5jdGlvbiBwYXJzZVF1ZXJ5U3RyaW5nS2V5cyhnaXZlbktleSwgdmFsLCBvcHRpb25zKSB7XG4gICAgaWYgKCFnaXZlbktleSkge1xuICAgICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgLy8gVHJhbnNmb3JtIGRvd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oc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgocHJlZml4LCBrZXkpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxuICAgICAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgICAgIGZvcm1hdHRlcixcbiAgICAgICAgICAgICAgICBlbmNvZGVWYWx1ZXNPbmx5XG4gICAgICAgICAgICApKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhbHVlcyA9IHZhbHVlcy5jb25jYXQoc3RyaW5naWZ5KFxuICAgICAgICAgICAgICAgIG9ialtrZXldLFxuICAgICAgICAgICAgICAgIHByZWZpeCArIChhbGxvd0RvdHMgPyAnLicgKyBrZXkgOiAnWycgKyBrZXkgKyAnXScpLFxuICAgICAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICAgICAgc3RyaWN0TnVsbEhhbmRsaW5nLFxuICAgICAgICAgICAgICAgIHNraXBOdWxscyxcbiAgICAgICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgICAgICBzb3J0LFxu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c1thcnJheUZvcm1hdF07XG5cbiAgICBpZiAoIW9iaktleXMpIHtcbiAgICAgICAgb2JqS2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgfVxuXG4gICAgaWYgKHNvcnQpIHtcbiAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGUgPyBlbmNvZGVyIDogbnVsbCxcbiAgICAgICAgICAgIGZpbHRlcixcbiAgICAgICAgICAgIHNvcnQsXG4gICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICBzZXJpYWxpemVEYXRlLFxuICAgICAgICAgICAgZm9ybWF0dGVyLFxuICAgICAgICAgICAgZW5jb2RlVmFsdWVzT25seVxuICAgICAgICApKTtcbiAgICB9XG5cbiAgICB2YXIgam9pbmVkID0ga2V5cy5qb2luKGRlbGltaXRlcik7XG4gICAgdmFyIHByZWZpeCA9IG9wdGlvbnMuYWRkUXVlcnlQcmVmaXggPT09IHRydWUgPyAnPycgOiAnJztcblxuICAgIHJldHVybiBqb2luZWQubGVuZ3RoID4gMCA/IHByZWZpeCArIGpvaW5lZCA6ICcnO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbnZhciBjb21wYWN0UXVldWUgPSBmdW5jdGlvbiBjb21wYWN0UXVldWUocXVldWUpIHtcbiAgICB2YXIgb2JqO1xuXG4gICAgd2hpbGUgKHF1ZXVlLmxlbmd0aCkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlLnBvcCgpO1xuICAgICAgICBvYmogPSBpdGVtLm9ialtpdGVtLnByb3BdO1xuXG4gICAgICAgIGlmIChBcnJheS5pc0FycmF5KG9iaikpIHtcbiAgICAgICAgICAgIHZhciBjb21wYWN0ZWQgPSBbXTtcblxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBvYmoubGVuZ3RoOyArK2opIHtcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG9ialtqXSAhPT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgICAgICAgICAgICAgICAgY29tcGFjdGVkLnB1c2gob2JqW2pdKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGl0ZW0ub2JqW2l0ZW0ucHJvcF0gPSBjb21wYWN0ZWQ7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gb2JqO1xufTtcblxuZXhwb3J0cy5hcnJheVRvT2JqZWN0ID0gZnVuY3Rpb24gYXJyYXlUb09iamVjdChzb3VyY2UsIG9wdGlvbnMpIHtcbiAgICB2YXIgb2JqID0gb3B0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oc3RyKTtcblxuICAgIHZhciBvdXQgPSAnJztcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IHN0cmluZy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgYyA9IHN0cmluZy5jaGFyQ29kZUF0KGkpO1xuXG4gICAgICAgIGlmIChcbiAgICAgICAgICAgIGMgPT09IDB4MkQgLy8gLVxuICAgICAgICAgICAgfHwgYyA9PT0gMHgyRSAvLyAuXG4gICAgICAgICAgICB8fCBjID09PSAweDVGIC8vIF9cbiAgICAgICAgICAgIHx8IGMgPT09IDB4N0UgLy8gflxuICAgICAgICAgICAgfHwgKGMgPj0gMHgzMCAmJiBjIDw9IDB4MzkpIC8vIDAtOVxuICAgICAgICAgICAgfHwgKGMgPj0gMHg0MSAmJiBjIDw9IDB4NUEpIC8vIGEtelxuICAgICAgICAgICAgfHwgKGMgPj0gMHg2MSAmJiBjIDw9IDB4N0EpIC8vIEEtWlxuICAgICAgICApIHtcbiAgICAgICAgICAgIG91dCArPSBzdHJpbmcuY2hhckF0KGkpO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODApIHtcbiAgICAgICAgICAgIG91dCA9IG91dCArIGhleFRhYmxlW2NdO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4ODAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhDMCB8IChjID4+IDYpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChjIDwgMHhEODAwIHx8IGMgPj0gMHhFMDAwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyAoaGV4VGFibGVbMHhFMCB8IChjID4+IDEyKV0gKyBoZXhUYWJsZVsweDgwIHwgKChjID4+IDYpICYgMHgzRildICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaSArPSAxO1xuICAgICAgICBjID0gMHgxMDAwMCArICgoKGMgJiAweDNGRikgPDwgMTApIHwgKHN0cmluZy5jaGFyQ29kZUF0KGkpICYgMHgzRkYpKTtcbiAgICAgICAgb3V0ICs9IGhleFRhYmxlWzB4RjAgfCAoYyA+PiAxOCldXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildXG4gICAgICAgICAgICArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gNikgJiAweDNGKV1cbiAgICAgICAgICAgICsgaGV4VGFibGVbMHg4MCB8IChjICYgMHgzRildO1xuICAgIH1cblxuICAgIHJldHVybiBvdXQ7XG59O1xuXG5leHBvcnRzLmNvbXBhY3QgPSBmdW5jdGlvbiBjb21wYWN0KHZhbHVlKSB7XG4gICAgdmFyIHF1ZXVlID0gW3sgb2JqOiB7IG86IHZhbHVlIH0sIHByb3A6ICdvJyB9XTtcbiAgICB2YXIgcmVmcyA9IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBxdWV1ZS5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIgaXRlbSA9IHF1ZXVlW2ldO1xuICAgICAgICB2YXIgb2JqID0gaXRlbS5vYmpbaXRlbS5wcm9wXTtcblxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwga2V5cy5sZW5ndGg7ICsraikge1xuICAgICAgICAgICAgdmFyIGtleSA9IGtleXNbal07XG4gICAgICAgICAgICB2YXIgdmFsID0gb2JqW2tleV07XG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhbCA9PT0gJ29iamVjdCcgJiYgdmFsICE9PSBudWxsICYmIHJlZnMuaW5kZXhPZih2YWwpID09PSAtMSkge1xuICAgICAgICAgICAgICAgIHF1ZXVlLnB1c2goeyBvYmo6IG9iaiwgcHJvcDoga2V5IH0pO1xuICAgICAgICAgICAgICAgIHJlZnMucHVzaCh2YWwpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGNvbXBhY3RRdWV1ZShxdWV1ZSk7XG59O1xuXG5leHBvcnRzLmlzUmVnRXhwID0gZnVuY3Rpb24gaXNSZWdFeHAob2JqKSB7XG4gICAgcmV0dXJuIE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcuY2FsbChvYmopID09PSAnW29iamVjdCBSZWdFeHBdJztcbn07XG5cbmV4cG9ydHMuaXNCdWZmZXIgPSBmdW5jdGlvbiBpc0J1ZmZlcihvYmopIHtcbiAgICBpZiAob2JqID09PSBudWxsIHx8IHR5cGVvZiBvYmogPT09ICd1bmRlZmluZWQnKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICByZXR1cm4gISEob2JqLmNvbnN0cnVjdG9yICYmIG9iai5jb25zdHJ1Y3Rvci5pc0J1ZmZlciAmJiBvYmouY29uc3RydWN0b3IuaXNCdWZmZXIob2JqKSk7XG59O1xuIl19 diff --git a/ccxt.js b/ccxt.js index 811b25c4c7b7..2f6207562d25 100644 --- a/ccxt.js +++ b/ccxt.js @@ -37,7 +37,7 @@ const errors = require ('./js/base/errors') //----------------------------------------------------------------------------- // this is updated by vss.js when building -const version = '1.10.528' +const version = '1.10.529' Exchange.ccxtVersion = version diff --git a/package.json b/package.json index 5f85db0d987b..e69afa3f3f77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ccxt", - "version": "1.10.528", + "version": "1.10.529", "description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 90+ exchanges", "main": "./ccxt.js", "unpkg": "build/ccxt.browser.js", diff --git a/php/Exchange.php b/php/Exchange.php index 42e16ad83d2e..ba65cdb119c4 100644 --- a/php/Exchange.php +++ b/php/Exchange.php @@ -30,7 +30,7 @@ namespace ccxt; -$version = '1.10.528'; +$version = '1.10.529'; abstract class Exchange { diff --git a/php/bithumb.php b/php/bithumb.php index e0e0138d05c7..b5e3ea680844 100644 --- a/php/bithumb.php +++ b/php/bithumb.php @@ -244,7 +244,7 @@ public function create_order ($symbol, $type, $side, $amount, $price = null, $pa 'currency' => $market['id'], 'units' => $amount, ); - $method .= 'Market' . $this->capitalise ($side); + $method .= 'Market' . $this->capitalize ($side); } $response = $this->$method (array_merge ($request, $params)); $id = null; diff --git a/python/ccxt/__init__.py b/python/ccxt/__init__.py index f2eb55986a4a..f971ad5c97c0 100644 --- a/python/ccxt/__init__.py +++ b/python/ccxt/__init__.py @@ -28,7 +28,7 @@ # ---------------------------------------------------------------------------- -__version__ = '1.10.528' +__version__ = '1.10.529' # ---------------------------------------------------------------------------- diff --git a/python/ccxt/async/__init__.py b/python/ccxt/async/__init__.py index 1e0d6a2425c1..c61e6e34137d 100644 --- a/python/ccxt/async/__init__.py +++ b/python/ccxt/async/__init__.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.528' +__version__ = '1.10.529' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/base/exchange.py b/python/ccxt/async/base/exchange.py index c7a8cb3afdb9..d2d823e3d583 100644 --- a/python/ccxt/async/base/exchange.py +++ b/python/ccxt/async/base/exchange.py @@ -2,7 +2,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.528' +__version__ = '1.10.529' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/async/bithumb.py b/python/ccxt/async/bithumb.py index cc930d9675ca..41bffa8171f5 100644 --- a/python/ccxt/async/bithumb.py +++ b/python/ccxt/async/bithumb.py @@ -234,7 +234,7 @@ async def create_order(self, symbol, type, side, amount, price=None, params={}): 'currency': market['id'], 'units': amount, } - method += 'Market' + self.capitalise(side) + method += 'Market' + self.capitalize(side) response = await getattr(self, method)(self.extend(request, params)) id = None if 'order_id' in response: diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index 89c198853c38..0f6034a34017 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -4,7 +4,7 @@ # ----------------------------------------------------------------------------- -__version__ = '1.10.528' +__version__ = '1.10.529' # ----------------------------------------------------------------------------- diff --git a/python/ccxt/bithumb.py b/python/ccxt/bithumb.py index 59d8c1d514de..26364690cd53 100644 --- a/python/ccxt/bithumb.py +++ b/python/ccxt/bithumb.py @@ -234,7 +234,7 @@ def create_order(self, symbol, type, side, amount, price=None, params={}): 'currency': market['id'], 'units': amount, } - method += 'Market' + self.capitalise(side) + method += 'Market' + self.capitalize(side) response = getattr(self, method)(self.extend(request, params)) id = None if 'order_id' in response: