xiaomianao666

小程序:歌词适配

Aug 6th, 2024
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@歌词适配@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5q2M6K+N6YCC6YWNIiwiYXV0aG9yIjoiVGhvbWFz5ZayIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wPWZ5cGFnZSIsInZlcnNpb24iOjIwMjQwNzI2LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG4kLnJlcXVpcmUoJ2hvbWU/cnVsZT3mrYzor43pgILphY0nKTsiLCJzZWFyY2hfdXJsIjoiaGlrZXI6Ly9lbXB0eT9zPSoqIiwiZ3JvdXAiOiLikaDmjqjojZAiLCJzZWFyY2hGaW5kIjoianM6XG5zZXRSZXN1bHQoW3tcbiAgICB0aXRsZTogXCLmkJzntKIgPT4gXCIgKyBNWV9LRVlXT1JELFxuICAgIGRlc2M6ICfpgJrov4dcIumrmOe6p+aQnOe0olwi6aG16Z2i5pCc57SiJyxcbiAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHNfdDIpID0+IHtcbiAgICAgICAgaWYgKGdldE15VmFyKCdzX3BsYXRmb3JtJywgJ2xpYicpID09ICdsaWInKVxuICAgICAgICAgICAgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3JykpO1xuICAgICAgICBwdXRNeVZhcignc190MicsIHNfdDIpO1xuICAgICAgICBjbGVhck15VmFyKCdz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V0dXJuIFxcXCLigJjigJjigJnigJlcXFwiICsgU3RyaW5nKHRlc3QpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxufCg8fFxcXFxzKyliclxcXFxzKlxcXFwvP1xcXFxzKj4vZ2ksICdcXFxcbicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxyL2csICdcXFxccicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFxmL2csICdcXFxcZicpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXFxcXFx0L2csICdcXFxcdCcpXFxuICAgICAgICAucmVwbGFjZSgvJihsdHxndHxuYnNwfGFtcHxxdW90KTsvZ2ksICgkMCwgJDEpID0+ICh7XFxuICAgICAgICAgICAgJ2x0JzogJzwnLFxcbiAgICAgICAgICAgICdndCc6ICc+JyxcXG4gICAgICAgICAgICAnbmJzcCc6ICcgJyxcXG4gICAgICAgICAgICAnYW1wJzogJyYnLFxcbiAgICAgICAgICAgICdxdW90JzogJ1xcXCInXFxuICAgICAgICB9WyQxLnRvTG93ZXJDYXNlKCldKSlcXG4gICAgICAgIC5yZXBsYWNlKC88XFxcXC8/ZW1bXj5dKj4vZ2ksICcnKTtcXG59XFxuY29uc3QgUiA9ICh4LCB6KSA9PiB7XFxuICAgIGxldCB0ID0gXFxcIlxcXCI7XFxuICAgIGxldCB6ID0geiB8fCBcXFwiMTIzNDU2Nzg5MGFiY2RlZlxcXCI7XFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgeDsgaSsrKSB7XFxuICAgICAgICB0ICs9IHpbTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogei5sZW5ndGgpXTtcXG4gICAgfVxcbiAgICByZXR1cm4gdFxcbn1cXG5jb25zdCBTaXplID0gc2l6ZSA9PiB7XFxuICAgIGlmICghc2l6ZSkgcmV0dXJuICfml6Dms5XorqHnrpcnO1xcbiAgICBsZXQgdW5pdHMgPSBbJ0InLCAnS0InLCAnTUInLCAnR0InXTtcXG4gICAgb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HIyLCByMykgPT4ge1xcbiAgICBpZiAocjEpIHtcXG4gICAgICAgIF8udGl0bGUgPSBSaWNoKF8udGl0bGUpLnJlcGxhY2UoXFxcIuKAmOKAmOKAmeKAmVxcXCIsICcnKTtcXG4gICAgICAgIF8uaW1nID0gU3RyaW5nKF8uaW1nKS5yZXBsYWNlKC97c2l6ZX0vZ2ksICc0ODAnKTtcXG4gICAgICAgIF8uY29udGVudCA9IF8uY29udGVudCArICcnO1xcbiAgICAgICAgXy56eWlkID0gXy56eWlkICsgJyc7XFxuICAgICAgICBpZiAoIV8uZGVzYykgXy5kZXNjID0gdGhpc19wbGF0Zm9ybTtcXG4gICAgfVxcbiAgICBsZXQgcjQsIHQxID0gTnVtYmVyKF8uY29udGVudC5yZXBsYWNlKC9eKFxcXFxkP1xcXFxEXFxcXGQ/KSskLywgJzAnKSkgPCAyID8gMCA6IDE7XFxuICAgIF8uZXh0cmEgPSB7XFxuICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgY2xzOiBpZCArICc6YWRkbGlzdCcsXFxuICAgICAgICBpZDogW18uZGVzYywgXy56eWlkID09IFxcXCJ1bmRlZmluZWRcXFwiID8gTWF0aC5yYW5kb20oKSA6IF8uenlpZCwgXy5jb250ZW50XS5qb2luKFxcXCIkXFxcIiksXFxuICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5pS26JePXFxcIiArICh0MSA/ICfmrYzljZUnIDogJ+WNleabsicpICsgXFxcIiDimIVcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0MSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5sb2dEYXRhKF8sIHQxKTtcXG4gICAgICAgICAgICB9LCB0MSwgXylcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDmibnph4/mlLbol48g4piFXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygoY2xzSWQsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogMCxcXG4gICAgICAgICAgICAgICAgICAgIHBpdGNoOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkYXRhOiBmaW5kSXRlbXNCeUNscyhjbHNJZClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvX2NhdGNoL0ltcG9ydC50eHRcXFwiLCBKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3JlbHkyI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgfSwgaWQgKyAnOmFkZGxpc3QnLCB0MSlcXG4gICAgICAgIH1dXFxuICAgIH07XFxuICAgIGlmIChfLmRlc2MubWF0Y2goL3FxfHd5fGtnfGt3fG1nfDVzLykgJiYgXy5jb250ZW50ICE9IDMpIHtcXG4gICAgICAgIF8uZXh0cmEubG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4pypIOWkjeWItumTvuaOpSDinKlcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChhLCBiLCBjKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmNvcHl1cmwoYSwgYiwgYyk7XFxuICAgICAgICAgICAgfSwgXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZClcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuXFxuICAgIGlmIChyMykge1xcbiAgICAgICAgcjQgPSAkKHIzLm5hbWVzLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChuYW1lcywgdXJscykgPT4ge1xcbiAgICAgICAgICAgIGxldCBpID0gbmFtZXMuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmxzW2ldO1xcbiAgICAgICAgfSwgcjMubmFtZXMsIHIzLnVybHMpO1xcbiAgICAgICAgaWYgKHIxID09IDIpIHtcXG4gICAgICAgICAgICBfLnVybCA9IHI0O1xcbiAgICAgICAgICAgIF8uZXh0cmEudXJsID0gcjM7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIF8udXJsID0gcjM7XFxuICAgICAgICAgICAgXy5leHRyYS51cmwgPSByNDtcXG4gICAgICAgIH1cXG4gICAgICAgIF8uZXh0cmEubG9uZ0NsaWNrLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOS4i+i9veatjOabsiDimIVcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChuYW1lcywgdXJscykgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lcywgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgobmFtZXMsIHVybHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGkgPSBuYW1lcy5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgfSwgbmFtZXMsIHVybHMpO1xcbiAgICAgICAgICAgIH0sIHIzLm5hbWVzLCByMy51cmxzKVxcbiAgICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBfLnVybCA9IExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCwgcjEgPT0gMik7XFxuICAgICAgICBpZiAoIXQxKSB7XFxuICAgICAgICAgICAgXy5leHRyYS51cmwgPSBMYXp5KF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQsIHIxICE9IDIpO1xcbiAgICAgICAgICAgIF8uZXh0cmEubG9uZ0NsaWNrLnVuc2hpZnQoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCAxKSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBfLmNvbF90eXBlID0gJ2NhcmRfcGljXzMnO1xcbiAgICBpZiAocjIpIHJldHVybiBfO1xcbiAgICBkLnB1c2goXyk7XFxufVxcblxcblxcblxcbiQuZXhwb3J0cyA9IHtcXG5cXG5cXG5cXG4gICAgbG9nRGF0YTogZnVuY3Rpb24obmV3RGF0YSwgc2ksIG5hbWUpIHtcXG4gICAgICAgIGlmIChuZXdEYXRhLnp5aWQgPT09IFxcXCJ1bmRlZmluZWRcXFwiKVxcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kuI3mlK/mjIHmlLbol49+XFxcIjtcXG5cXG4gICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgIGlmICh6eSA9PT0gXFxcIlxcXCIpIHp5ID0ge1xcbiAgICAgICAgICAgIFxcXCLlhajpg6hcXFwiOiBbXVxcbiAgICAgICAgfSwgc3RvcmFnZTAuc2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2ksIHp5KTtcXG4gICAgICAgIGxldCB6dSA9IE9iamVjdC5rZXlzKHp5KTtcXG5cXG5cXG4gICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5paw57uEXFxcIiksIDMsIFxcXCLpgInmi6nnu4RcXFwiKS5zZWxlY3QoKHp5LCB6dSwgbmV3RGF0YSwgc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuaWsOe7hFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCF6dS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKG5hbWUsIFxcXCLor7fovpPlhaXmlrDnu4TlkI3np7BcXFwiKS5pbnB1dCgoenksIHp1LCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkubWF0Y2goL15cXFxcZCt8XlxcXFxzKijmlrDnu4QpP1xcXFxzKiQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+e7hOWQjeS4jeiDveS4uuepuiAmIOacgOWJjemdouS4jeiDveaYr+aVsOWtlyAmIOS5n+S4jeiDveWPq+aWsOe7hFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMywgJ+ivt+mAieaLqeaWsOe7hOS9jee9ricpLnNlbGVjdCgoenksIGlucHV0MiwgbmV3RGF0YXMsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdEYXRhID0gQXJyYXkuaXNBcnJheShuZXdEYXRhcykgPyBuZXdEYXRhcyA6IFtuZXdEYXRhc107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5pyA5ZCO6Z2iXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaW5wdXQyXSA9IG5ld0RhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB6eSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baW5wdXQyXSA9IG5ld0RhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShuZXdEYXRhcykpIGJhY2sodHJ1ZSksIHRvYXN0KCfmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHp5LCBpbnB1dCwgbmV3RGF0YSwgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgenksIHp1LCBuZXdEYXRhLCBzaSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5YiG57uE5ZCN56ew6YeN5aSN5LqGflxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgenkgPSB6eVtpbnB1dF07XFxuICAgICAgICAgICAgaWYgKEFycmF5LmlzQXJyYXkobmV3RGF0YSkpIHtcXG4gICAgICAgICAgICAgICAgenkgPSB6eS5jb25jYXQobmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KCfmiJDlip8nKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGlucHV0KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgenUgPSB6eS5tYXAoaXQgPT4gaXQudGl0bGUpO1xcbiAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6notYTmupDkvY3nva4nKS5zZWxlY3QoKHp5LCB6dSwgaW5wdXQyLCBuZXdEYXRhLCBzaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuacgOWQjumdolxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHp5LnB1c2gobmV3RGF0YSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IHp1LmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGksIDAsIG5ld0RhdGEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBpbnB1dDIpO1xcbiAgICAgICAgICAgIH0sIHp5LCB6dSwgaW5wdXQsIG5ld0RhdGEsIHNpKTtcXG4gICAgICAgIH0sIHp5LCB6dSwgbmV3RGF0YSwgc2kpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZXREYXRhOiBmdW5jdGlvbihzaSwgenkyLCBrZXkpIHtcXG4gICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgIGlmIChrZXkpIHtcXG4gICAgICAgICAgICB6eVtrZXldID0genkyO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB6eSA9IHp5MjtcXG4gICAgICAgIH1cXG4gICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpLCB6eSk7XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5oiQ5YqfXFxcIjtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgY29weXVybDogZnVuY3Rpb24oQSwgQiwgQykge1xcbiAgICAgICAgc3dpdGNoIChBKSB7XFxuICAgICAgICAgICAgY2FzZSAncXEnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL2kueS5xcS5jb20vbjIvbS9zaGFyZS9kZXRhaWxzL3Rhb2dlLmh0bWw/aWQ9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL2kueS5xcS5jb20vdjgvcGxheXNvbmcuaHRtbD9zb25nbWlkPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ3d5JzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly95Lm11c2ljLjE2My5jb20vbS9wbGF5bGlzdD9pZD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8veS5tdXNpYy4xNjMuY29tL20vc29uZz9pZD0nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdrZyc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoQikge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEMubWF0Y2goL18vKSkgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeaUr+aMgWdjaWTpk77mjqXliIbkuqtcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ua3Vnb3UuY29tL3dlaWJvLz9zaGFyZV90eXBlPXNwZWNpYWwmaWQ9JyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ua3Vnb3UuY29tL3dlaWJvLz9oYXNoPScgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ2t3JzpcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChCKSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLmt1d28uY24vbmV3aDVhcHAvcGxheWxpc3RfZGV0YWlsLycgKyBDO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaHR0cHM6Ly9tLmt1d28uY24vbmV3aDVhcHAvcGxheV9kZXRhaWwvJyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnbWcnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwczovL20ubXVzaWMubWlndS5jbi92My9tdXNpYy9wbGF5bGlzdC8nICsgQztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJ2h0dHBzOi8vbS5tdXNpYy5taWd1LmNuL3YzL211c2ljL3NvbmcvJyArIEM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnNXMnOlxcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKEIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICdodHRwOi8vNXNpbmcua3Vnb3UuY29tL3RvcGljL3NoYXJlL3NvbmdsaXN0LyMvP2lkPSc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b25fMTMweDEzMC5wbmcnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAnNXMnOlxcbiAgICAgICAgICAgIHJldHVybiAnaHR0cHM6Ly9hbmRyb2lkLWFydHdvcmtzLjI1cHAuY29tL2ZzMDgvMjAyMy8xMi8yOC8wLzExMF9jNWM0YWY0N2Y2MGY5MTZmODhjMzAxMTAwMThlM2E2NF9jb25fMTMweDEzMC5wbmcnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAn6K6+572uJzpcXG4gICAgICAgICAgICByZXR1cm4gJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvMzAuc3ZnJztcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ+aUtuiXjyc6XFxuICAgICAgICAgICAgcmV0dXJuICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvMTI5LnBuZyc7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICfkvZzogIUnOlxcbiAgICAgICAgICAgIHJldHVybiAnaHR0cDovL3EucWxvZ28uY24vZz9iPXFxJm5rPTE1ODU1Njg4NjUmcz0xNDAnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAndG9wJzpcXG4gICAgICAgICAgICByZXR1cm4gJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvaW1nL1RvcEltZzAucG5nJztcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ2FkZCc6XFxuICAgICAgICAgICAgcmV0dXJuICdodHRwczovL2Nkbi5pY29uLWljb25zLmNvbS9pY29uczIvMzcvUE5HLzUxMi9hZGRwcm9wZXJ0eV9hJUMzJUIxYWRpcl8zNjI1LnBuZyc7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgIHJldHVybiAnaGl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OkuihjFxcXCJdW18uZ3JvdXBOYW1lXS5wdXNoKEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogX18udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfXy5oZWFkUGljVXJsIHx8IF9fLmZyb250UGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogX18udG9wSWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEsIDEpKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJxcV9pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIGxldCBsaXN0LCBfLCB1O1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhSAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiO1xcbiAgICAgICAgICAgICAgICBfID0gYWpheCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29tbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdDogJzE5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Y6ICcxODU5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZTogJ211c2ljLnBmX3NvbmdfZGV0YWlsX3N2cicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ2dldF9zb25nX2RldGFpbF95cXEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29uZ19taWQ6IHQxXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgIH0pLnJlcS5kYXRhLnRyYWNrX2luZm87XFxuICAgICAgICAgICAgICAgIGxldCBmID0gXy5maWxlO1xcblxcbiAgICAgICAgICAgICAgICAvLyDkuIvovb1cXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gW107XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5zaXplXzEyOG1wMylcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSArIFNpemUoZi5zaXplXzEyOG1wMykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV8zMjBtcDMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKGYuc2l6ZV8zMjBtcDMpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLnNpemVfZmxhYylcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoZi5zaXplX2ZsYWMpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLnNpemVfaGlyZXMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNF0gKyBTaXplKGYuc2l6ZV9oaXJlcykpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBhcnIuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwicXFcXFwiLCB0MSwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgdDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsLCBpaSwgbHJjO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlpID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmW1xcXCJzaXplX2hpcmVzXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInFxXFxcIiwgdDEsIDMsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZbXFxcInNpemVfZmxhY1xcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJxcVxcXCIsIHQxLCAyLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmW1xcXCIzMjBtcDNcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwicXFcXFwiLCB0MSwgMSwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnBheS5wYXlfcGxheSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInFxXFxcIiwgdDEsIDAsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgKz0gYD9kYXRhPXtcXFwicmVxXzBcXFwiOntcXFwibW9kdWxlXFxcIjpcXFwidmtleS5HZXRWa2V5U2VydmVyXFxcIixcXFwibWV0aG9kXFxcIjpcXFwiQ2dpR2V0VmtleVxcXCIsXFxcInBhcmFtXFxcIjp7XFxcImd1aWRcXFwiOlxcXCIwXFxcIixcXFwicGxhdGZvcm1cXFwiOlxcXCIyMFxcXCIsXFxcImZpbGVuYW1lXFxcIjpbXFxcIk01MDAke3QxK3QxfS5tcDNcXFwiXSxcXFwic29uZ21pZFxcXCI6W1xcXCIke3QxfVxcXCJdfX19YDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgX18gPSBhamF4KHUpLnJlcV8wLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IF9fLm1pZHVybGluZm9bMF0ucHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCAmJiB1cmwgIT0gXFxcIlxcXCIpIHVybCA9IF9fLnNpcFswXSArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGxUeXBlIG9mIFtcXFwibmV3XFxcIiwgXFxcInlxcVxcXCJdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gYWpheChcXFwiaHR0cDovL2MueS5xcS5jb20vbHlyaWMvZmNnaS1iaW4vZmNnX3F1ZXJ5X2x5cmljX1xcXCIgKyBsVHlwZSArIFxcXCIuZmNnP2Zvcm1hdD1qc29uJm5vYmFzZTY0PTEmc29uZ21pZD1cXFwiICsgdDEpLmx5cmljO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWxyYy5tYXRjaCgvXFxcXFtcXFxcZCtcXFxcOlxcXFxkKy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBMcmMobHJjLCBfLmludGVydmFsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxyYykgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vYy55LnFxLmNvbS9zcGxjbG91ZC9mY2dpLWJpbi9mY2dfZ2V0X2Rpc3NfYnlfdGFnLmZjZz9mb3JtYXQ9anNvbiZjYXRlZ29yeUlkPVxcXCIgKyB0MSArIFxcXCImc2luPVxcXCIgKyAoKE1ZX1BBR0UgLSAxKSAqIDMwKSArIFxcXCImZWluPVxcXCIgKyAoKE1ZX1BBR0UgKiAzMCkgLSAxKTtcXG4gICAgICAgICAgICAgICAgXyA9IGFqYXgodSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdDtcXG4gICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5kaXNzbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWd1cmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXy5zdW0gfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly9jLnkucXEuY29tL3F6b25lL2ZjZy1iaW4vZmNnX3VjY19nZXRjZGluZm9fYnlpZHNfY3AuZmNnP2Zvcm1hdD1qc29uJnR5cGU9MSZ1dGY4PTEmZGlzc3RpZD1cXFwiICsgdDE7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHUpLmNkbGlzdFswXS5zb25nbGlzdDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vdS55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2c/Z190az01MzgxJmRhdGE9XFxcIiArIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkZXRhaWxcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1vZHVsZVxcXCI6IFxcXCJtdXNpY1RvcGxpc3QuVG9wbGlzdEluZm9TZXJ2ZXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJtZXRob2RcXFwiOiBcXFwiR2V0RGV0YWlsXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0b3BJZFxcXCI6ICt0MSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm9mZnNldFxcXCI6IChNWV9QQUdFIC0gMSkgKiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm51bVxcXCI6IDMwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGVyaW9kXFxcIjogXFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb21tXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiY3RcXFwiOiAyNCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImN2XFxcIjogMFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHUpLmRldGFpbC5kYXRhLnNvbmdJbmZvTGlzdDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfO1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IChfLm5hbWUgfHwgXy5zb25nbmFtZSkgKyAnIC0gJyArIF8uc2luZ2VyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgIGltZzogKGFsYnVtaWQgPSBfLmFsYnVtbWlkIHx8IChfLmFsYnVtID8gXy5hbGJ1bS5taWQgOiBcXFwiXFxcIikpICE9IFxcXCJcXFwiID8gYGh0dHBzOi8veS5ndGltZy5jbi9tdXNpYy9waG90b19uZXcvVDAwMlIzMDB4MzAwTTAwMCR7YWxidW1pZH0uanBnYCA6IFxcXCJoaWtlcjovL2ltYWdlcy9ydWxlX3R5cGVfYXVkaW9cXFwiLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IF8ucGF5LnBheXBsYXksXFxuICAgICAgICAgICAgenlpZDogXy5taWQgfHwgXy5zb25nbWlkXFxuICAgICAgICB9LCAxKSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSwgcnVuKSB7XFxuICAgICAgICBsZXQgXztcXG4gICAgICAgIGlmIChpc1UgIT0gXFxcInVybFxcXCIpIHtcXG4gICAgICAgICAgICBsZXQgbGlzdCwgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiBfLnBheS5wYXlfcGxheSA9PSAnMScsXFxuICAgICAgICAgICAgICAgIGZyZWU6IChfKSA9PiBfLnBheS5wYXlfcGxheSA9PSAnMCdcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHN1cmwgPSAoc3R5cGUpID0+IGFqYXgoXFxcImh0dHA6Ly91Ni55LnFxLmNvbS9jZ2ktYmluL211c2ljdS5mY2dcXFwiLCB7XFxuICAgICAgICAgICAgICAgIFxcXCJib2R5XFxcIjogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInJlcVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibW9kdWxlXFxcIjogXFxcIm11c2ljLnNlYXJjaC5TZWFyY2hDZ2lTZXJ2aWNlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIkRvU2VhcmNoRm9yUVFNdXNpY0xpdGVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInF1ZXJ5XFxcIjoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF90eXBlXFxcIjogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJudW1fcGVyX3BhZ2VcXFwiOiAzMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhZ2VfbnVtXFxcIjogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIFxcXCJtZXRob2RcXFwiOiBcXFwiUE9TVFxcXCJcXG4gICAgICAgICAgICB9KS5yZXEuZGF0YTtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoMCk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5ib2R5Lml0ZW1fc29uZztcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLnNpbmdlci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAoYWxidW1pZCA9IF8uYWxidW1taWQgfHwgKF8uYWxidW0gPyBfLmFsYnVtLm1pZCA6IFxcXCJcXFwiKSkgIT0gXFxcIlxcXCIgPyBgaHR0cHM6Ly95Lmd0aW1nLmNuL211c2ljL3Bob3RvX25ldy9UMDAyUjMwMHgzMDBNMDAwJHthbGJ1bWlkfS5qcGdgIDogXFxcImhpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpb1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8ucGF5LnBheV9wbGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLm1pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKDMpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYm9keS5pdGVtX3NvbmdsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uZGlzc25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmxvZ28sXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmRpc3NpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLm1ldGEuc3VtIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Q6ICcxOScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdjogJzE4NTknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kdWxlOiAnbXVzaWMucGZfc29uZ19kZXRhaWxfc3ZyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ2dldF9zb25nX2RldGFpbF95cXEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb25nX21pZDoga2V5d29yZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgICAgIH0pLnJlcS5kYXRhLnRyYWNrX2luZm87XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5zaW5nZXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAoYWxidW1pZCA9IF8uYWxidW1taWQgfHwgKF8uYWxidW0gPyBfLmFsYnVtLm1pZCA6IFxcXCJcXFwiKSkgIT0gXFxcIlxcXCIgPyBgaHR0cHM6Ly95Lmd0aW1nLmNuL211c2ljL3Bob3RvX25ldy9UMDAyUjMwMHgzMDBNMDAwJHthbGJ1bWlkfS5qcGdgIDogXFxcImhpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpb1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy5wYXkucGF5cGxheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLm1pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoXFxcImh0dHA6Ly9jLnkucXEuY29tL3F6b25lL2ZjZy1iaW4vZmNnX3VjY19nZXRjZGluZm9fYnlpZHNfY3AuZmNnP2Zvcm1hdD1qc29uJnR5cGU9MSZ1dGY4PTEmZGlzc3RpZD1cXFwiICsga2V5d29yZCkuY2RsaXN0WzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKF8uZGlzc25hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5sb2dvLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzdGlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gMDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgcmVmcmVzaF9sb2dpbjogZnVuY3Rpb24oY29va2llLCBydW4pIHtcXG4gICAgICAgIGxldCBib2R5LCBjLCBDID0gU3RyaW5nKGNvb2tpZSkudHJpbSgpO1xcbiAgICAgICAgYyA9IEMuc3BsaXQoL3FtX2tleXN0PS9pKTtcXG4gICAgICAgIGxldCBrZXkgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdChcXFwiO1xcXCIpWzBdO1xcbiAgICAgICAgYyA9IEMuc3BsaXQoL3Vpbj0vaSk7XFxuICAgICAgICBsZXQgdWluID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgIGlmIChrZXkuc3RhcnRzV2l0aCgnV19YJykpIHtcXG4gICAgICAgICAgICBib2R5ID0ge1xcbiAgICAgICAgICAgICAgICBcXFwiY29tbVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJmUGVyc29uYWxpdHlcXFwiOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidG1lTG9naW5UeXBlXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInRtZUxvZ2luTWV0aG9kXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aHN0XFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiY3RcXFwiOiBcXFwiMTFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImN2XFxcIjogXFxcIjEyMDgwMDA4XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ2XFxcIjogXFxcIjEyMDgwMDA4XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0bWVBcHBJRFxcXCI6IFxcXCJxcW11c2ljXFxcIlxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBcXFwicmVxMVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJtb2R1bGVcXFwiOiBcXFwibXVzaWMubG9naW4uTG9naW5TZXJ2ZXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJMb2dpblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNvZGVcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwib3BlbmlkXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfdG9rZW5cXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic3RyX211c2ljaWRcXFwiOiB1aW4sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm11c2lja2V5XFxcIjoga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1bmlvbmlkXFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZnJlc2hfa2V5XFxcIjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImxvZ2luTW9kZVxcXCI6IDJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgYm9keSA9IHtcXG4gICAgICAgICAgICAgICAgJ3JlcTEnOiB7XFxuICAgICAgICAgICAgICAgICAgICAnbW9kdWxlJzogJ1FRQ29ubmVjdExvZ2luLkxvZ2luU2VydmVyJyxcXG4gICAgICAgICAgICAgICAgICAgICdtZXRob2QnOiAnUVFMb2dpbicsXFxuICAgICAgICAgICAgICAgICAgICAncGFyYW0nOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2V4cGlyZWRfaW4nOiA3Nzc2MDAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtdXNpY2lkJzogdWluLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdtdXNpY2tleSc6IGtleVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgYm9keSA9IEpTT04uc3RyaW5naWZ5KGJvZHkpO1xcbiAgICAgICAgbGV0IHVybCA9IFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3MuZmNnP3NpZ249enphXFxcIiArIFIoMTYpICsgbWQ1KCdDSkJQQUNyUnVOeTcnICsgYm9keSk7XFxuICAgICAgICBsZXQgXyA9IEpTT04ucGFyc2UocG9zdCh1c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29sb3IocGxhdGZvcm0pKSk7XFxuICAgIHJldHVybiBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHBsYXRmb3JtLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgIGlmICghcGxhdGZvcm0ubWF0Y2goL17igJjigJjigJnigJkvKSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignY19wbGF0Zm9ybScsIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY190MicpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBwbGF0Zm9ybSksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgIH0pO1xcbn0pO1xcbmQucHVzaCh7XFxuICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxufSk7XFxubGV0IGN0YWI7XFxuaWYgKHNpID09ICcwJykge1xcbiAgICBzd2l0Y2ggKGNfcGxhdGZvcm0pIHtcXG4gICAgICAgIGNhc2UgJzVzJzpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsaWJcXFwiLCBcXFwieWNcXFwiLCBcXFwiZmNcXFwiLCBcXFwiYnpcXFwiXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ215JzpcXG4gICAgICAgICAgICBjdGFiID0gW1xcXCJsaWJcXFwiLCBcXFwid3lcXFwiLCBcXFwia3dcXFwiLCBcXFwibWdcXFwiXTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ3F0JzpcXG4gICAgICAgICAgICBjdGFiID0gcXRzO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgZGVmYXVs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pYy5jbi9tbWJpel9wbmcvNXM3SjI4VTlHSFZpY0Q3Z3V2eWJhc2U4NkhoSEMxMm9PRGJ0cnNnSzdDeHJqNVFwTDZnS255aWJlWkR3RUtJVktVT3RQb0hjeHBmd2EwcG9uWjFpYTVubEEvMD93eF9mbXQ9cG5nJyxcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLimIXmiZPlvIDkuoznuqfimIVcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IycpLnJ1bGUoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbbmFtZV0ubWFwKF8gPT4gRXh0cmEoXykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJUR1jmlLbol48gLSDojrflj5bplJnor69cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogKHNpID09ICcwJyA/ICfmrYzmm7InIDogJ+atjOWNlScpICsgXFxcIuWIhue7hCDjgIxcXFwiICsgbmFtZSArIFxcXCLjgI0g5LiN5a2Y5Zyo77yfXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLlcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuS/ruaUueWQjeensFxcXCIsIFxcXCLmm7TmlLnmjpLluo9cXFwiLCBcXFwi5YiG57uE5ZCI5bm2XFxcIiwgXSwgMSwgJ+mAieaLqeimgeWPmOabtOeahOS6i+S7ticpLnNlbGVjdCgoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfkv67mlLnlkI3np7AnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXmlrDnmoTnu4TlkI1cXFwiKS5pbnB1dCgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQubWF0Y2goL15cXFxccyoo5paw57uEfOacgOWQjumdoik/XFxcXHMqJC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v57uE5ZCN5LiN6IO95Li656m677yM5Lmf5LiN6IO96K6+572u5Li6J+aWsOe7hCcvJ+acgOWQjumdoidcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBpbiB6eSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBuYW1lKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2lucHV0XSA9IHp5W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfmm7TmlLnmjpLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpIG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW25hbWVdID0genlbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGknLCB6dS5pbmRleE9mKGkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLmnIDlkI7pnaJcXFwiID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25bbmFtZV0gPSB6eVtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpJywgenUubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIhue7hOWQiOW5tic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LCAzLCAn6YCJ5oup6KaB5ZCI5bm255qE5YiG57uEJykuc2VsZWN0KChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpIG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpXSA9IHp5W2ldLmNvbmNhdCh6eVtuYW1lXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGknLCB6dS5pbmRleE9mKGkpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW2ldID0genlbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpdGNoOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtuYW1lXVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5nZXRTaGFyZShqc29uLCBmYWxzZSwganNvbi5kYXRhLmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaTliIbnu4QgXFxcIiArIG5hbWUgKyBcXFwiIOWQl++8n1xcXFxu5q2k5pON5L2c5LiN5Y+v6YCG77yM6LCo5oWO6YCJ5oup44CCXFxcIikuY29uZmlybSgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHp5W25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICB9XVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59KTtcXG5cXG5cXG5cXG5cXG5cXG5cXG5zd2l0Y2ggKGNfdDIpIHtcXG4gICAgY2FzZSAnZnJlZSc6XFxuICAgICAgICBjX3QyID0gJzAnXFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAncGFpZCc6XFxuICAgICAgICBjX3QyID0gJzEnXFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAnc29uZ3MnOlxcbiAgICAgICAgY190MiA9ICcyJ1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgJ2hvdHMnOlxcbiAgICAgICAgY190MiA9ICczJ1xcbiAgICAgICAgYnJlYWs7XFxufVxcbmlmIChKU09OLnN0cmluZ2lmeSh6dSkgPT0gJ1tcXFwi5YWo6YOoXFxcIl0nICYmIHp5W1xcXCLlhajpg6hcXFwiXS5sZW5ndGggPT0gMCkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeaciX5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIilcXG4gICAgfSk7XFxufSBlbHNlIHtcXG4gICAgaWYgKHp5W3p1W3RpXV0ubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBkZWxldGUgenlbenVbdGldXTtcXG4gICAgICAgIGNsZWFyTXlWYXIoJ3RpJyk7XFxuICAgICAgICAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIGxldCBpaSA9IDA7XFxuICAgICAgICB6eVt6dVt0aV1dLm1hcCgoXywgaSkgPT4ge1xcbiAgICAgICAgICAgIGlmICgoKGNfcGxhdGZvcm0gPT0gJ2xpYicgfHwgY19wbGF0Zm9ybSA9PSBfLmRlc2MpICYmIChjX3QyID09ICdsaWInIHx8IGNfdDIgPT0gXy5jb250ZW50KSkgfHwgKGNfcGxhdGZvcm0gPT0gJ2xpYicgJiYgKChjX3QyID09IF8uY29udGVudCkgfHwgKGNfdDIgPT0gJzAnICYmIF8uY29udGVudCAhPSAnMScpKSkpIHtcXG4gICAgICAgICAgICAgICAgXy5leHRyYSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgJzphZGRsaXN0JyxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIHp1LCBrZXksIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwi5L+u5pS55ZCN56ewXFxcIiwgXFxcIuabtOaUueaOkuW6j1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWwgemdolxcXCIsIFxcXCLliIfmjaLliIbnu4RcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qXFxcIuaJuemHj+aNoue7hFxcXCIqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXSwgMiwgJ+mAieaLqeimgeWPmOabtOeahOS6i+S7ticpLnNlbGVjdCgoc2ksIHp1LCBrZXksIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+S/ruaUueWQjeensCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+S/ruaUueWwgemdoic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdHlwZSwgdGV4dF0gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWQjeensFxcXCI6IFsndGl0bGUnLCAn6K+36L6T5YWl5paw55qE5ZCN56ewJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIuS/ruaUueWwgemdolxcXCI6IFtfLmltZyA/ICdpbWcnIDogJ3BpYycsICfor7fovpPlhaXmraPnoa7nmoTlsIHpnaLlnLDlnYAnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVtpbnB1dF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChfW3R5cGVdLCB0ZXh0KS5pbnB1dCgoc2ksIGtleSwgaSwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlID09ICd0aXRsZScgJiYgaW5wdXQubWF0Y2goL15cXFxccyrmnIDlkI7pnaJcXFxccyokLykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/otYTmupDlkI3kuI3og73orr7nva7miJAn5pyA5ZCO6Z2iJ1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaV1bdHlwZV0gPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCBpLCB0eXBlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfmm7TmlLnmjpLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenUgPSB6eS5tYXAoXyA9PiBfLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0genlbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KChzaSwga2V5LCB6eSwgenUsIGRhdGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQganNvbiA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4genUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHp1W2ldID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uLnB1c2goZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbi5wdXNoKHp5W2ldKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFxcXCLmnIDlkI7pnaJcXFwiID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXksIHp5LCB6dSwgZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5YiH5o2i5YiG57uEJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpaSA9IHp1LmluZGV4T2Yoa2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoJ+aWsOe7hCcpLCAzLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KChzaSwga2V5LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhLCBqc29uID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlba2V5XS5tYXAoKF8sIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSAhPSBpKSBqc29uLnB1c2goXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgZGF0YSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlba2V5XSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCfmlrDnu4QnID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5paw57uE5ZCN56ewXFxcIikuaW5wdXQoKHNpLCB6eSwgZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0Lm1hdGNoKC9eXFxcXHMqKOaWsOe7hHzmnIDlkI7pnaIpP1xcXFxzKiQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v57uE5ZCN5LiN6IO95Li656m677yM5Lmf5LiN6IO96K6+572u5Li6J+aWsOe7hCcvJ+acgOWQjumdoidcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaW5wdXRdID0gW2RhdGFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenksIGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpbnB1dF0ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5om56YeP5o2i57uEJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiYWRkbGlzdD9ydWxlPXRneOmfs+S5kFxcXCIpKHNpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBrZXksIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIHp1W3RpXSwgaSwgXylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliIbkuqtcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoXywgc2ksIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaXRjaDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhOiBbX11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLmdldFNoYXJlKGpzb24sIGZhbHNlLCAxLCBzaSA9PSBcXFwiMFxcXCIgPyBcXFwi5q2M5puyXFxcIiA6IFxcXCLmrYzljZVcXFwiLCBfLnRpdGxlLCBbXFxcIuaJuemHj+WIhuS6q1xcXCIsIC8qXFxcIuWumOaWuemTvuaOpVxcXCIqLyBdLCBzaSwga2V5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgXywgc2ksIHp1W3RpXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIGtleSwgaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumuWIoOmZpFxcXCIgKyBuYW1lICsgXFxcIuWQl++8n1xcXCIpLmNvbmZpcm0oKHNpLCBrZXksIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgaSwgXy50aXRsZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKF8uZGVzYy5tYXRjaCgvcXF8d3l8a2d8a3d8bWd8NXMvKSAmJiBfLmNvbnRlbnQgIT0gMykgXy5leHRyYS5sb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKcqSDlpI3liLbpk77mjqUg4pypXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChhLCBiLCBjKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuY29weXVybChhLCBiLCBjKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoTnVtYmVyKF8uY29udGVudC5yZXBsYWNlKC9eKFxcXFxkKlxcXFxEK1xcXFxkKikrJC8sICcwJykpIDwgMikgXy5leHRyYS5sb25nQ2xpY2sudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCAxKSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmICghXy51cmwpIF8udXJsID0gTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkKTtcXG4gICAgICAgICAgICAgICAgXy5jb2xfdHlwZSA9ICdjYXJkX3B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xuICAgIGlzUCA9IE1ZX1BBR0UgPT0gMTtcXG5cXG5cXG5cXG5pZiAoc190MSA9PSAnMCcpIHtcXG4gICAgc3dpdGNoIChzX3BsYXRmb3JtKSB7XFxuICAgICAgICBjYXNlICdsaWInOlxcbiAgICAgICAgICAgIHNfdDMgPSBnZXRNeVZhcignc190MycsICdrdycpO1xcbiAgICAgICAgICAgIHRhYnMgPSBbJ2t3JywgJ2tnJ107XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICc1cyc6XFxuICAgICAgICAgICAgdGFicyA9IFsnbGliJywgJ3ljJywgJ2ZjJywgJ2J6J107XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICdteSc6XFxuICAgICAgICAgICAgc190NCA9IGdldE15VmFyKCdzX3Q0JywgJzEnKSA9PSAnMSc7XFxuICAgICAgICAgICAgc190MyA9IGdldE15VmFyKCdzX3QzJywgJ3d5Jyk7XFxuICAgICAgICAgICAgaWYgKCFzX3QzLm1hdGNoKC93eXxrd3xtZy8pICYmIHNfdDQpXFxuICAgICAgICAgICAgICAgIHNfdDMgPSAnd3knO1xcbiAgICAgICAgICAgIHRhYnMgPSBbXFxcInd5XFxcIiwgXFxcImt3XFxcIiwgXFxcIm1nXFxcIiwgXFxcIjF0XFxcIiwgXFxcImRiXFxcIiwgXFxcIjV5XFxcIiwgXFxcIjVmXFxcIl0uc2xpY2UoMCwgc190NCA/IDMgOiA3KTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2UgJ3F0JzpcXG4gICAgICAgICAgICBzX3QzID0gZ2V0TXlWYXIoJ3NfdDMnLCAnYmQnKTtcXG4gICAgICAgICAgICB0YWJzID0gcXRzLnNsaWNlKDEpO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICBpZiAoc190MyA9PSAna3cnIHx8IHNfdDMgPT0gJ2tnJykge1xcbiAgICAgICAgICAgICA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AgICBbXFxcIjVzXFxcIiwgLzVzaW5nXFxcXC4vaSwgLy4qKHNvbmdsaXN0LippZD0pKFthLXowLTldKykvaSwgLy4qKFxcXFw/c29uZy4qPz18XFxcXC8pKFthLXowLTldKykoXFxcXCZzb25nLio/PXxcXFxcLykoW2EtejAtOV0rKS9pXSxcXG4gICAgICAgICAgICBbXFxcImtnXFxcIiwgL2t1Z291XFxcXC4vaSwgLyhcXFxcL3NwZWNpYWxcXFxcL3NpbmdsZVxcXFwvfHNoYXJlX3R5cGU9c3BlY2lhbCZpZD18Z2xvYmFsX3NwZWNpYWxpZD18XFxcXC9zb25nbGlzdFxcXFwvfGdsb2JhbF9jb2xsZWN0aW9uX2lkPXxeW14oXFxcXC9zaGFyZSldK1smXFxcXD9daWQ9KShbXiZcXFxcL10rKS9pLCAvKGhhc2g9KShbYS16MC05XSspL2ldLFxcbiAgICAgICAgXTtcXG4gICAgICAgIGZvciAoW3BsYXRmb3JtLCByZWcxLCByZWcyLCByZWczXSBvZiByZWdzKSB7XFxuICAgICAgICAgICAgaWYgKHNfdDIubWF0Y2gocmVnMSkpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHNfcGxhdGZvcm0gPSBwbGF0Zm9ybTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZWcyICYmIChtYXQgPSBzX3QyLm1hdGNoKHJlZzIpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNfdDEgPSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaWQgPSBtYXRbM10gfHwgbWF0WzJdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChyZWczICYmIChtYXQgPSBzX3QyLm1hdGNoKHJlZzMpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNfdDEgPSAnMCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaWQgPSBtYXRbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBsYXRmb3JtID09ICc1cycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlZ2lkLm1hdGNoKC9cXFxcRC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVnaWQgPSBtYXRbNF0gKyAnIycgKyByZWdpZDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVnaWQgKz0gJyMnICsgbWF0WzRdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7fVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoIXJlZ2lkKSB7IC8vIOato+WImeacquWMuemFjVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIFtzX3BsYXRmb3JtLCBzX3QxLCByZWdpZF0gPSBKU09OLnBhcnNlKGV4ZWN1dGVXZWJSdWxlKHNfdDIucmVwbGFjZSgvXltcXFxcc1xcXFxTXSo/KGh0dHBbXlxcXFxuXSspW1xcXFxzXFxcXFNdKi9pLCBcXFwiJDFcXFwiKSwgJC50b1N0cmluZygocmVncywgcGxhdGZvcm0sIHNfdDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpc1JlZyA9IChyZWcsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gd2luZG93LmxvY2F0aW9uLmhyZWYubWF0Y2gocmVnKVtpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChtYXRFcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW1xcXCJxcVxcXCIsIFxcXCIxXFxcIiwgaXNSZWcocmVnc1swXVsyXSwgMikgfHwgZmlyc3RQYWdlRGF0YS50YW9nZURhdGEuaWRdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaHBQYXJhbSA9IGRhdGFGcm9tU21hcnR5WzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChpc0tncGUpIHt9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwZWNpYWxpZCA9IHBocFBhcmFtLnNwZWNpYWxpZCB8fCBwaHBQYXJhbS5nbG9iYWxfY29sbGVjdGlvbl9pZDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNwZWNpYWxpZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW1xcXCJrZ1xcXCIsIFxcXCIxXFxcIiwgc3BlY2lhbGlkXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJ1biA9IFtcXFwia2dcXFwiLCBcXFwiMFxcXCIsIGlzUmVnKHJlZ3NbNV1bM10sIDIpIHx8IHBocFBhcmFtLmhhc2hdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyMikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cnkgeyAvLyDlpb3lg4/mmK/ov5nmoLfmi7znmoQo5aSn5qaCXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGxpc3RpZCA9IGlzUmVnKC9saXN0aWQ9KFxcXFxkKykvaSwgMSkpICYmICh1aWQgPSBpc1JlZygvdWlkPShcXFxcZCspL2ksIDEpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJ1biA9IFtcXFwia2dcXFwiLCBcXFwiMVxcXCIsIFxcXCJjb2xsZWN0aW9uXzNfXFxcIiArIHVpZCArIFxcXCJfXFxcIiArIGxpc3RpZCArIFxcXCJfMFxcXCJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaHBQYXJhbSA9ICh3aW5kb3cuJG91dHB1dCA/IHdpbmRvdy4kb3V0cHV0LmluZm8gOiBuRGF0YSkubGlzdGluZm87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW1xcXCJrZ1xcXCIsIFxcXCIxXFxcIiwgcGhwUGFyYW0uc3BlY2lhbGlkIHx8IHBocFBhcmFtLmdsb2JhbF9jb2xsZWN0aW9uX2lkXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnVuID0gW3BsYXRmb3JtLCBzX3QxLCBcXFwiXFxcIl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoUnVuKTtcXG4gICAgICAgICAgICAgICAgfSwgcmVncywgcGxhdGZvcm0sIHNfdDEpLCB7XFxuICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddLFxcbiAgICAgICAgICAgICAgICAgICAgdGltZW91dDogODAwMFxcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAod2ViRXJyKSB7fVxcbiAgICAgICAgICAgIGlmICghcmVnaWQgJiYgc19wbGF0Zm9ybSA9PSBcXFwia2dcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQga2dfaHJlZiA9IEpTT04ucGFyc2UoZmV0Y2goc190Mi5yZXBsYWNlKC9eW1xcXFxzXFxcXFNdKj8oaHR0cFteXFxcXG5dKylbXFxcXHNcXFxcU10qL2ksIFxcXCIkMVxcXCIpLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChtYXQgPSBrZ19ocmVmLm1hdGNoKHJlZ3NbNV1bMl0pIHx8IGtnX2hyZWYubWF0Y2gocmVnc1s1XVszXSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzX3QxID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtYXQgPSBrZ19ocmVmLm1hdGNoKHJlZ3NbNV1bM10pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc190MSA9IFxcXCIwXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJlZ2lkID0gbWF0WzJdO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHt9XFxuICAgICAgICAg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AgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc190MicsaW5wdXQpXFxcIixcXG4gICAgICAgICAgICAvKiDkuI3lpb3nlKhcXG4gICAgICAgICAgICAkLnRvU3RyaW5nKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCA9IFN0cmluZyhpbnB1dCkudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcInNfdDJcXFwiKSAhPSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoaWQgKyAnOmNtZDprZXknKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCAmJiBpbnB1dCAhPSBcXFwiXFxcIiAmJiAhL2h0dHBzPzpcXFxcL1xcXFwvLy50ZXN0KGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL21zZWFyY2hjZG4ua3Vnb3UuY29tL25ldy9hcHAvaS9zZWFyY2gucGhwP2NtZD0zMDIma2V5d29yZD1cXFwiICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IEpTT04ucGFyc2UoZmV0Y2godSkpLmRhdGFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ua2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXh0cmEgPSBmaW5kSXRlbShpZCtcXFwiOnNlYXJjaFxcXCIpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYS5kZWZhdWx0VmFsdWUgPSBrZXk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGV4dHJhXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlkLCBfLmtleXdvcmQpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyAnOmNtZDprZXknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoaWQgKyAnOnNlYXJjaCcsIGQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaWQpXFxuICAgICAgICAgICovXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgfSk7XFxuICAgIHBsYXRmb3Jtcy5tYXAocGxhdGZvcm0gPT4ge1xcbiAgICAgICAgaWYgKHNfcGxhdGZvcm0gPT0gcGxhdGZvcm0pXFxuICAgICAgICAgICAgcGxhdGZvcm0gPSBSaWNoKFN0cm9uZyhDb2xvcihwbGF0Zm9ybSkpKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHBsYXRmb3JtLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKCFwbGF0Zm9ybS5tYXRjaCgvXuKAmOKAmOKAmeKAmS8pKSB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzZWFyY2hfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBwbGF0Zm9ybSk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3Q0Jyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBwbGF0Zm9ybSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgfSk7XFxuICAgIGlmIChzX3QxID09ICcwJyAmJiBzX3BsYXRmb3JtID09ICdteScpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFJpY2goU3Ryb25nKENvbG9yKHNfdDQgPyAn5pawJyA6ICfml6cnLCAnIzMzOTljYycpKSksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3Q0KSA9PiB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3Q0Jywgc190NCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBzX3Q0ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICB0YWJzLm1hcChuYW1lID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHNfdDMgPT0gbmFtZSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QzJywgdGlkKT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yArIHNfdDIgKyAnIycgKyBNWV9QQUdFKTtcXG4gICAgICAgIGlmIChpc1AgJiYgIWlzVSAmJiBzX3QxID09ICcwJykge1xcbiAgICAgICAgICAgIGlzX2Rvd24gPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJ1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpc19kb3duID8gJzxiPvCfk6Ug5LiL6L29PC9iPicgOiAnPGI+8J+OtSDmkq3mlL48L2I+JyxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tb3JlLycgKyAoaXNfZG93biA/IDIyIDogNDApICsgJy5wbmcnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaXNfZG93biA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlLCBpbWcgPSAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tb3JlLyc7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNfZG93bikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJzxiPvCfjrUg5pKt5pS+PC9iPic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nICs9ICc0MCc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gJzxiPvCfk6Ug5LiL6L29PC9iPic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nICs9ICcyMic7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpbWcgKz0gJy5wbmcnO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaF9kb3duJywgaXNfZG93biA/ICcwJyA6ICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkICsgJzp5aXlhbicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBmaW5kSXRlbXNCeUNscyhpZCArICc6YWRkbGlzdCcpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBleHRyYV91cmwgPSBpdC51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGl0LmV4dHJhLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdC5leHRyYS51cmwgPSBleHRyYV91cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpdC5leHRyYS5pZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogaXQuZXh0cmEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfaWNvblxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaWQgKyAnOnlpeWFuJ1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGlzUCkge1xcbiAgICAgICAgICAgIC8vIGlzX2Rvd24gPSBmZXRjaCgnaHR0cHM6Ly92MS5oaXRva290by5jbi8/ZW5jb2RlPXRleHQnKTtcXG4gICAgICAgICAgICBpc19kb3duID0gZmV0Y2goJ2h0dHBzOi8vdGVuYXBpLmNuL3YyL3lpeWFuJywge1xcbiAgICAgICAgICAgICAgICB0aW1lb3V0OiAzMDAwXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8Yj7wn5OaICcgKyBpc19kb3duICsgJzwvYj4nLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9pY29uNCcsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpc19kb3duID0gZmV0Y2goJ2h0dHBzOi8vdGVuYXBpLmNuL3YyL3lpeWFuJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDMwMDBcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPGI+8J+TmiAnICsgaXNfZG93biArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5aSN5Yi2OiBcXFwiICsgaXNfZG93bixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIHRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlzX2Rvd24pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpZCArIFxcXCI6c2VhcmNoX2Rvd25cXFwiKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2ljb25cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGlkICsgXFxcIjpzZWFyY2hfZG93blxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlpI3liLY6IFxcXCIgKyBpc19kb3duLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXNfZG93bilcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChpc1AgfHwgZ2V0TXlWYXIoJ3NlYXJjaF9wYWdlJywgJzAnKSA9PSAnMCcgfHwgc19wbGF0Zm9ybS5tYXRjaCgvbXl8cXQvKSkge1xcbiAgICAgICAgICAgIGxldCBwYWdlU2l6ZSA9IHNfcGxhdGZvcm0gPT0gXFxcIjVzXFxcIiA/IChzX3QxID09ICcwJyA/IDEwIDogMTUpIDogMzA7XFxuICAgICAgICAgICAgbGV0IHRvdGFsID0gJC5yZXF1aXJlKHNfcGxhdGZvcm0gKyBcXFwiP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2VhcmNoKHNfdDEsIHNfdDIsIHNfdDMsIHNfdDQpO1xcbiAgICAgICAgICAgIGlmICh0b3RhbCA8IE1ZX1BBR0UgKiBwYWdlU2l6ZSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc2VhcmNoX3BhZ2UnLCAnMScpO1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgJ+aIkeaYr+acieW6lee6v+eahCcuZm9udGNvbG9yKCdHcmF5Jykuc21hbGwoKSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9XFxufSBlbHNlIGlmIChpc1AgJiYgIWlzVSkge1xcbiAgICBzZXRQYWdlVGl0bGUoJ+mrmOe6p+aQnOe0oicpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6I2ZmNjYwMVxcXCI+PGI+5Y6G5Y+y5pCc57SiPC9iPjwvc3Bhbj4nLFxcbiAgICAgICAgcGljX3V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l8xXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBlbHNlIGhpc3RvcnkubWFwKChrZXksIGkpID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGtleSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHNfcGxhdGZvcm0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAodHJ1ZSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNfcGxhdGZvcm0gPT0gJ2xpYicpIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgZ2V0SXRlbSgnc19wbGF0Zm9ybScsICdrdycpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAvLyBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZXh0cmEgPSBmaW5kSXRlbShcXFwiZ2NzcDE5OTk6c2VhcmNoXFxcIikuZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYS5kZWZhdWx0VmFsdWUgPSBrZXk7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSwgc19wbGF0Zm9ybSwga2V5KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOmtleTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpOWFs+mUruivjTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGlkLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGlzdG9yeSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcInNlYXJjaEhpc3RvcnlcXFwiLCBbXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlpID0gaGlzdG9yeS5pbmRleE9mKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGlzdG9yeS5zcGxpY2UoaWksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcInNlYXJjaEhpc3RvcnlcXFwiLCBoaXN0b3J5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcIjprZXk6XFxcIiArIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBhZGRJdGVtQWZ0ZXIoaWQgKyBcXFwiOnNlYXJjaEhpc3RvcnlcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJ5ZOmfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaWQsIGtleSlcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIFJlc291ID0gKGlkLCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgcmVzb3UpID0+IHtcXG4gICAgICAgIGxldCBEID0gW107XFxuICAgICAgICByZXNvdS5tYXAobmFtZSA9PiB7XFxuICAgICAgICAgICAgRC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc19wbGF0Zm9ybSwgcGxhdGZvcm0sIGtleXdvcmQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzX3BsYXRmb3JtID09ICdsaWInKSBwdXRNeVZhcignc19wbGF0Zm9ybScsIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICAgICAgLy8gY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgc19wbGF0Zm9ybSwgcGxhdGZvcm0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyAnOnJlc291OmtleSdcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gRDtcXG4gICAgfTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6I2ZmNjYwMVxcXCI+PGI+5aSn5a626YO95Zyo5pCcPC9iPjwvc3Bhbj4nLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpZCwgc19wbGF0Zm9ybSwgcGxhdGZvcm0sIFJlc291KSA9PiB7XFxuICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKGlkICsgJzpyZXNvdTprZXknKTtcXG4gICAgICAgICAgICBsZXQgc3JlYztcXG4gICAgICAgICAgICBpZiAocGxhdGZvcm0gIT0gJ2tnJykge1xcbiAgICAgICAgICAgICAgICBzcmVjID0gW107XFxuICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly9zZWFyY2hyZWMua3V3by5jbi9zcmVjLnM/c2VhcmNocmVjYXBpPTAmaWQ9MFxcXCIpKS5hYnNsaXN0Lm1hcChhYmxpc3QgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgYWJsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzcmVjLnB1c2goXy53b3JkKVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBNWV9QQUdFID0gMTtcXG4gICAgICAgICAgICAgICAgc3JlYyA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZWFyY2goXFxcIjBcXFwiLCBcXFwiXFxcIiwgXFxcImxpYlxcXCIsIFxcXCJzcmVjXFxcIikubWFwKF8gPT4gXy5PcmlTb25nTmFtZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihpZCArICc6cmVzb3UnLCBSZXNvdShpZCwgc19wbGF0Zm9ybSwgcGxhdGZvcm0sIHNyZWMpKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfSwgaWQsIHNfcGxhdGZvcm0sIHNfdDMsIFJlc291KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9ydWxlX3R5cGVfY29taWNzXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGlkICsgXFx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AgICAgICAgICAgICAgICAgIFxcXCJjbGllbnR0aW1lXFxcIjogbmV3IERhdGUoKS5nZXRUaW1lKCkgKyBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ4LXJvdXRlclxcXCI6IFxcXCJtc2VhcmNoLmt1Z291LmNvbVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIEpTT04ucGFyc2Uoc3JlY190KS5kYXRhLmxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICByID0gXy5uYW1lID09IFxcXCLnu7zoibrng63mkJxcXFwiO1xcbiAgICAgICAgICAgICAgICBfLmtleXdvcmRzLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNyZWMucHVzaChyID8gXy5rZXl3b3JkLnNwbGl0KFxcXCIgXFxcIilbMF0gOiBfLmtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgIH1cXG4gICAgICAgIHNyZWMgPSBzcmVjLmZpbHRlcigoYSwgYiwgYykgPT4gYy5pbmRleE9mKGEpID09PSBiICYmIGEudHJpbSgpICE9PSBcXFwiXFxcIik7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzX3QzICsgXFxcIl9zcmVjXFxcIiwgc3JlYyk7XFxuICAgIH1cXG4gICAgZCA9IGQuY29uY2F0KFJlc291KGlkLCBzX3BsYXRmb3JtLCBzX3QzLCBzcmVjKSk7XFxufVxcblxcbk1ZX1BBR0UgPT0gMSA/IHNldFByZVJlc3VsdChkKSA6IHNldFJlc3VsdChkKTtcXG5kZWxldGVJdGVtQnlDbHMoJ2xvYWRpbmdfZ2lmJyk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLinbd3eVwiLFwicGF0aFwiOlwid3lcIixcInJ1bGVcIjpcImV2YWwoSlNPTi5wYX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VsZT3mrYzor43pgILphY0nKS5hamF4MihcXFwiL3BsYXlsaXN0L2NhdGFsb2d1ZVxcXCIsIHt9KS5zdWI7XFxuICAgICAgICBsZXQgU3ViID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgzKFxcXCIvYXBpL3BsYXlsaXN0L2NhdGFsb2d1ZS92MVxcXCIsIHt9KS5zdWI7XFxuICAgICAgICBTdWIubWFwKF8gPT5cXG4gICAgICAgICAgICBpVGFnW0FycltfLmNhdGVnb3J5XV1bXy5uYW1lXSA9IF8ubmFtZVxcbiAgICAgICAgKTtcXG4gICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdID0ge307XFxuICAgICAgICBpZiAocnVuKSByZXR1cm4gdHJ1ZTtcXG4gICAgICAgIC8qXFxuICAgICAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW1xcXCLlhajpg6hcXFwiXSA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KFxcXCJ0b3BsaXN0P1xcXCIpLmxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgICovXFxuICAgICAgICAkLnJlcXVpcmUoJ3d5P3J1bGU95q2M6K+N6YCC6YWNJykuYWpheDMoXFxcIi9hcGkvdG9wbGlzdC9kZXRhaWwvdjJcXFwiKS5kYXRhLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5saXN0ICYmIF8ubGlzdC5sZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBfLm5hbWUucmVwbGFjZSgv5qac5Y2VPy8sIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bbmFtZV0gPSBbXTtcXG4gICAgICAgICAgICAgICAgXy5saXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLmlkICE9IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpVGFnW1xcXCLmjpLooYxcXFwiXVtuYW1lXS5wdXNoKEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJ3eV9pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIGxldCBsaXN0LCBfO1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhVxcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIvdjMvc29uZy9kZXRhaWxcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBjOiBgW3tcXFwiaWRcXFwiOiR7dDF9fV1gXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsZXQgYSA9IF8uc29uZ3NbMF07XFxuICAgICAgICAgICAgICAgIGxldCBpc0ZyZWVNdXNpYyA9IChhLmZlZSA9PSAwIHx8IGEuZmVlID09IDgpICYmIChfLnByaXZpbGVnZXNbMF0uc3QgPiAtMSk7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOS4i+i9vVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbdHNbMV0gKyBTaXplKGEubCA/IGEubC5zaXplIDogYS5tLnNpemUpXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLmgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKGEuaC5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoYS5zcSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoYS5zcS5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoYS5ocilcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1s0XSArIFNpemUoYS5oci5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJ3eVxcXCIsIHQxLCBpLCBhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCB0MSwgYSk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHZhciB1cmwsIGlpLCBscmM7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuaHIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInd5XFxcIiwgdDEsIDMsIGEsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpID09IDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEuc3EpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcInd5XFxcIiwgdDEsIDIsIGEsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWlpID0gaWkgPiAwID8gMSA6IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZG8ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNGcmVlTXVzaWMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVybCA9IGBodHRwOi8vbXVzaWMuMTYzLmNvbS9zb25nL21lZGlhL291dGVyL3VybD9pZD0ke3QxfS5tcDNgO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgzKFxcXCIvYXBpL3NvbmcvZW5oYW5jZS9wbGF5ZXIvdXJsL3YxXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkczogYFske3QxfV1gLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsOiBpaWkgPiAwID8gXFxcImV4aGlnaFxcXCIgOiBcXFwic3RhbmRhcmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuY29kZVR5cGU6IFxcXCJmbGFjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkuZGF0YVswXS51cmwuc3BsaXQoXFxcIj9cXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoYS5oICYmIGlpID09IDEpIHx8IGlpaSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJ3eVxcXCIsIHQxLCBpaWksIGEsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpaWkgLT0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IHdoaWxlIChpaWkgPiAtMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIvc29uZy9seXJpY1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsdjogLTEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGt2OiAtMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHY6IC0xXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkubHJjLmx5cmljO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyBcXFwiI2lzTXVzaWM9dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvL+mmlumhtVxcbiAgICAgICAgICAgICAgICAvLyBpZiAoIXQxLm1hdGNoKC9cXFxcPy8pKSB0MSA9IFxcXCJ0b3AvcGxheWxpc3Q/Y2F0PVxcXCIgKyB0MSArIFxcXCImXFxcIjtcXG4gICAgICAgICAgICAgICAgLy8gXyA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KHQxKTtcXG4gICAgICAgICAgICAgICAgaWYgKHQxID09IFxcXCJwZXJzb25hbGl6ZWQ/XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4MyhcXFwiL2FwaS9wZXJzb25hbGl6ZWQvcGxheWxpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGltaXQ6IDEyXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgQ29va2llOiBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgyKFxcXCIvcGxheWxpc3QvbGlzdFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXQ6IHQxIHx8IFxcXCLlhajpg6hcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yZGVyOiBcXFwiaG90XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW1pdDogMzAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0OiAoTVlfUEFHRSAtIDEpICogMzAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdG90YWw6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY3NyZl90b2tlbjogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsaXN0ID0gXy5yZXN1bHQgfHwgXy5wbGF5bGlzdHM7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCB8fCBfLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgLy8gaWYgKHQxID09IFxcXCJwZXJzb25hbGl6ZWQ/XFxcIikgcmV0dXJuIDA7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiAvLyDlj5HnjrBcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImdkL3Y2L1xcXCIgKyB0MSwgOTk5OTkpLnBsYXlsaXN0LnRyYWNrcztcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0MikgcmV0dXJuIF87XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLmFyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgIGltZzogXy5hbC5waWNVcmwsXFxuICAgICAgICAgICAgY29udGVudDogKChfLmZlZSA9PSAwIHx8IF8uZmVlID09IDgpICYmIChfLnByaXZpbGVnZSA/IChfLnByaXZpbGVnZS5zdCA+IC0xKSA6IDEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgIH0sIDEpKTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfSxcXG4gICAgc2VhcmNoOiBmdW5jdGlvbihwbGF0Zm9ybSwga2V5d29yZCwgaXNVKSB7XFxuICAgICAgICBsZXQgXztcXG4gICAgICAgIGlmIChpc1UgIT0gXFxcInVybFxcXCIpIHtcXG4gICAgICAgICAgICBsZXQgbGlzdCwgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiAoKF8uZmVlID09IDAgfHwgXy5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlID8gKF8ucHJpdmlsZWdlLnN0ID4gLTEpIDogMSkpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgIGZyZWU6IChfKSA9PiAoKF8uZmVlID09IDAgfHwgXy5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlID8gKF8ucHJpdmlsZWdlLnN0ID4gLTEpIDogMSkpID8gMSA6IDBcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGxldCBzdXJsID0gKHN0eXBlKSA9PiBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIvc2VhcmNoL2dldFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgczoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgbGltaXQ6IDMwLFxcbiAgICAgICAgICAgICAgICBvZmZzZXQ6IChNWV9QQUdFIC0gMSkgKiAzMCxcXG4gICAgICAgICAgICAgICAgdHlwZTogc3R5cGUsXFxuICAgICAgICAgICAgICAgIHN0cmF0ZWd5OiA1LFxcbiAgICAgICAgICAgICAgICBxdWVyeUNvcnJlY3Q6IHRydWVcXG4gICAgICAgICAgICB9KS5yZXN1bHQ7XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBzdXJsKDEpLnNvbmdzO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVSA9PT0gMSkgcmV0dXJuIGxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmFsLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKChfLmZlZSA9PSAwIHx8IF8uZmVlID09IDgpICYmIChfLnByaXZpbGVnZSA/IChfLnByaXZpbGVnZS5zdCA+IC0xKSA6IDEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHN1cmwoMTAwMCkucGxheWxpc3RzO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzVSA9PT0gMSkgcmV0dXJuIGxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy5zb25nQ291bnQgfHwgXy5wbGF5bGlzdENvdW50IHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIi92My9zb25nL2RldGFpbFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjOiBgW3tcXFwiaWRcXFwiOiR7a2V5d29yZH19XWBcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGEgPSBfLnNvbmdzWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBhLm5hbWUgKyAnIC0gJyArIGEuYXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBhLmFsLnBpY1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAoKGEuZmVlID09IDAgfHwgYS5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlc1swXS5zdCA+IC0xKSkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBhLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImdkL3Y2L1xcXCIgKyBrZXl3b3JkLCAwKS5wbGF5bGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgLyogTXlGcmVlTVAzIOatjOWNleino+aekOW0qeS6hu+8jOS4jeaYvuekulxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnbXknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gMDtcXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgYWpheDogZnVuY3Rpb24ocGF0aCwgbikge1xcbiAgICAgICAgaWYgKHBhdGgubWF0Y2goL15nZFxcXFwvdjZcXFxcLy8pKSB7XFxuICAgICAgICAgICAgcGF0aCA9IHBhdGgucmVwbGFjZSgvXmdkKFxcXFwvdjZcXFxcLykoXFxcXGQrKS8sIFxcXCJodHRwczovL211c2ljLjE2My5jb20vYXBpJDF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XFwiaGlrZXI6Ly9hc3NldHMvY3J5cHRvLWphdmEuanNcXFwiKTtcXG4gICAgICAgIGxldCBwYXJhbXMgPSBbcGF0aCwgSlNPTi5zdHJpbmdpZnkoanNvbiB8fCB7fSldO1xcbiAgICAgICAgcGFyYW1zLnB1c2gobWQ1KFxcbiAgICAgICAgICAgIFxcXCJub2JvZHlcXFwiICtcXG4gICAgICAgICAgICBwYXJhbXMuam9pbihcXFwidXNlXFxcIikgK1xcbiAgICAgICAgICAgIFxcXCJtZDVmb3JlbmNyeXB0XFxcIlxcbiAgICAgICAgKSk7XFxuICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShwb3N0UEMocGF0aC5yZXBsYWNlKFxcXCIvXFxcIiwgXFxcImh0dHBzOi8vaW50ZXJmYWNlLm11c2ljLjE2My5jb20vZVxcXCIpLCB7XFxuICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICBwYXJhbXM6IENyeXB0b1V0aWwuQUVTLmVuY3J5cHQoXFxuICAgICAgICAgICAgICAgICAgICBwYXJhbXMuam9pbihcXFwiLTM2Y2Q0NzliNmI1LVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgQ3J5cHRvVXRpbC5EYXRhLnBhcnNlVVRGOChcXFwiZTgyY2tlbmg4ZGljaGVuOFxcXCIpLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogXFxcIkFFUy9FQ0IvUEtDUzdQYWRkaW5nXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgKS50b0hleCgpXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBoZWFkZXJzOiBPYmplY3QuYXNzaWduKGhlYWRlcnMsIGhlYWQgfHwge30pXFxuICAgICAgICB9KSk7XFxuICAgIH0sXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p24a2dcIixcInBhdGhcIjpcImtnXCIsXCJydWxlXCI6XCJld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hdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhVxcbiAgICAgICAgICAgICAgICBsZXQgcmVsYXRlX2dvb2RzID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoW3tcXG4gICAgICAgICAgICAgICAgICAgIGhhc2g6IHQxXFxuICAgICAgICAgICAgICAgIH1dKVswXS5yZWxhdGVfZ29vZHMuc2xpY2UoMCwgNCk7XFxuICAgICAgICAgICAgICAgIF8gPSByZWxhdGVfZ29vZHNbMF07XFxuXFxuICAgICAgICAgICAgICAgIC8vIOS4i+i9vVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSByZWxhdGVfZ29vZHMubWFwKChfLCBpKSA9PiB0c1tpICsgMV0gKyBTaXplKF8uaW5mby5maWxlc2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCByZWxhdGVfZ29vZHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJrZ1xcXCIsIHQxLCBpLCByZWxhdGVfZ29vZHMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCByZWxhdGVfZ29vZHMpO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8vIOmTvuaOpVxcbiAgICAgICAgICAgICAgICB2YXIgdXJsLCBpaSwgbHJjO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlpID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDMgJiYgaWkgPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRlX2dvb2RzWzNdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrZ1xcXCIsIHQxLCAzLCByZWxhdGVfZ29vZHMsIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MyAmJiBpaSA9PSAyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWxhdGVfZ29vZHNbMl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImtnXFxcIiwgdDEsIDIsIHJlbGF0ZV9nb29kcywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXQzICYmIGlpID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlbGF0ZV9nb29kc1sxXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia2dcXFwiLCB0MSwgMSwgcmVsYXRlX2dvb2RzLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ucHJpdmlsZWdlID09IDAgfHwgXy5wcml2aWxlZ2UgPT0gOCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cmwgPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwodDEsICcxMjgnLCBfLmFsYnVtX2lkLCBfLmFsYnVtX2F1ZGlvX2lkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9tLmt1Z291LmNvbS9hcHAvaS9nZXRTb25nSW5mby5waHA/Y21kPXBsYXlJbmZvJmhhc2g9XFxcIiArIHQxKSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImtnXFxcIiwgdDEsIDAsIHJlbGF0ZV9nb29kcywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghdXJsKSByZXR1cm4gXFxcInRvYXN0Oi8v5peg5rOV6Kej5p6QXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIGlmICghbHJjKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1ID0gXFxcImh0dHA6Ly9rcmNzLmt1Z291LmNvbS9zZWFyY2g/dmVyPTEmbWFuPXllcyZjbGllbnQ9bW9iaSZrZXl3b3JkPSZkdXJhdGlvbj0maGFzaD1cXFwiICsgdDEgKyBcXFwiJmFsYnVtX2F1ZGlvX2lkPVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IF9fID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuY2FuZGlkYXRlc1swXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX18gJiYgX18uaWQgJiYgX18uYWNjZXNza2V5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL2x5cmljcy5rdWdvdS5jb20vZG93bmxvYWQ/dmVyPTEmY2xpZW50PXBjJmlkPVxcXCIgKyBfXy5pZCArIFxcXCImYWNjZXNza2V5PVxcXCIgKyBfXy5hY2Nlc3NrZXkgKyBcXFwiJmZtdD1scmMmY2hhcnNldD11dGY4XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gYmFzZTY0RGVjb2RlKEpTT04ucGFyc2UoZmV0Y2godSkpLmNvbnRlbnQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBscmMgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwOi8vd3d3Mi5rdWdvdS5rdWdvdS5jb20veXVla3Uvdjkvc3BlY2lhbC9nZXRTcGVjaWFsP2lzX2FqYXg9MSZjZG49Y2RuJnQ9NSZwYWdlc2l6ZT0zMCZjPVxcXCIgKyB0MSArIFxcXCImcD1cXFwiICsgTVlfUEFHRSkpLnNwZWNpYWxfZGI7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc3BlY2lhbG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc3BlY2lhbGlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIGlmICh0MS5tYXRjaCgvXy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICBfID0gd2ViU2lnbihcXFwiaHR0cHM6Ly9tb2JpbGVzLmt1Z291LmNvbS9hcGkvdjUvc3BlY2lhbC9zb25nX3YyXFxcIiwgWydnbG9iYWxfc3BlY2lhbGlkPScgKyB0MSwgJ3NwZWNpYWxpZD0nICsgdDEsIF0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uaW5mbztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gZXhlY3V0ZVdlYlJ1bGUoYGh0dHA6Ly93d3cyLmt1Z291Lmt1Z291LmNvbS95dWVrdS92OS9zcGVjaWFsL3NpbmdsZS8ke3QxfS01LTk5OTk5Lmh0bWw/anNvbj10cnVlYCwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShnbG9iYWwuZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBKU09OLnBhcnNlKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGxpc3QgPSBbXTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGgpXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgobGlzdCk7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBbXTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaChgaHR0cDovL21vYmlsZWNkbmJqLmt1Z291LmNvbS9hcGkvdjMvcmFuay9zb25nP3BhZ2VzaXplPTMwJnBhZ2U9JHtNWV9QQUdFfSZyYW5raWQ9JHt0MX1gKSkuZGF0YS5pbmZvO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0MikgcmV0dXJuIF87XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogKF8uZmlsZW5hbWUgfHwgXy5uYW1lKS5zcGxpdCgnIC0gJykucmV2ZXJzZSgpLmpvaW4oJyAtICcpLFxcbiAgICAgICAgICAgIGltZzogXy5hbGJ1bV9zaXphYmxlX2NvdmVyIHx8IChfLmluZm8gPyBfLmluZm8uaW1hZ2UgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgY29udGVudDogKF8ucHJpdmlsZWdlID09IDAgfHwgXy5wcml2aWxlZ2UgPT0gOCkgPyAwIDogMSxcXG4gICAgICAgICAgICB6eWlkOiBfLmhhc2hcXG4g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V5d29yZCwgcGxhdGZvcm1dKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1UgPT0gJ2ZyZWUnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwyKFxcXCJ2M1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSByZXR1cm4gXy5saXN0c1swXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGlzdCA9IHN1cmwoJ3NvbmcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcInYzXFxcIiwgXFxcInBsYXRmb3JtPVdlYkZpbHRlclxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3NyZWMnKSByZXR1cm4gXy5saXN0cztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChfLmxpc3RzKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogKF8uZmlsZW5hbWUgfHwgXy5uYW1lKS5zcGxpdCgnIC0gJykucmV2ZXJzZSgpLmpvaW4oJyAtICcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWxidW1fc2l6YWJsZV9jb3ZlciB8fCAoXy5pbmZvID8gXy5pbmZvLmltYWdlIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAoXy5wcml2aWxlZ2UgPT0gMCB8fCBfLnByaXZpbGVnZSA9PSA4KSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmhhc2hcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICAvLyBsaXN0ID0gc3VybCgnc3BlY2lhbCcpO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwyKFxcXCJ2MVxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3RzO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc3BlY2lhbG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZ3VybCB8fCBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc3BlY2lhbGlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIF8udG90YWwgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGFzaDoga2V5d29yZFxcbiAgICAgICAgICAgICAgICAgICAgfV0pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAoXy5maWxlbmFtZSB8fCBfLm5hbWUpLnNwbGl0KCcgLSAnKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmFsYnVtX3NpemFibGVfY292ZXIgfHwgKF8uaW5mbyA/IF8uaW5mby5pbWFnZSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAoXy5wcml2aWxlZ2UgPT0gMCB8fCBfLnByaXZpbGVnZSA9PSA4KSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaGFzaCArIFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gd2ViU2lnbihcXFwiaHR0cHM6Ly9tb2JpbGVzLmt1Z291LmNvbS9hcGkvdjUvc3BlY2lhbC9pbmZvX3YyXFxcIiwgW1xcXCJzcGVjaWFsaWQ9XFxcIiArIGtleXdvcmQsIFxcXCJnbG9iYWxfc3BlY2lhbGlkPVxcXCIgKyBrZXl3b3JkXSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXyA9PT0gbnVsbCAmJiBOdW1iZXIoa2V5d29yZCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gZXhlY3V0ZVdlYlJ1bGUoYGh0dHA6Ly93d3cyLmt1Z291Lmt1Z291LmNvbS95dWVrdS92OS9zcGVjaWFsL3NpbmdsZS8ke2tleXdvcmR9LTUtOTk5OTkuaHRtbD9qc29uPXRydWVgLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGdsb2JhbCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNwZWNpYWxuYW1lIHx8IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsIHx8IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogKF8uc3BlY2lhbGlkIHx8IF8uZ2xvYmFsX3NwZWNpYWxpZCB8fCBfLmlkKSArIFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gMDtcXG4gIC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mlkPScgKyB1c2VyaWQsXFxuICAgICAgICAgICAgJ2tleT0nICsgbWQ1KGhhc2ggKyBcXFwiNTdhZTEyZWI2ODkwMjIzZTM1NWNjZmNiNzRlZGY3MGRcXFwiICsgYXBwaWQgKyBtaWQgKyB1c2VyaWQpLFxcbiAgICAgICAgICAgICdhbGJ1bV9pZD0nICsgYWxidW1faWQsXFxuICAgICAgICAgICAgJ2FsYnVtX2F1ZGlvX2lkPScgKyBhbGJ1bV9hdWRpb19pZCxcXG4gICAgICAgICAgICAnY2xpZW50dGltZT0nICsgTWF0aC5mbG9vcihkYXRlIC8gMTAwMCksXFxuICAgICAgICAgICAgJ29wZW5fdGltZT0nICsgJC5kYXRlRm9ybWF0KGRhdGUsICd5eXl5TU1kZCcpLFxcbiAgICAgICAgICAgICd0b2tlbj0nICsgdG9rZW4sXFxuICAgICAgICAgICAgJ2FyZWFfY29kZT0xJyxcXG4gICAgICAgICAgICAnbW9kdWxlPScsXFxuICAgICAgICAgICAgJ3NzYV9mbGFnPWlzX2Zyb210cmFjaycsXFxuICAgICAgICAgICAgJ2NsaWVudHZlcj0xMDUxOCcsIC8vMTIwMjlcXG4gICAgICAgICAgICAndmlwVHlwZT02JyxcXG4gICAgICAgICAgICAncHR5cGU9MCcsXFxuICAgICAgICAgICAgJ2F1dGg9JyxcXG4gICAgICAgICAgICAnbXR5cGU9MCcsXFxuICAgICAgICAgICAgJ2JlaGF2aW9yPXBsYXknLFxcbiAgICAgICAgICAgICdwaWQ9MicsXFxuICAgICAgICAgICAgJ2RmaWQ9LScsXFxuICAgICAgICAgICAgJ3BpZHZlcnNpb249MzAwMScsXFxuICAgICAgICAgICAgJ3NlY3JldD0nICsgUigzMiksXFxuICAgICAgICAgICAgLy8gJ2JlaGF2aW9yPXBsYXknLFxcbiAgICAgICAgICAgIC8vICd2ZXJzaW9uPTkyMDknLFxcbiAgICAgICAgICAgIC8vICdjbWQ9MjYnLFxcbiAgICAgICAgXTtcXG4gICAgICAgIC8vIGJv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p4bGlzdCwgcmVxID0gSlNPTi5wYXJzZShwb3N0KFxcXCJodHRwczovL2dhdGV3YXkua3Vnb3UuY29tL3YyL3JlcG9ydC9saXN0ZW5fc29uZz9cXFwiICsgZ2V0UGFyYW1zKHBhcmFtcywgc2lnbmtleSwgYm9keSksIHtcXG4gICAgICAgICAgICBib2R5LFxcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiQW5kcm9pZDcxMi1BbmRyb2lkUGhvbmUtMTA1MTgtMTgtMC1OZXRNdXNpYy13aWZpXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVRIYXNoXFxcIjogXFxcIjNlNWVjNmJcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiS0ctUmVjXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiS0ctUkNcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJ4LXJvdXRlclxcXCI6IFxcXCJ5b3V0aC5rdWdvdS5jb21cXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgaWYgKHJlcS5zdGF0dXMgPT0gMSkge1xcbiAgICAgICAgICAgIGlmIChpc2p4KSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9rZycsIFtdKVxcbiAgICAgICAgICAgICAgICAgICAgLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImM4NzdhZTcyYjk3YmMyNjcyMGFkOGIxYTM5MzYyZDQ3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnRpbWUgPSBkYXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X2tnJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIGlmIChyZXEuZXJyb3JfY29kZSA9PSAxMzAwMTIpIHsgLy8g562+5Yiw6L+H5LqG77yfICAgICAgXFxuICAgICAgICAgICAgaWYgKGlzangpIHtcXG4gICAgICAgICAgICAgICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pXFxuICAgICAgICAgICAgICAgICAgICAubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiYzg3N2FlNzJiOTdiYzI2NzIwYWQ4YjFhMzkzNjJkNDdcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8udGltZSA9IGRhdGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uc2lnbmluID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIF9cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3Rfa2cnLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1x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fzc2V0cy9jcnlwdG8tamF2YS5qc1xcXCIpO1xcbiAgICAgICAgbGV0IGNsaWVudHRpbWVfbXMgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKSArIFxcXCJcXFwiO1xcbiAgICAgICAgbGV0IGNsaWVudHRpbWUgPSBNYXRoLmZsb29yKGNsaWVudHRpbWVfbXMgLyAxZTMpO1xcbiAgICAgICAgbGV0IHAzID0gQ3J5cHRvVXRpbC5BRVMuZW5jcnlwdChcXG4gICAgICAgICAgICBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIGNsaWVudHRpbWUsXFxuICAgICAgICAgICAgICAgIHRva2VuXFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgQ3J5cHRvVXRpbC5EYXRhLnBhcnNlVVRGOChhZXNfa2V5KSxcXG4gICAgICAgICAgICAoe1xcbiAgICAgICAgICAgICAgICBpdjogQ3J5cHRvVXRpbC5EYXRhLnBhcnNlVVRGOChhZXNfaXYpLFxcbiAgICAgICAgICAgICAgICBtb2RlOiBcXFwiQUVTL0NCQy9QS0NTN1BhZGRpbmdcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICkudG9IZXgoKTtcXG5cXG4gICAgICAgIC8vIGRmaWQsIGRldiwgcGxhdCwgZ2l0dmVyc2lvblxcbiAgICAgICAgbGV0IGJvZHkgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgcDMsXFxuICAgICAgICAgICAgY2xpZW50dGltZV9tcyxcXG4gICAgICAgICAgICB0MTogXFxcIjBcXFwiLFxcbiAgICAgICAgICAgIHQyOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgdXNlcmlkLFxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICAvLyB1dWlkXFxuICAgICAgICBsZXQgcGFyYW1zID0gW1xcbiAgICAgICAgICAgIFxcXCJkZmlkPS1cXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcHBpZD1cXFwiICsgYXBwaWQsXFxuICAgICAgICAgICAgXFxcIm1pZD1cXFwiICsgUigzMiwgXFxcIjEyMzQ1Njc4OTBcXFwiKSxcXG4gICAgICAgICAgICBcXFwiY2xpZW50dmVyPTEwNTk3XFxcIixcXG4gICAgICAgICAgICBcXFwiY2xpZW50dGltZT1cXFwiICsgY2xpZW50dGltZSxcXG4gICAgICAgIF07XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKHBvc3QoXFxcImh0dHA6Ly9sb2dpbi51c2VyLmt1Z291LmNvbS92NC9sb2dpbl9ieV90b2tlbi8/XFxcIiArIGdldFBhcmFtcyhwYXJhbXMsIHNpZ25rZXksIGJvZHkpLCB7XFxuICAgICAgICAgICAgICAgIGJvZHksXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIkFuZHJvaWQ4MDAtMTA3MC0xMDU5Ny00Ni0wLUxPR0lOLXdpZmlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIktHLVRIYXNoXFxcIjogXFxcIjNlNWVjNmJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIktHLVJlY1xcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJLRy1SQ1xcXCI6IFxcXCIxXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSkpLmRhdGEudG9rZW47XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgfVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p25a3dcIixcInBhdGhcIjpcImt3XCIsXCJydWxlXCI6XCJldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgIL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SKDQpfS0ke1IoMTIpfSZwbGF0PXdlYl93d3cmZnJvbT1gO1xcbiAgICBsZXQgZ2V0ZGF0YSA9IChhamF4ZXJyKSA9PiB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoUEModXJsLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8va3V3by5jbi8nLFxcbiAgICAgICAgICAgICAgICAgICAgJ0Nvb2tpZSc6IGdldE15VmFyKCdrd19Db29raWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICdTZWNyZXQnOiBnZXRNeVZhcigna3dfU2VjcmV0JylcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGFqYXhlcnIgPCAyID8gZ2V0ZGF0YShhamF4ZXJyICsgMSkgOiBcXFwiXFxcIjtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICByZXR1cm4gZ2V0ZGF0YSgwKTtcXG59XFxuXFxuXFxuZnVuY3Rpb24gZ2V0THJjKHJpZCwgaXNHZXRMeXJpY3gpIHtcXG4gICAgY29uc3QgQnVmZmVyID0ge1xcbiAgICAgICAgZnJvbTogdCA9PiB7XFxuICAgICAgICAgICAgbGV0IHIgPSB0Lmxlbmd0aDtcXG4gICAgICAgICAgICBsZXQgZSA9IG5ldyBVaW50OEFycmF5KHIpO1xcbiAgICAgICAgICAgIGZvciAobGV0IG4gPSAwOyBuIDwgcjsgbisrKVxcbiAgICAgICAgICAgICAgICBlW25dID0gdC5jaGFyQ29kZUF0KG4pO1xcbiAgICAgICAgICAgIHJldHVybiBlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgY29uc3QgYnVma2V5ID0gQnVmZmVyLmZyb20oJ3llZWxpb24nKTtcXG4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uY2xvc2UoKTtcXG4gICAgICAgICAgICBiYWlzLmNsb3NlKCk7XFxuICAgICAgICAgICAgYmFvcy5jbG9zZSgpO1xcbiAgICAgICAgICAgIGlmICghaXNHZXRMeXJpY3gpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGJhb3MudG9CeXRlQXJyYXkoKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGI2NFRleHQyID0gU3RyaW5nKGJhb3MudG9CeXRlQXJyYXkoKSwgXFxcIlVURi04XFxcIik7XFxuICAgICAgICAgICAgcmV0dXJuIEJhc2U2NC5nZXREZWNvZGVyKCkuZGVjb2RlKGI2NFRleHQyKTtcXG4gICAgICAgIH1cXG4gICAgfTtcXG5cXG5cXG4gICAgZnVuY3Rpb24gVF94b3IoYkFycikge1xcbiAgICAgICAgYkFyciA9IEFycmF5LmZyb20oYkFycik7XFxuICAgICAgICBsZXQgbGVuID0gYkFyci5sZW5ndGg7XFxuICAgICAgICBsZXQgYSA9IG5ldyBVaW50OEFycmF5KGxlbik7XFxuICAgICAgICBsZXQgaSA9IDA7XFxuICAgICAgICB3aGlsZSAoaSA8IGxlbikge1xcbiAgICAgICAgICAgIGxldCBqID0gMFxcbiAgICAgICAgICAgIHdoaWxlIChqIDwgYnVma2V5bGVuICYmIGkgPCBsZW4pIHtcXG4gICAgICAgICAgICAgICAgYVtpXSA9IGJBcnJbaV0gXiBidWZrZXlbal1cXG4gICAgICAgICAgICAgICAgaSsrXFxuICAgICAgICAgICAgICAgIGorK1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiB3aW5kb3cwLmJ0b2EoU3RyaW5nLmZyb21DaGFyQ29kZS5hcHBseShudWxsLCBhKSk7XFxuICAgIH1cXG5cXG5cXG4gICAgbGV0IHBhcmFtcyA9IFxcXCJ1c2VyPTEyMzQ1LHdlYix3ZWIsd2ViJnJlcXVlc3Rlcj1sb2NhbGhvc3QmcmVxPTEmcmlkPU1V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ICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBfLnNvdXJjZWlkXFxuICAgICAgICAgICAgfSwgMSwgMSkpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwia3dfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyLCB0Mykge1xcbiAgICAgICAgbGV0IGxpc3QsIF87XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwOi8vZGF0YWNlbnRlci5rdXdvLmNuL2QuYz9jbWtleT1wbGlzdF9wbDIwMTImZnQ9bXVzaWMmcmVzZW5jPXV0ZjgmaWRzPVxcXCIgKyB0MSkpWzBdO1xcbiAgICAgICAgICAgICAgICBsZXQgUmVnID0gKGspID0+IHJlZyA9IF8uTl9NSU5GTy5tYXRjaChuZXcgUmVnRXhwKCdiaXRyYXRlOicgKyBrICsgJyxmb3JtYXQ6W14sXSssc2l6ZTooW147XSspJykpO1xcblxcbiAgICAgICAgICAgICAgICAvLyDkuIvovb1cXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYXJyID0gW107XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IDE7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBrIG9mIFsxMjgsIDMyMCwgMjAwMCwgNDAwMF0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUmVnKGspKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzW2ldICsgcmVnWzFdLnJlcGxhY2UoL1xcXFxzKm1iL2ksIFxcXCIgTUJcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJrd1xcXCIsIHQxLCBpLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCB0MSwgXyk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHZhciB1cmwsIGlpLCBscmM7XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MyAmJiBpaSA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChSZWcoNDAwMCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImt3XFxcIiwgdDEsIDMsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MyAmJiBpaSA9PSAyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChSZWcoMjAwMCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImt3XFxcIiwgdDEsIDIsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCkgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpaSA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0MyAmJiBpaSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChSZWcoMzIwKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgW3VybCwgbHJjLCBpaV0gPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia3dcXFwiLCB0MSwgMSwgXywgbHJjLCBpaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsKSBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlpID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnRwYXkgPT0gMSB8fCBfLmlzc2hvd3R5cGUgIT0gXFxcIjBcXFwiIHx8IF8uY2FjaGVfc3RhdHVzICE9IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJrd1xcXCIsIHQxLCAwLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1cmwgPSBhamF4KHBjYXBpLnJlcGxhY2UoLyhhcGlcXFxcLykvLCAnJDF2MS8nKSArIFxcXCJtdXNpYy9wbGF5VXJsP21pZD1cXFwiICsgdDEgKyBcXFwiJnR5cGU9bXVzaWMmXFxcIikudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBmZXRjaChcXFwiaHR0cHM6Ly9hbnRpc2VydmVyLmt1d28uY24vYW50aS5zP3R5cGU9Y29udmVydF91cmwmZm9ybWF0PW1wMyZyaWQ9XFxcIiArIHQxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwpIHJldHVybiBcXFwidG9hc3Q6Ly/ml6Dms5Xop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcblxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gU3RyaW5nKGdldExyYyh0MSwgdHJ1ZSkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9cXFxcPFxcXFxzKlxcXFwtP1xcXFxkK1xcXFxzKlxcXFwsXFxcXHMqXFxcXC0/XFxcXGQrXFxcXHMqXFxcXD4vZ2ksIFxcXCJcXFwiKTsgLy8g55uu5YmN5LiN5pSv5oyB6YCQ5a2X5q2M6K+NXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChscmNfZXJyMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7IC8vIOWkh+eUqFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBscmMgPSBhamF4KFxcXCJodHRwOi8vbS5rdXdvLmNuL25ld2g1L3NpbmdsZXMvc29uZ2luZm9hbmRscmM/bXVzaWNJZD1cXFwiICsgdDEgKyBcXFwiJlxcXCIpLmxyY2xpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHMgPSAoKF8udGltZSAtIDApICUgNjApLnRvRml4ZWQoMykucGFkU3RhcnQoNiwgJzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtID0gKChfLnRpbWUgLSBzKSAvIDYwKS50b0ZpeGVkKDApLnBhZFN0YXJ0KDIsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYFske219OiR7c31dYCArIF8ubGluZUx5cmljXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLmpvaW4oJ1xcXFxuJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAobHJjX2VycjIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHBjYXBpICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IF8uZGF0YSB8fCBfLmxpc3Q7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzInOiA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gaWYgKGlzVSA9PSAnZnJlZScpXFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwyKFxcXCJtdXNpY1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcIm11c2ljXFxcIiwgXFxcIiZ2aXB2ZXI9MVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYWJzbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBfIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIV8uU09OR05BTUUubWF0Y2goJ+eJh+autScpKSByZXR1cm4gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbWcsIHJpZCA9IF8uTVVTSUNSSUQuc3BsaXQoJ18nKVsxXSArICcnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8ud2ViX2FsYnVtcGljX3Nob3J0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vaW1nMi5rdXdvLmNuL3N0YXIvYWxidW1jb3Zlci9cXFwiICsgXy53ZWJfYWxidW1waWNfc2hvcnQucmVwbGFjZSgvXjEyMC8sICc1MDAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nID0gZmV0Y2goJ2h0dHA6Ly9hcnRpc3RwaWNzZXJ2ZXIua3V3by5jbi9waWMud2ViP3R5cGU9cmlkX3BpYyZwaWN0eXBlPXVybCZzaXplPTUwMCZyaWQ9JyArIHJpZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1nID09IFxcXCJOT19QSUNcXFwiICYmIF8ud2ViX2FydGlzdHBpY19zaG9ydCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwOi8vaW1nMS5rdXdvLmNuL3N0YXIvc3RhcmhlYWRzL1xcXCIgKyBfLndlYl9hcnRpc3RwaWNfc2hvcnQucmVwbGFjZSgvXjEyMC8sICc1MDAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5TT05HTkFNRSArICcgLSAnICsgXy5BUlRJU1QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy50cGF5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHJpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1cmwoJ1BsYXlMaXN0JykubWFwKCk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybDIoXFxcInBsYXlsaXN0XFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8uYWJzbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucGxheWxpc3RpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLlRPVEFMIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwOi8vZGF0YWNlbnRlci5rdXdvLmNuL2QuYz9jbWtleT1wbGlzdF9wbDIwMTImZnQ9bXVzaWMmcmVzZW5jPXV0ZjgmaWRzPVxcXCIgKyBrZXl3b3JkKSlbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChfLnRpdGxlIHx8IF8ubmFtZSkgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogZmV0Y2goJ2h0dHA6Ly9hcnRpc3RwaWNzZXJ2ZXIua3V3by5jbi9waWMud2ViP3R5cGU9cmlkX3BpYyZwaWN0eXBlPXVybCZzaXplPTUwMCZyaWQ9JyArIF8uaWQpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8udHBheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChwY2FwaSArIFxcXCJwbGF5bGlzdC9wbGF5TGlzdEluZm8/cGlkPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj0xJnJuPTEmXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuICAgIGxyYzogZ2V0THJjLFxcbiAgICBkZXM6IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgIHJldHVybiBleGVjdXRlV2ViUnVsZShcXFwiXFxcIiwgJC50b1N0cmluZygodCkgPT4ge1xcbiAgICAgICAgICAgIGNvbnN0IEJ1ZmZlciA9IHtcXG4gICAgICAgICAgICAgICAgZnJvbTogdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByID0gdC5sZW5ndGg7XFxuICAgICAgICAgICAgICAgICAgICBlID0gbmV3IFVpbnQ4QXJyYXkocik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKG4gPSAwOyBuIDwgcjsgbisrKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVbbl0gPSB0LmNoYXJDb2RlQXQobik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJhbmdlID0gdCA9PiBBcnJheS5mcm9tKG5ldyBBcnJheSh0KS5rZXlzKCkpO1xcbiAgICAgICAgICAgIExvbmcgPSB0ID0+IHtcXG4gICAgICAgICAgICAgICAgY29uc3QgciA9IEJpZ0ludCh0KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHRvU3RyaW5nOiAoKSA9PiByLnRvU3RyaW5nKCksXFxuICAgICAgICAgICAgICAgICAgICBpc05lZ2F0aXZlOiAoKSA9PiByIDwgMCxcXG4gICAgICAgICAgICAgICAgICAgIG5vdDogKCkgPT4gTG9uZyh+ciksXFxuICAgICAgICAgICAgICAgICAgICBsb3c6IE51bWJlcihyKSxcXG4gICAgICAgICAgICAgICAgICAgIG9yOiB0ID0+IExvbmcociB8IEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICB4b3I6IHQgPT4gTG9uZyhyIF4gQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIGFuZDogdCA9PiBMb25nKHIgJiBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgZXF1YWxzOiB0ID0+IHIgPT09IEJpZ0ludCh0KSxcXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0TGVmdDogdCA9PiBMb25nKHIgPDwgQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIHNoaWZ0UmlnaHQ6IHQgPT4gTG9uZyhyID4+IEJpZ0ludCh0KSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgTG9uZ0FycmF5ID0gdCA9PiB0Lm1hcCh0ID0+IExvbmcodCkpO1xcblxcblxcbiAgICAgICAgICAgIGFycmF5RSA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDMxLCAwLCAxLCAyLCAzLCA0LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDMsIDQsIDUsIDYsIDcsIDgsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNywgOCwgOSwgMTAsIDExLCAxMiwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAxMSwgMTIsIDEzLCAxNCwgMTUsIDE2LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDE1LCAxNiwgMTcsIDE4LCAxOSwgMjAsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTksIDIwLCAyMSwgMjIsIDIzLCAyNCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyMywgMjQsIDI1LCAyNiwgMjcsIDI4LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDI3LCAyOCwgMjksIDMwLCAzMSwgMzAsIC0xLCAtMVxcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlJUCA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDU3LCA0OSwgNDEsIDMzLCAyNSwgMTcsIDksIDEsXFxuICAgICAgICAgICAgICAgIDU5LCA1MSwgNDMsIDM1LCAyNywgMTksIDExLCAzLFxcbiAgICAgICAgICAgICAgICA2MSwgNTMsIDQ1LCAzNywgMjksIDIxLCAxMywgNSxcXG4gICAgICAgICAgICAgICAgNjMsIDU1LCA0NywgMzksIDMxLCAyMywgMTUsIDcsXFxuICAgICAgICAgICAgICAgIDU2LCA0OCwgNDAsIDMyLCAyNCwgMTYsIDgsIDAsXFxuICAgICAgICAgICAgICAgIDU4LCA1MCwgNDIsIDM0LCAyNiwgMTgsIDEwLCAyLFxcbiAgICAgICAgICAgICAgICA2MCwgNTIsIDQ0LCAzNiwgMjgsIDIwLCAxMiwgNCxcXG4gICAgICAgICAgICAgICAgNjIsIDU0LCA0NiwgMzgsIDMwLCAyMiwgMTQsIDZcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5SVBfMSA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDM5LCA3LCA0NywgMTUsIDU1LCAyMywgNjMsIDMxLFxcbiAgICAgICAgICAgICAgICAzOCwgNiwgNDYsIDE0LCA1NCwgMjIsIDYyLCAzMCxcXG4gICAgICAgICAgICAgICAgMzcsIDUsIDQ1LCAxMywgNTMsIDIxLCA2MSwgMjksXFxuICAgICAgICAgICAgICAgIDM2LCA0LCA0NCwgMTIsIDUyLCAyMCwgNjAsIDI4LFxcbiAgICAgICAgICAgICAgICAzNSwgMywgNDMsIDExLCA1MSwgMTksIDU5LCAyNyxcXG4gICAgICAgICAgICAgICAgMzQsIDIsIDQyLCAxMCwgNTAsIDE4LCA1OCwgMjYsXFxuICAgICAgICAgICAgICAgIDMzLCAxLCA0MSwgOSwgNDksIDE3LCA1NywgMjUsXFxuICAgICAgICAgICAgICAgIDMyLCAwLCA0MCwgOCwgNDgsIDE2LCA1NiwgMjRcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5THMgPSBbXFxuICAgICAgICAgICAgICAgIDEsIDEsIDIsIDIsIDIsIDIsIDIsIDIsXFxuICAgICAgICAgICAgICAgIDEsIDIsIDIsIDIsIDIsIDIsIDIsIDFcXG4gICAgICAgICAgICBdXFxuICAgICAgICAgICAgYXJyYXlMc01hc2sgPSBMb25nQXJyYXkoWzAsIDEwNDg1NzcsIDMxNDU3MzFdKVxcbiAgICAgICAgICAgIGFycmF5TWFzayA9IHJhbmdlKDY0KS5tYXAodCA9PiBNYXRoLnBvdygyLCB0KSlcXG4gICAgICAgICAgICBhcnJheU1hc2tbNjNdICo9IC0xXFxuICAgICAgICAgICAgYXJyYXlQID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgMTUsIDYsIDE5LCAyMCwgMjgsIDExLCAyNywgMTYsXFxuICAgICAgICAgICAgICAgIDAsIDE0LCAyMiwgMjUsIDQsIDE3LCAzMCwgOSxcXG4gICAgICAgICAgICAgICAgMSwgNywgMjMsIDEzLCAzMSwgMjYsIDIsIDgsXFxuICAgICAgICAgICAgICAgIDE4LCAxMiwgMjksIDUsIDIxLCAxMCwgMywgMjRcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5UENfMSA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDU2LCA0OCwgNDAsIDMyLCAyNCwgMTYsIDgsIDAsXFxuICAgICAgICAgICAgICAgIDU3LCA0OSwgNDEsIDMzLCAyNSwgMTcsIDksIDEsXFxuICAgICAgICAgICAgICAgIDU4LCA1MCwgNDIsIDM0LCAyNiwgMTgsIDEwLCAyLFxcbiAgICAgICAgICAgICAgICA1OSwgNTEsIDQzLCAzNSwgNjIsIDU0LCA0NiwgMzgsXFxuICAgICAgICAgICAgICAgIDMwLCAyMiwgMTQsIDYsIDYxLCA1MywgNDUsIDM3LFxcbiAgICAgICAgICAgICAgICAyOSwgMjEsIDEzLCA1LCA2MCwgNTIsIDQ0LCAzNixcXG4gICAgICAgICAgICAgICAgMjgsIDIwLCAxMiwgNCwgMjcsIDE5LCAxMSwgM1xcbiAgICAgICAgICAgIF0pXFxuICAgICAgICAgICAgYXJyYXlQQ18yID0gTG9uZ0FycmF5KFtcXG4gICAgICAgICAgICAgICAgMTMsIDE2LCAxMCwgMjMsIDAsIDQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMiwgMjcsIDE0LCA1LCAyMCwgOSwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyMiwgMTgsIDExLCAzLCAyNSwgNywgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAxNSwgNiwgMjYsIDE5LCAxMiwgMSwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA0MCwgNTEsIDMwLCAzNiwgNDYsIDU0LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDI5LCAzOSwgNTAsIDQ0LCAzMiwgNDcsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNDMsIDQ4LCAzOCwgNTUsIDMzLCA1MiwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICA0NSwgNDEsIDQ5LCAzNSwgMjgsIDMxLCAtMSwgLTFcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIG1hdHJpeE5TQm94ID0gW1xcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxNCwgNCwgMywgMTUsIDIsIDEzLCA1LCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDE0LCA2LCA5LCAxMSwgMiwgMCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDEwLCAxMiwgMTUsIDYsIDksIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgOCwgMTIsIDcsIDgsIDExLCA3LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMCwgMTUsIDEwLCA1LCAxNCwgNCwgOSwgMTAsXFxuICAgICAgICAgICAgICAgICAgICA3LCA4LCAxMiwgMywgMTMsIDEsIDMsIDYsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMTIsIDYsIDExLCAyLCA5LCA1LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMiwgMTEsIDE0LCAxLCA3LCA4LCAxM1xcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMCwgOSwgNSwgNiwgMTAsIDEyLCA5LFxcbiAgICAgICAgICAgICAgICAgICAgOCwgNywgMiwgMTIsIDMsIDEzLCA1LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMTQsIDcsIDgsIDExLCA0LCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDExLCAxMywgNiwgNCwgMSwgMTAsIDE1LFxcbiAgICAgICAgICAgICAgICAgICAgMywgMTMsIDEyLCAxMSwgMTUsIDMsIDYsIDAsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxMCwgMSwgNywgOCwgNCwgMTEsIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDgsIDAsIDYsIDIsIDE1LCA5LCA1LFxcbiAgICAgICAgICAgICAgICAgICAgNywgMSwgMTAsIDEyLCAxNCwgMiwgNSwgOVxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxMCwgMTMsIDEsIDExLCA2LCA4LCAxMSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDksIDQsIDEyLCAyLCAxNSwgMywgMiwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAwLCA2LCAxMywgMSwgMywgMTUsIDQsIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDksIDcsIDEyLCA1LCAwLCA4LCA3LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDEsIDIsIDQsIDMsIDYsIDEyLCAxMSxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDEzLCA1LCAxNCwgNiwgOCwgMTUsIDIsXFxuICAgICAgICAgICAgICAgICAgICA3LCAxMCwgOCwgMTUsIDQsIDksIDExLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgOSwgMCwgMTQsIDMsIDEwLCA3LCAxLCAxMlxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICA3LCAxMCwgMSwgMTUsIDAsIDEyLCAxMSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCA5LCA4LCAzLCA5LCA3LCA0LCA4LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDYsIDIsIDEsIDYsIDExLCAxMiwgMixcXG4gICAgICAgICAgICAgICAgICAgIDMsIDAsIDUsIDE0LCAxMCwgMTMsIDE1LCA0LFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDMsIDQsIDksIDYsIDEwLCAxLCAxMixcXG4gICAgICAgICAgICAgICAgICAgIDExLCAwLCAyLCA1LCAwLCAxMywgMTQsIDIsXFxuICAgICAgICAgICAgICAgICAgICA4LCAxNSwgNywgNCwgMTUsIDEsIDEwLCA3LFxcbiAgICAgICAgICAgICAgICAgICAgNSwgNiwgMTIsIDExLCAzLCA4LCA5LCAxNFxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAyLCA0LCA4LCAxNSwgNywgMTAsIDEzLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMywgMTIsIDExLCA3LCAxNCwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDEyLCAyLCA1LCA5LCAxMCwgMTMsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxLCAxMSwgMTUsIDUsIDYsIDgsIDksIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMTQsIDExLCA1LCA2LCA0LCAxLCAzLCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDEyLCAxNSwgMCwgMTMsIDIsIDgsIDUsXFxuICAgICAgICAgICAgICAgICAgICAxMSwgOCwgMCwgMTUsIDcsIDE0LCA5LCA0LFxcbiAgICAgICAgICAgICAgICAgICAgMTIsIDcsIDEwLCA5LCAxLCAxMywgNiwgM1xcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxMiwgOSwgMCwgNywgOSwgMiwgMTQsIDEsXFxuICAgICAgICAgICAgICAgICAgICAxMCwgMTUsIDMsIDQsIDYsIDEyLCA1LCAxMSxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDE0LCAxMywgMCwgMiwgOCwgNywgMTMsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgNSwgNCwgMTAsIDgsIDMsIDExLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgMTAsIDQsIDYsIDExLCA3LCA5LCAwLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMiwgMTMsIDEsIDksIDE1LCAzLCA4LFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDMsIDEsIDE0LCAxMiwgNSwgMTEsIDAsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMiwgMTQsIDcsIDUsIDEwLCA4LCAxM1xcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAzLCAxMCwgMTUsIDEyLCA1LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTEsIDksIDYsIDgsIDcsIDYsIDksXFxuICAgICAgICAgICAgICAgICAgICAxMSwgNCwgMTIsIDE1LCAwLCAzLCAxMCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCAxMywgNywgOCwgMTMsIDE0LCAxLCAyLFxcbiAgICAgICAgICAgICAgICAgICAgMTMsIDYsIDE0LCA5LCA0LCAxLCAyLCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDExLCAxMywgNSwgMCwgMSwgMTAsIDgsIDMsXFxuICAgICAgICAgICAgICAgICAgICAwLCAxMSwgMywgNSwgOSwgNCwgMTUsIDIsXFxuICAgICAgICAgICAgICAgICAgICA3LCA4LCAxMiwgMTUsIDEwLCA3LCA2LCAxMlxcbiAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgICAgICAxMywgNywgMTAsIDAsIDYsIDksIDUsIDE1LFxcbiAgICAgICAgICAgICAgICAgICAgOCwgNCwgMywgMTAsIDExLCAxNCwgMTIsIDUsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMSwgOSwgNiwgMTUsIDEyLCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMTQsIDEzLCAxLCAyLCA3LCA4LFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMiwgMTIsIDE1LCAxMCwgNCwgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAxNCwgNiwgOSwgNywgOCwgOSwgNixcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAxLCA1LCAxMiwgMywgMTAsIDE0LCA1LFxcbiAgICAgICAgICAgICAgICAgICAgOCwgNywgMTEsIDAsIDQsIDEzLCAyLCAxMVxcbiAgICAgICAgICAgICAgICBdXFxuICAgICAgICAgICAgXVxcbiAgICAgICAgICAgIGJpdFRyYW5zZm9ybSA9ICh0LCByLCBlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBuID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJhbmdlKHIpLmZvckVhY2gociA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB0W3JdLmlzTmVnYXRpdmUoKSB8fCBlLmFuZChhcnJheU1hc2tbdFtyXS5sb3ddKS5lcXVhbHMoMCkgfHwgKG4gPSBuLm9yKGFycmF5TWFza1tyXSkpXFxuICAgICAgICAgICAgICAgIH0pLCBuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIERFUzY0ID0gKHQsIHIpID0+IHtcXG4gICAgICAgICAgICAgICAgZSA9IFtdLFxcbiAgICAgICAgICAgICAgICAgICAgbiA9IFtdO1xcbiAgICAgICAgICAgICAgICBmID0gYml0VHJhbnNmb3JtKGFycmF5SVAsIDY0LCByKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5bMF0gPSBmLmFuZCg0Mjk0OTY3Mjk1KSxcXG4gICAgICAgICAgICAgICAgICAgIG5bMV0gPSBmLmFuZCgtNDI5NDk2NzI5Nikuc2hpZnRSaWdodCgzMiksXFxuICAgICAgICAgICAgICAgICAgICByYW5nZSgxNikuZm9yRWFjaChyID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZiA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IExvbmcoblsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBiaXRUcmFuc2Zvcm0oYXJyYXlFLCA2NCwgaSkueG9yKHRbcl0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5nZSg4KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZVt0XSA9IGkuc2hpZnRSaWdodCg4ICogdCkuYW5kKDI1NSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlKDgpLnJldmVyc2UoKS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiA9IGYuc2hpZnRMZWZ0KDQpLm9yKG1hdHJpeE5TQm94W3RdW2VbdF1dKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGJpdFRyYW5zZm9ybShhcnJheVAsIDMyLCBmKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbyA9IExvbmcoblswXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5bMF0gPSBMb25nKG5bMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuWzFdID0gby54b3IoaSlcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbi5yZXZlcnNlKCksXFxuICAgICAgICAgICAgICAgICAgICBmID0gblsxXS5zaGlmdExlZnQoMzIpLmFuZCgtNDI5NDk2NzI5Nikub3IoblswXS5hbmQoNDI5NDk2NzI5NSkpLFxcbiAgICAgICAgICAgICAgICAgICAgZiA9IGJpdFRyYW5zZm9ybShhcnJheUlQXzEsIDY0LCBmKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzdWJLZXlzID0gKHQsIHIpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG4gPSBiaXRUcmFuc2Zvcm0oYXJyYXlQQ18xLCA1NiwgdCk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKDE2KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbiA9IG4uYW5kKGFycmF5THNNYXNrW2FycmF5THNbdF1dKS5zaGlmdExlZnQoMjggLSBhcnJheUxzW3RdKS5vcihuLmFuZChhcnJheUxzTWFza1thcnJheUxzW3RdXS5ub3QoKSkuc2hpZnRSaWdodChhcnJheUxzW3RdKSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgclt0XSA9IGJpdFRyYW5zZm9ybShhcnJheVBDXzIsIDY0LCBuKVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBiID0gZnVuY3Rpb24odCkge1xcbiAgICAgICAgICAgICAgICBjb25zdCByID0gQnVmZmVyLmZyb20oXFxcInlsenN4a3dtXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBuID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UoOCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIG4gPSBMb25nKHJbdF0pLnNoaWZ0TGVmdCg4ICogdCkub3IobilcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IG8gPSBNYXRoLmZsb29yKHQubGVuZ3RoIC8gOCksXFxuICAgICAgICAgICAgICAgICAgICBpID0gcmFuZ2UoMTYpLm1hcCgoKSA9PiBMb25nKDApKTtcXG4gICAgICAgICAgICAgICAgc3ViS2V5cyhuLCBpKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgZiA9IHJhbmdlKG8pLm1hcCgoKSA9PiBMb25nKDApKTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UobykuZm9yRWFjaChyID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlKDgpLmZvckVhY2goZSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZltyXSA9IExvbmcodFtlICsgOCAqIHJdKS5zaGlmdExlZnQoOCAqIGUpLm9yKGZbcl0pXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgY29uc3QgcyA9IFtdO1xcbiAgICAgICAgICAgICAgICByYW5nZShvKS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc1t0XSA9IERFUzY0KGksIGZbdF0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjb25zdCB1ID0gdC5zbGljZSg4ICogbyk7XFxuICAgICAgICAgICAgICAgIGxldCBoID0gTG9uZygwKTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UodC5sZW5ndGggJSA4KS5mb3JFYWNoKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaCA9IExvbmcodVt0XSkuc2hpZnRMZWZ0KDggKiB0KS5vcihoKVxcbiAgICAgICAgICAgICAgICB9KSwgc1tvXSA9IERFUzY0KGksIGgpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBhID0gW107XFxuICAgICAgICAgICAgICAgIGxldCBjID0gMDtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHMuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJhbmdlKDgpLmZvckVhY2gociA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYVtjXSA9IHQuc2hpZnRSaWdodCg4ICogcikuYW5kKDI1NSkubG93O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGMrK1xcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSksIGE7XFxuICAgICAgICAgICAgfShCdWZmZXIuZnJvbSh0KSk7XFxuICAgICAgICAgICA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90cmVlXFxcIikubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlmICghL+S5kMK35qacLy50ZXN0KF8uY29sdW1uVGl0bGUpKSB7XFxuICAgICAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW18uY29sdW1uVGl0bGVdID0gXy5iaWxsQm9hcmRWb3MubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uY29sdW1uVGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczonICsgXy5jb2x1bW5TbWFsbFBpYyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnBhdGhOYW1lXFxuICAgICAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJtZ19pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIGxldCBsaXN0LCBfO1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOivpuaDhVxcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJtZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIyXFxcIiwgdDEsIFxcXCJjb3B5cmlnaHRJZFxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgZiA9IF8uY29kZVJhdGU7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOS4i+i9vVxcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBhcnIgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ID0gXy5uZXdSYXRlRm9ybWF0cztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLlBRKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdICsgU2l6ZSh0WzBdLnNpemUgfHwgdFswXS5hbmRyb2lkU2l6ZSB8fCB0WzBdLmlvc1NpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLkhRKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdICsgU2l6ZSh0WzFdLnNpemUgfHwgdFsxXS5hbmRyb2lkU2l6ZSB8fCB0WzFdLmlvc1NpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLlNRKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZSh0WzJdLnNpemUgfHwgdFsyXS5hbmRyb2lkU2l6ZSB8fCB0WzJdLmlvc1NpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmLlpRKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzRdICsgU2l6ZSh0WzNdLnNpemUgfHwgdFszXS5hbmRyb2lkU2l6ZSB8fCB0WzNdLmlvc1NpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJkb3duXFxcIiwgXFxcIm1nXFxcIiwgdDEsIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBfKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdmFyIHVybCwgaWksIGxyYyA9IF8ubHJjVXJsO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlpID0gZ2V0SXRlbSgncGxheV9wbGF0Zm9ybScsICcwJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzMnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLlpRKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJtZ1xcXCIsIHQxLCAzLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLlNRKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJtZ1xcXCIsIHQxLCAyLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnMjogJyArIGlpICsgJzonICsgdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpaSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLkhRKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdXJsLCBscmMsIGlpXSA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJtZ1xcXCIsIHQxLCAxLCBfLCBscmMsIGlpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwpIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWkgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udmlwVHlwZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFt1cmwsIGxyYywgaWldID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcIm1nXFxcIiwgdDEsIDAsIF8sIGxyYywgaWkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY24vbWlndS9yZW1vdGluZy9jbXNfZGV0YWlsX3RhZz9jcGlkPVxcXCIgKyB0MSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly9tLm11c2ljLm1pZ3UuY24vdjMvXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHJjID0gX18ubHlyaWNMcmMgfHwgbHJjO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBfXy5saXNRcSB8fCBfXy5saXN0ZW5Vcmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghdXJsKSByZXR1cm4gXFxcInRvYXN0Oi8v5peg5rOV6Kej5p6QXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIGlmICghbHJjKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vbXVzaWMubWlndS5jbi92My9hcGkvbXVzaWMvYXVkaW9QbGF5ZXIvZ2V0THlyaWM/Y29weXJpZ2h0SWQ9XFxcIiArIHQxLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly9hcHAuYy5uZi5taWd1LmNuL1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5seXJpYztcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHVyaSk7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBfLml0ZW1zIHx8IF9bMF0uaXRlbXM7XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSB8fCBfLnRpdGxlIHx8IF8ucGxheUxpc3ROYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyB8fCBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWQgfHwgXy5wbGF5TGlzdElkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIF8udG90YWwgfHwgKChNWV9QQUdFIC0gMSkgKiAzMCArIGxpc3QubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGVuID0gYWpheChgcGxheWxpc3QvaW5mbz9zb25nTGlzdElkPSR7dDF9YCkuY29udGVudENvdW50O1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoYHBsYXlsaXN0L3NvbmdzSW5mbz9wYWx5bGlzdElkPSR7dDF9YCwgbGVuKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIF8gPSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtczogW11cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBfID0gYWpheChgYmlsbGJvYXJkL2hvbWU/cGF0aE5hbWU9JHt0MX1gKS5zb25ncztcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodDIpIHJldHVybiBfLml0ZW1zO1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5pdGVtcy5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgaWYgKF8uZnVsbFNvbmcpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLnNpbmdlcnMgPyAnIC0gJyArIF8uc2luZ2Vycy5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6ICcnKSxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8ubWVkaXVtUGljLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBfLmZ1bGxTb25nLnZpcEZsYWcsXFxuICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UpIHtcXG4gICAgICAgIGxldCBfO1xcbiAgICAgICAgaWYgKGlzVSAhPSBcXFwidXJsXFxcIikge1xcbiAgICAgICAgICAgIGxldCBsaXN0LCBfXyA9IHtcXG4gICAgICAgICAgICAgICAgbGliOiAoXykgPT4gdHJ1ZSxcXG4gICAgICAgICAgICAgICAgcGFpZDogKF8pID0+IF8uZnVsbFNvbmcudmlwRmxhZyA9PSAnMScsXFxuICAgICAgICAgICAgICAgIGZyZWU6IChfKSA9PiBfLmZ1bGxTb25nLnZpcEZsYWcgPT0gJzAnXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBsZXQgc3VybCA9IChzdHlwZSwgZXJyaSkgPT4ge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFqYXgoXFxcInNlYXJjaC9cXFwiICsgc3R5cGUgKyBcXFwiP3RleHQ9XFxcIiArIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnJpIDwgMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdXJsKHN0eXBlLCBlcnJpICsgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBbXTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHN1cmwoJ3NvbmcnLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLml0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHIxID0gZ2V0TXlWYXIoJ3NlYXJjaF9kb3duJywgJzAnKSA9PSAnMScgPyAyIDogMTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmZ1bGxTb25nICYmIF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLnNpbmdlcnMgPyAnIC0gJyArIF8uc2luZ2Vycy5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6ICcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8ubWVkaXVtUGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLmZ1bGxTb25nLnZpcEZsYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgnc29uZ0xpc3QnLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBfLml0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBfLnRvdGFsIHx8ICgoTVlfUEFHRSAtIDEpICogMzAgKyBsaXN0Lmxlbmd0aCk7XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcIjJcXFwiLCBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5zaW5nZXIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmFsYnVtSW1nc1swXS5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy52aXBUeXBlID8gMSA6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5jb3B5cmlnaHRJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoYHBsYXlsaXN0L2luZm8/c29uZ0xpc3RJZD0ke2tleXdvcmR9YCk7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ucGxheUxpc3ROYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucGxheUxpc3RJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIGFqYXg6IGFqYXgsXFxuICAgIGFqYXgyOiBmdW5jdGlvbihyZXNvdXJjZVR5cGUsIHJlc291cmNlSWQsIGNvcHlyaWdodElkKSB7IC8vIGMubXVzaWNhcHAubWlndS5jblxcbiAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly9hcHAuYy5uZi5taWd1LmNuL01JR1VNMi4wL3YxLjAvY29udGVudC9yZXNvdXJjZWluZm8uZG8/bmVlZFNpbXBsZT0wMSZyZXNvdXJjZVR5cGU9XFxcIiArIHJlc291cmNlVHlwZSArIFxcXCImXFxcIiArIChjb3B5cmlnaHRJZCB8fCBcXFwicmVzb3VyY2VJZFxcXCIpICsgXFxcIj1cXFwiICsgcmVzb3VyY2VJZCkpLnJlc291cmNlWzBdO1xcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4p27NXNcIixcInBhdGhcIjpcIjVzXCIsXCJydWxlXCI6XCJldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILph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gICAgICAgICAgIGxldCBnZXRNdXNpY0luZm8gPSB1VHlwZSA9PiBhamF4KGBzb25nLyR7dVR5cGV9P3NvbmdpZD0ke3QxfSZzb25ndHlwZT0ke3R5cGV9YCk7XFxuICAgICAgICAgICAgICAgIF8gPSBnZXRNdXNpY0luZm8oXFxcImdldFNvbmdVcmxcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyMiA9IFtdO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLmxxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdICsgU2l6ZShfLmxxc2l6ZSkpLCBhcnIyLnB1c2goXy5scXVybCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXy5ocXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoXy5ocXNpemUpKSwgYXJyMi5wdXNoKF8uaHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uc3F1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10gKyBTaXplKF8uc3FzaXplKSksIGFycjIucHVzaChfLnNxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCBhcnIyKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIGFycjJbaV07XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIGFycjIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICB2YXIgdHlwZTIgPSB7XFxuICAgICAgICAgICAgICAgICAgICB5YzogMSxcXG4gICAgICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICAgICAgYno6IDNcXG4gICAgICAgICAgICAgICAgfVt0eXBlXTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGBodHRwOi8vc2VydmljZS41c2luZy5rdWdvdS5jb20vc29uZy9kZXRhaWw/c29uZ0lkPSR7dDF9JnNvbmdUeXBlPSR7dHlwZTJ9YDtcXG4gICAgICAgICAgICAgICAgdmFyIGlpLCBscmMgPSBKU09OLnBhcnNlKGZldGNoUEModXJsKSkuZGF0YS5seXJpY3M7XFxuICAgICAgICAgICAgICAgIGlmICghbHJjKSBscmMgPSBnZXRNdXNpY0luZm8oXFxcIm5ld2dldFxcXCIpLmR5bmFtaWNXb3JkcztcXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5zcXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10pLCBhcnIyLnB1c2goXy5zcXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uaHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdKSwgYXJyMi5wdXNoKF8uaHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmxxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSksIGFycjIucHVzaChfLmxxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmhxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSksIGFycjIucHVzaChfLmhxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5scXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0pLCBhcnIyLnB1c2goXy5scXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uc3F1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdKSwgYXJyMi5wdXNoKF8uc3F1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5scXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0pLCBhcnIyLnB1c2goXy5scXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uaHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdKSwgYXJyMi5wdXNoKF8uaHF1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSksIGFycjIucHVzaChfLnNxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IGFycixcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IGFycjIubWFwKHUgPT4gdSArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IFN0cmluZyhscmMpLnJlcGxhY2UoLzxiclxcXFwvPz4vZ2ksIFxcXCJcXFxcblxcXCIpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy/pppbpobVcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChcXFwiaHR0cDovLzVzaW5nLmt1Z291LmNvbS9nZC9nZExpc3Q/JnRhZ05hbWU9XFxcIiArIHQxICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJi5hbGJ1bVxcXCIpO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcIi5qeF9uYW1lJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaW1nID0gcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwxJiZzb25nbGlzdGlkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogenlpZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIChNWV9QQUdFIC0gMSkgKiAxNiArIGxpc3QubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJzb25nL2dldHNvbmdsaXN0c29uZz9pZD1cXFwiICsgdDEpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgXyA9IFtdO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIGlmICh0MSA9PSBcXFwibGlzdDI1XFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHVyaSA9IFxcXCJzb25nbGlzdC9ob3RzdXBwb3J0cmFua2xpc3Q/cGFnZT1cXFwiO1xcbiAgICAgICAgICAgICAgICBlbHNlIGlmICh0MSA9PSBcXFwieWNcXFwiIHx8IHQxID09IFxcXCJmY1xcXCIgfHwgdDEgPT0gXFxcImxpc3QyM1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICB1cmkgPSBcXFwicmFuay9kZXRhaWw/aWQ9XFxcIiArIHQxICsgXFxcIiZwYWdlaW5kZXg9XFxcIjtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgdXJpID0gXFxcInJhbmsvc3R5bGVyYW5rP3N0eWxlPVxcXCIgKyB0MSArIFxcXCImcGFnZWluZGV4PVxcXCI7XFxuICAgICAgICAgICAgICAgIF8gPSBhamF4KHVyaSArIE1ZX1BBR0UgKyBcXFwiJnBhZ2VTaXplPTMwXFxcIik7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHQyKSByZXR1cm4gXy5zb25ncyB8fCBfO1xcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgKF8uc29uZ3MgfHwgXykubWFwKF8gPT4ge1xcbiAgICAgICAgICAgIGlmIChfLlNUID09IHVuZGVmaW5lZCB8fCBfLlNUID4gMCkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogKF8uc29uZ05hbWUgfHwgXy5TTikgKyAnIC0gJyArIChfLm5pY2tuYW1lIHx8IF8udXNlci5OTiksXFxuICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSB8fCAoXy51c2VyID8gXy51c2VyLkkgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8uc29uZ0tpbmQgfHwgXy5TSyxcXG4gICAgICAgICAgICAgICAgenlpZDogKF8uc29uZ0lkIHx8IF8uSUQpICsgJyMnICsgKF8uc29uZ0tpbmQgfHwgXy5TSylcXG4gICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UpIHtcXG4gICAgICAgIGxldCBfO1xcbiAgICAgICAgaWYgKGlzVSAhPSBcXFwidXJsXFxcIikge1xcbiAgICAgICAgICAgIGxldCBsaXN0LCBmaWx0ZXIgPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogMCxcXG4gICAgICAgICAgICAgICAgeWM6IDEsXFxuICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICBiejogM1xcbiAgICAgICAgICAgIH1baXNVXTtcXG4gICAgICAgICAgICBsZXQgc3VybCA9IChzdHlwZSkgPT4gSlNPTi5wYXJzZShmZXRjaFBDKFxcXCJodHRwOi8vc2VhcmNoLjVzaW5nLmt1Z291LmNvbS9ob21lL2pzb24/a2V5d29yZD1cXFwiICsga2V5d29yZCArIFxcXCImc29ydD0xJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJmZpbHRlcj1cXFwiICsgZmlsdGVyICsgXFxcIiZ0eXBlPVxcXCIgKyBzdHlwZSkpO1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBfID0gc3VybCgnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IF8ubGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByMSA9IGdldE15VmFyKCdzZWFyY2hfZG93bicsICcwJykgPT0gJzEnID8gMiA6IDE7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIEpTT04ucGFyc2UoZmV0Y2hQQyhgaHR0cDovL3NlcnZpY2UuNXNpbmcua3Vnb3UuY29tL3NvbmcvZGV0YWlsP3NvbmdJZD0ke18uc29uZ0lkfSZzb25nVHlwZT0ke18udHlwZX1gKSkuZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5uaWNrTmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnR5cGVFbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25nSWQgKyAnIycgKyBfLnR5cGVFbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBzdXJsKCcxJyk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpY3R1cmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdMaXN0SWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXy5wYWdlSW5mby50b3RhbENvdW50O1xcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBbdDEsIHQyXSA9IGtleXdvcmQuc3BsaXQoJyMnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0MyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB5YzogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYzogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICBiejogM1xcbiAgICAgICAgICAgICAgICAgICAgfVt0Ml07XFxuICAgICAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaFBDKGBodHRwOi8vc2VydmljZS41c2luZy5rdWdvdS5jb20vc29uZy9kZXRhaWw/c29uZ0lkPSR7dDF9JnNvbmdUeXBlPSR7dDN9YCkpLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc29uZ05hbWUgKyAnIC0gJyArIF8ubmlja05hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IHQyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGtleXdvcmRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJzb25nL2dldHNvbmdsaXN0P2lkPVxcXCIgKyBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5ULFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5QIHx8IF8udXNlci5sLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5JRFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIDA7XFxuICAgICAgICB9XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLinbxteVwiLFwicGF0aFwiOlwibXlcIixcInJ1bGVcIjpcImV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScpKS5ydWxlKTtcXG5jb25zdCB0aGlzX3BsYXRmb3JtID0gXFxcIm15XFxcIjtcXG5cXG5mdW5jdGlvbiBhamF4KHBhdGgsIGJvZHksIGhvc3QpIHtcXG4gICAgbGV0IHVybCA9IChob3N0IHx8IFxcXCJodHRwczovL2FwaVxcXCIpICsgXFxcIi5saXVtaW5neWUuY24vbS9hcGkvXFxcIiArIHBhdGg7XFxuICAgIGlmICghaG9zdCkge1xcbiAgICAgICAgYm9keS5fdCA9IERhdGUubm93KCkgKyAnJ1xcbiAgICAgICAgYm9keS50b2tlbiA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5uZXdfdG9rZW4oYm9keSk7XFxuICAgICAgICBpZiAoYm9keS5xdWFsaXR5ICE9IHVuZGVmaW5lZClcXG4gICAgICAgICAgICByZXR1cm4gYnVpbGRVcmwodXJsLCBib2R5KTtcXG4gICAgICAgIGJvZHkgPSBKU09OLnN0cmluZ2lmeShib2R5KTtcXG4gICAgfVxcbiAgICBsZXQgXyA9IEpTT04ucGFyc2UocG9zdCh1cmwsIHtcXG4gICAgICAgIGJvZHk6IGJvZHksXFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUEsXFxuICAgICAgICAgICAgJ09yaWdpbic6ICdodHRwczovL3Rvb2wubGl1bWluZ3llLmNuJyxcXG4gICAgICAgIH1cXG4gICAgfSkpO1xcbiAgICBfLmRhdGEuY29kZSA9IF8uY29kZTtcXG4gICAgXy5kYXRhLm1zZyA9IF8ubXNnO1xcbiAgICByZXR1cm4gXy5kYXRhO1xcbn1cXG4kLmV4cG9ydHMgPSB7XFxuXFxuICAgIGlUYWc6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgLyog5LiN6IO96Kej5p6Qd3nmrYzljZXkuoZcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmlUYWcoMSk7XFxuICAgICAgICAgICAgICAgIGlUYWdbXFxcIuaOkuihjFxcXCJdW1xcXCLlhajpg6hcXFwiXSA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KFxcXCJ0b3BsaXN0P1xcXCIpLmxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDMsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgICovXFxuICAgICAgICBsZXQgYXJyID0gXFxcIkFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaI1xcXCIuc3BsaXQoXFxcIlxcXCIpO1xcbiAgICAgICAgYXJyLnVuc2hpZnQoXFxcIuaOqOiNkFxcXCIpO1xcbiAgICAgICAgYXJyLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgIGlUYWdbdF0gPSB7fTtcXG4gICAgICAgICAgICBpVGFnW3RdW1xcXCJNeUZyZWVNUDNcXFwiXSA9IFN0cmluZyhpKTtcXG4gICAgICAgIH0pXFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwibXlfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IFt0c1swXSArIDk2LCB0c1sxXSArIDEyOCwgdHNbMl0gKyAzMjAsIHRzWzNdICsgMjAwMF07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdDIgPSBpbnB1dC5zcGxpdCgn44CRJylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gYWpheChcXFwibGlua1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5OiB0MlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHQxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgaWksIGxyYyA9IGFqYXgoXFxcImx5cmljXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHQxXFxuICAgICAgICAgICAgICAgIH0pLmxyYztcXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoaWkgPSBnZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgJzAnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gWzIwMDAsIDMyMCwgMTI4LCA5Nl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIgPSBbMzIwLCAxMjgsIDIwMDAsIDk2XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIgPSBbMTI4LCAzMjAsIDIwMDAsIDk2XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgbmFtZXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBhcnIubWFwKChxdWFsaXR5LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lc1tpXSA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICA5NjogdHNbMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgMTI4OiB0c1sxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzMjA6IHRzWzJdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDIwMDA6IHRzWzNdXFxuICAgICAgICAgICAgICAgICAgICB9W3F1YWxpdHldO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFqYXgoXFxcImxpbmtcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHF1YWxpdHk6IHF1YWxpdHkgKyAnJ1xcbiAgICAgICAgICAgICAgICAgICAgfSkgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IHVybHMsXFxuICAgICAgICAgICAgICAgICAgICBuYW1lczogbmFtZXMsXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy/pppbpobVcXG4gICAgICAgICAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdDEubWF0Y2goL1xcXFw/LykpIHQxID0gXFxcInRvcC9wbGF5bGlzdD9jYXQ9XFxcIiArIHQxICsgXFxcIiZcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZSgnd3k/cnVsZT3mrYzor43pgILphY0nKS5hamF4KHQxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChfLnJlc3VsdCB8fCBfLnBsYXlsaXN0cykubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsIHx8IF8ucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBfID0gYWpheChcXFwiYXJ0aXN0L2xpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBpbml0aWFsOiB0MSxcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2U6IE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGxpc3QgPSBfLmxpc3QgfHwgW107XFxuICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5waWMgfHwgJ2hpa2VyOi8vaW1hZ2VzL3J1bGVfdHlwZV9hdWRpbycsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLCAvLyAyXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIChNWV9QQUdFIC0gMSkgKiA5MCArIGxpc3QubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpXFxuICAgICAgICAgICAgICAgICAgICBfID0gYWpheChcXFwic2VhcmNoL3BsYXlsaXN0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiZFxcXCIgKyB0MVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIF8gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdDogW11cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSlcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KFxcXCJhcnRpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0OiBbXVxcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAg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ICAgICAgICAgICAgICAgbGV0IHN0eXBlMiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICd3eSc6ICdZUUQnLFxcbiAgICAgICAgICAgICAgICAgICAgJ2t3JzogJ1lRQicsXFxuICAgICAgICAgICAgICAgICAgICAnbWcnOiBpc05ldyA/ICdZUU0nIDogJ21pZ3UnLFxcbiAgICAgICAgICAgICAgICAgICAgJzF0JzogJzF0aW5nJyxcXG4gICAgICAgICAgICAgICAgICAgICdkYic6ICdkb3ViYW4nLFxcbiAgICAgICAgICAgICAgICAgICAgJzV5JzogJ3d1c2luZ3ljJyxcXG4gICAgICAgICAgICAgICAgICAgICc1Zic6ICd3dXNpbmdmYydcXG4gICAgICAgICAgICAgICAgfVtzdHlwZV07XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCwgYm9keSwgXywgcjEgPSBnZXRNeVZhcignc2VhcmNoX2Rvd24nLCAnMCcpID09ICcxJyA/IDIgOiAxO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzTmV3KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGFqYXgoJ3NlYXJjaCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogc3R5cGUyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0OiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBNWV9QQUdFLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2OiAnYmV0YSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0IHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgKF8uYXJ0aXN0ID8gJyAtICcgKyBfLmFydGlzdC5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6IFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCBfLmFsYnVtLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaGFzaCB8fCBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9IFxcXCJ0ZXh0PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZ0eXBlPVxcXCIgKyBzdHlwZTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keSA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5vbGRfZW5jb2RlKGJvZHkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBhamF4KCdzZWFyY2gnLCBib2R5LCBcXFwiaHR0cDovL2FwaTJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gXy5saXN0IHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBMYXp5KCdteScsIF8uaWQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsX200YSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF9tNGEgKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy51cmxfMTI4KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKF8udXJsXzEyOCArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1sxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF8zMjApXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfMzIwICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsX2ZsYWMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfZmxhYyArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1szXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyIHx8IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiB1cmxzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IG5hbWVzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QubGVuZ3RoID09IDAgJiYgXy5jb2RlID09IDQwMykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm1zZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXy5jb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi572R57uc5byC5bi477yM5pCc57Si5aSx6LSlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBlLnRvU3RyaW5nKCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2VhcmNoKDEsIGtleXdvcmQsIDEpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcblxcblxcbiAgICBuZXdfdG9rZW46IGZ1bmN0aW9uKGJvZHkpIHtcXG4gICAgICAgIFt0LCBlLCBBc10gPSBbXFxuICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICBcXFwiMjAyMzAzMjcuXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInlHejRuOVhFOXhZeTJPajVVYjdFNnU5YTVwNWFJV1pZZTUzT3JxNXdFNVVnbmpiV3EwNDEwV1R2bUxCTzFaMk5cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwicFc4amcvbWtlNmNPMUY0Q1R1YWlzd2haZlFHek15cTVOSlJMUFZJdkR4bEE3PUUzWXJTVW9IMGIyQlhLbjl0ZCtcXFwiXFxuICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICBbXFxuICAgICAgICAgICAgICAgIFxcXCIyMDIyMTIyMi5cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiSDJodXV3WGY4d045Q3g1SzNsRVFrZGc0VlRDSnFJYjQ0MFFRWDk1T1F5ZTFEMDkyMjkyQkk2cmdqRmdLOW1jeFxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJRc1ZtdDRycHFQRkp5V2NnMVkvU1JBdUxNVGVkQjM3NVhaTkRsT0d4ajZiMnZhbjk9QzhVaEhLRSt3aWZJa296MFxcXCJcXG4gICAgICAgICAgICBdXFxuICAgICAgICBdWzBdO1xcbiAgICAgICAgdmFyIGEsIGIsIGMsIGQsXFxuICAgICAgICAgICAgdiA9IDAsXFxuICAgICAgICAgICAgdGsgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciBlID0gZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KGJvZHkpKS5zcGxpdChcXFwiXFxcIilcXG4gICAgICAgICAgICAubWFwKCh0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0LmNoYXJDb2RlQXQoMCkgXiBlLmNoYXJDb2RlQXQoTWF0aC5mbG9vcihpICUgNjQpKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB2YXIgaSA9IGUubGVuZ3RoICUgM1xcbiAgICAgICAgZG8ge1xcbiAgICAgICAgICAgIGEgPSBlW3YrK11cXG4gICAgICAgICAgICBiID0gZVt2KytdXFxuICAgICAgICAgICAgYyA9IGVbdisrXVxcbiAgICAgICAgICAgIGQgPSBhIDw8IDE2IHwgYiA8PCA4IHwgY1xcbiAgICAgICAgICAgIGEgPSBkID4+IDE4ICYgNjNcXG4gICAgICAgICAgICBiID0gZCA+PiAxMiAmIDYzXFxuICAgICAgICAgICAgYyA9IGQgPj4gNiAmIDYzXFxuICAgICAgICAgICAgZCA9IGQgJiA2M1xcbiAgICAgICAgICAgIHRrICs9IEFzLmNoYXJBdChhKSArIEFzLmNoYXJBdChiKSArIEFzLmNoYXJBdChjKSArIEFzLmNoYXJBdChkKVxcbiAgICAgICAgfSB3aGlsZSAodiA8IGUubGVuZ3RoKVxcbiAgICAgICAgcmV0dXJuIHQgKyBtZDUoaSA9PSAwID8gdGsgOiB0ay5zbGljZSgwLCBpIC0gMykgKyAnPT09Jy5zbGljZShpIHx8IDMpKVxc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A9IHQgPSAwO1xcbiAgICAgICAgZm9yIChsZXQgaSBpbiBwKSB7XFxuICAgICAgICAgICAgSSA9IChJICsgcFtpXSArIGFbaSAlIDY0XS5jaGFyQ29kZUF0KCkpICUgMjU2XFxuICAgICAgICAgICAgWCA9IHBbaV1cXG4gICAgICAgICAgICBwW2ldID0gcFtJXVxcbiAgICAgICAgICAgIHBbSV0gPSBYXFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBpIGluIGUpIHtcXG4gICAgICAgICAgICBJID0gTnVtYmVyKGkpICsgMTtcXG4gICAgICAgICAgICBYID0gcFtJXTtcXG4gICAgICAgICAgICBiID0gKGIgKyBYKSAlIDI1NjtcXG4gICAgICAgICAgICBwW0ldID0gcFtiXTtcXG4gICAgICAgICAgICBwW2JdID0gWDtcXG4gICAgICAgICAgICBFICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoXFxuICAgICAgICAgICAgICAgIGVbaV0uY2hhckNvZGVBdCgpIF5cXG4gICAgICAgICAgICAgICAgcFsocFtJXSArIHBbYl0pICUgMjU2XVxcbiAgICAgICAgICAgICk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgWiA9IFxcXCJBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OS1fXFxcIjtcXG4gICAgICAgIGZvciAoXFxuICAgICAgICAgICAgdmFyIE8gPSBcXFwiXFxcIjsgRS5jaGFyQXQodCB8IDApIHx8IChaID0gJz0nLCB0ICUgMSk7IE8gKz0gWi5jaGFyQXQoNjMgJiBjID4+IDggLSB0ICUgMSAqIDgpXFxuICAgICAgICApIGMgPSBjIDw8IDggfCBFLmNoYXJDb2RlQXQodCArPSAwLjc1KTtcXG4gICAgICAgIHJldHVybiBcXFwiZGF0YT1cXFwiICsgUjQgKyBPICsgXFxcIiZ2PTJcXFwiO1xcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92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gICAgIGNhc2UgJ3p6JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly96ejEyMy5jb20nO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IEpTT04ucGFyc2UocG9zdCh1ICsgJy9hamF4LycsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwiYWN0PXNlYXJjaCZrZXk9XFxcIiArIGtleXdvcmQgKyBcXFwiJmxhbmc9JnBhZ2U9XFxcIiArIE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZCA9IF8uaWQgKyAnI3p6JztcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCd6eicsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm1uYW1lICsgJyAtICcgKyBfLnNuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljLnJlcGxhY2UoL1xcXFw/LiovLCAnJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICd6eicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYmQnOlxcbiAgICAgICAgICAgICAgICAgICAgcWlhbnFpYW4oXFxcInNlYXJjaFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3b3JkOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VObzogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgfSkudHlwZVRyYWNrLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIV8uaXNWaXApIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnYmQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkICsgJyNiZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdreic6IC8vIOS6uuacuumqjOivgVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly9oYXlxYmhnci5zbGlkZXIua3ovXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaCh1ICsgXFxcInZrX2F1dGgucGhwP3E9XFxcIiArIGtleXdvcmQpKVtcXFwiYXVkaW9zXFxcIl1bXFxcIlxcXCJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IF8gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAoXy51cmwubWF0Y2goL2h0dHBzPzovKSA/IFxcXCJcXFwiIDogdSkgKyBfLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRfYXJ0LnNwbGl0KCcgLSAnKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgna3onKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdreicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICduaSc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSBodG0gPSBcXFwiLTEuaHRtXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaHRtID0gXFxcIi0xLVxcXCIgKyBNWV9QQUdFICsgXFxcIi5odG1cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAga2V5d29yZCA9IGVuY29kZVVSSUNvbXBvbmVudChrZXl3b3JkKS5yZXBsYWNlKC8tL2csICdfMmQnKS5yZXBsYWNlKC8lL2csICdfJyk7XFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gZmV0Y2hDb2RlQnlXZWJWaWV3KFxcXCJodHRwczovL3d3dy5oaWZpbmkuY29tL3NlYXJjaC1cXFwiICsga2V5d29yZCArIGh0bSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdibG9ja1J1bGVzJzogWycuanMnLCAnLmNzcycsICcucG5nJywgJy5pY28nXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiA1MDAwXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZsaS5tZWRpYVtkYXRhLXRpZF1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwZGZoKGl0ZW0sIFxcXCJhLDImJlRleHRcXFwiKSAhPSBcXFwi54m55L6bXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwxJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNuaSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCduaScsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiYSwxJiZUZXh0XFxcIikuc3BsaXQoXFxcIuOAi1xcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnNwbGl0KFxcXCLjgIpcXFwiKS5yZXZlcnNlKCkuam9pbignIC0gJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOi8vd3d3LmhpZmluaS5jb20vXFxcIiArIHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnbmknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2czJzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly93d3cuZ2dnbXVzaWMuY29tL1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICBrZXl3b3JkID0gZW5jb2RlVVJJQ29tcG9uZW50KGtleXdvcmQpLnJlcGxhY2UoLy0vZywgJ18yZCcpLnJlcGxhY2UoLyUvZywgJ18nKTtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBmZXRjaENvZGVCeVdlYlZpZXcodSArIFxcXCJzZWFyY2gtXFxcIiArIGtleXdvcmQgKyBcXFwiLTEuaHRtXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdibG9ja1J1bGVzJzogWycuanMnLCAnLmNzcycsICcucG5nJywgJy5pY28nXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiA1MDAwXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZsaS50aHJlYWRbZGF0YS10aWRdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwxJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNnMyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF6eSgnZzMnLCB6eWlkLCAwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhLDEmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZS5zcGxpdChcXFwiIC0gXFxcIikucmV2ZXJzZSgpLmpvaW4oJyAtICcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZzMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2J6JzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cHM6Ly9kZWJlbnppLmNvbS8/cz1cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiZoMi5lbnRyeS10aXRsZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkID0gcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNieic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBsYXp5KCdieicsIHp5aWQsIDAsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vcGljLnJtYi5iZHN0YXRpYy5jb20vYmpoLzM5Yjk2NGIyYjA4N2EwNWMzOWE1NmEyZTM4YzA0MDE5MzM4LmpwZWcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2J6JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdzdCc6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChgaHR0cDovL3d3dy5zb25ndGFzdGUuY28vZGFuY2Uvc2VhcmNoP2tleT0ke2tleXdvcmR9JnBhZ2U9JHtNWV9QQUdFfWApLCBcXFwiYm9keSYmLm1saXN0JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZCA9IHBkZmgoaXRlbSwgXFxcIi50ZDMmJmEmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvLywgJycpICsgJyNzdCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbGF6eSgnc3QnLCB6eWlkLCAwLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLnRkMyYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIikucmVwbGFjZSgncGljZGF0YScsICdhdHRhY2htZW50JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdzdCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYmxtJzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKGBodHRwczovL2JsYWNrYmxtLmJhaWxlbWkuY29tL2luZGV4LnBocC9kYW5jZS9zZWFyY2g/a2V5PSR7a2V5d29yZH0mcGFnZT0ke01ZX1BBR0V9YCkpLmRhbmNlbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IF8gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IF8uZG93bnVybCB8fCBfLnBsYXl1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAncnVuJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwgJiYgXy5uYW1lKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIChfLnNpbmdlciB8fCBfLnVwX3VzZXIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXIgfHwgXy51cF91c2VyX2xvZ28sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdibG0nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdpZCArICcjYmxtJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdmcCc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vd3d3LmZhbmdwaS5uZXQvcy9cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiZbY2xhc3M9cm93XVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJkaXYsMSYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCJkaXYsMiYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2ZwJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZnAnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNmcCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdodCc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHA6Ly9tLmh0cXl5LmNvbS9zZWFyY2gvcmVzdWx0P2lkPVxcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCJlbSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIikgKyAnMEBoZWFkZXJzPXtcXFwicmVmZXJlclxcXCI6XFxcImh0dHA6Ly9tLmh0cXl5LmNvbVxcXCJ9JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdodCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCIucGxheSYmZGF0YS1pZFxcXCIpICsgJyNodCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICcxdCc6XFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKGBodHRwczovL3NvLjF0aW5nLmNvbS9zb25nL2pzb24/cT0ke2tleXdvcmR9JnBhZ2U9JHtNWV9QQUdFfSZzaXplPTMwYCkpLnJlc3VsdHMubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdfbmFtZSArICcgLSAnICsgXy5zaW5nZXJfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczonICsgXy5hbGJ1bV9jb3ZlcixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnMXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ19pZCArICcjMXQnXFxuICAgICAgICAgICAgICAgICAgICB9LCByMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJzl0JzpcXG4gICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKGZldGNoKGBodHRwOi8vbmV3Ljlza3kuY29tL2FwaS93ZWliby9jb250ZW50L3NlYXJjaD9jb250ZW50PSR7a2V5d29yZH1gKSkuZGF0YS5zb25nX2xpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL15OJC9pLnRlc3QoXy5pc19zdGF0aW9uKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbmV3Ljlza3kuY29tL2FwaS9zb25nL2RldGFpbD9pZD1cXFwiICsgXy5zb25nX2lkICsgXFxcIiZpc19sb2dpbj1OXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKHUpKS5kYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdfbmFtZSArICcgLSAnICsgXy5tdXNpY2lhbl9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5kaXNjX2ltZ191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJzl0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdfaWQgKyAnIzl0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXy5zb25nX3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY191cmwgfHwgTHJjKF8uZGVzaWduX25vdGVzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdreSc6XFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHBvc3QoJ2h0dHA6Ly9hcGkua3VhaXlpbjEyMy5uZXQvcS9zZWFyY2gnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcInE9XFxcIiArIGtleXdvcmQgKyBcXFwiJmNsaWVudF92PTIuNy4xJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiJnBsYXRmb3JtPUFuZHJvaWRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNsaWVudC12XFxcIjogXFxcIjIuNy4xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImRldmljZS1pZFxcXCI6IFIoMTYpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGxhdGZvcm1cXFwiOiBcXFwiQW5kcm9pZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIm9raHR0cC8zLjE0LjRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29ubmVjdGlvblxcXCI6IFxcXCJLZWVwLUFsaXZlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvbnRlbnQtVHlwZVxcXCI6IFxcXCJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEubXVzaWNfbGlzdC5yb3dzLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSArICcgLSAnICsgXy51c2VyX2luZm8ubmlja25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdreScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy56eWlkXFxuICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtfLnBsYXlfdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjX3VybFxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJzVuZCc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHA6Ly9tLjVuZC5jb20vc28vc19cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiYubGlzdC1zb25nJiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIuc29uZyYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIuYXJ0aXN0JiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnNW5kJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcImEmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvfFxcXFwuLiovZywgJycpICsgJyM1bmQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnYml1JzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwczovL2JpdS5tb2UvaW5kZXgucGhwP209JmM9U29uZyZhPXNlYXJjaCZkYXRhPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwPVxcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJnRib2R5JiZ0clxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiaXVfc2lkID0gcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQrLywgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmSHRtbFxcXCIpLnJlcGxhY2UoL1xcXFxzKjxzcGFuW1xcXFxzXFxcXFNdKy9pLCBcXFwiXFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcImEsMSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL2JpdS5tb2UvU29uZy9zaG93Q292ZXIvc2lkL1xcXCIgKyBiaXVfc2lkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnYml1JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogYml1X3NpZCArICcjYml1J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHIxKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdtdXMnOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vc2t5bXVzLm9yZy90cmFja3MvXFxcIiArIGtleXdvcmQgKyBcXFwiL1xcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJi5mLXRhYmxlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5hcnRpc3QtbmFtZSYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIudHJhY2stbmFtZSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIikucmVwbGFjZSgvXiguKykvLCAnaHR0cHM6JDEnKSB8fCAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ211cycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnbXVzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogJ3VuZGVmaW5lZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW1xcXCJodHRwczpcXFwiICsgcGRmaChpdGVtLCBcXFwiLm1wMyYmaHJlZlxcXCIpICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdqYW0nOlxcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9zb2xyY2xvdWQuamFtZW5kby5jb20vc29sci9qYW1jb20/d3Q9anNvbiZyb3dzPTMwJnE9XFxcIiArIGtleXdvcmQgKyBcXFwiJnN0YXJ0PVxcXCIgKyAoKE1ZX1BBR0UgLSAxKSAqIDMwKSkpLnJlc3BvbnNlLmRvY3MubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwczovL3Byb2QtMS5zdG9yYWdlLmphbWVuZG8uY29tL2Rvd25sb2FkL3RyYWNrL1xcXCIgKyBfLmlkICsgXFxcIi9tcDM1XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUucmVwbGFjZShfLmFydGlzdF9uYW1lICsgJyAtICcsICcnKSArICcgLSAnICsgXy5hcnRpc3RfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly91c2VyY29udGVudC5qYW1lbmRvLmNvbS8/dHlwZT1hbGJ1bSZpZD1cXFwiICsgXy5hbGJ1bV9pZC5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyBcXFwiJndpZHRoPTUwMCZ0cmFja2lkPVxcXCIgKyBfLmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnamFtJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogJ3VuZGVmaW5lZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdqdWknOlxcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGV2YWwocG9zdCgnaHR0cHM6Ly9uZXcubXlmcmVlbXAzanVpY2VzLmNjL2FwaS9hcGlfc2VhcmNoLnBocD9jYWxsYmFjaz1xaWFucWlhbicsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwicT1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHUgPSBcXFwiaHR0cHM6Ly9ucGxheS5pZG1wM3MuY29tL3N0cmVhbS9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIG8gPSBcXFwiQUJDREVGR0hKS01OUFFSU1RVVldYWVphYmNkZWZnaGprbW5wcXJzdHV2eHl6MTIzXFxcIjtcXG5cXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGp1aV9kKHQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgwID09IHQpIHJldHVybiBvWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCA8IDAgJiYgKHQgKj0gLTEsIGUgKz0gXFxcIi1cXFwiKTsgMCA8IHQ7KSB2YWwgPSBwYXJzZUludCh0ICUgNDgpLCB0ID0gcGFyc2VJbnQodCAvIDQ4KSwgZSArPSBvW3ZhbF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGxpc3RbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHJldHR5SWQgPSBqdWlfZChfLm93bmVyX2lkKSArIFxcXCI6XFxcIiArIGp1aV9kKF8uaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnanVpJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdqdWknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnByZXR0eUlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1ICsgcHJldHR5SWQgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ3kzJzpcXG4gICAgICAgICAgICAgICAgICAgICRzb25nX2RhdGEgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIHNvbmdfbGlzdCA9IChpLCBpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSAkc29uZ19kYXRhW2ldLnNwbGl0KFxcXCJ8fFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBpdGVtLnNwbGl0KFxcXCJ8XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfWzRdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cDovL3Rpbmc2Lnl5bXAzLm5ldDo4Mi9cXFwiICsgU3RyaW5nKF9bNF0pLnJlcGxhY2UoJy53bWEnLCAnLm1wMycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfWzFdICsgJyAtICcgKyBfWzNdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCd5MycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICd5MycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wcmV0dHlJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaFBDKFxcXCJodHRwOi8vd3d3Lnl5bXAzLmNvbS9wL2dldHNlci5hc3B4P2tleT1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJzM2NSc6XFxuICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gJDM2NV9TZWFyY2hSZXN1bHQodCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGRmYShcXFwiPGJvZHk+XFxcIiArIHQgKyBcXFwiPC9ib2R5PlxcXCIsIFxcXCJib2R5JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gZXZhbChcXFwiJDM2NV9cXFwiICsgZmV0Y2goXFxcImh0dHA6Ly9oaXQueXVlMzY1LmNvbS9zZWFyY2guYXNwP3JuZD1cXFwiICsgTWF0aC5yYW5kb20oKSArIFxcXCIma2V5d29yZHM9XFxcIiArIGVzY2FwZShrZXl3b3JkKSArIFxcXCImdD0xXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE11c2ljSWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvfFxcXFwuLiovZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cDovLzk2LmllcmdlLmNuL1xcXCIgKyBwYXJzZUludChNdXNpY0lkIC8gMzAwMDApICsgXFxcIi9cXFwiICsgcGFyc2VJbnQoTXVzaWNJZCAvIDIwMDApICsgXFxcIi9cXFwiICsgTXVzaWNJZCArIFxcXCIubXAzXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5uYW1lJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcIi5zaW5nZXImJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCczNjUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICczNjUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogJ3VuZGVmaW5lZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICBjYXNlICdkajEnOlxcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vd3d3Lnp6emRqLmNvbVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKHUgKyBcXFwiL211c2ljL3NlYXJjaC1cXFwiICsga2V5d29yZCArIFxcXCI/Y2F0X2lkPTAmcGFnZT1cXFwiICsgTVlfUEFHRSksIFxcXCJib2R5JiZ0Ym9keSYmdHJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5tYXRjaCgvYWx0PVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiB1ICsgaXRlbS5tYXRjaCgvc3JjPVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqMScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL2RhdGEtaWQ9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajEnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqMic6XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKFxcXCJodHRwczovL3d3dy5kanV1LmNvbS9zZWFyY2g/bXVzaWNuYW1lPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZsaXN0PTImY2lkPTAmcGFnZT1cXFwiICsgTVlfUEFHRSksIFxcXCJib2R5JiYubGlzdF9tdXNpY2xpc3QmJnRyW2NsYXNzXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm1hdGNoKC90aXRsZT1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOlxcXCIgKyBpdGVtLm1hdGNoKC9zcmM9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGoyJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvdmFsdWU9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajInXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2RqMyc6XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly93d3cubGFsYWRqLmNvbVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKHUgKyBcXFwiL3NlYXJjaD9zZWFyY2g9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmLmxpc3RfbXVzaWNsaXN0JiZ0cltjbGFzc11cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLnQxJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogdSArIGl0ZW0ubWF0Y2goL3NyYz1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqMydcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo0JzpcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEMoXFxcImh0dHBzOi8vbS5haGFkai5jb20vc2VhcmNoLz9rZXk9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UgKyBcXFwiLmh0bWxcXFwiKSwgXFxcImJvZHkmJi55aW55dWVfbGlzdCYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJoMyYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwczovL3N0Ljkya3UuY29tL3p3Y3MvXFxcIiArIHRpdGxlICsgXFxcIi5tcDRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI2RqNCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzBdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo1JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGoubmV0Lyc7XFxuICAgICAgICAgICAgICAgICAgICBfID0gcG9zdCh1ICsgJ3NlYXJjaC5waHA/bW9kPW11c2ljJmZvcm1oYXNoPThjOTY0ZThhJnNyY2h0eHQ9JyArIGVuY29kZVN0cihrZXl3b3JkLCAnR0JLJykgKyAnJnNlYXJjaHN1Ym1pdD15ZXMnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ3RleHQvaHRtbDsgY2hhcnNldD1nYmsnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IHUgKyBKU09OLnBhcnNlKF8pLmhlYWRlcnMubG9jYXRpb25bMF0gKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0U7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaCh1cmwpLCBcXFwiYm9keSYmLm11c2ljLWxpc3QmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLnJlcGxhY2UoXFxcIiZzaXplPXNtYWxsXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo1JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSwxJiZocmVmXFxcIikubWF0Y2goL2lkPShcXFxcZCspLylbMV0gKyAnI2RqNSdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo2JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cDovL3d3dy4zNmRqLmNvbS9lL3NlYXJjaC8nO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IHBvc3QodSArICdpbmRleC5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc2lkOiAnMSwyLDMsNCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleWJvYXJkOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJtaXQ6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93OiAndGl0bGUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1waWQ6ICcxJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHUgKz0gSlNPTi5wYXJzZShfKS5oZWFkZXJzLmxvY2F0aW9uWzBdICsgXFxcIiZwYWdlPVxcXCIgKyAoTVlfUEFHRSAtIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2godSksIFxcXCJib2R5JiYjcGxheWxpc3QmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZGo2JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajYnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqNidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo3JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuN2lkai5jb20vZS9zZWFyY2gvJ1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IHBvc3QodSArICdpbmRleC5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlib2FyZDoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdzogJ3RpdGxlJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHUgKz0gSlNPTi5wYXJzZShfKS5oZWFkZXJzLmxvY2F0aW9uWzBdICsgXFxcIiZwYWdlPVxcXCIgKyAoTVlfUEFHRSAtIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2godSksIFxcXCJib2R5JiZsaVtkYXRhLWlkXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2RqNycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo3JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvZGF0YS1pZD1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqNydcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo4JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGp1OC5jb20vJztcXG4gICAgICAgICAgICAgICAgICAgIGl0ZW0gPSBmZXRjaFBDKHUgKyAna2V5L21sXycgKyBlbmNvZGVTdHIoa2V5d29yZCwgJ0dCSycpICsgJ18nICsgTVlfUEFHRSArICcuaHRtbCcsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAndGV4dC9odG1sOyBjaGFyc2V0PWdiMjMxMicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdyZWZlcmVyJzogdVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoaXRlbSwgXFxcImJvZHkmJiNkam91ciYmbGlbb25tb3VzZW92ZXJdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZGo4JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajgnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqOCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCByMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgY2FzZSAnZGo5JzpcXG4gICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGp5eXkuY29tL3NlYXJjaC5waHA/YWM9ZGoma2V5PScgKyBrZXl3b3JkICsgJyZwYWdlcz0nICsgTVlfUEFHRTtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEModSksIFxcXCJib2R5JiZsaVtkYXRhLWlkXSBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdkajknKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqOScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL2RhdGEtaWQ9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajknXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgcjEpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5o6l5Y+j6ZSZ6K+vflxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuayoeacieWPr+S7peaQnOe0ouatjOWNleeahOaOpeWPo35cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiBsYXp5KHBsYXRmb3JtLCB0MSwgdDIsIHQzKSB7XFxuICAgIFt0MSwgcGxhdGZvcm0sIHR5cGVdID0gdDEuc3BsaXQoJyMnKTtcXG4gICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICBjYXNlICd6eic6XFxuICAgICAgICAgICAgdSA9ICdodHRwczovL3p6MTIzLmNvbSc7XFxuICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1ICsgJy9hamF4LycsIHtcXG4gICAgICAgICAgICAgICAgYm9keTogXFxcImFjdD1zb25naW5mbyZpZD1cXFwiICsgdDEgKyBcXFwiJmxhbmc9XFxcIlxcbiAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgIHVybCA9IF8ubXAzO1xcbiAgICAgICAgICAgIGlmICh0MykgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UodSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBfLmxyYy5yZXBsYWNlKC9cXFxcci9nLCAnJylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2JkJzpcXG4gICAgICAgICAgICBfID0gcWlhbnFpYW4oXFxcInNvbmcvdHJhY2tsaW5rXFxcIiwge1xcbiAgICAgICAgICAgICAgICBUU0lEOiB0MVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCBfLnBhdGgpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbXy5wYXRoICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnbmknOlxcbiAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly93d3cuaGlmaW5pLmNvbS9cXFwiO1xcbiAgICAgICAgICAgIGl0ZW0gPSBwZGZoKGZldGNoKHUgKyBgdGhyZWFkLSR7dDF9Lmh0bWApLCBcXFwiZGl2Lm1lc3NhZ2UuYnJlYWstYWxsJiZIdG1sXFxcIik7XFxuICAgICAgICAgICAgdXJsID0gdSArIGl0ZW0ubWF0Y2goL3VybDpcXFxccypbXFxcIiddKFteXFxcIiddKykvKVsxXTtcXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IGl0ZW0ucmVwbGFjZSgvXltcXFxcc1xcXFxTXSs/PFxcXFwvaDU+fDxoNVtePl0qPltcXFxcc1xcXFxTXSsvZ2ksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBMcmMobHJjKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZzMnOlxcbiAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly93d3cuZ2dnbXVzaWMuY29tL1xcXCI7XFxuICAgICAgICAgICAgaXRlbSA9IHBkZmgoZmV0Y2godSArIFxcXCJ0aHJlYWQtXFxcIiArIHQxICsgXFxcIi5odG1cXFwiKSwgXFxcImRpdi5tZXNzYWdlLmJyZWFrLWFsbCYmSHRtbFxcXCIpO1xcbiAgICAgICAgICAgIGV2YWwoXFxcInVybD1cXFwiICsgaXRlbS5tYXRjaCgvdXJsOlxcXFxzKihbXlxcXFxuLF0rKS8pWzFdLnJlcGxhY2UoXFxcImJhc2U2NF9kZWNvZGVcXFwiLCBcXFwiYmFzZTY0RGVjb2RlXFxcIikpO1xcbiAgICAgICAgICAgIGlmICghdXJsLm1hdGNoKC9odHRwLykpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdSArIHVybFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IGl0ZW0uc3BsaXQoXFxcIjwvaDU+XFxcIilbMV0uc3BsaXQoXFxcIjxoNVxcXCIpWzBdO1xcbiAgICAgICAgICAgIGlmIChscmMubWF0Y2goL1xcXFxbXFxcXGQrOlxcXFxkKy8pKVxcbiAgICAgICAgICAgICAgICBscmMgPSBscmMucmVwbGFjZSgvKFxcXFxzKjxcXFxcLz9wPikrL2dpLCBcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgIGxyYyA9IExyYyhscmMpO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXG4gICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2J6JzpcXG4gICAgICAgICAgICBpdGVtID0gZmV0Y2goXFxcImh0dHBzOi8vZGViZW56aS5jb20vdS9cXFwiICsgdDEgKyBcXFwiL1xcXCIpO1xcbiAgICAgICAgICAgIHVybCA9IHBkZmgoaXRlbSwgXFxcImF1ZGlvJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxyYyA9IHBkZmgoaXRlbSwgXFxcIi5lbnRyeS1jb250ZW50JiZIdG1sXFxcIikuc3BsaXQoXFxcIjxzdHJvbmc+5q2M6K+N77yaPC9zdHJvbmc+XFxcIilbMV07XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogTHJjKGxyYylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ3N0JzpcXG4gICAgICAgICAgICBpdGVtID0gZmV0Y2hQQyhcXFwiaHR0cDovL3d3dy5zb25ndGFzdGUuY28vc29uZy9cXFwiICsgdDEpO1xcbiAgICAgICAgICAgIHVybCA9IHBkZmgoaXRlbSwgXFxcInNvdXJjZSwwJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICBpZiAodDMpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGV2YWwoU3RyaW5nKGl0ZW0ubWF0Y2goL2xyYyA9IGBbXFxcXHNcXFxcU10qP2A7LylbMF0pKTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBMcmMobHJjKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnYmxtJzpcXG4gICAgICAgICAgICB1ID0gJ2h0dHBzOi8vYmxhY2tibG0uYmFpbGVtaS5jb20vaW5kZXgucGhwL2RhbmNlL3BsYXkvaWQvJyArIHQxO1xcbiAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKHUpKTtcXG4gICAgICAgICAgICB1cmwgPSBfLmRvd251cmwgfHwgXy5wbGF5dXJsO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2ZwJzpcXG4gICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL3d3dy5mYW5ncGkubmV0L2FwaS9wbGF5X3VybD9pZD1cXFwiICsgdDEgKyBcXFwiJmpzb249MVxcXCIpKS5kYXRhLnVybDtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogXFxcImh0dHBzOi8vd3d3LmZhbmdwaS5uZXQvZG93bmxvYWQvbHJjL1xcXCIgKyB0MVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnaHQnOlxcbiAgICAgICAgICAgIHUgPSBcXFwiaHR0cDovL20uaHRxeXkuY29tL3BsYXkvXFxcIiArIHQxO1xcbiAgICAgICAgICAgIGNvZGUgPSBleGVjdXRlV2ViUnVsZSh1LCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGU7XFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHVybCA9IFxcXCJodHRwOi8vZjUuaHRxeXkuY29tL3BsYXk5L1xcXCIgKyB0MSArIFxcXCIvbXAzL1xcXCIgKyBjb2RlO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IFt7XFxuICAgICAgICAgICAgICAgICAgICByZWZlcmVyOiB1XFxuICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICcxdCc6XFxuICAgICAgICAgICAgdSA9IFxcXCJodHRwczovL3d3dy4xdGluZy5jb21cXFwiO1xcbiAgICAgICAgICAgIHBhdGggPSBleGVjdXRlV2ViUnVsZShgaHR0cHM6Ly9oNS4xdGluZy5jb20vc29uZy9gICsgdDEsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZ19zb25nX21ldGEuc29uZ19wYXRoO1xcbiAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB1cmwgPSB1ICsgXFxcIi9hcGkvYXVkaW8/XFxcIiArIHBhdGg7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCwgaGVhZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlcjogdVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UodSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwsIHUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBscmMgPSB1ICsgXFxcIi90b3VjaC9hcGkvbHlyaWMvXFxcIiArIHQxO1xcbiAgICAgICAgICAgIGxyYyA9IEpTT04ucGFyc2UoZmV0Y2gobHJjKSkubHlyaWNfY29udGVudDtcXG4gICAgICAgICAgICBpZiAoIWxyYy5tYXRjaCgvXFxcXFtcXFxcZCs6XFxcXGQrLykpXFxuICAgICAgICAgICAgICAgIGxyYyA9IExyYyhscmMpO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXG4gICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzl0JzpcXG4gICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly9uZXcuOXNreS5jb20vYXBpL3NvbmcvZGV0YWlsP2lkPVxcXCIgKyB0MSArIFxcXCImaXNfbG9naW49TlxcXCI7XFxuICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2godSkpLmRhdGE7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIF8uc29uZ191cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbXy5zb25nX3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBscmM6IF8ubHlyaWNfdXJsIHx8IExyYyhfLmRlc2lnbl9ub3RlcylcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJzVuZCc6XFxuICAgICAgICAgICAgaXRlbSA9IGZldGNoKGBodHRwOi8vbS41bmQuY29tL3RpbmcvJHt0MX0uaHRtbGApO1xcbiAgICAgICAgICAgIGV2YWwoaXRlbS5tYXRjaCgvbXAzID0gLio/Oy8pWzBdKTtcXG4gICAgICAgICAgICB1cmwgPSAnaHR0cDovL21wZ2UuNW5kLmNvbS8nICsgbXAzO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBscmMgPSBwZGZoKGl0ZW0sIFxcXCIjbHJjY29udCYmSHRtbFxcXCIpLnJlcGxhY2UoLzxcXFxcIS0tLio/LS0+fDxiclxcXFwvPz4vZ2ksICdcXFxcbicpXFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdiaXUnOlxcbiAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vYml1Lm1vZS9Tb25nL3BsYXlTSUQvc2lkL1xcXCIgKyB0MSkpLnVybGluZm8udXJsO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBscmMgPSBwZGZoKGZldGNoKFxcXCJodHRwczovL2JpdS5tb2Uvc1xcXCIgKyB0MSksIFxcXCIuYW0tcG9wdXAtYmQmJkh0bWxcXFwiKS5yZXBsYWNlKC88KGJ1dHRvbikuKj9cXFxcMT58PFxcXFwvP2JyXFxcXC8/Pi9naSwgXFxcIlxcXFxuXFxcIik7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdkajEnOlxcbiAgICAgICAgICAgIGl0ZW0gPSBmZXRjaFBDKFxcXCJodHRwOi8vd3d3Lnp6emRqLmNvbS9tdXNpYy9pbmZvLVxcXCIgKyB0MSk7XFxuICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwiYXVkaW8mJnNyY1xcXCIpO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqMic6XFxuICAgICAgICAgICAgdXJpID0gSlNPTi5wYXJzZShmZXRjaFBDKFxcXCJodHRwczovL3d3dy5kanV1LmNvbS93YXAvcGxheS9wbGF5P2lkPVxcXCIgKyB0MSkpLmRhdGEubGlzdGVudXJsO1xcbiAgICAgICAgICAgIHVybCA9IGBodHRwOi8vbXA0LmRqdXUuY29tLyR7dXJpfS5tNGFgO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqMyc6XFxuICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShmZXRjaFBDKFxcXCJodHRwOi8vd3d3LmxhbGFkai5jb20vaW5kZXgvaW5kZXgvZ2V0X2Nvb2tpZVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogYHNvbmdfbGlzdD10aGluazpbe1xcXCJpZFxcXCI6XFxcIiR7dDF9XFxcIn1dO2BcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pKS5kYXRhWzBdLnBhdGg7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGo0JzpcXG4gICAgICAgICAgICB1cmkgPSBleGVjdXRlV2ViUnVsZShcXFwiaHR0cHM6Ly93d3cuYWhhZGouY29tL211c2ljL1xcXCIgKyB0MSArIFxcXCIuaHRtbFxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZGFuY2VGaWxlUGF0aDtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gYGh0dHBzOi8vc3QuOTJrdS5jb20vYCArIHVyaTtcXG4gICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuICAgICAgICBjYXNlICdkajUnOlxcbiAgICAgICAgICAgIF8gPSBwb3N0KCdodHRwczovL20uZGoubmV0L3RlbXBsYXRlL3poemhfZHptdXNpYy9hamF4Lz9hY3Rpb249Z2V0dXJsJywge1xcbiAgICAgICAgICAgICAgICBib2R5OiBcXFwiaWQ9XFxcIiArIHQxXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOi8vZGpuZXQuc3JjLmRqLm5ldDo0NDMxL1xcXCIgKyBKU09OLnBhcnNlKF8pLmRhdGFbMF0uc3JjO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqNic6XFxuICAgICAgICAgICAgdXJpID0gZXhlY3V0ZVdlYlJ1bGUoXFxcImh0dHA6Ly93d3cuMzZkai5jb20vcGxheS9cXFwiICsgdDEgKyBcXFwiLmh0bWxcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGluZm8ucGxheXVybDtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbycsICcvZS8nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHVybCA9IGBodHRwOi8vdG4xLjcyZGphcHAuY246ODM5OS9gICsgdXJpO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqNyc6XFxuICAgICAgICAgICAgdXJsID0gZXhlY3V0ZVdlYlJ1bGUoXFxcImh0dHBzOi8vd3d3LjdpZGouY29tL2RqL1xcXCIgKyB0MSArIFxcXCIuaHRtbFxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gcGxheXVybDtcXG4gICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgY2FzZSAnZGo4JzpcXG4gICAgICAgICAgICB1ID0gJ2h0dHBzOi8vd3d3LmRqdTguY29tJztcXG4gICAgICAgICAgICBpdGVtID0gdSArICcvaWsvei8/JyArIGV4ZWN1dGVXZWJSdWxlKHUgKyAnL2Rpc2NvLycgKyB0MSArICcvJywgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBmdXJsO1xcbiAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpdGVtID0gZmV0Y2hDb2RlQnlXZWJWaWV3KGl0ZW0sIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwiYXVkaW8mJnNyY1xcXCIpO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG4gICAgICAgIGNhc2UgJ2RqOSc6XFxuICAgICAgICAgICAgdXJsID0gZXhlY3V0ZVdlYlJ1bGUoJ2h0dHBzOi8vbS5kanl5eS5jb20vcGxheS8nICsgdDEgKyAnLmh0bWwnLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBsYXl1cmw7XFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICBicmV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DogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpZCcsIHRpZCk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWknKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogQ29sb3IoXFxcIjxiPuWIh+aNouaOpeWPozwvYj5cXFwiLCBcXFwiI2ZmNjYwMVxcXCIpLFxcbiAgICAgICAgICAgIHVybDogJChwbGF0Zm9ybXMuc2xpY2UoMCwgOCkubWFwKHRpdGxlID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKHRpdGxlID09IHBsYXRmb3JtKVxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBSaWNoKFN0cm9uZyhDb2xvcih0aXRsZSkpKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRpdGxlXFxuICAgICAgICAgICAgfSksIDIsICfpgInmi6nmjqXlj6PlubPlj7AnKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoIWlucHV0Lm1hdGNoKC9e4oCY4oCY4oCZ4oCZLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdwbGF0Zm9ybScsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2hvbWVfcGFnZScpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcigndGlkJyk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWknKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKHBsYXRmb3JtKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogQ29sb3IoXFxcIjxiPlRHWOaUtuiXjzwvYj5cXFwiLCBcXFwiI2ZmNjYwMVxcXCIpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9jb2xsZWN0aW9uI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjP3J1bGU95q2M6K+N6YCC6YWNXFxcIixcXG4gICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgn5pS26JePJyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzMnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogXFxcIlRHWOaUtuiXj1xcXCIsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBDb2xvcihcXFwiPGI+6Kej5p6Q566h55CGPC9iPlxcXCIsIFxcXCIjZmY2NjAxXFxcIiksXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3J1bGVMaXN0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjP3BhZ2VUaXRsZT3op6PmnpDnrqHnkIYmcnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCforr7nva4nKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDliIbkuqvpk77mjqUnLFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoc19wbGF0Zm9ybSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQudHJpbSgpKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc19wbGF0Zm9ybScsIHNfcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3BsYXRmb3JtJyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc190MycpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3Q0Jyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NlYXJjaF9wYWdlJyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3NlYXJjaCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cD1meXBhZ2UmcnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgICAgIH0sIHBsYXRmb3JtKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaDFcXFwiLFxcbiAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IFxcXCLpq5jnuqfmkJzntKJcXFwiLFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJzX3QyXFxcIiksXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ3NfdDInLCBpbnB1dClcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5oiR55qE5pS26JePJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2NvbGxlY3Rpb24/cnVsZT3mrYzor43pgILphY0nLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb24xJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfljoblj7LorrDlvZUnLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjScsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjMnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ+mrmOe6p+aQnOe0oicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc2VhcmNoX3BhZ2UnKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc19wbGF0Zm9ybScpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDQnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc2VhcmNoI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wPWZ5cGFnZSZydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjInLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFJpY2goQ29sb3IoJzxiPicgKyB0aWQgKyAnPC9iPicsICcjZmY2NjAxJykpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICB0cnIubWFwKChuYW1lLCBpaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHR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0UgKiBwYWdlU2l6ZSkge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignaG9tZV9wYWdlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArICfmiJHmmK/mnInlupXnur/nmoQnLmZvbnRjb2xvcignR3JheScpLnNtYWxsKCksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdob21lX3BhZ2UnKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSBkID0gZC5jb25jYXQodXJpKTtcXG59IGNhdGNoIChmZXRjaF9lcnJvcikge1xcbiAgICAvLyBlcnJvcihmZXRjaF9lcnJvcik7XFxuICAgIGQgPSBbe1xcbiAgICAgICAgdGl0bGU6IFxcXCLnvZHnu5zlvILluLggLyDmjqXlj6PltKnmuoPkuoZcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuaNouS4quaOpeWPo+eci+eci+OAglxcXCIsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9XTtcXG4gICAgcGxhdGZvcm1zLnNsaWNlKDEsIDgpXFxuICAgICAgICAuZmlsdGVyKHRpdGxlID0+IHRpdGxlICE9IHBsYXRmb3JtKVxcbiAgICAgICAgLm1hcCh0aXRsZSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fMl9yb3VuZCcsXFxuICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aXRsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3BsYXRmb3JtJywgdGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignaG9tZV9wYWdlJyk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWQnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpaScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIHRpdGxlKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxufVxcbk1ZX1BBR0UgPT0gMSA/IHNldFByZVJlc3VsdChkKSA6IHNldFJlc3VsdChkKTtcXG5kZWxldGVJdGVtQnlDbHMoJ2xvYWRpbmdfZ2lmJyk7XFxuXFxuXFxuXFxuXFxuXFxuLy8g5bCP56iL5bqP5rKh5pyJ5pu05paw77yM5a+56Kej5p6Q6L+b6KGM5qOA5rWL44CCXFxuaWYgKGdldE15VmFyKCdSdWxlX25vdXBkYXRlJywgJycpID09ICcxJyAmJiBNWV9QQUdFID09IDEpIHtcXG4gICAgbGV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dGUsIHRpbWUgPSBOdW1iZXIoJC5kYXRlRm9ybWF0KG5ldyBEYXRlKCkuZ2V0VGltZSgpLCAneXl5eU1NZGQnKSk7XFxuICAgIGlmIChnZXRNeVZhcigndXBkYXRlMScsIGdldEl0ZW0oJ3VwZGF0ZTEnLCAnMScpKSA9PSAnMScgJiYga2dfaXRlbTIgIT0gLTEpIHtcXG4gICAgICAgIGtnX2xpdGUgPSBrZ19saXN0MVtrZ19pdGVtMl07XFxuICAgICAgICBpZiAoJC5kYXRlRm9ybWF0KGtnX2xpdGUudGltZSwgJ3l5eXlNTWRkJykgPCB0aW1lKSB7XFxuICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnW+mFt+eLl+amguW/teeJiF0g5ZCs5q2M6aKG5Lya5ZGYJyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+avj+aXpeWQrOatjOWNs+WPr+mihuWPljHml6Xphbfni5fmpoLlv7XniYhWSVAnLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbWF0ID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvXFxcIihcXFxcZCspXFxcIiwgXFxcIihbXlxcXCJdKylcXFwiLCBcXFwiXFxcXGQqXFxcIiwgXFxcIihbXlxcXCJdKilcXFwiLyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLkxpdGVfU2lnbmluKG1hdFsxXSwgbWF0WzJdLCBtYXRbM10sIHRydWUpO1xcbiAgICAgICAgICAgICAgICB9LCBrZ19saXRlKSxcXG4gICAgICAgICAgICAgICAgY2FuY2VsOiAkLnRvU3RyaW5nKChqeGxpc3QsIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIF8udGltZSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgXy5zaWduaW4gPSAxO1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0W2ldID0gXztcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF9rZycsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LuK5pel5LiN5YaN5o+Q56S677yM6K+35Zyo6K6+572u6aG15omL5Yqo562+5YiwXFxcIlxcbiAgICAgICAgICAgICAgICB9LCBrZ19saXN0MSwga2dfaXRlbTIsIGtnX2xpdGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUxJywgJzAnKTsgLy8g5LuK5aSp5bey57uP562+5Yiw6L+H5LqGXFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBwdXRNeVZhcigndXBkYXRlMScsICcwJyk7IC8vIOayoeacieamguW/teeJiOino+aekCAvIOS4jeaPkOekulxcbiAgICB9XFxuICAgIGlmIChnZXRNeVZhcigndXBkYXRlMicsIGdldEl0ZW0oJ3VwZGF0ZTInLCAnMCcpKSA9PSAnMScgJiYgKCFrZ19saXRlIHx8ICQuZGF0ZUZvcm1hdChrZ19saXRlLnRpbWUsICd5eXl5TU1kZCcpID09IHRpbWUpKSB7XFxuICAgICAgICBsZXQgcXFfbGl0ZSA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9xcScsIFtdKVxcbiAgICAgICAgICAgIC5maW5kKF8gPT4gbWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImUyYzFhNGJmOGQ1OGQxNzAzYTVlODEwOWUxZjkwY2MwXFxcIik7XFxuICAgICAgICBpZiAocXFfbGl0ZSkge1xcbiAgICAgICAgICAgIGlmICgkLmRhdGVGb3JtYXQocXFfbGl0ZS50aW1lICsgNS4zZTgsICd5eXl5TU1kZCcpIDwgdGltZSkge1xcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnW1FR6Z+z5LmQXSDliLfmlrBjb29raWUnLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+avj+S4g+WkqemcgOimgeWIt+aWsOS4gOasoWNvb2tpZScsXFxuICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL0Nvb2tpZTogXFxcIihbXlxcXCJdKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5yZWZyZXNoX2xvZ2luKGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBxcV9saXRlKSxcXG4gICAgICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8udGltZSArPSA4LjZlNztcXG4gICAgICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9xcScsIFtdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QudW5zaGlmdChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBtZDUob2JqLnRpdGxlICsgb2JqLnVybCkgPT09IG1kNShvLnRpdGxlICsgby51cmwpKSA9PT0gaW5kZXg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X3FxJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S7iuaXpeS4jeWGjeaPkOekuu+8jOivt+WcqOiuvue9rumhteaJi+WKqOetvuWIsFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHFxX2xpdGUpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd1cGRhdGUyJywgJzAnKTsgLy8g6L+Y5rKh5Yiw562+5Yiw5pe26Ze0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcigndXBkYXRlMicsICcwJyk7IC8vIOayoeaciXFx6Kej5p6QIC8g5LiN5o+Q56S6XFxuICAgICAgICB9XFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLikabop4TliJnnvJbovpFcIixcInBhdGhcIjpcInJ1bGVFZGl0XCIsXCJydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nLCB7fSkp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AgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICB9KSxcXG4gICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoanhfdHlwZSksXFxuICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJ1xcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPuWQr+eUqOivleWQrDwvYj48L3NwYW4+JyxcXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLLCBvcGVuKSA9PiB7XFxuICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdqeF9vcGVuJywgb3Blbik7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKG9wZW4pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20xJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfb3BlbicsIG9wZW4pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5r+A5rS75aSx6LSlXFxcIjtcXG4gICAgICAgICAgICB9LCBvcGVuKTtcXG4gICAgICAgIH1cXG4gICAgfSwganhfczEsIGp4X29wZW4gPyAnMCcgOiAnMScpLFxcbiAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfb3BlbiA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojZmY2NjAxXFxcIj48Yj7lkK/nlKjkuIvovb08L2I+PC9zcGFuPicsXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSywgZG93bikgPT4ge1xcbiAgICAgICAgaWYgKEspIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignanhfZG93bicsIGRvd24pO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpea/gOa0u+WvhuWMmVxcXCIpLmlucHV0KChkb3duKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IGdldE15VmFyKCdqeF9tMScpKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczEnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X2Rvd24nLCBkb3duKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+a/gOa0u+Wksei0pVxcXCI7XFxuICAgIC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cXFwic3FcXFwiLCBcXFwiaHJcXFwiLCAvKiBcXFwienFcXFwiKi8gXS5tYXAodCA9PiBnZXRNeVZhcihcXFwianhfXFxcIiArIHQpICE9IFxcXCJcXFwiID8gJ+KYhScgOiAn4piGJykuam9pbihcXFwiXFxcIiksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogZ2V0TXlWYXIoJ2p4X2ltZycpIHx8ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgpXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKCdqeF9kZXNjJykgKyAn5LioJyArIGdldE15VmFyKCdqeF91cmwnKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoJ2p4X2NvbnRlbnQnLCAnXFxcXG5cXFxcblxcXFxuXFxcXG5cXFxcbicpLnJlcGxhY2UoL1xcXFxuL2csICc8YnI+JyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5L2/55So5p2D6ZmQJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKEspID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKEspIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20xJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczEnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMSksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MxID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uXzJfcm91bmQnLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn57yW6L6R5p2D6ZmQJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKEspID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKEspIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MyID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uXzJfcm91bmQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfln7rmnKwnOlxcbiAgICAgICAgW1xcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5rqQ5qCH6K+GJywgJ3VybCddLFxcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5rqQ5ZCN56ewJywgJ3RpdGxlJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDlm77moIcnLCAnaW1nJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDliIbnu4QnLCAnZGVzYyddLFxcbiAgICAgICAgICAgIFsn6YCJ5aGr77yM5rqQ5rOo6YeKJywgJ2NvbnRlbnQnXVxcbiAgICAgICAgXS5tYXAoW2EsIGJdID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBkZXNjOiBhLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImp4X1xcXCIgKyBiKSxcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcImp4XyR7Yn1cXFwiLCBpbnB1dClgLFxcbiAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgJ+mfs+i0qCc6XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyfpgInloavvvIzmoIflh4bpn7PotKjjgILkvovvvJp0Mj1cXFwiMTI4a1xcXCInLCAnbXAzJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzpq5jlk4Hpn7PotKjjgILkvovvvJp0Mj1cXFwiMzIwa1xcXCInLCAnaHEnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOaXoOaNn+mfs+i0qOOAguS+i++8mnQyPVxcXCIyMDAwa1xcXCInLCAnc3EnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOmrmOWTgeaXoOaNn+OAguS+i++8mnQyPVxcXCI0MDAwa1xcXCInLCAnaHInXSxcXG4gICAgICAgICAgICAvLyBbJ+mAieWhq++8jOeri+S9k+aXoOaNn+OAguS+i++8mnQyPVxcXCIyMDAwMGtcXFwiJywgJ3pxJ11cXG4gICAgICAgIF0ubWFwKFthLCBiXSA9PiB7XFxuICAgICAgICAgICAgbGV0IF8gPSB7XFxuICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoanhfczIgfHwganhfczMpIHtcXG4gICAgICAgICAgICAgICAgXy5kZWZhdWx0VmFsdWUgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIGdldE15VmFyKFxcXCJqeF9cXFwiICsgYikpO1xcbiAgICAgICAgICAgICAgICBfLm9uQ2hhbmdlID0gJC50b1N0cmluZygobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0LnRyaW0oKSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKG5hbWUsIGdldFByaXZhdGVKUyhpbnB1dC50cmltKCkpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIobmFtZSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBcXFwianhfXFxcIiArIGIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIF8uZGVmYXVsdFZhbHVlID0gXFxcIuayoeacieadg+mZkO+8jOivt+ino+mUgeOAglxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgZGVzYzogYSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBfXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfop6PmnpAnOlxcbiAgICAgICAgbGV0IF8gPSB7XFxuICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgIHR5cGU6IFxcXCJ0ZXh0YXJlYVxcXCIsXFxuICAgICAgICAgICAgaGVpZ2h0OiA3XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoanhfczIgfHwganhfczMpIHtcXG4gICAgICAgICAgICBfLmRlZmF1bHRWYWx1ZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgZ2V0TXlWYXIoXFxcImp4X2ppZXhpXFxcIikpO1xcbiAgICAgICAgICAgIF8ub25DaGFuZ2UgPSAkLnRvU3RyaW5nKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKG5hbWUsIGdldFByaXZhdGVKUyhpbnB1dC50cmltKCkpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKG5hbWUsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIFxcXCJqeF9qaWV4aVxcXCIpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBfLmRlZmF1bHRWYWx1ZSA9IFxcXCLmsqHmnInmnYPpmZDvvIzor7fop6PplIHjgIJcXFwiXFxuICAgICAgICB9XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGRlc2M6ICflj5jph4/vvJpfICYgdDEgJiBtdXNpY0l0ZW1cXFxcblxcXFxu6K+05piO77ya5Y+v5Lul5LuO6Z+z6LSo6YKj6YeM5Lyg5Y+Y6YeP6L+H5p2lKOS+izogdDIp77yM6YW354uX55qEbXVzaWNJdGVt5piv5pWw57uE44CCXFxcXG5cXFxcbuWumuS5iXVybOWwseihjO+8jOekuuS+i++8mlxcXFxudXJpID0gYGh0dHBzOi8vYmFpZHUuY29tP2E9JHt0MX0mYj0ke3QyfWA7XFxcXG51cmwgPSBKU09OLnBhcnNlKGZldGNoKHVyaSkpLnVybDsnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgIGV4dHJhOiBfXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmi5PlsZUnOlxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+Whq+WGmeWvhuWMmeWQju+8jOWPr+S7peWvuemfs+a6kOWBmuS4gOS6m+mZkOWItuOAgicsXFxuICAgICAgICAgICAgZGVzYzogJ+WvhuWMmeaXoOazlei/veWbnu+8jOWhq+iusOW+l+S9j+eahO+8gScsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn57yW6L6R5rqQ55qE6ZmQ5Yi2JyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5Y+v5Lul55yL77yM5Y+v5Lul57yW6L6RKOWkp+eIseaXoOeWhiknLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSykgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoSykgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20yJywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pu05pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMiksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChqeF9zMiA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICflj6/ku6XnnIvvvIzkuI3og73nvJbovpEo6Ziy5q2i5LqM5pS5KScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLMSwgSzIpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdqeF9tMicpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IGlucHV0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoSzEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi5pON5L2c57G75Z6L77ya5pu05pS55a+G5YyZXFxcXG7or7fovpPlhaXljp/lr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gaW5wdXQyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4bmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ljp/lr4bljJnpqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoSzIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi5pON5L2c57G75Z6L77ya5p2D6ZmQ6ZmN57qnXFxcXG7or7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+G5YyZ6ZSZ6K+v77yM6ZmN57qn5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBqeF9zMywgIWp4X3MyKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MyID8gNjMgOiBqeF9zMyA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfkuI3og73nnIvvvIzkuI3og73nvJbovpEo6IO955So5bCx6KGMKScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLMSwgSzIpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdqeF9tMicpID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IGlucHV0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MyJywgJzInKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoSzEgJiYgSzIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi5pON5L2c57G75Z6L77ya5pu05pS55a+G5YyZXFxcXG7or7fovpPlhaXljp/lr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20yJykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+ehruiupOWvhuWMmVxcXCIpLmlucHV0KChpbnB1dDIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gaW5wdXQyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMicsICcyJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9tMicsIG1kNShpbnB1dCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4bmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yqg5a+G5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ljp/lr4bljJnpqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczInLCAnMicpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sICFqeF9zMywgIWp4X3MyKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MyID8gNjMgOiBqeF9zMyA/IDYzIDogNTUpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn5L2/55So5rqQ55qE6ZmQ5Yi2JyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9jb2RlJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5rKh5pyJ6aqM6K+BKOS4jeaQnuiKseeahCknLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSykgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoSykgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTEnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20xJywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6aqM6K+B5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pqozor4HlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBqeF9zMSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArIChqeF9zMSA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmv4DmtLvpqozor4Eo6aqM6K+B5LiA5LiLKScsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChLKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignanhfbTEnKSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXlr4bljJlcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fnoa7orqTlr4bljJlcXFwiKS5pbnB1dCgoaW5wdXQyKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBpbnB1dDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfbTEnLCBtZDUoaW5wdXQpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4bmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4blpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKEspIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLmk43kvZznsbvlnovvvJrmm7TmlLnlr4bljJlcXFxcbuivt+i+k+WFpeWOn+WvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTEnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeWvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+356Gu6K6k5a+G5YyZXFxcIikuaW5wdXQoKGlucHV0MikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBpbnB1dDIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X3MxJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X20xJywgbWQ1KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WKoOWvhuaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liqDlr4blpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WOn+WvhuWMmemqjOivgeWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGp4X3MxKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X3MxID8gNjMgOiA1NSkgKyAnLnN2ZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+aXtuaViOmqjOivgSjnrYnlvoXlrozlloQpJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS82My5zdmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbn1cXG5kLnB1c2goe1xcbiAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3IoJ+S/neWtmOW5tumAgOWHuicpKSksXFxuICAgIGRlc2M6ICfkuIrmrKHnvJbovpHvvJonICsgJC5kYXRlRm9ybWF0KE51bWJlcihnZXRNeVZhcihcXFwianhfdGltZVxcXCIpKSB8fCBuZXcgRGF0ZSgpLmdldFRpbWUoKSwgJ3l5eXktTU0tZGQgaGg6bW06c3MnKSxcXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgIGlmIChnZXRNeVZhcignanhfbTInKSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5a+G5YyZXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBnZXRNeVZhcignanhfbTInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXRFZGl0KCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mqjOivgeWksei0pe+8jOS4jeaUr+aMgeS/neWtmO+8jOivt+W3puS4iuinkuaJi+WKqOmAgOWHuuOAglxcXCI7XFxuICAgICAgICAgICAgfSk7XFxuICAgIC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IFN0cmluZyhfLm0yKS5sZW5ndGggPT0gMzIgJiYgXy5zMiA9PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgXy5zMiA9IFxcXCIyXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAganNvbltfLnR5cGVdID0gW19dO1xcbiAgICAgICAgICAgIGxldCB0MSA9IF8udHlwZTtcXG4gICAgICAgICAgICBsZXQgdDIgPSBfLnRpdGxlO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBmb3IgKGxldCBrZXkgb2YgenUpIHtcXG4gICAgICAgICAgICAgICAgbGV0IF8gPSB6eVtrZXldO1xcbiAgICAgICAgICAgICAgICBpZiAoIWpzb25bXy50eXBlXSkge1xcbiAgICAgICAgICAgICAgICAgICAganNvbltfLnR5cGVdID0gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKF8ubTEgJiYgXy5tMSAhPSBcXFwiXFxcIiAmJiBTdHJpbmcoXy5tMSkubGVuZ3RoID09IDMyKSB7XFxuICAgICAgICAgICAgICAgICAgICBfLnMxID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgXy5kb3duID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChfLm0yICYmIF8ubTIgIT0gXFxcIlxcXCIgJiYgU3RyaW5nKF8ubTIpLmxlbmd0aCA9PSAzMiAmJiBfLnMyID09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgXy5zMiA9IFxcXCIyXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBqc29uW18udHlwZV0ucHVzaChfKTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk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F0Zm9ybS5yZXBsYWNlKCdsaWInLCAn5YWo6YOoJykgKyAn6Kej5p6QJyxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6Zmk4oCcXFxcIiArIHBsYXRmb3JtLnJlcGxhY2UoJ2xpYicsICflhajpg6gnKSArIFxcXCLop6PmnpDigJ3lkJfvvJ9cXFxcbuatpOaTjeS9nOS4jeWPr+mAhu+8jOivt+iwqOaFjumAieaLqeOAglxcXCIpLmNvbmZpcm0oKHBsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBsYXRmb3JtID09ICdsaWInKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF0Zm9ybXMgPSBbJ3FxJywgJ3d5JywgJ2tnJywgJ2t3JywgJ21nJywgJ3F0J107XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbGF0Zm9ybXMgPSBbcGxhdGZvcm1dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IHBsYXRmb3JtIG9mIHBsYXRmb3Jtcykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ2p4bGlzdF8nICsgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHBsYXRmb3JtKTtcXG4gICAgICAgICAgICAgICAgfSwgcGxhdGZvcm0pXFxuICAgICAgICAgICAgfV1cXG4gICAgICAgIH1cXG4gICAgfSk7XFxufSk7XFxubGV0IGp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iAoXy5kb3duID09ICcxJykge1xcbiAgICAgICAgICAgIGQxID0gQ29sb3IoZDEsIFxcXCIjMkU1RDhFXFxcIik7XFxuICAgICAgICAgICAgZDIgPSBcXFwi56aB55So5LiL6L29XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZyhpID8gXy50aXRsZSA6IENvbG9yKF8udGl0bGUpKSxcXG4gICAgICAgICAgICBkZXNjOiBkMSxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLliIbkuqtcXFwiLCBcXFwi57yW6L6RXFxcIiwgXFxcIuWIoOmZpFxcXCIsIFxcXCLnp7vliqhcXFwiXS5jb25jYXQoW2kgPyAn6YCJ5Lit6Kej5p6QJyA6ICflj5bmtojpgInkuK0nLCBkMl0pLCAyLCAn6YCJ5oup5omp5bGV5pON5L2cJykuc2VsZWN0KCh0eXBlLCB0aXRsZSwgdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBqc29uLCBqeGxpc3QyLCBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3RfJyArIHR5cGUsIFtdKTtcXG4gICAgICAgICAgICAgICAgbGV0IHp1ID0ganhsaXN0Lm1hcChfID0+IG1kNShfLnR5cGUgKyAnOicgKyBfLnRpdGxlICsgJzonICsgXy51cmwpKTtcXG4gICAgICAgICAgICAgICAgbGV0IG0gPSBtZDUodHlwZSArICc6JyArIHRpdGxlICsgJzonICsgdXJsKTtcXG4gICAgICAgICAgICAgICAgbGV0IGkgPSB6dS5pbmRleE9mKG0pO1xcbiAgICAgICAgICAgICAgICBsZXQgXyA9IGp4bGlzdFtpXTtcXG4gICAgICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5YiG5LqrJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy5tMSAmJiBfLm0xICE9IFxcXCJcXFwiICYmIFN0cmluZyhfLm0xKS5sZW5ndGggPT0gMzIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5zMSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmRvd24gPSBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLm0yICYmIF8ubTIgIT0gXFxcIlxcXCIgJiYgU3RyaW5nKF8ubTIpLmxlbmd0aCA9PSAzMiAmJiBfLnMyID09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnMyID0gXFxcIjJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAganNvblt0eXBlXSA9IFtfXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLmdldFNoYXJlKGpzb24sIHRydWUsIDEsIHR5cGUsIHRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+e8lui+kSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgW1xcXCJ0eXBlXFxcIiwgXFxcIm9wZW5cXFwiLCBcXFwiZG93blxcXCIsIFxcXCJpbWdcXFwiLCBcXFwidGl0bGVcXFwiLCBcXFwiZGVzY1xcXCIsIFxcXCJ1cmxcXFwiLCBcXFwiY29udGVudFxcXCIsIFxcXCJtcDNcXFwiLCBcXFwiaHFcXFwiLCBcXFwic3FcXFwiLCBcXFwiaHJcXFwiLCBcXFwienFcXFwiLCBcXFwiamlleGlcXFwiLCBcXFwiczFcXFwiLCBcXFwibTFcXFwiLCBcXFwiczJcXFwiLCBcXFwibTJcXFwiLCBcXFwidGltZVxcXCIsIFxcXCJ0aWRcXFwiLCBcXFwidWlkXFxcIl0ubWFwKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdqeF8nICsgdClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfdWlkJywgbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoXykubWFwKHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfJyArIHQsIF9bdF0gfHwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3J1bGVFZGl0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wYWdlVGl0bGU96KeE5YiZ57yW6L6RJnJ1bGU95q2M6K+N6YCC6YWNJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIoOmZpCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumuWIoOmZpFxcXCIgKyBfLnR5cGUgKyBcXFwi6Kej5p6Q4oCcXFxcIiArIF8udGl0bGUgKyAn4oCd5ZCX77yfXFxcXG7mraTmk43kvZzkuI3lj6/pgIbvvIzor7fosKjmhY7pgInmi6njgIInKS5jb25maXJtKCh0eXBlLCBqeGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0XycgKyB0eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSwganhsaXN0LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+enu+WKqCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB6dSA9IGp4bGlzdC5tYXAoXyA9PiBfLnRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup56e75Yqo5L2N572uJykuc2VsZWN0KCh0eXBlLCBqeGxpc3QsIF8sIHp1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpID0genUuaW5kZXhPZihpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IC0xKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnB1c2goXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdC5zcGxpY2UoaSwgMCwgXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImp4bGlzdF9cXFwiICsgdHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHR5cGUsIGp4bGlzdCwgXywgenUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn6YCJ5Lit6Kej5p6QJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MlttXSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCBqeGxpc3QyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflj5bmtojpgInkuK0nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDIgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwianhsaXN0MlxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUganhsaXN0MlttXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwianhsaXN0MlxcXCIsIGp4bGlzdDIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WQr+eUqOS4i+i9vSc6XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfnpoHnlKjkuIvovb0nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnMxID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmRvd24gPSBfLmRvd24gPT0gJzEnID8gJzAnIDogJzEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoXy5kb3duID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpea/gOa0u+WvhuWMmVxcXCIpLmlucHV0KChqeGxpc3QsIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IF8ubTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnMxID0gJzAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9ICcxJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3RbaV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8v5r+A5rS75oiQ5Yqf77yM5qyi6L+O5L2/55SoJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr4bljJnplJnor6/vvIzml6Dms5XlkK/nlKhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBqeGxpc3QsIGksIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uZG93biA9ICcwJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3RbaV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBfLnR5cGUsIF8udGl0bGUsIF8udXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBfLmltZyB8fCAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoKVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBfLnR5cGUgKyAn5LioJyArIChfLmRlc2MgfHwgJ+acquefpScpICsgJ+S4qCcgKyBfLnVybCxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHR5cGUsIHRpdGxlLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwgW10pO1xcbiAgICAgICAgICAgICAgICBsZXQgenUgPSBqeGxpc3QubWFwKF8gPT4gbWQ1KF8udHlwZSArICc6JyArIF8udGl0bGUgKyAnOicgKyBfLnVybCkpO1xcbiAgICAgICAgICAgICAgICBsZXQgbSA9IG1kNSh0eXBlICsgJzonICsgdGl0bGUgKyAnOicgKyB1cmwpO1xcbiAgICAgICAgICAgICAgICBsZXQgaSA9IHp1LmluZGV4T2YobSk7XFxuICAgICAgICAgICAgICAgIGxldCBqeF9vcGVuID0gKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLnMxID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9IF8ub3BlbiA9PSAnMScgPyAnMCcgOiAnMSc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKF8ub3BlbiA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpea/gOa0u+WvhuWMmVxcXCIpLmlucHV0KChqeGxpc3QsIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gXy5tMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5zMSA9ICcwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9ICcxJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdFtpXSA9IF87XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfJyArIF8udHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly/mv4DmtLvmiJDlip/vvIzmrKLov47kvb/nlKgnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr4bljJnplJnor6/vvIzml6Dms5XlkK/nlKhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGp4bGlzdCwgaSwgXyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8ub3BlbiA9ICcwJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAganhsaXN0W2ldID0gXztcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZn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cbiAgICAgICAgICAgIGZvciAobGV0IF8gb2YganhsaXN0KSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bcXVhbGl0eV0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bXFxcImppZXhpXFxcIl0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIFN0cmluZyh1cmwpLmxlbmd0aCA+IDE5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFt1cmwsIGxyYywgaWldO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChqeEVycm9yKSB7XFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coZXJyb3IoanhFcnJvcikpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHF1YWxpdHkgPT0gXFxcIm1wM1xcXCIpIHsgLy8g6LCD55So5YW25a6D6Kej5p6Q5o6l5Y+jXFxuICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgbGF6eSxcXG4gICAgICAgICAgICAgICAgc2VhcmNoXFxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwicXQ/cnVsZT3mrYzor43pgILphY1cXFwiKTtcXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShtdXNpY0l0ZW0pKSB7XFxuICAgICAgICAgICAgICAgIG11c2ljSXRlbSA9IG11c2ljSXRlbVswXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHNvbmdOYW1lID0gKG11c2ljSXRlbS5zb25nTmFtZSB8fCBtdXNpY0l0ZW0ubmFtZSkuc3BsaXQoJyAtICcpO1xcbiAgICAgICAgICAgIHNvbmdOYW1lID0gc29uZ05hbWVbMV0gfHwgc29uZ05hbWVbMF07XFxuICAgICAgICAgICAgbGV0IHNvbmdBcnRpc3QgPSBtdXNpY0l0ZW0uYXJ0aXN0IHx8IG11c2ljSXRlbS5zaW5nZXJuYW1lIHx8IG11c2ljSXRlbS5zaW5nZXIgfHwgbXVzaWNJdGVtLmFyO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHNvbmdBcnRpc3QpKSB7XFxuICAgICAgICAgICAgICAgIC8vIHNvbmdBcnRpc3QgPSBzb25nQXJ0aXN0Lm1hcChfPT5fLm5hbWUpLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgICAgICAgICAgICAgc29uZ0FydGlzdCA9IHNvbmdBcnRpc3RbMF0ubmFtZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgTVlfUEFHRSA9IDE7XFxuICAgICAgICAgICAgZm9yIChsZXQgXyBvZiBqeGxpc3QyKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bcXVhbGl0eV0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF9bXFxcImppZXhpXFxcIl0pKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodXJsICYmIFN0cmluZyh1cmwpLmxlbmd0aCA+IDE5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFt1cmwsIGxyYywgaWldO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChqeEVycm9yKSB7XFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coZXJyb3IoanhFcnJvcikpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGlzUGxheSkgcmV0dXJuIFtmYWxzZSwgbHJjLCBpaV07XFxuICAgICAgICByZXR1cm4gW1xcXCJ0b2FzdDovL+ino+aekOWksei0pVxcXCIsIGxyYywgaWldO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBnZXRTaGFyZShqc29uLCBpc0p4LCBsZW4sIHQxLCB0MiwgYXJyLCBzaSwga2V5KSB7XFxuICAgICAgICBsZXQgdGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICByZXR1cm4gJChnZXRQYXN0ZXMoKS5jb25jYXQoXFxcIue6r+aWh+acrFxcXCIpLmNvbmNhdChhcnIgfHwgW10pLCAyLCAn6YCJ5oup5YiG5Lqr5qC85byPJykuc2VsZWN0KCh0ZXh0LCBpc0p4LCBsZW4sIHQxLCB0Miwgc2ksIGtleSkgPT4ge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5om56YeP5YiG5LqrXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaXRjaDogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV1cXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvX2NhdGNoL0ltcG9ydC50eHRcXFwiLCBKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9yZWx5MiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5a6Y5pa56ZO+5o6lXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjsgLy/ov5jmsqHlhpkgICAgXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGRlc2MsIHR5cGUsIHJlbHksIGdyb3VwO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgIT0gXFxcIue6r+aWh+acrFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRleHQgPSBzaGFyZVBhc3RlKHRleHQsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIGdyb3VwID0gXFxcIlBhc3RlXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGdyb3VwID0gXFxcIlRleHRcXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNKeCkge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFxcXCLop6PmnpBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgcmVseSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGUgPSBcXFwi5pS26JePXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIHJlbHkgPSBcXFwiMlxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGxlbiA9PSAxICYmIHQxICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICA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c6XFxuICAgICAgICAgICAgICAgIHRleHQgPSBwYXJzZVBhc3RlKHRleHQpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdMYW56b3UnOlxcbiAgICAgICAgICAgICAgICBbdXJsLCBwd2RdID0gdGV4dC5zcGxpdChcXFwiIyNcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGR1cmwgPSAkLnJlcXVpcmUoJ2xhbnpvdT9ydWxlPeatjOivjemAgumFjScpLm9uZV91cmwodXJsLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICB0ZXh0ID0gU3RyaW5nKGZldGNoKGR1cmwpKTtcXG4gICAgICAgICAgICAgICAgbGV0IHNwID0gdGV4dC5zcGxpdChcXFwi77+lXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChzcC5sZW5ndGggPT0gMykge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dCA9IHNwWzJdLnNwbGl0KFxcXCJAXFxcIilbMF0udHJpbSgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL19jYXRjaC9JbXBvcnQudHh0XFxcIiwgYmFzZTY0RGVjb2RlKHRleHQpKTtcXG4gICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3JlbHlcXFwiICsgKHJlbHkgfHwgMSkgKyBcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9ydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNldEVkaXQ6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgbGV0IF8gPSB7XFxuICAgICAgICAgICAgdHlwZTogZ2V0TXlWYXIoXFxcImp4X3R5cGVcXFwiLCBcXFwia3dcXFwiKSxcXG4gICAgICAgICAgICBvcGVuOiBnZXRNeVZhcihcXFwianhfb3BlblxcXCIsIFxcXCIxXFxcIiksXFxuICAgICAgICAgICAgZG93bjogZ2V0TXlWYXIoXFxcImp4X2Rvd25cXFwiLCBcXFwiMFxcXCIpLFxcblxcbiAgICAgICAgICAgIGltZzogZ2V0TXlWYXIoXFxcImp4X2ltZ1xcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoXFxcImp4X3RpdGxlXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGRlc2M6IGdldE15VmFyKFxcXCJqeF9kZXNjXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIHVybDogZ2V0TXlWYXIoXFxcImp4X3VybFxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBjb250ZW50OiBnZXRNeVZhcihcXFwianhfY29udGVudFxcXCIsIFxcXCJcXFwiKSxcXG5cXG4gICAgICAgICAgICBtcDM6IGdldE15VmFyKFxcXCJqeF9tcDNcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgaHE6IGdldE15VmFyKFxcXCJqeF9ocVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBzcTogZ2V0TXlWYXIoXFxcImp4X3NxXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGhyOiBnZXRNeVZhcihcXFwianhfaHJcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgenE6IGdldE15VmFyKFxcXCJqeF96cVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBqaWV4aTogZ2V0TXlWYXIoXFxcImp4X2ppZXhpXFxcIiwgXFxcIlxcXCIpLFxcblxcbiAgICAgICAgICAgIHMxOiBnZXRNeVZhcihcXFwianhfczFcXFwiLCBcXFwiMFxcXCIpLFxcbiAgICAgICAgICAgIG0xOiBnZXRNeVZhcihcXFwianhfbTFcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgczI6IGdldE15VmFyKFxcXCJqeF9zMlxcXCIsIFxcXCIwXFxcIiksXFxuICAgICAgICAgICAgbTI6IGdldE15VmFyKFxcXCJqeF9tMlxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICB0aW1lOiBuZXcgRGF0ZSgpLmdldFRpbWUoKVxcbiAgICAgICAgfTtcXG4gICAgICAgIGlmIChfLnRpdGxlICE9IFxcXCJcXFwiICYmIF8udXJsICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgdCBpbiBfKSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4XycgKyB0KTtcXG4gICAgICAgICAgICAgICAgaWYgKF9bdF0gPT0gXFxcIlxcXCIgfHwgX1t0XSA9PSBcXFwiVmZhbmFocy95MGlaeGNTTDBQSkFjUT09XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIF9bdF07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBbXSk7XFxuICAgICAgICAgICAgbGV0IHVpZHMgPSBqeGxpc3QubWFwKF9fID0+IG1kNShfXy50eXBlICsgJzonICsgX18udGl0bGUgKyAnOicgKyBfXy51cmwpKTtcXG4gICAgICAgICAgICBsZXQgaSA9IHVpZHMuaW5kZXhPZihnZXRNeVZhcignanhfdWlkJywgJy0xJykpO1xcbiAgICAgICAgICAgIGlmIChpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5wdXNoKF8pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5zcGxpY2UoaSwgMSwgXyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4X3RpZCcpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2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9IF8uc2lwWzBdICsgdXJsO2ApO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICd3eSc6XFxuICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogXFxcIue9keaYk+S6kemfs+S5kFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogXFxcImh0dHBzOi8vbXVzaWMuMTYzLmNvbVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcIktmVVBnMnBiS3BJdVh4cUcxMUUzRXpVWFR6SURiWHdXWnRNSVZZcU9VNjQ9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJocVxcXCI6IFxcXCI1Z2JRYTZSdVZ0bDJITElyOEduSkFJdGd3NGVwUkl4VzZjNkV6RzNNeGZZPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwic3FcXFwiOiBcXFwiY0pIQlNDZUphNDZHRjdOVUphRVVPa1JYOUlpTURMaFpRcXoydGkyYTZMYz1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhyXFxcIjogXFxcIktFSi94ZDZ2RVAzeStacE0vQ2JwSjFYMnAyb2JQOHRJbWNYRWk5RHlRSEU9XFxcIixcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGMgPSBDMC5zcGxpdCgvTVVTSUNfVT0oW147XFxcXHMnXFxcIl0rKS9pKTtcXG4gICAgICAgICAgICAgICAgYzAgPSBjID8gY1sxXSA6IGZhbHNlO1xcbiAgICAgICAgICAgICAgICBpZiAoIWMwKSByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgXy5qaWV4aSA9IGdldFByaXZhdGVKUyhgdXJsID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeat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4gICAgICAgICAgICAgICAgYyA9IEMxLnNwbGl0KC90b2tlbj0vaSk7XFxuICAgICAgICAgICAgICAgIGMxID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgYyA9IEMyLnNwbGl0KC9hcHBpZD0vaSk7XFxuICAgICAgICAgICAgICAgIGMyID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoLzt8JnxcXFxcbi9pKVswXTtcXG4gICAgICAgICAgICAgICAgaWYgKCFjMCB8fCAhYzEpIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBpZiAobWQ1KGMyKSAhPSBcXFwiNzhjNjBjMzVlNTkwYmVlOGUxNGJhZTQ0YmRlNTEyNzdcXFwiKSByZXR1cm4gXFxcInRvYXN0Oi8vc2lnbmtleemUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgIGdldGtnamlleGkoXFxcIumFt+eLl+amguW/teeJiFxcXCIsIFxcXCJodHRwczovL2dhdGV3YXkua3Vnb3UuY29tXFxcIiwgYzAsIGMxLCBcXFwiMzExNlxcXCIsIGMyKTtcXG4gICAgICAgICAgICAgICAgXy5zaWduaW4gPSAwO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICdrdyc6XFxuICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogXFxcIumFt+aIkemfs+S5kFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidXJsXFxcIjogXFxcImh0dHA6Ly9tb2JpLmt1d28uY25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm1wM1xcXCI6IFxcXCJSWGxuWk55WUlVYjEzTXVrSWs5UlRRPT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcIlZNK3BhVEZ1cHMxYWVTb24rejBoMmc9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwic3FcXFwiOiBcXFwiUEdBbkNRQ2p1Slh6YmlhK3ArMEh0UT09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIC8vIFxcXCJoclxcXCI6IFxcXCJ0cTFwWDRUL1kxM3ZUZUEzWmZLWG5WWDJwMm9iUDh0SW1jWEVpOUR5UUhFPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiaHJcXFwiOiBcXFwiMzd1VFE2S2l0NlM3Yzc3SUhxTjFiUT09XFxcIixcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmICghQzApIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKEMwKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAna3cyJzpcXG4gICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihfLCB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi5rOi54K56Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBcXFwiaHR0cHM6Ly9iZC1hcGkua3V3by5jblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcImxvcTZlbm9BdkprYWdMQTg2U0VpSENCNlZqTXBydkhUOExGdnVnYnVmcVE9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJocVxcXCI6IFxcXCJlay9ibVUwOXZYRHFQTEhyVEhEanZTQjZWak1wcnZIVDhMRnZ1Z2J1ZnFRPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwic3FcXFwiOiBcXFwiUHc0VlpCeUFBUW92aVA3cVpvS1V1aVR5UW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Rva2VuJzogJyR7YzF9JyxcXG4gICAgICAgICdkZXZJZCc6ICcke2MyfSdcXG4gICAgfVxcbn0pKS5kYXRhLnVybDtgKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnbWcnOlxcbiAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IFxcXCLlkqrlkpXpn7PkuZBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwczovL20ubXVzaWMubWlndS5jblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcImhTM2RyWWtwN09JMXhLT2MyQmtmcVE9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiaHFcXFwiOiBcXFwiUHdYcnZ2em0wNGZ0b0NuVVdrcEpGdz09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzcVxcXCI6IFxcXCI1L21LOVRjWjFpOGgvWTl6MU5IaHp3PT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImhyXFxcIjogXFxcInc1bFFueVhWYWhKc1lHZVVlK3BOdXc9PVxcXCIsXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL1NFU1NJT049L2kpO1xcbiAgICAgICAgICAgICAgICBjMCA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KC87fCZ8XFxcXG4vaSlbMF07XFxuICAgICAgICAgICAgICAgIGlmICghYzApIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKGBoZWFkZXJzID0ge1xcbiAgICBoZWFkZXJzOiB7XFxuICAgICAgICBcXFwiUmVmZXJlclxcXCI6IF8udXJsICsg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lXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLikajop6PmnpDlr7zlhaVcIixcInBhdGhcIjpcInJlbHkxXCIsXCJydWxlXCI6XCJqczpcXG5sZXQgaW5kZXjCoCA9IDA7XFxubGV0IGluZGV4MiA9IDA7XFxubGV0IGluZGV4MywganhsaXN0LCBqc29uID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9fY2F0Y2gvSW1wb3J0LnR4dFxcXCIpKTtcXG5mb3IgKGxldCBrZXkgaW4ganNvbikge1xcbiAgICBpZiAoanNvbltrZXldLmxlbmd0aCAhPSAwKSB7XFxuICAgICAgICBpbmRleCArPSBqc29uW2tleV0ubGVuZ3RoO1xcbiAgICAgICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwianhsaXN0X1xcXCIgKyBrZXksIFtdKTtcXG4gICAgICAgIGluZGV4MyA9IGp4bGlzdC5sZW5ndGg7XFxuICAgICAgICBqeGxpc3QgPSBqc29uW2tleV0uY29uY2F0KGp4bGlzdCk7XFxuICAgICAgICBsZXQgbWFwID0gbmV3IE1hcCgpO1xcbiAgICAgICAganhsaXN0LmZvckVhY2gob2JqID0+IHtcXG4gICAgICAgICAgICBsZXQga2V5ID0gb2JqLnRpdGxlICsgb2JqLnVybDtcXG4gICAgICAgICAgICBpZiAoIW1hcC5oYXMoa2V5KSkge1xcbiAgICAgICAgICAgICAgICBtYXAuc2V0KGtleSwgb2JqKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAob2JqLnRpbWUgPiBtYXAuZ2V0KGtleSkudGltZSkge1xcbiAgICAgICAgICAgICAgICAgICAgbWFwLnNldChrZXksIG9iaik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGp4bGlzdCA9IEFycmF5LmZyb20obWFwLnZhbHVlcygpKTtcXG4gICAgICAgIGluZGV4MiAr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gICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmxvZ0RhdGEobmV3RGF0YXMsIHNpLCBuYW1lIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgIGVsc2UgaWYgKHR5cGUgPT09IDEpXFxuICAgICAgICAgICAgcmV0dXJuICQobmFtZSB8fCBcXFwiXFxcIiwgXFxcIuehruWumuWIhue7hOWQjeensFxcXCIpLmlucHV0KChzaSwgbmV3RGF0YXMpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDEsXFxuICAgICAgICAgICAgICAgICAgICBzaTogc2ksXFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgIGRhdGE6IG5ld0RhdGFzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5nZXRTaGFyZShqc29uLCBmYWxzZSwgbmV3RGF0YXMubGVuZ3RoKTtcXG4gICAgICAgICAgICB9LCBzaSwgbmV3RGF0YXMpO1xcbiAgICB9LCBhZGRsaXN0LCBfLnNpLCBfLnR5cGUsIF8ubmFtZSksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgIH1dXFxuICAgIH0sXFxuICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdhZGQnKVxcbn0pO1xcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIua4qemmqOaPkOekulwiLFwicGF0aFwiOlwibm90aWNlXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSBmdW5jdGlvbigpIHtcXG4gICAgbGV0IGYgPSBcXFwiR3JheVxcXCI7XFxuICAgIGxldCB0ID0gZmFsc2U7XFxuICAgIGxldCBhcnIgPSBbXTtcXG4gICAgbGV0IHVwID0gZ2V0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnJyk7XFxuICAgIGxldCB1cmwsIHYsIHJ1biwgVDtcXG4gICAgaWYgKHVwICE9ICcxJykge1xcbiAgICAgICAgbGV0IHZlcnNpb24gPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImhpa2VyOi8vaG9tZUDmrYzor43pgILphY1cXFwiKSkudmVyc2lvbjtcXG4gICAgICAgIGlmICh1cCA9PSAnJykge1xcbiAgICAgICAgICAgIFt1cmwsIHYsIHJ1bl0gPSAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPeatjOivjemAgumFjVxcXCIpLmxpc3Rfb25lKFxcXCJodHRwczovL3d3ci5sYW56b3VpLmNvbS9iMDNyMzc5aGNcXFwiLCBcXFwiZ2NzcFxcXCIpO1xcbiAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAndHJ1ZScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgKi9cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgdiA9IHZlcnNpb24gKyAxO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHZlcnNpb24gPCB2KSB7XFxuICAgICAgICAgICAgZiA9IFxcXCJyZWRcXFwiO1xcbiAgICAgICAgICAgIHQgPSBcXFwi5qOA5rWL5Yiw5paw54mI5pu05paw77yM54K55Ye75LqG6Kej6K+m5oOF44CCXFxcIjtcXG4gICAgICAgICAgICBUID0gXFxcIuabtOaWsOWGheWuuVxcXCI7XFxuICAgICAgICAgICAgaWYgKHVwID09ICcnKSB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKCd1cGRhdGUwJywgJzEnKSA9PSAnMScpIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDmj5DnpLonLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+ajgOa1i+WIsOS9oOeahOinhOWImeeJiOacrOWwj+S6juacjeWKoeWZqOeJiOacrO+8jOaYr+WQpueri+WNs+abtOaWsO+8nycsXFxuICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChkYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPeatjOivjemAgumFjVxcXCIpLm9uZV91cmwoZGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh1cCwgdmVyc2lvbikgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsYW56b3U/cnVsZT3mrYzor43pgILphY1cXFwiKS5vbmVfaW5mbyh1cCwgXFxcImdjc3BcXFwiLCB2ZXJzaW9uKTtcXG4gICAgICAgICAgICB9LCB1cmwgfHwgdXAsIHZlcnNpb24pO1xcbiAgICAgICAgICAgIGFyci5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfnqIvluo/orr7nva4nLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9pbnN0YWxsI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5IyNub1JlZnJlc2gjP3BhZ2VUaXRsZT3nqIvluo/orr7nva4nO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgaWYgKCF0KSB7XFxuICAgICAgICBUID0gXFxcIueoi+W6j+iuvue9rlxcXCI7XFxuICAgICAgICB1cmwgPSBcXFwiaGlrZXI6Ly9wYWdlL2luc3RhbGwjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjI25vUmVmcmVzaCNcXFwiO1xcbiAgICAgICAgbGV0IGhvdXIgPSBuZXcgRGF0ZSgpLmdldEhvdXJzKCk7XFxuICAgICAgICBpZiAoaG91ciA8IDUpIHtcXG4gICAgICAgICAgICB0ID0gXFxcIua3seWknO+8jOeOsOWcqOeahOWknO+8jOeGrOW+l+WPquaYr+i/mOacquaUueWPmOeahOS5oOaDr1xcXCI7XFxuICAgICAgICB9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FwuY29tLiovLCBcXFwiLmNvbS9hamF4bS5waHBcXFwiKTtcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkLmhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICBib2R5XFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgcGF0aCA9IF8udXJsO1xcbiAgICAgICAgICAgICAgICBob3N0ID0gXy5kb207XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdSA9IGhvc3QgKyBcXFwiL2ZpbGUvXFxcIiArIHBhdGg7XFxuICAgICAgICBrID0gSlNPTi5wYXJzZShmZXRjaCh1LCB7XFxuICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvbjtcXG4gICAgICAgIGsgPSBBcnJheS5pc0FycmF5KGspID8ga1swXSA6IGs7XFxuICAgICAgICBpZiAocnVuKSByZXR1cm4gaztcXG4gICAgICAgIGxldCBmID0gXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvX2ZpbGVTZWxlY3RfcnVsZS5qc29uXFxcIjtcXG4gICAgICAgIGRvd25sb2FkRmlsZShrLCBmKTtcXG4gICAgICAgIHJldHVybiBmO1xcbiAgICB9IGNhdGNoIChlcnIyKSB7XFxuICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgIH1cXG59O1xcbiQuZXhwb3J0cyA9IHtcXG4gICAgbGlzdF9vbmU6IGZ1bmN0aW9uKHVybCwgcHdkLCBydW4pIHtcXG4gICAgICAgIGxldCBzcmMgPSBmZXRjaCh1cmwsIGhlYWQpO1xcbiAgICAgICAgZXZhbChzcmMubWF0Y2goL3ZhciBwZ3M7KFtcXFxcc1xcXFxTXSo/cGdzLis7KS8pWzFdKTtc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biAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiPGI+4oCc4oCc56Gu5a6a5pu05paw4oCd4oCdPC9iPlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKHVybCwgcHdkLCBpdGVtLCBpc0xvb2spID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdSdWxlX25vdXBkYXRlJykgPT0gJzEnICYmICFpc0xvb2spIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrKHRydWUpLCBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgIG9uZV91cmxcXG4gICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2xhbnpvdT9ydWxlPeatjOivjemAgumFjVxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgSyA9IG9uZV91cmwodXJsLCBwd2QsIDEsIDAsIGl0ZW0pO1xcbiAgICAgICAgICAgICAgICBpZiAoIUspIHtcXG4gICAgICAgICAgICAgICAgICAgIEsgPSBvbmVfdXJsKHVybCwgcHdkLCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIUspIHtcXG4gICAgICAgICAgICAgICAgICAgIEsgPSBvbmVfdXJsKHVybC5zcGxpdChcXFwiP1xcXCIpWzBdLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChLKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZiA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoSywgZik7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ojrflj5bkuIvovb3pk77mjqXlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgdXJsLCBwd2QsIGl0ZW0sICEhaXNMb29rKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIueoi+W6j+iuvue9rlwiLFwicGF0aFwiOlwiaW5zdGFsbFwiLFwicnVsZVwiOlwianM6XFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJywge30pKS5ydWxlKTtcXG5sZXQgXyA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiaGlrZXI6Ly9ob21lQOatjOivjemAgumFjVxcXCIpKTtcXG5sZXQgZCA9IFtdO1xcbmQucHVzaCh7XFxuICAgIGltZzogXy5pY29uLFxcbiAgICBjb2xfdHlwZTogJ3BpY18xX2NlbnRlcicsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgIH0sXFxuICAgIHVybDogJChbXFxuICAgICAgICBcXFwiW+mFt+eLl+amguW/teeJiF0g5ZCs5q2M6aKG5Lya5ZGYXFxcIixcXG4gICAgICAgIFxcXCJbUVHpn7PkuZBdIOWIt+aWsGNvb2tpZVxcXCIsXFxuICAgIF0sIDEsIFxcXCLpgInmi6nmianlsZXmk43kvZxcXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAzOyBpKyspIHtcXG4gICAgICAgICAgICBjbGVhck15VmFyKCd2aXBydWxlX2MnICsgaSk7XFxuICAgICAgICB9XFxuICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgY2FzZSAnW1FR6Z+z5LmQXSDliLfmlrBjb29raWUnOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZDtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignYmFjaycpID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2JhY2snKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gW107XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5Yi35pawY29va2llJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IF8gPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3RfcXEnLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXyA9PiBtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiZTJjMWE0YmY4ZDU4ZDE3MDNhNWU4MTA5ZTFmOTBjYzBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn5q+P5LiD5aSp6ZyA6KaB5Yi35paw5LiA5qyhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJ2Nvb2tpZSDpnIDopoHljIXlkKsgcW1fa2V5c3Qg5ZKMIHVpbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogNCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcInZpcHJ1bGVfYzBcXFwiLCBpbnB1dCk7YCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LuO6Kej5p6Q6I635Y+WXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9zZWFyY2g2XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNpZ25pbiA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvb2tpZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL0Nvb2tpZTogXFxcIihbXlxcXCJdKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBjb29raWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5q2j5Zyo6LCD55So6Kej5p6Q5Y+C5pWwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5aW95YOP6L+Y5rKh5Yiw5Yi35paw5pe26Ze077yM56Gu5a6a6I635Y+W5ZCX77yfXFxcIikuY29uZmlybSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29va2llID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvQ29va2llOiBcXFwiKFteXFxcIl0rKS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBjb29raWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mraPlnKjosIPnlKjop6PmnpDlj4LmlbAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ayoeaciVFR6Z+z5LmQ55qE6Kej5p6QXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi56Gu5a6a5Yi35pawXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9tZW51NlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSBTdHJpbmcoZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzAnKSkudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNvb2tpZSAmJiBjb29raWUgIT0gXFxcIlxcXCIgJiYgY29va2llLm1hdGNoKFxcXCJxbV9rZXlzdD1cXFwiKSAmJiBjb29raWUubWF0Y2goXFxcInVpbj1cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmkgPSAkLnJlcXVpcmUoXFxcInFxP3J1bGU95q2M6K+N6YCC6YWNXFxcIikucmVmcmVzaF9sb2dpbihjb29raWUsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHVyaSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgoW3FtX2tleXN0LCB1aW5dKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29va2llID0gYHFtX2tleXN0PSR7cW1fa2V5c3R9OyB1aW49JHt1aW59O2BcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5Yi35paw5oiQ5YqfJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICdjb29raWXliLfmlrDmiJDlip8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPGJyPjxoNiBzdHlsZT1cXFwidGV4dC1hbGlnbjogY2VudGVyO1xcXCI+JyArIGNvb2tpZSArIFxcXCI8L2g2PlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlpI3liLZjb29raWVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoY29va2llKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignYmFjaycsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgXFxcImNvcHk6Ly9cXFwiICsgY29va2llO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBjb29raWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2Nsb3VkNlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWFpei/m+ino+aekFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKChrZXksIHVpbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2JhY2snLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzEnLCB1aW4pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXRFZGl0MihcXFwicXFcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwga2V5LCB1aW4pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2Rvd25sb2FkNlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVyaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVyaTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9jb29raWXmoLzlvI/plJnor69cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogJ+WIt+aWsOaIkOWKnycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnW+mFt+eLl+amguW/teeJiF0g5ZCs5q2M6aKG5Lya5ZGYJzpcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgodHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCflkKzmrYzpoobkvJrlkZgnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBfID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pXFxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXyA9PiBtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiYzg3N2FlNzJiOTdiYzI2NzIwYWQ4YjFhMzkzNjJkNDdcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBkID0gW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn5q+P5aSp5Y+q6IO96aKG5Y+W5LiA5qyhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICAgICAgWyd1c2VyaWQnLCAndG9rZW4nLCAnc2lnbmtleSddLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3ZpcHJ1bGVfYycgKyBpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcInZpcHJ1bGVfYyR7aX1cXFwiLCBpbnB1dCk7YCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LuO6Kej5p6Q6I635Y+WXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX3NlYXJjaDZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8uc2lnbmluID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWF0ID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvXFxcIihbXlxcXCJdKylcXFwiLCBcXFwiKC4rKVxcXCIsIFxcXCIzMTE2XFxcIiwgXFxcIiguKylcXFwiLyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBtYXRbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MxJywgbWF0WzJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMicsIG1hdFszXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5q2j5Zyo6LCD55So6Kej5p6Q5Y+C5pWwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuS7iuWkqeWlveWDj+W3sue7j+etvuWIsOi/h+S6hu+8jOehruWumuiOt+WPluWQl++8n1xcXCIpLmNvbmZpcm0oKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG1hdCA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgXy5qaWV4aSkubWF0Y2goL1xcXCIoW15cXFwiXSspXFxcIiwgXFxcIiguKylcXFwiLCBcXFwiMzExNlxcXCIsIFxcXCIoLispXFxcIi8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMCcsIG1hdFsxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MxJywgbWF0WzJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzInLCBtYXRbM10pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5q2j5Zyo6LCD55So6Kej5p6Q5Y+C5pWwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ayoeacieamguW/teeJiOeahOino+aekFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnoa7lrprpooblj5ZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25fbWVudTZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXNlcmlkID0gZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRva2VuID0gZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNpZ25rZXkgPSBnZXRNeVZhcigndmlwcnVsZV9jMicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KHNpZ25rZXkpID09IFxcXCI3OGM2MGMzNWU1OTBiZWU4ZTE0YmFlNDRiZGU1MTI3N1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0MSA9ICQuZGF0ZUZvcm1hdChuZXcgRGF0ZSgpLmdldFRpbWUoKSwgJ3l5eXlNTWRkJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdDIgPSAkLmRhdGVGb3JtYXQoXy50aW1lLCAneXl5eU1NZGQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtYXQgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9cXFwiKFteXFxcIl0rKVxcXCIsIFxcXCIoLispXFxcIiwgXFxcIjMxMTZcXFwiLCBcXFwiKC4rKVxcXCIvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtYXR4ID0gdXNlcmlkID09IG1hdFsxXSAmJiB0b2tlbiA9PSBtYXRbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0eCAmJiB0MSA8IHQyICYmIF8uc2lnbmluID09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5LuK5aSp5bey57uP562+5Yiw6L+H5LqGJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5MaXRlX1NpZ25pbihcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2tlbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2lnbmtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0eFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vc2lnbmtleemUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBfKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPGI+XFxcIiArIFN0cmluZyhfLnZlcnNpb24pLnJlcGxhY2UoLyhcXFxcZFxcXFxkKShcXFxcZFxcXFxkKSQvLCBcXFwiLSQxLSQyXFxcIikuZm9udGNvbG9yKFxcXCJyZWRcXFwiKS5zbWFsbCgpICsgXFxcIjwvYj5cXFwiL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CIsIHZlcnNpb24sIDEpO1xcbiAgICAgICAgICAgICAgICB9LCBob3N0ICsgJy90cC8nICsgXy5pZCwgdmVyc2lvbiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IF8ubmFtZV9hbGwsXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSk7XFxuICAgICAgICBzZXRSZXN1bHQobGlzdCk7XFxuICAgIH0sIF8udmVyc2lvbiksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBwYWdlVGl0bGU6ICfljoblj7LniYjmnKwnLFxcbiAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgIH1cXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiPlxcXCIgKyBcXFwi6buY6K6k6K6+572uPGJyPjxicj48c21hbGw+5bCP56iL5bqP6buY6K6k6K6+572uPC9zbWFsbD5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpICsgXFxcIjwvYj5cXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcImNhcmRfcGljXzJcXFwiLFxcbiAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX3BpYzNcXFwiLFxcbiAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjI25vUmVmcmVzaCNcXFwiKS5ydWxlKCh0eXBlKSA9PiB7XFxuICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgbGV0IGxpbmUgPSAoKSA9PiBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuayd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6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vZmxhYy5saWZlLyNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS8xMC5wbmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mnpzmoLg8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9naHlpbnl1ZS5jb20vI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPkxYIE11c2ljPC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL2RvY3MubHhtdXNpYy50b3AvI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vZG9jcy5seG11c2ljLnRvcC9sb2dvLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5YWt6Z+zPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLngrnlh7vnoa7lrprot7PovaznvZHlnYBcXFxcblxcXCIgKyB1cmwpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9LCBcXFwiaHR0cHM6Ly93d3cuc2l4eWluLmNvbS83NjQ1Lmh0bWxcXFwiKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS8xMC5wbmcnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7mopPmvoQ8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIueCueWHu+ehruWumui3s+i9rOe9keWdgFxcXFxu5o+Q5Y+W56CB77yabHhtdXNpY1xcXCIpLmNvbmZpcm0oKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICB9LCBcXFwiaHR0cHM6Ly93d3AubGFuem91cS5jb20vYjAyZnE5dzhkXFxcIiksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9zeXN0ZW0vMTAucG5nJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+aUt1bjwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5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PC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdodHRwczovL211c2ljZnJlZS51cHVwLmZ1bi8jbm9IaXN0b3J5IycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9tdXNpY2ZyZWUudXB1cC5mdW4vaW1nL2xvZ28ucG5nJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7lrpjmlrk8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIueCueWHu+ehruWumuWkjeWItumTvuaOpVxcXFxuXFxcIiArIHVybCkuY29uZmlybSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgdXJsO1xcbiAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgIH0sIFxcXCJodHRwczovL2dpdGVlLmNvbS9tYW90b3VtYW8vTXVzaWNGcmVlUGx1Z2lucy9yYXcvbWFzdGVyL3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuS9nOiAhTwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vZ2l0ZWUuY29tL1Rob21hc1lvdS9tdXNpY2ZyZWUvcmF3L21hc3Rlci9kaXN0L3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPumAn+aCpjwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHA6Ly9hZGFkMjN1LmFwcGluc3RhbGwubGlmZS9kaXN0L19wbHVnaW5zL3BsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuaMpeadr+WKnTwvYj4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi54K55Ye756Gu5a6a5aSN5Yi26ZO+5o6lXFxcXG5cXFwiICsgdXJsKS5jb25maXJtKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgfSwgXFxcImh0dHBzOi8vcmF3Lm5pdW1hNjY2YmV0LmJ1enovSHVpYnEva2VlcC1hbGl2ZS9tYXN0ZXIvTXVzaWNfRnJlZS9teVBsdWdpbnMuanNvblxcXCIpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzEwLnBuZydcXG4gICAgICAgIH0pO1xcblxcblxcblxcblxcbiAgICAgICAgbGluZSgpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuaSreaUvumfs+i0qDwvYj4nLnNtYWxsKCksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbl9tZW51NicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgcGxheV9wbGF0Zm9ybSA9IGdldEl0ZW0oJ3BsYXlfcGxhdGZvcm0nLCAnMCcpO1xcbiAgICAgICAgdHMuc2xpY2UoMSwgNSkubWFwKCh0aXRsZSwgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcodGl0bGUpLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoaSA9PSBwbGF5X3BsYXRmb3JtID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9pY29uJyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCdwbGF5X3BsYXRmb3JtJywgaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBTdHJpbmcoaSkpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG5cXG5cXG5cXG4gICAgICAgIGxpbmUoKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7lvLnnqpfmj5DnpLo8L2I+Jy5zbWFsbCgpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzQxLnBuZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgdTAgPSBnZXRJdGVtKCd1cGRhdGUwJywgJzEnKSA9PSAnMSc7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5bCP56iL5bqP5pu05pawPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodTApID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgndXBkYXRlMCcsIHUwKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHUwID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAodTAgPyA1NSA6IDYzKSArICcuc3ZnJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgdTEgPSBnZXRJdGVtKCd1cGRhdGUxJywgJzEnKSA9PSAnMSc7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+5qaC5b+154mI562+5YiwPC9iPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodTEpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgndXBkYXRlMScsIHUxKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHUxID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAodTEgPyA1NSA6IDYzKSArICcuc3ZnJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgdTIgPSBnZXRJdGVtKCd1cGRhdGUyJywgJzAnKSA9PSAnMSc7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+cXHpn7PkuZDliLfmlrA8L2I+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1MikgPT4ge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKCd1cGRhdGUyJywgdTIpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgdTIgPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh1MiA/IDU1IDogNjMpICsgJy5zdmcnXFxuICAgICAgICB9KTtcXG5cXG5cXG5cXG4gICAgICAgIGxpbmUoKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8Yj7pu5jorqTkuLvpobU8L2I+Jy5zbWFsbCgpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vc3lzdGVtLzQyLnBuZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgcGxhdGZvcm0gPSBnZXRJdGVtKCdwbGF0Zm9ybScsICdrdycpO1xcbiAgICAgICAgcGxhdGZvcm1zLnNsaWNlKDAsIDgpLm1hcCh0aXRsZSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlID09IHBsYXRmb3JtID8gUmljaChTdHJvbmcoQ29sb3IodGl0bGUpKSkgOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzQnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCdwbGF0Zm9ybScsIHRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIHRpdGxlKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuXFxuXFxuXFxuICAgICAgICBsaW5lKCk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPGI+6buY6K6k5pCc57SiPC9iPicuc21hbGwoKSxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL3N5c3RlbS80My5wbmcnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IHNfcGxhdGZvcm0gPSBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3Jyk7XFxuICAgICAgICBwbGF0Zm9ybXMuc2xpY2UoMSwgNikubWFwKHRpdGxlID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUgPT0gc19wbGF0Zm9ybSA/IFJpY2goU3Ryb25nKENvbG9yKHRpdGxlKSkpIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF81JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0aXRsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnc19wbGF0Zm9ybScsIHRpdGxlKTtcXG4gICAgICAgICAgIC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XCLlkqrlkpXpn7PkuZBcXFwiLFxcbiAgICBcXFwi5L2c6ICFXFxcIjogXFxcIuaNkOi1oOS4k+WxnlxcXCIsXFxufVxcbmxldCB6ID0gT2JqZWN0LmtleXMoXyk7XFxuZm9yIChsZXQgcCBvZiB6KSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiPlxcXCIgKyBfW3BdLmJpZygpLmZvbnRjb2xvcihcXFwicHVycGxlXFxcIikgKyBcXFwiPC9iPlxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImNhcmRfcGljXzJcXFwiLFxcbiAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykocCksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHBhZ2VUaXRsZTogX1twXSArICfphY3nva4nXFxuICAgICAgICB9LFxcbiAgICAgICAgdXJsOiAkKFxcXCIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKHR5cGUpID0+IHtcXG4gICAgICAgICAgICBzd2l0Y2ggKHR5cGUpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAncXEnOlxcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gWydjb29raWXmnInmlYjmnJ835aSp77yM5bey5pSv5oyB5Yi35pawY29va2llJywgJ+W8ueeql+aPkOekuum7mOiupOWFs+mXre+8jOivt+aJi+WKqOW8gOWQrycsIFsncW1fa2V5c3QnLCAndWluJ11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ3d5JzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsnd2VhcGnlt7LmlLnmiJBlYXBpJywgJ+W6lOivpeaJgOaciemfs+i0qOmDveiDveiOt+WPluS6hicsIFsnTVVTSUNfVSddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdrZyc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+S4jeWPr+S7peaKk+e9kemhteerr+eahGNvb2tpZScsICfjgIAnLCBbJ3VzZXJpZCcsICd0b2tlbiddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdrZzInOlxcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gWyflt7LmlK/mjIHmr4/lpKnnrb7liLDpoobkvJrlkZgnLCAnc2lnbmtleeWFs+mUruivjUxuVDZ4cCcsIFsndXNlcmlkJywgJ3Rva2VuJywgJ3NpZ25rZXknXV07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAna3cnOlxcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gWyfoh6rlt7Hlhplqc+iOt+WPlicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gJ2h0dHBzOi8vZ2l0aHViLmNvbS95aHNqMDkxOS9tdXNpY19hcGkvYmxvYi9tYWluL2xpYi9hcGkva3V3by9tb2R1bGUvc29uZy5kYXJ0JywgXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2h0dHBzOi8vZ2l0aHViLmNvbS9HU1FaL0t1d29NdXNpY0FwaS9ibG9iL21hc3Rlci9rdy91cmwuanMnLCBbJ3JpZOS8oOWPguS4uu+8mnQxXFxcXG5icuS8oOWPguS4uu+8mnQyXFxcXG5kZXPosIPnlKjvvJokLnJlcXVpcmUoXFxcImt3P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuZGVzKHN0cik7J11cXG4gICAgICAgICAgICAgICAgICAgIF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAna3cyJzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsn5LuOQVBQ5oqT5YyFJywgJ+OAgCcsIFsndWlkJywgJ3Rva2VuJywgJ2RldmlkJ11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ21nJzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsn5LuO572R6aG155m75b2VJywgJ+OAgCcsIFsnU0VTU0lPTiddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICfkvZzogIUnOlxcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gJ3RvYXN0Oi8v6YKi5ZWK77yM5L2c6ICF5LiN5oOz5pS25Yiw5b6L5biI5Ye977yM5pqC5LiN5pSv5oyBJztcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodHlwZSAhPSAn5L2c6ICFJykge1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDM7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcigndmlwcnVsZV9jJyArIGkpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHVybCA9ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjI25vUmVmcmVzaCNcXFwiKS5ydWxlKCh0eXBlLCBbdGl0bGUsIGRlc2MsIGNvb2tpZXNdKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZCA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XTtcXG4gICAgICAgICAgICAgICAgICAgIGNvb2tpZXMubWFwKCh0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiB0eXBlID09ICdrdycgPyA3IDogMyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3ZpcHJ1bGVfYycgKyBpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcInZpcHJ1bGVfYyR7aX1cXFwiLCBpbnB1dCk7YCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc56Gu5a6a5a+85YWl4oCd4oCdXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKCh0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RWRpdDIodHlwZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdHlwZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgIH0sIHR5cGUsIGFycik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICB9LCBwKSxcXG4gICAgfSk7XFxufVxcbnNldFJlc3VsdChkKTtcIn1dIiwiaWNvbiI6Imh0dHA6Ly9tbWJpei5xcGljLmNuL21tYml6X3BuZy81czdKMjhVOUdIVmljRDdndXZ5YmFzZTg2SGhIQzEyb09EYnRyc2dLN0N4cmo1UXBMNmdLbnlpYmVaRHdFS0lWS1VPdFBvSGN4cGZ3YTBwb25aMWlhNW5sQS8wP3d4X2ZtdD1wbmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment