xiaomianao666

邀您一起看:九龙神尊

Mar 13th, 2024
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥九龙神尊@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTgeWIl+ihqEFQSVwiLFwicGF0aFwiOlwiUXVhcmtTaGFyZUFwaVwiLFwicnVsZVwiOlwianM6XFxuLy9AYXV0aG9yIExveURnSWtcXG5sZXQgaHR0cFJlcXVlc3QgPSAkLnJlcXVpcmUoXFxcImh0dHBSZXF1ZXN0XFxcIik7XFxuY29uc3QgYmFzZVVybCA9IFxcXCJodHRwczovL3Bhbi5xdWFyay5jblxcXCI7XFxuXFxuZnVuY3Rpb24gUXVhcmtTaGFyZUFwaShzaGFyZUlkLCBzaGFyZVB3ZCkge1xcbiAgICB0aGlzLnNoYXJlSWQgPSBzaGFyZUlkO1xcbiAgICB0aGlzLnNoYXJlUHdkID0gc2hhcmVQd2Q7XFxuICAgIHRoaXMucmVmcmVzaENhbGxCYWNrID0gKCgpID0+IHZvaWQgMCk7XFxuICAgIC8vdGhpcy5zaGFyZVRva2VuID0gc2hhcmVUb2tlbiB8fCB0aGlzLmdldFNoYXJlVG9rZW4oKTtcXG59XFxuT2JqZWN0LmFz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0dXNDb2RlKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZXJyID0gdGhpcy5lcnJvclR5cGVDYWxsYmFjayhlcnIsIHJlcyk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodGhpcy5yZXRyeUNvdW50KSB7XFxuICAgICAgICAgICAgICAgIGxldCB0cnlSZXN1bHQgPSB0aGlzLmVycm9yQ2FsbGJhY2tXaXRoUmV0cnkoZXJyLCByZXMsIHRoaXMpO1xcbiAgICAgICAgICAgICAgICBpZiAodHJ5UmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQtLTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnN0YXJ0KHRvSnNvbik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJldHJ5Q291bnQgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JDYWxsYmFjayhlcnIsIHJlcyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5lcnJvckNhbGxiYWNrKGVyciwgcmVzKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIHNldE9wdGlvbnMob3B0aW9ucykge1xcbiAgICAgICAgdGhpcy5vcHRpb25zID0gT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucywge1xcbiAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBtZXJnZUhlYWRBbmRCb2R5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ogXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS9pbWcvYWxpX3BsYXkuc3ZnXFxcIixcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuWKn+iDvVxcXCIsXFxuICAgICAgICB1cmw6ICQoW1xcXCLot7PovazlpLjlhYtBUFBcXFwiLCBcXFwi55m75b2VXFxcIiwgXFxcIuWOn+eUu+S4i+i9vee6v+eoi1xcXCJdKS5zZWxlY3QoKHNoYXJlSWQpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLot7PovazlpLjlhYtBUFBcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwicWtsaW5rOi8vd3d3LnVjLmNuL2IyMGI4NGZkNzM1YThkZDNmNzU0MTEyOWJhY2M0ZTlhP2FjdGlvbj1vcGVuX3VybCZ1cmw9aHR0cHM6Ly9wYW4ucXVhcmsuY24vcy9cXFwiICsgc2hhcmVJZDtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09PSBcXFwi55m75b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIui+k+WFpUNvb2tpZVxcXCIsIFxcXCLnvZHpobXnmbvlvZVcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIue9kemhteeZu+W9lVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9sb2dpblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWlQ29va2llXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJC5yZXF1aXJlKFxcXCJ0b29sXFxcIikuaXNMb2dpbkNvb2tpZShpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgaW5wdXQucmVwbGFjZSgvXFxcXHMvZywgXFxcIlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7miJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL0Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09PSBcXFwi5Y6f55S75LiL6L2957q/56iLXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChnZXRJdGVtKFxcXCJzcGVlZFRocmVhZFxcXCIsIFxcXCIxMFxcXCIpLCBcXFwi6K+36L6T5YWlMy0zMuS5i+mXtOeahOaVtOaVsFxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzcGVlZFRocmVhZCA9IHBhcnNlSW50KGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzcGVlZFRocmVhZCA8IDMgfHwgc3BlZWRUaHJlYWQgPiAzMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7kuI3lkIjms5VcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwic3BlZWRUaHJlYWRcXFwiLCBTdHJpbmcoc3BlZWRUa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k7XFxuICAgICAgICBzZXRQYWdlVGl0bGUocmVzLmRhdGEuc2hhcmUudGl0bGUpO1xcbiAgICAgICAgdmFyIGxpc3QgPSByZXMuZGF0YS5saXN0fHxbXTtcXG4gICAgfVxcbiAgICBsaXN0LmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAvL+WIpOaWreaYr+WQpuaWh+S7tuWkuVxcbiAgICAgICAgaWYgKGl0ZW0uZGlyKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5OCXFxcIiArIGl0ZW0uZmlsZV9uYW1lLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAkLmRhdGVGb3JtYXQoaXRlbS51cGRhdGVkX2F0LCAneXl5eS1NTS1kZCcpICsgJyAgJyArIGl0ZW0uaW5jbHVkZV9pdGVtcyArICfpobkgICcsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LzI3LnN2Z1xcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Q/cGFnZT1meXBhZ2VcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogc3R5bGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBzaGFyZUlkLFxcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVQd2QsXFxuICAgICAgICAgICAgICAgICAgICBzaGFyZVRva2VuOiBxdWFya1NoYXJlQXBpLmdldFRva2VuKCksXFxuICAgICAgICAgICAgICAgICAgICBmaWxlSWQ6IGl0ZW0uZmlkLFxcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRIZWFkKGl0ZW0ub2JqX2NhdGVnb3J5KSArIGl0ZW0uZmlsZV9uYW1lLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAkLmRhdGVGb3JtYXQoaXRlbS51cGRhdGVkX2F0LCAneXl5eS1NTS1kZCcpICsgJyAgJyArIGZvcm1hdFNpemUoaXRlbS5zaXplKSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaXRlbS50aHVtYm5haWwsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChmaWQsIGZpZF90b2tlbiwgcHdkX2lkLCBzdG9rZW4sIGNhdGVnb3J5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVVybENhY2hlID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcInBsYXlVcmxDYWNoZVxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwbGF5VXJsQ2FjaGVbZmlkXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5VXJsQ2FjaGVbZmlkXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICQucmVxdWlyZShcXFwicGxheVxcXCIpLmdldFBsYXlVcmwoZmlkLCBmaWRfdG9rZW4sIHB3ZF9pZCwgc3Rva2VuLCBjYXRlZ29yeSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGxheVVybENhY2hlW2ZpZF0gPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBsYXlVcmxDYWNoZVxcXCIsIHBsYXlVcmxDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXRlbS5maWQsIGl0ZW0uc2hhcmVfZmlkX3Rva2VuLCBzaGFyZUlkLCBxdWFya1NoYXJlQXBpLmdldFRva2VuKCksIGl0ZW0ub2JqX2NhdGVnb3J5KSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHN0eWxlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZmlkLFxcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlsaXN0ICcgKyBpdGVtLm9ial9jYXRlZ29yeVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbn0gY2F0Y2ggKGUpIHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBlLm1lc3NhZ2UsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgaWYgKGUubWVzc2FnZS5pbmNsdWRlcyhcXFwi5o+Q5Y+W56CBXFxcIikpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLovpPlhaXmj5Dlj5bnoIFcXFwiLFxcbiAgICAgICAgICAgIHVybDogJCgpLmlucHV0KChNWV9QQVJBTVMpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0UGFnZVBhcmFtcyhPYmplY3QuYXNzaWduKHt9LCBNWV9QQVJBTVMsIHtcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlUHdkOiBpbnB1dFxcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgfSwgTVlfUEFSQU1TKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxuICAgICAgICB9KTtcXG4gICAgfVxcbn1cXG5zZXRSZXN1bHQoZCk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLik4Hojrflj5bpk77mjqVcIixcInBhdGhcIjpcInBsYXlcIixcInJ1bGVcIjpcImpzOlxcbmNvbnN0IGNvb2tpZSA9IGdldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgXFxcIlxcXCIpO1xcbmxldCBodHRwUmVxdWVzdCA9ICQucmVxdWlyZShcXFwiaHR0cFJlcXVlc3RcXFwiKTtcXG5cXG5mdW5jdGlvbiBDb29raWVNYW5hZ2UoY29va2llKSB7XFxuICAgIHRoaXMuY29va2llID0ge307XFxuICAgIHRoaXMuYWRkKGNvb2tpZSk7XFxufVxcbk9iamVjdC5hc3NpZ24oQ29va2llTWFuYWdlLnByb3RvdHlwZSwge1xcbiAgICBhZGQoY29va2llKSB7XFxuICAgICAgICBsZXQgY29va2llcyA9IFtdO1xcbiAgICAgICAgaWYgKHR5cGVvZiBjb29raWUgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxuICAgICAgICAgICAgY29va2llcyA9IGNvb2tpZS5zcGxpdChcXFwiO1xcXCIpO1xcbiAgICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KGNvb2tpZSkpIHtcXG4gICAgICAgICAgICBjb29raWVzID0gY29va2llO1xcbiAgICAgICAgfVxcbiAgICAgICAgY29va2llcy5mb3JFYWNoKHYgPT4ge1xcbiAgICAgICAgICAgIHYgPSB2LnNwbGl0KFxcXCI9XFxcIik7XFxuICAgICAgICAgICAgaWYgKHYubGVuZ3RoI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KHRhc2tJZCk7XFxuICAgICAgICBpZiAoIWFzZmlkKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iOt+WPluWksei0pVxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcGxheUNvb2tpZSA9IGNvb2tpZU1hbmFnZS5nZXQoKTtcXG4gICAgICAgIGxldCBwbGF5SGVhZGVyID0ge1xcbiAgICAgICAgICAgIFJlZmVyZXI6IFxcXCJodHRwOi8vcGFuLnF1YXJrLmNuL1xcXCIsXFxuICAgICAgICAgICAgY29va2llOiBwbGF5Q29va2llLFxcbiAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcImNvbS5zdHViLlN0dWJBcHAvMS4zLjAgKExpbnV4O0FuZHJvaWQgMTQpIEFuZHJvaWRYTWVkaWEzLzEuMS4xXFxcIlxcbiAgICAgICAgfTtcXG4gICAgICAgIGlmIChjYXRlZ29yeSA9PSBcXFwidmlkZW9cXFwiKSB7XFxuICAgICAgICAgICAgbGV0IHBsYXlNb2RlID0gZ2V0SXRlbShcXFwicXVhcmtfcGxheU1vZGVcXFwiLCBcXFwi6L2s56CBXFxcIik7XFxuICAgICAgICAgICAgaWYgKHBsYXlNb2RlID09PSBcXFwi6L2s56CBXFxcIikge1xcbiAgICAgICAgICAgICAgICBsZXQgdmlkZW9SZXMgPSBnZXRQcmV2aWV3VmlkZW8oYXNmaWQpO1xcbiAgICAgICAgICAgICAgICBsZXQgdmlkZW9MaXN0ID0gdmlkZW9SZXMuZGF0YS52aWRlb19saXN0O1xcbiAgICAgICAgICAgICAgICBsZXQgcGxheUxpc3QgPSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lczogW10sXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXSxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFtdXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHZpZGVvTGlzdC5maWx0ZXIodiA9PiB2LmFjY2Vzc2FibGUpLmZvckVhY2godiA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdC5uYW1lcy5wdXNoKHYucmVzb2x1dGlvbik7XFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdC51cmxzLnB1c2godi52aWRlb19pbmZvLnVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcGxheUxpc3QuaGVhZGVycy5wdXNoKHBsYXlIZWFkZXIpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgY3JlYXRlRGVsZXRlVGFzayhhc2ZpZCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShwbGF5TGlzdCk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlVcmwgPSBnZXREb3dubG9hZFVybChhc2ZpZCkuZGF0YVswXS5kb3dubG9hZF91cmw7XFxuICAgICAgICAgICAgICAgIGxldCBwbGF5TGlzdCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbXFxcIuWOn+eUu1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3BsYXlVcmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSMjZmFzdFBsYXlNb2RlIyN0aHJlYWRzPVxcXCIgKyBnZXRJdGVtKFxcXCJzcGVlZFRocmVhZFxcXCIsIFxcXCIxMFxcXCIpICsgXFxcIiNcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFtwbGF5SGVhZGVyXVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNyZWF0ZURlbGV0ZVRhc2soYXNmaWQpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocGxheUxpc3QpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7IC8vIOS4jeaYr+inhumikei1hOa6kFxcbiAgICAgICAgICAgIGxldCBwbGF5SW5mbyA9IGdldERvd25sb2FkVXJsKGFzZmlkKS5kYXRhWzBdO1xcbiAgICAgICAgICAgIGxldCBwbGF5VXJsID0gcGxheUluZm8uZG93bmxvYWRfdXJsO1xcblxcbiAgICAgICAgICAgIC8vIOmfs+mikei1hOa6kFxcbiAgICAgICAgICAgIGlmIChwbGF5SW5mby5mb3JtYXRfdHlwZS5pbmNsdWRlcygnYXVkaW8nKSB8fCBwbGF5SW5mby5maWxlX25hbWUubWF0Y2goL1xcXFwuKGFhY3xhYzN8YWlmZnxhbXJ8bTRhfG1wMnxtcDN8b2dnfHJhfGF1fHdhdnx3bWF8bWthfGZsYWN8d2F2KS8pKSB7XFxuICAgICAgICAgICAgICAgIGxldCBwbGF5TGlzdCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbXFxcIumfs+mikVxcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3BsYXlVcmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFtwbGF5SGVhZGVyXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNyZWF0ZURlbGV0ZVRhc2soYXNmaWQpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocGxheUxpc3QpO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAvLyDmvI/nvZHkuYvpsbxcXG4gICAgICAgICAgICBpZiAocGxheUluZm8uZm9ybWF0X3R5cGUuaW5jbHVkZXMoJ3ZpZGVvJykgfHwgcGxheUluZm8uZmlsZV9uYW1lLm1hdGNoKC9cXFxcLihhdml8d212fG1wZWd8bXA0fG00dnxtb3Z8YXNmfGZsdnxmN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gY29sX3R5cGU6IFxcXCJ4NV93ZWJ2aWV3X3NpbmdsZVxcXCIsXFxuICAgIHVybDogXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXCIsXFxuICAgIGRlc2M6IFxcXCJmbG9hdCYmMTAwJVxcXCIsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBqczogJC50b1N0cmluZygoQXBpUm9vdFVybCkgPT4ge1xcbiAgICAgICAgICAgIGxldCB0aW1lSW50ZXIgPSBzZXRJbnRlcnZhbCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBDb29raWUgPSBmYmEuZ2V0Q29va2llKEFwaVJvb3RVcmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoQ29va2llLmluY2x1ZGVzKFxcXCJfVVBfRjdFXzhEXz1cXFwiKSAmJiBDb29raWUuaW5jbHVkZXMoXFxcIl9fdWlkPVxcXCIpJiZDb29raWUuaW5jbHVkZXMoXFxcIl9fcHV1cz1cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLnB1dFZhcihcXFwicXVhcmtDb29raWVcXFwiLCBDb29raWUpXFxuICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVJbnRlcik7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKENvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICBmYmEuYmFjayhmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCA2MDApO1xcbiAgICAgICAgfSwgXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuXFxcIiksXFxuICAgICAgICB1YTogUENfVUEsXFxuICAgICAgICBqc0xvYWRpbmdJbmplY3Q6IGZhbHNlXFxuICAgIH1cXG59KTtcXG5zZXRSZXN1bHQoZClcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTgeeZu+W9leajgOa1i1wiLFwicGF0aFwiOlwidG9vbFwiLFwicnVsZVwiOlwianM6XFxuJC5leHBvcnRzID0ge1xcbiAgICBpc0xvZ2luQ29va2llKGNvb2tpZSkge1xcbiAgICAgICAgcmV0dXJuICEhKGNvb2tpZSAmJiBjb29raWUuaW5jbHVkZXMoXFxcIl9VUF9GN0VfOERfPVxcXCIpICYmIGNvb2tpZS5pbmNsdWRlcyhcXFwiX191aWQ9XFxcIikgJiYgY29va2llLmluY2x1ZGVzKFxcXCJfX3B1dXM9XFxcIikpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZXRSdWxlKGlucHV0KSB7XFxuICAgICAgICBzaG93TG9hZGluZygndWNra+S6kSDop6PmnpDkuK0uLi4nKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgLy8g5qC85byP5YyWXFxuICAgICAgICAgICAgW2xvZ1QsIHR5cGUsIHRleHRdID0gU3RyaW5nKGlucHV0KS5zcGxpdChcXFwi77+lXFxcIik7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcodHlwZSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnUGFzdGUnOlxcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHBhcnNlUGFzdGUodGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnTGFuem91JzpcXG4gICAgICAgICAgICAgICAgICAgIFt1cmwsIHB3ZF0gPSB0ZXh0LnNwbGl0KFxcXCIjI1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZHVybCA9ICQucmVxdWlyZSgnbGFuem91P3J1bGU9dWNra+S6kScpLm9uZV91cmwodXJsLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IFN0cmluZyhmZXRjaChkdXJsKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoKHNwID0gdGV4dC5zcGxpdChcXFwi77+lXFxcIikpLmxlbmd0aCA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHNwWzJdLnNwbGl0KFxcXCJAXFxcIilbMF0udHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFycjEgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZSh0ZXh0KSk7XFxuXFxuXFxuICAgICAgICAgICAgLy8g5ZCI5bm277yM5Y676YeNXFxuICAgICAgICAgICAgYXJyMiA9ICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5nZXRKc29uKCk7XFxuICAgICAgICAgICAgYXJyMyA9IGFycjIuY29uY2F0KGFycjEpLmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gb2JqLmdyb3VwID09PSBvLmdyb3VwICYmIG9iai50aXRsZSA9PT0gby50aXRsZSAmJiAob2JqLnRpbWUgPiBvLnRpbWUgfHwgb2JqLnRpbWUgPT0gby50aW1lKSkgPT09IGluZGV4O1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5zYXZlSnNvbihhcnIzKTtcXG5cXG5cXG4gICAgICAgICAgICAvLyDorqHnrpfkvZnph49cXG4gICAgICAgICAgICB4ID0gYXJyMy5sZW5ndGggLSBhcnIyLmxlbmd0aDtcXG4gICAgICAgICAgICBmID0gYXJyMS5sZW5ndGggLSB4XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5Yqf77yM5paw5aKe77yaXFxcIiArIHggKyBcXFwiIOimhueblu+8mlxcXCIgKyBmKTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gIC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gY2xlYXJNeVZhcih0KTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfW3RdID09IFxcXCJcXFwiIHx8IF9bdF0gPT0gXFxcIjBcXFwiIHx8IF9bdF0gPT0gXFxcIk1PQklMRV9VQVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgX1t0XTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBqeGxpc3QgPSAkLnJlcXVpcmUoXFxcImNvbmZpZ3M/cnVsZT11Y2tr5LqRXFxcIikuZ2V0SnNvbigpO1xcbiAgICAgICAgICAgICAgICB1aWRzID0ganhsaXN0Lm1hcChfXyA9PiBtZDUoX18uZ3JvdXAgKyBfXy50aXRsZSkpO1xcbiAgICAgICAgICAgICAgICBpID0gdWlkcy5pbmRleE9mKGdldE15VmFyKCdydWxlX3VpZCcsICctMScpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGp4bGlzdC5wdXNoKF8pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0LnNwbGljZShpLCAxLCBfKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdydWxlX3RpZCcpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdydWxlX3VpZCcpO1xcbiAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gbWQ1KG9iai5ncm91cCArIG9iai50aXRsZSkgPT09IG1kNShvLmdyb3VwICsgby50aXRsZSkgJiYgKG9iai50aW1lID4gby50aW1lIHx8IG9iai50aW1lID09PSBvLnRpbWUpKSA9PT0gaW5kZ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FxcIlRleHRcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHR4dCwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICBnID0gXFxcIlBhc3RlXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGxlbiA9PT0gMSkge1xcbiAgICAgICAgICAgICAgICB0ID0gXy5ncm91cCArIFxcXCLop4TliJnjgIxcXFwiICsgXy50aXRsZSArIFxcXCLjgI1cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHQgPSBcXFwi5YWx44CMXFxcIiArIGxlbiArIFxcXCLjgI3mnaHop4TliJlcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoaXNKeCkgY2xlYXJNeVZhcignanhsaXN0MicpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly91Y2tr6KeE5YiZ5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXG5cXFwiICsgdCArIFxcXCLvv6VcXFwiICsgZyArIFxcXCLvv6VcXFwiICsgdSArICdAaW1wb3J0PWpzOiQucmVxdWlyZShcXFwidG9vbD9ydWxlPXVja2vkupFcXFwiKS5zZXRSdWxlKGlucHV0KTsnO1xcbiAgICAgICAgfSwgdGV4dCwgcnVsZXMubGVuZ3RoLCBydWxlc1swXSwgaXNKeCk7XFxuICAgIH0sXFxufTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKdtumAmueUqOWHveaVsFwiLFwicGF0aFwiOlwibGliXCIsXCJydWxlXCI6XCJjb25zdCBDb2xvciA9ICh0ZXN0LCBjb2xvcikgPT4ge1xcbiAgICByZXR1cm4gJzxmb250IGNvbG9yPVxcXCInICsgKGNvbG9yIHx8ICcjRkE3Mjk4JykgKyAnXFxcIj4nICsgdGVzdCArICc8L2Zyb250Pic7XFxufVxcbmNvbnN0IFN0cm9uZyA9ICh0ZXN0KSA9PiB7XFxuICAgIHJldHVybiAnPHN0cm9uZz4nICsgdGVzdCArICc8L3N0cm9uZz4nO1xcbn1cXG5jb25zdCBSaWNoID0gKHRlc3QpID0+IHtcXG4gICAgcmV0dXJuIFxcXCLigJjigJjigJnigJlcXFwiICsgU3RyaW5nKHRlc3QpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxufCg8fFxcXFxzKyliclxcXFxzKlxcXFwvP1xcXFxzKj4vZ2ksICdcXFxcbicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxyL2csICdcXFxccicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxmL2csICdcXFxcZicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFx0L2csICdcXFxcdCcpXFxuICAgICAgICAucmVwbGFjZSgvJihsdHxndHxuYnNwfGFtcHxxdW90KTsvZ2ksICgkMCwgJDEpID0+ICh7XFxuICAgICAgICAgICAgJ2x0JzogJzwnLFxcbiAgICAgICAgICAgICdndCc6ICc+JyxcXG4gICAgICAgICAgICAnbmJzcCc6ICcgJyxcXG4gICAgICAgICAgICAnYW1wJzogJyYnLFxcbiAgICAgICAgICAgICdxdW90JzogJ1xcXCInXFxuICAgICAgICB9WyQxLnRvTG93ZXJDYXNlKCldKSlcXG4gICAgICAgIC5yZXBsYWNlKC88XFxcXC8/KGVtfHNwYW4pW14+XSo+L2dpLCAnJyk7XFxufVxcbmNvbnN0IFNpemUgPSBzaXplID0+IHtcXG4gICAgaWYgKCFzaXplKSByZXR1cm4gJ+aXoOazleiuoeeulyc7XFxuICAgIHVuaXRzID0gWydCJywgJ0tCJywgJ01CJywgJ0dCJ107XFxuICAgIGkgPSAwO1xcbiAgICB3aGlsZSAoc2l6ZSA+IDEwMjMpIHtcXG4gICAgICAgIHNpemUgL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PXBhZ2UyJyArIF8pKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBwYWdlMjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICApXFxuICAgICAgICAucmVwbGFjZSgvZnlwYWdlL2csIHBhZ2UpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXCpcXFxcKi9nLCBLZXl3b3JkIHx8IFxcXCJcXFwiKTtcXG4gICAgaWYgKCFrZXl3b3JkKSBiYXNlVSA9IFN0cmluZyhiYXNlVSlcXG4gICAgICAgIC5yZXBsYWNlKFxcbiAgICAgICAgICAgIC9meShjbGFzc3xhcmVhfHllYXJ8c29ydCkvZyxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiBydWxlWyQxICsgJ191cmwnXVtldmFsKCQxICsgJ19pJyldIHx8IFxcXCJcXFwiXFxuICAgICAgICApXFxuICAgICAgICAucmVwbGFjZShcXG4gICAgICAgICAgICAvZnlBbGwvZyxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxuICAgICAgICAgICAgICAgIEZ5QWxsX2lpID0gRnlBbGxfaTtcXG4gICAgICAgICAgICAgICAgaWYgKEZ5QWxsX2lpID4gKHJ1bGUuY2xhc3NfaSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICBGeUFsbF9paSAtPSBydWxlLmNsYXNzX2k7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRnlBbGxfaWkgPiAocnVsZS5hcmVhX2kgLSAxKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEZ5QWxsX2lpIC09IHJ1bGUuYXJlYV9pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLnllYXJfaSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnNvcnRfdXJsW0Z5QWxsX2lpIC0gcnVsZS55ZWFyX2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnllYXJfdXJsW0Z5QWxsX2lpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmFyZWFfdXJsW0Z5QWxsX2lpXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmNsYXNzX3VybFtGeUFsbF9paV07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICApO1xcbiAgICByZXR1cm4gYmFzZVU7XFxufVxcbmNvbnN0IGdldFJ1bGVHcm91cCA9IChjb2xfdHlwZSwgU291KSA9PiB7XFxuICAgIGZvciAoaXQgb2YgWydjbGFzcycsICdhcmVhJywgJ3llYXInLCAnc29ydCddKSB7XFxuICAgICAgICBldmFsKGBpbmRleCA9IHtcXG4gICAgY2xhc3M6IDAsXFxuICAgIGFyZWE6IHJ1bGUuY2xhc3NfaSxcXG4gICAgeWVhcjogcnVsZS5jbGFzc19pICsgcnVsZS5hcmVhX2ksXFxuICAgIHNvcnQ6IHJ1bGUuY2xhc3NfaSArIHJ1bGUuYXJlYV9pICsgcnVsZS55ZWFyX2ksXFxufVtpdF1cXG5ydWxlLiR7aXR9X25hbWUubWFwKChuYW1lLCBpKSA9PiB7XFxuICAgIGlmIChpc0Z5QWxsKSB7XFxuICAgICAgICBpID0gaW5kZXggKyBpO1xcbiAgICAgICAgdCA9IEZ5QWxsX2kgPT0gaTtcXG4gICAgICAgIGsgPSAnRnlBbGxfaSc7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICB0ID0gJHtpdH1faSA9PSBpO1xcbiAgICAgICAgayA9ICcke2l0fV9pJ1xcbiAgICB9XFxuICAgIGQucHVzaCh7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FxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaFxcXCIsXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZToga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcigna2V5d29yZCcsaW5wdXQpXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB1cmw6IFxcXCJ0b2FzdDovL+WKoOi9veS4rS4uLlxcXCIsXFxuICAgICAgICBpbWc6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vd2Vpc3lyL2ltZy9Mb2FkaW5nMS5naWZcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJwaWNfMV9jZW50ZXJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBjbHM6IFxcXCJsb2FkaW5nX2dpZlxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIHNldFByZVJlc3VsdChkKTtcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLinbrmuKnppqjmj5DnpLpcIixcInBhdGhcIjpcIm5vdGljZVwiLFwicnVsZVwiOlwiJC5leHBvcnRzID0gZnVuY3Rpb24oKSB7XFxuICAgIGYgPSBcXFwiR3JheVxcXCI7XFxuICAgIHQgPSBmYWxzZTtcXG4gICAgdXAgPSBnZXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcnKTtcXG4gICAgaWYgKHVwICE9ICcxJykge1xcbiAgICAgICAgdmVyc2lvbiA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9ob21lQHVja2vkupFcXFwiKSkudmVyc2lvbjtcXG4gICAgICAgIGlmICh1cCA9PSAnJykge1xcbiAgICAgICAgICAgIFt1cmwsIHYsIHJ1bl0gPSAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPXVja2vkupFcXFwiKS5saXN0X29uZShcXFwiaHR0cHM6Ly93d3IubGFuem91aS5jb20vYjAzcWYyOHFiXFxcIiwgXFxcInJlYWRcXFwiKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgdiA9IHZlcnNpb24gKyAxO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHZlcnNpb24gPCB2KSB7XFxuICAgICAgICAgICAgZiA9IFxcXCJyZWRcXFwiO1xcbiAgICAgICAgICAgIHQgPSBcXFwi5qOA5rWL5Yiw5paw54mI5pu05paw77yM54K55Ye75LqG6Kej6K+m5oOF44CCXFxcIjtcXG4gICAgICAgICAgICBUID0gXFxcIuabtOaWsOWGheWuuVxcXCI7XFxuICAgICAgICAgICAgaWYgKHVwID09ICcnKSB7XFxuICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDmj5DnpLonLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+ajgOa1i+WIsOS9oOeahOinhOWImeeJiOacrOWwj+S6juacjeWKoeWZqOeJiOacrO+8jOaYr+WQpueri+WNs+abtOaWsO+8nycsXFxuICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChkYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPXVja2vkupFcXFwiKS5vbmVfdXJsKGRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJcXFxcdTZkNzdcXFxcdTk2MTRcXFxcdTg5YzZcXFxcdTc1NGNcXFxcdWZmZTVob21lX3J1bGVfdXJsXFxcXHVmZmU1XFxcIiArIGdldFBhdGgoZik7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHVybCA9ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgodXAsIHZlcnNpb24pID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGFuem91P3J1bGU9dWNra+S6kVxcXCIpLm9uZV9pbmZvKHVwLCBcXFwidWNra1xcXCIsIHZlcnNpb24pO1xcbiAgICAgICAgICAgIH0sIHVybCB8fCB1cCwgdmVyc2lvbik7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcblxcbiAgICBpZiAoISQucmVxdWlyZShcXFwidG9vbFxcXCIpLmlzTG9naW5Db29raWUoZ2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBcXFwiXFxcIikpKSB7XFxuICAgICAgICBjbGVhckl0ZW0oXFxcInF1YXJrQ29va2llXFxcIik7XFxuICAgICAgICBmID0gXFxcInJlZFxcXCI7XFxuICAgICAgICBUID0gXFxcIueZu+W9lei0puWPt1xcXCI7XFxuICAgICAgICB0ID0gXFxcIuacquajgOa1i+WIsOeZu+W9leS/oeaBr1xcXCI7XFxuICAgICAgICB1cmwgPSAkKFtcXFwi6L6T5YWlQ29va2llXFxcIiwgXFxcIue9kemhteeZu+W9lVxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIue9kemhteeZu+W9lVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvbG9naW5cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWlQ29va2llXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQucmVxdWlyZShcXFwidG9vbFxcXCIpLmlzTG9naW5Db29raWUoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBpbnB1dC5yZXBsYWNlKC9cXFxccy9nLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9Db29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9IGVsc2UgaWYgKCF0KSB7XFxuICAgICAgICBUID0gXFxcIueoi+W6j+iuvue9rlxcXCI7XFxuICAgICAgICB1cmwgPSBc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wgbm9UcCwgSHRtbCkge1xcbiAgICB0cnkge1xcbiAgICAgICAgaGVhZC5oZWFkZXJzLnJlZmVyZXIgPSB1cmwuc3BsaXQoXFxcIj9cXFwiKVswXTtcXG4gICAgICAgIGlzVHAgPSAhdXJsLm1hdGNoKFxcXCIvdHAvXFxcIik7XFxuICAgICAgICBpZiAoaXNUcCAmJiAhbm9UcCkge1xcbiAgICAgICAgICAgIGRhID0gdXJsLnJlcGxhY2UoL14oLio/XFxcXC5jb20pLywgJyQxL3RwJyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGRhID0gdXJsO1xcbiAgICAgICAgfVxcbiAgICAgICAgaHRtbCA9IFN0cmluZyhIdG1sIHx8IGZldGNoKGRhLCBoZWFkKSk7XFxuICAgICAgICBpZiAoaHRtbCA9PSBcXFwiXFxcIiAmJiBpc1RwICYmICFub1RwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIG9uZV91cmwodXJsLCBwd2QsIHJ1biwgdHJ1ZSk7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHBhdGggPSBodG1sLm1hdGNoKC9saW5rID0gWydcXFwiXShbXlxcXCInXSspL2kpWzFdO1xcbiAgICAgICAgICAgIGhvc3QgPSB1cmwubWF0Y2goL14oLio/XFxcXC5jb21cXFxcLykvKVsxXTtcXG4gICAgICAgICAgICByZXR1cm4gb25lX3VybChob3N0ICsgcGF0aCwgcHdkLCBydW4pO1xcbiAgICAgICAgfSBjYXRjaCAoZXJyMCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHBhdGggPSBodG1sLm1hdGNoKC8nKFxcXFw/Lis/KScvKVsxXTtcXG4gICAgICAgICAgICAgICAgaG9zdCA9IFxcXCJodHRwczovL2RldmVsb3Blci5sYW56b3VnLmNvbVxcXCI7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyMSkge1xcbiAgICAgICAgICAgICAgICBldmFsKGh0bWwubWF0Y2goL3ZhbHVlXFxcXDsoW1xcXFxzXFxcXFNdKz8pXFxcXCRcXFxcKC9pKVsxXSk7XFxuICAgICAgICAgICAgICAgIGV2YWwoJ2JvZHk9JyArIGh0bWwubWF0Y2goL1tcXFxcc1xcXFxTXSpkYXRhIDooW1xcXFxzXFxcXFNdKj9cXFxcfSksXFxcXHMrLylbMV0pO1xcbiAgICAgICAgICAgICAgICB1ID0gU3RyaW5nKHVybCkucmVwbGFjZSgvXFxcXC5jb20uKi8sIFxcXCIuY29tL2FqYXhtLnBocFxcXCIpO1xcbiAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShwb3N0KHUsIHtcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IGJvZHksXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkLmhlYWRlcnNcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICBwYXRoID0gXy51cmw7XFxuICAgICAgICAgICAgICAgIGhvc3QgPSBfLmRvbTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICB1ID0gaG9zdCArIFxcXCIvZmlsZS9cXFwiICsgcGF0aDtcXG4gICAgICAgIGsgPSBKU09OLnBhcnNlKGZldGNoKHUsIHtcXG4gICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uO1xcbiAgICAgICAgayA9IEFycmF5LmlzQXJyYXkoaykgPyBrWzBdIDogaztcXG4gICAgICAgIGlmIChydW4pIHJldHVybiBrO1xcbiAgICAgICAgbGV0IGYgPSBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9fZmlsZVNlbGVjdF9ydWxlLmpzb25cXFwiO1xcbiAgICAgICAgZG93bmxvYWRGaWxlKGssIGYpO1xcbiAgICAgICAgcmV0dXJuIGY7XFxuICAgIH0gY2F0Y2gg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gICAgICAgICAgICAgIEsgPSBvbmVfdXJsKHVybCwgcHdkLCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIUspIHtcXG4gICAgICAgICAgICAgICAgICAgIEsgPSBvbmVfdXJsKHVybC5zcGxpdChcXFwiP1xcXCIpWzBdLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChLKSB7XFxuICAgICAgICAgICAgICAgICAgICBmID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvX2ZpbGVTZWxlY3RfcnVsZS5qc29uXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRmlsZShLLCBmKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiXFxcXHU2ZDc3XFxcXHU5NjE0XFxcXHU4OWM2XFxcXHU3NTRjXFxcXHVmZmU1aG9tZV9ydWxlX3VybFxcXFx1ZmZlNVxcXCIgKyBnZXRQYXRoKGYpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iOt+WPluS4i+i9vemTvuaOpeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCB1cmwsIHB3ZCwgaXRlbSksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLinbvmlK/mjIHkvZzogIVcIixcInBhdGhcIjpcImRvbmF0ZVwiLFwicnVsZVw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AgICBleHRyYToge1xcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Yig6ZmkJyArIGdyb3VwLnJlcGxhY2UoJ+e7vOWQiCcsICflhajpg6gnKSArICfop4TliJknLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGdyb3VwKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdyb3VwID09IFxcXCLnu7zlkIhcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoJCQucnVsZVBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXCJncm91cFxcXCIsIGdyb3VwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9LCBncm91cClcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliIbkuqsnICsgZ3JvdXAucmVwbGFjZSgn57u85ZCIJywgJ+WFqOmDqCcpICsgJ+inhOWImScsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoZ3JvdXApID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXAgPT0gXFxcIue7vOWQiFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uKCkuc2xpY2UoMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzEoXFxcImdyb3VwXFxcIiwgZ3JvdXAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ0b29sP3J1bGU9dWNra+S6kVxcXCIpLmdldFJ1bGVQYXN0ZShydWxlcyk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBncm91cClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIF1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSk7XFxuZC5wdXNoKHtcXG4gICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG59KTtcXG5ydWxlcyA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRHcm91cEpzb24oZmFsc2UsIFxcXCJncm91cFxcXCIsIHBsYXRmb3JtLCBcXFwi57u85ZCIXFxcIik7XFxuXFxuXFxuXFxuXFxuXFxucGlkID0gTnVtYmVyKGdldE15VmFyKCdwaWQnKSkgfHwgMDtcXG5uYW1lcyA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRHcm91cE5hbWVzKHJ1bGVzLCBcXFwic2VhcmNoX2dyb3VwXFxcIik7XFxuaWYgKHBpZCA+IG5hbWVzLmxlbmd0aCAtIDEpIHtcXG4gICAgcGlkID0gMDtcXG59XFxubmFtZXMubWFwKChncm91cCwgaSkgPT4ge1xcbiAgICBpZiAoaSA9PSBwaWQpXFxuICAgICAgICBwbGF0Zm9ybTIgPSBSaWNoKFN0cm9uZyhDb2xvcihncm91cCkpKTtcXG4gICAgZWxzZVxcbiAgICAgICAgcGxhdGZvcm0yID0gZ3JvdXA7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogcGxhdGZvcm0yLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ3BpZCcsIGkpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgaSksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5LqrJyArIGdyb3VwLnJlcGxhY2UoJ+WFqOWFqCcsICflhajpg6gnKSArICfop4TliJknLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGxhdGZvcm0sIGdyb3VwKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwbGF0Zm9ybSA9PSBcXFwi57u85ZCIXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbigpLnNsaWNlKDEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMShcXFwiZ3JvdXBcXFwiLCBwbGF0Zm9ybSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB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tcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgYXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIodCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9IE9iamVjdC5rZXlzKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBhcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIodCwgX1t0XSB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdydWxlX3VpZCcsIG0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzZWFyY2hfZW5hYmxlZCcsIF8uc2VhcmNoX2VuYWJsZWQgfHwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZXhwbG9yZV9lbmFibGVkJywgXy5leHBsb3JlX2VuYWJsZWQgfHwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9ydWxlRWRpdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cGFnZVRpdGxlPeinhOWImee8lui+kSZydWxlPXVja2vkupEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Yig6ZmkJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6ZmkXFxcIiArIF8uZ3JvdXAgKyBcXFwi6KeE5YiZ4oCcXFxcIiArIF8udGl0bGUgKyAn4oCd5ZCX77yfXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzor7fosKjmhY7pgInmi6njgIInKS5jb25maXJtKChtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMihtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnp7vliqgnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dSA9IHp5LnNsaWNlKDEpLm1hcChfID0+IF8udGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6nnp7vliqjkvY3nva4nKS5zZWxlY3QoKHp5LCB6dSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IC0xKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGkgKyAxLCAwLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLnNhdmVKc29uKHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHp5LCB6dSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfpgInkuK3op4TliJknOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwianhsaXN0MlxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyW21dID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwianhsaXN0MlxcXCIsIGp4bGlzdDIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WPlua2iOmAieS4rSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBqeGxpc3QyW21dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJqeGxpc3QyXFxcIiwganhsaXN0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5ZCv55So5Y+R546wJzpcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+emgeeUqOWPkeeOsCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFwiZXhwbG9yZV9lbmFibGVkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgbSwgXyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogXy5pY29uXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IF8uZ3JvdXAgKyAn5LioJyArIF8uc2VhcmNoX2dyb3VwICsgJ+S4qCcgKyAoXy54NV91cmwgfHwgKF8udXJsID8gXy51cmwgOiBfLnNlYXJjaF91cmwpLnNwbGl0KFxcXCIvXFxcIikuc2xpY2UoMCwgMykuam9pbihcXFwiL1xcXCIpKSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG0pID0+IHtcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFwic2VhcmNoX2VuYWJsZWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIG0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoXy5zZWFyY2hfZW5hYmxlZCA9PSAnMScgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc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4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBnZXRNeVZhcigna2V5d29yZCcpKTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpZCcsIGkpO1xcbiAgICAgICAgICAgICAgICBmb3IgKHQgb2YgW1xcXCJjbGFzc1xcXCIsIFxcXCJhcmVhXFxcIiwgXFxcInllYXJcXFwiLCBcXFwic29ydFxcXCIsIFxcXCJGeUFsbFxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHQgKyBcXFwiX2lcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIGkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwieDVfd2Vidmlld19zaW5nbGVcXFwiLFxcbiAgICAgICAgdXJsOiBfLng1X2Rlc2MgPT0gJzEnIHx8IF8ueDVfdXJsIHx8IF8udXJsLFxcbiAgICAgICAgZGVzYzogXy54NV9kZXNjID09ICcxJyA/ICcwJyA6ICdzY3JlZW4tMTMzJiZmbG9hdCcsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNhbkJhY2s6IHRydWUsXFxuICAgICAgICAgICAgdWE6IF8ueDVfdWEgPyAoXy54NV91YSA9PSBcXFwiUENfVUFcXFwiID8gUENfVUEgOiBfLng1X3VhKSA6IE1PQklMRV9VQSxcXG4gICAgICAgICAgICByZWZlcmVyOiBfLng1X3JlZmVyZXIsXFxuICAgICAgICAgICAganM6IF8ueDVfanMsXFxuICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiAhIV8ueDVfanNMb2FkaW5nSW5qZWN0LFxcbiAgICAgICAgICAgIGF1dG9QbGF5OiAhIV8ueDVfYXV0b1BsYXksXFxuICAgICAgICAgICAgZmxvYXRWaWRlbzogISFfLng1X2Zsb2F0VmlkZW8sXFxuICAgICAgICAgICAgaW1nTG9uZ0NsaWNrOiAhXy54NV9pbWdMb25nQ2xpY2ssXFxuICAgICAgICAgICAgc2hvd1Byb2dyZXNzOiAhXy54NV9zaG93UHJvZ3Jlc3MsXFxuICAgICAgICAgICAgYmxvY2tSdWxlczogZXZhbChfLng1X2Jsb2NrUnVsZXMpIHx8IFtdLFxcbiAgICAgICAgICAgIHVybEludGVyY2VwdG9yOiAkLnRvU3RyaW5nKCh1cmxJbnRlcmNlcHRvcl9qcywgeDVVcmwpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJhbGl5dW5kcml2ZS5jb20vXFxcIikgfHwgaW5wdXQuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlLm5ldC9cXFwiKSB8fCBpbnB1dC5pbmNsdWRlcyhcXFwiYWxpcGFuLmNvbS9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZTogJ+S6keebmOWQmy7nroAnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvYWxpeXVuI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPeS6keebmOWQmy7nroAmcGFnZT1meXBhZ2UmcmVhbHVybD1cXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmNsdWRlcyhcXFwicXVhcmsuY25cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlpLjlhYvnvZHnm5hcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvcXVhcmtMaXN0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPXVja2vkupEmcmVhbHVybD1cXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHg1X3VybEludGVyY2VwdG9yID0gbmV3IEZ1bmN0aW9uKFxcXCJpbnB1dFxcXCIsIFxcXCJ4NVVybFxcXCIsIHVybEludGVyY2VwdG9yX2pzKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHg1X3VybEludGVyY2VwdG9yKGlucHV0LCB4NVVybCk7XFxuICAgICAgICAgICAgfSwgXy54NV91cmxJbnRlcmNlcHRvciwgXFxcImhpa2VyOi8vcGFnZS9ydWxlSG9tZSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT11Y2tr5LqRJnBhZ2U9ZnlwYWdlJnJ1bGVOYW1lPVxcXCIgKyBfLnRpdGxlICsgXFxcIiZydWxlR3JvdXA9XFxcIiArIF8uZ3JvdXAgKyBcXFwiJmJhc2VVcmw9XFxcIilcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufVxcblxcblxcblxcbmlmICh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o6lJyxcXG4gICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKC9xdWFyay5jbi4qXFxcXC9zXFxcXC8uKy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3JlYWx1cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChpbnB1dCkgKyBcXFwiJnJ1bGU9dWNra+S6kSZzaGFyZVB3ZD1cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaFxcXCIsXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZToga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcigna2V5d29yZCcsaW5wdXQpXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IocnVsZVR5cGUsIFxcXCIjMzM5OWNjXFxcIikpKSxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLnu7zlkIhcXFwiXS5jb25jYXQoZ3JvdXBzKS5tYXAobmFtZSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChuYW1lID09IHJ1bGVUeXBlKSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzZWFyY2hfdHlwZS5pbmRleE9mKG5hbWUpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gUmljaChcXFwiPFM+XFxcIiArIG5hbWUgKyBcXFwiPC9TPlxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBuYW1lO1xcbiAgICAgICAgICAgIH0pLCAzLCBcXFwi6YCJ5oup5pCc57Si57G75YirXFxcIikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmluZGV4T2YoXFxcIjxTPlxcXCIpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ5a+55bqU6KeE5YiZXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dC5pbmRleE9mKFxcXCI8XFxcIikgPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVUeXBlJywgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwicnVsZUdyb3VwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCJzaWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2VhcmNoX2dyb3VwLm1hcCgobmFtZSwgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBydWxlR3JvdXAgPT0gaSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVHcm91cCcsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwic2lkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzZWFyY2hfcnVsZS5tYXAoKF8sIGkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogc2lkID09IGkgPyBSaWNoKFN0cm9uZyhDb2xvcihfLnRpdGxlKSkpIDogXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBnZXRNeVZhcigna2V5d29yZCcpKTtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzaWQnLCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuXFxuXFxuXFxuXFxuXFxuICAgIGlmIChfU09VKSB7XFxuICAgICAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliqDovb3nrKxcXFwiICsgcGFnZSArIFxcXCLpobXkuK3vvIzov5vluqbvvJoxL1xcXCIgKyBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChfUEFHRSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5rKh5pyJ5Y+v55So55qE5pCc57Si6KeE5YiZXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2UgaWYgKF9QQUdFIHx8IHJ1bGUudXJsLm1hdGNoKFxcXCJmeXBhZ2VcXFwiKSkge1xcbiAgICAgICAgaWYgKF9QQUdFKSB7XFxuICAgICAgICAgICAgaWYgKHJ1bGUudGl0bGUgIT0gXFxcIuiBmuaQnFxcXCIpIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+JyArIENvbG9yKHJ1bGUudGl0bGUsICcjZmY2NjAxJykgKyAnPC9iPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgW1xcXCJjbGFzc1xcXCIsIFxcXCJhcmVhXFxcIiwgXFxcInllYXJcXFwiLCBcXFwic29ydFxcXCIsIFxcXCJGeUFsbFxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcih0ICsgXFxcIl9pXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICB9LCBcXFwiaGlrZXI6Ly9wYWdlL3J1bGVIb21lP3J1bGU9dWNra+S6kSZwYWdlPWZ5cGFnZSZydWxlTmFtZT1cXFwiICsgcnVsZS50aXRsZSArIFxcXCImcnVsZUdyb3VwPVxcXCIgKyBydWxlLmdyb3VwKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgaW1nOiBydWxlLmljb24sXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBob21lOiAxXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBnZXRSdWxlR3JvdXAoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGJhc2VVcmwgPSBob21lX2Jhc2VVcmw7XFxuICAgICAgICBldmFsKHJ1bGUucHJlUnVsZSk7XFxuICAgICAgICBldmFsKHJ1bGUuZmluZF9ydWxlKTtcXG4gICAgfVxcbn1cXG5fUEFHRSA/IHNldFByZVJlc3VsdChkKSA6IHNldFJlc3VsdChkKTtcXG5kZWxldGVJdGVtQnlDbHMoJ2xvYWRpbmdfZ2lmJyk7XFxuXFxuXFxuXFxuLy8g5pCc57SiXFxuaWYgKCghcnVsZV94NSB8fCAocnVsZS5TZWFyY2ggJiYgcnVsZS5zZWFyY2hfdXJsICE9IFxcXCJcXFwiICYmIHJ1bGUuc2VhcmNoRmluZCAhPSBcXFwiXFxcIikpICYmIF9TT1UgJiYgZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgIHNldEhpc3RvcnlLZXl3b3JkKCk7XFxuICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgcGFnZSA9IE1ZX1BBR0U7XFxuICAgICAgICAgICAgICAgICAgICBiYXNlVXJsID0gZ2V0UnVsZUJhc2VVcmwocnVsZS5zZWFyY2hfdXJsLCBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwYWdlID09IDEgfHwgcnVsZS5zZWFyY2hfdXJsLm1hdGNoKFxcXCJmeXBhZ2VcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwocnVsZS5wcmVSdWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2VhcmNoZmluZCA9IG5ldyBGdW5jdGlvbihcXFwicnVsZVxcXCIsIFxcXCJiYXNlVXJsXFxcIiwgXFxcImtleXdvcmRcXFwiLCBcXFwicGFnZVxcXCIsIHJ1bGUuc2VhcmNoRmluZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBzZWFyY2hmaW5kKHJ1bGUsIGJhc2VVcmwsIGtleXdvcmQsIHBhZ2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbGlzdCkgcmV0dXJuIFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZXNjVGlwcyA9IFxcXCLigJzigJzigJ3igJ1cXFwiICsgcnVsZS50aXRsZS5mb250Y29sb3IoXFxcIiNmMTNiNjZhXFxcIikgKyBcXFwiJm5ic3A7Jm5ic3A7XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzTGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzTGlzdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZS5pbmNsdWRlcyhcXFwi4oCc4oCc4oCd4oCdXFxcIikgPyBpdC50aXRsZSA6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgaXQudGl0bGUucmVwbGFjZSgvPFxcXFwvZW0+L2csIFxcXCJcXFwiKS5yZXBsYWNlKG5ldyBSZWdFeHAoa2V5d29yZCwgXFxcImdcXFwiKSwgXFxcIjxzdHJvbmc+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjogIzFFOTBGRlxcXFxcXFwiPlxcXCIgKyBrZXl3b3JkICsgXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2NUaXBzICsgKGl0LmRlc2MgfHwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGl0LmltZyB8fCBpdC5waWNfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LmNvbF90eXBlIHx8IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9QaWM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0LmV4dHJhIHx8IHt9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc0xpc3Q7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKF8udGl0bGUgKyBcXFwiOlxcXCIgKyBlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbTogaXQsXFxuICAgICAgICAgICAgaWQ6IFxcXCJ1Y2trX3J1bGVAXFxcIiArIGl0LnRpdGxlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBiYXRjaEV4ZWN1dGUodGFza3MsIHtcXG4gICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcbiAgICAgICAgICAgIHBhcmFtLmkgKz0gMTtcXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShyZXN1bHQpKSB7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oXFxcIl9ub3RoYXZlXFxcIik7XFxuICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUocGFnZWlkLCByZXN1bHQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAocGFyYW0uaSA9PT0gcGFyYW0uYWxsKSB7XFxuICAgICAgICAgICAgICAgIGlmICghcmVzdWx0IHx8ICFyZXN1bHQubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKFxcXCJfbm90aGF2ZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjotYTmupDpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJfbm90aGF2ZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZCk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxcXG4gICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICBpOiAwLFxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XCJ9LHtcImNvbF90eXBlXCI6X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WFyY2hfZ3JvdXBcXFwiKTtcXG4gICAgICAgICAgICBpZiAoIWdyb3VwLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAkKGdyb3VwLCAzLCBcXFwi6YCJ5oup6KeE5YiZ5YiG57uEXFxcIikuc2VsZWN0KChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgZXh0cmEgPSBmaW5kSXRlbShpZCkuZXh0cmE7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKGV4dHJhLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSwgaWQpO1xcbiAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihpZCwgdmFsdWUpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcIiR7aWR9XFxcIiwgaW5wdXQpYCxcXG4gICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnLFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogdHJ1ZSxcXG4gICAgICAgICAgICBoaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgaGVpZ2h0OiBoZWlnaHQgfHwgNSxcXG4gICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICB9LCBqc29uIHx8IHt9KVxcbiAgICB9KTtcXG59XFxuc3dpdGNoIChydWxlX3RpZCkge1xcbiAgICBjYXNlICfln7rmnKwnOlxcbiAgICAgICAgW1xcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5rqQ5ZCN56ewJywgJ3RpdGxlJywgJyddLFxcbiAgICAgICAgICAgIFsn6YCJ5aGr77yM5rqQ5Zu+5qCHJywgJ2ljb24nLCAnJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDkvZzogIUnLCAnYXV0aG9yJywgJ+S9muWQjSddLFxcbiAgICAgICAgICAgIFsn6YCJ5aGr77yMSnNMaWInLCAncHJlUnVsZScsICcnLCB7XFxuICAgICAgICAgICAgICAgIGhlaWdodDogM1xcbiAgICAgICAgICAgIH1dLFxcbiAgICAgICAgXS5tYXAoW2EsIGIsIGMsIGVdID0+IHtcXG4gICAgICAgICAgICBpbnB1dF9wdXNoKGEsIGIsIGMsIGUsIDEpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAn5pCc57SiJzpcXG4gICAgICAgIFtcXG4gICAgICAgICAgICBbJ+W/heWhq++8jOaQnOe0oumTvuaOpScsICdzZWFyY2hfdXJsJywgJyddLFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5pCc57Si5YiG57uEJywgJ3NlYXJjaF9ncm91cCcsICflhajlhagnLCB7XFxuICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogZmFsc2UsXFxuICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgWyflv4XloavvvIzliJfooajop4TliJlcXFxcbuaPkOS+m+WPmOmHjzogYmFzZVVybCwga2V5d29yZCwgcGFnZVxcXFxuXFxcXG7pnIDopoHov5Tlm57mlbDnu4TvvJpyZXR1cm4gW107JywgJ3NlYXJjaEZpbmQnLCAnJywge1xcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDVcXG4gICAgICAgICAgICB9XSxcXG4gICAgICAgIF0ubWFwKFthLCBiLCBjLCBlXSA9PiB7XFxuICAgICAgICAgICAgaW5wdXRfcHVzaChhLCBiLCBjLCBlLCAxKTtcXG4gICAgIC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AgY2FzZSAn5pu/5o2iJzpcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn5Y+R546w6ZO+5o6l5pu/5o2iJyksXFxuICAgICAgICAgICAgZGVzYzogJ+mAieWhqycsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyfliIbnsbvlkI3np7AnLCAnY2xhc3NfbmFtZScsICcnXSxcXG4gICAgICAgICAgICBbJ+WIhuexu+abv+aNoicsICdjbGFzc191cmwnLCAnJ10sXFxuICAgICAgICAgICAgWyflnLDljLrlkI3np7AnLCAnYXJlYV9uYW1lJywgJyddLFxcbiAgICAgICAgICAgIFsn5Zyw5Yy65pu/5o2iJywgJ2FyZWFfdXJsJywgJyddLFxcbiAgICAgICAgICAgIFsn5bm05Luj5ZCN56ewJywgJ3llYXJfbmFtZScsICcnXSxcXG4gICAgICAgICAgICBbJ+W5tOS7o+abv+aNoicsICd5ZWFyX3VybCcsICcnXSxcXG4gICAgICAgICAgICBbJ+aOkuW6j+WQjeensCcsICdzb3J0X25hbWUnLCAnJ10sXFxuICAgICAgICAgICAgWyfmjpLluo/mm7/mjaInLCAnc29ydF91cmwnLCAnJ10sXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcbiAgICAgICAgICAgIGlucHV0X3B1c2goYSwgYiwgYywgZSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmianlsZUnOlxcbiAgICAgICAgeDVfanNMb2FkaW5nSW5qZWN0ID0gZ2V0TXlWYXIoJ3g1X2pzTG9hZGluZ0luamVjdCcsICcwJykgPT0gJzEnO1x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NrID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7kuI3mmL7npLrov5vluqbmnaE8L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X3Nob3dQcm9ncmVzcycsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfc2hvd1Byb2dyZXNzID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfc2hvd1Byb2dyZXNzID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mgqzmta7ll4XmjqLmkq3mlL48L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2Zsb2F0VmlkZW8nLCB4KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHg1X2Zsb2F0VmlkZW8gPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh4NV9mbG9hdFZpZGVvID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7pn7Pop4bpopHoh6rliqjmkq3mlL48L2I+JyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2F1dG9QbGF5JywgeCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB4NV9hdXRvUGxheSA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKHg1X2F1dG9QbGF5ID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcoJ3g15omp5bGVJyksXFxuICAgICAgICAgICAgZGVzYzogJ+mAieWhqycsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6aaW6aG15LiN5pi+56S65pCc57Si5qGGPC9iPicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh4KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd4NV9kZXNjJywgeCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB4NV9kZXNjID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfZGVzYyA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBpbnB1dF9wdXNoKFxcXCJ1cmzvvIzlj5HnjrDpk77mjqXlkox4NemTvuaOpeWGsueqgeaXtuWhq+WGmVxcXCIsIFxcXCJ4NV91cmxcXFwiLCBcXFwiXFxcIiwge30sIDEpO1xcbiAgICAgICAgaW5wdXRfcHVzaChcXFwiaG9tZV9qc++8jOS4jeaYvuekuuaQnOe0ouahhuaXtuaJp+ihjOOAglxcXFxu57un5om/5pWw57uEZO+8jOWGheWuueWPquacieinhOWImeWIhuexu+OAglxcXFxu5Zyo5q2k5Z+656GA5LiK6Ieq5a6a5LmJ6aaW6aG15ZCn44CCXFxcIiwgXFxcIng1X2hvbWVcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICBicmVhaztcXG59XFxuZC5wdXNoKHtcXG4gICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhDb2xvcign5L+d5a2Y5bm26YC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XFxcIikubGF6eVJ1bGUoKGlkLCBrZXkpID0+IHtcXG4gICAgICAgICAgICBsZXQgZXh0cmEgPSBmaW5kSXRlbShpZCArIFxcXCI6c2VhcmNoXFxcIikuZXh0cmE7XFxuICAgICAgICAgICAgZXh0cmEuZGVmYXVsdFZhbHVlID0ga2V5O1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfSwgaWQsIGtleSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjprZXk6XFxcIiArIGtleSxcXG4gICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaTlhbPplK7or406XFxcIiArIGtleSxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGlkLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBoaXN0b3J5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpaSA9IGhpc3RvcnkuaW5kZXhPZihrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgaGlzdG9yeS5zcGxpY2UoaWksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIGhpc3RvcnkpO1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArIFxcXCI6a2V5OlxcXCIgKyBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBhZGRJdGVtQWZ0ZXIoaWQgKyBcXFwiOnNlYXJjaEhpc3RvcnlcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJ5ZOmfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSwgaWQsIGtleSlcXG4gICAgICAgICAgICB9XVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59KTtgLFxcblxcbiAgICAgICAgY2xhc3NfbmFtZTogXFxcIlxcXCIsXFxuICAgICAgICBjbGFzc191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgYXJlYV9uYW1lOiBcXFwiXFxcIixcXG4gICAgICAgIGFyZWFfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgIHllYXJfbmFtZTogXFxcIlxcXCIsXFxuICAgICAgICB5ZWFyX3VybDogXFxcIlxcXCIsXFxuICAgICAgICBzb3J0X25hbWU6IFxcXCJcXFwiLFxcbiAgICAgICAgc29ydF91cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgdGltZTogMFxcbiAgICB9XTtc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0gT2JqZWN0LmFzc2lnbih7fSwgdGhpcy5vcHRpb25zKTtcXFxcbiAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLmJvZHkgPT09IFxcXFxcXFwib2JqZWN0XFxcXFxcXCIgJiYgdGhpcy5fYm9keVRvU3RyaW5nKSB7XFxcXG4gICAgICAgICAgICBvcHRpb25zLmJvZHkgPSBKU09OLnN0cmluZ2lmeShvcHRpb25zLmJvZHkpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHRoaXMuc3RhcnRSZXF1ZXN0KHRoaXMuYnVpbGRQYXJhbT9idWlsZFVybCh0aGlzLnVybCwgdGhpcy5idWlsZFBhcmFtKTp0aGlzLnVybCwgb3B0aW9ucykpO1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgaWYgKHJlcy5zdGF0dXNDb2RlID49IDIwMCAmJiByZXMuc3RhdHVzQ29kZSA8PSAzMDApIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgYm9keSA9IHJlcy5ib2R5O1xcXFxuICAgICAgICAgICAgICAgIGlmICh0b0pzb24pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IEpTT04ucGFyc2UoYm9keSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnN1Y2Nlc3NDYWxsYmFjayhib2R5LCByZXMpO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoU3RyaW5nKHJlcy5zdGF0dXNDb2RlKSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGVycikge1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBlcnIgPSB0aGlzLmVycm9yVHlwZUNhbGxiYWNrKGVyciwgcmVzKTtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHRoaXMucmV0cnlDb3VudCkge1xcXFxuICAgICAgICAgICAgICAgIGxldCB0cnlSZXN1bHQgPSB0aGlzLmVycm9yQ2FsbGJhY2tXaXRoUmV0cnkoZXJyLCByZXMsIHRoaXMpO1xcXFxuICAgICAgICAgICAgICAgIGlmICh0cnlSZXN1bHQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXRyeUNvdW50LS07XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnN0YXJ0KHRvSnNvbik7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXRyeUNvdW50ID0gMDtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JDYWxsYmFjayhlcnIsIHJlcyk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5lcnJvckNhbGxiYWNrKGVyciwgcmVzKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgIH0sXFxcXG4gICAgc2V0T3B0aW9ucyhvcHRpb25zKSB7XFxcXG4gICAgICAgIHRoaXMub3B0aW9ucyA9IE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMsIHtcXFxcbiAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICByZXR1cm4gdGhpcztcXFxcbiAgICB9LFxcXFxuICAgIG1lcmdlSGVhZEFuZEJvZHkob3B0aW9ucykge1xcXFxuICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTtcXFxcbiAgICAgICAgT2JqZWN0LmFzc2lnbih0aGlzLm9wdGlvbnMu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xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJxa2xpbms6Ly93d3cudWMuY24vYjIwYjg0ZmQ3MzVhOGRkM2Y3NTQxMTI5YmFjYzRlOWE/YWN0aW9uPW9wZW5fdXJsJnVybD1odHRwczovL3Bhbi5xdWFyay5jbi9zL1xcXFxcXFwiICsgc2hhcmVJZDtcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09IFxcXFxcXFwi55m75b2VXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcXFxcXCLovpPlhaVDb29raWVcXFxcXFxcIiwgXFxcXFxcXCLnvZHpobXnmbvlvZVcXFxcXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcXFxcXCLnvZHpobXnmbvlvZVcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuivt+i+k+WFpUNvb2tpZVxcXFxcXFwiKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCQucmVxdWlyZShcXFxcXFxcInRvb2xcXFxcXFxcIikuaXNMb2dpbkNvb2tpZShpbnB1dCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFxcXFxcInF1YXJrQ29va2llXFxcXFxcXCIsIGlucHV0LnJlcGxhY2UoL1xcXFxcXFxccy9nLCBcXFxcXFxcIlxcXFxcXFwiKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9Db29raWXmoLzlvI/plJnor69cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09PSBcXFxcXFxcIuWOn+eUu+S4i+i9vee6v+eoi1xcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoZ2V0SXRlbShcXFxcXFxcInNwZWVkVGhyZWFkXFxcXFxcXCIsIFxcXFxcXFwiMTBcXFxcXFxcIiksIFxcXFxcXFwi6K+36L6T5YWlMy0zMuS5i+mXtOeahOaVtOaVsFxcXFxcXFwiKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzcGVlZFRocmVhZCA9IHBhcnNlSW50KGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNwZWVkVGhyZWFkIDwgMyB8fCBzcGVlZFRocmVhZCA+IDMyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+iuvue9ruS4jeWQiOazlVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJzcGVlZFRocmVhZFxcXFxcXFwiLCBTdHJpbmcoc3BlZWRUaHJlYWQpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFw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RyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBzaGFyZUlkLFxcXFxuICAgICAgICAgICAgICAgICAgICBzaGFyZVB3ZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVUb2tlbjogcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLFxcXFxuICAgICAgICAgICAgICAgICAgICBmaWxlSWQ6IGl0ZW0uZmlkLFxcXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRIZWFkKGl0ZW0ub2JqX2NhdGVnb3J5KSArIGl0ZW0uZmlsZV9uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6ICQuZGF0ZUZvcm1hdChpdGVtLnVwZGF0ZWRfYXQsICd5eXl5LU1NLWRkJykgKyAnICAnICsgZm9ybWF0U2l6ZShpdGVtLnNpemUpLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGl0ZW0udGh1bWJuYWlsLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChmaWQsIGZpZF90b2tlbiwgcHdkX2lkLCBzdG9rZW4sIGNhdGVnb3J5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VXJsQ2FjaGUgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFxcXFxcInBsYXlVcmxDYWNoZVxcXFxcXFwiLCB7fSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwbGF5VXJsQ2FjaGVbZmlkXSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmxDYWNoZVtmaWRdO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICQucmVxdWlyZShcXFxcXFxcInBsYXlcXFxcXFxcIikuZ2V0UGxheVVybChmaWQsIGZpZF90b2tlbiwgcHdkX2lkLCBzdG9rZW4sIGNhdGVnb3J5KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlVcmxDYWNoZVtmaWRdID0gdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcXFxcXCJwbGF5VXJsQ2FjaGVcXFxcXFxcIiwgcGxheVVybENhY2hlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV9maWRfdG9rZW4sIHNoYXJlSWQsIHF1YXJrU2hhcmVBcGkuZ2V0VG9rZW4oKSwgaXRlbS5vYmpfY2F0ZWdvcnkpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzdHlsZSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5maWQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlsaXN0ICcgKyBpdGVtLm9ial9jYXRlZ29yeVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfSk7XFxcXG59IGNhdGNoIChlKSB7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6IGUubWVzc2FnZSxcXFxcbiAgIC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Iik7XFxcXG5sZXQgaHR0cFJlcXVlc3QgPSAkLnJlcXVpcmUoXFxcXFxcXCJodHRwUmVxdWVzdFxcXFxcXFwiKTtcXFxcblxcXFxuZnVuY3Rpb24gQ29va2llTWFuYWdlKGNvb2tpZSkge1xcXFxuICAgIHRoaXMuY29va2llID0ge307XFxcXG4gICAgdGhpcy5hZGQoY29va2llKTtcXFxcbn1cXFxcbk9iamVjdC5hc3NpZ24oQ29va2llTWFuYWdlLnByb3RvdHlwZSwge1xcXFxuICAgIGFkZChjb29raWUpIHtcXFxcbiAgICAgICAgbGV0IGNvb2tpZXMgPSBbXTtcXFxcbiAgICAgICAgaWYgKHR5cGVvZiBjb29raWUgPT09IFxcXFxcXFwic3RyaW5nXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIGNvb2tpZXMgPSBjb29raWUuc3BsaXQoXFxcXFxcXCI7XFxcXFxcXCIpO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoY29va2llKSkge1xcXFxuICAgICAgICAgICAgY29va2llcyA9IGNvb2tpZTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBjb29raWVzLmZvckVhY2godiA9PiB7XFxcXG4gICAgICAgICAgICB2ID0gdi5zcGxpdChcXFxcXFxcIj1cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBpZiAodi5sZW5ndGggPCAyKSByZXR1cm47XFxcXG4gICAgICAgICAgICB0aGlzLmNvb2tpZVt2WzBdLnRyaW0oKV0gPSB2WzFdLnRyaW0oKTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfSxcXFxcbiAgICBnZXQoKSB7XFxcXG4gICAgICAgIHJldHVybiBPYmplY3QuZW50cmllcyh0aGlzLmNvb2tpZSkubWFwKHYgPT4gdlswXSArIFxcXFxcXFwiPVxcXFxcXFwiICsgdlsxXSkuam9pbihcXFxcXFxcIjtcXFxcXFxcIik7XFxcXG4gICAgfVxcXFxufSk7XFxcXG5jb25zdCBjb29ra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xcIui9rOeggVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIGlmIChwbGF5TW9kZSA9PT0gXFxcXFxcXCLovaznoIFcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIGxldCB2aWRlb1JlcyA9IGdldFByZXZpZXdWaWRlbyhhc2ZpZCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHZpZGVvTGlzdCA9IHZpZGVvUmVzLmRhdGEudmlkZW9fbGlzdDtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcGxheUxpc3QgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW10sXFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFtdXFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICB2aWRlb0xpc3QuZmlsdGVyKHYgPT4gdi5hY2Nlc3NhYmxlKS5mb3JFYWNoKHYgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdC5uYW1lcy5wdXNoKHYucmVzb2x1dGlvbik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlMaXN0LnVybHMucHVzaCh2LnZpZGVvX2luZm8udXJsICsgXFxcXFxcXCIjaXNWaWRlbz10cnVlI1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGxheUxpc3QuaGVhZGVycy5wdXNoKHBsYXlIZWFkZXIpO1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIGNyZWF0ZURlbGV0ZVRhc2soYXNmaWQpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShwbGF5TGlzdCk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIGxldCBwbGF5VXJsID0gZ2V0RG93bmxvYWRVcmwoYXNmaWQpLmRhdGFb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cIikgKyBcXFxcXFxcIiNcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFtwbGF5SGVhZGVyXVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjcmVhdGVEZWxldGVUYXNrKGFzZmlkKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocGxheUxpc3QpO1xcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAvLyDmmL7npLrlm77niYdcXFxcbiAgICAgICAgICAgIGlmIChwbGF5SW5mby5mb3JtYXRfdHlwZS5pbmNsdWRlcygnaW1hZ2UnKSB8fCBwbGF5SW5mby5maWxlX25hbWUubWF0Y2goL1xcXFxcXFxcLihqcGd8Z2lmfGpwZWd8cG5nfGJtcHxzdmd8aWNvfHRpZmYpLykpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybCArIFxcXFxcXFwiQGhlYWRlcnM9XFxcXFxcXCIgKyBKU09OLnN0cmluZ2lmeShwbGF5SGVhZGVyKTtcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgLy8g5LiL6L296LWE5rqQXFxcXG4gICAgICAgICAgICBwbGF5SGVhZGVyID0gT2JqZWN0LmtleXMocGxheUhlYWRlcikubWFwKEtleSA9PiBLZXkgKyBcXFxcXFxcIkBcXFxcXFxcIiArIFN0cmluZyhwbGF5SGVhZGVyW0tleV0pLnJlcGxhY2UoLzsvZywgXFxcXFxcXCLvvJvvvJtcXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyBwbGF5VXJsICsgJzt7JyArIHBsYXlIZWFkZXIuam9pbihcXFxcXFxcIiYmXFxcXFxcXCIpICsgJ30nO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICBpZiAoZS5tZXNzYWdl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goe1xcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcXFxcXCIsXFxcXG4gICAgdXJsOiBcXFxcXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXFxcXFwiLFxcXFxuICAgIGRlc2M6IFxcXFxcXFwiZmxvYXQmJjEwMCVcXFxcXFxcIixcXFxcbiAgICBleHRyYToge1xcXFxuICAgICAgICBqczogJC50b1N0cmluZygoQXBpUm9vdFVybCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IHRpbWVJbnRlciA9IHNldEludGVydmFsKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgQ29va2llID0gZmJhLmdldENvb2tpZShBcGlSb290VXJsKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoQ29va2llLmluY2x1ZGVzKFxcXFxcXFwiX1VQX0Y3RV84RF89XFxcXFxcXCIpICYmIENvb2tpZS5pbmNsdWRlcyhcXFxcXFxcIl9fdWlkPVxcXFxcXFwiKSYmQ29va2llLmluY2x1ZGVzKFxcXFxcXFwiX19wdXVzPVxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXFxcXFwicXVhcmtDb29raWVcXFxcXFxcIiwgQ29va2llKVxcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKHRpbWVJbnRlcik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coQ29va2llKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmJhY2soZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIDYwMCk7XFxcXG4gICAgICAgIH0sIFxcXFxcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY25cXFxcXFxcIiksXFxcXG4gICAgICAgIHVhOiBQQ19VQSxcXFxcbiAgICAgICAganNMb2FkaW5nSW5qZWN0OiBmYWxzZVxcXFxuICAgIH1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FxcXCIjI1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZHVybCA9ICQucmVxdWlyZSgnbGFuem91P3J1bGU9dWNra+S6kScpLm9uZV91cmwodXJsLCBwd2QsIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gU3RyaW5nKGZldGNoKGR1cmwpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKChzcCA9IHRleHQuc3BsaXQoXFxcXFxcXCLvv6VcXFxcXFxcIikpLmxlbmd0aCA9PSAzKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gc3BbMl0uc3BsaXQoXFxcXFxcXCJAXFxcXFxcXCIpWzBdLnRyaW0oKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGFycjEgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZSh0ZXh0KSk7XFxcXG5cXFxcblxcXFxuICAgICAgICAgICAgLy8g5ZCI5bm277yM5Y676YeNXFxcXG4gICAgICAgICAgICBhcnIyID0gJC5yZXF1aXJlKFxcXFxcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFxcXFxcIikuZ2V0SnNvbigpO1xcXFxuICAgICAgICAgICAgYXJyMyA9IGFycjIuY29uY2F0KGFycjEpLmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBvYmouZ3JvdXAgPT09IG8uZ3JvdXAgJiYgb2JqLnRpdGxlID09PSBvLnRpdGxlICYmIChvYmoudGltZSA+IG8udGltZSB8fCBvYmoudGltZSA9PSBvLnRpbWUpKSA9PT0gaW5kZXg7XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICQucmVxdWlyZShcXFxcXFxcImNvbmZpZ3M/c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XFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEsIF8pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdydWxlX3RpZCcpO1xcXFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdWlkJyk7XFxcXG4gICAgICAgICAgICAgICAganhsaXN0ID0ganhsaXN0LmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gbWQ1KG9iai5ncm91cCArIG9iai50aXRsZSkgPT09IG1kNShvLmdyb3VwICsgby50aXRsZSkgJiYgKG9iai50aW1lID4gby50aW1lIHx8IG9iai50aW1lID09PSBvLnRpbWUpKSA9PT0gaW5kZXg7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXFxcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFxcXFxcIikuc2F2ZUpzb24oanhsaXN0KTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgJ3RvYXN0Oi8v5L+d5a2Y5oiQ5YqfJztcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aQnOe0ouinhOWImS/lj5HnjrDop4TliJnmgLvlvpflhpnkuIDkuKrlkKcnO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGVsc2UgaWYgKF8udGl0bGUgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ivt+Whq+WGmea6kOWQjeensCc7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJ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gICAgICAgIH1cXFxcbiAgICAgICAgKVxcXFxuICAgICAgICAucmVwbGFjZSgvZnlwYWdlL2csIHBhZ2UpXFxcXG4gICAgICAgIC5yZXBsYWNlKC9cXFxcXFxcXCpcXFxcXFxcXCovZywgS2V5d29yZCB8fCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICBpZiAoIWtleXdvcmQpIGJhc2VVID0gU3RyaW5nKGJhc2VVKVxcXFxuICAgICAgICAucmVwbGFjZShcXFxcbiAgICAgICAgICAgIC9meShjbGFzc3xhcmVhfHllYXJ8c29ydCkvZyxcXFxcbiAgICAgICAgICAgICgkMCwgJDEpID0+IHJ1bGVbJDEgKyAnX3VybCddW2V2YWwoJDEgKyAnX2knKV0gfHwgXFxcXFxcXCJcXFxcXFxcIlxcXFxuICAgICAgICApXFxcXG4gICAgICAgIC5yZXBsYWNlKFxcXFxuICAgICAgICAgICAgL2Z5QWxsL2csXFxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgRnlBbGxfaWkgPSBGeUFsbF9pO1xcXFxuICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLmNsYXNzX2kgLSAxKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBGeUFsbF9paSAtPSBydWxlLmNsYXNzX2k7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLmFyZWFfaSAtIDEpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBGeUFsbF9paSAtPSBydWxlLmFyZWFfaTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLnllYXJfaSAtIDEpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuc29ydF91cmxbRnlBbGxfaWkgLSBydWxlLnllYXJfaV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLnllYXJfdXJsW0Z5QWxsX2lpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmFyZWFfdXJsW0Z5QWxsX2lpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmNsYXNzX3VybFtGeUFsbF9paV07XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICApO1xcXFxuICAgIHJldHVybiBiYXNlVTtcXFxcbn1cXFxcbmNvbnN0IGdldFJ1bGVHcm91cCA9IChjb2xfdHlwZSwgU291KSA9PiB7XFxcXG4gICAgZm9yIChpdCBvZiBbJ2NsYXNzJywgJ2FyZWEnLCAneWVhcicsICdzb3J0J10pIHtcXFxcbiAgICAgICAgZXZhbChgaW5kZXggPSB7XFxcXG4gICAgY2xhc3M6IDAsXFxcXG4gICAgYXJlYTogcnVsZS5jbGFzc19pLFxcXFxuICAgIHllYXI6IHJ1bGUuY2xhc3NfaSArIHJ1bGUuYXJlYV9pLFxcXFxuICAgIHNvcnQ6IHJ1bGUuY2xhc3NfaSArIHJ1bGUuYXJlYV9pICsgcnVsZS55ZWFyX2ksXFxcXG59W2l0XVxcXFxucnVsZS4ke2l0fV9uYW1lLm1hcCgobmFtZSwgaSkgPT4ge1xcXFxuICAgIGlmIChpc0Z5QWxsKSB7XFxcXG4gICAgICAgIGkgPSBpbmRleCArIGk7XFxcXG4gICAgICAgIHQgPSBGeUFsbF9pID09IGk7XFxcXG4gICAgICAgIGsgPSAnRnlBbGxfaSc7XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgdCA9ICR7aXR9X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XFxcXFxcIjtcXFxcbiAgICAgICAgICAgIHQgPSBcXFxcXFxcIuajgOa1i+WIsOaWsOeJiOabtOaWsO+8jOeCueWHu+S6huino+ivpuaDheOAglxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgVCA9IFxcXFxcXFwi5pu05paw5YaF5a65XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICBpZiAodXAgPT0gJycpIHtcXFxcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDmj5DnpLonLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAn5qOA5rWL5Yiw5L2g55qE6KeE5YiZ54mI5pys5bCP5LqO5pyN5Yqh5Zmo54mI5pys77yM5piv5ZCm56uL5Y2z5pu05paw77yfJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoZGEpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAkLnJlcXVpcmUoXFxcXFxcXCJsYW56b3U/cnVsZT11Y2tr5LqRXFxcXFxcXCIpLm9uZV91cmwoZGEpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnMScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiXFxcXFxcXFx1NmQ3N1xcXFxcXFxcdTk2MTRcXFxcXFxcXHU4OWM2XFxcXFxcXFx1NzU0Y1xcXFxcXFxcdWZmZTVob21lX3J1bGVfdXJsXFxcXFxcXFx1ZmZlNVxcXFxcXFwiICsgZ2V0UGF0aChmKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgdXJsKTtcXFxcbiAgICAgICAgICAgIH1cXFxcb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XFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9sb2dpblxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuivt+i+k+WFpUNvb2tpZVxcXFxcXFwiKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcXFxcXCJ0b29sXFxcXFxcXCIpLmlzTG9naW5Db29raWUoaW5wdXQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwicXVhcmtDb29raWVcXFxcXFxcIiwgaW5wdXQucmVwbGFjZSgvXFxcXFxcXFxzL2csIFxcXFxcXFwiXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9Db29raWXmoLzlvI/plJnor69cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0gZWxzZSBpZiAoIXQpIHtcXFxcbiAgICAgICAgVCA9IFxcXFxcXFwi56iL5bqP6K6+572uXFxcXFxcXCI7XFxcXG4gICAgICAgIHVybCA9IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2luc3RhbGwjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcXFxcXCI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XFxcXC8pLylbMV07XFxcXG4gICAgICAgICAgICByZXR1cm4gb25lX3VybChob3N0ICsgcGF0aCwgcHdkLCBydW4pO1xcXFxuICAgICAgICB9IGNhdGNoIChlcnIwKSB7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIHBhdGggPSBodG1sLm1hdGNoKC8nKFxcXFxcXFxcPy4rPyknLylbMV07XFxcXG4gICAgICAgICAgICAgICAgaG9zdCA9IFxcXFxcXFwiaHR0cHM6Ly9kZXZlbG9wZXIubGFuem91Zy5jb21cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycjEpIHtcXFxcbiAgICAgICAgICAgICAgICBldmFsKGh0bWwubWF0Y2goL3ZhbHVlXFxcXFxcXFw7KFtcXFxcXFxcXHNcXFxcXFxcXFNdKz8pXFxcXFxcXFwkXFxcXFxcXFwoL2kpWzFdKTtcXFxcbiAgICAgICAgICAgICAgICBldmFsKCdib2R5PScgKyBodG1sLm1hdGNoKC9bXFxcXFxcXFxzXFxcXFxcXFxTXSpkYXRhIDooW1xcXFxcXFxcc1xcXFxcXFxcU10qP1xcXFxcXFxcfSksXFxcXFxcXFxzKy8pWzFdKTtcXFxcbiAgICAgICAgICAgICAgICB1ID0gU3RyaW5nKHVybCkucmVwbGFjZSgvXFxcXFxcXFwuY29tLiovLCBcXFxcXFxcIi5jb20vYWpheG0ucGhwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKHBvc3QodSwge1xcXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkLmhlYWRlcnNcXFxcbiAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgcGF0aCA9IF8udXJsO1xcXFxuICAgICAgICAgICAgICAgIGhvc3QgPSBfLmRvbTtcXFxcbiAgICAgICAgICAgIH1cXFxcb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cjovL2VtcHR5JyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJpZ19ibGFua19ibG9ja1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwiPGI+4oCc4oCc56Gu5a6a5pu05paw4oCd4oCdPC9iPlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFxcXFxcIikubGF6eVJ1bGUoKHVybCwgcHdkLCBpdGVtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdSdWxlX25vdXBkYXRlJykgPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrKHRydWUpLCBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbGV0IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgb25lX3VybFxcXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvbGFuem91P3J1bGU95q2M6K+N6YCC6YWNXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGxldCBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSwgMCwgaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIEsgP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iXS5jb25jYXQoZ3JvdXBzKS5tYXAoZ3JvdXAgPT4ge1xcXFxuICAgIGlmIChncm91cCA9PSBwbGF0Zm9ybSlcXFxcbiAgICAgICAgcGxhdGZvcm0yID0gUmljaChTdHJvbmcoQ29sb3IoZ3JvdXApKSk7XFxcXG4gICAgZWxzZVxcXFxuICAgICAgICBwbGF0Zm9ybTIgPSBncm91cDtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogcGxhdGZvcm0yLFxcXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGdyb3VwKSA9PiB7XFxcXG4gICAgICAgICAgICBwdXRNeVZhcigncGxhdGZvcm0nLCBncm91cCk7XFxcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgfSwgZ3JvdXApLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+WIoOmZpCcgKyBncm91cC5yZXBsYWNlKCfnu7zlkIgnLCAn5YWo6YOoJykgKyAn6KeE5YiZJyxcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGdyb3VwKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChncm91cCA9PSBcXFxcXFxcIue7vOWQiFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSgkJC5ydWxlUGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXFxcXFwiZ3JvdXBcXFxcXFxcIiwgZ3JvdXApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQkLnNhdmVKc29uKHJ1bGVzKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGdyb3VwKVxcXFxuICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAge1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhuS6qycgKyBncm91cC5yZXBsYWNlKCfnu7zlkIgnLCAn5YWo6YOoJykgKyAn6KeE5YiZJyxcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGdyb3VwKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChncm91cCA9PSBcXFxcXFxcIue7vOWQiFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uKCkuc2xpY2UoMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXFxcXFwiZ3JvdXBcXFxcXFxcIiwgZ3JvdXAsIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICA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biAgICAgICAgICAgIHB1dE15VmFyKCdwaWQnLCBpKTtcXFxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgIH0sIGkpLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5YiG5LqrJyArIGdyb3VwLnJlcGxhY2UoJ+WFqOWFqCcsICflhajpg6gnKSArICfop4TliJknLFxcXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwbGF0Zm9ybSwgZ3JvdXApID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwbGF0Zm9ybSA9PSBcXFxcXFxcIue7vOWQiFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb24oKS5zbGljZSgxKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8xKFxcXFxcXFwiZ3JvdXBcXFxcXFxcIiwgcGxhdGZvcm0sIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChncm91cCAhPSBcXFxcXFxcIuWFqOWFqFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9IHJ1bGVzLmZpbHRlcihmID0+IGYuc2VhcmNoX2dyb3VwID09IGdyb3VwKTtcXFxcbiAgICAgICAgICA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aztcXFxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn57yW6L6RJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyciA9ICQucmVxdWlyZSgndG9vbD9ydWxlPXVja2vkupEnKS5nZXRWYXJpYWJsZXMoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBhcnIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gT2JqZWN0LmtleXMoXyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgYXJyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIodCwgX1t0XSB8fCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdydWxlX3VpZCcsIG0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaF9lbmFibGVkJywgXy5zZWFyY2hfZW5hYmxlZCB8fCBcXFxcXFxcIjBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZXhwbG9yZV9lbmFibGVkJywgXy5leHBsb3JlX2VuYWJsZWQgfHwgXFxcXFxcXCIwXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcnVsZUVkaXQjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3BhZ2VUaXRsZT3op4TliJnnvJbovpEmcnVsZT11Y2tr5LqRJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfliKDpmaQnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcXFxcXCLnoa7lrprliKDpmaRcXFxcXFxcIiArIF8uZ3JvdXAgKyBcXFxcXFxcIuinhOWImeKAnFxcXFxcXFwiICsgXy50aXRsZSArICfigJ3lkJfvvJ9cXFxcXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzor7fosKjmhY7pgInmi6njgIInKS5jb25maXJtKChtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzIobSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQuc2F2ZUpzb24ocnVsZXMpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIG0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+enu+WKqCc6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eSA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5nZXRKc29uXzIobSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dSA9IHp5LnNsaWNlKDEpLm1hcChfID0+IF8udGl0bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXFxcXFwi5pyA5ZCO6Z2iXFxcXFxcXCIpLCAyLCAn6K+36YCJ5oup56e75Yqo5L2N572uJykuc2VsZWN0KCh6eSwgenUsIF8pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gLTEpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5LnB1c2goXyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSArIDEsIDAsIF8pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKS5zYXZlSnNvbih6eSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgenksIHp1LCBfKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfpgInkuK3op4TliJknOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCB7fSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyW21dID0gXztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCBqeGxpc3QyKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflj5bmtojpgInkuK0nOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCB7fSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUganhsaXN0MlttXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwianhsaXN0MlxcXFxcXFwiLCBqeGxpc3QyKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflkK/nlKjlj5HnjrAnOlxcXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnpoHnlKjlj5HnjrAnOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEpzb25fMihtLCBcXFxcXFxcImV4cGxvcmVfZW5hYmxlZFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIG0sIF8pLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcXFxuICAgICAgICAgICAgaW1nOiBfLmljb25cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXy5ncm91cCArICfkuKgnICsgXy5zZWFyY2hfZ3JvdXAgKyAn5LioJyArIChfLng1X3VybCB8fCAoXy51cmwgPyBfLnVybCA6IF8uc2VhcmNoX3VybCkuc3BsaXQoXFxcXFxcXCIvXFxcXFxcXCIpLnNsaWNlKDAsIDMpLmpvaW4oXFxcXFxcXCIvXFxcXFxcXCIpKSxcXFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgobSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICQucm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WZlcmVyOiBfLng1X3JlZmVyZXIsXFxcXG4gICAgICAgICAgICBqczogXy54NV9qcyxcXFxcbiAgICAgICAgICAgIGpzTG9hZGluZ0luamVjdDogISFfLng1X2pzTG9hZGluZ0luamVjdCxcXFxcbiAgICAgICAgICAgIGF1dG9QbGF5OiAhIV8ueDVfYXV0b1BsYXksXFxcXG4gICAgICAgICAgICBmbG9hdFZpZGVvOiAhIV8ueDVfZmxvYXRWaWRlbyxcXFxcbiAgICAgICAgICAgIGltZ0xvbmdDbGljazogIV8ueDVfaW1nTG9uZ0NsaWNrLFxcXFxuICAgICAgICAgICAgc2hvd1Byb2dyZXNzOiAhXy54NV9zaG93UHJvZ3Jlc3MsXFxcXG4gICAgICAgICAgICBibG9ja1J1bGVzOiBldmFsKF8ueDVfYmxvY2tSdWxlcykgfHwgW10sXFxcXG4gICAgICAgICAgICB1cmxJbnRlcmNlcHRvcjogJC50b1N0cmluZygodXJsSW50ZXJjZXB0b3JfanMsIHg1VXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0LmluY2x1ZGVzKFxcXFxcXFwiYWxpeXVuZHJpdmUuY29tL1xcXFxcXFwiKSB8fCBpbnB1dC5pbmNsdWRlcyhcXFxcXFxcImFsaXl1bmRyaXZlLm5ldC9cXFxcXFxcIikgfHwgaW5wdXQuaW5jbHVkZXMoXFxcXFxcXCJhbGlwYW4uY29tL1xcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYmEub3BlbihKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZTogJ+S6keebmOWQmy7nroAnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvYWxpeXVuI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPeS6keebmOWQmy7nroAmcGFnZT1meXBhZ2UmcmVhbHVybD1cXFxcXFxcIiArIGVuY29kZVVSSUNvbXBvbmVudCh1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5jbHVkZXMoXFxcXFxcXCJxdWFyay5jblxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYmEub3BlbihKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5aS45YWL572R55uYXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU9dWNra+S6kSZyZWFsdXJsPVxcXFxcXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KHVybCksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBsZXQgeDVfdXJsSW50ZXJjZXB0b3IgPSBuZXcgRnVuY3Rpb24oXFxcXFxcXCJpbnB1dFxcXFxcXFwiLCBcXFxcXFxcIng1VXJsXFxcXFxcXCIsIHVybEludGVyY2VwdG9yX2pzKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4geDVfdXJsSW50ZXJjZXB0b3IoaW5wdXQsIHg1VXJsKTtcXFxcbiAgICAgICAgICAgIH0sIF8ueDVfdXJsSW50ZXJj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kSZzaGFyZVB3ZD1cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ICE9IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImlucHV0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXFxcXFwiOnNlYXJjaFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZToga2V5d29yZCxcXFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcXFxcXCJwdXRNeVZhcigna2V5d29yZCcsaW5wdXQpXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgdGl0bGU6IFJpY2goU3Ryb25nKENvbG9yKHJ1bGVUeXBlLCBcXFxcXFxcIiMzMzk5Y2NcXFxcXFxcIikpKSxcXFxcbiAgICAgICAgICAgIHVybDogJChbXFxcXFxcXCLnu7zlkIhcXFxcXFxcIl0uY29uY2F0KGdyb3VwcykubWFwKG5hbWUgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChuYW1lID09IHJ1bGVUeXBlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2VhcmNoX3R5cGUuaW5kZXhPZihuYW1lKSA9PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBuYW1lID0gUmljaChcXFxcXFxcIjxTPlxcXFxcXFwiICsgbmFtZSArIFxcXFxcXFwiPC9TPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5hbWU7XFxcXG4gICAgICAgICAgICB9KSwgMywgXFxcXFxcXCLpgInmi6nmkJzntKLnsbvliKtcXFxcXFxcIikuc2VsZWN0KCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuaW5kZXhPZihcXFxcXFxcIjxTPlxcXFxcXFwiKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+ayoeacieWvueW6lOinhOWImVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5kZXhPZihcXFxcXFxcIjxcXFxcXFxcIikgPT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgZ2V0TXlWYXIoJ2tleXdvcmQnKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdydWxlVHlwZScsIGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFxcXFxcInJ1bGVHcm91cFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFxcXFxcInNpZFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBzZWFyY2hfZ3JvdXAubWFwKChuYW1lLCBpKSA9PiB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBydWxlR3JvdXAgPT0gaSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5d29yZDInLCBnZXRNeVZhcigna2V5d29yZCcpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVHcm91cCcsIGkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwic2lkXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcXFxuICAgICAgICAgICAgICAgIH0sIGkpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBzZWFyY2hfcnVsZS5tYXAoKF8sIGkpID0+IHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHNpZCA9PSBpID8gUmljaChTdHJvbmcoQ29sb3IoXy50aXRsZSkpKSA6IF8udGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc2lkJywgaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICAgICAgfSwgaSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG5cXFxcblxcXFxuXFxcXG5cXFxcblxcXFxuICAgIGlmIChfU09VKSB7XFxcXG4gICAgICAgIGlmIChkYXRhLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yqg6L2956ysXFxcXFxcXCIgKyBwYWdlICsgXFxcXFxcXCLpobXkuK3vvIzov5vluqbvvJoxL1xcXFxcXFwiICsgZGF0YS5sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIGlmIChfUEFHRSkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmsqHmnInlj6/nlKjnmoTmkJzntKLop4TliJlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSBlbHNlIGlmIChfUEFHRSB8fCBydWxlLnVybC5tYXRjaChcXFxcXFxcImZ5cGFnZVxcXFxcXFwiKSkge1xcXFxuICAgICAgICBpZiAoX1BBR0UpIHtcXFxcbiAgICAgICAgICAgIGlmIChydWxlLnRpdGxlICE9IFxcXFxcXFwi6IGa5pCcXFxcXFxcXCIpIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj4nICsgQ29sb3IocnVsZS50aXRsZSwgJyNmZjY2MDEnKSArICc8L2I+JyxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHQgb2YgW1xcXFxcXFwiY2xhc3NcXFxcXFxcIiwgXFxcXFxcXCJhcmVhXFxcXFxcXCIsIFxcXFxcXFwieWVhclxcXFxcXFwiLCBcXFxcXFxcInNvcnRcXFxcXFxcIiwgXFxcXFxcXCJGeUFsbFxcXFxcXFwiXSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcih0ICsgXFxcXFxcXCJfaVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcXFxuICAgICAgICAgICAgICAgIH0sIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3J1bGVIb21lP3J1bGU9dWNra+S6kSZwYWdlPWZ5cGFnZSZydWxlTmFtZT1cXFxcXFxcIiArIHJ1bGUudGl0bGUgKyBcXFxcXFxcIiZydWxlR3JvdXA9XFxcXFxcXCIgKyBydWxlLmdyb3VwKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcXFxuICAgICAgICAgICAgICAgIGltZzogcnVsZS5pY29uLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgaG9tZTogMVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgZ2V0UnVsZUdyb3VwKCk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgYmFzZVVybCA9IGhvbWVfYmFzZVVybDtcXFxcbiAgICAgICAgZXZhbChydWxlLnByZVJ1bGUpO1xcXFxuICAgICAgICBldmFsKHJ1bGUuZmluZF9ydWxlKTtcXFxcbiAgICB9XFxcXG59XFxcXG5fUEFHRSA/IHNldFByZVJlc3VsdChkK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xcXFxcXFwiXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpdC5pbWcgfHwgaXQucGljX3VybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LmNvbF90eXBlIHx8IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub1BpYzogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpdC5leHRyYSB8fCB7fSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXNMaXN0O1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2coXy50aXRsZSArIFxcXFxcXFwiOlxcXFxcXFwiICsgZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBwYXJhbTogaXQsXFxcXG4gICAgICAgICAgICBpZDogXFxcXFxcXCJ1Y2trX3J1bGVAXFxc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ICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJfbm90aGF2ZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZCk7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0ocGFnZWlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcXFxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS5hbGwsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9LFxcXFxuICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXFxcbiAgICAgICAgICAgIGk6IDAsXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLinbnop4TliJnnvJbovpFcXFwiLFxcXCJwYXRoXFxcIjpcXFwicnVsZUVkaXRc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ICAgICB0aXRsZTogXFxcXFxcXCI8Lz5cXFxcXFxcIixcXFxcbiAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgbGV0IGdyb3VwID0gJC5yZXF1aXJlKFxcXFxcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFxcXFxcIikuZ2V0R3JvdXBOYW1lcygwLCBcXFxcXFxcInNlYXJjaF9ncm91cFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIGlmICghZ3JvdXAubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gJChncm91cCwgMywgXFxcXFxcXCLpgInmi6nop4TliJnliIbnu4RcXFxcXFxcIikuc2VsZWN0KChpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKGV4dHJhLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9LCBpZCk7XFxcXG4gICAgICAgIH0sIGlkKSxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxcXG4gICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHtcXFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoaWQsIHZhbHVlKSxcXFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcXFxcXCIke2lkfVxcXFxcXFwiLCBpbnB1dClgLFxcXFxuICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogdHJ1ZSxcXFxcbiAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXFxcbiAgICAgICAgICAgIGhlaWdodDogaGVpZ2h0IHx8IDUsXFxcXG4gICAgICAgICAgICBpZDogaWQsXFxcXG4gICAgICAgIH0sIGpzb24gfHwge30pXFxcXG4gICAgfSk7XFxcXG59XFxcXG5zd2l0Y2ggKHJ1bGVfdGlkKSB7XFxcXG4gICAgY2FzZSAn5Z+65pysJzpcXFxcbiAgICAgICAgW1xcXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDlkI3np7AnLCAndGl0bGUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOWbvuaghycsICdpY29uJywgJyddLFxcXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDkvZzogIUnLCAnYXV0aG9yJywgJ+S9muWQjSddLFxcXFxuICAgICAgICAgICAgWyfpgInloavvvIxKc0xpYicsICdwcmVSdWxlJywgJycsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWlnaHQ6IDNcXFxcbiAgICAgICAgICAgIH1dLFxcXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcXFxuICAgICAgICAgICAgaW5wdXRfcHVzaChhLCBiLCBjLCBlLCAxKTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgJ+aQnOe0oic6XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5pCc57Si6ZO+5o6lJywgJ3NlYXJjaF91cmwnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+W/heWhq++8jOaQnOe0ouWIhue7hCcsICdzZWFyY2hfZ3JvdXAnLCAn5YWo5YWoJywge1xcXFxuICAgICAgICAgICAgICAgIGhpZ2hsa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FxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5rqQ6ZO+5o6lJywgJ3VybCcsICcnLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxXFxcXG4gICAgICAgICAgICB9XSxcXFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5YiX6KGo6KeE5YiZXFxcXFxcXFxu5ZCv55SoeDXlsLHkuI3nlKjlhpnkuoZcXFxcXFxcXG5cXFxcXFxcXG7nu6fmib/mlbDnu4Rk77yaIGQucHVzaChqc29uKTsnLCAnZmluZF9ydWxlJywgJyddLFxcXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcXFxuICAgICAgICAgICAgaW5wdXRfcHVzaChhLCBiLCBjLCBlKTtcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGJyZWFrO1xcXFxuICAgIGNhc2UgJ+abv+aNoic6XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCflj5HnjrDpk77mjqXmm7/mjaInKSxcXFxcbiAgICAgICAgICAgIGRlc2M6ICfpgInloasnLFxcXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9ob21lX2ljb25fZWRpdCdcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIFtcXFxcbiAgICAgICAgICAgIFsn5YiG57G75ZCN56ewJywgJ2NsYXNzX25hbWUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WIhuexu+abv+aNoicsICdjbGFzc191cmwnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WcsOWMuuWQjeensCcsICdhcmVhX25hbWUnLCAnJ10sXFxcXG4gICAgICAgICAgICBbJ+WcsOWMuu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cbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6Z+z6KeG6aKR6Ieq5Yqo5pKt5pS+PC9iPicsXFxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigneDVfYXV0b1BsYXknLCB4KTtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXFxcbiAgICAgICAgICAgIH0sIHg1X2F1dG9QbGF5ID8gJzAnIDogJzEnKSxcXFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh4NV9hdXRvUGxheSA/IDU1IDogNjMpICsgJy5zdmcnLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcoJ3g15omp5bGVJyksXFxcXG4gICAgICAgICAgICBkZXNjOiAn6YCJ5aGrJyxcXFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7pppbpobXkuI3mmL7npLrmkJzntKLmoYY8L2I+JyxcXFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoeCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd4NV9kZXNjJywgeCk7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxcXG4gICAgICAgICAgICB9LCB4NV9kZXNjID8gJzAnIDogJzEnKSxcXFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh4NV9kZXNjID8gNTUgOiA2MykgKyAnLnN2ZycsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGlucHV0X3B1c2goXFxcXFxcXCJ1cmzvvIzlj5HnjrDpk77mjqXlkox4NemTvuaOpeWGsueqgeaXtuWhq+WGmVxcXFxcXFwiLCBcXFxcXFxcIng1X3VybFxcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiLCB7fSwgMSk7XFxcXG4gICAgICAgIGlucHV0X3B1c2goXFxcXFxcXCJob21lX2pz77yM5LiN5pi+56S65pCc57Si5qGG5pe25omn6KGM44CCXFxcXFxcXFxu57un5om/5pWw57uEZO+8jOWGheWuueWPquacieinhOWImeWIhuexu+OAglxcXFxcXFxcbuWcqOatpOWfuuehgOS4iuiHquWumuS5iemmlumhteWQp+OAglxcXFxcXFwiLCBcXFxcXFxcIng1X2hvbWVcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgIGJyZWFrO1xcXFxufVxcXFxuZC5wdXNoKHtcXFxcbiAgICBjb2xfdHlwZTogJ2xpbm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k7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICB9LCBpZCwga2V5KSxcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGlkOiBpZCArIFxcXFxcXFwiOmtleTpcXFxcXFxcIiArIGtleSxcXFxcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIjprZXlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliKDpmaTlhbPplK7or406XFxcXFxcXCIgKyBrZXksXFxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGlkLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXFxcXFwic2VhcmNoSGlzdG9yeVxcXFxcXFwiLCBbXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpaSA9IGhpc3RvcnkuaW5kZXhPZihrZXkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcXFxcXCJzZWFyY2hIaXN0b3J5XFxcXFxcXCIsIGhpc3RvcnkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcXFxcXCI6a2V5OlxcXFxcXFwiICsga2V5KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBhZGRJdGVtQWZ0ZXIoaWQgKyBcXFxcXFxcIjpzZWFyY2hIaXN0b3J5XFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ1cXFxcXFxcIiArIFxcXFxcXFwifn5+5LuA5LmI6YO95rKh5pyJ5ZOmfn5+XFxcXFxcXCIuZm9udGNvbG9yKFxcXFxcXFwiR3JheVxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXFxcXFwiOmtleVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcXFxuICAgICAgICAgICAgfV1cXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxufSk7YCxcXFxcblxcXFxuICAgICAgICBjbGFzc19uYW1lOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICBjbGFzc191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIGFyZWFfbmFtZTogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgYXJlYV91cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIHllYXJfbmFtZTogXFxcXFxcXCJcXFxcXFxc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