xiaomianao666

小程序:Alist V3

Feb 17th, 2023
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@Alist V3@eyJmaXJzdEhlYWRlciI6ImNsYXNzIiwibGFzdF9jaGFwdGVyX3J1bGUiOiIiLCJ0aXRsZSI6IkFsaXN0IFYzIiwiYXV0aG9yIjoiSm9lIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wYWdlPWZ5cGFnZSIsInZlcnNpb24iOjEyLCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InRvb2wiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczokLnJlcXVpcmUoXCJob21lXCIpIiwic2VhcmNoX3VybCI6IiIsImdyb3VwIjoi4pGg572R55uYIiwic2VhcmNoRmluZCI6IiIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoiIiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IiIsInVhIjoibW9iaWxlIiwicHJlUnVsZSI6IiQuZXh0ZW5kKHtcbiAgICB0ZXh0OiBbXCJodG1cIiwgXCJodG1sXCIsIFwieG1sXCIsIFwiamF2YVwiLCBcInByb3BlcnRpZXNcIiwgXCJzcWxcIiwgXCJqc1wiLCBcIm1kXCIsIFwianNvblwiLCBcImNvbmZcIiwgXCJpbmlcIiwgXCJ2dWVcIiwgXCJwaHBcIiwgXCJweVwiLCBcImJhdFwiLCBcImdpdGlnbm9yZVwiLCBcInltbFwiLCBcImdvXCIsIFwic2hcIiwgXCJjXCIsIFwiY3BwXCIsIFwiaFwiL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gICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBub3cucGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgIFxcXCJvdHBfY29kZVxcXCI6IFxcXCJcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pKVxcbiAgICAgICAgaWYgKHJlcy5jb2RlID09IDIwMCkge1xcbiAgICAgICAgICAgIGhlYWRlcnNbXFxcIkF1dGhvcml6YXRpb25cXFwiXSA9IHJlcy5kYXRhLnRva2VuXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRvYXN0KFxcXCLnmbvpmYblpLHotKVcXFwiKVxcbiAgICAgICAgICAgIGxvZyhyZXMpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLotKblj7flr4bnoIHplJnor69cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgaWYgKHBhdGggPT0gXFxcIi9cXFwiKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLimpnvuI/orr7nva5cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgYWxpc3QuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGkgPT0gc2VsZWN0ZWQgPyAkLnJlcXVpcmUoXFxcImFwaVxcXCIpLmNvbG9yKGl0ZW0ubmFtZSwgXFxcInJlZFxcXCIpIDogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogaSA9PSBzZWxlY3RlZCA/IFxcXCJ4NTovL1xcXCIgKyBub3cudXJsIDogJCgpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwic2VsZWN0ZWRcXFwiLCBpICsgXFxcIlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJcXG4gICAgICAgIH0pXFxuICAgICAgICBpZiAobm93LnNlYXJjaCkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi8J+UjiDmkJzntKJcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2Uvc2VhcmNoP3BhZ2U9ZnlwYWdlJnU9XFxcIiArIG5vdy51cmwgKyBcXFwiJnBhdGg9XFxcIiArIHBhdGgsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgbm93OiBub3dcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmlrDlu7rmlofku7blpLlcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIlxcXCIpLmlucHV0KChwYXRoLCBub3csIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvbWtkaXJcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBwYXRoICsgXFxcIi9cXFwiICsgaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIm+W7uuWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCwgbm93LCBoZWFkZXJzKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmlrDlu7rmlofku7ZcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIlxcXCIpLmlucHV0KChwYXRoLCBub3csIGhlYWRlcnMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnNbXFxcIkZpbGUtUGF0aFxcXCJdID0gZW5jb2RlVVJJKHBhdGggKyBcXFwiL1xcXCIgKyBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHJlcXVlc3Qobm93LnVybCArIFxcXCJhcGkvZnMvcHV0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiBcXFwiUFVUXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liJvlu7rmiJDlip9cXFwiXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgsIG5vdywgaGVhZGVycylcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5re75YqgYXJpYTLku7vliqFcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIlxcXCIsIFxcXCLlpJrmnaHnlKjlm57ovabpmpTlvIBcXFwiKS5pbnB1dCgocGF0aCwgbm93LCBoZWFkZXJzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZShwb3N0KG5vdy51cmwgKyBcXFwiYXBpL2ZzL2FkZF9hcmlhMlxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IGlucHV0LnNwbGl0KFxcXCJcXFxcblxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVyc1xcbiAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liJvlu7rmiJDlip9cXFwiXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgsIG5vdywgaGVhZGVycylcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcblxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgICAgIH0pXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIC8vIOaOkuW6j1xcbiAgICAgICAgc29yci5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGlmIChuc29ydCA9PSBpdGVtKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0gKyBcXFwi4oaTXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAobnNvcnQuaW5jbHVkZXMoXFxcIuWPjVxcXCIpICYmIG5zb3J0LmluY2x1ZGVzKGl0ZW0pKSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0gKyBcXFwi4oaRXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0gKyBcXFwi4oaVXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFwic29ydFxcXCIsIFxcXCLpu5jorqRcXFwiKSA9PSBpdGVtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwic29ydFxcXCIsIGl0ZW0gKyBcXFwi5Y+NXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwic29ydFxcXCIsIGl0ZW0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgbGV0IGJpZCA9IHBhdGggKyBcXFwiLWxvYWRpbmctXFxcIiArIE1ZX1BBR0U7XFxuICAgIGxldCBkMiA9IFtdO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLliqrlipvliqDovb3kuK3vvIzor7fnqI3lgJkuLi5cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGJpZCxcXG4gICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgIH1cXG4gICAgfSlcXG4gICAgc2V0UmVzdWx0KGQpO1xcblxcbiAgICB0cnkge1xcbiAgICAgICAgLy8g6I635Y+W5paH5Lu25YiX6KGoXFxuICAgICAgICB2YXIgbGlzdCA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9saXN0XFxcIiwge1xcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhdGhcXFwiOiBwYXRoLFxcbiAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBhbGlzdFtzZWxlY3RlZF1bXFxcIm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HVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgMjogJC50b1N0cmluZygodXJsLCBsaXN0LCB1LCBwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzdWJ0aXRsZXMgPSAkLnJlcXVpcmUoXFxcImFwaVxcXCIpLmdldFN1YnRpdGxlcyhsaXN0LCB1LCBwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VidGl0bGVzLmxlbmd0aCA+IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuYW1lbGlzdCA9IHN1YnRpdGxlcy5tYXAoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lbGlzdCwgMSwgXFxcIuivt+mAieaLqeWtl+W5lVxcXCIpLnNlbGVjdCgoc3VidGl0bGVzLCBuYW1lbGlzdCwgdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YnRpdGxlOiBzdWJ0aXRsZXNbbmFtZWxpc3QuaW5kZXhPZihpbnB1dCldLnVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzdWJ0aXRsZXMsIG5hbWVsaXN0LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsLCBsaXN0LCB1LCBwYXRoKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDQ6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgNTogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiIy5qcGdcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0uaXNfZGlyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvaG9tZT9wYWdlPWZ5cGFnZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSA9PSBcXFwicGRmXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly9hbGlzdC1vcmcuZ2l0aHViLmlvL3BkZi5qcy93ZWIvdmlld2VyLmh0bWw/ZmlsZT1cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQub2ZmaWNlLmluY2x1ZGVzKCQucmVxdWlyZShcXFwiYXBpXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLlvq7ova9cXFwiLCBcXFwi6LC35q2MXFxcIl0pLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5b6u6L2vXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL3ZpZXcub2ZmaWNlYXBwcy5saXZlLmNvbS9vcC92aWV3LmFzcHg/c3JjPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZ3ZpZXc/JmVtYmVkZGVkPXRydWUmdXJsPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwodHlwZV9kaWN0W2l0ZW0udHlwZV0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGRvd25fdXJsLCBwYXRoLCBsaXN0LmRhdGEuY29udGVudCwgbm93LnVybClcXG4gICAgICAgICAgICAgICAgdmFyIGxvbmdDbGljayA9IFtdXFxuICAgICAgICAgICAgICAgIGlmICghaXRlbS5pc19kaXIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS4i+i9vVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIHUsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJkb3dubG9hZDovL1xcXCIgKyB1XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgZG93bl91cmwsIHBhdGgpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnlKjlhbbku5bova/ku7bmiZPlvIBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd25sb2FkRmlsZSh1LCBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFwiICsgaXRlbS5uYW1lKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIm9wZW5GaWxlOi8vXFxcIiArIFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBkb3duX3VybCwgcGF0aClcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKG5vdy51c2VyICYmIG5vdy5wYXNzd29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaTvvJ9cXFwiKS5jb25maXJtKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvcmVtb3ZlXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkaXI6IHBhdGgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbaXRlbS5uYW1lXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumHjeWRveWQjVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpdGVtLm5hbWUpLmlucHV0KChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvcmVuYW1lXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBwYXRoICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mHjeWRveWQjeaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mHjeWRveWQjeWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGdldEl0ZW0oXFxcInN0eWxlXFxcIiwgXFxcImF2YXRhclxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiAocGF0aCA9PSBcXFwiL1xcXCIgPyBcXFwiL1xcXCIgOiBwYXRoICsgXFxcIi9cXFwiKSArIGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIGlmIChnZXRJdGVtKFxcXCJzdHlsZVxcXCIsIFxcXCJhdmF0YXJcXFwiKSA9PSBcXFwiYXZhdGFyXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGDigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9JyNhYWFhYWEnPiR7ZGVzY308L2ZvbnQ+PC9zbWFsbD5gLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdGg6IChwYXRoID09IFxcXCIvXFxcIiA/IFxcXCIvXFxcIiA6IHBhdGggKyBcXFwiL1xcXCIpICsgaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKGxpc3QubWVzc2FnZSA9PSBcXFwicGFzc3dvcmQgaXMgaW5jb3JyZWN0IG9yIHlvdSBoYXZlIG5vIHBlcm1pc3Npb25cXFwiKSB7XFxuICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5rWP6KeI5a+G56CB6ZSZ6K+vXFxcIixcXG4g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W5rXFxcIlxcbn0pXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLinpUg5paw5aKeQWxpc3RcXFwiLFxcbiAgICB1cmw6ICQoXFxcIlxcXCIsIFxcXCLlkI3np7BcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgfSBlbHNlIGlmIChzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pLm1hcChmdW5jdGlvbihpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBpLm5hbWVcXG4gICAgICAgICAgICB9KS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5pyJ55u45ZCM55qE572R56uZ5LqGXFxcIlxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIumTvuaOpSDnpLrkvos6aHR0cDovLzEyNy4wLjAuMS9cXFwiKS5pbnB1dCgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoIWlucHV0LmluY2x1ZGVzKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFwiXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXRbaW5wdXQubGVuZ3RoIC0gMV0gIT0gXFxcIi9cXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQgKz0gXFxcIi9cXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2YXIgY29uZmlnID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0ICsgXFxcImFwaS9wdWJsaWMvc2V0dGluZ3NcXFwiKSkuZGF0YVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJsaXN0XFxcIiwgW10pXFxuICAgICAgICAgICAgICAgICAgICBsaXN0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiYnJvd3Nlci1wYXNzd29yZFxcXCI6IHt9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hcXFwiOiBjb25maWcuc2VhcmNoX2luZGV4ICYmIGNvbmZpZy5zZWFyY2hfaW5kZXggIT0gXFxcIm5vbmVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbn0sIHtcXG4gICAgdGl0bGU6IFxcXCLliIbkuqtcXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgIHVybDogJChbXFxcIuS7heWIhuS6q+e9keermVxcXCIsIFxcXCLliIbkuqvnvZHnq5nliqDlr4bnoIFcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgIHZhciBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKVxcbiAgICAgICAgaWYgKGlucHV0ID09IFxcXCLku4XliIbkuqvnvZHnq5lcXFwiKSB7XFxuICAgICAgICAgICAgdmFyIGFsaXN0ID0gbGlzdC5tYXAoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpdGVtLnVybCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJicm93c2VyLXBhc3N3b3JkXFxcIjoge31cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoSlNPTi5zdHJpbmdpZnkoYWxpc3QpKVxcbiAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL0FsaXN0IFYz572R55uY5a+85YWl5Y+j5LukIOWFsVxcXCIgKyBhbGlzdC5sZW5ndGggKyBcXFwi5LiqQFxcXCIgKyB1cmwgKyBcXFwiQGltcG9ydD1qczpcXFwiICsgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2Nsb3VkaW1wb3J0P3J1bGU9QWxpc3QgVjNcXFwiKS5pbnB1dChpbnB1dClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShKU09OLnN0cmluZ2lmeShsaXN0KSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9BbGlzdCBWM+e9keebmOWvvOWFpeWPo+S7pCDlhbFcXFwiICsgYWxpc3QubGVuZ3RoICsgXFxcIuS4qkBcXFwiICsgdXJsICsgXFxcIkBpbXBvcnQ9anM6XFxcIiArICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9jbG91ZGltcG9ydD9ydWxlPUFsaXN0IFY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jYXNlIFxcXCLkv67mlLnlkI3np7BcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXS5uYW1lKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3RvcmFnZTAuZ2V0SXRlbShcXFwibGlzdFxcXCIsIFtdKS5tYXAoZnVuY3Rpb24oaSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGkubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS5pbmNsdWRlcyhpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sue7j+acieebuOWQjOeahOe9keermeS6hlxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldLm5hbWUgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJsaXN0XFxcIiwgbGlzdClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLkv67mlLnpk77mjqVcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXS51cmwpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpbnB1dC5pbmNsdWRlcyhcXFwiaHR0cFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pk77mjqXmoLzlvI/plJnor69cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dFtpbnB1dC5sZW5ndGggLSAxXSAhPSBcXFwiL1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+mTvuaOpeagvOW8j+mUmeivr1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldLnVybCA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgIGNhc2UgXFxcIuS/ruaUuei0puaIt+WvhueggVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChsaXN0W2ldW1xcXCJ1c2VyXFxcIl0gPyBsaXN0W2ldW1xcXCJ1c2VyXFxcIl0gOiBcXFwiXFxcIiwgXFxcIui0puWPt1xcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA/IGxpc3RbaV1bXFxcInBhc3N3b3JkXFxcIl0gOiBcXFwiXFxcIiwgXFxcIuWvhueggVxcXCIpLmlucHV0KCh1c2VyLCBsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbaV1bXFxcInVzZXJcXFwiXSA9IHVzZXJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdFtpXVtcXFwicGFzc3dvcmRcXFwiXSA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImxpc3RcXFwiLCBsaXN0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQsIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICBjYXNlIFxcXCLmjpLluo9cXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoaSArIDEgKyBcXFwiXFxcIiwgXFxcIuaLjeWIsOesrOWHoOS4qlxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY2hlY2tSYXRlKGlucHV0KSB744CA44CAXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZSA9IC9eWzAtOV0rLj9bMC05XSovOyAvL+WIpOaWreWtl+espuS4suaYr+WQpuS4uuaVsOWtly8v5Yik5pat5q2j5pW05pWwL1sx4oiSOV0rWzDiiJI5XeKIl13iiJcvXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOOAgOOAgFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmUudGVzdChpbnB1dCnjgIDjgIBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNoZWNrUmF0ZShpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGEgPSBwYXJzZUludChpbnB1dCkgLSAxIC8vIOebruagh1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSA+IGxpc3QubGVuZ3RoICYmIGEgPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuS4jeiDveWkp+S6juWIl+ihqOaVsOmHj++8gVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGVtcCA9IGxpc3RbYV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3RbYV0gPSBsaXN0W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0W2ldID0gdGVtcFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwibGlzdFxcXCIsIGxpc3QpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi6K+36L6T5YWl5q2j5pW05pWwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIGl0ZW0sIGkpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiXFxuICAgIH0pXFxufSlcXG5zZXRSZXN1bHQoZCk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLku6PnoIFcIixcInBhdGhcIjpcImFwaVwiLFwicnVsZVwiOlwiJC5leHBvcnRzID0ge1xcbiAgICBjb2xvcjogZnVuY3Rpb24odGV4dCw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XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgICAgIHMudW5zaGlmdCh7XFxuICAgICAgICAgICAgbmFtZTogXFxcIuS4jemcgOimgeWtl+W5lVxcXCJcXG4gICAgICAgIH0pXFxuICAgICAgICByZXR1cm4gc1xcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pCc57SiXCIsXCJwYXRoXCI6XCJzZWFyY2hcIixcInJ1bGVcIjpcImpzOlxcbnRyeSB7XFxuICAgIHZhciBkID0gW107XFxuICAgIHZhciB7XFxuICAgICAgICBnZXRJY29uLFxcbiAgICAgICAgZ2V0RmlsZVNpemVcXG4gICAgfSA9ICQucmVxdWlyZShcXFwiYXBpXFxcIilcXG4gICAgdmFyIHVybCA9IGdldFBhcmFtKFxcXCJ1XFxcIilcXG4gICAgdmFyIG5vdyA9IE1ZX1BBUkFNUy5ub3dcXG4gICAgdmFyIGhlYWRlcnMgPSBNWV9QQVJBTVMuaGVhZGVyc1xcbiAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICBkLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5pCc57SiXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwia3dcXFwiLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcImt3XFxcIiwgXFxcIlxcXCIpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICB2YXIgcGF0aCA9IGdldFBhcmFtKFxcXCJwYXRoXFxcIilcXG4gICAgaWYgKGdldE15VmFyKFxcXCJrd1xcXCIsIFxcXCJcXFwiKSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgdmFyIGxpc3QgPSBKU09OLnBhcnNlKHBvc3QodXJsICsgXFxcImFwaS9mcy9zZWFyY2hcXFwiLCB7XFxuICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJlbnRcXFwiOiBnZXRQYXJhbShcXFwicGF0aFxcXCIpLFxcbiAgICAgICAgICAgICAgICBcXFwia2V5d29yZHNcXFwiOiBnZXRNeVZhcihcXFwia3dcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgIFxcXCJwYWdlXFxcIjogTVlfUEFHRSxcXG4gICAgICAgICAgICAgICAgXFxcInBlcl9wYWdlXFxcIjogMTAwXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pKVxcbiAgICAgICAgaWYgKGxpc3QuY29kZSA9PSAyMDAgJiYgbGlzdC5kYXRhLmNvbnRlbnQpIHtcXG4gICAgICAgICAgICBsaXN0LmRhdGEuY29udGVudC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgZGVzYyA9IGdldEZpbGVTaXplKGl0ZW0uc2l6ZSlcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9ICQoKS5sYXp5UnVsZSgoaXRlbSwgdSwgcGF0aCwgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNpZ24gPSBKU09OLnBhcnNlKHBvc3QodSArIFxcXCJhcGkvZnMvZ2V0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGF0aFxcXCI6IGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLnNpZ25cXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSBlbmNvZGVVUkkodSArIFxcXCJkXFxcIiArIGl0ZW0ucGFyZW50ICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lICsgXFxcIj9zaWduPVxcXCIgKyBzaWduKVxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZV9kaWN0ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIDA6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgMjogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIDQ6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImRvd25sb2FkOi8vXFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgNTogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFwiIy5qcGdcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW0uaXNfZGlyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvaG9tZT9wYWdlPWZ5cGFnZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5yZXF1aXJlKFxcXCJhcGlcXFwiKS5nZXRIem0oaXRlbS5uYW1lKSA9PSBcXFwicGRmXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly9hbGlzdC1vcmcuZ2l0aHViLmlvL3BkZi5qcy93ZWIvdmlld2VyLmh0bWw/ZmlsZT1cXFwiICsgdXJsXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCQub2ZmaWNlLmluY2x1ZGVzKCQucmVxdWlyZShcXFwiYXBpXFxcIikuZ2V0SHptKGl0ZW0ubmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLlvq7ova9cXFwiLCBcXFwi6LC35q2MXFxcIl0pLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5b6u6L2vXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczovL3ZpZXcub2ZmaWNlYXBwcy5saXZlLmNvbS9vcC92aWV3LmFzcHg/c3JjPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaHR0cHM6Ly9kb2NzLmdvb2dsZS5jb20vZ3ZpZXc/JmVtYmVkZGVkPXRydWUmdXJsPVxcXCIgKyB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGV2YWwodHlwZV9kaWN0W2l0ZW0udHlwZV0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIG5vdy51cmwsIHBhdGgsIGhlYWRlcnMpXFxuICAgICAgICAgICAgICAgIHZhciBsb25nQ2xpY2sgPSBbXVxcbiAgICAgICAgICAgICAgICBpZiAoIWl0ZW0uaXNfZGlyKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuIvovb1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCB1LCBwYXRoLCBoZWFkZXJzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiZG93bmxvYWQ6Ly9cXFwiICsgZW5jb2RlVVJJKHUgKyBcXFwiZFxcXCIgKyBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCI/c2lnbj1cXFwiICsgSlNPTi5wYXJzZShwb3N0KHUgKyBcXFwiYXBpL2ZzL2dldFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhdGhcXFwiOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGEuc2lnbilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi55So5YW25LuW6L2v5Lu25omT5byAXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaXRlbSwgdSwgcGF0aCwgaGVhZGVycykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgc2lnbiA9IEpTT04ucGFyc2UocG9zdCh1ICsgXFxcImFwaS9mcy9nZXRcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXRoXFxcIjogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLnNpZ25cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKGVuY29kZVVSSSh1ICsgXFxcImRcXFwiICsgaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUgKyBcXFwiP3NpZ249XFxcIiArIHNpZ24pLCBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9cXFwiICsgaXRlbS5uYW1lKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIm9wZW5GaWxlOi8vXFxcIiArIFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL1xcXCIgKyBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBub3cudXJsLCBwYXRoLCBoZWFkZXJzKVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAobm93LnVzZXIgJiYgbm93LnBhc3N3b3JkKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2sucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWIoOmZpO+8n1xcXCIpLmNvbmZpcm0oKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IEpTT04ucGFyc2UocG9zdChub3cudXJsICsgXFxcImFwaS9mcy9yZW1vdmVcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpcjogaXRlbS5wYXJlbnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbaXRlbS5uYW1lXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuY29kZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXRlbSwgaGVhZGVycywgcGF0aCwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumHjeWRveWQjVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChpdGVtLm5hbWUpLmlucHV0KChpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSBKU09OLnBhcnNlKHBvc3Qobm93LnVybCArIFxcXCJhcGkvZnMvcmVuYW1lXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmNvZGVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXMgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mk43kvZzmiJDlip9cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mk43kvZzlpLHotKVcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0sIGhlYWRlcnMsIHBhdGgsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBpdGVtLCBoZWFkZXJzLCBwYXRoLCBub3cpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGdldEl0ZW0oXFxcInN0eWxlXFxcIiwgXFxcImF2YXRhclxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhcmVudCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IGl0ZW0ubmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0SXRlbShcXFwic3R5bGVcXFwiLCBcXFwiYXZhdGFyXFxcIikgPT0gXFxcImF2YXRhclxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGDigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9JyNhYWFhYWEnPiR7ZGVzY308L2ZvbnQ+PC9zbWFsbD5gLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IGxvbmdDbGljayxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXJlbnQgKyBcXFwiL1xcXCIgKyBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB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vZ28uc3ZnIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment