xiaomianao666

小程序:歌词适配

Feb 5th, 2024
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@歌词适配@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5q2M6K+N6YCC6YWNIiwiYXV0aG9yIjoiVGhvbWFz5ZayIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wPWZ5cGFnZSIsInZlcnNpb24iOjIwMjQwMjA0LCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6Im11c2ljIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6JC5yZXF1aXJlKCdob21lP3J1bGU95q2M6K+N6YCC6YWNJyk7Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHk/cz0qKiIsImdyb3VwIjoi4pGg5o6o6I2QIiwic2VhcmNoRmluZCI6ImpzOlxuc2V0UmVzdWx0KFt7XG4gICAgdGl0bGU6IFwi5pCc57SiID0+IFwiICsgTVlfS0VZV09SRCxcbiAgICBkZXNjOiAn6YCa6L+HXCLpq5jnuqfmkJzntKJcIumhtemdouaQnOe0oicsXG4gICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3QyKSA9PiB7XG4gICAgICAgIGlmIChnZXRNeVZhcignc19wbGF0Zm9ybScsICdsaWInKSA9PSAnbGliJylcbiAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgZ2V0SXRlbSgnc19wbGF0Zm9ybScsICdrdycpKTtcbiAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBzX3QyKTtcbiAgICAgICAgcmV0dXJuIFwiaGlrZXI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WcpLnJlcGxhY2UoL3tzaXplfS9naSwgJzQ4MCcpO1xcbiAgICAgICAgXy5jb250ZW50ID0gXy5jb250ZW50ICsgJyc7XFxuICAgICAgICBfLnp5aWQgPSBfLnp5aWQgKyAnJztcXG4gICAgICAgIGlmICghXy5kZXNjKSBfLmRlc2MgPSB0aGlzX3BsYXRmb3JtO1xcbiAgICB9XFxuICAgIHQxID0gTnVtYmVyKF8uY29udGVudC5yZXBsYWNlKC9eKFxcXFxkP1xcXFxEXFxcXGQ/KSskLywgJzAnKSkgPCAyID8gMCA6IDE7XFxuICAgIF8uZXh0cmEgPSB7XFxuICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgY2xzOiBpZCArICc6YWRkbGlzdCcsXFxuICAgICAgICBsb25nQ2xpY2s6IFtcXG4gICAgICAgICAgICAvKntcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDliIbkuqvpk77mjqUg4piFXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygoYSwgYiwgYykgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5jb3B5dXJsKGEsIGIsIGMpO1xcbiAgICAgICAgICAgIH0sIF8uZGVzYywgXy5jb250ZW50LCBfLnp5aWQpXFxuICAgICAgICB9LCAqL1xcbiAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5pS26JePXFxcIiArICh0MSA/ICfmrYzljZUnIDogJ+WNleabsicpICsgXFxcIiDimIVcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodDEsIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLmxvZ0RhdGEoXywgdDEpO1xcbiAgICAgICAgICAgICAgICB9LCB0MSwgXylcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOaJuemHj+aUtuiXjyDimIVcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoY2xzSWQsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IGZpbmRJdGVtc0J5Q2xzKGNsc0lkKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL19jYXRjaC9JbXBvcnQudHh0XFxcIiwgSlNPTi5zdHJpbmdpZnkoanNvbikpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvcmVseTIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU95q2M6K+N6YCC6YWNXFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaWQgKyAnOmFkZGxpc3QnLCB0MSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICBdXFxuICAgIH07XFxuICAgIGlmIChyMykge1xcbiAgICAgICAgXy51cmwgPSByMztcXG4gICAgICAgIF8uZXh0cmEubG9uZ0NsaWNrLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4piFIOS4i+i9veatjOabsiDimIVcXFwiLFxcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChuYW1lcywgdXJscykgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChuYW1lcywgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgobmFtZXMsIHVybHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGkgPSBuYW1lcy5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgfSwgbmFtZXMsIHVybHMpO1xcbiAgICAgICAgICAgIH0sIHIzLm5hbWVzLCByMy51cmxzKVxcbiAgICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBfLnVybCA9IExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCk7XFxuICAgICAgICBpZiAoIXQxKSBfLmV4dHJhLmxvbmdDbGljay51bnNoaWZ0KHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKYhSDkuIvovb3mrYzmm7Ig4piFXFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgfSwgTGF6eShfLmRlc2MsIF8uY29udGVudCwgXy56eWlkLCAxKSlcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIF8uY29sX3R5cGUgPSAnY2FyZF9waWNfMyc7XFxuICAgIGlmIChyMikgcmV0dXJuIF87XFxuICAgIGQucHVzaChfKTtcXG59XFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuXFxuJC5leHBvcnRzID0ge1xcblxcblxcblxcbiAgICBsb2dEYXRhOiBmdW5jdGlvbihuZXdEYXRhLCBzaSwgbmFtZSkge1xcbiAgICAgICAgaWYgKG5ld0RhdGEuenlpZCA9PT0gXFxcInVuZGVmaW5lZFxcXCIpXFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeaUr+aMgeaUtuiXj35cXFwiO1xcblxcbiAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgaWYgKHp5ID09PSBcXFwiXFxcIikgenkgPSB7XFxuICAgICAgICAgICAgXFxcIuWFqOmDqFxcXCI6IFtdXFxuICAgICAgICB9LCBzdG9yYWdlMC5zZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSwgenkpO1xcbiAgICAgICAgbGV0IHp1ID0gT2JqZWN0LmtleXMoenkpO1xcblxcblxcbiAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmlrDnu4RcXFwiKSwgMywgXFxcIumAieaLqee7hFxcXCIpLnNlbGVjdCgoenksIHp1LCBuZXdEYXRhLCBzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5paw57uEXFxcIikge1xcbiAgICAgICAgICAgICAgICBpZiAoIXp1LmluY2x1ZGVzKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobmFtZSwgXFxcIuivt+i+k+WFpeaWsOe7hOWQjeensFxcXCIpLmlucHV0KCh6eSwgenUsIG5ld0RhdGEsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0LnRyaW0oKS5tYXRjaCgvXlxcXFxkK3xeXFxcXHMqKOaWsOe7hCk/XFxcXHMqJC8pKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v57uE5ZCN5LiN6IO95Li656m6ICYg5pyA5YmN6Z2i5LiN6IO95piv5pWw5a2XICYg5Lmf5LiN6IO95Y+r5paw57uEXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAzLCAn6K+36YCJ5oup5paw57uE5L2N572uJykuc2VsZWN0KCh6eSwgaW5wdXQyLCBuZXdEYXRhcywgc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RGF0YSA9IEFycmF5LmlzQXJyYXkobmV3RGF0YXMpID8gbmV3RGF0YXMgOiBbbmV3RGF0YXNdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuacgOWQjumdolxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2lucHV0Ml0gPSBuZXdEYXRhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIGluIHp5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpbnB1dDJdID0gbmV3RGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBqc29uO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KG5ld0RhdGFzKSkgYmFjayh0cnVlKSwgdG9hc3QoJ+aIkOWKnycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgenksIGlucHV0LCBuZXdEYXRhLCBzaSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCB6eSwgenUsIG5ld0RhdGEsIHNpLCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liIbnu4TlkI3np7Dph43lpI3kuoZ+XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICB6eSA9IHp5W2lucHV0XTtcXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShuZXdEYXRhKSkge1xcbiAgICAgICAgICAgICAgICB6eSA9IHp5LmNvbmNhdChuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoJ+aIkOWKnycpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSwgaW5wdXQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB6dSA9IHp5Lm1hcChpdCA9PiBpdC50aXRsZSk7XFxuICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMiwgJ+ivt+mAieaLqei1hOa6kOS9jee9ricpLnNlbGVjdCgoenksIHp1LCBpbnB1dDIsIG5ld0RhdGEsIHNpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5pyA5ZCO6Z2iXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgenkucHVzaChuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGkgPSB6dS5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHp5LnNwbGljZShpLCAwLCBuZXdEYXRhKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgIC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ICAgICAgICAgIF8udG9wbGlzdC5tYXAoX18gPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoX18udGl0bGUgIT0gXFxcIk1W5qacXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bXy5ncm91cE5hbWVdLnB1c2goRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF9fLmhlYWRQaWNVcmwgfHwgX18uZnJvbnRQaWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfXy50b3BJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSwgMSkpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInFxX2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0MiwgaXN1cmwpIHtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4UgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnXFxcIjtcXG4gICAgICAgICAgICAgICAgdmFyIGJvZHkgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBjb21tOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY3Q6ICcxOScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY3Y6ICcxODU5J1xcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIHJlcToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZTogJ211c2ljLnBmX3NvbmdfZGV0YWlsX3N2cicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnZ2V0X3NvbmdfZGV0YWlsX3lxcScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc29uZ19taWQ6IHQxXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHUsIHtcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IGJvZHksXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICB9KS5yZXEuZGF0YS50cmFja19pbmZvO1xcbiAgICAgICAgICAgICAgICBuYW1lID0gXy5uYW1lO1xcbiAgICAgICAgICAgICAgICBhcnRpc3QgPSBfLnNpbmdlci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7IC8vIOS4i+i9vVxcbiAgICAgICAgICAgICAgICAgICAgZiA9IF8uZmlsZTtcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV8xMjhtcDMgIT0gMClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSArIFNpemUoZi5zaXplXzEyOG1wMykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV8zMjBtcDMgIT0gMClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoZi5zaXplXzMyMG1wMykpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGYuc2l6ZV9mbGFjICE9IDApXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbM10gKyBTaXplKGYuc2l6ZV9mbGFjKSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZi5zaXplX2hpcmVzICE9IDApXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbNF0gKyBTaXplKGYuc2l6ZV9oaXJlcykpO1xcblxcblxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCBuYW1lLCBhcnRpc3QpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJxcVxcXCIsIHQxLCBpLCBuYW1lLCBhcnRpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBuYW1lLCBhcnRpc3QpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbHJjID0gJC5yZXF1aXJlKFxcXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoXFxcImh0dHA6Ly9jLnkucXEuY29tL2x5cmljL2ZjZ2ktYmluL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cXCJxcT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgodSkucmVxXzAuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IF8uc2lwWzBdICsgXy5taWR1cmxpbmZvWzBdLnB1cmw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly9jLnkucXEuY29tL3NwbGNsb3VkL2ZjZ2ktYmluL2ZjZ19nZXRfZGlzc19ieV90YWcuZmNnP2Zvcm1hdD1qc29uJmNhdGVnb3J5SWQ9XFxcIiArIHQxICsgXFxcIiZzaW49XFxcIiArICgoTVlfUEFHRSAtIDEpICogMzApICsgXFxcIiZlaW49XFxcIiArICgoTVlfUEFHRSAqIDMwKSAtIDEpO1xcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ3FxP3J1bGU95q2M6K+N6YCC6YWNJykuYWpheCh1cmwpLmRhdGEubGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5kaXNzbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWd1cmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcb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ZSkgKyAnIC0gJyArIF8uc2luZ2VyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgIGltZzogYGh0dHBzOi8veS5ndGltZy5jbi9tdXNpYy9waG90b19uZXcvVDAwMlIzMDB4MzAwTTAwMCR7Xy5hbGJ1bW1pZHx8KF8uYWxidW0/Xy5hbGJ1bS5taWQ6XFxcIlxcXCIpfS5qcGdgLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IF8ucGF5LnBheXBsYXksXFxuICAgICAgICAgICAgenlpZDogXy5taWQgfHwgXy5zb25nbWlkXFxuICAgICAgICB9LCAxKSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSkge1xcbiAgICAgICAgaWYgKGlzVSAhPSBcXFwidXJsXFxcIikge1xcbiAgICAgICAgICAgIF9fID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IChfKSA9PiB0cnVlLFxcbiAgICAgICAgICAgICAgICBwYWlkOiAoXykgPT4gXy5wYXkucGF5X3BsYXkgPT0gJzEnLFxcbiAgICAgICAgICAgICAgICBmcmVlOiAoXykgPT4gXy5wYXkucGF5X3BsYXkgPT0gJzAnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN1cmwgPSAoc3R5cGUpID0+ICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwOi8vdTYueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnXFxcIiwge1xcbiAgICAgICAgICAgICAgICBcXFwiYm9keVxcXCI6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJyZXFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1vZHVsZVxcXCI6IFxcXCJtdXNpYy5zZWFyY2guU2VhcmNoQ2dpU2VydmljZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1ldGhvZFxcXCI6IFxcXCJEb1NlYXJjaEZvclFRTXVzaWNMaXRlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1cXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJxdWVyeVxcXCI6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hfdHlwZVxcXCI6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibnVtX3Blcl9wYWdlXFxcIjogMzAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYWdlX251bVxcXCI6IE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIlBPU1RcXFwiXFxuICAgICAgICAgICAgfSkucmVxLmRhdGEuYm9keTtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgc3VybCgwKS5pdGVtX3NvbmcubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIF8uc2luZ2VyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGBodHRwczovL3kuZ3RpbWcuY24vbXVzaWMvcGhvdG9fbmV3L1QwMDJSMzAweDMwME0wMDAke18uYWxidW1taWR8fChfLmFsYnVtP18uYWxidW0ubWlkOlxcXCJcXFwiKX0uanBnYCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogXy5wYXkucGF5X3BsYXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ubWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBzdXJsKDMpLml0ZW1fc29uZ2xpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLmRpc3NuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5sb2dvLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5kaXNzaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGJvZHkgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29tbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdDogJzE5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Y6ICcxODU5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZTogJ211c2ljLnBmX3NvbmdfZGV0YWlsX3N2cicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ2dldF9zb25nX2RldGFpbF95cXEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc29uZ19taWQ6IGtleXdvcmRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwicXE/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwczovL3UueS5xcS5jb20vY2dpLWJpbi9tdXNpY3UuZmNnXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IGJvZHksXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgICAgIH0pLnJlcS5kYXRhLnRyYWNrX2luZm87XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5zaW5nZXIubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBgaHR0cHM6Ly95Lmd0aW1nLmNuL211c2ljL3Bob3RvX25ldy9UMDAyUjMwMHgzMDBNMDAwJHtfLmFsYnVtP18uYWxidW0ubWlkOlxcXCJcXFwifS5qcGdgLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8ucGF5LnBheXBsYXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5taWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInFxP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwiaHR0cDovL2MueS5xcS5jb20vcXpvbmUvZmNnLWJpbi9mY2dfdWNjX2dldGNkaW5mb19ieWlkc19jcC5mY2c/Zm9ybWF0PWpzb24mdHlwZT0xJnV0Zjg9MSZkaXNzdGlkPVxcXCIgKyBrZXl3b3JkKS5jZGxpc3RbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goXy5kaXNzbmFtZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmxvZ28sXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmRpc3N0aWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBhamF4OiBmdW5jdGlvbih1cmwsIGhlYWQpIHtcXG4gICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHVybCwgT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8veS5xcS5jb20vXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiTW96aWxsYS81LjAgKGNvbXBhdGlibGU7IE1TSUUgOS4wOyBXaW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AgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSB6eVtuYW1lXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaJk+W8gOS4uuS6jOe6p1xcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjJykucnVsZSgoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgenlbbmFtZV0ubWFwKF8gPT4gRXh0cmEoXykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5L+u5pS55ZCN56ewXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpeaWsOeahOe7hOWQjVxcXCIpLmlucHV0KChzaSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB6eSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpIGluIHp5KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID09IG5hbWUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baW5wdXRdID0genlbaV1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb25baV0gPSB6eVtpXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIG5hbWUpO1xcbiAgICAgICAgICAgICAgICB9LCBzaSwgbmFtZSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5pu05pS55o6S5bqPXFxcIixcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCB6dSwgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh6dS5jb25jYXQoXFxcIuacgOWQjumdolxcXCIpLCAyLCAn6K+36YCJ5oup6LWE5rqQ5L2N572uJykuc2VsZWN0KChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBvZiB6dSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltuYW1lXSA9IHp5W25hbWVdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpJywgenUuaW5kZXhPZihpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwi5pyA5ZCO6Z2iXFxcIiA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uW25hbWVdID0genlbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd0aScsIHp1Lmxlbmd0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKTtcXG4gICAgICAgICAgICAgICAgfSwgc2ksIHp1LCBuYW1lKVxcbiAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliIbnu4TlkIjlubZcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIHp1LCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpID0genUuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgIHp1LnNwbGljZShpLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LCAzLCAn6YCJ5oup6KaB5ZCI5bm255qE5YiG57uEJykuc2VsZWN0KChzaSwgenUsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBvZiB6dSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlbaV0gPSB6eVtpXS5jb25jYXQoenlbbmFtZV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpJywgenUuaW5kZXhPZihpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbltpXSA9IHp5W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5KTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSk7XFxuICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgbmFtZSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrIFxcXCIgKyBuYW1lLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW25hbWVdXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoanNvbikpO1xcbiAgICAgICAgICA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uICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnIl+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpXFxuICAgIH0pO1xcbn0gZWxzZSB7XFxuICAgIGlmICh6eVt6dVt0aV1dLmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgZGVsZXRlIHp5W3p1W3RpXV07XFxuICAgICAgICBjbGVhck15VmFyKCd0aScpO1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBpaSA9IDA7XFxuICAgICAgICB6eVt6dVt0aV1dLm1hcCgoXywgaSkgPT4ge1xcbiAgICAgICAgICAgIGlmICgoKGNfcGxhdGZvcm0gPT0gJ2xpYicgfHwgY19wbGF0Zm9ybSA9PSBfLmRlc2MpICYmIChjX3QyID09ICdsaWInIHx8IGNfdDIgPT0gXy5jb250ZW50KSkgfHwgKGNfcGxhdGZvcm0gPT0gJ2xpYicgJiYgKChjX3QyID09IF8uY29udGVudCkgfHwgKGNfdDIgPT0gJzAnICYmIF8uY29udGVudCAhPSAnMScpKSkpIHtcXG4gICAgICAgICAgICAgICAgXy5leHRyYSA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgJzphZGRsaXN0JyxcXG4gICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkv67mlLlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoc2ksIGtleSwgaSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLkv67mlLnlkI3np7BcXFwiLCBcXFwi5L+u5pS55bCB6Z2iXFxcIl0sIDEsICfpgInmi6nopoHkv67mlLnnmoTlj4LmlbAnKS5zZWxlY3QoKHNpLCBrZXksIGksIF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbdHlwZSwgdGV4dF0gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCLkv67mlLnlkI3np7BcXFwiOiBbJ3RpdGxlJywgJ+ivt+i+k+WFpeaWsOeahOWQjeensCddLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwi5L+u5pS55bCB6Z2iXFxcIjogW18uaW1nID8gJ2ltZycgOiAncGljJywgJ+ivt+i+k+WFpeato+ehrueahOWwgemdouWcsOWdgCddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVtpbnB1dF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZSA9IF9bdHlwZV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQobmFtZSwgdGV4dCkuaW5wdXQoKHNpLCBrZXksIGksIHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2ldW3R5cGVdID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibGliP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0RGF0YShzaSwgenksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSwgdHlwZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCBpLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgaSwgXylcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Y+Y5pu0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCB6dSwga2V5LCBpLCB6eWlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuabtOaUueaOkuW6j1xcXCIsIFxcXCLliIfmjaLliIbnu4RcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8sIFxcXCLmibnph4/mjaLnu4RcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLCAxLCAn6YCJ5oup6KaB5Y+Y5pu055qE5LqL5Lu2Jykuc2VsZWN0KChzaSwgenUsIGtleSwgaSwgenlpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAn5pu05pS55o6S5bqPJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpW2tleV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dSA9IHp5Lm1hcChfID0+IF8udGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IHp5W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenUuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMiwgJ+ivt+mAieaLqei1hOa6kOS9jee9ricpLnNlbGVjdCgoc2ksIGtleSwgenksIHp1LCBkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSBpbiB6dSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoenVbaV0gPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24ucHVzaChkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uLnB1c2goenlbaV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXFxcIuacgOWQjumdolxcXCIgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbi5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eSA9IGpzb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgenksIHp1LCBkYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfliIfmjaLliIbnu4QnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWkgPSB6dS5pbmRleE9mKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6dS5zcGxpY2UoaWksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KCfmlrDnu4QnKSwgMywgJ+ivt+mAieaLqei1hOa6kOS9jee9ricpLnNlbGVjdCgoc2ksIGtleSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwiZGF0YV9cXFwiICsgc2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtrZXldLm1hcCgoXywgaWkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlpICE9IGkpIGpzb24ucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBkYXRhID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtrZXldID0ganNvbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJ+aWsOe7hCcgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaXmlrDnu4TlkI3np7BcXFwiKS5pbnB1dCgoc2ksIHp5LCBkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQudHJpbSgpLm1hdGNoKC9eXFxcXGQrfF5cXFxccyoo5paw57uEKT9cXFxccyokLykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+e7hOWQjeS4jeiDveS4uuepuiAmIOacgOWJjemdouS4jeiDveaYr+aVsOWtl1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eVtpbnB1dF0gPSBbZGF0YV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6eSwgZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5W2lucHV0XS5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXREYXRhKHNpLCB6eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwga2V5LCBpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfmibnph4/mjaLnu4QnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikucnVsZSgoc2kpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJhZGRsaXN0P3J1bGU9dGd46Z+z5LmQXFxcIikoc2ksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzaSwgenUsIGtleSwgaSwgenlpZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNpLCB6dSwgenVbdGldLCBpLCBfLnp5aWQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKF8sIHNpLCBrZXksIHp5aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBcXFwi5YiG5Lqr6ZO+5o6lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwi5YiG5Lqr5Y+j5LukXFxcIiwgXFxcIuaJuemHj+WIhuS6q1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0sIDEsICfpgInmi6nopoHlj5jmm7TnmoTkuovku7YnKS5zZWxlY3QoKF8sIHNpLCBrZXksIHp5aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+WIhuS6q+mTvuaOpSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsaWI/cnVsZT3mrYzor43pgILphY1cXFwiKS5jb3B5dXJsKHNpLCB6eWlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICfliIbkuqvlj6Pku6QnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpdGNoOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpOiBzaSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBfLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IFtfXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoanNvbikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8v5q2M6K+N6YCC6YWN5pS26JeP5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXG7vv6VUZXh077+lXFxcIiArIHQgKyBgQGltcG9ydD1qczokLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0UnVsZShpbnB1dCwyKTtgO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ+aJuemHj+WIhuS6qyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImRhdGFfXFxcIiArIHNpKVtrZXldXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL19jYXRjaC9JbXBvcnQudHh0XFxcIiwgSlNPTi5zdHJpbmdpZnkoanNvbikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvcmVseTIjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU95q2M6K+N6YCC6YWNXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8sIHNpLCBrZXksIHp5aWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBfLCBzaSwgenVbdGldLCBfLnp5aWQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHNpLCBrZXksIGksIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaRcXFwiICsgbmFtZSArIFxcXCLlkJfvvJ9cXFwiKS5jb25maXJtKChzaSwga2V5LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJkYXRhX1xcXCIgKyBzaSlba2V5XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxpYj9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldERhdGEoc2ksIHp5LCBrZXkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIGtleSwgaSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc2ksIHp1W3RpXSwgaSwgXy50aXRsZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKE51bWJlcihfLmNvbnRlbnQucmVwbGFjZSgvXihcXFxcZCpcXFxcRCtcXFxcZCopKyQvLCAnMCcpKSA8IDIpIF8uZXh0cmEubG9uZ0NsaWNrLnVuc2hpZnQoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLimIUg5LiL6L295q2M5puyIOKYhVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCwgMSkpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoIV8udXJsKSBfLnVybCA9IExhenkoXy5kZXNjLCBfLmNvbnRlbnQsIF8uenlpZCk7XFxuICAgICAgICAgICAgICAgIF8uY29sX3R5cGUgPSAnY2FyZF9waWNfMyc7XFxuICAgICAgICAgICAgICAgIGQucHVzaChfKTtcXG4gICAgICAgICAgICAgICAgaWkrKztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmICghaWkpIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pGj6auY57qn5pCc57SiXCIsXCJwYXRoXCI6XCJzZWFyY2hcIixcInJ1bGVcIjpcImpzOlxcbmV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2xpYj9ydWxlPeatjOivjemAgumFjScsIHt9KSkucnVsZSk7XFxubGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgW10pO1xcbmxldCBzX3BsYXRmb3JtID0gZ2V0TXlWYXIoJ3NfcGxhdGZvcm0nLCAnbGliJylcXG5sZXQgc190MSA9IGdldE15VmFyKCdzX3QxJywgZ2V0SXRlbSgnc190MScsICcwJykpXFxubGV0IHNfdDIgPSBnZXRNeVZhcignc190MicsICcnKTtcXG5sZXQgc190MyA9IGdldE15VmFyKCdzX3QzJywgJ2xpYicpO1xcbmxldCBzX3Q0LCByZWdpZCwgaXNQID0gTVlfUEFHRSA9PSAxLFxcbiAgICBpc1UgPSAvaHR0cHM/OlxcXFwvXFxcXC8vLnRlc3Qoc190Mik7XFxuXFxuXFxuXFxuaWYgKHNfdDEgPT0gJzAnKSB7XFxuICAgIHN3aXRjaCAoc19wbGF0Zm9ybSkge1xcbiAgICAgICAgY2FzZSAnbGliJzpcXG4gICAgICAgICAgICBzX3QzID0gZ2V0TXlWYXIoJ3NfdDMnLCAna3cnKTtcXG4gICAgICAgICAgICB0YWJzID0gWydrdycsICdrZyddO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAnNXMnOlxcbiAgICAgICAgICAgIHRhYnMgPSBbJ2xpYicsICd5YycsICdmYycsICdieiddO1xcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSAnbXknOlxcbiAgICAgICAgICAgIHNfdDQgPSBnZXRNeVZhcignc190NCcsICcxJykgPT0gJzEnO1xcbiAgICAgICAgICAgIHNfdDMgPSBnZXRNeVZhcignc190MycsICd3eScpO1xcbiAgICAgICAgICAgIGlmICghc190My5tYXRjaCgvd3l8a3d8bWcvKSAmJiBzX3Q0KVxcbiAgICAgICAgICAgICA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lzdChfZGV0YWlsKT9cXFxcLyhcXFxcZCspL2ksIC9cXFxcLyh5aW55dWV8cGxheV9kZXRhaWwpXFxcXC8oXFxcXGQrKS9pXSxcXG4gICAgICAgICAgICBbXFxcIm1nXFxcIiwgL21pZ3VcXFxcLmNuL2ksIC9cXFxcL3BsYXlsaXN0XFxcXC8oLippZD0pPyhcXFxcZCspL2ksIC9cXFxcL3NvbmdcXFxcLyguKmlkPSk/KFthLXowLTldKykvaV0sXFxuICAgICAgICAgICAgLy8gW1xcXCJrZ1xcXCIsIC4uLl1cXG4gICAgICAgICAgICBbXFxcIjVzXFxcIiwgLzVzaW5nXFxcXC4vaSwgLy4qKHNvbmdsaXN0LippZD0pKFthLXowLTldKykvaSwgLy4qKFxcXFw/c29uZy4qPz18XFxcXC8pKFthLXowLTldKykoXFxcXCZzb25nLio/PXxcXFxcLykoW2EtejAtOV0rKS9pXSxcXG4gICAgICAgIF07XFxuICAgICAgICBmb3IgKFtwbGF0Zm9ybSwgcmVnMSwgcmVnMiwgcmVnM10gb2YgcmVncykge1xcbiAgICAgICAgICAgIGlmIChzX3QyLm1hdGNoKHJlZzEpKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBzX3BsYXRmb3JtID0gcGxhdGZvcm07XFxuICAgICAgICAgICAgICAgICAgICBpZiAobWF0ID0gc190Mi5tYXRjaChyZWcyKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNfdDEgPSAnMSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVnaWQgPSBtYXRbMl07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1hdCA9IHNfdDIubWF0Y2gocmVnMykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzX3QxID0gJzAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkID0gbWF0WzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwbGF0Zm9ybSA9PSAnNXMnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWdpZC5tYXRjaCgvXFxcXEQvKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkID0gbWF0WzRdICsgJyMnICsgcmVnaWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lkICs9ICcjJyArIG1hdFs0XTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge31cXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgc190MiA9IHJlZ2lkXFxuICAgIH0gZWxzZSBpZiAoc190Mi50cmltKCkpIHtcXG4gICAgICAgIGxldCBpaSA9IGhpc3RvcnkuaW5kZXhPZihzX3QyKTtcXG4gICAgICAgIGlmIChpaSA+IC0xKSB7XFxuICAgICAgICAgICAgaGlzdG9yeS5zcGxpY2UoaWksIDEpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID4gMjApIHtcXG4gICAgICAgICAgICBoaXN0b3J5LnNwbGljZShoaXN0b3J5Lmxlbmd0aCAtIDEsIDEpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaGlzdG9yeS51bnNoaWZ0KHNfdDIpO1xcbiAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwic2VhcmNoSGlzdG9yeVxcXCIsIGhpc3RvcnkpO1xcbiAgICB9XFxuXFxuXFxuXFxuICAgIGQgPSBbe1xcbiAgICAgICAgY29sX3R5cGU6ICdwaWNfMV9mdWxsJyxcXG4gICAgICAgIHRpdGxlOiAnMCcsXFxuICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKShcXFwidG9wXFxcIiksXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5iYWNrKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvY29sbGVjdGlvbiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3mrYzor43pgILphY1cXFwiO1xcbiAgICAgICAgfSwgTVlfUEFSQU1TKSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgcGFnZVRpdGxlOiBcXFwiVEdY5pS26JePXFxcIixcXG4gICAgICAgICAgICBiYWNrOiAxXFxuICAgICAgICB9XFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiBTdHJvbmcoXFxcIuaQnOe0olxcXCIgKyAoc190MSA9PT0gJzAnID8gXFxcIuWNleabslxcXCIgOiBcXFwi5q2M5Y2VXFxcIikpLFxcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3QxKSA9PiB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDEnLCBzX3QxKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgc190MSA9PT0gJzAnID8gJzEnIDogJzAnKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl9zbWFsbF8zXFxcIixcXG4gICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25feGl1dGFuXFxcIlxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLmiJHnmoTmlLbol49cXFwiKSxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vY29sbGVjdGlvbj9ydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2Rvd25sb2FkXFxcIlxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLljoblj7LorrDlvZVcXFwiKSxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vaGlzdG9yeT9ydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX2hpc1xcXCJcXG4gICAgfV07XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgZGVzYzogJ+aQnOe0ouWFs+mUruivjSAvIOWIhuS6q+mTvuaOpScsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKHNfcGxhdGZvcm0pID0+IHtcXG4gICAgICAgICAgICBzX3QyID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgIGlmIChzX3QyICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3QyJywgc190Mik7XFxuICAgICAgICAgICAgICAgIGlmIChzX3BsYXRmb3JtID09ICdsaWInKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfcGxhdGZvcm0nLCBnZXRJdGVtKCdzX3BsYXRmb3JtJywgJ2t3JykpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XF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3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICB9KTtcXG4gICAgaWYgKHNfdDEgPT0gJzAnICYmIHNfcGxhdGZvcm0gPT0gJ215Jykge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQ29sb3Ioc190NCA/ICfmlrAnIDogJ+aXpycsICczMzk5Y2MnKSkpLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc190NCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190NCcsIHNfdDQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgc190NCA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgdGFicy5tYXAobmFtZSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBzX3QzID09IG5hbWUgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MycsIHRpZCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBuYW1lKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgIH0sIHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgfSk7XFxuICAgIExvYWRpbmcoKTtcXG4gICAgaWYgKGlzVSkge1xcbiAgICAgICAgaWYgKCFyZWdpZCkgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIumTvuaOpeagvOW8j+acquaUtuW9lVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZWxzZSBzX3QzID0gXFxcInVybFxcXCI7XFxuICAgIH1cXG59IGVsc2UgZCA9IFtdO1xcblxcblxcblxcbmlmIChzX3BsYXRmb3JtICE9IFxcXCJsaWJcXFwiICYmICEvXlxcXFxzKiQvLnRlc3Qoc190MikpIHtcXG4gICAgaWYgKHNfdDIudHJpbSgpICYmICghaXNVIHx8IGlzUCkpIHtcXG4gICAgICAgIGlmIChpc1UpXFxuICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCfpq5jnuqfmkJzntKIgLSAnICsgc19wbGF0Zm9ybSArIChzX3QxID09ICcxJyA/ICfmrYzljZUnIDogJ+WNleabsicpKTtcXG4gICAgICAgIGVsc2VcXG4gICAgICAgICAgICBzZXRQYWdlVGl0bGUoJ+mrmOe6p+aQnOe0oiAtICcgKyBzX3QyICsgJyMnICsgTVlfUEFHRSk7XFxuICAgICAgICAkLnJlcXVpcmUoc19wbGF0Zm9ybSArIFxcXCI/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZWFyY2goc190MSwgc190Miwgc190Mywgc190NCk7XFxuICAgIH1cXG59IGVsc2UgaWYgKGlzUC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AgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogaWQgKyBcXFwiOnNlYXJjaEhpc3RvcnlcXFwiLFxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBkLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBlbHNlIGhpc3RvcnkubWFwKChrZXksIGksIGlkKSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBrZXksXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChzX3BsYXRmb3JtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzX3BsYXRmb3JtID09ICdsaWInKSBwdXRNeVZhcignc19wbGF0Zm9ybScsIGdldEl0ZW0oJ3NfcGxhdGZvcm0nLCAna3cnKSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZXh0cmEgPSBmaW5kSXRlbShcXFwiZ2NzcDE5OTk6c2VhcmNoXFxcIikuZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYS5kZWZhdWx0VmFsdWUgPSBrZXk7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogZXh0cmFcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSwgc19wbGF0Zm9ybSwga2V5KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogaWQgKyBcXFwiOmtleTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIjprZXlcXFwiLFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpOWFs+mUruivjTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKGlkLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaGlzdG9yeSA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcInNlYXJjaEhpc3RvcnlcXFwiLCBbXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlpID0gaGlzdG9yeS5pbmRleE9mKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGlzdG9yeS5zcGxpY2UoaWksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcInNlYXJjaEhpc3RvcnlcXFwiLCBoaXN0b3J5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcIjprZXk6XFxcIiArIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhpc3RvcnkubGVuZ3RoID09PSAwKSBhZGRJdGVtQWZ0ZXIoaWQgKyBcXFwiOnNlYXJjaEhpc3RvcnlcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwifn5+5LuA5LmI6YO95rKh5pyJ5ZOmfn5+XFxcIi5mb250Y29sb3IoXFxcIkdyYXlcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaWQsIGtleSlcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIFJlc291ID0gKGlkLCBzX3BsYXRmb3JtLCBwbGF0Zm9ybSwgcmVzb3UpID0+IHtcXG4gICAgICAgIEQgPSBbXTtcXG4gICAgICAgIHJlc291Lm1hcChuYW1lID0+IHtcXG4gICAgICAgICAgICBELnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzX3BsYXRmb3JtLCBwbGF0Zm9ybSwga2V5d29yZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNfcGxhdGZvcm0gPT0gJ2xpYicpIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgcGxhdGZvcm0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDEnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NfdDInLCBrZXl3b3JkKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHNfcGxhdGZvcm0sIHBsYXRmb3JtLCBuYW1lKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgJzpyZXNvdTprZXknXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIEQ7XFxuICAgIH07XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPuWkp+WutumDveWcqOaQnDwvYj48L3NwYW4+JyxcXG4gICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaWQsIHNfcGxhdGZvcm0sIHBsYXRmb3JtLCB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gICAgICAgICBcXFwibWlkXFxcIjogUigzMiwgXFxcIjEyMzQ1Njc4OTBcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjbGllbnR0aW1lXFxcIjogbmV3IERhdGUoKS5nZXRUaW1lKCkgKyBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ4LXJvdXRlclxcXCI6IFxcXCJtc2VhcmNoLmt1Z291LmNvbVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgIEpTT04ucGFyc2Uoc3JlY190KS5kYXRhLmxpc3QubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICByID0gXy5uYW1lID09IFxcXCLnu7zoibrng63mkJxcXFwiO1xcbiAgICAgICAgICAgICAgICBfLmtleXdvcmRzLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNyZWMucHVzaChyID8gXy5rZXl3b3JkLnNwbGl0KFxcXCIgXFxcIilbMF0gOiBfLmtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgIH1cXG4gICAgICAgIHNyZWMgPSBzcmVjLmZpbHRlcigoYSwgYiwgYykgPT4gYy5pbmRleE9mKGEpID09PSBiICYmIGEudHJpbSgpICE9PSBcXFwiXFxcIik7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihzX3QzICsgXFxcIl9zcmVjXFxcIiwgc3JlYyk7XFxuICAgIH1cXG4gICAgZCA9IGQuY29uY2F0KFJlc291KGlkLCBzX3BsYXRmb3JtLCBzX3QzLCBzcmVjKSk7XFxufVxcblxcbk1ZX1BBR0UgPT0gMSA/IHNldFByZVJlc3VsdChkKSA6IHNldFJlc3VsdChkKTtcXG5kZWxldGVJdGVtQnlDbHMoJ2xvYWRpbmdfZ2lmJyk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1l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cIuWFqOmDqFxcXCJdID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgoXFxcInRvcGxpc3Q/XFxcIikubGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwid3lfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcImh0dHBzOi8vbXVzaWMuMTYzLmNvbS93ZWFwaS92My9zb25nL2RldGFpbFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGM6IGBbe1xcXCJpZFxcXCI6JHt0MX19XWBcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGEgPSBfLnNvbmdzWzBdO1xcbiAgICAgICAgICAgICAgICBuYW1lID0gYS5uYW1lO1xcbiAgICAgICAgICAgICAgICBhcnRpc3QgPSBhLmFyLm1hcChfID0+IF8ubmFtZSkuam9pbihcXFwiJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFt0c1sxXSArIFNpemUoYS5sID8gYS5sLnNpemUgOiBhLm0uc2l6ZSldO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGEuaClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1syXSArIFNpemUoYS5oLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLnNxKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZShhLnNxLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChhLmhyKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzRdICsgU2l6ZShhLmhyLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgbmFtZSwgYXJ0aXN0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwid3lcXFwiLCB0MSwgaSwgbmFtZSwgYXJ0aXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCBhLmlkLCBuYW1lLCBhcnRpc3QpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOatjOivjVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbHJjID0gJC5yZXF1aXJlKFxcXCJ3eT9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCJodHRwczovL211c2ljLjE2My5jb20vd2VhcGkvc29uZy9seXJpY1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbHY6IC0xLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGt2OiAtMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0djogLTFcXG4gICAgICAgICAgICAgICAgICAgIH0pLmxyYy5seXJpYztcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICBscmMgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICgoYS5mZWUgPT0gMCB8fCBhLmZlZSA9PSA4KSAmJiAoXy5wcml2aWxlZ2VzWzBdLnN0ID4gLTEpKVxcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gYGh0dHA6Ly9tdXNpYy4xNjMuY29tL3NvbmcvbWVkaWEvb3V0ZXIvdXJsP2lkPSR7dDF9Lm1wM2A7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwib3BlblxcXCIsIFxcXCJ3eVxcXCIsIHQxLCAwLCBuYW1lLCBhcnRpc3QpO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8v6aaW6aG1XFxuICAgICAgICAgICAgICAgIGlmICghdDEubWF0Y2goL1xcXFw/LykpIHQxID0gXFxcInRvcC9wbGF5bGlzdD9jYXQ9XFxcIiArIHQxICsgXFxcIiZcXFwiO1xcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgodDEpO1xcbiAgICAgICAgICAgICAgICAoXy5yZXN1bHQgfHwgXy5wbGF5bGlzdHMpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwgfHwgXy5waWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwid3k/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwczovL211c2ljLjE2My5jb20vYXBpL3Y2L3BsYXlsaXN0L2RldGFpbD9saW1pdD05OTk5OSZpZD1cXFwiICsgdDEgKyBcXFwiJm49OTk5OTlcXFwiKS5wbGF5bGlzdC50cmFja3M7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBbXTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLm1hcCh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gIHM6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgIGxpbWl0OiAzMCxcXG4gICAgICAgICAgICAgICAgb2Zmc2V0OiAoTVlfUEFHRSAtIDEpICogMzAsXFxuICAgICAgICAgICAgICAgIHR5cGU6IHN0eXBlLFxcbiAgICAgICAgICAgICAgICBzdHJhdGVneTogNSxcXG4gICAgICAgICAgICAgICAgcXVlcnlDb3JyZWN0OiB0cnVlXFxuICAgICAgICAgICAgfSkucmVzdWx0O1xcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBzdXJsKDEpLnNvbmdzLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoX19baXNVXShfKSkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgJyAtICcgKyBfLmFyLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWwucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAoKF8uZmVlID09IDAgfHwgXy5mZWUgPT0gOCkgJiYgKF8ucHJpdmlsZWdlID8gKF8ucHJpdmlsZWdlLnN0ID4gLTEpIDogMSkpID8gMCA6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBzdXJsKDEwMDApLnBsYXlsaXN0cztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1UgPT09IDEpIHJldHVybiBsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdC5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2UgeyAvLyDmkJzntKIg5YiG5Lqr6ZO+5o6lXFxuICAgICAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXFxcImh0dHBzOi8vbXVzaWMuMTYzLmNvbS93ZWFwaS92My9zb25nL2RldGFpbFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjOiBgW3tcXFwiaWRcXFwiOiR7a2V5d29yZH19XWBcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYSA9IF8uc29uZ3NbMF07XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGEubmFtZSArICcgLSAnICsgYS5hci5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGEuYWwucGljVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICgoYS5mZWUgPT0gMCB8fCBhLmZlZSA9PSA4KSAmJiAoXy5wcml2aWxlZ2VzWzBdLnN0ID4gLTEpKSA/IDAgOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGEuaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwiaHR0cHM6Ly9tdXNpYy4xNjMuY29tL2FwaS92Ni9wbGF5bGlzdC9kZXRhaWw/aWQ9XFxcIiArIGtleXdvcmQpLnBsYXlsaXN0O1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVySW1nVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICdteSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfV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xcIuabsumjjuamnFxcXCJdW18uY2xhc3NpZnldO1xcbiAgICAgICAgICAgIGlmICghaVRhZ1tcXFwi5o6S6KGMXFxcIl1bbmFtZV0pIGlUYWdbXFxcIuaOkuihjFxcXCJdW25hbWVdID0gW107XFxuICAgICAgICAgICAgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bbmFtZV0ucHVzaChFeHRyYSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBfLnJhbmtuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICB6eWlkOiBfLnJhbmtpZCxcXG4gICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJrZ19pVGFnXFxcIiwgaVRhZyk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDor6bmg4VcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFt7XFxuICAgICAgICAgICAgICAgICAgICBoYXNoOiB0MVxcbiAgICAgICAgICAgICAgICB9XSlbMF07XFxuICAgICAgICAgICAgICAgIFthcnRpc3QsIG5hbWVdID0gXy5uYW1lLnNwbGl0KCcgLSAnKTtcXG4gICAgICAgICAgICAgICAgYWxidW1faWQgPSBfLnJlY29tbWVuZF9hbGJ1bV9pZDtcXG4gICAgICAgICAgICAgICAgYWxidW1fYXVkaW9faWQgPSBfLmFsYnVtX2F1ZGlvX2lkO1xcbiAgICAgICAgICAgICAgICByZWxhdGVfZ29vZHMgPSBfLnJlbGF0ZV9nb29kcztcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBfLnJlbGF0ZV9nb29kcy5tYXAoKF8sIGkpID0+IHRzW2kgKyAxXSArIFNpemUoXy5pbmZvLmZpbGVzaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChhcnIsIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKGFyciwgdDEsIG5hbWUsIGFydGlzdCwgcmVsYXRlX2dvb2RzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwia2dcXFwiLCB0MSwgaSwgbmFtZSwgYXJ0aXN0LCByZWxhdGVfZ29vZHMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBuYW1lLCBhcnRpc3QsIHJlbGF0ZV9nb29kcyk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdXJsID0gYGh0dHBzOi8vd3d3YXBpLmt1Z291LmNvbS95eS9pbmRleC5waHA/cj1wbGF5JTJGZ2V0ZGF0YSZoYXNoPSR7dDF9JmFsYnVtX2lkPSR7Xy5yZWNvbW1lbmRfYWxidW1faWR9Jm1pZD0ke1IoMzIpfSZwbGF0aWQ9NGA7XFxuICAgICAgICAgICAgICAgIF9fID0gSlNPTi5wYXJzZShmZXRjaCh1cmwpKS5kYXRhO1xcbiAgICAgICAgICAgICAgICBscmMgPSBfXy5seXJpY3M7XFxuICAgICAgICAgICAgICAgIGlmIChfXy5wcml2aWxlZ2UgPT0gMCB8fCBfXy5wcml2aWxlZ2UgPT0gOCkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gX18ucGxheV91cmwgfHwgX18ucGxheV9iYWNrdXBfdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF1cmwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB1cmwgPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwodDEsICcxMjgnLCBhbGJ1bV9pZCwgYWxidW1fYXVkaW9faWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vbS5rdWdvdS5jb20vYXBwL2kvZ2V0U29uZ0luZm8ucGhwP2NtZD1wbGF5SW5mbyZoYXNoPVxcXCIgKyB0MSkpLnVybDtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcIm9wZW5cXFwiLCBcXFwia2dcXFwiLCB0MSwgMCwgbmFtZSwgYXJ0aXN0LCByZWxhdGVfZ29vZHMpO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOmmlumhtVxcbiAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cDovL3d3dzIua3Vnb3Uua3Vnb3UuY29tL3l1ZWt1L3Y5L3NwZWNpYWwvZ2V0U3BlY2lhbD9pc19hamF4PTEmY2RuPWNkbiZ0PTUmcGFnZXNpemU9MzAmYz1cXFwiICsgdDEgKyBcXFwiJnA9XFxcIiArIE1ZX1BBR0U7XFxuICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2godXJsKSkuc3BlY2lhbF9kYi5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zcGVjaWFsbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zcGVjaWFsaWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBfID0gZXhlY3V0ZVdlYlJ1bGUoYGh0dHA6Ly93d3cyLmt1Z291Lmt1Z291LmNvbS95dWVrdS92OS9zcGVjaWFsL3NpbmdsZS8ke3QxfS01LTk5OTk5Lmh0bWw/anNvbj10cnVlYCwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGdsb2JhbC5kYXRhKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoSlNPTi5wYXJzZShfKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBfID0gW107XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2goYGh0dHA6Ly9tb2JpbGVjZG5iai5rdWdvdS5jb20vYXBpL3YzL3Jhbmsvc29uZz9wYWdlc2l6ZT0zMCZwYWdlPSR7TVlfUEFHRX0mcmFua2lkPSR7dDF9YCkpLmRhdGEuaW5mbztcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICB0aXRsZTogKF8uZmlsZW5hbWUgfHwgXy5uYW1lKS5zcGxpdCgnIC0gJykucmV2ZXJzZSgpLmpvaW4oJyAtICcpLFxcbiAgICAgICAgICAgIGltZzogXy5hbGJ1bV9zaXphYmxlX2NvdmVyIHx8IF8uaW5mby5pbWFnZSxcXG4gICAgICAgICAgICBjb250ZW50OiAoXy5wcml2aWxlZ2UgPT0gMCB8fCBfLnByaXZpbGVnZSA9PSA4KSA/IDAgOiAxLFxcbiAgICAgICAgICAgIHp5aWQ6IF8uaGFzaFxcbiAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UsIHJ1bikge1xcbiAgICAgICAgX18gPSB7XFxuICAgICAgICAgICAgbGliOiAoXykgPT4gdHJ1ZSxcXG4gICAgICAgICAgICBwYWlkOiAoXykgPT4gKF8ucHJpdmlsZWdlICE9IDAgJiYgXy5wcml2aWxlZ2UgIT0gOCksXFxuICAgICAgICAgICAgZnJlZTogKF8pID0+IChfLnByaXZpbGVnZSA9PSAwIHx8IF8ucHJpdmlsZWdlID09IDgpXFxuICAgICAgICB9O1xcbiAgICAgICAgc3VybCA9IChzdHlwZSkgPT4gSlNPTi5wYXJzZShmZXRjaChgaHR0cDovL21vYmlsZWNkbi5rdWdvdS5jb20vYXBpL3YzL3NlYXJjaC8ke3N0eXBlfT9mb3JtYXQ9anNvbiZrZXl3b3JkPSR7a2V5d29yZH0mcGFnZT0ke01ZX1BBR0V9JnBhZ2VzaXplPTMwYCkpLmRhdGEuaW5mbztcXG4gICAgICAgIHN1cmwyID0gKHBsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgbWlkID0gUigzMik7XFxuICAgICAgICAgICAgYXJyID0gW1xcbiAgICAgICAgICAgICAgICBcXFwic3JjYXBwaWQ9MjkxOVxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJjbGllbnR2ZXI9MTAwMFxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJjbGllbnR0aW1lPVxcXCIgKyBuZXcgRGF0ZSgpLmdldFRpbWUoKSxcXG4gICAgICAgICAgICAgICAgXFxcIm1pZD1cXFwiICsgbWlkLFxcbiAgICAgICAgICAgICAgICBcXFwidXVpZD1cXFwiICsgbWlkLFxcbiAgICAgICAgICAgICAgICBcXFwiZGZpZD0tXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcImFwcGlkPTEwNThcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwidG9rZW49XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInVzZXJpZD0wXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcImtleXdvcmQ9XFxcIiArIGtleXdvcmQsXFxuICAgICAgICAgICAgICAgIFxcXCJwYWdlPVxcXCIgKyBNWV9QQUdFLFxcbiAgICAgICAgICAgICAgICBcXFwicGFnZXNpemU9MzBcXFwiLFxcbiAgICAgICAgICAgICAgICBwbGF0Zm9ybVxcbiAgICAgICAgICAgIF0uc29ydCgpO1xcbiAgICAgICAgICAgIHNpZ25hdHVyZSA9IFxcXCJOVlBoNW9vNzE1ejVESVdBZVFsaE1Ec1dYWFFWNGh3dFxcXCI7XFxuICAgICAgICAgICAgc2lnbmF0dXJlID0gbWQ1KHNpZ25hdHVyZSArIGFyci5qb2luKFxcXCJcXFwiKSArIHNpZ25hdHVyZSk7XFxuICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOi8vZ2F0ZXdheS5rdWdvdS5jb20vY29tcGxleHNlYXJjaC92My9zZWFyY2gvc29uZz9cXFwiICsgYXJyLmpvaW4oXFxcIiZcXFwiKSArIFxcXCImc2lnbmF0dXJlPVxcXCIgKyBzaWduYXR1cmU7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZmV0Y2godXJsKSkuZGF0YS5saXN0cztcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgIGNhc2UgJzAnOiAvLyDmkJzntKLljZXmm7JcXG4gICAgICAgICAgICAgICAgaWYgKGlzVSA9PSAnZnJlZScpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBzdXJsMihcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocnVuID09ICdydW4nKSByZXR1cm4gbGlzdFswXTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIC8vIGxpc3QgPSBzdXJsKCdzb25nJyk7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gc3VybDIoXFxcInBsYXRmb3JtPVdlYkZpbHRlclxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJ1biA9PSAnc3JlYycpIHJldHVybiBsaXN0O1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwia2c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KGxpc3QpLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChfLmZpbGVuYW1lIHx8IF8ubmFtZSkuc3BsaXQoJyAtICcpLnJldmVyc2UoKS5qb2luKCcgLSAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWxidW1fc2l6YWJsZV9jb3ZlciB8fCBfLmluZm8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogKF8ucHJpdmlsZWdlID09IDAgfHwgXy5wcml2aWxlZ2UgPT0gOCkgPyAwIDogMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmhhc2hcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICBzdXJsKCdzcGVjaWFsJykubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uc3BlY2lhbG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1ndXJsLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc3BlY2lhbGlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuICAgIGFqYXg6IGZ1bmN0aW9uKHJlc291cmNlKSB7XFxuICAgICAgICByZXNvdXJjZSA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicmVsYXRlXFxcIjogMSxcXG4gICAgICAgICAgICBcXFwidXNlcmlkXFxcIjogXFxcIjI2MjY0MzE1MzZcXFwiLFxcbiAgICAgICAgICAgIFxcXCJ2aXBcXFwiOiAxLFxcbiAgICAgICAgICAgIFxcXCJ0b2tlblxcXCI6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcHBpZFxcXCI6IDEwMDEsXFxuICAgICAgICAgICAgXFxcImJlaGF2aW9yXFxcIjogXFxcInBsYXlcXFwiLFxcbiAgICAgICAgICAgIFxcXCJhcmVhX2NvZGVcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgXFxcImNsaWVudHZlclxcXCI6IFxcXCI4OTkwXFxcIixcXG4gICAgICAgICAgICBcXFwibmVlZF9oYXNoX29mZnNldFxcXCI6IDEsXFxuICAgICAgICAgICAgXFxcInJlc291cmNlXFxcIjogcmVzb3VyY2UubWFwKF8gPT4gKHtcXG4gICAgICAgICAgICAgICAgXFxcImlkXFxcIjogMCxcXG4gICAgICAgICAgICAgICAgXFxcInR5cGVcXFwiOiBcXFwiYXVkaW9cXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiaGFzaFxcXCI6IF8uaGFzaCB8fCBfLkZpbGVIYXNoXFxuICAgICAgICAgICAgfSkpXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwOi8vbWVkaWEuc3RvcmUua3Vnb3UuY29tL3YxL2dldF9yZXNfcHJpdmlsZWdlXFxcIiwge1xcbiAgICAgICAgICAgIGJvZHk6IHJlc291cmNlLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KSkuZGF0YTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgR2V0TXVzaWNV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gICAgICAgIGRhdGUgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKTtcXG4gICAgICAgIHBhcmFtcyA9IFtcXG4gICAgICAgICAgICAndXNlcmlkPScgKyB1c2VyaWQsXFxuICAgICAgICAgICAgJ3Rva2VuPScgKyB0b2tlbixcXG4gICAgICAgICAgICAnY2xpZW50dGltZT0nICsgTWF0aC5mbG9vcihkYXRlIC8gMTAwMCksXFxuICAgICAgICAgICAgJ2FwcGlkPTMxMTYnLFxcbiAgICAgICAgICAgICdjbGllbnR2ZXI9MTA1MTgnLFxcbiAgICAgICAgICAgICdtaWQ9JyArIG1pZCxcXG4gICAgICAgICAgICAndXVpZD0nICsgbWQ1KG1pZCksXFxuICAgICAgICAgICAgJ2RmaWQ9LSdcXG4gICAgICAgIF0uc29ydCgpO1xcbiAgICAgICAgc2lnbmF0dXJlID0gbWQ1KFxcbiAgICAgICAgICAgIHNpZ25rZXkgK1xcbiAgICAgICAgICAgIHBhcmFtcy5qb2luKFxcXCJcXFwiKSArXFxuICAgICAgICAgICAgX2JvZHkgK1xcbiAgICAgICAgICAgIHNpZ25rZXlcXG4gICAgICAgICk7XFxuXFxuICAgICAgICByZXEgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL2dhdGV3YXkua3Vnb3UuY29tL3YyL3JlcG9ydC9saXN0ZW5fc29uZz9cXFwiICsgcGFyYW1zLmpvaW4oXFxcIiZcXFwiKSArIFxcXCImc2lnbmF0dXJlPVxcXCIgKyBzaWduYXR1cmUsIHtcXG4gICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcIlBPU1RcXFwiLFxcbiAgICAgICAgICAgIFxcXCJib2R5XFxcIjogX2JvZHksXFxuICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIkFuZHJvaWQ3MTItQW5kcm9pZFBob25lLTEwNTE4LTE4LTAtTmV0TXVzaWMtd2lmaVxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJLRy1USGFzaFxcXCI6IFxcXCIzZTVlYzZiXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVJlY1xcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIktHLVJDXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwieC1yb3V0ZXJcXFwiOiBcXFwieW91dGgua3Vnb3UuY29tXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pKTtcXG4gICAgICAgIGlmIChyZXEuc3RhdHVzID09IDEpIHtcXG4gICAgICAgICAgICBpZiAoaXNqeCkge1xcbiAgICAgICAgICAgICAgICBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKCdqeGxpc3Rfa2cnLCBbXSlcXG4gICAgICAgICAgICAgICAgICAgIC5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1kNShfLnRpdGxlICsgXy51cmwpID09IFxcXCJjODc3YWU3MmI5N2JjMjY3MjBhZDhiMWEzOTM2MmQ0N1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy50aW1lID0gZGF0ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5zaWduaW4gPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gX1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF9rZycsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nrb7liLDmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/nrb7liLDmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSBpZiAocmVxLmVycm9yX2NvZGUgPT0gMTMwMDEyKSB7IC8vIOetvuWIsOi/h+S6hu+8nyAgICAgIFxcbiAgICAgICAgICAgIGlmIChpc2p4KSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF9rZycsIFtdKVxcbiAgICAgICAgICAgICAgICAgICAgLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KF8udGl0bGUgKyBfLnVybCkgPT0gXFxcImM4NzdhZTcyYjk3YmMyNjcyMGFkOGIxYTM5MzYyZDQ3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnRpbWUgPSBkYXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnNpZ25pbiA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBfXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X2tnJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOWksei0pe+8muS7iuWkqeW3sue7j+etvuWIsOi/h+S6hu+8n1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+etvuWIsOWksei0pe+8muS7iuWkqeW3sue7j+etvuWIsOi/h+S6hu+8n1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v562+5Yiw5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or6bmg4VcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGkgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHA6Ly9kYXRhY2VudGVyLmt1d28uY24vZC5jP2Nta2V5PXBsaXN0X3BsMjAxMiZmdD1tdXNpYyZyZXNlbmM9dXRmOCZpZHM9XFxcIiArIHQxKSlbMF07XFxuICAgICAgICAgICAgICAgICAgICBuID0gXy5OX01JTkZPO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChrIG9mIFsxMjgsIDMyMCwgMjAwMCwgNDAwMF0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWcgPSBuZXcgUmVnRXhwKCdiaXRyYXRlOicgKyBrICsgJyxmb3JtYXQ6W14sXSssc2l6ZTooW147XSspJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlZyA9IG4ubWF0Y2gocmVnKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1tpXSArIHJlZ1sxXS5yZXBsYWNlKC9cXFxccyptYi9pLCBcXFwiIE1CXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpKys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIHQxLCBuYW1lLCBhcnRpc3QpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9ICQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5HZXRNdXNpY1VybChcXFwiZG93blxcXCIsIFxcXCJrd1xcXCIsIHQxLCBpLCBuYW1lLCBhcnRpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCBhcnIsIHQxLCBfLm5hbWUsIF8uYXJ0aXN0KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvLyDmrYzor41cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwOi8vbS5rdXdvLmNuL25ld2g1L3NpbmdsZXMvc29uZ2luZm9hbmRscmM/bXVzaWNJZD1cXFwiICsgdDEgKyBcXFwiJlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbHJjID0gXy5scmNsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtID0gTWF0aC5mbG9vcihfLnRpbWUgLyA2MCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcyA9IChfLnRpbWUgJSA2MCkudG9GaXhlZCgzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYFske20udG9TdHJpbmcoKS5wYWRTdGFydCgyLCAnMCcpfToke3MucGFkU3RhcnQoNiwgJzAnKX1dYCArIF8ubGluZUx5cmljXFxuICAgICAgICAgICAgICAgICAgICB9KS5qb2luKCdcXFxcbicpO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxyYyA9IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgX18gPSBfLnNvbmdpbmZvO1xcbiAgICAgICAgICAgICAgICAvLyDpk77mjqVcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHBjYXBpLnJlcGxhY2UoLyhhcGlcXFxcLykvLCAnJDF2MS8nKSArIFxcXCJtdXNpYy9wbGF5VXJsP21pZD1cXFwiICsgdDEgKyBcXFwiJnR5cGU9bXVzaWMmXFxcIikudXJsO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChpc192aXBNdXNpYykge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcImt3XFxcIiwgdDEsIDAsIF9fLnNvbmdOYW1lLCBfXy5hcnRpc3QpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICh1cmwubWF0Y2goXFxcInRvYXN0Oi8vXFxcIikpIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogbHJjXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g6aaW6aG1XFxuICAgICAgICAgICAgICAgIGlmICghdDEubWF0Y2goJ2lkPXJjbScpIHx8IE1ZX1BBR0UgPT09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcImt3P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChwY2FwaSArIHQxICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAoXy5kYXRhIHx8IF8ubGlzdCkubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgocGNhcGkgKyBcXFwicGxheWxpc3QvcGxheUxpc3RJbmZvP3BpZD1cXFwiICsgdDEgKyBcXFwiJnBuPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZybj0zMCZcXFwiKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgocGNhcGkgKyBcXFwiYmFuZy9iYW5nL211c2ljTGlzdD9iYW5nSWQ9XFxcIiArIHQxICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIik7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tdXNpY0xpc3QubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgIHRpdGxlOiAoXy5zb25nTmFtZSB8fCBfLm5hbWUpICsgJyAtICcgKyBfLmFydGlzdCxcXG4gICAgICAgICAgICBpbWc6IF8ucGljIHx8IF8uaW1nIHx8IGZldGNoKCdodHRwOi8vYXJ0aXN0cGljc2VydmVyLmt1d28uY24vcGljLndlYj90eXBlPXJpZF9waWMmcGljdHlwZT11cmwmc2l6ZT01MDAmcmlkPScgKyBfLmlkKSxcXG4gICAgICAgICAgICBjb250ZW50OiBfLmlzTGlzdGVuRmVlID09IHRydWUgPyAxIDogMCxcXG4gICAgICAgICAgICB6eWlkOiBfLmlkIHx8IF8ucmlkXFxuICAgICAgICB9LCAxKSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSwgcnVuKSB7XFxuICAgICAgICBpZiAoaXNVICE9IFxcXCJ1cmxcXFwiKSB7XFxuICAgICAgICAgICAgX18gPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogKF8pID0+IHRydWUsXFxuICAgICAgICAgICAgICAgIHBhaWQ6IChfKSA9PiBfLnRwYXkgPT0gJzEnLFxcbiAgICAgICAgICAgICAgICBmcmVlOiAoXykgPT4gXy50cGF5ID09ICcwJ1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgc3VybCA9IChzdHlwZSkgPT4gJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgocGNhcGkgKyBcXFwic2VhcmNoL3NlYXJjaFxcXCIgKyBzdHlwZSArIFxcXCJCeWtleVdvcmQ/a2V5PVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwbj1cXFwiICsgTVlfUEFHRSArIFxcXCImcm49MzAmXFxcIikubGlzdDtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgLy8gc3VybCgnTXVzaWMnKS5tYXAoKTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwOi8vc2VhcmNoLmt1d28uY24vci5zP2NsaWVudD1rdCZhbGw9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBuPVxcXCIgKyAoTVlfUEFHRSAtIDEpICsgXFxcIiZybj0zMCZ1aWQ9MCZ2ZXI9a3dwbGF5ZXJoZF9hcl84LjUuNC41JmZ0PW11c2ljJmNsdXN0ZXI9MCZzdHJhdGVneT0yMDEyJmVuY29kaW5nPXV0ZjgmcmZvcm1hdD1qc29uJnZlcm1lcmdlPTEmbW9iaT0xXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc1UgIT0gJ2ZyZWUnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCArPSBcXFwiJnZpcHZlcj0xXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKHVybCkpLmFic2xpc3Q7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKF8gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfX1tpc1VdKF8pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChydW4gPT0gJ3J1bicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghXy5TT05HTkFNRS5tYXRjaCgn54mH5q61JykpIHJldHVybiBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmlkID0gXy5NVVNJQ1JJRC5zcGxpdCgnXycpWzFdICsgJyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy53ZWJfYWxidW1waWNfc2hvcnQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcgPSBcXFwiaHR0cHM6Ly9pbWcyLmt1d28uY24vc3Rhci9hbGJ1bWNvdmVyL1xcXCIgKyBfLndlYl9hbGJ1bXBpY19zaG9ydC5yZXBsYWNlKC9eMTIwLywgJzUwMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcgPSBmZXRjaCgnaHR0cDovL2FydGlzdHBpY3NlcnZlci5rdXdvLmNuL3BpYy53ZWI/dHlwZT1yaWRfcGljJnBpY3R5cGU9dXJsJnNpemU9NTAwJnJpZD0nICsgcmlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbWcgPT0gXFxcIm5vcGljXFxcIiAmJiBfLndlYl9hcnRpc3RwaWNfc2hvcnQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWcgPSBcXFwiaHR0cDovL2ltZzEua3V3by5jbi9zdGFyL3N0YXJoZWFkcy9cXFwiICsgXy53ZWJfYXJ0aXN0cGljX3Nob3J0LnJlcGxhY2UoL14xMjAvLCAnNTAwJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8uU09OR05BTUUgKyAnIC0gJyArIF8uQVJUSVNULFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8udHBheSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiByaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIHN1cmwoJ1BsYXlMaXN0JykubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJodHRwOi8vbS5rdXdvLmNuL25ld2g1L3NpbmdsZXMvc29uZ2luZm9hbmRscmM/bXVzaWNJZD1cXFwiICsga2V5d29yZCArIFxcXCImXFxcIikuc29uZ2luZm87XFxuICAgICAgICAgICAgICAgICAgICBfXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpY1xcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJrdz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgocGNhcGkucmVwbGFjZSgvKGFwaVxcXFwvKS8sICckMXYxLycpICsgXFxcIm11c2ljL3BsYXlVcmw/bWlkPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZ0eXBlPW11c2ljJlxcXCIpLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfXy5jb250ZW50ID0gMDtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKHZpcCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF9fLmNvbnRlbnQgPSAxO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgX18uenlpZCA9IGtleXdvcmQ7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYShfXywgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwia3c/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHBjYXBpICsgXFxcInBsYXlsaXN0L3BsYXlMaXN0SW5mbz9waWQ9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBuPTEmcm49MSZcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgYWpheDogZnVuY3Rpb24odXJsKSB7XFxuICAgICAgICBDb29raWUgPSBKU09OLnBhcnNlKGZldGNoUEMoJ2h0dHBzOi8vd3d3Lmt1d28uY24vZmF2aWNvbi5pY28/dj0xJywge1xcbiAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICB9KSkuaGVhZGVyc1snc2V0LWNvb2tpZSddO1xcbiAgICAgICAgQ29va2llID0gU3RyaW5nKENvb2tpZSkucmVwbGFjZSgvOy4qLywgJycpO1xcbiAgICAgICAgW2UsIHRdID0gQ29va2llLnNwbGl0KCc9Jyk7XFxuICAgICAgICB0ID0gdW5lc2NhcGUodCk7XFxuICAgICAgICBmb3IgKHZhciBuID0gXFxcIlxcXCIsIGkgPSAwOyBpIDwgZS5sZW5ndGg7IGkrKykgbiArPSBlLmNoYXJDb2RlQXQoaSkudG9TdHJpbmcoKTtcXG4gICAgICAgIG4gPSBTdHJpbmcobik7XFxuICAgICAgICB2YXIgciA9IE1hdGguZmxvb3Iobi5sZW5ndGggLyA1KSxcXG4gICAgICAgICAgICBvID0gcGFyc2VJbnQobi5jaGFyQXQocikgKyBuLmNoYXJBdCgyICogcikgKyBuLmNoYXJBdCgzICogcikgKyBuLmNoYXJBdCg0ICogcikgKyBuLmNoYXJBdCg1ICogcikpLFxcbiAgICAgICAgICAgIGwgPSBNYXRoLmNlaWwoZS5sZW5ndGggLyAyKSxcXG4gICAgICAgICAgICBjID0gTWF0aC5wb3coMiwgMzEpIC0gMTtcXG4gICAgICAgIHZhciBkID0gTWF0aC5yb3VuZCgxZTkgKiBNYXRoLnJhbmRvbSgpKSAlIDFlODtcXG4gICAgICAgIGZvciAobiArPSBkOyBuLmxlbmd0aCA+IDEwOylcXG4gICAgICAgICAgICBuID0gKHBhcnNlSW50KG4uc3Vic3RyaW5nKDAsIDEwKSkgKyBwYXJzZUludChuLnN1YnN0cmluZygxMCwgbi5sZW5ndGgpKSkudG9TdHJpbmcoKTtcXG4gICAgICAgIG4gPSAobyAqIG4gKyBsKSAlIGM7XFxuICAgICAgICB2YXIgaCA9IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGYgPSBcXFwiXFxcIjtcXG4gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0Lmxlbmd0aDsgaSsrKVxcbiAgICAgICAgICAgIGYgKz0gKGggPSBwYXJzZUludCh0LmNoYXJDb2RlQXQoaSkgXiBNYXRoLmZsb29yKG4gLyBjICogMjU1KSkpIDwgMTYgPyBcXFwiMFxcXCIgKyBoLnRvU3RyaW5nKDE2KSA6IGgudG9TdHJpbmcoMTYpLFxcbiAgICAgICAgICAgIG4gPSAobyAqIG4gKyBsKSAlIGM7XFxuICAgICAgICBmb3IgKGQgPSBkLnRvU3RyaW5nKDE2KTsgZC5sZW5ndGggPCA4OylcXG4gICAgICAgICAgICBkID0gXFxcIjBcXFwiICsgZDtcXG4gICAgICAgIFNlY3JldCA9IGYgKyBkO1xcbiAgICAgICAgdXJsICs9IGBodHRwc1N0YXR1cz0xJnJlcUlkPSR7Uig4KX0tJHtSKDQpfS0ke1IoNCl9LSR7Uig0KX0tJHtSKDEyKX0mcGxhdD13ZWJfd3d3JmZyb209YDtcXG4gICAgICAgIGdldGRhdGEgPSAoYWpheGVycikgPT4ge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBfID0gSlNPTi5wYXJzZShmZXRjaFBDKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8va3V3by5jbi8nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICdDb29raWUnOiBDb29raWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1NlY3JldCc6IFNlY3JldFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSkuZGF0YTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFqYXhlcnIgPCAyID8gZ2V0ZGF0YShhamF4ZXJyICsgMSkgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gZ2V0ZGF0YSgwKTtcXG4gICAgfSxcXG5cXG5cXG5cXG4gICAgZGVzOiBmdW5jdGlvbih0KSB7XFxuICAgICAgICByZXR1cm4gZXhlY3V0ZVdlYlJ1bGUoXFxcIlxcXCIsICQudG9TdHJpbmcoKHQpID0+IHtcXG4gICAgICAgICAgICBjb25zdCBCdWZmZXIgPSB7XFxuICAgICAgICAgICAgICAgIGZyb206IHQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgciA9IHQubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICAgICAgZSA9IG5ldyBVaW50OEFycmF5KHIpO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yIChuID0gMDsgbiA8IHI7IG4rKylcXG4gICAgICAgICAgICAgICAgICAgICAgICBlW25dID0gdC5jaGFyQ29kZUF0KG4pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByYW5nZSA9IHQgPT4gQXJyYXkuZnJvbShuZXcgQXJyYXkodCkua2V5cygpKTtcXG4gICAgICAgICAgICBMb25nID0gdCA9PiB7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHIgPSBCaWdJbnQodCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB0b1N0cmluZzogKCkgPT4gci50b1N0cmluZygpLFxcbiAgICAgICAgICAgICAgICAgICAgaXNOZWdhdGl2ZTogKCkgPT4gciA8IDAsXFxuICAgICAgICAgICAgICAgICAgICBub3Q6ICgpID0+IExvbmcofnIpLFxcbiAgICAgICAgICAgICAgICAgICAgbG93OiBOdW1iZXIociksXFxuICAgICAgICAgICAgICAgICAgICBvcjogdCA9PiBMb25nKHIgfCBCaWdJbnQodCkpLFxcbiAgICAgICAgICAgICAgICAgICAgeG9yOiB0ID0+IExvbmcociBeIEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICBhbmQ6IHQgPT4gTG9uZyhyICYgQmlnSW50KHQpKSxcXG4gICAgICAgICAgICAgICAgICAgIGVxdWFsczogdCA9PiByID09PSBCaWdJbnQodCksXFxuICAgICAgICAgICAgICAgICAgICBzaGlmdExlZnQ6IHQgPT4gTG9uZyhyIDw8IEJpZ0ludCh0KSksXFxuICAgICAgICAgICAgICAgICAgICBzaGlmdFJpZ2h0OiB0ID0+IExvbmcociA+PiBCaWdJbnQodCkpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIExvbmdBcnJheSA9IHQgPT4gdC5tYXAodCA9PiBMb25nKHQpKTtcXG4gICAgICAgICAgICBhcnJheUUgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICAzMSwgMCwgMSwgMiwgMywgNCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAzLCA0LCA1LCA2LCA3LCA4LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDcsIDgsIDksIDEwLCAxMSwgMTIsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTEsIDEyLCAxMywgMTQsIDE1LCAxNiwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAxNSwgMTYsIDE3LCAxOCwgMTksIDIwLCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDE5LCAyMCwgMjEsIDIyLCAyMywgMjQsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMjMsIDI0LCAyNSwgMjYsIDI3LCAyOCwgLTEsIC0xLFxcbiAgICAgICAgICAgIC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AzMywgMSwgNDEsIDksIDQ5LCAxNywgNTcsIDI1LFxcbiAgICAgICAgICAgICAgICAzMiwgMCwgNDAsIDgsIDQ4LCAxNiwgNTYsIDI0XFxuICAgICAgICAgICAgXSlcXG4gICAgICAgICAgICBhcnJheUxzID0gW1xcbiAgICAgICAgICAgICAgICAxLCAxLCAyLCAyLCAyLCAyLCAyLCAyLFxcbiAgICAgICAgICAgICAgICAxLCAyLCAyLCAyLCAyLCAyLCAyLCAxXFxuICAgICAgICAgICAgXVxcbiAgICAgICAgICAgIGFycmF5THNNYXNrID0gTG9uZ0FycmF5KFswLCAxMDQ4NTc3LCAzMTQ1NzMxXSlcXG4gICAgICAgICAgICBhcnJheU1hc2sgPSByYW5nZSg2NCkubWFwKHQgPT4gTWF0aC5wb3coMiwgdCkpXFxuICAgICAgICAgICAgYXJyYXlNYXNrWzYzXSAqPSAtMVxcbiAgICAgICAgICAgIGFycmF5UCA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDE1LCA2LCAxOSwgMjAsIDI4LCAxMSwgMjcsIDE2LFxcbiAgICAgICAgICAgICAgICAwLCAxNCwgMjIsIDI1LCA0LCAxNywgMzAsIDksXFxuICAgICAgICAgICAgICAgIDEsIDcsIDIzLCAxMywgMzEsIDI2LCAyLCA4LFxcbiAgICAgICAgICAgICAgICAxOCwgMTIsIDI5LCA1LCAyMSwgMTAsIDMsIDI0XFxuICAgICAgICAgICAgXSlcXG4gICAgICAgICAgICBhcnJheVBDXzEgPSBMb25nQXJyYXkoW1xcbiAgICAgICAgICAgICAgICA1NiwgNDgsIDQwLCAzMiwgMjQsIDE2LCA4LCAwLFxcbiAgICAgICAgICAgICAgICA1NywgNDksIDQxLCAzMywgMjUsIDE3LCA5LCAxLFxcbiAgICAgICAgICAgICAgICA1OCwgNTAsIDQyLCAzNCwgMjYsIDE4LCAxMCwgMixcXG4gICAgICAgICAgICAgICAgNTksIDUxLCA0MywgMzUsIDYyLCA1NCwgNDYsIDM4LFxcbiAgICAgICAgICAgICAgICAzMCwgMjIsIDE0LCA2LCA2MSwgNTMsIDQ1LCAzNyxcXG4gICAgICAgICAgICAgICAgMjksIDIxLCAxMywgNSwgNjAsIDUyLCA0NCwgMzYsXFxuICAgICAgICAgICAgICAgIDI4LCAyMCwgMTIsIDQsIDI3LCAxOSwgMTEsIDNcXG4gICAgICAgICAgICBdKVxcbiAgICAgICAgICAgIGFycmF5UENfMiA9IExvbmdBcnJheShbXFxuICAgICAgICAgICAgICAgIDEzLCAxNiwgMTAsIDIzLCAwLCA0LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDIsIDI3LCAxNCwgNSwgMjAsIDksIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMjIsIDE4LCAxMSwgMywgMjUsIDcsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgMTUsIDYsIDI2LCAxOSwgMTIsIDEsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNDAsIDUxLCAzMCwgMzYsIDQ2LCA1NCwgLTEsIC0xLFxcbiAgICAgICAgICAgICAgICAyOSwgMzksIDUwLCA0NCwgMzIsIDQ3LCAtMSwgLTEsXFxuICAgICAgICAgICAgICAgIDQzLCA0OCwgMzgsIDU1LCAzMywgNTIsIC0xLCAtMSxcXG4gICAgICAgICAgICAgICAgNDUsIDQxLCA0OSwgMzUsIDI4LCAzMSwgLTEsIC0xXFxuICAgICAgICAgICAgXSlcXG4gICAgICAgICAgICBtYXRyaXhOU0JveCA9IFtcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTQsIDQsIDMsIDE1LCAyLCAxMywgNSwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAxNCwgNiwgOSwgMTEsIDIsIDAsIDUsXFxuICAgICAgICAgICAgICAgICAgICA0LCAxLCAxMCwgMTIsIDE1LCA2LCA5LCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDgsIDEyLCA3LCA4LCAxMSwgNywgMCxcXG4gICAgICAgICAgICAgICAgICAgIDAsIDE1LCAxMCwgNSwgMTQsIDQsIDksIDEwLFxcbiAgICAgICAgICAgICAgICAgICAgNywgOCwgMTIsIDMsIDEzLCAxLCAzLCA2LFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDEyLCA2LCAxMSwgMiwgOSwgNSwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDIsIDExLCAxNCwgMSwgNywgOCwgMTNcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTUsIDAsIDksIDUsIDYsIDEwLCAxMiwgOSxcXG4gICAgICAgICAgICAgICAgICAgIDgsIDcsIDIsIDEyLCAzLCAxMywgNSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDEsIDE0LCA3LCA4LCAxMSwgNCwgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCAxMSwgMTMsIDYsIDQsIDEsIDEwLCAxNSxcXG4gICAgICAgICAgICAgICAgICAgIDMsIDEzLCAxMiwgMTEsIDE1LCAzLCA2LCAwLFxcbiAgICAgICAgICAgICAgICAgICAgNCwgMTAsIDEsIDcsIDgsIDQsIDExLCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA4LCAwLCA2LCAyLCAxNSwgOSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDcsIDEsIDEwLCAxMiwgMTQsIDIsIDUsIDlcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTAsIDEzLCAxLCAxMSwgNiwgOCwgMTEsIDUsXFxuICAgICAgICAgICAgICAgICAgICA5LCA0LCAxMiwgMiwgMTUsIDMsIDIsIDE0LFxcbiAgICAgICAgICAgICAgICAgICAgMCwgNiwgMTMsIDEsIDMsIDE1LCA0LCAxMCxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCA5LCA3LCAxMiwgNSwgMCwgOCwgNyxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAxLCAyLCA0LCAzLCA2LCAxMiwgMTEsXFxuICAgICAgICAgICAgICAgICAgICAwLCAxMywgNSwgMTQsIDYsIDgsIDE1LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgNywgMTAsIDgsIDE1LCA0LCA5LCAxMSwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDksIDAsIDE0LCAzLCAxMCwgNywgMSwgMTJcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgNywgMTAsIDEsIDE1LCAwLCAxMiwgMTEsIDUsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgOSwgOCwgMywgOSwgNywgNCwgOCxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA2LCAyLCAxLCA2LCAxMSwgMTIsIDIsXFxuICAgICAgICAgICAgICAgICAgICAzLCAwLCA1LCAxNCwgMTAsIDEzLCAxNSwgNCxcXG4gICAgICAgICAgICAgICAgICAgIDEzLCAzLCA0LCA5LCA2LCAxMCwgMSwgMTIsXFxuICAgICAgICAgICAgICAgICAgICAxMSwgMCwgMiwgNSwgMCwgMTMsIDE0LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgOCwgMTUsIDcsIDQsIDE1LCAxLCAxMCwgNyxcXG4gICAgICAgICAgICAgICAgICAgIDUsIDYsIDEyLCAxMSwgMywgOCwgOSwgMTRcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMiwgNCwgOCwgMTUsIDcsIDEwLCAxMywgNixcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDMsIDEyLCAxMSwgNywgMTQsIDAsXFxuICAgICAgICAgICAgICAgICAgICAxMiwgMiwgNSwgOSwgMTAsIDEzLCAwLCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMSwgMTEsIDE1LCA1LCA2LCA4LCA5LCAxNCxcXG4gICAgICAgICAgICAgICAgICAgIDE0LCAxMSwgNSwgNiwgNCwgMSwgMywgMTAsXFxuICAgICAgICAgICAgICAgICAgICAyLCAxMiwgMTUsIDAsIDEzLCAyLCA4LCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDgsIDAsIDE1LCA3LCAxNCwgOSwgNCxcXG4gICAgICAgICAgICAgICAgICAgIDEyLCA3LCAxMCwgOSwgMSwgMTMsIDYsIDNcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTIsIDksIDAsIDcsIDksIDIsIDE0LCAxLFxcbiAgICAgICAgICAgICAgICAgICAgMTAsIDE1LCAzLCA0LCA2LCAxMiwgNSwgMTEsXFxuICAgICAgICAgICAgICAgICAgICAxLCAxNCwgMTMsIDAsIDIsIDgsIDcsIDEzLFxcbiAgICAgICAgICAgICAgICAgICAgMTUsIDUsIDQsIDEwLCA4LCAzLCAxMSwgNixcXG4gICAgICAgICAgICAgICAgICAgIDEwLCA0LCA2LCAxMSwgNywgOSwgMCwgNixcXG4gICAgICAgICAgICAgICAgICAgIDQsIDIsIDEzLCAxLCA5LCAxNSwgMywgOCxcXG4gICAgICAgICAgICAgICAgICAgIDE1LCAzLCAxLCAxNCwgMTIsIDUsIDExLCAwLFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTIsIDE0LCA3LCA1LCAxMCwgOCwgMTNcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgNCwgMSwgMywgMTAsIDE1LCAxMiwgNSwgMCxcXG4gICAgICAgICAgICAgICAgICAgIDIsIDExLCA5LCA2LCA4LCA3LCA2LCA5LFxcbiAgICAgICAgICAgICAgICAgICAgMTEsIDQsIDEyLCAxNSwgMCwgMywgMTAsIDUsXFxuICAgICAgICAgICAgICAgICAgICAxNCwgMTMsIDcsIDgsIDEzLCAxNCwgMSwgMixcXG4gICAgICAgICAgICAgICAgICAgIDEzLCA2LCAxNCwgOSwgNCwgMSwgMiwgMTQsXFxuICAgICAgICAgICAgICAgICAgICAxMSwgMTMsIDUsIDAsIDEsIDEwLCA4LCAzLFxcbiAgICAgICAgICAgICAgICAgICAgMCwgMTEsIDMsIDUsIDksIDQsIDE1LCAyLFxcbiAgICAgICAgICAgICAgICAgICAgNywgOCwgMTIsIDE1LCAxMCwgNywgNiwgMTJcXG4gICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICAgICAgMTMsIDcsIDEwLCAwLCA2LCA5LCA1LCAxNSxcXG4gICAgICAgICAgICAgICAgICAgIDgsIDQsIDMsIDEwLCAxMSwgMTQsIDEyLCA1LFxcbiAgICAgICAgICAgICAgICAgICAgMiwgMTEsIDksIDYsIDE1LCAxMiwgMCwgMyxcXG4gICAgICAgICAgICAgICAgICAgIDQsIDEsIDE0LCAxMywgMSwgMiwgNywgOCxcXG4gICAgICAgICAgICAgICAgICAgIDEsIDIsIDEyLCAxNSwgMTAsIDQsIDAsIDMsXFxuICAgICAgICAgICAgICAgICAgICAxMywgMTQsIDYsIDksIDcsIDgsIDksIDYsXFxuICAgICAgICAgICAgICAgICAgICAxNSwgMSwgNSwgMTIsIDMsIDEwLCAxNCwgNSxcXG4gICAgICAgICAgICAgICAgICAgIDgsIDcsIDExLCAwLCA0LCAxMywgMiwgMTFcXG4gICAgICAgICAgICAgICAgXVxcbiAgICAgICAgICAgIF1cXG4gICAgICAgICAgICBiaXRUcmFuc2Zvcm0gPSAodCwgciwgZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgbiA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiByYW5nZShyKS5mb3JFYWNoKHIgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdFtyXS5pc05lZ2F0aXZlKCkgfHwgZS5hbmQoYXJyYXlNYXNrW3Rbcl0ubG93XSkuZXF1YWxzKDApIHx8IChuID0gbi5vcihhcnJheU1hc2tbcl0pKVxcbiAgICAgICAgICAgICAgICB9KSwgblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBERVM2NCA9ICh0LCByKSA9PiB7XFxuICAgICAgICAgICAgICAgIGUgPSBbXSxcXG4gICAgICAgICAgICAgICAgICAgIG4gPSBbXTtcXG4gICAgICAgICAgICAgICAgZiA9IGJpdFRyYW5zZm9ybShhcnJheUlQLCA2NCwgcik7XFxuICAgICAgICAgICAgICAgIHJldHVybiBuWzBdID0gZi5hbmQoNDI5NDk2NzI5NSksXFxuICAgICAgICAgICAgICAgICAgICBuWzFdID0gZi5hbmQoLTQyOTQ5NjcyOTYpLnNoaWZ0UmlnaHQoMzIpLFxcbiAgICAgICAgICAgICAgICAgICAgcmFuZ2UoMTYpLmZvckVhY2gociA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGYgPSBMb25nKDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBMb25nKG5bMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpID0gYml0VHJhbnNmb3JtKGFycmF5RSwgNjQsIGkpLnhvcih0W3JdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmFuZ2UoOCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVbdF0gPSBpLnNoaWZ0UmlnaHQoOCAqIHQpLmFuZCgyNTUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5nZSg4KS5yZXZlcnNlKCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBmLnNoaWZ0TGVmdCg0KS5vcihtYXRyaXhOU0JveFt0XVtlW3RdXSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSBiaXRUcmFuc2Zvcm0oYXJyYXlQLCAzMiwgZiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG8gPSBMb25nKG5bMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuWzBdID0gTG9uZyhuWzFdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgblsxXSA9IG8ueG9yKGkpXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIG4ucmV2ZXJzZSgpLFxcbiAgICAgICAgICAgICAgICAgICAgZiA9IG5bMV0uc2hpZnRMZWZ0KDMyKS5hbmQoLTQyOTQ5NjcyOTYpLm9yKG5bMF0uYW5kKDQyOTQ5NjcyOTUpKSxcXG4gICAgICAgICAgICAgICAgICAgIGYgPSBiaXRUcmFuc2Zvcm0oYXJyYXlJUF8xLCA2NCwgZilcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3ViS2V5cyA9ICh0LCByKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBuID0gYml0VHJhbnNmb3JtKGFycmF5UENfMSwgNTYsIHQpO1xcbiAgICAgICAgICAgICAgICByYW5nZSgxNikuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIG4gPSBuLmFuZChhcnJheUxzTWFza1thcnJheUxzW3RdXSkuc2hpZnRMZWZ0KDI4IC0gYXJyYXlMc1t0XSkub3Iobi5hbmQoYXJyYXlMc01hc2tbYXJyYXlMc1t0XV0ubm90KCkpLnNoaWZ0UmlnaHQoYXJyYXlMc1t0XSkpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJbdF0gPSBiaXRUcmFuc2Zvcm0oYXJyYXlQQ18yLCA2NCwgbilcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYiA9IGZ1bmN0aW9uKHQpIHtcXG4gICAgICAgICAgICAgICAgY29uc3QgciA9IEJ1ZmZlci5mcm9tKFxcXCJ5bHpzeGt3bVxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgbiA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKDgpLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBuID0gTG9uZyhyW3RdKS5zaGlmdExlZnQoOCAqIHQpLm9yKG4pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjb25zdCBvID0gTWF0aC5mbG9vcih0Lmxlbmd0aCAvIDgpLFxcbiAgICAgICAgICAgICAgICAgICAgaSA9IHJhbmdlKDE2KS5tYXAoKCkgPT4gTG9uZygwKSk7XFxuICAgICAgICAgICAgICAgIHN1YktleXMobiwgaSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IGYgPSByYW5nZShvKS5tYXAoKCkgPT4gTG9uZygwKSk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKG8pLmZvckVhY2gociA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByYW5nZSg4KS5mb3JFYWNoKGUgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZbcl0gPSBMb25nKHRbZSArIDggKiByXSkuc2hpZnRMZWZ0KDggKiBlKS5vcihmW3JdKVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHMgPSBbXTtcXG4gICAgICAgICAgICAgICAgcmFuZ2UobykuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNbdF0gPSBERVM2NChpLCBmW3RdKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgY29uc3QgdSA9IHQuc2xpY2UoOCAqIG8pO1xcbiAgICAgICAgICAgICAgICBsZXQgaCA9IExvbmcoMCk7XFxuICAgICAgICAgICAgICAgIHJhbmdlKHQubGVuZ3RoICUgOCkuZm9yRWFjaCh0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGggPSBMb25nKHVbdF0pLnNoaWZ0TGVmdCg4ICogdCkub3IoaClcXG4gICAgICAgICAgICAgICAgfSksIHNbb10gPSBERVM2NChpLCBoKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgYSA9IFtdO1xcbiAgICAgICAgICAgICAgICBsZXQgYyA9IDA7XFxuICAgICAgICAgICAgICAgIHJldHVybiBzLmZvckVhY2godCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByYW5nZSg4KS5mb3JFYWNoKHIgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFbY10gPSB0LnNoaWZ0UmlnaHQoOCAqIHIpLmFuZCgyNTUpLmxvdztcXG4gICAgICAgICAgICAgICAgICAgICAgICBjKytcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pLCBhO1xcbiAgICAgICAgICAgIH0oQnVmZmVyLmZyb20odCkpO1xcbiAgICAgICAgICAgIHJldHVybiB3aW5kb3cuYnRvYShTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIGIpKTtcXG4gICAgICAgIH0sIHQpKTtcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKdum1nXCIsXCJwYXRoXCI6XCJtZ1wiLFwicnVsZVwiOlwiZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvbGliP3J1bGU95q2M6K+N6YCC6YWNJykpLnJ1bGUpO1xcbmNvbnN0IHRoaXNfcGxhdGZvcm0gPSBcXFwibWdcXFwiO1xcbiQuZXhwb3J0cyA9IHtcXG4gICAgaVRhZzogZnVuY3Rpb24oKSB7XFxuICAgICAgICBpVGFnW1xcXCLmjqjojZBcXFwiXSA9IHt9O1xcbiAgICAgICAgaVRhZ1tcXFwi5o6o6I2QXFxcIl1bXFxcIuacgOaWsOatjOWNlVxcXCJdID0gXFxcInBsYXls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HR0cHM6JyArIF8uY29sdW1uU21hbGxQaWMsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAzLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wYXRoTmFtZVxcbiAgICAgICAgICAgICAgICB9LCAxLCAxKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwibWdfaVRhZ1xcXCIsIGlUYWcpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBsYXp5OiBmdW5jdGlvbihwbGF0Zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g5q2M5puy6K+m5oOFXFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL20ubXVzaWMubWlndS5jbi9taWd1L3JlbW90aW5nL2Ntc19kZXRhaWxfdGFnP2NwaWQ9XFxcIiArIHQxLCB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiaGVhZGVyc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL20ubXVzaWMubWlndS5jbi92My9cXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgICAgICAgICBuYW1lID0gXy5zb25nTmFtZTtcXG4gICAgICAgICAgICAgICAgYXJ0aXN0ID0gXy5zaW5nZXJOYW1lLmpvaW4oXFxcIiZcXFwiKTtcXG4gICAgICAgICAgICAgICAgdXJsID0gXy5saXNRcSB8fCBfLmxpc3RlblVybDtcXG4gICAgICAgICAgICAgICAgdDMgPSBfLnFxLnByb2R1Y3RJZDtcXG4gICAgICAgICAgICAgICAgdDQgPSBfLnNvbmdJZDtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmID0gXy5hdWRpdGlvbnMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5saXNCcVNpemUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzFdICsgU2l6ZShmLmxpc0JxU2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLmxpc0hRU2l6ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKGYubGlzSFFTaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYubGlzU1FTaXplKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoZi5saXNTUVNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5saXMyNEJpdFNpemUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzRdICsgU2l6ZShmLmxpczI0Qml0U2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJtZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgyKFxcXCIyXFxcIiwgdDQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSBfLmNvZGVSYXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHQgPSBfLm5ld1JhdGVGb3JtYXRzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLlBRKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1sxXSArIFNpemUodFswXS5hbmRyb2lkU2l6ZSB8fCB0WzBdLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZi5IUSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMl0gKyBTaXplKHRbMV0uYW5kcm9pZFNpemUgfHwgdFsxXS5zaXplKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGYuU1EpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzNdICsgU2l6ZSh0WzJdLmFuZHJvaWRTaXplIHx8IHRbMl0uc2l6ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmLlpRKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1s0XSArIFNpemUodFszXS5hbmRyb2lkU2l6ZSB8fCB0WzJdLnNpemUpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgoYXJyLCB0MSwgbmFtZSwgYXJ0aXN0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaSA9IGFyci5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXFxcImRvd25cXFwiLCBcXFwibWdcXFwiLCB0MSwgaSwgbmFtZSwgYXJ0aXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXJsLm1hdGNoKFxcXCJ0b2FzdDovL1xcXCIpKSByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgYXJyLCB0MSwgbmFtZSwgYXJ0aXN0KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBscmMgPSBfLmx5cmljTHJjO1xcbiAgICAgICAgICAgICAgICBpZiAoIXVybCkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gJC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLkdldE11c2ljVXJsKFxcXCJvcGVuXFxcIiwgXFxcIm1nXFxcIiwgdDEsIDAsIG5hbWUsIGFydGlzdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHVybC5tYXRjaChcXFwidG9hc3Q6Ly9cXFwiKSkgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgaWYgKCFscmMpXFxuICAgICAgICAgICAgICAgICAgICBscmMgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJodHRwczovL211c2ljLm1pZ3UuY24vdjMvYXBpL211c2ljL2F1ZGlvUGxheWVyL2dldEx5cmljP2NvcHlyaWdodElkPVxcXCIgKyB0MSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoZWFkZXJzXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL2FwcC5jLm5mLm1pZ3UuY24vXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pKS5seXJpYztcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDpppbpobVcXG4gICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZSgnbWc/cnVsZT3mrYzor43pgILphY0nKS5hamF4KHVyaSk7XFxuICAgICAgICAgICAgICAgIGlmICghXykgXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGl0ZW1zOiBbXVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAoXy5pdGVtcyB8fCBfWzBdLml0ZW1zKS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lIHx8IF8udGl0bGUgfHwgXy5wbGF5TGlzdE5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1nIHx8IF8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZCB8fCBfLnBsYXlMaXN0SWRcXG4gICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB0MiA9ICQucmVxdWlyZShcXFwibWc/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KGBwbGF5bGlzdC9pbmZvP3NvbmdMaXN0SWQ9JHt0MX1gKS5jb250ZW50Q291bnQ7XFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJtZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoYHBsYXlsaXN0L3NvbmdzSW5mbz9wYWx5bGlzdElkPSR7dDF9YCwgdDIpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgXyA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGl0ZW1zOiBbXVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICczJzogLy8g5o6S6KGMXFxuICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChgYmlsbGJvYXJkL2hvbWU/cGF0aE5hbWU9JHt0MX1gKS5zb25ncztcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLml0ZW1zLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5mdWxsU29uZykgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lICsgKF8uc2luZ2VycyA/ICcgLSAnICsgXy5zaW5nZXJzLm1hcChfID0+IF8ubmFtZSkuam9pbignJicpIDogJycpLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczonICsgXy5tZWRpdW1QaWMsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IF8uZnVsbFNvbmcudmlwRmxhZyxcXG4gICAgICAgICAgICAgICAgenlpZDogXy5jb3B5cmlnaHRJZFxcbiAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIGlzVSkge1xcbiAgICAgICAgaWYgKGlzVSAhPSBcXFwidXJsXFxcIikge1xcbiAgICAgICAgICAgIF9fID0ge1xcbiAgICAgICAgICAgICAgICBsaWI6IChfKSA9PiB0cnVlLFxcbiAgICAgICAgICAgICAgICBwYWlkOiAoXykgPT4gXy5mdWxsU29uZy52aXBGbGFnID09ICcxJyxcXG4gICAgICAgICAgICAgICAgZnJlZTogKF8pID0+IF8uZnVsbFNvbmcudmlwRmxhZyA9PSAnMCdcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIHN1cmwgPSAoc3R5cGUsIGVycmkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcIm1nP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwic2VhcmNoL1xcXCIgKyBzdHlwZSArIFxcXCI/dGV4dD1cXFwiICsga2V5d29yZCkuaXRlbXM7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVycmkgPCAzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN1cmwoc3R5cGUsIGVycmkgKyAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBzdXJsKCdzb25nJywgMCkubWFwKF8gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLmZ1bGxTb25nICYmIF9fW2lzVV0oXykpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLnNpbmdlcnMgPyAnIC0gJyArIF8uc2luZ2Vycy5tYXAoXyA9PiBfLm5hbWUpLmpvaW4oJyYnKSA6ICcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8ubWVkaXVtUGljLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLmZ1bGxTb25nLnZpcEZsYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uY29weXJpZ2h0SWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOiAvLyDmkJzntKLmrYzljZVcXG4gICAgICAgICAgICAgICAgICAgIHN1cmwoJ3NvbmdMaXN0JywgMCkubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7IC8vIOaQnOe0oiDliIbkuqvpk77mjqVcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vYy5tdXNpY2FwcC5taWd1LmNuL01JR1VNMi4wL3YxLjAvY29udGVudC9yZXNvdXJjZWluZm8uZG8/cmVzb3VyY2VUeXBlPTImcmVzb3VyY2VJZD1cXFwiICsga2V5d29yZCkpLnJlc291cmNlWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdOYW1lICsgJyAtICcgKyBfLnNpbmdlcixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uYWxidW1JbWdzWzBdLmltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnZpcFR5cGUgPyAxIDogMCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmNvcHlyaWdodElkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCJtZz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgoYHBsYXlsaXN0L2luZm8/c29uZ0xpc3RJZD0ke2tleXdvcmR9YCk7XFxuICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ucGxheUxpc3ROYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5pbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8ucGxheUxpc3RJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIGFqYXg6IGZ1bmN0aW9uKHVyaSwgc2l6ZSwgaGVhZCkge1xcbiAgICAgICAgdXJpID0gU3RyaW5nKHVyaSk7XFxuICAgICAgICBpZiAodXJpLm1hdGNoKC9wbGF5bGlzdFxcXFwvKGxpc3R8c29uZ3NJbmZvKXxiaWxsYm9hcmRcXFxcL2hvbWV8c2VhcmNoXFxcXC9zb25nLykgJiYgIXVyaS5tYXRjaCgnY29sdW1uSWQ9MzgxOTk1ODgnKSlcXG4gICAgICAgICAgICB1cmkgKz0gXFxcIiZwYWdlTnVtPVxcXCIgKyBNWV9QQUdFICsgXFxcIiZwYWdlU2l6ZT1cXFwiICs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YXAoXyA9PiB7XFxuICAgICAgICAgICAgaWYgKF8ubmFtZSAhPSAn5pSv5oyB5qacJykgaVRhZ1tcXFwi5o6S6KGMXFxcIl1bXFxcIuWFqOmDqFxcXCJdLnB1c2goRXh0cmEoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IF8ucGhvdG9CaWcgfHwgXy5waG90byxcXG4gICAgICAgICAgICAgICAgY29udGVudDogMyxcXG4gICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgIH0sIDEsIDEpKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcIjVzX2lUYWdcXFwiLCBpVGFnKTtcXG4gICAgfSxcXG5cXG5cXG4gICAgbGF6eTogZnVuY3Rpb24ocGxhdGZvcm0sIHQxLCB0Mikge1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOatjOabsuivpuaDhVxcbiAgICAgICAgICAgICAgICBbdDEsIHR5cGVdID0gdDEuc3BsaXQoJyMnKTtcXG4gICAgICAgICAgICAgICAgdXJpID0gYHNvbmcvZ2V0U29uZ1VybD9zb25naWQ9JHt0MX0mc29uZ3R5cGU9JHt0eXBlfWA7XFxuICAgICAgICAgICAgICAgIF8gPSAkLnJlcXVpcmUoXFxcIjVzP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheCh1cmkpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgYXJyMiA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8ubHF1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyLnB1c2godHNbMV0gKyBTaXplKF8ubHFzaXplKSksIGFycjIucHVzaChfLmxxdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfLmhxdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFyci5wdXNoKHRzWzJdICsgU2l6ZShfLmhxc2l6ZSkpLCBhcnIyLnB1c2goXy5ocXVybCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXy5zcXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIucHVzaCh0c1szXSArIFNpemUoXy5zcXNpemUpKSwgYXJyMi5wdXNoKF8uc3F1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoYXJyLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KChhcnIsIGFycjIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpID0gYXJyLmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgYXJyMltpXTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGFyciwgYXJyMik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8g5q2M6K+NXFxuICAgICAgICAgICAgICAgIHR5cGUgPSB7XFxuICAgICAgICAgICAgICAgICAgICB5YzogMSxcXG4gICAgICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICAgICAgYno6IDNcXG4gICAgICAgICAgICAgICAgfVt0eXBlXTtcXG4gICAgICAgICAgICAgICAgdXJsID0gYGh0dHA6Ly9zZXJ2aWNlLjVzaW5nLmt1Z291LmNvbS9zb25nL2RldGFpbD9zb25nSWQ9JHt0MX0mc29uZ1R5cGU9JHt0eXBlfWA7XFxuICAgICAgICAgICAgICAgIGxyYyA9IEpTT04ucGFyc2UoZmV0Y2hQQyh1cmwpKS5kYXRhLmx5cmljcy5yZXBsYWNlKC88YnJcXFxcLz8+L2dpLCBcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICAgICAgLy8g6ZO+5o6lXFxuICAgICAgICAgICAgICAgIHVybCA9IF8ubHF1cmwgfHwgXy5ocXVybCB8fCBfLnNxdXJsO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8v6aaW6aG1XFxuICAgICAgICAgICAgICAgIGxldCBodG1sID0gZmV0Y2goXFxcImh0dHA6Ly81c2luZy5rdWdvdS5jb20vZ2QvZ2RMaXN0PyZ0YWdOYW1lPVxcXCIgKyB0MSArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSk7XFxuICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gcGRmYShodG1sLCBcXFwiYm9keSYmLmFsYnVtXFxcIik7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdGVtLCBcXFwiLmp4X25hbWUmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHp5aWQgPSBwZGZoKGl0ZW0sIFxcXCJhLDEmJnNvbmdsaXN0aWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiB6eWlkXFxuICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMic6IC8vIOWPkeeOsFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmkgPSBcXFwic29uZy9nZXRzb25nbGlzdHNvbmc/aWQ9XFxcIiArIHQxO1xcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwiNXM/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KHVyaSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBfID0gW107XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJzMnOiAvLyDmjpLooYxcXG4gICAgICAgICAgICAgICAgdXJpID0gXFxcInJhbmsvZGV0YWlsP3BhZ2VzaXplPTMwJnBhZ2VpbmRleD1cXFwiICsgTVlfUEFHRSArIFxcXCImaWQ9XFxcIiArIHQxO1xcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCI1cz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgodXJpKS5zb25ncztcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBfLm1hcChfID0+IHtcXG4gICAgICAgICAgICBpZiAoXy5TVCA9PSB1bmRlZmluZWQgfHwgXy5TVCA+IDApIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IF8uU04gKyAnIC0gJyArIF8udXNlci5OTixcXG4gICAgICAgICAgICAgICAgaW1nOiBfLnVzZXIuSSxcXG4gICAgICAgICAgICAgICAgY29udGVudDogXy5TSyxcXG4gICAgICAgICAgICAgICAgenlpZDogXy5JRCArICcjJyArIF8uU0tcXG4gICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICB9LFxcblxcblxcblxcbiAgICBzZWFyY2g6IGZ1bmN0aW9uKHBsYXRmb3JtLCBrZXl3b3JkLCBpc1UpIHtcXG4gICAgICAgIGlmIChpc1UgIT0gXFxcInVybFxcXCIpIHtcXG4gICAgICAgICAgICBmaWx0ZXIgPSB7XFxuICAgICAgICAgICAgICAgIGxpYjogMCxcXG4gICAgICAgICAgICAgICAgeWM6IDEsXFxuICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICBiejogM1xcbiAgICAgICAgICAgIH1baXNVXTtcXG4gICAgICAgICAgICBzdXJsID0gKHN0eXBlKSA9PiBKU09OLnBhcnNlKGZldGNoUEMoXFxcImh0dHA6Ly9zZWFyY2guNXNpbmcua3Vnb3UuY29tL2hvbWUvanNvbj9rZXl3b3JkPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZzb3J0PTEmcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCImZmlsdGVyPVxcXCIgKyBmaWx0ZXIgKyBcXFwiJnR5cGU9XFxcIiArIHN0eXBlKSkubGlzdDtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICAgICAgc3VybCgnMCcpLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIEpTT04ucGFyc2UoZmV0Y2hQQyhgaHR0cDovL3NlcnZpY2UuNXNpbmcua3Vnb3UuY29tL3NvbmcvZGV0YWlsP3NvbmdJZD0ke18uc29uZ0lkfSZzb25nVHlwZT0ke18udHlwZX1gKSkuZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5uaWNrTmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmltYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBfLnR5cGVFbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5zb25nSWQgKyAnIycgKyBfLnR5cGVFbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgc3VybCgnMScpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8ucGljdHVyZVVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ0xpc3RJZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHsgLy8g5pCc57SiIOWIhuS6q+mTvuaOpVxcbiAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICcwJzogLy8g5pCc57Si5Y2V5puyXFxuICAgICAgICAgICAgICAgICAgICBbdDEsIHQyXSA9IGtleXdvcmQuc3BsaXQoJyMnKTtcXG4gICAgICAgICAgICAgICAgICAgIHQzID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHljOiAxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZjOiAyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJ6OiAzXFxuICAgICAgICAgICAgICAgICAgICB9W3QyXTtcXG4gICAgICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoUEMoYGh0dHA6Ly9zZXJ2aWNlLjVzaW5nLmt1Z291LmNvbS9zb25nL2RldGFpbD9zb25nSWQ9JHt0MX0mc29uZ1R5cGU9JHt0M31gKSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5zb25nTmFtZSArICcgLSAnICsgXy5uaWNrTmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogdDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDoga2V5d29yZFxcbiAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAnMSc6IC8vIOaQnOe0ouatjOWNlVxcbiAgICAgICAgICAgICAgICAgICAgdXJpID0gXFxcInNvbmcvZ2V0c29uZ2xpc3Q/aWQ9XFxcIiArIGtleXdvcmQ7XFxuICAgICAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKFxcXCI1cz9ydWxlPeatjOivjemAgumFjVxcXCIpLmFqYXgodXJpKTtcXG4gICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5ULFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5QIHx8IF8udXNlci5sLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5JRFxcbiAgICAgICAgICAgIC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zm9ybSwgdDEsIHQyKSB7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyhwbGF0Zm9ybSkpIHtcXG4gICAgICAgICAgICBjYXNlICcwJzogLy8g6K+m5oOFXFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgYXJyID0gW3RzWzBdICsgOTYsIHRzWzFdICsgMTI4LCB0c1syXSArIDMyMCwgdHNbM10gKyAyMDAwXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGFyciwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodDEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0MiA9IGlucHV0LnNwbGl0KCfjgJEnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSAkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwibGlua1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHQxLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdWFsaXR5OiB0MlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHQxKTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBscmMgPSAkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwibHlyaWNcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogdDFcXG4gICAgICAgICAgICAgICAgfSkubHJjO1xcbiAgICAgICAgICAgICAgICB1cmxzID0gW107XFxuICAgICAgICAgICAgICAgIGZvciAocXVhbGl0eSBvZiBbOTYsIDEyOCwgMzIwLCAyMDAwXSlcXG4gICAgICAgICAgICAgICAgICAgIHVybHMucHVzaCgkLnJlcXVpcmUoXFxcIm15P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheChcXFwibGlua1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcXVhbGl0eTogcXVhbGl0eSArICcnXFxuICAgICAgICAgICAgICAgICAgICB9KSArICcjaXNNdXNpYz10cnVlIycpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogdXJscyxcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbJ+a1geeVhScsICfmoIflh4YnLCAn6auY5ZOBJywgJ+aXoOaNnyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnMSc6IC8v6aaW6aG1XFxuICAgICAgICAgICAgICAgIGlmICghdDEubWF0Y2goL1xcXFw/LykpIHQxID0gXFxcInRvcC9wbGF5bGlzdD9jYXQ9XFxcIiArIHQxICsgXFxcIiZcXFwiO1xcbiAgICAgICAgICAgICAgICBfID0gJC5yZXF1aXJlKCd3eT9ydWxlPeatjOivjemAgumFjScpLmFqYXgodDEpO1xcbiAgICAgICAgICAgICAgICAoXy5yZXN1bHQgfHwgXy5wbGF5bGlzdHMpLm1hcChfID0+IEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IF8uY292ZXJJbWdVcmwgfHwgXy5waWNVcmwsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAyLFxcbiAgICAgICAgICAgICAgICAgICAgenlpZDogXy5pZFxcbiAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcyJzogLy8g5Y+R546wXFxuICAgICAgICAgICAgY2FzZSAnMyc6IC8vIOaOkuihjFxcbiAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKVxcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KFxcXCJzZWFyY2gvcGxheWxpc3RcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJkXFxcIiArIHQxXFxuICAgICAgICAgICAgICAgICAgICB9KS5saXN0O1xcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBfID0gW107XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgfVxcbiAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgXy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArIChfLmFydGlzdCA/ICcgLSAnICsgXy5hcnRpc3QubWFwKF8gPT4gXy5uYW1lKS5qb2luKCcmJykgOiBcXFwiXFxcIiksXFxuICAgICAgICAgICAgaW1nOiBfLnBpYyB8fCBfLmFsYnVtLnBpYyxcXG4gICAgICAgICAgICBjb250ZW50OiAnd3knLFxcbiAgICAgICAgICAgIHp5aWQ6IF8uaGFzaCB8fCBfLmlkXFxuICAgICAgICB9LCAxKSk7XFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0sXFxuXFxuXFxuXFxuXFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIHN0eXBlLCBpc05ldykge1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6IC8vIOaQnOe0ouWNleabslxcbiAgICAgICAgICAgICAgICBzdHlwZSA9IHN0eXBlIHx8ICd3eSc7XFxuICAgICAgICAgICAgICAgIHN0eXBlMiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICd3eSc6ICdZUUQnLFxcbiAgICAgICAgICAgICAgICAgICAgJ2t3JzogJ1lRQicsXFxuICAgICAgICAgICAgICAgICAgICAnbWcnOiBpc05ldyA/ICdZUU0nIDogJ21pZ3UnLFxcbiAgICAgICAgICAgICAgICAgICAgJzF0JzogJzF0aW5nJyxcXG4gICAgICAgICAgICAgICAgICAgICdkYic6ICdkb3ViYW4nLFxcbiAgICAgICAgICAgICAgICAgICAgJzV5JzogJ3d1c2luZ3ljJyxcXG4gICAgICAgICAgICAgICAgICAgICc1Zic6ICd3dXNpbmdmYydcXG4gICAgICAgICAgICAgICAgfVtzdHlwZV07XFxuXFxuICAgICAgICAgICAgICAgIGlmIChpc05ldykge1xcbiAgICAgICAgICAgICAgICAgICAgXyA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5hamF4KCdzZWFyY2gnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogc3R5cGUyLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHQ6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogTVlfUEFHRSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2OiAnYmV0YSdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgKF8ubGlzdCB8fCBbXSkubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAoXy5hcnRpc3QgPyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5waWMgfHwgXy5hbGJ1bS5waWMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5oYXNoIHx8IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSBcXFwidGV4dD1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCImdHlwZT1cXFwiICsgc3R5cGUyO1xcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9ICQucmVxdWlyZShcXFwibXk/cnVsZT3mrYzor43pgILphY1cXFwiKS5vbGRfZW5jb2RlKGJvZHkpO1xcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cDovL2FwaTIubGl1bWluZ3llLmNuL20vYXBpL3NlYXJjaFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAnT3JpZ2luJzogJ2h0dHBzOi8vdG9vbC5saXVtaW5neWUuY24nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogXFxcIlBPU1RcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5saXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBMYXp5KCdteScsIF8uaWQpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJscyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsX200YSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKF8udXJsX200YSArICcjaXNNdXNpYz10cnVlIycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lcy5wdXNoKHRzWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXy51cmxfMTI4KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzLnB1c2goXy51cmxfMTI4ICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnVybF8zMjApXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF8zMjAgKyAnI2lzTXVzaWM9dHJ1ZSMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXMucHVzaCh0c1syXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8udXJsX2ZsYWMpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaChfLnVybF9mbGFjICsgJyNpc011c2ljPXRydWUjJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLnB1c2godHNbM10pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSArICcgLSAnICsgXy5hcnRpc3QsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlciB8fCBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogc3R5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IHVybHMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBuYW1lcyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlICcxJzogLy8g5pCc57Si5q2M5Y2VXFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwid3k/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZWFyY2goMSwga2V5d29yZCwgMSkubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlckltZ1VybCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IDIsXFxuICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkXFxuICAgICAgICAgICAgICAgIH0sIDEpKTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0sXFxuXFxuXFxuXFxuXFxuXFxuICAgIGFqYXg6IGZ1bmN0aW9uKHBhdGgsIGJvZHkpIHtcXG4gICAgICAgIHVybCA9IFxcXCJodHRwczovL2FwaS5saXVtaW5neWUuY24vbS9hcGkvXFxcIiArIHBhdGg7XFxuICAgICAgICBib2R5Ll90ID0gRGF0ZS5ub3coKSArICcnXFxuICAgICAgICBib2R5LnRva2VuID0gJC5yZXF1aXJlKFxcXCJteT9ydWxlPeatjOivjemAgumFjVxcXCIpLm5ld190b2tlbihib2R5KTtcXG4gICAgICAgIGlmIChib2R5LnF1YWxpdHkgIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgdXJpID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgZm9yIChrZXkgaW4gYm9keSlcXG4gICAgICAgICAgICAgICAgdXJpICs9ICcmJyArIGtleSArICc9JyArIGJvZHlba2V5XTtcXG4gICAgICAgICAgICB1cmkgPSBTdHJpbmcodXJpKS5yZXBsYWNlKC9eJi8sICc/Jyk7XFxuICAgICAgICAgICAgcmV0dXJuIHVybCArIHVyaTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBLFxcbiAgICAgICAgICAgICAgICAgICAgJ09yaWdpbic6ICdodHRwczovL3Rvb2wubGl1bWluZ3llLmNuJyxcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbicsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KGJvZHkpLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXCJQT1NUXFxcIlxcbiAgICAgICAgICAgIH0pKS5kYXRhO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcblxcblxcbiAgICBuZXdfdG9rZW46IGZ1bmN0aW9uKGJvZHkpIHtcXG4gICAgICAgIFt0LCBlLCBBc10gPSBbXFxuICAgICAgICAgICAgW1xcbiAgICAgICAgICAgICAgICBcXFwiMjAyMzAzMjcuXFx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uICAgICAgICAgICAgICAgIGUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShpID4+IDEyIHwgMjI0KVxcbiAgICAgICAgICAgICAgICBlICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoaSA+PiA2ICYgNjMgfCAxMjgpXFxuICAgICAgICAgICAgICAgIGUgKz0gU3RyaW5nLmZyb21DaGFyQ29kZShpICYgNjMgfCAxMjgpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIGEgPSBtZDUocC5zdWJzdHIoMCwgMTYpKTtcXG4gICAgICAgIHZhciBhID0gYSArIG1kNShhICsgUjQpO1xcbiAgICAgICAgcCA9IFtdO1xcbiAgICAgICAgZm9yIChpID0gMDsgaSA8IDI1NjsgaSsrKSBwW2ldID0gaTtcXG4gICAgICAgIEkgPSBiID0gYyA9IHQgPSAwO1xcbiAgICAgICAgZm9yIChpIGluIHApIHtcXG4gICAgICAgICAgICBJID0gKEkgKyBwW2ldICsgYVtpICUgNjRdLmNoYXJDb2RlQXQoKSkgJSAyNTZcXG4gICAgICAgICAgICBYID0gcFtpXVxcbiAgICAgICAgICAgIHBbaV0gPSBwW0ldXFxuICAgICAgICAgICAgcFtJXSA9IFhcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAoaSBpbiBlKSB7XFxuICAgICAgICAgICAgSSA9IE51bWJlcihpKSArIDE7XFxuICAgICAgICAgICAgWCA9IHBbSV07XFxuICAgICAgICAgICAgYiA9IChiICsgWCkgJSAyNTY7XFxuICAgICAgICAgICAgcFtJXSA9IHBbYl07XFxuICAgICAgICAgICAgcFtiXSA9IFg7XFxuICAgICAgICAgICAgRSArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKFxcbiAgICAgICAgICAgICAgICBlW2ldLmNoYXJDb2RlQXQoKSBeXFxuICAgICAgICAgICAgICAgIHBbKHBbSV0gKyBwW2JdKSAlIDI1Nl1cXG4gICAgICAgICAgICApO1xcbiAgICAgICAgfVxcbiAgICAgICA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biAgICB1ID0gYGh0dHBzOi8vbXVzaWMuOTFxLmNvbS92MS8ke3VyaX0/YCArIGJvZHk7XFxuICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHUpKS5kYXRhO1xcbn1cXG4kLmV4cG9ydHMgPSB7XFxuICAgIHNlYXJjaDogZnVuY3Rpb24ocGxhdGZvcm0sIGtleXdvcmQsIHBsYXRmb3JtMikge1xcbiAgICAgICAgc3dpdGNoIChTdHJpbmcocGxhdGZvcm0pKSB7XFxuICAgICAgICAgICAgY2FzZSAnMCc6XFxuICAgICAgICAgICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtMikpIHtcXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2czJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly93d3cuZ2dnbXVzaWMuY29tL1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5d29yZCA9IGVuY29kZVVSSUNvbXBvbmVudChrZXl3b3JkKS5yZXBsYWNlKC8tL2csICdfMmQnKS5yZXBsYWNlKC8lL2csICdfJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaHRtbCA9IGZldGNoQ29kZUJ5V2ViVmlldyh1ICsgXFxcInNlYXJjaC1cXFwiICsga2V5d29yZCArIFxcXCItMS5odG1cXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICdibG9ja1J1bGVzJzogWycuanMnLCAnLmNzcycsICcucG5nJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDUwMDBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShodG1sLCBcXFwiYm9keSYmbGkubWVkaWFbZGF0YS10aWRdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhLDEmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLnNwbGl0KFxcXCIgLSBcXFwiKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2czJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcImEsMSYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEL2csICcnKSArICcjZzMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2J6JzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKFxcXCJodHRwczovL2RlYmVuemkuY29tLz9zPVxcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJmgyLmVudHJ5LXRpdGxlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vcGljLnJtYi5iZHN0YXRpYy5jb20vYmpoLzM5Yjk2NGIyYjA4N2EwNWMzOWE1NmEyZTM4YzA0MDE5MzM4LmpwZWcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdieicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNieidcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnYmQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHFpYW5xaWFuKFxcXCJzZWFyY2hcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdvcmQ6IGtleXdvcmQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VObzogTVlfUEFHRVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLnR5cGVUcmFjay5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghXy5pc1ZpcCkgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0Lm1hcChfID0+IF8ubmFtZSkuam9pbignJicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLnBpYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdiZCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkICsgJyNiZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICd6eic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3p6MTIzLmNvbSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShwb3N0KHUgKyAnL2FqYXgvJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwiYWN0PXNlYXJjaCZrZXk9XFxcIiArIGtleXdvcmQgKyBcXFwiJmxhbmc9JnBhZ2U9XFxcIiArIE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm1uYW1lICsgJyAtICcgKyBfLnNuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBfLnBpYy5yZXBsYWNlKC9cXFxcPy4qLywgJycpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnenonLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLmlkICsgJyN6eidcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCAxKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICduaSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkgaHRtID0gXFxcIi0xLmh0bVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBodG0gPSBcXFwiLTEtXFxcIiArIE1ZX1BBR0UgKyBcXFwiLmh0bVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5d29yZCA9IGVuY29kZVVSSUNvbXBvbmVudChrZXl3b3JkKS5yZXBsYWNlKC8tL2csICdfMmQnKS5yZXBsYWNlKC8lL2csICdfJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaHRtbCA9IGZldGNoQ29kZUJ5V2ViVmlldyhcXFwiaHR0cHM6Ly93d3cuaGlmaW5pLmNvbS9zZWFyY2gtXFxcIiArIGtleXdvcmQgKyBodG0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJ2Jsb2NrUnVsZXMnOiBbJy5qcycsICcuY3NzJywgJy5wbmcnXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dDogNTAwMFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIFxcXCJib2R5JiZsaS5tZWRpYVtkYXRhLXRpZF1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGRmaChpdGVtLCBcXFwiYSwyJiZUZXh0XFxcIikgIT0gXFxcIueJueS+m1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZGZoKGl0ZW0sIFxcXCJhLDEmJlRleHRcXFwiKS5zcGxpdChcXFwi44CLXFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnNwbGl0KFxcXCLjgIpcXFwiKS5yZXZlcnNlKCkuam9pbignIC0gJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOi8vd3d3LmhpZmluaS5jb20vXFxcIiArIHBkZmgoaXRlbSwgXFxcImltZyYmc3JjXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ25pJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhLDEmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI25pJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdmcCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaChcXFwiaHR0cHM6Ly93d3cuZmFuZ3BpLm5ldC9zL1xcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJltjbGFzcz1yb3ddXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImRpdiwxJiZUZXh0XFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcImRpdiwyJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2ZwJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2ZwJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJmhyZWZcXFwiKS5yZXBsYWNlKC9cXFxcRC9nLCAnJykgKyAnI2ZwJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdzdCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goYGh0dHA6Ly93d3cuc29uZ3Rhc3RlLmNvL2RhbmNlL3NlYXJjaD9rZXk9JHtrZXl3b3JkfSZwYWdlPSR7TVlfUEFHRX1gKSwgXFxcImJvZHkmJi5tbGlzdCYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLnRkMyYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLnJlcGxhY2UoJ3BpY2RhdGEnLCAnYXR0YWNobWVudCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ3N0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcIi50ZDMmJmEmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvLywgJycpICsgJyNzdCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnaHQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHA6Ly9tLmh0cXl5LmNvbS9zZWFyY2gvcmVzdWx0P2lkPVxcXCIgKyBrZXl3b3JkKSwgXFxcImJvZHkmJmxpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCJlbSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpICsgJzBAaGVhZGVycz17XFxcInJlZmVyZXJcXFwiOlxcXCJodHRwOi8vbS5odHF5eS5jb21cXFwifScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2h0JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCIucGxheSYmZGF0YS1pZFxcXCIpICsgJyNodCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnMXQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goYGh0dHBzOi8vc28uMXRpbmcuY29tL3NvbmcvanNvbj9xPSR7a2V5d29yZH0mcGFnZT0ke01ZX1BBR0V9JnNpemU9MzBgKSkucmVzdWx0cy5tYXAoXyA9PiBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdfbmFtZSArICcgLSAnICsgXy5zaW5nZXJfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6JyArIF8uYWxidW1fY292ZXIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICcxdCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IF8uc29uZ19pZCArICcjMXQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnOXQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaChgaHR0cDovL25ldy45c2t5LmNvbS9hcGkvd2VpYm8vY29udGVudC9zZWFyY2g/Y29udGVudD0ke2tleXdvcmR9YCkpLmRhdGEuc29uZ19saXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXk4kL2kudGVzdChfLmlzX3N0YXRpb24pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbmV3Ljlza3kuY29tL2FwaS9zb25nL2RldGFpbD9pZD1cXFwiICsgXy5zb25nX2lkICsgXFxcIiZpc19sb2dpbj1OXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLnNvbmdfbmFtZSArICcgLSAnICsgXy5tdXNpY2lhbl9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IF8uZGlzY19pbWdfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnOXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdfaWQgKyAnIzl0J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtfLnNvbmdfdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY191cmwgfHwgTHJjKF8uZGVzaWduX25vdGVzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICc1bmQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHA6Ly9tLjVuZC5jb20vc28vc19cXFwiICsga2V5d29yZCksIFxcXCJib2R5JiYubGlzdC1zb25nJiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIuc29uZyYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIuYXJ0aXN0JiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICc1bmQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IHBkZmgoaXRlbSwgXFxcImEmJmhyZWZcXFwiKS5yZXBsYWNlKC8uKlxcXFwvfFxcXFwuLiovZywgJycpICsgJyM1bmQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2JpdSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vYml1Lm1vZS9pbmRleC5waHA/bT0mYz1Tb25nJmE9c2VhcmNoJmRhdGE9XFxcIiArIGtleXdvcmQgKyBcXFwiJnA9XFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmdGJvZHkmJnRyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYml1X3NpZCA9IHBkZmgoaXRlbSwgXFxcImEsMCYmaHJlZlxcXCIpLnJlcGxhY2UoL1xcXFxEKy8sIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmSHRtbFxcXCIpLnJlcGxhY2UoL1xcXFxzKjxzcGFuW1xcXFxzXFxcXFNdKy9pLCBcXFwiXFxcIikgKyAnIC0gJyArIHBkZmgoaXRlbSwgXFxcImEsMSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9iaXUubW9lL1Nvbmcvc2hvd0NvdmVyL3NpZC9cXFwiICsgYml1X3NpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdiaXUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogYml1X3NpZCArICcjYml1J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdibG0nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goYGh0dHBzOi8vYmxhY2tibG0uYmFpbGVtaS5jb20vaW5kZXgucGhwL2RhbmNlL3NlYXJjaD9rZXk9JHtrZXl3b3JkfSZwYWdlPSR7TVlfUEFHRX1gKSkuZGFuY2VsaXN0Lm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXy5kb3dudXJsIHx8IF8ucGxheXVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybCAmJiBfLm5hbWUpIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfLm5hbWUgKyAnIC0gJyArIChfLnNpbmdlciB8fCBfLnVwX3VzZXIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBfLmNvdmVyIHx8IF8udXBfdXNlcl9sb2dvLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2JsbScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnNvbmdpZCArICcjYmxtJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ211cyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2goXFxcImh0dHBzOi8vc2t5bXVzLm9yZy90cmFja3MvXFxcIiArIGtleXdvcmQgKyBcXFwiL1xcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJi5mLXRhYmxlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi5hcnRpc3QtbmFtZSYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIudHJhY2stbmFtZSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLnJlcGxhY2UoL14oLispLywgJ2h0dHBzOiQxJykgfHwgJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdtdXMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdtdXMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogJ3VuZGVmaW5lZCdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXFxcImh0dHBzOlxcXCIgKyBwZGZoKGl0ZW0sIFxcXCIubXAzJiZocmVmXFxcIikgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdqYW0nOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vc29scmNsb3VkLmphbWVuZG8uY29tL3NvbHIvamFtY29tP3d0PWpzb24mcm93cz0zMCZxPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZzdGFydD1cXFwiICsgKChNWV9QQUdFIC0gMSkgKiAzMCkpKS5yZXNwb25zZS5kb2NzLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOi8vcHJvZC0xLnN0b3JhZ2UuamFtZW5kby5jb20vZG93bmxvYWQvdHJhY2svXFxcIiArIF8uaWQgKyBcXFwiL21wMzVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy5uYW1lLnJlcGxhY2UoXy5hcnRpc3RfbmFtZSArICcgLSAnLCAnJykgKyAnIC0gJyArIF8uYXJ0aXN0X25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJodHRwczovL3VzZXJjb250ZW50LmphbWVuZG8uY29tLz90eXBlPWFsYnVtJmlkPVxcXCIgKyBfLmFsYnVtX2lkLnJlcGxhY2UoL1xcXFxEL2csICcnKSArIFxcXCImd2lkdGg9NTAwJnRyYWNraWQ9XFxcIiArIF8uaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnamFtJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6ICd1bmRlZmluZWQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnanVpJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gZXZhbChwb3N0KCdodHRwczovL25ldy5teWZyZWVtcDNqdWljZXMuY2MvYXBpL2FwaV9zZWFyY2gucGhwP2NhbGxiYWNrPWp1aWNlcycsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogXFxcInE9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0VcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHUgPSBcXFwiaHR0cHM6Ly9ucGxheS5pZG1wM3MuY29tL3N0cmVhbS9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBvID0gXFxcIkFCQ0RFRkdISktNTlBRUlNUVVZXWFlaYWJjZGVmZ2hqa21ucHFyc3R1dnh5ejEyM1xcXCI7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24ganVpX2QodCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoMCA9PSB0KSByZXR1cm4gb1swXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh0IDwgMCAmJiAodCAqPSAtMSwgZSArPSBcXFwiLVxcXCIpOyAwIDwgdDspIHZhbCA9IHBhcnNlSW50KHQgJSA0OCksIHQgPSBwYXJzZUludCh0IC8gNDgpLCBlICs9IG9bdmFsXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGxpc3RbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXR0eUlkID0ganVpX2QoXy5vd25lcl9pZCkgKyBcXFwiOlxcXCIgKyBqdWlfZChfLmlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IF8udGl0bGUgKyAnIC0gJyArIF8uYXJ0aXN0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2p1aScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2p1aScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnByZXR0eUlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMV1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3UgKyBwcmV0dHlJZCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ3kzJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAkc29uZ19kYXRhID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgc29uZ19saXN0ID0gKGksIGlpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSAkc29uZ19kYXRhW2ldLnNwbGl0KFxcXCJ8fFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXyA9IGl0ZW0uc3BsaXQoXFxcInxcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfWzRdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHA6Ly90aW5nNi55eW1wMy5uZXQ6ODIvXFxcIiArIFN0cmluZyhfWzRdKS5yZXBsYWNlKCcud21hJywgJy5tcDMnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBfWzFdICsgJyAtICcgKyBfWzNdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgneTMnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ3kzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy5wcmV0dHlJZFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2hQQyhcXFwiaHR0cDovL3d3dy55eW1wMy5jb20vcC9nZXRzZXIuYXNweD9rZXk9XFxcIiArIGtleXdvcmQgKyBcXFwiJnBhZ2U9XFxcIiArIE1ZX1BBR0UpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJzM2NSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiAkMzY1X1NlYXJjaFJlc3VsdCh0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGRmYShcXFwiPGJvZHk+XFxcIiArIHQgKyBcXFwiPC9ib2R5PlxcXCIsIFxcXCJib2R5JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBldmFsKFxcXCIkMzY1X1xcXCIgKyBmZXRjaChcXFwiaHR0cDovL2hpdC55dWUzNjUuY29tL3NlYXJjaC5hc3A/cm5kPVxcXCIgKyBNYXRoLnJhbmRvbSgpICsgXFxcIiZrZXl3b3Jkcz1cXFwiICsgZXNjYXBlKGtleXdvcmQpICsgXFxcIiZ0PTFcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdXNpY0lkID0gcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvLipcXFxcL3xcXFxcLi4qL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IFxcXCJodHRwOi8vOTYuaWVyZ2UuY24vXFxcIiArIHBhcnNlSW50KE11c2ljSWQgLyAzMDAwMCkgKyBcXFwiL1xcXCIgKyBwYXJzZUludChNdXNpY0lkIC8gMjAwMCkgKyBcXFwiL1xcXCIgKyBNdXNpY0lkICsgXFxcIi5tcDNcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIubmFtZSYmVGV4dFxcXCIpICsgJyAtICcgKyBwZGZoKGl0ZW0sIFxcXCIuc2luZ2VyJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJzM2NScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICczNjUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6ICd1bmRlZmluZWQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxLCAwLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFt0c1sxXV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2t6JzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly9zbGlkZXIua3ovXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShmZXRjaCh1ICsgXFxcInZrX2F1dGgucGhwP3E9XFxcIiArIGtleXdvcmQpKVtcXFwiYXVkaW9zXFxcIl1bXFxcIlxcXCJdLm1hcChfID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRfYXJ0LnNwbGl0KCcgLSAnKS5yZXZlcnNlKCkuam9pbignIC0gJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2t6JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2t6JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBfLnp5aWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBbKF8udXJsLm1hdGNoKC9odHRwcz86Lyk/XFxcIlxcXCI6dSkgK18udXJsICsgJyNpc011c2ljPXRydWUjJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdreSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZShwb3N0KCdodHRwOi8vYXBpLmt1YWl5aW4xMjMubmV0L3Evc2VhcmNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwicT1cXFwiICsga2V5d29yZCArIFxcXCImY2xpZW50X3Y9Mi43LjEmcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCImcGxhdGZvcm09QW5kcm9pZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjbGllbnQtdlxcXCI6IFxcXCIyLjcuMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZGV2aWNlLWlkXFxcIjogUigxNiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGxhdGZvcm1cXFwiOiBcXFwiQW5kcm9pZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJva2h0dHAvMy4xNC40XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb25uZWN0aW9uXFxcIjogXFxcIktlZXAtQWxpdmVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvbnRlbnQtVHlwZVxcXCI6IFxcXCJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSkuZGF0YS5tdXNpY19saXN0LnJvd3MubWFwKF8gPT4gRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXy50aXRsZSArICcgLSAnICsgXy51c2VyX2luZm8ubmlja25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXy5jb3ZlcixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2t5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogXy56eWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSwgMCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lczogW3RzWzFdXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW18ucGxheV91cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjX3VybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2RqMSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vd3d3Lnp6emRqLmNvbVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyh1ICsgXFxcIi9tdXNpYy9zZWFyY2gtXFxcIiArIGtleXdvcmQgKyBcXFwiP2NhdF9pZD0wJnBhZ2U9XFxcIiArIE1ZX1BBR0UpLCBcXFwiYm9keSYmdGJvZHkmJnRyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubWF0Y2goL2FsdD1cXFwiKC4rPylcXFwiLylbMV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBpdGVtLm1hdGNoKC9zcmM9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqMScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC9kYXRhLWlkPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGoxJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdkajInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoUEMoXFxcImh0dHBzOi8vd3d3LmRqdXUuY29tL3NlYXJjaD9tdXNpY25hbWU9XFxcIiArIGtleXdvcmQgKyBcXFwiJmxpc3Q9MiZjaWQ9MCZwYWdlPVxcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJi5saXN0X211c2ljbGlzdCYmdHJbY2xhc3NdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubWF0Y2goL3RpdGxlPVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogXFxcImh0dHBzOlxcXCIgKyBpdGVtLm1hdGNoKC9zcmM9XFxcIiguKz8pXFxcIi8pWzFdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqMicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC92YWx1ZT1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqMidcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnZGozJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHA6Ly93d3cubGFsYWRqLmNvbVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyh1ICsgXFxcIi9zZWFyY2g/c2VhcmNoPVxcXCIgKyBrZXl3b3JkICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFKSwgXFxcImJvZHkmJi5saXN0X211c2ljbGlzdCYmdHJbY2xhc3NdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcIi50MSYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiB1ICsgaXRlbS5tYXRjaCgvc3JjPVxcXCIoLis/KVxcXCIvKVsxXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvdmFsdWU9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2RqNCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2hQQyhcXFwiaHR0cHM6Ly9tLmFoYWRqLmNvbS9zZWFyY2gvP2tleT1cXFwiICsga2V5d29yZCArIFxcXCImcGFnZT1cXFwiICsgTVlfUEFHRSArIFxcXCIuaHRtbFxcXCIpLCBcXFwiYm9keSYmLnlpbnl1ZV9saXN0JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiaDMmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHBzOi8vc3QuOTJrdS5jb20vendjcy9cXFwiICsgdGl0bGUgKyBcXFwiLm1wNFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogcGRmaChpdGVtLCBcXFwiaW1nJiZzcmNcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogcGRmaChpdGVtLCBcXFwiYSwwJiZocmVmXFxcIikucmVwbGFjZSgvXFxcXEQvZywgJycpICsgJyNkajQnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEsIDAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbdHNbMF1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2RqNSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3d3dy5kai5uZXQvJztcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gcG9zdCh1ICsgJ3NlYXJjaC5waHA/bW9kPW11c2ljJmZvcm1oYXNoPThjOTY0ZThhJnNyY2h0eHQ9JyArIGVuY29kZVN0cihrZXl3b3JkLCAnR0JLJykgKyAnJnNlYXJjaHN1Ym1pdD15ZXMnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAndGV4dC9odG1sOyBjaGFyc2V0PWdiaycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1ICsgSlNPTi5wYXJzZShfKS5oZWFkZXJzLmxvY2F0aW9uWzBdICsgXFxcIiZwYWdlPVxcXCIgKyBNWV9QQUdFO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKHVybCksIFxcXCJib2R5JiYubXVzaWMtbGlzdCYmbGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwxJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHUgKyBwZGZoKGl0ZW0sIFxcXCJpbWcmJnNyY1xcXCIpLnJlcGxhY2UoXFxcIiZzaXplPXNtYWxsXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqNScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBwZGZoKGl0ZW0sIFxcXCJhLDEmJmhyZWZcXFwiKS5tYXRjaCgvaWQ9KFxcXFxkKykvKVsxXSArICcjZGo1J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdkajYnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cDovL3d3dy4zNmRqLmNvbS9lL3NlYXJjaC8nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIF8gPSBwb3N0KHUgKyAnaW5kZXgucGhwJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc2lkOiAnMSwyLDMsNCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXlib2FyZDoga2V5d29yZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Ym1pdDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93OiAndGl0bGUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcGlkOiAnMSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHUgKz0gSlNPTi5wYXJzZShfKS5oZWFkZXJzLmxvY2F0aW9uWzBdICsgXFxcIiZwYWdlPVxcXCIgKyAoTVlfUEFHRSAtIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBwZGZhKGZldGNoKHUpLCBcXFwiYm9keSYmI3BsYXlsaXN0JiZsaVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdkajYnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajYnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvdmFsdWU9XFxcIihcXFxcZCspXFxcIi8pWzFdICsgJyNkajYnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ2RqNyc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgdSA9ICdodHRwczovL3d3dy43aWRqLmNvbS9lL3NlYXJjaC8nXFxuICAgICAgICAgICAgICAgICAgICAgICAgXyA9IHBvc3QodSArICdpbmRleC5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleWJvYXJkOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvdzogJ3RpdGxlJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdSArPSBKU09OLnBhcnNlKF8pLmhlYWRlcnMubG9jYXRpb25bMF0gKyBcXFwiJnBhZ2U9XFxcIiArIChNWV9QQUdFIC0gMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHBkZmEoZmV0Y2godSksIFxcXCJib2R5JiZsaVtkYXRhLWlkXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaXRlbSBvZiBsaXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEV4dHJhKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCJhLDAmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCdkajcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6ICdkajcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgenlpZDogaXRlbS5tYXRjaCgvZGF0YS1pZD1cXFwiKFxcXFxkKylcXFwiLylbMV0gKyAnI2RqNydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcblxcblxcblxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAnZGo4JzpcXG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8vd3d3LmRqdTguY29tLyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbSA9IGZldGNoUEModSArICdrZXkvbWxfJyArIGVuY29kZVN0cihrZXl3b3JkLCAnR0JLJykgKyAnXycgKyBNWV9QQUdFICsgJy5odG1sJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ3RleHQvaHRtbDsgY2hhcnNldD1nYjIzMTInLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJ3JlZmVyZXInOiB1XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShpdGVtLCBcXFwiYm9keSYmI2Rqb3VyJiZsaVtvbm1vdXNlb3Zlcl1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGl0ZW0gb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBFeHRyYSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiYSwwJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKSgnZGo4JyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAnZGo4JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp5aWQ6IGl0ZW0ubWF0Y2goL3ZhbHVlPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGo4J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBjYXNlICdkajknOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGp5eXkuY29tL3NlYXJjaC5waHA/YWM9ZGoma2V5PScgKyBrZXl3b3JkICsgJyZwYWdlcz0nICsgTVlfUEFHRTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShmZXRjaFBDKHUpLCBcXFwiYm9keSYmbGlbZGF0YS1pZF0gXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRXh0cmEoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgXFxcImEsMCYmVGV4dFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ2RqOScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ2RqOScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eWlkOiBpdGVtLm1hdGNoKC9kYXRhLWlkPVxcXCIoXFxcXGQrKVxcXCIvKVsxXSArICcjZGo5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5o6l5Y+j6ZSZ6K+vflxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuayoeacieWPr+S7peaQnOe0ouatjOWNleeahOaOpeWPo35cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH0sXFxuICAgIGxhenk6IGZ1bmN0aW9uKHBsYXRmb3JtLCB0MSwgdDIpIHtcXG4gICAgICAgIFt0MSwgcGxhdGZvcm0sIHR5cGVdID0gdDEuc3BsaXQoJyMnKTtcXG4gICAgICAgIHN3aXRjaCAoU3RyaW5nKHBsYXRmb3JtKSkge1xcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2czJzpcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vd3d3LmdnZ211c2ljLmNvbS9cXFwiO1xcbiAgICAgICAgICAgICAgICBpdGVtID0gcGRmaChmZXRjaCh1ICsgXFxcInRocmVhZC1cXFwiICsgdDEgKyBcXFwiLmh0bVxcXCIpLCBcXFwiZGl2Lm1lc3NhZ2UuYnJlYWstYWxsJiZIdG1sXFxcIik7XFxuICAgICAgICAgICAgICAgIFxcbmV2YWwoXFxcInVybD1cXFwiK2l0ZW0ubWF0Y2goL3VybDpcXFxccyooW15cXFxcbixdKykvKVsxXS5yZXBsYWNlKFxcXCJiYXNlNjRfZGVjb2RlXFxcIiwgXFxcImJhc2U2NERlY29kZVxcXCIpKTtcXG5pZighdXJsLm1hdGNoKC9odHRwLykpe1xcbnVybCA9IHUrdXJsXFxufVxcbmVsc2V7XFxudT1cXFwiXFxcIlxcbn1cXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbHJjID0gaXRlbS5zcGxpdChcXFwiPC9oNT5cXFwiKVsxXS5zcGxpdChcXFwiPGg1XFxcIilbMF07XFxuICAgICAgICAgICAgICAgIGlmIChscmMubWF0Y2goL1xcXFxbXFxcXGQrOlxcXFxkKy8pKVxcbiAgICAgICAgICAgICAgICAgICAgbHJjID0gbHJjLnJlcGxhY2UoLyhcXFxccyo8XFxcXC8/cD4pKy9naSwgXFxcIlxcXFxuXFxcIik7XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGxyYyA9IExyYyhscmMpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZlcmVyOiB1XFxuICAgICAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2J6JzpcXG4gICAgICAgICAgICAgICAgaXRlbSA9IGZldGNoKFxcXCJodHRwczovL2RlYmVuemkuY29tL3UvXFxcIiArIHQxICsgXFxcIi9cXFwiKTtcXG4gICAgICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwiYXVkaW8mJnNyY1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBscmMgPSBwZGZoKGl0ZW0sIFxcXCIuZW50cnktY29udGVudCYmSHRtbFxcXCIpLnNwbGl0KFxcXCI8c3Ryb25nPuatjOivje+8mjwvc3Ryb25nPlxcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IExyYyhscmMpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICdiZCc6XFxuICAgICAgICAgICAgICAgIF8gPSBxaWFucWlhbihcXFwic29uZy90cmFja2xpbmtcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBUU0lEOiB0MVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIF8ucGF0aCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFtfLnBhdGggKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGxyYzogXy5seXJpY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgY2FzZSAnenonOlxcbiAgICAgICAgICAgICAgICB1ID0gJ2h0dHBzOi8venoxMjMuY29tJztcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1ICsgJy9hamF4LycsIHtcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IFxcXCJhY3Q9c29uZ2luZm8maWQ9XFxcIiArIHQxICsgXFxcIiZsYW5nPVxcXCJcXG4gICAgICAgICAgICAgICAgfSkpLmRhdGE7XFxuICAgICAgICAgICAgICAgIHVybCA9IHUgKyBfLm1wMztcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1ID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb25seUhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKHUpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IF8ubHJjLnJlcGxhY2UoL1xcXFxyL2csICcnKVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgY2FzZSAnbmknOlxcbiAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBzOi8vd3d3LmhpZmluaS5jb20vXFxcIjtcXG4gICAgICAgICAgICAgICAgaXRlbSA9IHBkZmgoZmV0Y2godSArIGB0aHJlYWQtJHt0MX0uaHRtYCksIFxcXCJkaXYubWVzc2FnZS5icmVhay1hbGwmJkh0bWxcXFwiKTtcXG4gICAgICAgICAgICAgICAgdXJsID0gdSArIGl0ZW0ubWF0Y2goL3VybDpcXFxccypbXFxcIiddKFteXFxcIiddKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbHJjID0gaXRlbS5yZXBsYWNlKC9eW1xcXFxzXFxcXFNdKz88XFxcXC9oNT58PGg1W14+XSo+W1xcXFxzXFxcXFNdKy9naSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IExyYyhscmMpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICdmcCc6XFxuICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImh0dHBzOi8vd3d3LmZhbmdwaS5uZXQvYXBpL3BsYXlfdXJsP2lkPVxcXCIgKyB0MSArIFxcXCImanNvbj0xXFxcIikpLmRhdGEudXJsO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IFxcXCJodHRwczovL3d3dy5mYW5ncGkubmV0L2Rvd25sb2FkL2xyYy9cXFwiICsgdDFcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ3N0JzpcXG4gICAgICAgICAgICAgICAgaXRlbSA9IGZldGNoUEMoXFxcImh0dHA6Ly93d3cuc29uZ3Rhc3RlLmNvL3NvbmcvXFxcIiArIHQxKTtcXG4gICAgICAgICAgICAgICAgdXJsID0gcGRmaChpdGVtLCBcXFwic291cmNlLDAmJnNyY1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhpdGVtLm1hdGNoKC9scmMgPSBgW1xcXFxzXFxcXFNdKj9gOy8pWzBdKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogTHJjKGxyYylcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2h0JzpcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbS5odHF5eS5jb20vcGxheS9cXFwiICsgdDE7XFxuICAgICAgICAgICAgICAgIGNvZGUgPSBleGVjdXRlV2ViUnVsZSh1LCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBjb2RlO1xcbiAgICAgICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgdXJsID0gXFxcImh0dHA6Ly9mNS5odHF5eS5jb20vcGxheTkvXFxcIiArIHQxICsgXFxcIi9tcDMvXFxcIiArIGNvZGU7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbdXJsICsgJyNpc011c2ljPXRydWUjJ10sXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZmVyZXI6IHVcXG4gICAgICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICcxdCc6XFxuICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cHM6Ly93d3cuMXRpbmcuY29tXFxcIjtcXG4gICAgICAgICAgICAgICAgcGF0aCA9IGV4ZWN1dGVXZWJSdWxlKGBodHRwczovL2g1LjF0aW5nLmNvbS9zb25nL2AgKyB0MSwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ19zb25nX21ldGEuc29uZ19wYXRoO1xcbiAgICAgICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgdXJsID0gdSArIFxcXCIvYXBpL2F1ZGlvP1xcXCIgKyBwYXRoO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1sxXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCwgaGVhZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBmZXRjaCh1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmZXJlcjogdVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9ubHlIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZSh1KS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsLCB1KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBscmMgPSB1ICsgXFxcIi90b3VjaC9hcGkvbHlyaWMvXFxcIiArIHQxO1xcbiAgICAgICAgICAgICAgICBscmMgPSBKU09OLnBhcnNlKGZldGNoKGxyYykpLmx5cmljX2NvbnRlbnQ7XFxuICAgICAgICAgICAgICAgIGlmICghbHJjLm1hdGNoKC9cXFxcW1xcXFxkKzpcXFxcZCsvKSlcXG4gICAgICAgICAgICAgICAgICAgIGxyYyA9IExyYyhscmMpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZlcmVyOiB1XFxuICAgICAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJzl0JzpcXG4gICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwOi8vbmV3Ljlza3kuY29tL2FwaS9zb25nL2RldGFpbD9pZD1cXFwiICsgdDEgKyBcXFwiJmlzX2xvZ2luPU5cXFwiO1xcbiAgICAgICAgICAgICAgICBfID0gSlNPTi5wYXJzZShmZXRjaCh1KSkuZGF0YTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIF8uc29uZ191cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbXy5zb25nX3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHJjOiBfLmx5cmljX3VybCB8fCBMcmMoXy5kZXNpZ25fbm90ZXMpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICc1bmQnOlxcbiAgICAgICAgICAgICAgICBpdGVtID0gZmV0Y2goYGh0dHA6Ly9tLjVuZC5jb20vdGluZy8ke3QxfS5odG1sYCk7XFxuICAgICAgICAgICAgICAgIGV2YWwoaXRlbS5tYXRjaCgvbXAzID0gLio/Oy8pWzBdKTtcXG4gICAgICAgICAgICAgICAgdXJsID0gJ2h0dHA6Ly9tcGdlLjVuZC5jb20vJyArIG1wMztcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbHJjID0gcGRmaChpdGVtLCBcXFwiI2xyY2NvbnQmJkh0bWxcXFwiKS5yZXBsYWNlKC88XFxcXCEtLS4qPy0tPnw8YnJcXFxcLz8+L2dpLCAnXFxcXG4nKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW3VybCArICcjaXNNdXNpYz10cnVlIyddLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IGxyY1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgY2FzZSAnYml1JzpcXG4gICAgICAgICAgICAgICAgdXJsID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9iaXUubW9lL1NvbmcvcGxheVNJRC9zaWQvXFxcIiArIHQxKSkudXJsaW5mby51cmw7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzFdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxyYyA9IHBkZmgoZmV0Y2goXFxcImh0dHBzOi8vYml1Lm1vZS9zXFxcIiArIHQxKSwgXFxcIi5hbS1wb3B1cC1iZCYmSHRtbFxcXCIpLnJlcGxhY2UoLzwoYnV0dG9uKS4qP1xcXFwxPnw8XFxcXC8/YnJcXFxcLz8+L2dpLCBcXFwiXFxcXG5cXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFt1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnXSxcXG4gICAgICAgICAgICAgICAgICAgIGx5cmljOiBscmNcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2JsbSc6XFxuICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly9ibGFja2JsbS5iYWlsZW1pLmNvbS9pbmRleC5waHAvZGFuY2UvcGxheS9pZC8nICsgdDE7XFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKGZldGNoKHUpKTtcXG4gICAgICAgICAgICAgICAgdXJsID0gXy5kb3dudXJsIHx8IF8ucGxheXVybDtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMV1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2RqMSc6XFxuICAgICAgICAgICAgICAgIGl0ZW0gPSBmZXRjaFBDKFxcXCJodHRwOi8vd3d3Lnp6emRqLmNvbS9tdXNpYy9pbmZvLVxcXCIgKyB0MSk7XFxuICAgICAgICAgICAgICAgIHVybCA9IHBkZmgoaXRlbSwgXFxcImF1ZGlvJiZzcmNcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2RqMic6XFxuICAgICAgICAgICAgICAgIHVyaSA9IEpTT04ucGFyc2UoZmV0Y2hQQyhcXFwiaHR0cHM6Ly93d3cuZGp1dS5jb20vd2FwL3BsYXkvcGxheT9pZD1cXFwiICsgdDEpKS5kYXRhLmxpc3RlbnVybDtcXG4gICAgICAgICAgICAgICAgdXJsID0gYGh0dHA6Ly9tcDQuZGp1dS5jb20vJHt1cml9Lm00YWA7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICdkajMnOlxcbiAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoUEMoXFxcImh0dHA6Ly93d3cubGFsYWRqLmNvbS9pbmRleC9pbmRleC9nZXRfY29va2llXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImhlYWRlcnNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGBzb25nX2xpc3Q9dGhpbms6W3tcXFwiaWRcXFwiOlxcXCIke3QxfVxcXCJ9XTtgXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pKS5kYXRhWzBdLnBhdGg7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICdkajQnOlxcbiAgICAgICAgICAgICAgICB1cmkgPSBleGVjdXRlV2ViUnVsZShcXFwiaHR0cHM6Ly93d3cuYWhhZGouY29tL211c2ljL1xcXCIgKyB0MSArIFxcXCIuaHRtbFxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGRhbmNlRmlsZVBhdGg7XFxuICAgICAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB1cmwgPSBgaHR0cHM6Ly9zdC45Mmt1LmNvbS9gICsgdXJpO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgJyNpc011c2ljPXRydWUjJztcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuXFxuXFxuXFxuXFxuICAgICAgICAgICAgY2FzZSAnZGo1JzpcXG4gICAgICAgICAgICAgICAgXyA9IHBvc3QoJ2h0dHBzOi8vbS5kai5uZXQvdGVtcGxhdGUvemh6aF9kem11c2ljL2FqYXgvP2FjdGlvbj1nZXR1cmwnLCB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBcXFwiaWQ9XFxcIiArIHQxXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6Ly9kam5ldC5zcmMuZGoubmV0OjQ0MzEvXFxcIiArIEpTT04ucGFyc2UoXykuZGF0YVswXS5zcmM7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICdkajYnOlxcbiAgICAgICAgICAgICAgICB1cmkgPSBleGVjdXRlV2ViUnVsZShcXFwiaHR0cDovL3d3dy4zNmRqLmNvbS9wbGF5L1xcXCIgKyB0MSArIFxcXCIuaHRtbFxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGluZm8ucGxheXVybDtcXG4gICAgICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJywgJy9lLyddXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB1cmwgPSBgaHR0cDovL3RuMS43MmRqYXBwLmNuOjgzOTkvYCArIHVyaTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2RqNyc6XFxuICAgICAgICAgICAgICAgIHVybCA9IGV4ZWN1dGVXZWJSdWxlKFxcXCJodHRwczovL3d3dy43aWRqLmNvbS9kai9cXFwiICsgdDEgKyBcXFwiLmh0bWxcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5dXJsO1xcbiAgICAgICAgICAgICAgICB9KSwge1xcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuanMnLCAnLmNzcycsICcuanBnJywgJy5wbmcnLCAnLmdpZicsICcuc3ZnJywgJy5pY28nXVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbdHNbMF1dLCAxLCAn6YCJ5oup5LiL6L296Z+z6LSoJykuc2VsZWN0KCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2Rvd25sb2FkOi8vJyArIHVybDtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybCArICcjaXNNdXNpYz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcblxcblxcblxcblxcbiAgICAgICAgICAgIGNhc2UgJ2RqOCc6XFxuICAgICAgICAgICAgICAgIHUgPSAnaHR0cHM6Ly93d3cuZGp1OC5jb20nO1xcbiAgICAgICAgICAgICAgICBpdGVtID0gdSArICcvaWsvei8/JyArIGV4ZWN1dGVXZWJSdWxlKHUgKyAnL2Rpc2NvLycgKyB0MSArICcvJywgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnVybDtcXG4gICAgICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmpzJywgJy5jc3MnLCAnLmpwZycsICcucG5nJywgJy5naWYnLCAnLnN2ZycsICcuaWNvJ11cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGl0ZW0gPSBmZXRjaENvZGVCeVdlYlZpZXcoaXRlbSwge1xcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB1cmwgPSBwZGZoKGl0ZW0sIFxcXCJhdWRpbyYmc3JjXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmICh0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW3RzWzBdXSwgMSwgJ+mAieaLqeS4i+i9vemfs+i0qCcpLnNlbGVjdCgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdkb3dubG9hZDovLycgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lzTXVzaWM9dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG5cXG5cXG5cXG5cXG4gICAgICAgICAgICBjYXNlICdkajknOlxcbiAgICAgICAgICAgICAgICB1cmwgPSBleGVjdXRlV2ViUnVsZSgnaHR0cHM6Ly9tLmRqeXl5LmNvbS9wbGF5LycgKyB0MSArICcuaHRtbCcsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXl1cmw7XFxuICAgICAgICAgICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5qcycsICcuY3NzJywgJy5qcGcnLCAnLnBuZycsICcuZ2lmJywgJy5zdmcnLCAnLmljbyddXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAodDIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFt0c1swXV0sIDEsICfpgInmi6nkuIvovb3pn7PotKgnKS5zZWxlY3QoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnZG93bmxvYWQ6Ly8nICsgdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdXJsKTtcXG4gICAgICAgICA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9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndGlkJywgdGlkKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpaScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfSwgbmFtZSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPuWIh+aNouaOpeWPozwvYj48L3NwYW4+JyxcXG4gICAgICAgICAgICB1cmw6ICQocGxhdGZvcm1zLnNsaWNlKDAsIDgpLm1hcCh0aXRsZSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmICh0aXRsZSA9PSBwbGF0Zm9ybSlcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gUmljaChTdHJvbmcoQ29sb3IodGl0bGUpKSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aXRsZVxcbiAgICAgICAgICAgIH0pLCAyLCAn6YCJ5oup5o6l5Y+j5bmz5Y+wJykuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKCFpbnB1dC5tYXRjaCgvXuKAmOKAmOKAmeKAmS8pKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncGxhdGZvcm0nLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd0aWQnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3RpaScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykocGxhdGZvcm0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiNmZjY2MDFcXFwiPjxiPlRHWOaUtuiXjzwvYj48L3NwYW4+JyxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvY29sbGVjdGlvbiNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT3mrYzor43pgILphY1cXFwiLFxcbiAgICAgICAgICAgIGltZzogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKCfmlLbol48nKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMycsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBcXFwiVEdY5pS26JePXFxcIixcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6I2ZmNjYwMVxcXCI+PGI+6Kej5p6Q566h55CGPC9iPjwvc3Bhbj4nLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9ydWxlTGlzdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cGFnZVRpdGxlPeino+aekOeuoeeQhiZydWxlPeatjOivjemAgumFjVxcXCIsXFxuICAgICAgICAgICAgaW1nOiAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoJ+iuvue9ricpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF8zJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn8J+UjScsXFxuICAgICAgICAgICAgZGVzYzogJ+aQnOe0ouWFs+mUruivjSAvIOWIhuS6q+mTvuaOpScsXFxuICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChzX3BsYXRmb3JtKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzX3BsYXRmb3JtJywgc19wbGF0Zm9ybSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc190MicsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfcGxhdGZvcm0nKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3QzJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDQnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc2VhcmNoI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wPWZ5cGFnZSZydWxlPeatjOivjemAgumFjVxcXCI7XFxuICAgICAgICAgICAgfSwgcGxhdGZvcm0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6c2VhcmNoMVxcXCIsXFxuICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogXFxcIumrmOe6p+aQnOe0olxcXCIsXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcInNfdDJcXFwiKSxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc190MicsIGlucHV0KVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmiJHnmoTmlLbol48nLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vY29sbGVjdGlvbj9ydWxlPeatjOivjemAgumFjScsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaWNvbjEnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ+WOhuWPsuiusOW9lScsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9oaXN0b3J5P3J1bGU95q2M6K+N6YCC6YWNJyxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9pY29uMycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiAn6auY57qn5pCc57SiJyxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzX3BsYXRmb3JtJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3NfdDMnKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcignc190NCcpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9zZWFyY2gjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3A9ZnlwYWdlJnJ1bGU95q2M6K+N6YCC6YWNXFxcIjtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9pY29uMicsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPjxmb250IGNvbG9yPSNmZjY2MDE+JyArIHRpZCArICc8L2ZvbnQ+PC9iPicsXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIHRyci5tYXAoKG5hbWUsIGlpKSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpaSA9PSBpaSA/IFJpY2goU3Ryb25nKENvbG9yKG5hbWUpKSkgOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3RpaScsIHRpaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBpaSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBMb2FkaW5nKCk7XFxuICAgIH1cXG4gICAgdXJpID0gaVRhZ1t0aWRdW3Ryclt0aWldXTtcXG4gICAgaWYgKCFBcnJheS5pc0FycmF5KHVyaSkpICQucmVxdWlyZShwbGF0Zm9ybSArIFxcXCI/cnVsZT3mrYzor43pgILphY1cXFwiKS5sYXp5KDEsIHVyaSk7XFxuICAgIGVsc2UgZCA9IGQuY29uY2F0KHVyaSk7XFxufSBjYXRjaCAoZmV0Y2hfZXJyb3IpIHtcXG4gICAgZCA9IFt7XFxuICAgICAgICB0aXRsZTogXFxcIue9kee7nOW8guW4uCAvIOaOpeWPo+W0qea6g+S6hlxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwi5o2i5Liq5o6l5Y+j55yL55yL44CCXFxcIixcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH1dO1xcbiAgICBwbGF0Zm9ybXMuc2xpY2UoMSwgOClcXG4gICAgICAgIC5maWx0ZXIodGl0bGUgPT4gdGl0bGUgIT0gcGxhdGZvcm0pXFxuICAgICAgICAubWFwKHRpdGxlID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXF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KSB7XFxuICAgICAgICBpZiAoJC5kYXRlRm9ybWF0KGtnX2xpdGUudGltZSwgJ3l5eXlNTWRkJykgPCB0aW1lKSB7XFxuICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnW+mFt+eLl+amguW/teeJiF0g5ZCs5q2M6aKG5Lya5ZGYJyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+avj+aXpeWQrOatjOWNs+WPr+mihuWPljHml6Xphbfni5fmpoLlv7XniYhWSVAnLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBtYXQgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9cXFwiKFteXFxcIl0rKVxcXCIsIFxcXCIoLispXFxcIiwgXFxcIjMxMTZcXFwiLCBcXFwiKC4rKVxcXCIvKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuTGl0ZV9TaWduaW4obWF0WzFdLCBtYXRbMl0sIG1hdFszXSwgdHJ1ZSk7XFxuICAgICAgICAgICAgICAgIH0sIGtnX2xpdGUpLFxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIF8udGltZSA9IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgXy5zaWduaW4gPSAxO1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pO1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0LnVuc2hpZnQoXyk7XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyLmZpbmRJbmRleChvID0+IG1kNShvYmoudGl0bGUgKyBvYmoudXJsKSA9PT0gbWQ1KG8udGl0bGUgKyBvLnVybCkpID09PSBpbmRleDtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0X2tnJywganhsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ku4rml6XkuI3lho3mj5DnpLrvvIzor7flnKjorr7nva7pobXmiYvliqjnrb7liLBcXFwiXFxuICAgICAgICAgICAgICAgIH0sIGtnX2xpdGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIC8vIOS7iuWkqeW3sue7j+etvuWIsOi/h+S6hlxcbiAgICAgICAgfVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgLy8g5rKh5pyJ5qaC5b+154mI6Kej5p6QXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLikabop4TliJnnvJbovpFcIixcInBhdGhcIjpcInJ1bGVFZGl0XCIsXCJydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9saWI/cnVsZT3mrYzor43pgILphY0nLCB7fSkpLnJ1bGUpO1xcbmQgPSBbXTtcXG5qeF9zMSA9IGdldE15VmFyKCdqeF9zMScsICcwJykgPT0gJzAnO1xcbmp4X3MyID0gZ2V0TXlWYXIoJ2p4X3MyJywgJzAnKSA9PSAnMCc7XFxuanhfczMgPSBnZXRNeVZhcignanhfczInLCAnMCcpID09ICcxJztcXG5qeF90eXBlID0gZ2V0TXlWYXIoJ2p4X3R5cGUnLCAna3cnKTtcXG5qeF9vcGVuID0gZ2V0TXlWYXIo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WxlKChLLCBvcGVuKSA9PiB7XFxuICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdqeF9vcGVuJywgb3Blbik7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKG9wZW4pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKG1kNShpbnB1dCkgPT0gZ2V0TXlWYXIoJ2p4X20xJykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF9zMScsICcwJyk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfb3BlbicsIG9wZW4pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5r+A5rS75aSx6LSlXFxcIjtcXG4gICAgICAgICAgICB9LCBvcGVuKTtcXG4gICAgICAgIH1cXG4gICAgfSwganhfczEsIGp4X29wZW4gPyAnMCcgOiAnMScpLFxcbiAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoanhfb3BlbiA/IDU1IDogNjMpICsgJy5zdmcnLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfMydcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojZmY2NjAxXFxcIj48Yj7lkK/nlKjkuIvovb08L2I+PC9zcGFuPicsXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoSywgZG93bikgPT4ge1xcbiAgICAgICAgaWYgKEspIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignanhfZG93bicsIGRvd24pO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIuivt+i+k+WFpea/gOa0u+WvhuWMmVxcXCIpLmlucHV0KChkb3duKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IGdldE15VmFyKCdqeF9tMScpKSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignanhfczEnLCAnMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2p4X2Rvd24nLCBkb3duKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+a/gOa0u+Wksei0pVxcXCI7XFxuICAgICAgICAgICAgfSwgZG93bik7XFxuICAgICAgICB9XFxuICAgIH0sIGp4X3MxLCBqeF9kb3duID8gJzAnIDogJzEnKSxcXG4gICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGp4X2Rvd24gPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzMnXFxufSk7XFxuW1xcXCLpooTop4hcXFwiLCBcXFwi5Z+65pysXFxcIiwgXFxcIumfs+i0qFxcXCIsIFxcXCLop6PmnpBcXFwiLCBcXFwi5ouT5bGVXFxcIl0ubWFwKG5hbWUgPT4ge1xcbiAgICBpID0ganhfdGlkID09IG5hbWVcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhpID8gQ29sb3IobmFtZSkgOiBuYW1lKSksXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHRpZCwgdGlpLCBmZWcpID0+IHtcXG4gICAgICAgICAgICBpZiAodGlpKSB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF90aWQnLCB0aWQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICB9LCBuYW1lLCAhaSwgIWp4X3MyKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF81J1xcbiAgICB9KTtcXG59KTtcXG5zd2l0Y2ggKGp4X3RpZCkge1xcbiAgICBjYXNlICfpooTop4gnOlxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKGdldE15VmFyKCdqeF90aXRsZScpKSxcXG4gICAgICAgICAgICBkZXNjOiBbXFxcIm1wM1xcXCIsIFxcXCJocVxcXCIsIFxcXCJzcVxcXCIsIFxcXCJoclxcXCIsLyogXFxcInpxXFxcIiovXS5tYXAodCA9PiBnZXRNeVZhcihcXFwianhfXFxcIiArIHQpICE9IFxcXCJcXFwiID8gJ+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++8mnQyPVxcXCI0MDAwa1xcXCInLCAnaHInXSxcXG4gICAgICAgICAgIC8vIFsn6YCJ5aGr77yM56uL5L2T5peg5o2f44CC5L6L77yadDI9XFxcIjIwMDAwa1xcXCInLCAnenEnXVxcbiAgICAgICAgXS5tYXAoW2EsIGJdID0+IHtcXG4gICAgICAgICAgICBfID0ge1xcbiAgICAgICAgICAgICAgICBoaWdobGlnaHQ6IHRydWVcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGp4X3MyIHx8IGp4X3MzKSB7XFxuICAgICAgICAgICAgICAgIF8uZGVmYXVsdFZhbHVlID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBnZXRNeVZhcihcXFwianhfXFxcIiArIGIpKTtcXG4gICAgICAgICAgICAgICAgXy5vbkNoYW5nZSA9ICQudG9TdHJpbmcoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihuYW1lLCBnZXRQcml2YXRlSlMoaW5wdXQudHJpbSgpKSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKG5hbWUsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgXFxcImp4X1xcXCIgKyBiKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBfLmRlZmF1bHRWYWx1ZSA9IFxcXCLmsqHmnInmnYPpmZDvvIzor7fop6PplIHjgIJcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGRlc2M6IGEsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICBleHRyYTogX1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAn6Kej5p6QJzpcXG4gICAgICAgIF8gPSB7XFxuICAgICAgICAgICAgaGlnaGxpZ2h0OiB0cnVlLFxcbiAgICAgICAgICAgIHR5cGU6IFxcXCJ0ZXh0YXJlYVxcXCIsXFxuICAgICAgICAgICAgaGVpZ2h0OiA3XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoanhfczIgfHwganhfczMpIHtcXG4gICAgICAgICAgICBfLmRlZmF1bHRWYWx1ZSA9IGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgZ2V0TXlWYXIoXFxcImp4X2ppZXhpXFxcIikpO1xcbiAgICAgICAgICAgIF8ub25DaGFuZ2UgPSAkLnRvU3RyaW5nKChuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC50cmltKCkgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1d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B0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn57yW6L6R5rqQ55qE6ZmQ5Yi2JyksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2hvbWVfaWNvbl9lZGl0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5Y+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/neWtmOW5tumAgOWHuicpKSksXFxuICAgIGRlc2M6ICfkuIrmrKHnv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cImppZXhpP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuc2V0UnVsZShpbnB1dCk7JztcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAganNvbiA9IHt9O1xcbiAgICAgICAgICAgIGZvciAoa2V5IG9mIHp1KSB7XFxuICAgICAgICAgICAgICAgIF8gPSB6eVtrZXldO1xcbiAgICAgICAgICAgICAgICBpZiAoIWpzb25bXy50eXBlXSkge1xcbiAgICAgICAgICAgICAgICAgICAganNvbltfLnR5cGVdID0gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKF8ubTEgJiYgXy5tMSAhPSBcXFwiXFxcIiAmJiBTdHJpbmcoXy5tMSkubGVuZ3RoID09IDMyKSB7XFxuICAgICAgICAgICAgICAgICAgICBfLnMxID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgXy5kb3duID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChfLm0yICYmIF8ubTIgIT0gXFxcIlxcXCIgJiYgU3RyaW5nKF8ubTIpLmxlbmd0aCA9PSAzMiAmJiBfLnMyID09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgXy5zMiA9IFxcXCIyXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBqc29uW18udHlwZV0ucHVzaChfKTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoanNvbikpO1xcbiAgICAgICAgICAgIHJldHVybiAkKFtcXFwi5Ymq6LS05p2/XFxcIiwgXFxcIue6r+aWh+acrFxcXCJdLCAxLCAn6YCJ5oup5YiG5Lqr5qC85byPJykuc2VsZWN0KCh0KSA9PiB7XFxuICAgICAgICAgICAgICAgI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icgKyB0aXRsZSArICc6JyArIHVybCk7XFxuICAgICAgICAgICAgICAgIGkgPSB6dS5pbmRleE9mKG0pO1xcbiAgICAgICAgICAgICAgICBfID0ganhsaXN0W2ldO1xcbiAgICAgICAgICAgICAgICBzd2l0Y2ggKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfliIbkuqsnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLm0xICYmIF8ubTEgIT0gXFxcIlxcXCIgJiYgXy5tMS5sZW5ndGggPT0gMzIpIF8uczEgPSBcXFwiMVxcXCIsIF8ub3BlbiA9IFxcXCIwXFxcIiwgXy5kb3duID0gXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLm0yICYmIF8ubTIgIT0gXFxcIlxcXCIgJiYgXy5tMS5sZW5ndGggPT0gMzIgJiYgXy5zMiA9PSBcXFwiMFxcXCIpIF8uczIgPSBcXFwiMlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgX18gPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfX1t0eXBlXSA9IFtfXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfXyA9IEpTT04uc3RyaW5naWZ5KF9fKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0gYmFzZTY0RW5jb2RlKF9fKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly/mrYzor43pgILphY3op6PmnpDlj6Pku6TvvIzmiZPlvIDmtbfpmJTljbPlj6/lr7zlhaVcXFxcbu+/pVRleHTvv6VcXFwiICsgXyArICdAaW1wb3J0PWpzOiQucmVxdWlyZShcXFwiamlleGk/cnVsZT3mrYzor43pgILphY1cXFwiKS5zZXRSdWxlKGlucHV0KTsnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn57yW6L6RJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBbXFxcInR5cGVcXFwiLCBcXFwib3BlblxcXCIsIFxcXCJkb3duXFxcIiwgXFxcImltZ1xcXCIsIFxcXCJ0aXRsZVxcXCIsIFxcXCJkZXNjXFxcIiwgXFxcInVybFxcXCIsIFxcXCJjb250ZW50XFxcIiwgXFxcIm1wM1xcXCIsIFxcXCJocVxcXCIsIFxcXCJzcVxcXCIsIFxcXCJoclxcXCIsIFxcXCJ6cVxcXCIsIFxcXCJqaWV4aVxcXCIsIFxcXCJzMVxcXCIsIFxcXCJtMVxcXCIsIFxcXCJzMlxcXCIsIFxcXCJtMlxcXCIsIFxcXCJ0aW1lXFxcIiwgXFxcInRpZFxcXCIsIFxcXCJ1aWRcXFwiXS5tYXAodCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4XycgKyB0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF91aWQnLCBtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyhfKS5tYXAodCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdqeF8nICsgdCwgX1t0XSB8fCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcnVsZUVkaXQjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3BhZ2VUaXRsZT3op4TliJnnvJbovpEmcnVsZT3mrYzor43pgILphY0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Yig6ZmkJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6ZmkXFxcIiArIF8udHlwZSArIFxcXCLop6PmnpDigJxcXFwiICsgXy50aXRsZSArICfigJ3lkJfvvJ9cXFxcbuatpOaTjeS9nOS4jeWPr+mAhu+8jOivt+iwqOaFjumAieaLqeOAgicpLmNvbmZpcm0oKHR5cGUsIGp4bGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfJyArIHR5cGUsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBqeGxpc3QsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn56e75YqoJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp1ID0ganhsaXN0Lm1hcChfID0+IF8udGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHp1LmNvbmNhdChcXFwi5pyA5ZCO6Z2iXFxcIiksIDIsICfor7fpgInmi6nnp7vliqjkvY3nva4nKS5zZWxlY3QoKHR5cGUsIGp4bGlzdCwgXywgenUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSAtMSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdC5wdXNoKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDAsIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJqeGxpc3RfXFxcIiArIHR5cGUsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB0eXBlLCBqeGxpc3QsIF8sIHp1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mAieS4rSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDJbbV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJqeGxpc3QyXFxcIiwganhsaXN0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Y+W5raI6YCJ5LitJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGp4bGlzdDJbbV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCBqeGxpc3QyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBfLnR5cGUsIF8udGl0bGUsIF8udXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBfLmltZyB8fCAkLnJlcXVpcmUoJ2ltYWdlP3J1bGU95q2M6K+N6YCC6YWNJykoKVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBfLnR5cGUgKyAn5LioJyArIF8uZGVzYyArICfkuKgnICsgXy51cmwsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh0eXBlLCB0aXRsZSwgdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oJ2p4bGlzdF8nICsgdHlwZSwgW10pO1xcbiAgICAgICAgICAgICAgICB6dSA9IGp4bGlzdC5tYXAoXyA9PiBtZDUoXy50eXBlICsgJzonICsgXy50aXRsZSArICc6JyArIF8udXJsKSk7XFxuICAgICAgICAgICAgICAgIG0gPSBtZDUodHlwZSArICc6JyArIHRpdGxlICsgJzonICsgdXJsKTtcXG4gICAgICAgICAgICAgICAgaSA9IHp1LmluZGV4T2YobSk7XFxuICAgICAgICAgICAgICAgIGp4X29wZW4gPSAoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF8uczEgPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gXy5vcGVuID09ICcxJyA/ICcwJyA6ICcxJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoXy5vcGVuID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWl5r+A5rS75a+G5YyZXFxcIikuaW5wdXQoKGp4bGlzdCwgaSwgXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGlucHV0KSA9PSBfLm0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLnMxID0gJzAnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gJzEnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0W2ldID0gXztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oJ2p4bGlzdF8nICsgXy50eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL+a/gOa0u+aIkOWKn++8jOasoui/juS9v+eUqCc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvhuWMmemUmeivr++8jOaXoOazleWQr+eUqFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwganhsaXN0LCBpLCBfKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXy5vcGVuID0gJzAnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3RbaV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnanhsaXN0XycgKyB0eXBlLCBqeGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ganhfb3BlbihqeGxpc3RbaV0pO1xcbiAgICAgICAgICAgIH0sIF8udHlwZ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wib3BlblxcXCIgPyBcXFwi6K+V5ZCsXFxcIiA6IFxcXCLkuIvovb1cXFwiKSArIFxcXCLop6PmnpBcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChfIG9mIGp4bGlzdCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IGZhbHNlXFxuICAgICAgICAgICAgICAgIGV2YWwoU3RyaW5nKGFlc0RlY29kZSgnaGs2NjY2NjY2MTA5JywgX1txdWFsaXR5XSkpKTtcXG4gICAgICAgICAgICAgICAgZXZhbChTdHJpbmcoYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKSkpO1xcbiAgICAgICAgICAgICAgICBpZiAodXJsICYmIHVybCAhPSBcXFwiXFxcIiAmJiAhdXJsLm1hdGNoKFxcXCLkuIvovb3lpLHotKVcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGp4RXJyb3IpIHtcXG4gICAgICAgICAgICAgICAgLy8gbG9nKGVycm9yKGp4RXJyb3IpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6Kej5p6Q5aSx6LSlXFxcIlxcbiAgICB9LFxcblxcblxcblxcbiAgICBzZXRSdWxlOiBmdW5jdGlvbihpbnB1dCwgVHlwZSkge1xcbiAgICAgICAgW2xvZ1QsIHR5cGUsIHRleHRdID0gU3RyaW5nKGlucHV0KS5zcGxpdChcXFwi77+lXFxcIik7XFxuICAgICAgICBzd2l0Y2ggKFN0cmluZyh0eXBlKSkge1xcbiAgICAgICAgICAgIGNhc2UgJ1Bhc3RlJzpcXG4gICAgICAgICAgICAgICAgdGV4dCA9IHBhcnNlUGFzdGUodGV4dCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNh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cXCJcXFwiKSxcXG4gICAgICAgICAgICB1cmw6IGdldE15VmFyKFxcXCJqeF91cmxcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgY29udGVudDogZ2V0TXlWYXIoXFxcImp4X2NvbnRlbnRcXFwiLCBcXFwiXFxcIiksXFxuXFxuICAgICAgICAgICAgbXAzOiBnZXRNeVZhcihcXFwianhfbXAzXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIGhxOiBnZXRNeVZhcihcXFwianhfaHFcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgc3E6IGdldE15VmFyKFxcXCJqeF9zcVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBocjogZ2V0TXlWYXIoXFxcImp4X2hyXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIHpxOiBnZXRNeVZhcihcXFwianhfenFcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgamlleGk6IGdldE15VmFyKFxcXCJqeF9qaWV4aVxcXCIsIFxcXCJcXFwiKSxcXG5cXG4gICAgICAgICAgICBzMTogZ2V0TXlWYXIoXFxcImp4X3MxXFxcIiwgXFxcIjBcXFwiKSxcXG4gICAgICAgICAgICBtMTogZ2V0TXlWYXIoXFxcImp4X20xXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgIHMyOiBnZXRNeVZhcihcXFwianhfczJcXFwiLCBcXFwiMFxcXCIpLFxcbiAgICAgICAgICAgIG0yOiBnZXRNeVZhcihcXFwianhfbTJcXFwiLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgdGltZTogbmV3IERhdGUoKS5nZXRUaW1lKClcXG4gICAgICAgIH07XFxuICAgICAgICBpZiAoXy50aXRsZSAhPSBcXFwiXFxcIiAmJiBfLnVybCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIGZvciAodCBpbiBfKSB7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4XycgKyB0KTtcXG4gICAgICAgICAgICAgICAgaWYgKF9bdF0gPT0gXFxcIlxcXCIgfHwgX1t0XSA9PSBcXFwiVmZhbmFocy95MGlaeGNTTDBQSkFjUT09XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIF9bdF07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAganhsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0XycgKyBfLnR5cGUsIFtdKTtcXG4gICAgICAgICAgICB1aWRzID0ganhsaXN0Lm1hcChfXyA9PiBtZDUoX18udHlwZSArICc6JyArIF9fLnRpdGxlICsgJzonICsgX18udXJsKSk7XFxuICAgICAgICAgICAgaSA9IHVpZHMuaW5kZXhPZihnZXRNeVZhcignanhfdWlkJywgJy0xJykpO1xcbiAgICAgICAgICAgIGlmIChpID09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5wdXNoKF8pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGp4bGlzdC5zcGxpY2UoaSwgMSwgXyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4X3RpZCcpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2p4X3VpZCcpO1xcbiAgICAgICAgICAgIGp4bGlzdCA9IGp4bGlzdC5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gYXJyLmZpbmRJbmRleChvID0+IG1kNShvYmoudGl0bGUgKyBvYmoudXJsKSA9PT0gbWQ1KG8udGl0bGUgKyBvLnVybCkpID09PSBpbmRleDtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdqeGxpc3RfJyArIF8udHlwZSwganhsaXN0KTtcXG4gICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwg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iKS5sb2dEYXRhKG5ld0RhdGFzLCBzaSwgbmFtZSB8fCBcXFwiXFxcIik7XFxuICAgICAgICBlbHNlIGlmICh0eXBlID09PSAxKVxcbiAgICAgICAgICAgIHJldHVybiAkKG5hbWUgfHwgXFxcIlxcXCIsIFxcXCLnoa7lrprliIbnu4TlkI3np7BcXFwiKS5pbnB1dCgoc2ksIG5ld0RhdGFzKSA9PiB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IDAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGl0Y2g6IDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2k6IHNpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGE6IG5ld0RhdGFzXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGpzb24pKTtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBzaGFyZVBhc3RlKHQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8v5q2M6K+N6YCC6YWN5pS26JeP5Y+j5Luk77yM5omT5byA5rW36ZiU5Y2z5Y+v5a+85YWlXFxcXG7vv6VQYXN0Ze+/pVxcXCIgKyB1ICsgYEBpbXBvcnQ9anM6JC5yZXF1aXJlKFxcXCJqaWV4aT9ydWxlPeatjOivjemAgumFjVxcXCIpLnNldFJ1bGUoaW5wdXQsMik7YDtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5YiG5Lqr5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH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HJ1biA9PSAndHJ1ZScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgKi9cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdXJsID0gZmFsc2U7XFxuICAgICAgICAgICAgdiA9IHZlcnNpb24gKyAxO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHZlcnNpb24gPCB2KSB7XFxuICAgICAgICAgICAgZiA9IFxcXCJyZWRcXFwiO1xcbiAgICAgICAgICAgIHQgPSBcXFwi5qOA5rWL5Yiw5paw54mI5pu05paw77yM54K55Ye75LqG6Kej6K+m5oOF44CCXFxcIjtcXG4gICAgICAgICAgICBUID0gXFxcIuabtOaWsOWGheWuuVxcXCI7XFxuICAgICAgICAgICAgaWYgKHVwID09ICcnKSB7XFxuICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDmj5DnpLonLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogJ+ajgOa1i+WIsOS9oOeahOinhOWImeeJiOacrOWwj+S6juacjeWKoeWZqOeJiOacrO+8jOaYr+WQpueri+WNs+abtOaWsO+8nycsXFxuICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChkYSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGYgPSAkLnJlcXVpcmUoXFxcImxhbnpvdT9ydWxlPeatjOivjemAgumFjVxcXCIpLm9uZV91cmwoZGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh1cCwgdmVyc2lvbikgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsYW56b3U/cnVsZT3mrYzor43pgILphY1cXFwiKS5vbmVfaW5mbyh1cCwgXFxcImdjc3BcXFwiLCB2ZXJzaW9uKTtcXG4gICAgICAgICAgICB9LCB1cmwgfHwgdXAsIHZlcnNpb24pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgaWYgKCF0KSB7XFxuICAgICAgICBUID0gXFxcIueoi+W6j+iuvue9rlxcXCI7XFxuICAgICAgICB1cmwgPSBcXFwiaGlrZXI6Ly9wYWdlL2luc3RhbGwjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIjtcXG4gICAgICAgIGhvdXIgPSBuZXcgRGF0ZSgpLmdldEhvdXJzKCk7XFxuICAgICAgICBpZiAoaG91ciA8IDUpIHtcXG4gICAgICAgICAgICB0ID0gXFxcIua3seWknO+8jOeOsOWcqOeahOWknO+8jOeGrOW+l+WPquaYr+i/mOacquaUueWPmOeahOS5oOaDr1xcXCI7XFxuICAgICAgICB9IGVsc2UgaWYgKGhvdXIgPCAxMSkge1xcbiAgICAgICAgICAgIHQgPSBcXFwi5pep5a6J77yM5riF5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VfdXJsKHVybCwgcHdkLCBydW4sIHRydWUpO1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBwYXRoID0gaHRtbC5tYXRjaCgvbGluayA9IFsnXFxcIl0oW15cXFwiJ10rKS9pKVsxXTtcXG4gICAgICAgICAgICBob3N0ID0gdXJsLm1hdGNoKC9eKC4qP1xcXFwuY29tXFxcXC8pLylbMV07XFxuICAgICAgICAgICAgcmV0dXJuIG9uZV91cmwoaG9zdCArIHBhdGgsIHB3ZCwgcnVuKTtcXG4gICAgICAgIH0gY2F0Y2ggKGVycjApIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBwYXRoID0gaHRtbC5tYXRjaCgvJyhcXFxcPy4rPyknLylbMV07XFxuICAgICAgICAgICAgICAgIGhvc3QgPSBcXFwiaHR0cHM6Ly9kZXZlbG9wZXIubGFuem91Zy5jb21cXFwiO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycjEpIHtcXG4gICAgICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC92YWx1ZVxcXFw7KFtcXFxcc1xcXFxTXSs/KVxcXFwkXFxcXCgvaSlbMV0pO1xcbiAgICAgICAgICAgICAgICBldmFsKCdib2R5PScgKyBodG1sLm1hdGNoKC9bXFxcXHNcXFxcU10qZGF0YSA6KFtcXFxcc1xcXFxTXSo/XFxcXH0pLFxcXFxzKy8pWzFdKTtcXG4gICAgICAgICAgICAgICAgdSA9IFN0cmluZyh1cmwpLnJlcGxhY2UoL1xcXFwuY29tLiovLCBcXFwiLmNvbS9hamF4bS5waHBcXFwiKTtcXG4gICAgICAgICAgICAgICAgXyA9IEpTT04ucGFyc2UocG9zdCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBib2R5LFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZC5oZWFkZXJzXFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgc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QxLSQyXFxcIik7XFxuICAgICAgICBkID0gW107XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGRlc2M6IFxcXCI8Yj7igJzigJxcXFwiICsgdmVyc2lvbiArIFxcXCIgPT4gXFxcIiArIHQgKyBcXFwi4oCd4oCdPC9iPlxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwZGZoKGl0ZW0sIFxcXCIubWRvJiZIdG1sXFxcIikucmVwbGFjZSgvKDxcXFxcL3NwYW4+KT9cXFxccyo8c3Bhbj4vZ2ksIFxcXCI8YnI+XFxcIiksXFxuICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCI8Yj7igJzigJznoa7lrprmm7TmlrDigJ3igJ08L2I+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgodXJsLCBwd2QsIGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdSdWxlX25vdXBkYXRlJykgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFjayh0cnVlKSwgXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICQucmVxdWlyZSgnbGFuem91P3J1bGU95q2M6K+N6YCC6YWNJyk7XFxuICAgICAgICAgICAgICAgIEsgPSBvbmVfdXJsKHVybCwgcHdkLCAxLCAwLCBpdGVtKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCFLKSB7XFxuICAgICAgICAgICAgICAgICAgICBLID0gb25lX3VybCh1cmwuc3BsaXQoXFxcIj9cXFwiKVswXSwgcHdkLCAxKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoSykge1xcbiAgICAgICAgICAgICAgICAgICAgZiA9IFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL19maWxlU2VsZWN0X3J1bGUuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBkb3dubG9hZEZpbGUoSywgZik7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUnVsZV9ub3VwZGF0ZScsICcxJyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4g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iAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgIGNhc2UgJ1tRUemfs+S5kF0g5Yi35pawY29va2llJzpcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WujOWWhOS4rX5cXFwiXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgJ1vphbfni5fmpoLlv7XniYhdIOWQrOatjOmihuS8muWRmCc6XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3ZpcHJ1bGVfYzAnKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcigndmlwcnVsZV9jMScpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCd2aXBydWxlX2MyJyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5ZCs5q2M6aKG5Lya5ZGYJyk7XFxuICAgICAgICAgICAgICAgICAgICBfID0gc3RvcmFnZTAuZ2V0SXRlbSgnanhsaXN0X2tnJywgW10pXFxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXyA9PiBtZDUoXy50aXRsZSArIF8udXJsKSA9PSBcXFwiYzg3N2FlNzJiOTdiYzI2NzIwYWQ4YjFhMzkzNjJkNDdcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGQgPSBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn5q+P5aSp5Y+q6IO96aKG5Y+W5LiA5qyhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1dO1xcbiAgICAgICAgICAgICAgICAgICAgWyd1c2VyaWQnLCAndG9rZW4nLCAnc2lnbmtleSddLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogMixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3ZpcHJ1bGVfYycgKyBpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBgcHV0TXlWYXIoXFxcInZpcHJ1bGVfYyR7aX1cXFwiLCBpbnB1dCk7YCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LuO6Kej5p6Q6I635Y+WXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IFxcXCJoaWtlcjovL2ltYWdlcy9pY29uX3NlYXJjaDZcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl8yX3JvdW5kXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKF8pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKF8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfLnNpZ25pbiA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF0ID0gYWVzRGVjb2RlKCdoazY2NjY2NjYxMDknLCBfLmppZXhpKS5tYXRjaCgvXFxcIihbXlxcXCJdKylcXFwiLCBcXFwiKC4rKVxcXCIsIFxcXCIzMTE2XFxcIiwgXFxcIiguKylcXFwiLyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCBtYXRbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCd2aXBydWxlX2MxJywgbWF0WzJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigndmlwcnVsZV9jMicsIG1hdFszXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5q2j5Zyo6LCD55So6Kej5p6Q5Y+C5pWwJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S7iuWkqeW3sue7j+etvuWIsOi/h+S6hic7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5rKh5pyJ5qaC5b+154mI55qE6Kej5p6QXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgXylcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuehruWumumihuWPllxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9tZW51NlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uXzJfcm91bmRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgoXykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQgPSBnZXRNeVZhcigndmlwcnVsZV9jMCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2tlbiA9IGdldE15VmFyKCd2aXBydWxlX2MxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpZ25rZXkgPSBnZXRNeVZhcigndmlwcnVsZV9jMicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KHNpZ25rZXkpID09IFxcXCI3OGM2MGMzNWU1OTBiZWU4ZTE0YmFlNDRiZGU1MTI3N1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQxID0gJC5kYXRlRm9ybWF0KG5ldyBEYXRlKCkuZ2V0VGltZSgpLCAneXl5eU1NZGQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHQyID0gJC5kYXRlRm9ybWF0KF8udGltZSwgJ3l5eXlNTWRkJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXQgPSBhZXNEZWNvZGUoJ2hrNjY2NjY2NjEwOScsIF8uamlleGkpLm1hdGNoKC9cXFwiKFteXFxcIl0rKVxcXCIsIFxcXCIoLispXFxcIiwgXFxcIjMxMTZcXFwiLCBcXFwiKC4rKVxcXCIvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hdHggPSB1c2VyaWQgPT0gbWF0WzFdICYmIHRva2VuID09IG1hdFsyXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXR4ICYmIHQxIDwgdDIgJiYgXy5zaWduaW4gPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ku4rlpKnlt7Lnu4/nrb7liLDov4fkuoYnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJrZz9ydWxlPeatjOivjemAgumFjVxcXCIpLkxpdGVfU2lnbmluKFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VyaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRva2VuLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaWdua2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXR4XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9zaWdua2V56ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIF8pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSAnW1FR6Z+z5LmQXSDnmb3lq5Zjb29raWUnOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpWFlc+WvhuWMmVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChtZDUoaW5wdXQpID09IFxcXCJjMDA0YzA4NGY5MDkyMjI0NGNhODUyZmMzNjhhNmVjZVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzaG93TG9hZGluZygnZ2V0IHFxX2Nvb2tpZSBpbmcuLi4nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZyhhZXNEZWNvZGUoaW5wdXQsIFxcXCJlOWRRenhxbmRDM3hvM2JBN3JLbklydUpPUXlyeTIzNWlrMWFuU3loTVExZm5XbWpVMDNtWFVVdlRJV29hQjV5YVlxNFQyMVhoMUg0US94RGNnUEl6ZVJHNDUzS0Uyamc2NU8rTUJoRHNXWVFnWnQ0VE00cmQyME4wYjhpQW9haVFsU3ZIQnV6WWgxSVhHUGp3S3lxUzNmSTJTNnVMY1AvVW5YbEx6dSsvaWFOdHQzbVRkaXlHSVRKZGMwTlFKYjRJYkZrZk5KR2VaMXVBSTM0LzRJbmJ3XFxcIikpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBfID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiczFcXFwiOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzMlxcXCI6IFxcXCIwXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImltZ1xcXCI6ICQucmVxdWlyZSgnaW1hZ2U/cnVsZT3mrYzor43pgILphY0nKShcXFwicXFcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInR5cGVcXFwiOiBcXFwicXFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidGltZVxcXCI6IG5ldyBEYXRlKCkuZ2V0VGltZSgpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwib3BlblxcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImRvd25cXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJkZXNjXFxcIjogXFxcIuS8mOmAiVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IFxcXCJRUemfs+S5kFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBcXFwiaHR0cHM6Ly91LnkucXEuY29tXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1wM1xcXCI6IFxcXCJVVksza0t6ck56dnlMa09UajZGbU9rbWI5WjY5QUsvWVFhc2Vl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KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJqeGxpc3RfcXFcXFwiLCBbXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0LnVuc2hpZnQoXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0ID0ganhsaXN0LmZpbHRlcigob2JqLCBpbmRleCwgYXJyKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gbWQ1KG9iai50aXRsZSArIG9iai51cmwpID09PSBtZDUoby50aXRsZSArIG8udXJsKSkgPT09IGluZGV4O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnNldEl0ZW0oXFxcImp4bGlzdF9xcVxcXCIsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvhuWMmemUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgfSlcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxiPlxcXCIgKyBTdHJpbmcoXy52ZXJzaW9uKS5yZXBsYWNlKC8oXFxcXGRcXFxcZCkoXFxcXGRcXFxcZCkkLywgXFxcIi0kMS0kMlxcXCIpLmZvbnRjb2xvcihcXFwic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ZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICd3eSc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ3dlYXBp5aW95YOP5Y+q5pyJ6K+V5ZCsJmhpcmVzJywgJ+aciemcgOimgeWGjeWGmeivpue7huaOpeWPoycsIFsnTVVTSUNfVSddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdrZyc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+WPr+S7peaKk+e9kemhteerr+eahGNvb2tpZScsICcuJywgWyd1c2VyaWQnLCAndG9rZW4nXV07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSAna2cyJzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsn5bey5pSv5oyB5q+P5aSp562+5Yiw6aKG5Lya5ZGYJywgJ3NpZ25rZXnlhbPplK7or41MblQ2eHAnLCBbJ3VzZXJpZCcsICd0b2tlbicsICdzaWdua2V5J11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2t3JzpcXG4gICAgICAgICAgICAgICAgICAgIGFyciA9IFsn6Ieq5bex5YaZanPojrflj5YnLCAnaHR0cHM6Ly9naXRodWIuY29tL3loc2owOTE5L211c2ljX2FwaS9ibG9iL21haW4vbGliL2FwaS9rdXdvL21vZHVsZS9zb25nLmRhcnQnLCBbJ3JpZOS8oOWPguS4uu+8mnQxXFxcXG5icuS8oOWPguS4uu+8mnQyXFxcXG5kZXPosIPnlKjvvJokLnJlcXVpcmUoXFxcImt3P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuZGVzKHN0cik7J11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2t3Mic6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+S7jkFQUOaKk+WMhScsICflupTor6Xlj6/ku6Xop6PmnpDvvIzmsqHmtYvor5UnLCBbJ3VpZCcsICd0b2tlbicsICdkZXZpZCddXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdtZyc6XFxuICAgICAgICAgICAgICAgICAgICBhcnIgPSBbJ+S7jue9kemhteeZu+W9lScsICcuJywgWydTRVNTSU9OJ11dO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ+S9nOiAhSc6XFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSAndG9hc3Q6Ly/pgqLllYrvvIzkvZzogIXkuI3mg7PmlLbliLDlvovluIjlh73vvIzmmoLkuI3mlK/mjIEnO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlICE9ICfkvZzogIUnKSB7XFxuICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAzOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3ZpcHJ1bGVfYycgKyBpKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1cmwgPSAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLnJ1bGUoKHR5cGUsIFt0aXRsZSwgZGVzYywgY29va2llc10pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGQgPSBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfV07XFxuICAgICAgICAgICAgICAgICAgICBjb29raWVzLm1hcCgodCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogJ3RleHRhcmVhJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogdHlwZSA9PSAna3cnID8gNyA6IDMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCd2aXBydWxlX2MnICsgaSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogYHB1dE15VmFyKFxcXCJ2aXBydWxlX2Mke2l9XFxcIiwgaW5wdXQpO2AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi56Gu5a6a5a+85YWlXFxcIi5mb250Y29sb3IoXFxcInJlZFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1xcXCIpLmxhenlSdWxlKCh0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiczFcXFwiOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiczJcXFwiOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaW1nXFxcIjogJC5yZXF1aXJlKCdpbWFnZT9ydWxlPeatjOivjemAgumFjScpKHR5cGUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInR5cGVcXFwiOiBTdHJpbmcodHlwZSkucmVwbGFjZSgvMiQvLCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidGltZVxcXCI6IG5ldyBEYXRlKCkuZ2V0VGltZSgpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm9wZW5cXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiZG93blxcXCI6IFxcXCIxXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJkZXNjXFxcIjogXFxcIuS8mOmAiVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQzAgPSBTdHJpbmcoZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzAnLCAnJykpLnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQzEgPSBTdHJpbmcoZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzEnLCAnJykpLnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQzIgPSBTdHJpbmcoZ2V0TXlWYXIoJ3ZpcHJ1bGVfYzInLCAnJykpLnRyaW0oKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0a2dqaWV4aSA9ICh0aXRsZSwgdXJsLCB1c2VyaWQsIHRva2VuLCBhcHBpZCwgc2lnbmtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihfLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcIkJ0N3crcWg5d0FkYkVLaFVtUzU0NXc9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcImhTM2RyWWtwN09JMXhLT2MyQmtmcVE9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNxXFxcIjogXFxcIlB3WHJ2dnptMDRmdG9DblVXa3BKRnc9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhyXFxcIjogXFxcIjUvbUs5VGNaMWk4aC9ZOXoxTkhoenc9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF8uamlleGkgPSBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKGBfID0gcmVsYXRlX2dvb2RzW3QyXTtcXG51cmwgPSAkLnJlcXVpcmUoXFxcImtnP3J1bGU95q2M6K+N6YCC6YWNXFxcIikuR2V0TXVzaWNVcmwoXy5oYXNoLCBfLnF1YWxpdHksIF8uYWxidW1faWQsIF8uYWxidW1fYXVkaW9faWQsIFxcXCIke3VzZXJpZH1cXFwiLCBcXFwiJHt0b2tlbn1cXFwiLCBcXFwiJHthcHBpZH1cXFwiLCBcXFwiJHtzaWdua2V5fVxcXCIpO2ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHR5cGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3FxJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKF8sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogXFxcIlFR6Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwczovL3UueS5xcS5jb21cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcIlVWSzNrS3pyTnp2eUxrT1RqNkZtT2ttYjlaNjlBSy9ZUWFzZWVzZnM4QTg9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcInE1QU12cGRrS3lhUmJBeWhZcXdrZ1VtYjlaNjlBSy9ZUWFzZWVzZnM4QTg9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNxXFxcIjogXFxcInhWQ3B6aGFLQ0N4L09ONHBsTzQ1dXlxZ0pFTGRsVzhrekxCV1JBandkT0U9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhyXFxcIjogXFxcIk02YVhMcmd3aFR5RE1QbUtHMVlXcWlxZ0pFTGRsVzhrekxCV1JBandkT0U9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL3FtX2tleXN0PS9pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMCA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IEMxLnNwbGl0KC91aW49L2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMxID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWMwIHx8ICFjMSkgcmV0dXJuIFxcXCJ0b2FzdDovL2Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5qaWV4aSA9IGdldFByaXZhdGVKUyhgdSA9IF8udXJsICsgXFxcXGAvY2dpLWJpbi9tdXNpY3UuZmNnP2RhdGE9e1xcXCJyZXFfMFxcXCI6e1xcXCJtb2R1bGVcXFwiOlxcXCJ2a2V5LkdldFZrZXlTZXJ2ZXJcXFwiLFxcXCJtZXRob2RcXFwiOlxcXCJDZ2lHZXRWa2V5XFxcIixcXFwicGFyYW1cXFwiOntcXFwiZ3VpZFxcXCI6XFxcIjBcXFwiLFxcXCJwbGF0Zm9ybVxcXCI6XFxcIjIwXFxcIixcXFwiZmlsZW5hbWVcXFwiOltcXFwiJFxcXFx7aCt0MSt0MStlfVxcXCJdLFxcXCJzb25nbWlkXFxcIjpbXFxcIiRcXFxce3QxfVxcXCJdfX19XFxcXGA7XFxuXyA9IEpTT04ucGFyc2UoZmV0Y2godSwge1xcbiAgICBoZWFkZXJzOiB7XFxuICAgICAgICBDb29raWU6IFxcXCJxbV9rZXlzdD0ke2MwfTsgdWluPSR7YzF9O1xcXCJcXG4gICAgfVxcbn0pKS5yZXFfMC5kYXRhO1xcbnVybCA9IF8ubWlkdXJsaW5mb1swXS5wdXJsO1xcbmlmICh1cmwpIHVybCA9IF8uc2lwWzBdICsgdXJsO2ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnd3knOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi572R5piT5LqR6Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwczovL211c2ljLjE2My5jb21cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibXAzXFxcIjogXFxcIktmVVBnMnBiS3BJdVh4cUcxMUUzRXpVWFR6SURiWHdXWnRNSVZZcU9VNjQ9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcIjVnYlFhNlJ1VnRsMkhMSXI4R25KQUl0Z3c0ZXBSSXhXNmM2RXpHM014Zlk9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNxXFxcIjogXFxcImNKSEJTQ2VKYTQ2R0Y3TlVKYUVVT2tSWDlJaU1ETGhaUXF6MnRpMmE2TGM9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhyXFxcIjogXFxcIktFSi94ZDZ2RVAzeStacE0vQ2JwSjFYMnAyb2JQOHRJbWNYRWk5RHlRSEU9XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL01VU0lDX1U9L2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWMwKSByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKGB1cmwgPSAkLnJlcXVpcmUoXFxcInd5P3J1bGU95q2M6K+N6YCC6YWNXFxcIikuYWpheDIoXy51cmwgKyBcXFwiL3dlYXBpL3NvbmcvZW5oYW5jZS9wbGF5ZXIvdXJsL3YxXFxcIiwge1xcbiAgICBlbmNvZGVUeXBlOiBcXFwiZmxhY1xcXCIsXFxuICAgIGlkczogXFxcXGBbJFxcXFx7dDF9XVxcXFxgLFxcbiAgICBsZXZlbDogbGV2ZWxcXG59LCB7XFxuICAgIENvb2tpZTogXFxcIk1VU0lDX1U9JHtjMH1cXFwiXFxufSkuZGF0YVswXS51cmwuc3BsaXQoXFxcIj9cXFwiKVswXTtgKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2tnJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL3VzZXJpZD0vaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzAgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdChcXFwiO1xcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMgPSBDMS5zcGxpdCgvdG9rZW49L2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMxID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWMwIHx8ICFjMSkgcmV0dXJuIFxcXCJ0b2FzdDovL2Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0a2dqaWV4aShcXFwi6YW354uX6Z+z5LmQXFxcIiwgXFxcImh0dHBzOi8vd3d3Lmt1Z291LmNvbVxcXCIsIGMwLCBjMSwgXFxcIlxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2tnMic6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IEMwLnNwbGl0KC91c2VyaWQ9L2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gQzEuc3BsaXQoL3Rva2VuPS9pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMSA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IEMyLnNwbGl0KC9hcHBpZD0vaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzIgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdChcXFwiO1xcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYzAgfHwgIWMxKSByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWQ1KGMyKSAhPSBcXFwiNzhjNjBjMzVlNTkwYmVlOGUxNGJhZTQ0YmRlNTEyNzdcXFwiKSByZXR1cm4gXFxcInRvYXN0Oi8vc2lnbmtleemUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0a2dqaWV4aShcXFwi6YW354uX5qaC5b+154mIXFxcIiwgXFxcImh0dHBzOi8vZ2F0ZXdheS5rdWdvdS5jb21cXFwiLCBjMCwgYzEsIFxcXCIzMTE2XFxcIiwgYzIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAna3cnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi6YW35oiR6Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwOi8vbW9iaS5rdXdvLmNuXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1wM1xcXCI6IFxcXCJSWGxuWk55WUlVYjEzTXVrSWs5UlRRPT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaHFcXFwiOiBcXFwiVk0rcGFURnVwczFhZVNvbit6MGgyZz09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNxXFxcIjogXFxcIlBHQW5DUUNqdUpYemJpYStwKzBIdFE9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJoclxcXCI6IFxcXCJ0cTFwWDRUL1kxM3ZUZUEzWmZLWG5WWDJwMm9iUDh0SW1jWEVpOUR5UUhFPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFDMCkgcmV0dXJuIFxcXCJ0b2FzdDovL2Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5qaWV4aSA9IGdldFByaXZhdGVKUyhDMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdrdzInOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi5rOi54K56Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwczovL2JkLWFwaS5rdXdvLmNuXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm1wM1xcXCI6IFxcXCJsb3E2ZW5vQXZKa2FnTEE4NlNFaUhDQjZWak1wcnZIVDhMRnZ1Z2J1ZnFRPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJocVxcXCI6IFxcXCJlay9ibVUwOXZYRHFQTEhyVEhEanZTQjZWak1wcnZIVDhMRnZ1Z2J1ZnFRPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzcVxcXCI6IFxcXCJQdzRWWkJ5QUFRb3ZpUDdxWm9LVXVpVHlRZGxkamwrOThHRE5XOFd2aXBzPVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IEMwLnNwbGl0KC91aWQ9L2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gQzEuc3BsaXQoL3Rva2VuPS9pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjMSA9IChjWzFdIHx8IGNbMF0pLnNwbGl0KFxcXCI7XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYyA9IEMyLnNwbGl0KC9kZXZJZD0vaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYzIgPSAoY1sxXSB8fCBjWzBdKS5zcGxpdChcXFwiO1xcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYzAgfHwgIWMxIHx8ICFjMikgcmV0dXJuIFxcXCJ0b2FzdDovL2Nvb2tpZeagvOW8j+mUmeivr1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXy5qaWV4aSA9IGdldFByaXZhdGVKUyhgdXJsID0gSlNPTi5wYXJzZShmZXRjaChfLnVybCArIFxcXCIvYXBpL3NlcnZpY2UvbXVzaWMvZG93bmxvYWRJbmZvL1xcXCIgKyB0MSArIFxcXCI/aXNNdj0wJmZvcm1hdD1cXFwiICsgdDMgKyBcXFwiJmJyPVxcXCIgKyB0MiArIFxcXCImbGV2ZWw9XFxcIiwge1xcbiAgICBcXFwiaGVhZGVyc1xcXCI6IHtcXG4gICAgICAgICdVc2VyLUFnZW50JzogJ29raHR0cC8zLjEwLjAnLFxcbiAgICAgICAgJ2NoYW5uZWwnOiAncXEnLFxcbiAgICAgICAgJ3BsYXQnOiAnYXInLFxcbiAgICAgICAgJ25ldCc6ICd3aWZpJyxcXG4gICAgICAgICd2ZXInOiAnMy4xLjInLFxcbiAgICAgICAgJ3VpZCc6ICcke2MwfScsXFxuICAgICAgICAndG9rZW4nOiAnJHtjMX0nLFxcbiAgICAgICAgJ2RldklkJzogJyR7YzJ9J1xcbiAgICB9XFxufSkpLmRhdGEudXJsO2ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbWcnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiBcXFwi5ZKq5ZKV6Z+z5LmQXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IFxcXCJodHRwczovL20ubXVzaWMubWlndS5jblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJtcDNcXFwiOiBcXFwiaFMzZHJZa3A3T0kxeEtPYzJCa2ZxUT09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImhxXFxcIjogXFxcIlB3WHJ2dnptMDRmdG9DblVXa3BKRnc9PVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzcVxcXCI6IFxcXCI1L21LOVRjWjFpOGgvWTl6MU5IaHp3PT1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaHJcXFwiOiBcXFwidzVsUW55WFZhaEpzWUdlVWUrcE51dz09XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjID0gQzAuc3BsaXQoL1NFU1NJT049L2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMwID0gKGNbMV0gfHwgY1swXSkuc3BsaXQoXFxcIjtcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWMwKSByZXR1cm4gXFxcInRvYXN0Oi8vY29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfLmppZXhpID0gZ2V0UHJpdmF0ZUpTKGBoZWFkZXJzID0ge1xcbiAgICBoZWFkZXJzOiB7XFxuICAgICAgICBcXFwiUmVmZXJlclxcXCI6IF8udXJsICsgXFxcIi92NC9cXFwiLFxcbiAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUEsXFxuICAgICAgICBcXFwiQnlcXFwiOiBtZDUoTU9CSUxFX1VBKSxcXG4gICAgICAgIFxcXCJDb29raWVcXFwiOiBcXFwiU0VTU0lPTj0ke2MwfVxcXCJcXG4gICAgfVxcbn07XFxudSA9IF8udXJsICsgXFxcIi9taWd1bXVzaWMvaDUvcGxheS9hdXRoL2dldFNvbmdQbGF5SW5mbz90eXBlPVxcXCIgKyB0MiArIFxcXCImY29weXJpZ2h0SWQ9XFxcIiArIHQxO1xcbnVybCA9IFxcXCJodHRwczpcXFwiICsgSlNPTi5wYXJzZShmZXRjaCh1LCBoZWFkZXJzKSkuZGF0YS5wbGF5VXJsO2ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcImp4bGlzdF9cXFwiICsgXy50eXBlLCBbXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdC51bnNoaWZ0KF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QgPSBqeGxpc3QuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBhcnIuZmluZEluZGV4KG8gPT4gbWQ1KG9iai50aXRsZSArIG9iai51cmwpID09PSBtZDUoby50aXRsZSArIG8udXJsKSkgPT09IGluZGV4O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwianhsaXN0X1xcXCIgKyBfLnR5cGUsIGp4bGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrKGZhbHNlKSwgXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHR5cGUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICB9LCB0eXBlLCBhcnIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgfSwgcCksXFxuICAgIH0pO1xcbn1cXG5zZXRSZXN1bHQoZCk7XCJ9XSIsImljb24iOiJodHRwOi8vbW1iaXoucXBpYy5jbi9tbWJpel9wbmcvNXM3SjI4VTlHSFZpY0Q3Z3V2eWJhc2U4NkhoSEMxMm9PRGJ0cnNnSzdDeHJqNVFwTDZnS255aWJlWkR3RUtJVktVT3RQb0hjeHBmd2EwcG9uWjFpYTVubEEvMD93eF9mbXQ9cG5nIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment