Advertisement
xiaomianao666

邀您一起看:A 阿麦从军

Feb 18th, 2024
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥A 阿麦从军@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTgeWIl+ihqEFQSVwiLFwicGF0aFwiOlwiUXVhcmtTaGFyZUFwaVwiLFwicnVsZVwiOlwianM6XFxuLy9AYXV0aG9yIExveURnSWtcXG5sZXQgaHR0cFJlcXVlc3QgPSAkLnJlcXVpcmUoXFxcImh0dHBSZXF1ZXN0XFxcIik7XFxuY29uc3QgYmFzZVVybCA9IFxcXCJodHRwczovL3Bhbi5xdWFyay5jblxcXCI7XFxuXFxuZnVuY3Rpb24gUXVhcmtTaGFyZUFwaShzaGFyZUlkLCBzaGFyZVB3ZCkge1xcbiAgICB0aGlzLnNoYXJlSWQgPSBzaGFyZUlkO1xcbiAgICB0aGlzLnNoYXJlUHdkID0gc2hhcmVQd2Q7XFxuICAgIHRoaXMucmVmcmVzaENhbGxCYWNrID0gKCgpID0+IHZvaWQgMCk7XFxuICAgIC8vdGhpcy5zaGFyZVRva2VuID0gc2hhcmVUb2tlbiB8fCB0aGlzLmdldFNoYXJlVG9rZW4oKTtcXG59XFxuT2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HJlcy5zdGF0dXNDb2RlKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZXJyID0gdGhpcy5lcnJvclR5cGVDYWxsYmFjayhlcnIsIHJlcyk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodGhpcy5yZXRyeUNvdW50KSB7XFxuICAgICAgICAgICAgICAgIGxldCB0cnlSZXN1bHQgPSB0aGlzLmVycm9yQ2FsbGJhY2tXaXRoUmV0cnkoZXJyLCByZXMsIHRoaXMpO1xcbiAgICAgICAgICAgICAgICBpZiAodHJ5UmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQtLTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnN0YXJ0KHRvSnNvbik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JDYWxsYmFjayhlcnIsIHJlcyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5lcnJvckNhbGxiYWNrKGVyciwgcmVzKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIHNldE9wdGlvbnMob3B0aW9ucykge1xcbiAgICAgICAgdGhpcy5vcHRpb25zID0gT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucywge1xcbiAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBtZXJnZUhlYW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B9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5Yqf6IO9XFxcIixcXG4gICAgICAgIHVybDogJChbXFxcIui3s+i9rOWkuOWFi0FQUFxcXCIsIFxcXCLnmbvlvZVcXFwiLCBcXFwi5Y6f55S75LiL6L2957q/56iLXFxcIl0pLnNlbGVjdCgoc2hhcmVJZCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIui3s+i9rOWkuOWFi0FQUFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJxa2xpbms6Ly93d3cudWMuY24vYjIwYjg0ZmQ3MzVhOGRkM2Y3NTQxMTI5YmFjYzRlOWE/YWN0aW9uPW9wZW5fdXJsJnVybD1odHRwczovL3Bhbi5xdWFyay5jbi9zL1xcXCIgKyBzaGFyZUlkO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09IFxcXCLnmbvlvZVcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFwi6L6T5YWlQ29va2llXFxcIiwgXFxcIue9kemhteeZu+W9lVxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi572R6aG155m75b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaVDb29raWVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcInRvb2xcXFwiKS5pc0xvZ2luQ29va2llKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBpbnB1dC5yZXBsYWNlKC9cXFxccy9nLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09IFxcXCLljp/nlLvkuIvovb3nur/nqItcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKGdldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgXFxcIjEwXFxcIiksIFxcXCLor7fovpPlhaUzLTMy5LmL6Ze055qE5pW05pWwXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNwZWVkVGhyZWFkID0gcGFyc2VJbnQoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNwZWVkVGhyZWFkIDwgMyB8fCBzcGVlZFRocmVhZCA+IDMyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruS4jeWQiOazlVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJzcGVlZFRocmVhZFxcXCIsIFN0cmluZyhzcGVlZFRocmVhZCkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdD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ICAgICB2YXIgbGlzdCA9IHJlcy5kYXRhLmxpc3R8fFtdO1xcbiAgICB9XFxuICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgIC8v5Yik5pat5piv5ZCm5paH5Lu25aS5XFxuICAgICAgICBpZiAoaXRlbS5kaXIpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIvCfk4JcXFwiICsgaXRlbS5maWxlX25hbWUsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICQuZGF0ZUZvcm1hdChpdGVtLnVwZGF0ZWRfYXQsICd5eXl5LU1NLWRkJykgKyAnICAnICsgaXRlbS5pbmNsdWRlX2l0ZW1zICsgJ+mhuSAgJyxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvMjcuc3ZnXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3F1YXJrTGlzdD9wYWdlPWZ5cGFnZVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzdHlsZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlSWQsXFxuICAgICAgICAgICAgICAgICAgICBzaGFyZVB3ZCxcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlVG9rZW46IHF1YXJrU2hhcmVBcGkuZ2V0VG9rZW4oKSxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVJZDogaXRlbS5maWQsXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldEhlYWQoaXRlbS5vYmpfY2F0ZWdvcnkpICsgaXRlbS5maWxlX25hbWUsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICQuZGF0ZUZvcm1hdChpdGVtLnVwZGF0ZWRfYXQsICd5eXl5LU1NLWRkJykgKyAnICAnICsgZm9ybWF0U2l6ZShpdGVtLnNpemUpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdGVtLnRodW1ibmFpbCxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VXJsQ2FjaGUgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwicGxheVVybENhY2hlXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBsYXlVcmxDYWNoZVtmaWRdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmxDYWNoZVtmaWRdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gJC5yZXF1aXJlKFxcXCJwbGF5XFxcIikuZ2V0UGxheVVybChmaWQsIGZpZF90b2tlbiwgcHdkX2lkLCBzdG9rZW4sIGNhdGVnb3J5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwbGF5VXJsQ2FjaGVbZmlkXSA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGxheVVybENhY2hlXFxcIiwgcGxheVVybENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV9maWRfdG9rZW4sIHNoYXJlSWQsIHF1YXJrU2hhcmVBcGkuZ2V0VG9rZW4oKSwgaXRlbS5vYmpfY2F0ZWdvcnkpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogc3R5bGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5maWQsXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheWxpc3QgJyArIGl0ZW0ub2JqX2NhdGVnb3J5XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGUubWVzc2FnZSxcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBpZiAoZS5tZXNzYWdlLmluY2x1ZGVzKFxcXCLmj5Dlj5bnoIFcXFwiKSkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIui+k+WFpeaPkOWPlueggVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKCkuaW5wdXQoKE1ZX1BBUkFNUykgPT4ge1xcbiAgICAgICAgICAgICAgICBzZXRQYWdlUGFyYW1zKE9iamVjdC5hc3NpZ24oe30sIE1ZX1BBUkFNUywge1xcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVQd2Q6IGlucHV0XFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICB9LCBNWV9QQVJBTVMpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTgeiOt+WPlumTvuaOpVwiLFwicGF0aFwiOlwicGxheVwiLFwicnVsZVwiOlwianM6XFxuY29uc3QgY29va2llID0gZ2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBcXFwiXFxcIik7XFxubGV0IGh0dHBSZXF1ZXN0ID0gJC5yZXF1aXJlKFxcXCJodHRwUmVxdWVzdFxcXCIpO1xcblxcbmZ1bmN0aW9uIENvb2tpZU1hbmFnZShjb29raWUpIHtcXG4gICAgdGhpcy5jb29raWUgPSB7fTtcXG4gICAgdGhpcy5hZGQoY29va2llKTtcXG59XFxuT2JqZWN0LmFzc2lnbihDb29raWVNYW5hZ2UucHJvdG90eXBlLCB7XFxuICAgIGFkZChjb29raWUpIHtcXG4gICAgICAgIGxldCBjb29raWVzID0gW107XFxuICAgICAgICBpZiAodHlwZW9mIGNvb2tpZSA9PT0gXFxcInN0cmluZ1xcXCIpIHtcXG4gICAgICAgICAgICBjb29raWVzID0gY29va2llLnNwbGl0KFxcXCI7XFxcIik7XFxuICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoY29va2llKSkge1xcbiAgICAgICAgICAgIGNvb2tpZXMgPSBjb29raWU7XFxuICAgICAgICB9XFxuICAgICAgICBjb29raWVzLmZvckVhY2godiA9PiB7XFxuICAgICAgICAgICAgdiA9IHYuc3BsaXQoXFxcIj1cXFwiKTtcXG4gICAgICAgICAgICBpZiAodi5sZW5ndGggPCAyKSByZXR1cm47XFxuICAgICAgICAgICAgdGhpcy5jb29raWVbdlswXS50cmltKCldID0gdlsxXS50c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oi8v6I635Y+W5aSx6LSlXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwbGF5Q29va2llID0gY29va2llTWFuYWdlLmdldCgpO1xcbiAgICAgICAgbGV0IHBsYXlIZWFkZXIgPSB7XFxuICAgICAgICAgICAgUmVmZXJlcjogXFxcImh0dHA6Ly9wYW4ucXVhcmsuY24vXFxcIixcXG4gICAgICAgICAgICBjb29raWU6IHBsYXlDb29raWUsXFxuICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiY29tLnN0dWIuU3R1YkFwcC8xLjMuMCAoTGludXg7QW5kcm9pZCAxNCkgQW5kcm9pZFhNZWRpYTMvMS4xLjFcXFwiXFxuICAgICAgICB9O1xcbiAgICAgICAgaWYgKGNhdGVnb3J5ID09IFxcXCJ2aWRlb1xcXCIpIHtcXG4gICAgICAgICAgICBsZXQgcGxheU1vZGUgPSBnZXRJdGVtKFxcXCJxdWFya19wbGF5TW9kZVxcXCIsIFxcXCLovaznoIFcXFwiKTtcXG4gICAgICAgICAgICBpZiAocGxheU1vZGUgPT09IFxcXCLovaznoIFcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCB2aWRlb1JlcyA9IGdldFByZXZpZXdWaWRlbyhhc2ZpZCk7XFxuICAgICAgICAgICAgICAgIGxldCB2aWRlb0xpc3QgPSB2aWRlb1Jlcy5kYXRhLnZpZGVvX2xpc3Q7XFxuICAgICAgICAgICAgICAgIGxldCBwbGF5TGlzdCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbXSxcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFtdLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW11cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgdmlkZW9MaXN0LmZpbHRlcih2ID0+IHYuYWNjZXNzYWJsZSkuZm9yRWFjaCh2ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlMaXN0Lm5hbWVzLnB1c2godi5yZXNvbHV0aW9uKTtcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlMaXN0LnVybHMucHVzaCh2LnZpZGVvX2luZm8udXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdC5oZWFkZXJzLnB1c2gocGxheUhlYWRlcik7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjcmVhdGVEZWxldGVUYXNrKGFzZmlkKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHBsYXlMaXN0KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcGxheVVybCA9IGdldERvd25sb2FkVXJsKGFzZmlkKS5kYXRhWzBdLmRvd25sb2FkX3VybDtcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtcXFwi5Y6f55S7XFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbcGxheVVybCArIFxcXCIjaXNWaWRlbz10cnVlIyNmYXN0UGxheU1vZGUjI3RocmVhZHM9XFxcIiArIGdldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgXFxcIjEwXFxcIikgKyBcXFwiI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW3BsYXlIZWFkZXJdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY3JlYXRlRGVsZXRlVGFzayhhc2ZpZCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShwbGF5TGlzdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHsgLy8g5LiN5piv6KeG6aKR6LWE5rqQXFxuICAgICAgICAgICAgbGV0IHBsYXlJbmZvID0gZ2V0RG93bmx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XFwiaHR0cHM6Ly9wYW4ucXVhcmsuY24vXFxcIixcXG4gICAgZGVzYzogXFxcImZsb2F0JiYxMDAlXFxcIixcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGpzOiAkLnRvU3RyaW5nKChBcGlSb290VXJsKSA9PiB7XFxuICAgICAgICAgICAgbGV0IHRpbWVJbnRlciA9IHNldEludGVydmFsKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IENvb2tpZSA9IGZiYS5nZXRDb29raWUoQXBpUm9vdFVybCk7XFxuICAgICAgICAgICAgICAgIGlmIChDb29raWUuaW5jbHVkZXMoXFxcIl9VUF9GN0VfOERfPVxcXCIpICYmIENvb2tpZS5pbmNsdWRlcyhcXFwiX191aWQ9XFxcIikmJkNvb2tpZS5pbmNsdWRlcyhcXFwiX19wdXVzPVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJxdWFya0Nvb2tpZVxcXCIsIENvb2tpZSlcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZUludGVyKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coQ29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5iYWNrKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIDYwMCk7XFxuICAgICAgICB9LCBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY25cXFwiKSxcXG4gICAgICAgIHVhOiBQQ19VQSxcXG4gICAgICAgIGpzTG9hZGluZ0luamVjdDogZmFsc2VcXG4gICAgfVxcbn0pO1xcbnNldFJlc3VsdChkKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pOB55m75b2V5qOA5rWLXCIsXCJwYXRoXCI6XCJ0b29sXCIsXCJydWxlXCI6XCJqczpcXG4kLmV4cG9ydHMgPSB7XFxuICAgIGlzTG9naW5Db29raWUoY29va2llKSB7XFxuICAgICAgICByZXR1cm4gISEoY29va2llICYmIGNvb2tpZS5pbmNsdWRlcyhcXFwiX1VQX0Y3RV84RF89XFxcIikgJiYgY29va2llLmluY2x1ZGVzKFxcXCJfX3VpZD1cXFwiKSAmJiBjb29raWUuaW5jbHVkZXMoXFxcIl9fcHV1cz1cXFwiKSk7XFxuICAgIH0sXFxuXFxuXFxuXFxuXFxuICAgIHNldFJ1bGUoaW5wdXQpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgLy8g5qC85byP5YyWXFxuICAgICAgICAgICAgW2xvZ1QsIHR5cGUsIHRleHRdID0gU3RyaW5nKGlucHV0KS5zcGxpdChcXFwi77+lXFxcIik7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcodHlwZSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnUGFzdGUnOlxcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHBhcnNlUGFzdGUodGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnTGFuem91JzpcXG4gICAgICAgICAgICAgICAgICAgIFt1cmwsIHB3ZF0gPSB0ZXh0LnNwbGl0KFxcXCIjI1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZHVybCA9ICQucmVxdWlyZSgnbGFuem91P3J1bGU9dWNra+S6kScpLm9uZV91cmwodXJsLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IFN0cmluZyhmZXRjaChkdXJsKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoKHNwID0gdGV4dC5zcGxpdChcXFwi77+lXFxcIikpLmxlbmd0aCA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHNwWzJdLnNwbGl0KFxcXCJAXFxcIilbMF0udHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFycjEgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZSh0ZXh0KSk7XFxuXFxuXFxuICAgICAgICAgICAgLy8g5ZCI5bm277yM5Y676YeNXFxuICAgICAgICAgICAgYXJyMiA9ICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5nZXRKc29uKCk7XFxuICAgICAgICAgICAgYXJyMyA9IGFycjIuY29uY2F0KGFycjEpLmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gb2JqLmdyb3VwID09PSBvLmdyb3VwICYmIG9iai50aXRsZSA9PT0gby50aXRsZSAmJiAob2JqLnRpbWUgPiBvLnRpbWUgfHwgb2JqLnRpbWUgPT0gby50aW1lKSkgPT09IGluZGV4O1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5zYXZlSnNvbihhcnIzKTtcXG5cXG5cXG4gICAgICAgICAgICAvLyDorqHnrpfkvZnph49cXG4gICAgICAgICAgICB4ID0gYXJyMy5sZW5ndGggLSBhcnIyLmxlbmd0aDtcXG4gICAgICAgICAgICBmID0gYXJyMS5sZW5ndGggLSB4XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5Yqf77yM5paw5aKe77yaXFxcIiArIHggKyBcXFwiIOimhueblu+8mlxcXCIgKyBmKTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5aSx6LSlXFxcIik7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuXFxuICAgIHNldEVkaXQoKSB7X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biAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBfW3RdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9ICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5nZXRKc29uKCk7XFxuICAgICAgICAgICAgICAgIHVpZHMgPSBqeGxpc3QubWFwKF9fID0+IG1kNShfXy5ncm91cCArIF9fLnRpdGxlKSk7XFxuICAgICAgICAgICAgICAgIGkgPSB1aWRzLmluZGV4T2YoZ2V0TXlWYXIoJ3J1bGVfdWlkJywgJy0xJykpO1xcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0LnB1c2goXyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdGlkJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdWlkJyk7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IGp4bGlzdC5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBtZDUob2JqLmdyb3VwICsgb2JqLnRpdGxlKSA9PT0gbWQ1KG8uZ3JvdXAgKyBvLnRpdGxlKSAmJiAob2JqLnRpbWUgPiBvLnRpbWUgfHwgb2JqLnRpbWUgPT09IG8udGltZSkpID09PSBpbmRleDtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5zYXZlSnNvbihqeGxpc3QpO1x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cXG4gICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxuICAgICAgICAgICAgICAgIHBhZ2UyID0gcGFnZTtcXG4gICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcIkBcXFwiKS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhZ2UyO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIClcXG4gICAgICAgIC5yZXBsYWNlKC9meXBhZ2UvZywgcGFnZSlcXG4gICAgICAgIC5yZXBsYWNlKFxcbiAgICAgICAgICAgIC9meShjbGFzc3xhcmVhfHllYXJ8c29ydCkvZyxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiBydWxlWyQxICsgJ191cmwnXVtldmFsKCQxICsgJ19pJyldIHx8IFxcXCJcXFwiXFxuICAgICAgICApXFxuICAgICAgICAucmVwbGFjZShcXG4gICAgICAgICAgICAvZnlBbGwvZyxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxuICAgICAgICAgICAgICAgIEZ5QWxsX2lpID0gRnlBbGxfaTtcXG4gICAgICAgICAgICAgICAgaWYgKEZ5QWxsX2lpID4gKHJ1bGUuY2xhc3NfaSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICBGeUFsbF9paSAtPSBydWxlLmNsYXNzX2k7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRnlBbGxfaWkgPiAocnVsZS5hcmVhX2kgLSAxKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEZ5QWxsX2lpIC09IHJ1bGUuYXJlYV9pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLnllYXJfaSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnNvcnRfdXJsW0Z5QWxsX2lpIC0gcnVsZS55ZWFyX2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnllYXJfdXJsW0Z5QWxsX2lpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmFyZWFfdXJsW0Z5QWxsX2lpXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmNsYXNzX3VybFtGeUFsbF9paV07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICApO1xcbiAgICByZXR1cm4gYmFzZVU7XFxufVxcbmNvbnN0IGdldFJ1bGVHcm91cCA9IChjb2xfdHlwZSwgU291KSA9PiB7XFxuICAgIGZvciAoaXQgb2YgWydjbGFzcycsICdhcmVhJywgJ3llYXInLCAnc29ydCddKSB7XFxuICAgICAgICBldmFsKGBpbmRleCA9IHtcXG4gICAgY2xhc3M6IDAsXFxuICAgIGFyZWE6IHJ1bGUuY2xhc3NfaSxcXG4gICAgeWVhcjogcnVsZS5jbGFzc19pICsgcnVsZS5hcmVhX2ksXFxuICAgIHNvcnQ6IHJ1bGUuY2xhc3NfaSArIHJ1bGUuYXJlYV9pICsgcnVsZS55ZWFyX2ksXFxufVtpdF1cXG5ydWxlLiR7aXR9X25hbWUubWFwKChuYW1lLCBpKSA9PiB7XFxuICAgIGlmIChpc0Z5QWxsKSB7XFxuICAgICAgICBpID0gaW5kZXggKyBpO1xcbiAgICAgICAgdCA9IEZ5QWxsX2kgPT0gaTtcXG4gICAgICAgIGsgPSAnRnlBbGxfaSc7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICB0ID0gJHtpdH1faSA9PSBpO1xcbi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9XFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hcXFwiLFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ2tleXdvcmQnLGlucHV0KVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdXJsOiBcXFwidG9hc3Q6Ly/liqDovb3kuK0uLi5cXFwiLFxcbiAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3dlaXN5ci9pbWcvTG9hZGluZzEuZ2lmXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicGljXzFfY2VudGVyXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgY2xzOiBcXFwibG9hZGluZ19naWZcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBzZXRQcmVSZXN1bHQoZCk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p265rip6aao5o+Q56S6XCIsXCJwYXRoXCI6XCJub3RpY2VcIixcInJ1bGVcIjpcIiQuZXhwb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AgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoZGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmID0gJC5yZXF1aXJlKFxcXCJsYW56b3U/cnVsZT11Y2tr5LqRXFxcIikub25lX3VybChkYSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiXFxcXHU2ZDc3XFxcXHU5NjE0XFxcXHU4OWM2XFxcXHU3NTRjXFxcXHVmZmU1aG9tZV9ydWxlX3VybFxcXFx1ZmZlNVxcXCIgKyBnZXRQYXRoKGYpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB1cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKHVwLCB2ZXJzaW9uKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPXVja2vkupFcXFwiKS5vbmVfaW5mbyh1cCwgXFxcInVja2tcXFwiLCB2ZXJzaW9uKTtcXG4gICAgICAgICAgICB9LCB1cmwgfHwgdXAsIHZlcnNpb24pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG5cXG4gICAgaWYgKCEkLnJlcXVpcmUoXFxcInRvb2xcXFwiKS5pc0xvZ2luQ29va2llKGdldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgXFxcIlxcXCIpKSkge1xcbiAgICAgICAgY2xlYXJJdGVtKFxcXCJxdWFya0Nvb2tpZVxcXCIpO1xcbiAgICAgICAgZiA9IFxcXCJyZWRcXFwiO1xcbiAgICAgICAgVCA9IFxcXCLnmbvlvZXotKblj7dcXFwiO1xcbiAgICAgICAgdCA9IFxcXCLmnKrmo4DmtYvliLDnmbvlvZXkv6Hmga9cXFwiO1xcbiAgICAgICAgdXJsID0gJChbXFxcIui+k+WFpUNvb2tpZVxcXCIsIFxcXCLnvZHpobXnmbvlvZVcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLnvZHpobXnmbvlvZVcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpUNvb2tpZVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcInRvb2xcXFwiKS5pc0xvZ2luQ29va2llKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgaW5wdXQucmVwbGFjZSgvXFxcXHMvZywgXFxcIlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7miJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICA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cXFwiaHR0cHM6Ly9kZXZlbG9wZXIubGFuem91Zy5jb21cXFwiO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycjEpIHtcXG4gICAgICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC92YWx1ZVxcXFw7KFtcXFxcc1xcXFxTXSs/KVxcXFwkXFxcXCgvaSlbMV0pO1xcbiAgICAgICAgICAgICAgICBldmFsKCdib2R5PScgKyBodG1sLm1hdGNoKC9bXFxcXHNcXFxcU10qZGF0YSA6KFtcXFxcc1xcXFxTXSo/XFxcXH0pLFxcXFxzKy8pWzFdKTtcXG4gICAgICAgICAgICAgICAgdSA9IFN0cmluZyh1cmwpLnJlcGxhY2UoL1xcXFwuY29tLiovLCBcXFwiLmNvbS9hamF4bS5waHBcXFwiKTtcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZC5oZWFkZXJzXFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgcGF0aCA9IF8udXJsO1xcbiAgICAgICAgICAgICAgICBob3N0ID0gXy5kb207XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdSA9IGhvc3QgKyBcXFwiL2ZpbGUvXFxcIiArIHBhdGg7XFxuICAgICAgICBrID0gSlNPTi5wYXJzZShmZXRjaCh1LCB7XFxuICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvbjtcXG4gICAgICAgIGsgPSBBcnJheS5pc0FycmF5KGspID8ga1swXSA6IGs7XFxuICAgICAgICBpZiAocnVuKSByZXR1cm4gaztcXG4gICAgICAgIGxldCBmID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGU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XCJiaWdfYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIubWRvJiZIdG1sXFxcIikucmVwbGFjZSgvKDxcXFxcL3NwYW4+KT9cXFxccyo8c3Bhbj4vZ2ksIFxcXCI8YnI+XFxcIiksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8Yj7igJzigJznoa7lrprmm7TmlrDigJ3igJ08L2I+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgodXJsLCBwd2QsIGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdSdWxlX25vdXBkYXRlJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICBvbmVfdXJsXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9sYW56b3U/cnVsZT3mrYzor43pgILphY1cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IEsgPSBvbmVfdXJsKHVybCwgcHdkLCAxLCAwLCBpdGVtKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwuc3BsaXQoXFxcIj9cXFwiKVswXSwgcHdkLCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgICAgICAgICAgZiA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoSywgZik7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ojrflj5bkuIvovb3pk77mjqXlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgdXJsLCBwd2QsIGl0ZW0pLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9XFxufVwifSx7XC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gIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICB6eSA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgenUgPSBPYmplY3Qua2V5cyh6eSk7XFxuICAgICAgICBpZiAoenUubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ6YCJ5Lit6Kej5p6QXFxcIjtcXG4gICAgICAgIH0gZWxzZSBpZiAoenUubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICBqc29uID0gW3p5W3p1WzBdXV07XFxuICAgICAgICAgICAgdSA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignanhsaXN0MicpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly91Y2tr6KeE5YiZ5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXG7vv6VUZXh077+lXFxcIiArIHUgKyAnQGltcG9ydD1qczokLnJlcXVpcmUoXFxcInRvb2w/cnVsZT11Y2tr5LqRXFxcIikuc2V0UnVsZShpbnB1dCk7JztcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAganNvbiA9IHp1Lm1hcChrZXkgPT4genlba2V5XSk7XFxuICAgICAgICAgICAgdCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLliarotLTmnb9cXFwiLCBcXFwi57qv5paH5pysXFxcIl0sIDEsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHQpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliarotLTmnb9cXFwiKSB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pLmxhenlSdWxlKChncm91cCkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdwbGF0Zm9ybScsIGdyb3VwKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBncm91cCksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+WIoOmZpCcgKyBncm91cC5yZXBsYWNlKCfnu7zlkIgnLCAn5YWo6YOoJykgKyAn6KeE5YiZJyxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChncm91cCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChncm91cCA9PSBcXFwi57u85ZCIXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKCQkLnJ1bGVQYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMShcXFwiZ3JvdXBcXFwiLCBncm91cCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNhdmVKc29uKHJ1bGVzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgZ3JvdXApXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5LqrJyArIGdyb3VwLnJlcGxhY2UoJ+e7vOWQiCcsICflhajpg6gnKSArICfop4TliJknLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGdyb3VwKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwID09IFxcXCLnu7zlkIhcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbigpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXCJncm91cFxcXCIsIGdyb3VwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA9PSAwKSByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ6KeE5YiZXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHJ1bGVzKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLliarotLTmnb9cXFwiLCBcXFwi57qv5paH5pysXFxcIl0sIDEsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliarotLTmnb9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gc2hhcmVQYXN0ZSh0LCAn5LqR5Ymq6LS05p2/NicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdCA9IFxcXCJQYXN0ZVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBcXFwiVGV4dFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanhsaXN0MicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL3Vja2vop4TliJnlj6Pku6TvvIzmiZPlvIDmtbfpmJTljbPlj6/lr7zlhaVcXFxcbu+/pVxcXCIgKyB0ICsgXFxcIu+/pVxcXCIgKyB1ICsgJ0BpbXBvcnQ9anM6JC5yZXF1aXJlKFxcXCJ0b29sP3J1bGU9dWNra+S6kVxcXCIpLnNldFJ1bGUoaW5wdXQpOyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdCk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBncm91cClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIF1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSk7XFxuZC5wdXNoKHtcXG4gICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG59KTtcXG5ydWxlcyA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRHcm91cEpzb24oZmFsc2UsIFxcXCJncm91cFxcXCIsIHBsYXRmb3JtLCBcXFwi57u85ZCIXFxcIik7XFxuXFxuXFxuXFxuXFxuXFxucGlkID0gTnVtYmVyKGdldE15VmFyKCdwaWQnKSkgfHwgMDtcXG5uYW1lcyA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRHcm91cE5hbWVzKHJ1bGVzLCBcXFwic2VhcmNoX2dyb3VwXFxcIik7XFxuaWYgKHBpZCA+IG5hbWVzLmxlbmd0aCAtIDEpIHtcXG4gICAgcGlkID0gMDtcXG59XFxubmFtZXMubWFwKChncm91cCwgaSkgPT4ge1xcbiAgICBpZiAoaSA9PSBwaWQpXFxuICAgICAgICBwbGF0Zm9ybTIgPSBSaWNoKFN0cm9uZyhDb2xvcihncm91cCkpKTtcXG4gICAgZWxzZVxcbiAgICAgICAgcGxhdGZvcm0yID0gZ3JvdXA7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogcGxhdGZvcm0yLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ3BpZCcsIGkpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgaSksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5LqrJyArIGdyb3VwLnJlcGxhY2UoJ+WFqOWFqCcsICflhajpg6gnKSArICfop4TliJknLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGxhdGZvcm0sIGdyb3VwKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXCJncm91cFxcXCIsIHBsYXRmb3JtLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChncm91cCAhPSBcXFwi5YWo5YWoXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKGYgPT4gZi5zZWFyY2hfZ3JvdXAgPT0gZ3JvdXApO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA9PSAwKSByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ6KeE5YiZXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkocnVsZXMpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFwi5Ymq6LS05p2/XFxcIiwgXFxcIue6r+aWh+acrFxcXCJdLCAxLCAn6YCJ5oup5YiG5Lqr5qC85byPJykuc2VsZWN0KCh0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliarotLTmnb9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQsICfkupHliarotLTmnb82Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBcXFwiUGFzdGVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gXFxcIlRleHRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdqeGxpc3QyJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL3Vja2vop4TliJnlj6Pku6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Ws7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnvJbovpEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9ICQucmVxdWlyZSgndG9vbD9ydWxlPXVja2vkupEnKS5nZXRWYXJpYWJsZXMoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgYXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIodCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IE9iamVjdC5rZXlzKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBhcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIodCwgX1t0XSB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdydWxlX3VpZCcsIG0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzZWFyY2hfZW5hYmxlZCcsIF8uc2VhcmNoX2VuYWJsZWQgfHwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZXhwbG9yZV9lbmFibGVkJywgXy5leHBsb3JlX2VuYWJsZWQgfHwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9ydWxlRWRpdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cGFnZVRpdGxlPeinhOWImee8lui+kSZydWxlPXVja2vkupEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Yig6ZmkJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6ZmkXFxcIiArIF8uZ3JvdXAgKyBcXFwi6KeE5YiZ4oCcXFxcIiArIF8udGl0bGUgKyAn4oCd5ZCX77yfXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzor7fosKjmhY7pgInmi6njgIInKS5jb25maXJtKChtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMihtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnp7vliqgnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dSA9IHp5LnNsaWNlKDEpLm1hcChfID0+IF8udGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6nnp7vliqjkvY3nva4nKS5zZWxlY3QoKHp5LCB6dSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IC0xKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGkgKyAxLCAwLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLnNhdmVKc29uKHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHp5LCB6dSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfpgInkuK3op4TliJknOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwianhsaXN0MlxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyW21dID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwianhsaXN0MlxcXCIsIGp4bGlzdDIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WPlua2iOmAieS4rSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBqeGxpc3QyW21dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJqeGxpc3QyXFxcIiwganhsaXN0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5ZCv55So5Y+R546wJzpcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+emgeeUqOWPkeeOsCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFwiZXhwbG9yZV9lbmFibGVkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgbSwgXyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogXy5pY29uXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IF8uZ3JvdXAgKyAn5LioJyArIF8uc2VhcmNoX2dyb3VwICsgJ+S4qCcgKyAoXy54NV91cmwgfHwgKF8udXJsID8gXy51cmwgOiBfLnNlYXJjaF91cmwpLnNwbGl0KFxcXCIvXFxcIikuc2xpY2UoMCwgMykuam9pbihcXFwiL1xcXCIpKSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG0pID0+IHtcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFwic2VhcmNoX2VuYWJsZWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIG0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFv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ZSArIFxcXCLigJ3igJ1cXFwiIDogXFxcIuKAneKAnVxcXCIgKyBfLnRpdGxlKSksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigndGlkJywgaSk7XFxuICAgICAgICAgICAgICAgIGZvciAodCBvZiBbXFxcImNsYXNzXFxcIiwgXFxcImFyZWFcXFwiLCBcXFwieWVhclxcXCIsIFxcXCJzb3J0XFxcIiwgXFxcIkZ5QWxsXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIodCArIFxcXCJfaVxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ4NV93ZWJ2aWV3X3NpbmdsZVxcXCIsXFxuICAgICAgICB1cmw6IF8ueDVfZGVzYyA9PSAnMScgfHwgXy54NV91cmwgfHwgXy51cmwsXFxuICAgICAgICBkZXNjOiBfLng1X2Rlc2MgPT0gJzEnID8gJzAnIDogJ3NjcmVlbi0xMzMmJmZsb2F0JyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgY2FuQmFjazogdHJ1ZSxcXG4gICAgICAgICAgICB1YTogXy54NV91YSA/IChfLng1X3VhID09IFxcXCJQQ19VQVxcXCIgPyBQQ19VQSA6IF8ueDVfdWEpIDogTU9CSUxFX1VBLFxcbiAgICAgICAgICAgIHJlZmVyZXI6IF8ueDVfcmVmZXJlcixcXG4gICAgICAgICAgICBqczogXy54NV9qcyxcXG4gICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6ICEhXy54NV9qc0xvYWRpbmdJbmplY3QsXFxuICAgICAgICAgICAgYXV0b1BsYXk6ICEhXy54NV9hdXRvUGxheSxcXG4gICAgICAgICAgICBmbG9hdFZpZGVvOiAhIV8ueDVfZmxvYXRWaWRlbyxcXG4gICAgICAgICAgICBpbWdMb25nQ2xpY2s6ICFfLng1X2ltZ0xvbmdDbGljayxcXG4gICAgICAgICAgICBzaG93UHJvZ3Jlc3M6ICFfLng1X3Nob3dQcm9ncmVzcyxcXG4gICAgICAgICAgICBibG9ja1J1bGVzOiBldmFsKF8ueDVfYmxvY2tSdWxlcykgfHwgW10sXFxuICAgICAgICAgICAgdXJsSW50ZXJjZXB0b3I6ICQudG9TdHJpbmcoKHVybEludGVyY2VwdG9yX2pzLCB4NVVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlLmNvbS9cXFwiKSB8fCBpbnB1dC5pbmNsdWRlcyhcXFwiYWxpeXVuZHJpdmUubmV0L1xcXCIpIHx8IGlucHV0LmluY2x1ZGVzKFxcXCJhbGlwYW4uY29tL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiAn5LqR55uY5ZCbLueugCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9hbGl5dW4jbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU95LqR55uY5ZCbLueugCZwYWdlPWZ5cGFnZSZyZWFsdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJxdWFyay5jblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWkuOWFi+e9keebmFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU9dWNra+S6kSZyZWFsdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgeDVfdXJsSW50ZXJjZXB0b3IgPSBuZXcgRnVuY3Rpb24oXFxcImlucHV0XFxcIiwgXFxcIng1VXJsXFxcIiwgdXJsSW50ZXJjZXB0b3JfanMpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4geDVfdXJsSW50ZXJjZXB0b3IoaW5wdXQsIHg1VXJsKTtcXG4gICAgICAgICAgICB9LCBfLng1X3VybEludGVyY2VwdG9yLCBcXFwiaGlrZXI6Ly9wYWdlL3J1bGVIb21lI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPXVja2vkupEmcGFnZT1meXBhZ2UmcnVsZU5hbWU9XFxcIiArIF8udGl0bGUgKy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AgICAgICAgIHRpdGxlOiBTdHJvbmcoXFxcIuinhOWImeeuoeeQhlxcXCIpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9ydWxlTGlzdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cGFnZVRpdGxlPeinhOWImeeuoeeQhiZydWxlPVxcXCIgKyBpZCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl94aXV0YW5cXFwiXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDpk77mjqUk5o+Q5Y+W56CBJyxcXG4gICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKC9xdWFyay5jbi4qXFxcXC9zXFxcXC8uKy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3JlYWx1cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChpbnB1dCkgKyBcXFwiJnJ1bGU9dWNra+S6kSZzaGFyZVB3ZD1cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaFxcXCIsXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZToga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcigna2V5d29yZCcsaW5wdXQpXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IocnVsZVR5cGUsIFxcXCIjMzM5OWNjXFxcIikpKSxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLnu7zlkIhcXFwiXS5jb25jYXQoZ3JvdXBzKS5tYXAobmFtZSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChuYW1lID09IHJ1bGVUeXBlKSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZWFyY2hfdHlwZS5pbmRleE9mKG5hbWUpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gUmljaChcXFwiPFM+XFxcIiArIG5hbWUgKyBcXFwiPC9TPlxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBuYW1lO1xcbiAgICAgICAgICAgIH0pLCAzLCBcXFwi6YCJ5oup5pCc57Si57G75YirXFxcIikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmluZGV4T2YoXFxcIjxTPlxcXCIpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ5a+55bqU6KeE5YiZXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmRleE9mKFxcXCI8XFxcIikgPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVUeXBlJywgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwicnVsZUdyb3VwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCJzaWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2VhcmNoX2dyb3VwLm1hcCgobmFtZSwgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBydWxlR3JvdXAgPT0gaSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVHcm91cCcsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwic2lkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzZWFyY2hfcnVsZS5tYXAoKF8sIGkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogc2lkID09IGkgPyBSaWNoKFN0cm9uZyhDb2xvcihfLnRpdGxlKSkpIDogXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBnZXRNeVZhcigna2V5d29yZCcpKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzaWQnLCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuXFxuXFxuXFxuXFxuXFxuICAgIGlmIChfU09VKSB7XFxuICAgICAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliqDovb3nrKxcXFwiICsgcGFnZSArIFxcXCLpobXkuK3vvIzov5vluqbvvJoxL1xcXCIgKyBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChfUEFHRSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5rKh5pyJ5Y+v55So55qE5pCc57Si6KeE5YiZXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2UgaWYgKF9QQUdFIHx8IHJ1bGUudXJsLm1hdGNoKFxcXCJmeXBhZ2VcXFwiKSkge1xcbiAgICAgICAgaWYgKF9QQUdFKSB7XFxuICAgICAgICAgICAgaWYgKHJ1bGUudGl0bGUgIT0gXFxcIuiBmuaQnFxcXCIpIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+JyArIENvbG9yKHJ1bGUudGl0bGUsICcjZmY2NjAxJykgKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgW1xcXCJjbGFzc1xcXCIsIFxcXCJhcmVhXFxcIiwgXFxcInllYXJcXFwiLCBcXFwic29ydFxcXCIsIFxcXCJGeUFsbFxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcih0ICsgXFxcIl9pXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICB9LCBcXFwiaGlrZXI6Ly9wYWdlL3J1bGVIb21lP3J1bGU9dWNra+S6kSZwYWdlPWZ5cGFnZSZydWxlTmFtZT1cXFwiICsgcnVsZS50aXRsZSArIFxcXCImcnVsZUdyb3VwPVxcXCIgKyBydWxlLmdyb3VwKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgaW1nOiBydWxlLmljb24sXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBob21lOiAxXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBnZXRSdWxlR3JvdXAoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGJhc2VVcmwgPSBob21lX2Jhc2VVcmw7XFxuICAgICAgICBldmFsKFN0cmluZyhydWxlLnByZVJ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sXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC9meXBhZ2VAKFteXFxcXD9cXFxcJlxcXFw7XFxcXCNcXFxcXFxcIlxcXFwnXFxcXHtdKylAPy9nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlMiA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkMS5zcGxpdChcXFwiQFxcXCIpLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFnZTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICApXFxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL2Z5cGFnZS9nLCBwYWdlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcKlxcXFwqL2csIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhZ2UgPT0gMSB8fCBydWxlLnNlYXJjaF91cmwubWF0Y2goXFxcImZ5cGFnZVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChydWxlLnByZVJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWFyY2hmaW5kID0gbmV3IEZ1bmN0aW9uKFxcXCJydWxlXFxcIiwgXFxcImJhc2VVcmxcXFwiLCBcXFwia2V5d29yZFxcXCIsIFxcXCJwYWdlXFxcIiwgcnVsZS5zZWFyY2hGaW5kKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHNlYXJjaGZpbmQocnVsZSwgYmFzZVVybCwga2V5d29yZCwgcGFnZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFsaXN0KSByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlc2NUaXBzID0gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBydWxlLnRpdGxlLmZvbnRjb2xvcihcXFwiI2YxM2I2NmFcXFwiKSArIFxcXCImbmJzcDsmbmJzcDtcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXNMaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNMaXN0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLmluY2x1ZGVzKFxcXCLigJzigJzigJ3igJ1cXFwiKSA/IGl0LnRpdGxlIDogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBpdC50aXRsZS5yZXBsYWNlKC88XFxcXC9lbT4vZywgXFxcIlxcXCIpLnJlcGxhY2UobmV3IFJlZ0V4cChrZXl3b3JkLCBcXFwiZ1xcXCIpLCBcXFwiPHN0cm9uZz48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAjMUU5MEZGXFxcXFxcXCI+XFxcIiArIGtleXdvcmQgKyBcXFwiPC9zcGFuPjwvc3Ryb25nPlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzY1RpcHMgKyAoaXQuZGVzYyB8fCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXQuaW1nIHx8IGl0LnBpY191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQuY29sX3R5cGUgfHwgXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub1BpYzogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQuZXh0cmEgfHwge30pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzTGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coXy50aXRsZSArIFxcXCI6XFxcIiArIGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBhcmFtOiBpdCxcXG4gICAgICAgICAgICBpZDogXFxcInVja2tfcnVsZUBcXFwiICsgaXQudGl0bGVcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgcGFyYW0uaSArPSAxO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHJlc3VsdCkpIHtcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbShcXFwiX25vdGhhdmVcXFwiKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHJlc3VsdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID09PSBwYXJhbS5hbGwpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCFyZXN1bHQgfHwgIXJlc3VsdC5sZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oXFxcIl9ub3RoYXZlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOi1hOa6kOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcIl9ub3RoYXZlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6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mVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgbmFtZSwgIWkpLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzUnXFxuICAgIH0pO1xcbn0pO1xcbmlucHV0X3B1c2ggPSAoZGVzYywgaWQsIHZhbHVlLCBqc29uLCBoZWlnaHQpID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICB0aXRsZTogXFxcIjwvPlxcXCIsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGdyb3VwID0gJC5yZXF1aXJlKFxcXCJjb25maWdzP3J1bGU9dWNra+S6kVxcXCIpLmdldEdyb3VwTmFtZXMoMCwgXFxcInNlYXJjaF9ncm91cFxcXCIpO1xcbiAgICAgICAgICAgIGlmICghZ3JvdXAubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICQoZ3JvdXAsIDMsIFxcXCLpgInmi6nop4TliJnliIbnu4RcXFwiKS5zZWxlY3QoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oZXh0cmEsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBpZCk7XFxuICAgICAgICB9LCBpZCksXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHtcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKGlkLCB2YWx1ZSksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IGBwdXRNeVZhcihcXFwiJHtpZH1cXFwiLCBpbnB1dClgLFxcbiAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYScsXFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiB0cnVlLFxcbiAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICBoZWlnaHQ6IGhlaWdodCB8fCA1LFxcbiAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgIH0sIGpzb24gfHwge30pXFxuICAgIH0pO1xcbn1cXG5zd2l0Y2ggKHJ1bGVfdGlkKSB7XFxuICAgIGNhc2UgJ+WfuuacrCc6XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDlkI3np7AnLCAndGl0bGUnLCAnJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDlm77moIcnLCAnaWNvbicsICcnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOS9nOiAhScsICdhdXRob3InLCAn5L2a5ZCNJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIxKc0xpYicsICdwcmVSdWxlJywgJycsIHtcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAzXFxuICAgICAgICAgICAgfV0sXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcbiAgICAgICAgICAgIGlucHV0X3B1c2goYSwgYiwgYywgZSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmkJzntKInOlxcbiAgICAgICAgW1xcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5pCc57Si6ZO+5o6lJywgJ3NlYXJjaF91cmwnLCAnJ10sXFxuICAgICAgICAgICAgWyflv4XloavvvIzmkJzntKLliIbnu4QnLCAnc2VhcmNoX2dyb3VwJywgJ+WFqOWFqCcsIHtcXG4gICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiBmYWxzZSxcXG4gICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICBbJ+W/heWhq++8jOWIl+ihqOinhOWImVxcXFxu5o+Q5L6b5Y+Y6YePOiBiYXNlVXJsLCBrZXl3b3JkLCBwYWdlXFxcXG5cXFxcbumcgOimgei/lOWbnuaVsOe7hO+8mnJldHVybiBbXTsnLCAnc2VhcmNoRmluZCcsICcnLCB7XFxuICAgICAgICAgICAgICAgIGhlaWdodDogNVxcbiAgICAgICAgICAgIH1dLFxcbiAgICAgICAgXS5tYXAoW2EsIGIsIGMsIGVdID0+IHtcXG4gICAgICAgICAgICBpbnB1dF9wdXNoKGEsIGIsIGMsIGUsIDEpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAn5Y+R546wJzpcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn5L2/55SoIHg1X3dlYnZpZXdfc2luZ2xlJyksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChleHBsb3JlX1g1KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdleHBsb3JlX1g1JywgZXhwbG9yZV9YNSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBleHBsb3JlX1g1ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGV4cGxvcmVfWDUgPyA1NSA6IDYzKSArICcuc3ZnJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDpk77mjqUnLCAndXJsJywgJycsIHtcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxXFxuICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgWyflv4XloavvvIzliJfooajop4TliJlcXFxcbuWQr+eUqHg15bCx5LiN55So5YaZ5LqGXFxcXG5cXFxcbue7p+aJv+aVsOe7hGTvvJogZC5wdXNoKGpzb24pOycsICdmaW5kX3J1bGUnLCAnJ10sXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcbiAgICAgICAgICAgIGlucHV0X3B1c2goYSwgYiwgYywgZSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmm7/mjaInOlxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCflj5HnjrDpk77mjqXmm7/mjaInKSxcXG4gICAgICAgICAgICBkZXNjOiAn6YCJ5aGrJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIFtcXG4gICAgICAgICAgICBbJ+WIhuexu+WQjeensCcsICdjbGFzc19uYW1lJywgJyddLFxcbiAgICAgICAgICAgIFsn5YiG57G75pu/5o2iJywgJ2NsYXNzX3VybCcsICcnXSxcXG4gICAgICAgICAgICBbJ+WcsOWMuuWQjeensCcsICdhcmVhX25hbWUnLCAnJ10sXFxuICAgICAgICAgICAgWyflnLDljLrmm7/mjaInLCAnYXJlYV91cmwnLCAnJ10sXFxuICAgICAgICAgICAgWyflubTku6PlkI3np7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2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7nvZHnq5nliqDovb3kuK3kuZ/miafooYw8L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2pzTG9hZGluZ0luamVjdCcsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfanNMb2FkaW5nSW5qZWN0ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfanNMb2FkaW5nSW5qZWN0ID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlucHV0X3B1c2goXFxcIlxcXCIsIFxcXCJ4NV9qc1xcXCIsIFxcXCJcXFwiLCB7fSwgMyk7XFxuXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCfmi6bmiKrotYTmupAnKSxcXG4gICAgICAgICAgICBkZXNjOiAn6YCJ5aGrJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICA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pbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2ltZ0xvbmdDbGljaycsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfaW1nTG9uZ0NsaWNrID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfaW1nTG9uZ0NsaWNrID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7kuI3mmL7npLrov5vluqbmnaE8L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X3Nob3dQcm9ncmVzcycsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfc2hvd1Byb2dyZXNzID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfc2hvd1Byb2dyZXNzID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mgqzmta7ll4XmjqLmkq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ICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcoJ3g15omp5bGVJyksXFxuICAgICAgICAgICAgZGVzYzogJ+mAieWhqycsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6aaW6aG15LiN5pi+56S65pCc57Si5qGGPC9iPicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh4KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd4NV9kZXNjJywgeCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB4NV9kZXNjID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfZGVzYyA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBpbnB1dF9wdXNoKFxcXCJ1cmzvvIzlj5HnjrDpk77mjqXlkox4NemTvuaOpeWGsueqgeaXtuWhq+WGmVxcXCIsIFxcXCJ4NV91cmxcXFwiLCBcXFwiXFxcIiwge30sIDEpO1xcbiAgICAgICAgaW5wdXRfcHVzaChcXFwiaG9tZV9qc++8jOS4jeaY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cXFwiICsga2V5LFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgW10pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlpID0gaGlzdG9yeS5pbmRleE9mKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgaGlzdG9yeSk7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcIjprZXk6XFxcIiArIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeS5sZW5ndGggPT09IDApIGFkZEl0ZW1BZnRlcihpZCArIFxcXCI6c2VhcmNoSGlzdG9yeVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAg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aWZ0KGtleXdvcmQpO1xcbiAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcInNlYXJjaEhpc3RvcnlcXFwiLCBoaXN0b3J5KTtcXG5cXG4gICAgICAgICAgICBsZXQgZGQgPSBkO1xcbiAgICAgICAgICAgIGJhc2VVcmwgPSBydWxlLnNlYXJjaF91cmxcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoXFxuICAgICAgICAgICAgICAgICAgICAvZnlwYWdlQChbXlxcXFw/XFxcXCZcXFxcO1xcXFwjXFxcXFxcXCJcXFxcJ1xcXFx7XSspQD8vZyxcXG4gICAgICAgICAgICAgICAgICAgICgkMCwgJDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlMiA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcIkBcXFwiKS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoU3RyaW5nKCdwYWdlMj1wYWdlMicgKyBfKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBhZ2UyO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICApXFxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9meXBhZ2UvZywgcGFnZSlcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcXFwqXFxcXCovZywga2V5d29yZCk7XFxuICAgICAgICAgICAgc2VhcmNoZmluZCA9IG5ldyBGdW5jdGlvbihcXFwicnVsZVxcXCIsIFxcXCJiYXNlVXJsXFxcIiwgXFxcImtleXdvcmRcXFwiLCBcXFwicGFnZVxcXCIsIHJ1bGUuc2VhcmNoRmluZCk7XFxuICAgICAgICAgICAgbGlzdCA9IHNlYXJjaGZpbmQocnVsZSwgYmFzZVVybCwga2V5d29yZCwgcGFnZSk7XFxuICAgICAgICAgICAgZC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rbGluazovL3d3dy51Yy5jbi9iMjBiODRmZDczNWE4ZGQzZjc1NDExMjliYWNjNGU5YT9hY3Rpb249b3Blbl91cmwmdXJsPWh0dHBzOi8vcGFuLnF1YXJrLmNuL3MvXFxcIiArIHNoYXJlSWQ7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gXFxcIueZu+W9lVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLovpPlhaVDb29raWVcXFwiLCBcXFwi572R6aG155m75b2VXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLnvZHpobXnmbvlvZVcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvbG9naW5cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpUNvb2tpZVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQucmVxdWlyZShcXFwidG9vbFxcXCIpLmlzTG9naW5Db29raWUoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJxdWFya0Nvb2tpZVxcXCIsIGlucHV0LnJlcGxhY2UoL1xcXFxzL2csIFxcXCJcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9Db29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gXFxcIuWOn+eUu+S4i+i9vee6v+eoi1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoZ2V0SXRlbShcXFwic3BlZWRUaHJlYWRcXFwiLCBcXFwiMTBcXFwiKSwgXFxcIuivt+i+k+WFpTMtMzLkuYvpl7TnmoTmlbTmlbBcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgc3BlZWRUaHJlYWQgPSBwYXJzZUludChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc3BlZWRUaHJlYWQgPCAzIHx8IHNwZWVkVGhyZWFkID4gMzIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5LiN5ZCI5rOVXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgU3RyaW5nKHNwZWVkVGhyZWFkKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgc2hhcmVJZCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfNFxcXCIsXFxuICAgICAgICBwaWNfdXJsOiBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL2ltZy9hbGlfZmlsZWludG8uc3ZnXFxcIixcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICA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c3Rva2VuLCBjYXRlZ29yeSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxDYWNoZSA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJwbGF5VXJsQ2FjaGVcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocGxheVVybENhY2hlW2ZpZF0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybENhY2hlW2ZpZF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAkLnJlcXVpcmUoXFxcInBsYXlcXFwiKS5nZXRQbGF5VXJsKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlVcmxDYWNoZVtmaWRdID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJwbGF5VXJsQ2FjaGVcXFwiLCBwbGF5VXJsQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uZmlkLCBpdGVtLnNoYXJlX2ZpZF90b2tlbiwgc2hhcmVJZCwgcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLCBpdGVtLm9ial9jYXRlZ29yeSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzdHlsZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLmZpZCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5bGlzdCAnICsgaXRlbS5vYmpfY2F0ZWd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ICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5zdWNjZXNzQ2FsbGJhY2soYm9keSwgcmVzKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFN0cmluZyhyZXMuc3RhdHVzQ29kZSkpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlcnIpIHtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgZXJyID0gdGhpcy5lcnJvclR5cGVDYWxsYmFjayhlcnIsIHJlcyk7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG5cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmICh0aGlzLnJldHJ5Q291bnQpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdHJ5UmVzdWx0ID0gdGhpcy5lcnJvckNhbGxiYWNrV2l0aFJldHJ5KGVyciwgcmVzLCB0aGlzKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAodHJ5UmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudC0tO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5zdGFydCh0b0pzb24pO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudCA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmVycm9yQ2FsbGJhY2soZXJyLCByZXMpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JDYWxsYmFjayhlcnIsIHJlcyk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1c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xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJC5yZXF1aXJlKFxcXFxcXFwidG9vbFxcXFxcXFwiKS5pc0xvZ2luQ29va2llKGlucHV0KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwicXVhcmtDb29raWVcXFxcXFxcIiwgaW5wdXQucmVwbGFjZSgvXFxcXFxcXFxzL2csIFxcXFxcXFwiXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/orr7nva7miJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL0Nvb2tpZeagvOW8j+mUmeivr1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09IFxcXFxcXFwi5Y6f55S75LiL6L2957q/56iLXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChnZXRJdGVtKFxcXFxcXFwic3BlZWRUaHJlYWRcXFxcXFxcIiwgXFxcXFxcXCIxMFxcXFxcXFwiKSwgXFxcXFxcXCLor7fovpPlhaUzLTMy5LmL6Ze055qE5pW05pWwXFxcXFxcXCIpLmlucHV0KCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNwZWVkVGhyZWFkID0gcGFyc2VJbnQoaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoc3BlZWRUaHJlYWQgPCAzIHx8IHN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ZW0uaW5jbHVkZV9pdGVtcyArICfpobkgICcsXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LzI3LnN2Z1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvcXVhcmtMaXN0P3BhZ2U9ZnlwYWdlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHN0eWxlLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlSWQsXFxcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlUHdkLFxcXFxuICAgICAgICAgICAgICAgICAgICBzaGFyZVRva2VuOiBxdWFya1NoYXJlQXBpLmdldFRva2VuKCksXFxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVJZDogaXRlbS5maWQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldEhlYWQoaXRlbS5vYmpfY2F0ZWdvcnkpICsgaXRlbS5maWxlX25hbWUsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogJC5kYXRlRm9ybWF0KGl0ZW0udXBkYXRlZF9hdCwgJ3l5eXktTU0tZGQnKSArICcgICcgKyBmb3JtYXRTaXplKGl0ZW0uc2l6ZSksXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaXRlbS50aHVtYm5haWwsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxDYWNoZSA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwicGxheVVybENhY2hlXFxcXFxcXCIsIHt9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBsYXlVcmxDYWNoZVtmaWRdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybENhY2hlW2ZpZF07XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gJC5yZXF1aXJlKFxcXFxcXFwicGxheVxcXFxcXFwiKS5nZXRQbGF5VXJsKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGxheVVybENhY2hlW2ZpZF0gPSB1cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBsYXlVcmxDYWNoZVxcXFxcXFwiLCBwbGF5VXJsQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uZmlkLCBpdGVtLnNoYXJlX2ZpZF90b2tlbiwgc2hhcmVJZCwgcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLCBpdGVtLm9ial9jYXRlZ29yeSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHN0eWxlLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLmZpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICA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1BZ2VudFxcXFxcXFwiOiBcXFxcXFxcImNvbS5zdHViLlN0dWJBcHAvMS4zLjAgKExpbnV4O0FuZHJvaWQgMTQpIEFuZHJvaWRYTWVkaWEzLzEuMS4xXFxcXFxcXCJcXFxcbiAgICAgICAgfTtcXFxcbiAgICAgICAgaWYgKGNhdGVnb3J5ID09IFxcXFxcXFwidmlkZW9cXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgbGV0IHBsYXlNb2RlID0gZ2V0SXRlbShcXFxcXFxcInF1YXJrX3BsYXlNb2RlXFxcXFxcXCIsIFxcXFxcXFwi6L2s56CBXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgaWYgKHBsYXlNb2RlID09PSBcXFxcXFxcIui9rOeggVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHZpZGVvUmVzID0gZ2V0UHJldmlld1ZpZGVvKGFzZmlkKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdmlkZW9MaXN0ID0gdmlkZW9SZXMuZGF0YS52aWRlb19saXN0O1xcXFxuICAgICAgICAgICAgICAgIGxldCBwbGF5TGlzdCA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtdLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW11cXFxcbiAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIHZpZGVvTGlzdC5maWx0ZXIodiA9PiB2LmFjY2Vzc2FibGUpLmZvckVhY2godiA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlMaXN0Lm5hbWVzLnB1c2godi5yZXNvbHV0aW9uKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGxheUxpc3QudXJscy5wdXNoKHYudmlkZW9faW5mby51cmwgKyBcXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdC5oZWFkZXJzLnB1c2gocGxheUhlYWRlcik7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgY3JlYXRlRGVsZXRlVGFzayhhc2ZpZCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHBsYXlMaXN0KTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlVcmwgPSBnZXREb3dubG9hZFVybChhc2ZpZCkuZGF0YVswXS5kb3dubG9hZF91cmw7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICBuYW1lczogW1xcXFxcXFwi5Y6f55S7XFxcXFxcXCJdLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbcGxheVVybCArIFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSMjZmFzdFBsYXlNb2RlIyN0aHJlYWRzPVxcXFxcXFwiICsgZ2V0SXRlbShcXFxcXFxcInNwZWVkVGhyZWFkXFxcXFxcXCIsIFxcXFxcXFwiMTBcXFxcXFxcIikgKyBcXFxcXFxcIiNcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFtwbGF5SGVhZGVyXVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjcmVhdGVEZWxldGVUYXNrKGFzZmlkKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocGxheUxpc3QpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGVsc2UgeyAvLyDkuI3mmK/op4bpopHotYTmupBcXFxcbiAgICAgICAgICAgIGxldCBwbGF5SW5mbyA9IGdldERvd25sb2FkVXJsKGFzZmlkKS5kYXRhWzBdO1xcXFxuICAgICAgICAgICAgbGV0IHBsYXlVc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N3aXRjaCAoU3RyaW5nKHR5cGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgY2FzZSAnUGFzdGUnOlxcXFxuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gcGFyc2VQYXN0ZSh0ZXh0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgY2FzZSAnTGFuem91JzpcXFxcbiAgICAgICAgICAgICAgICAgICAgW3VybCwgcHdkXSA9IHRleHQuc3BsaXQoXFxcXFxcXCIjI1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZHVybCA9ICQucmVxdWlyZSgnbGFuem91P3J1bGU9dWNra+S6kScpLm9uZV91cmwodXJsLCBwd2QsIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gU3RyaW5nKGZldGNoKGR1cmwpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKChzcCA9IHRleHQuc3BsaXQoXFxcXFxcXCLvv6VcXFxcXFxcIikpLmxlbmd0aCA9PSAzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gc3BbMl0uc3BsaXQoXFxcXFxcXCJAXFxcXFxcXCIpWzBdLnRyaW0oKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGFycjEgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZSh0ZXh0KSk7XFxcXG5cXFxcblxcXFxuICAgICAgICAgICAgLy8g5ZCI5bm277yM5Y676YeNXFxcXG4gICAgICAgICAgICBhcnIyID0gJC5yZXF1aXJlKFxcXFxcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFxcXFxcIikuZ2V0SnNvbigpO1xcXFxuICAgICAgICAgICAgYXJyMyA9IGFycjIuY29uY2F0KGFycjEpLmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBvYmouZ3JvdXAgPT09IG8uZ3JvdXAgJiYgb2JqLnRpdGxlID09PSBvLnRpdGxlICYmIChvYmoudGltZSA+IG8udGltZSB8fCBvYmoudGltZSA9PSBvLnRpbWUpKSA9PT0gaW5kZXg7XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICQucmVxdWlyZShcXFxcXFxcImNvbmZpZ3M/cnVsZT11Y2tr5LqRXFxcXFxcXCIpLnNhdmVKc29uKGFycjMpO1xcXFxuXFxcXG5cXFxcbiAgICAgICAgICAgIC8vIOiuoeeul+S9memHj1xcXFxuICAgICAgICAgICAgeCA9IGFycjMubGVuZ3RoIC0gYXJyMi5sZW5ndGg7XFxcXG4gICAgICAgICAgICBmID0gYXJyMS5sZW5ndGggLSB4XFxcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLlr7zlhaXmiJDlip/vvIzmlrDlop7vvJpcXFxcXFxcIiArIHggKyBcXFxcXFxcIiDopobnm5bvvJpcXFxcXFxcIiArIGYpO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5a+85YWl5aSx6LSlXFxcXFxcXCIpO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSxcXFxcblxcXFxuXFxcXG5cXFxcblxcXFxuICAgIHNldEVkaXQoKSB7XFxcXG4gICAgICAgIF8gPSB7XFxcXG4gICAgICAgICAgICBncm91cDogZ2V0TXlWYXIoXFxcXFxcXCJncm91cFxcXFxcXFwiLCBcXFxcXFxcIuWkuOWFi1xcXFxcXFwiKS50cmltKCksIC8vIOinhOWImSDnsbvliKtcXFxcbiAgICAgICAgICAgIHNlYXJjaF9lbmFibGV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b24oKTtcXFxcbiAgICAgICAgICAgICAgICB1aWRzID0ganhsaXN0Lm1hcChfXyA9PiBtZDUoX18uZ3JvdXAgKyBfXy50aXRsZSkpO1xcXFxuICAgICAgICAgICAgICAgIGkgPSB1aWRzLmluZGV4T2YoZ2V0TXlWYXIoJ3J1bGVfdWlkJywgJy0xJykpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpID09IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGp4bGlzdC5wdXNoKF8pO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGp4bGlzdC5zcGxpY2UoaSwgMSwgXyk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdGlkJyk7XFxcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcigncnVsZV91aWQnKTtcXFxcbiAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBtZDUob2JqLmdyb3VwICsgb2JqLnRpdGxlKSA9PT0gbWQ1KG8uZ3JvdXAgKyBvLnRpdGxlKSAmJiAob2JqLnRpbWUgPiBvLnRpbWUgfHwgb2JqLnRpbWUgPT09IG8udGltZSkpID09PSBpbmRleDtcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcXFxcXCJjb25maWdzP3J1bGU9dWNra+S6kVxcXFxcXFwiKS5zYXZlSnNvbihqeGxpc3QpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBiYWNrKHRydWUpLCAndG9hc3Q6Ly/kv53lrZjmiJDlip8nO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR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AgICAgIHBhZ2UyID0gcGFnZTtcXFxcbiAgICAgICAgICAgICAgICAkMS5zcGxpdChcXFxcXFxcIkBcXFxcXFxcIikubWFwKF8gPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBwYWdlMjtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgKVxcXFxuICAgICAgICAucmVwbGFjZSgvZnlwYWdlL2csIHBhZ2UpXFxcXG4gICAgICAgIC5yZXBsYWNlKFxcXFxuICAgICAgICAgICAgL2Z5KGNsYXNzfGFyZWF8eWVhcnxzb3J0KS9nLFxcXFxuICAgICAgICAgICAgKCQwLCAkMSkgPT4gcnVsZVskMSArICdfdXJsJ11bZXZhbCgkMSArICdfaScpXSB8fCBcXFxcXFxcIlxcXFxcXFwiXFxcXG4gICAgICAgIClcXFxcbiAgICAgICAgLnJlcGxhY2UoXFxcXG4gICAgICAgICAgICAvZnlBbGwvZyxcXFxcbiAgICAgICAgICAgICgkMCwgJDEpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBGeUFsbF9paSA9IEZ5QWxsX2k7XFxcXG4gICAgICAgICAgICAgICAgaWYgKEZ5QWxsX2lpID4gKHJ1bGUuY2xhc3NfaSAtIDEpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIEZ5QWxsX2lpIC09IHJ1bGUuY2xhc3NfaTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKEZ5QWxsX2lpID4gKHJ1bGUuYXJlYV9pIC0gMSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIEZ5QWxsX2lpIC09IHJ1bGUuYXJlYV9pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZ5QWxsX2lpID4gKHJ1bGUueWVhcl9pIC0gMSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcnVsZS5zb3J0X3VybFtGeUFsbF9paSAtIHJ1bGUueWVhcl9pXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUueWVhcl91cmxbRnlBbGxfaWldO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuYXJlYV91cmxbRnlBbGxfaWldO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuY2xhc3NfdXJsW0Z5QWxsX2lpXTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICk7XFxcXG4gICAgcmV0dXJuIGJhc2VVO1xcXFxufVxcXFxuY29uc3QgZ2V0UnVsZUdyb3VwID0gKGNvbF90eXBlLCBTb3UpID0+IHtcXFxcbiAgICBmb3IgKGl0IG9mIFsnY2xhc3MnLCAnYXJlYScsICd5ZWFyJywgJ3NvcnQnXSkge1xcXFxuICAgICAgICBldmFsKGBpbmRleCA9IHtcXFxcbiAgICBjbGFzczogMCxcXFxcbiAgICBhcmVhOiBydWxlLmNsYXNzX2ksXFxcXG4gICAgeWVhcjogcnVsZS5jbGFzc19pICsgcnVsZS5hcmVhX2ksXFxcXG4gICAgc29ydDogcnVsZS5jbGFzc19pICsgcnVsZS5hcmVhX2kgKyBydWxlLnllYXJfaSxcXFxcbn1baXRdXFxcXG5ydWxlLiR7aXR9X25hbWUubWFwKChuYW1lLCBpKSA9PiB7XFxcXG4gICAgaWYgKGlzRnlBbGwpIHtcXFxcbiAgICAgICAgaSA9IGluZGV4ICsgaTtcXFxcbiA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gICAgICAgICB2ID0gdmVyc2lvbiArIDE7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYgKHZlcnNpb24gPCB2KSB7XFxcXG4gICAgICAgICAgICBmID0gXFxcXFxcXCJyZWRcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIHQgPSBcXFxcXFxcIuajgOa1i+WIsOaWsOeJiOabtOaWsO+8jOeCueWHu+S6huino+ivpuaDheOAglxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgVCA9IFxcXFxcXFwi5pu05paw5YaF5a65XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICBpZiAodXAgPT0gJycpIHtcXFxcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDmj5DnpLonLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAn5qOA5rWL5Yiw5L2g55qE6KeE5YiZ54mI5pys5bCP5LqO5pyN5Yqh5Zmo54mI5pys77yM5piv5ZCm56uL5Y2z5pu05paw77yfJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoZGEpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAkLnJlcXVpcmUoXFxcXFxcXCJsYW56b3U/cnVsZT11Y2tr5LqRXFxcXFxcXCIpLm9uZV91cmwoZGEpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnMScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiXFxcXFxcXFx1NmQ3N1xcXFxcXFxcdTk2MTRcXFxcXFxcXHU4OWM2XFxcXFxcXFx1NzU0Y1xcXFxcXFxcdWZmZTVob21lX3J1bGVfdXJsXFxcXFxcXFx1ZmZlNVxcXFxcXFwiICsgZ2V0UGF0aChmKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfS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XFxcXFxcIue9kemhteeZu+W9lVxcXFxcXFwiXSkuc2VsZWN0KCgpID0+IHtcXFxcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcXFxcXCLnvZHpobXnmbvlvZVcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9sb2dpblxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuivt+i+k+WFpUNvb2tpZVxcXFxcXFwiKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcXFxcXCJ0b29sXFxcXFxcXCIpLmlzTG9naW5Db29raWUoaW5wdXQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwicXVhcmtDb29raWVcXFxcXFxcIiwgaW5wdXQucmVwbGFjZSgvXFxcXFxcXFxzL2csIFxcXFxcXFwiXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9Db29raWXmoLzlvI/plJnor69cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0gZWxzZSBpZiAoIXQpIHtcXFxcbiAgICAgICAgVCA9IFxcXFxcXFwi56iL5bqP6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XRjaCgvbGluayA9IFsnXFxcXFxcXCJdKFteXFxcXFxcXCInXSspL2kpWzFdO1xcXFxuICAgICAgICAgICAgaG9zdCA9IHVybC5tYXRjaCgvXiguKj9cXFxcXFxcXC5jb21cXFxcXFxcXC8pLylbMV07XFxcXG4gICAgICAgICAgICByZXR1cm4gb25lX3VybChob3N0ICsgcGF0aCwgcHdkLCBydW4pO1xcXFxuICAgICAgICB9IGNhdGNoIChlcnIwKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIHBhdGggPSBodG1sLm1hdGNoKC8nKFxcXFxcXFxcPy4rPyknLylbMV07XFxcXG4gICAgICAgICAgICAgICAgaG9zdCA9IFxcXFxcXFwiaHR0cHM6Ly9kZXZlbG9wZXIubGFuem91Zy5jb21cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycjEpIHtcXFxcbiAgICAgICAgICAgICAgICBldmFsKGh0bWwubWF0Y2goL3ZhbHVlXFxcXFxcXFw7KFtcXFxcXFxcXHNcXFxcXFxcXFNdKz8pXFxcXFxcXFwkXFxcXFxcXFwoL2kpWzFdKTtcXFxcbiAgICAgICAgICAgICAgICBldmFsKCdib2R5PScgKyBodG1sLm1hdGNoKC9bXFxcXFxcXFxzXFxcXFxcXFxTXSpkYXRhIDooW1xcXFxcXFxcc1xcXFxcXFxcU10qP1xcXFxcXFxcfSksXFxcXFxcXFxzKy8pWzFdKTtcXFxcbiAgICAgICAgICAgICAgICB1ID0gU3RyaW5nKHVybCkucmVwbGFjZSgvXFxcXFxcXFwuY29tLiovLCBcXFxcXFxcIi5jb20vYWpheG0ucGhwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKHBvc3QodSwge1xcXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkLmhlYWRlcnNcXFxcbiAgICAg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XFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliKDpmaQnICsgZ3JvdXAucmVwbGFjZSgn57u85ZCIJywgJ+WFqOmDqCcpICsgJ+inhOWImScsXFxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChncm91cCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXAgPT0gXFxcXFxcXCLnu7zlkIhcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoJCQucnVsZVBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMShcXFxcXFxcImdyb3VwXFxcXFxcXCIsIGdyb3VwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zYXZlSnNvbihydWxlcyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBncm91cClcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliIbkuqsnICsgZ3JvdXAucmVwbGFjZSgn57u85ZCIJywgJ+WFqOmDqCcpICsgJ+inhOWImScsXFxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChncm91cCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXAgPT0gXFxcXFxcXCLnu7zlkIhcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbigpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMShcXFxcXFxcImdyb3VwXFxcXFxcXCIsIGdyb3VwLCAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydWxlcy5sZW5ndGggPT0gMCkgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/msqHmnInop4TliJlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkocnVsZXMpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXFxcXFxcIuWJqui0tOadv1xcXFxcXFwiLCBcXFxcXFxcIue6r+aWh+acrFxcXFxcXFwiXSwgMSwgJ+mAieaLqeWIhuS6q+agvOW8jycpLnNlbGVjdCgodCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFxcXFxcIuWJqui0tOadv1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQsICfkupHliarotLTmnb82Jyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBcXFxcXFxcIlBhc3RlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBcXFxcXFxcIlRleHRcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignanhsaXN0MicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJjb3B5Oi8vdWNra+inhOWImeWPo+S7pO+8jOaJk+W8gOa1t+mYlOWNs+WPr+WvvOWFpVxcXFxcXFxcbu+/pVxcXFxcXFwiICsgdCArIFxcXFxcXFwi77+lXFxcXFxcXCIgKyB1ICsgJ0BpbXBvcnQ9anM6JC5yZXF1aXJlKFxcXFxcXFwidG9vbD9ydWxlPXVja2vkupFcXFxcXFxcIikuc2V0UnVsZShpbnB1dCk7JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHQpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBncm91cClcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBdXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbn0pO1xcXFxuZC5wdXNoKHtcXFxcbiAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcXFxufSk7XFxcXG5ydWxlcyA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRHcm91cEpzb24oZmFsc2UsIFxcXFxcXFwiZ3JvdXBcXFxcXFxcIiwgcGxhdGZvcm0sIFxcXFxcXFwi57u85ZCIXFxcXFxcXCIpO1xcXF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gICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcXFxuICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMShcXFxcXFxcImdyb3VwXFxcXFxcXCIsIHBsYXRmb3JtLCAxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwICE9IFxcXFxcXFwi5YWo5YWoXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gcnVsZXMuZmlsdGVyKGYgPT4gZi5zZWFyY2hfZ3JvdXAgPT0gZ3JvdXApO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChydWxlcy5sZW5ndGggPT0gMCkgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/msqHmnInop4TliJlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgdCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShydWxlcykpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcXFxcXCLliarotLTmnb9cXFxcXFxcIiwgXFxcXFxcXCLnuq/mlofmnKxcXFxcXFxcIl0sIDEsICfpgInmi6nliIbkuqvmoLzlvI8nKS5zZWxlY3QoKHQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFxcXFxcIuWJqui0tOadv1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHNoYXJlUGFzdGUodCwgJ+S6keWJqui0tOadvzYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ID0gXFxcXFxcXCJQYXN0ZVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdD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gPyBcXFxcXFxcIuemgeeUqOWPkeeOsFxcXFxcXFwiIDogXFxcXFxcXCLlkK/nlKjlj5HnjrBcXFxcXFxcIl0pLCAyLCAn6YCJ5oup5omp5bGV5pON5L2cJykuc2VsZWN0KChtLCBfKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfliIbkuqsnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShbX10pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImNvcHk6Ly91Y2tr6KeE5YiZ5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXFxcXFxu77+lVGV4dO+/pVxcXFxcXFwiICsgXyArICdAaW1wb3J0PWpzOiQucmVxdWlyZShcXFxcXFxcInRvb2w/cnVsZT11Y2tr5LqRXFxcXFxcXCIpLnNldFJ1bGUoaW5wdXQpOyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn57yW6L6RJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9ICQucmVxdWlyZSgndG9vbD9ydWxlPXVja2vkupEnKS5nZXRWYXJpYWJsZXMoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBhcnIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gT2JqZWN0LmtleXMoXyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgYXJyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIodCwgX1t0XSB8fCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdydWxlX3VpZCcsIG0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaF9lbmFibGVkJywgXy5zZWFyY2hfZW5hYmxlZCB8fCBcXFxcXFxcIjBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZXhwbG9yZV9lbmFibGVkJywgXy5leHBsb3JlX2VuYWJsZWQgfHwgXFxcXFxcXCIwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcnVsZUVkaXQjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3BhZ2VUaXRsZT3op4TliJnnvJbovpEmcnVsZT11Y2tr5LqRJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfliKDpmaQnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCLnoa7lrprliKDpmaRcXFxcXFxcIiArIF8uZ3JvdXAgKyBcXFxcXFxcIuinhOWImeKAnFxcXFxcXFwiICsgXy50aXRsZSArICfigJ3lkJfvvJ9cXFxcXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzor7fosKjmhY7pgInmi6njgIInKS5jb25maXJtKChtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzIobSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIG0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+enu+WKqCc6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eSA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRKc29uXzIobSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dSA9IHp5LnNsaWNlKDEpLm1hcChfID0+IF8udGl0bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXFxcXFwi5pyA5ZCO6Z2iXFxcXFxcXCIpLCAyLCAn6K+36YCJ5oup56e75Yqo5L2N572uJykuc2VsZWN0KCh6eSwgenUsIF8pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gLTEpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5LnB1c2goXyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSArIDEsIDAsIF8pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5zYXZlSnNvbih6eSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgenksIHp1LCBfKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfpgInkuK3op4TliJknOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCB7fSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyW21dID0gXztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCBqeGxpc3QyKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflj5bmtojpgInkuK0nOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCB7fSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUganhsaXN0MlttXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCBqeGxpc3QyKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflkK/nlKjlj5HnjrAnOlxcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnpoHnlKjlj5HnjrAnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFxcXFxcImV4cGxvcmVfZW5hYmxlZFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIG0sIF8pLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcXFxuICAgICAgICAgICAgaW1nOiBfLmljb25cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXy5ncm91cCArICfkuKgnICsgXy5zZWFyY2hfZ3JvdXAgKyAn5LioJyArIChfLng1X3VybCB8fCAoXy51cmwgPyBfLnVybCA6IF8uc2VhcmNoX3VybCkuc3BsaXQoXFxcXFxcXCIvXFxcXFxcXCIpLnNsaWNlKDAsIDMpLmpvaW4oXFxcXFxcXCIvXFxcXFxcXCIpKSxcXFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgobSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRKc29uXzIobSwgXFxcXFxcXCJzZWFyY2hfZW5hYmxlZFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgICAgIH0sIG0pLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKF8uc2VhcmNoX2VuYWJsZWQgPT0gJzEnID8gNTUgOiA2MykgKyAnLnN2ZycsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxu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XR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcXFxuICAgICAgICAgICAgfSwgaSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH0pO1xcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcXFxcXCIsXFxcXG4gICAgICAgIHVybDogXy54NV9kZXNjID09ICcxJyB8fCBfLng1X3VybCB8fCBfLnVybCxcXFxcbiAgICAgICAgZGVzYzogXy54NV9kZXNjID09ICcxJyA/ICcwJyA6ICdzY3JlZW4tMTMzJiZmbG9hdCcsXFxcXG4gICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICBjYW5CYWNrOiB0cnVlLFxcXFxuICAgICAgICAgICAgdWE6IF8ueDVfdWEgPyAoXy54NV91YSA9PSBcXFxcXFxcIlBDX1VBXFxcXFxcXCIgPyBQQ19VQSA6IF8ueDVfdWEpIDogTU9CSUxFX1VBLFxcXFxuICAgICAgICAgICAgcmVmZXJlcjogXy54NV9yZWZlcmVyLFxcXFxuICAgICAgICAgICAganM6IF8ueDVfanMsXFxcXG4gICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6ICEhXy54NV9qc0xvYWRpbmdJbmplY3QsXFxcXG4gICAgICAgICAgICBhdXRvUGxheTogISFfLng1X2F1dG9QbGF5LFxcXFxuICAgICAgICAgICAgZmxvYXRWaWRlbzogISFfLng1X2Zsb2F0VmlkZW8sXFxcXG4gICAgICAgICAgICBpbWdMb25nQ2xpY2s6ICFfLng1X2ltZ0xvbmdDbGljayxcXFxcbiAgICAgICAgICAgIHNob3dQcm9ncmVzczogIV8ueDVfc2hvd1Byb2dyZXNzLFxcXFxuICAgICAgICAgICAgYmxvY2tSdWxlczogZXZhbChfLng1X2Jsb2NrUnVsZXMpIHx8IFtdLFxcXFxuICAgICAgICAgICAgdXJsSW50ZXJjZXB0b3I6ICQudG9TdHJpbmcoKHVybEludGVyY2VwdG9yX2pzLCB4NVVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC5pbmNsdWRlcyhcXFxcXFxcImFsaXl1bmRyaXZlLmNvbS9cXFxcXFxcIikgfHwgaW5wdXQuaW5jbHVkZXMoXFxcXFxcXCJhbGl5dW5kcml2ZS5uZXQvXFxcXFxcXCIpIHx8IGlucHV0LmluY2x1ZGVzKFxcXFxcXFwiYWxpcGFuLmNvbS9cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6ICfkupHnm5jlkJsu566AJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2FsaXl1biNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3kupHnm5jlkJsu566AJnBhZ2U9ZnlwYWdlJnJlYWx1cmw9XFxcXFxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXFxcXFwicXVhcmsuY25cXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBc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XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaW5wdXRcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcXFxcXCI6c2VhcmNoXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBrZXl3b3JkLFxcXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFxcXFxcInB1dE15VmFyKCdrZXl3b3JkJyxpbnB1dClcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IocnVsZVR5cGUsIFxcXFxcXFwiIzMzOTljY1xcXFxcXFwiKSkpLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFxcXFxcIue7vOWQiFxcXFxcXFwiXS5jb25jYXQoZ3JvdXBzKS5tYXAobmFtZSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKG5hbWUgPT0gcnVsZVR5cGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZSA9IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZWFyY2hfdHlwZS5pbmRleE9mKG5hbWUpID09IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBSaWNoKFxcXFxcXFwiPFM+XFxcXFxcXCIgKyBuYW1lICsgXFxcXFxcXCI8L1M+XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gbmFtZTtcXFxcbiAgICAgICAgICAgIH0pLCAzLCBcXFxcXFxcIumAieaLqeaQnOe0ouexu+WIq1xcXFxcXFwiKS5zZWxlY3QoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC5pbmRleE9mKFxcXFxcXFwiPFM+XFxcXFxcXCIpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5rKh5pyJ5a+55bqU6KeE5YiZXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmRleE9mKFxcXFxcXFwiPFxcXFxcXFwiKSA9PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBnZXRNeVZhcigna2V5d29yZCcpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVUeXBlJywgaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwicnVsZUdyb3VwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwic2lkXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIHNlYXJjaF9ncm91cC5tYXAoKG5hbWUsIGkpID0+IHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHJ1bGVHcm91cCA9PSBpID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncnVsZUdyb3VwJywgaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcXFxcXCJzaWRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIHNlYXJjaF9ydWxlLm1hcCgoXywgaSkgPT4ge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogc2lkID09IGkgPyBSaWNoKFN0cm9uZyhDb2xvcihfLnRpdGxlKSkpIDogXy50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgZ2V0TXlWYXIoJ2tleXdvcmQnKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzaWQnLCBpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgICAgICAgICB9LCBpKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcblxcXFxuXFxcXG5cXFxcblxcXFxuXFxcXG4gICAgaWYgKF9TT1UpIHtcXFxcbiAgICAgICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliqDovb3nrKxcXFxcXFxcIiArIHBhZ2UgKyBcXFxcXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcXFxcXCIgKyBkYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKF9QQUdFKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuayoeacieWPr+eUqOeahOaQnOe0ouinhOWImVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGVsc2UgaWYgKF9QQUdFIHx8IHJ1bGUudXJsLm1hdGNoKFxcXFxcXFwiZnlwYWdlXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgIGlmIChfUEFHRSkge1xcXFxuICAgICAgICAgICAgaWYgKHJ1bGUudGl0bGUgIT0gXFxcXFxcXCLogZrmkJxcXFxcXFxcIikgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPicgKyBDb2xvcihydWxlLnRpdGxlLCAnI2ZmNjYwMScpICsgJzwvYj4nLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBbXFxcXFxcXCJjbGFzc1xcXFxcXFwiLCBcXFxcXFxcImFyZWFcXFxcXFxcIiwgXFxcXFxcXCJ5ZWFyXFxcXFxcXCIsIFxcXFxcXFwic29ydFxcXFxcXFwiLCBcXFxcXFxcIkZ5QWxsXFxcXFxcXCJdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHQgKyBcXFxcXFxcIl9pXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxcXG4gICAgICAgICAgICAgICAgfSwgXFxcXFxcXCJoaWtlcjovL3BhZ2UvcnVsZUhvbWU/cnVsZT11Y2tr5LqRJnBhZ2U9ZnlwYWdlJnJ1bGVOYW1lPVxcXFxcXFwiICsgcnVsZS50aXRsZSArIFxcXFxcXFwiJnJ1bGVHcm91cD1cXFxcXFxcIiArIHJ1bGUuZ3JvdXApLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBydWxlLmljb24sXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICBob21lOiAxXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBnZXRSdWxlR3JvdXAoKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBiYXNlVXJsID0gaG9tZV9iYXNlVXJsO1xcXFxuICAgICAgICBldmFsKFN0cmluZyhydWxlLnByZVJ1bGUpKTtcXFxcbiAgICAgICAgZXZhbChTdHJpbmcocnVsZS5maW5kX3J1bGUpKTtcXFxcbiAgICB9XFxcXG59XFxcXG5fUEFHRSA/IHNldFByZVJlc3VsdChkKSA6IHNldFJlc3VsdChkKTtcXFxcbmRlbGV0ZUl0ZW1CeUNscygnbG9hZGluZ19naWYnKTtcXFxcblxcXFxuXFxcXG5cXFxcbi8vIOaQnOe0olxcXFxuaWYgKCFydWxlX3g1ICYmIF9TT1UgJiYgZGF0YS5sZW5ndGggPiAwKSB7XFxcXG4gICAgbGV0IGlpID0gaGlzdG9yeS5pbmRleE9mKGtleXd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gICAgKCQwLCAkMSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlMiA9IHBhZ2U7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQxLnNwbGl0KFxcXFxcXFwiQFxcXFxcXFwiKS5tYXAoXyA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBhZ2UyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9meXBhZ2UvZywgcGFnZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcXFxcXCpcXFxcXFxcXCovZywga2V5d29yZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwYWdlID09IDEgfHwgcnVsZS5zZWFyY2hfdXJsLm1hdGNoKFxcXFxcXFwiZnlwYWdlXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKHJ1bGUucHJlUnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2VhcmNoZmluZCA9IG5ldyBGdW5jdGlvbihcXFxcXFxcInJ1bGVcXFxcXFxcIiwgXFxcXFxcXCJiYXNlVXJsXFxcXFxcXCIsIFxcXFxcXFwia2V5d29yZFxcXFxcXFwiLCBcXFxcXFxcInBhZ2VcXFxcXFxcIiwgcnVsZS5zZWFyY2hGaW5kKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gc2VhcmNoZmluZChydWxlLCBiYXNlVXJsLCBrZXl3b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AgdXJsOiBpdC51cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXQuaW1nIHx8IGl0LnBpY191cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdC5jb2xfdHlwZSB8fCBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9QaWM6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQuZXh0cmEgfHwge30pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzTGlzdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKF8udGl0bGUgKyBcXFxcXFxcIjpcXFxcXFxcIiArIGUudG9TdHJpbmcoKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgcGFyYW06IGl0LFxcXFxuICAgICAgICAgICAgaWQ6IFxcXFxcXFwidWNra19ydWxlQFxcXFxcXFwiICsgaXQudGl0bGVcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuXFx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xpbmVWaXNpYmxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJfbm90aGF2ZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZCk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0ocGFnZWlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcXFxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS5hbGwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgIGk6IDAsXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLinbnop4TliJnnvJbovpFcXFwiLFxcXCJwYXRoXFxcIjpcXFwicnVsZUVkaXRcXFwiLFxcXCJydWxlXFxcIjpcXFwianM6XFxcXG5ldmFsKEpTT04ucGFyc2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gdXJsOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGdyb3VwID0gJC5yZXF1aXJlKFxcXFxcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFxcXFxcIikuZ2V0R3JvdXBOYW1lcygwLCBcXFxcXFxcInNlYXJjaF9ncm91cFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIGlmICghZ3JvdXAubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gJChncm91cCwgMywgXFxcXFxcXCLpgInmi6nop4TliJnliIbnu4RcXFxcXFxcIikuc2VsZWN0KChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKGV4dHJhLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9LCBpZCk7XFxcXG4gICAgICAgIH0sIGlkKSxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxcXG4gICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHtcXFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoaWQsIHZhbHVlKSxcXFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcXFxcXCIke2lkfVxcXFxcXFwiLCBpbnB1dClgLFxcXFxuICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogdHJ1ZSxcXFxcbiAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXFxcbiAgICAgICAgICAgIGhlaWdodDogaGVpZ2h0IHx8IDUsXFxcXG4gICAgICAgICAgICBpZDogaWQsXFxcXG4gICAgICAgIH0sIGpzb24gfHwge30pXFxcXG4gICAgfSk7XFxcXG59XFxcXG5zd2l0Y2ggKHJ1bGVfdGlkKSB7XFxcXG4gICAgY2FzZSAn5Z+65pysJzpcXFxcbiAgICAgICAgW1xcXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDlkI3np7AnLCAndGl0bGUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOWbvuaghycsICdpY29uJywgJyddLFxcXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDkvZzogIUnLCAnYXV0aG9yJywgJ+S9muWQjSddLFxcXFxuICAgICAgICAgICAgWyfpgInloavvvIxKc0xpYicsICdwcmVSdWxlJywgJycsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDNcXFxcbiAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcXFxuICAgICAgICAgICAgaW5wdXRfcHVzaChhLCBiLCBjLCBlLCAxKTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgJ+aQnOe0oic6XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5pCc57Si6ZO+5o6lJywgJ3NlYXJjaF91cmwnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+W/heWhq++8jOaQnOe0ouWIhue7hCcsICdzZWFyY2hfZ3JvdXAnLCAn5YWo5YWoJywge1xcXFxuICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogZmFsc2UsXFxcXG4gICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAg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sn5b+F5aGr77yM5rqQ6ZO+5o6lJywgJ3VybCcsICcnLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxXFxcXG4gICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5YiX6KGo6KeE5YiZXFxcXFxcXFxu5ZCv55SoeDXlsLHkuI3nlKjlhpnkuoZcXFxcXFxcXG5cXFxcXFxcXG7nu6fmib/mlbDnu4Rk77yaIGQucHVzaChqc29uKTsnLCAnZmluZF9ydWxlJywgJyddLFxcXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcXFxuICAgICAgICAgICAgaW5wdXRfcHVzaChhLCBiLCBjLCBlKTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgJ+abv+aNoic6XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCflj5HnjrDpk77mjqXmm7/mjaInKSxcXFxcbiAgICAgICAgICAgIGRlc2M6ICfpgInloasnLFxcXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9ob21lX2ljb25fZWRpdCdcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5YiG57G75ZCN56ewJywgJ2NsYXNzX25hbWUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WIhuexu+abv+aNoicsICdjbGFzc191cmwnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WcsOWMuuWQjeensCcsICdhcmVhX25hbWUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WcsOWMuuabv+aNoicsICdhcmVhX3VybCcsICcnXSxcXFxcbiAgICAgICAgICAgIFsn5bm05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gICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2F1dG9QbGF5JywgeCk7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICB9LCB4NV9hdXRvUGxheSA/ICcwJyA6ICcxJyksXFxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfYXV0b1BsYXkgPyA1NSA6IDYzKSArICcuc3ZnJyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCd4NeaJqeWxlScpLFxcXFxuICAgICAgICAgICAgZGVzYzogJ+mAieWhqycsXFxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6aaW6aG15LiN5pi+56S65pCc57Si5qGGPC9iPicsXFxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBwdXR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FxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICB9LCBpZCwga2V5KSxcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGlkOiBpZCArIFxcXFxcXFwiOmtleTpcXFxcXFxcIiArIGtleSxcXFxcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIjprZXlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaTlhbPplK7or406XFxcXFxcXCIgKyBrZXksXFxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGlkLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXFxcXFwic2VhcmNoSGlzdG9yeVxcXFxcXFwiLCBbXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpaSA9IGhpc3RvcnkuaW5kZXhPZihrZXkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcXFxcXCJzZWFyY2hIaXN0b3J5XFxcXFxcXCIsIGhpc3RvcnkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcXFxcXCI6a2V5OlxcXFxcXFwiICsga2V5KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBhZGRJdGVtQWZ0ZXIoaWQgKyBcXFxcXFxcIjpzZWFyY2hIaXN0b3J5XFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIFxcXFxcXFwifn5+5LuA5LmI6YO95rKh5pyJ5ZOmfn5+XFxcXFxcXCIuZm9udGNvbG9yKFxcXFxcXFwiR3JheVxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiOmtleVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcXFxuICAgICAgICAgICAgfV1cXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxufSk7YCxcXFxcblxcXFxuICAgICAgICBjbGFzc19uYW1lOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICBjbGFzc191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIGFyZWFfbmFtZTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgYXJlYV91cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIHllYXJfbmFtZTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgeWVhcl91cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIHNvcnRfbm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XFxuICAgICAgICAgICAgbGV0IGRkID0gZDtcXFxcbiAgICAgICAgICAgIGJhc2VVcmwgPSBydWxlLnNlYXJjaF91cmxcXFxcbiAgICAgICAgICAgICAgICAucmVwbGFjZShcXFxcbiAgICAgICAgICAgICAgICAgICAgL2Z5cGFnZUAoW15cXFxcXFxcXD9cXFxcXFxcXCZcXFxcXFxcXDtcXFxcXFxcXCNcXFxcXFxcXFxcXFxcXFwiXFxcXFxcXFwnXFxcXFxcXFx7XSspQD8vZyxcXFxcbiAgICAgICAgICAgICAgICAgICAgKCQwLCAkMSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTIgPSBwYWdlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcXFxcXCJAXFxcXFxcXCIpLm1hcChfID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGFnZTI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICApXFxcXG4gICAgICAgICAgICAgICAgLnJlcGxhY2UoL2Z5cGFnZS9nLCBwYWdlKVxcXFxuICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcXFxcXCpcXFxcXFxcXCovZywga2V5d29yZCk7XFxcXG4gICAgICAgICAgICBzZWFyY2hmaW5kID0gbmV3IEZ1bmN0aW9uKFxcXFxcXFwicnVsZVxcXFxcXFwiLCBcXFxcXFxcImJhc2VVcmxcXFxcXFxcIiwgXFxcXFxcXCJrZXl3b3JkXFxcXFxcXCIsIFxcXFxcXFwicGFnZVxcXFxcXFwiLCBydWxlLnNlYXJjaEZpbmQpO1xcXFxuICAgICAgICAgICAgbGlzdCA9IHNlYXJjaGZpbmQocnVsZSwgYmFzZVVybCwga2V5d29yZCwgcGFnZSk7XFxcXG4gICAgICAgICAgICBkID0gZGQuY29uY2F0KGxpc3QpO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKCFfU09VICYmIChfUEFHRSB8fCBydWxlLnVybC5pbmNsdWRlcyhcXFxcXFxcImZ5cGFnZVxcXFxcXFwiKSkpIHtcXFxcbiAgICAgICAgICAgIGV2YWwocnVsZS5maW5kX3J1bGUpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIF9QQUdFID8gc2V0UHJlUmVzdWx0KGQpIDogc2V0UmVzdWx0KGQpO1xcXFxuICAgICAgICBkZWxldGVJdGVtQnlDbHMoJ2xvYWRpbmdfZ2lmJyk7XFxcXG4gICAgfSBlbHNlIHsgLy8g5LuOeDXot7PovaznmoRcXFxcbiAgICAgICAgZXZhbChydWxlLnByZVJ1bGUpO1xcXFxuICAgICAgICBldmFsKHJ1bGUueDVfcGFnZUhvbWUpO1xcXFxuICAgIH1cXFxcbn0gZWxzZSB7XFxcXG4gICAgc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgIHRpdGxlOiBDb2xvcignPGgxIHN0eWxlPVxcXFxcXFwidGV4dC1hbGlnbjpjZW50ZXI7XFxcXFxcXCI+5Zu+5Lmm6aaGUHJvPC9oMT4nLCAnI0ZFQkQ2RicpLmJpZygpLFxcXFxuICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJyaWNoX3RleHRcXFxcXFxcIlxcXFxuICAgIH1dKTtcXFxcbn1cXFwifV1cIixcInByb3h5XCI6XCJcIn0iLCJwaWNVcmwiOiJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LzI3LnN2ZyIsInRpdGxlIjoiQSDpmL/puqbku47lhpsifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement