Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@追更周历@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6L+95pu05ZGo5Y6GIiwiYXV0aG9yIjoi6ZqP6aOOIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjIiwidmVyc2lvbiI6MjAyNDA0MTcsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoiYWxsIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG4kLnJlcXVpcmUoXCJob21lXCIpLkhvbWUoKTsiLCJzZWFyY2hfdXJsIjoiIiwiZ3JvdXAiOiLikablqLHkuZAiLCJzZWFyY2hGaW5kIjoiIiwiZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsImRldGFpbF9maW5kX3J1bGUiOiIiLCJzZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsInNkZXRhaWxfZmluZF9ydWxlIjoiIiwidWEiOiJtb2JpbGUiLCJwcmVSdWxlIjoibGV0IGRhdGV0aW1lID0gJC5yZXF1aXJlKFwiemhvdVwiKS55bWRobSgpLnNwbGl0KFwiI1wiKVswXTtcbmxldCBsaXN0MTtcbmxldCBsaXN0MjtcbnRyeSB7XG4gICAgbGlzdDEgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvemh1aS5qcycpKTtcbn0gY2F0Y2ggKGUpIHtcbiAgICBsaXN0MSA9IG51bGw7XG59O1xudHJ5IHtcbiAgICBsaXN0MiA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZX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ogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICBpbWc6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvMjc3LnBuZ1xcXCIsXFxuICAgICAgICB1cmw6ICQoeGlhbywgMSwgXFxcIuWIh+aNouexu+Wei1xcXCIpLnNlbGVjdCgoempneCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBsZXhpID0gZ2V0TXlWYXIoXFxcImxlaXhpblxcXCIsIFxcXCLov73mm7TlkajljoZcXFwiKTtcXG4gICAgICAgICAgICBpZiAobGV4aSA9PSBcXFwi5ZGo5pu05YiX6KGoXFxcIikge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJ6bGtleVxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgIGlmIChsZXhpID09IFxcXCLov73mm7TlkajljoZcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInpodWlnZW5cXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJ6dWlnZW5cXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcImlkX3pq5pu0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIjxiPlxcXCIgKyBnZXRJdGVtKFxcXCJ6dWlnZW5cXFwiLCBcXFwi5Yqo5ryrXFxcIikuZm9udGNvbG9yKFxcXCIjMTlCODlEXFxcIikgKyBcXFwiPC9iPlxcXFx0XFxcIixcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIGxldCBodG1sID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcInpqaHRtbFxcXCIpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICBsZXQgbGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgempneChsZCwgaHRtbCk7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwiY2xzX3rov5FcXFwiKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKFxcXCJpZF966L+RXFxcIiwgbGQpO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgY2xlYXJNeVZhcignc3dpdGNoJyk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0sIGdldE15VmFyKFxcXCJsZWl4aW5cXFwiLCBcXFwi6L+95pu05ZGo5Y6GXFxcIikgPT0gXFxcIuacgOi/keabtOaWsFxcXCIgPyB6amd4IDogXFxcIlxcXCIpLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogXFxcImlkX3pq5pu0XFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59O1xcblxcbi8v5oyJ5ZGo5o6o5ZCO5pel5pyfXFxuJC5leHBvcnRzLmdldE5leHRTYXR1cmRheSA9IGZ1bmN0aW9uKHpob3UpIHtcXG4gICAgbGV0IHdlZWtNYXAgPSB7XFxuICAgICAgICAn5pelJzogMCxcXG4gICAgICAgICfkuIAnOiAxLFxcbiAgICAgICAgJ+S6jCc6IDIsXFxuICAgICAgICAn5LiJJzogMyxcXG4gICAgICAgICflm5snOiA0LFxcbiAgICAgICAgJ+S6lCc6IDUsXFxuICAgICAgICAn5YWtJzogNlxcbiAgICB9O1xcbiAgICBsZXQgem91cyA9IHpob3Uuc3BsaXQoXFxcIixcXFwiKVswXTtcXG4gICAgbGV0IG51bXMgPSB6b3VzLnNwbGl0KCcnKS5tYXAoZnVuY3Rpb24obikge1xcbiAgICAgICAgcmV0dXJuIHdlZWtNYXBbbl07XFxuICAgIH0pLmpv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XJyW2ldLm5hbWUuc3BsaXQoXFxcIixcXFwiKTtcXG5cXG4gICAgICAgICAgICAvLyDmib7liLDnrKzkuIDkuKrljLnphY3liLDnmoTmlbDlrZdcXG4gICAgICAgICAgICBsZXQgZmlyc3ROdW0gPSAtMTtcXG4gICAgICAgICAgICBmb3IgKGxldCBqID0gMTsgaiA8IG5hbWVQYXJ0cy5sZW5ndGg7IGorKykge1xcbiAgICAgICAgICAgICAgICBpZiAoIWlzTmFOKG5hbWVQYXJ0c1tqXSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZpcnN0TnVtID0gajtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgaWYgKGZpcnN0TnVtICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgIC8vIOajgOafpeaYr+WQpuacieesrOS6jOS4quWMuemFjeWIsOeahOaVsOWtl++8jOiLpeayoeacieWImei3s+i/h+avlOi+g+mDqOWIhlxcbiAgICAgICAgICAgICAgICBsZXQgc2Vjb25kTnVtID0gLTE7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGsgPSBmaXJzdE51bSArIDE7IGsgPCBuYW1lUGFydHMubGVuZ3RoOyBrKyspIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICghaXNOYU4obmFtZVBhcnRzW2tdKSAmJiBrICE9IGZpcnN0TnVtKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kTnVtID0gaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHBhcnNlSW50KG5hbWVQYXJ0c1tmaXJzdE51bV0pID49IHBhcnNlSW50KG5hbWVQYXJ0c1tzZWNvbmROdW1dKSkgJiYgc2Vjb25kTnVtICE9PSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgbGV0IG51bSA9IHBhcnNlSW50KG5hbWVQYXJ0c1tmaXJzdE51bV0pO1xcbiAgICAgICAgICAgICAgICAvLyDliKTmlq3mmK/lkKbotoXov4flkI7pnaLmib7liLDnmoTmlbDlrZdcXG4gICAgICAgICAgICAgICAgaWYgKChudW0gKyBwYXJzZUludChEYXlzKSAqIHBhcnNlSW50KGdqcykgPj0gcGFyc2VJbnQobmFtZVBhcnRzW3NlY29uZE51bV0pKSAmJiBzZWNvbmROdW0gIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIG51bSA9IHBhcnNlSW50KG5hbWVQYXJ0c1tzZWNvbmROdW1dKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIG51bSArPSBwYXJzZUludChEYXlzKSAqIHBhcnNlSW50KGdqcyk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIG5hbWVQYXJ0c1tmaXJzdE51bV0gPSBudW0udG9TdHJpbmcoKTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGFycltpXS5uYW1lID0gbmFtZVBhcnRzLmpvaW4oXFxcIixcXFwiKTtcXG4gICAgICAgICAgICBhcnJbaV0ucmlxaSA9IHltZGF5O1xcbiAgICAgICAgfTtcXG4gICAgfTtcXG4gICAgc2F2ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvWkdaTC8nICsgZ2VuICsgJy5qcycsIEpTT04uc3RyaW5naWZ5KGFycikpO1xcbiAgICAvL3NldEl0ZW0oZ2VuZyA9PSBcXFwi5ZGo5pu0XFxcIiA/IERheSA6IFxcXCIxXFxcIiwgeW1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JlcXVlc3QoJ2h0dHBzOi8vbS5kb3ViYW4uY29tL3NlYXJjaC8/cXVlcnk9JyArIGVuY29kZVVSSUNvbXBvbmVudChOYW1lLnNwbGl0KFxcXCIsXFxcIilbMF0pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBwZGZhKHVybCwgXFxcIi5zZWFyY2gtcmVzdWx0cyYmaW1nXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwaWMgPSBwZGZoKGxpc3RbMF0sIFxcXCJpbWcmJnNyY1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtWydpbWcnXSA9IHBpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpdGVtWyd3ZWVrJ10uc3BsaXQoXFxcIixcXFwiKVswXSA9PSB6aG91LnNwbGl0KFxcXCIsXFxcIilbMF0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpdGVtWydyaXFpJ10gPSBTYXR1cmRheTtcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKGNvbkFycmF5KVxcbiAgICAgICAgICAgICAgICBsZXQgZ2VuID0gZ2VuZyA9PSBcXFwi5ZGo5pu0XFxcIiA/IFxcXCJ6aHVpXFxcIiA6IFxcXCJyaVxcXCI7XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvJyArIGdlbiArICcuanMnLCBKU09OLnN0cmluZ2lmeShjb25BcnJheSkpO1xcblxcbiAgICAgICAgICAgICAgICAvL3NldEl0ZW0oemhvdS5zcGxpdChcXFwiLFxcXCIpWzBdLCBTYXR1cmRheSk7XFxuICAg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lbSgnYWRkJylcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc3dpdGNoJywgJ+WFsycpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGFkZEFycmF5ID0gW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5qih5byP5p+l5om+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNhID0gZ2V0SXRlbShcXFwiQ2hhXFxcIiwgXFxcIuWFs+mXrVxcXCIpID09IFxcXCLlhbPpl61cXFwiID8gXFxcIuW8gOWQr1xcXCIgOiBcXFwi5YWz6ZetXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbW8gPSBnZXRJdGVtKFxcXCJ4Z2drXFxcIiwgXFxcIuingueci1xcXCIpID09IFxcXCLop4LnnItcXFwiID8gXFxcIuS/ruaUuVxcXCIgOiBcXFwi6KeC55yLXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbY2EgKyBcXFwi5p+l5om+XFxcIiwgbW8gKyBcXFwi5qih5byPXFxcIl0sIDEpLnNlbGVjdCgoY2EpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IGNhICsgXFxcIuafpeaJvlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcIkNoYVxcXCIsIGdldEl0ZW0oXFxcIkNoYVxcXCIsIFxcXCLlhbPpl61cXFwiKSA9PSBcXFwi5byA5ZCvXFxcIiA/IFxcXCLlhbPpl61cXFwiIDogXFxcIuW8gOWQr1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3slxcXCIgKyBnZXRJdGVtKFxcXCJDaGFcXFwiLCBcXFwi5YWz6ZetXFxcIikgKyBcXFwi5p+l5om+XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInhnZ2tcXFwiLCBnZXRJdGVtKFxcXCJ4Z2drXFxcIiwgXFxcIuingueci1xcXCIpID09IFxcXCLkv67mlLlcXFwiID8gXFxcIuingueci1xcXCIgOiBcXFwi5L+u5pS5XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5YiH5o2i5Li6XFxcIiArIGdldEl0ZW0oXFxcInhnZ2tcXFwiLCBcXFwi6KeC55yLXFxcIikgKyBcXFwi5qih5byPXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBjYSk7XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdhZGQnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5Lqr5ZGo5pu0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLmjInlkajliIbkuqtcXFwiLCBcXFwi5YiG5Lqr5YWo6YOoXFxcIl0sIDEpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5oyJ5ZGo5YiG5LqrXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLovpPlhaXopoHliIbkuqvnmoTlkajvvIzpnIDovpPlhaXmsYnlrZdcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9eW+aXpeS4gOS6jOS4ieWbm+S6lOWFrV0kLy50ZXN0KGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ovpPlhaXkuIDliLDml6VcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLlrozmlbTnvJbnoIFcXFwiXS5jb25jYXQoZ2V0UGFzdGVzKCkpLCAyKS5zZWxlY3QoKHdlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9aR1pML3podWkuanMnKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb3VudCA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3ZWsgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgbGkgb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpLndlZWsuc3BsaXQoXFxcIixcXFwiKVswXSA9PSB3ZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdlay5wdXNoKGxpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm8gPSBjb3VudDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlc2I2NCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeSh3ZWspKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdldFBhc3MgPSAobmFtZSwgcnVsZSwgdHlwZSkgPT4gXFxcIua1t+mYlOinhueVjO+8jOOAjOWRqFxcXCIgKyB3ZSArIFxcXCIt5YWxXFxcIiArIG5hbWUgKyBcXFwi5p2h44CN6L+95pu05ZGo5Y6G5YiG5Lqr77yM5aSN5Yi25pW05p2h5Y+j5Luk6Ieq5Yqo5a+85YWlJFxcXCIgKyBydWxlICsgXFxcIiRcXFwiICsgdHlwZSArIFxcXCIk5ZGo5pu0XFxcIiArIFxcXCJAaW1wb3J0PWpzOiQucmVxdWlyZSgnaW1wb3J0P3J1bGU9JytcXFwiICsgSlNPTi5zdHJpbmdpZnkoTVlfUlVMRS50aXRsZSkgKyBcXFwiKShpbnB1dClcXFwiO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWujOaVtOe8lueggVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyBnZXRQYXNzKG5vLCByZXNiNjQsIFxcXCJhXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2hhcmUgPSBzaGFyZVBhc3RlKHJlc2I2NCwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIGdldFBhc3Mobm8sIGJhc2U2NEVuY29kZShzaGFyZSksIFxcXCJiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChbXFxcIuWujOaVtOe8lueggVxcXCJdLmNvbmNhdChnZXRQYXN0ZXMoKSksIDIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvemh1aS5qcycpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm8gPSBsaXN0Lmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzYjY0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2V0UGFzcyA9IChuYW1lLCBydWxlLCB0eXBlKSA9PiBcXFwi5rW36ZiU6KeG55WM77yM44CM5ZGo5pu0LeWFsVxcXCIgKyBuYW1lICsgXFxcIuadoeOAjei/veabtOWRqOWOhuWIhuS6q++8jOWkjeWItuaVtOadoeWPo+S7pOiHquWKqOWvvOWFpSRcXFwiICsgcnVsZSArIFxcXCIkXFxcIiArIHR5cGUgKyBcXFwiJOWRqOabtFxcXCIgKyBcXFwiQGltcG9ydD1qczokLnJlcXVpcmUoJ2ltcG9ydD9ydWxlPScrXFxcIiArIEpTT04uc3RyaW5naWZ5KE1ZX1JVTEUudGl0bGUpICsgXFxcIikoaW5wdXQpXFxcIjtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWujOaVtOe8lueggVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIGdldFBhc3Mobm8sIHJlc2I2NCwgXFxcImFcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc2hhcmUgPSBzaGFyZVBhc3RlKHJlc2I2NCwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgZ2V0UGFzcyhubywgYmFzZTY0RW5jb2RlKHNoYXJlKSwgXFxcImJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdhZGQnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5Lqr5pel5pu0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLlrozmlbTnvJbnoIFcXFwiXS5jb25jYXQoZ2V0UGFzdGVzKCkpLCAyKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvWkdaTC9yaS5qcycpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vID0gbGlzdC5sZW5ndGg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXNiNjQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkobGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2V0UGFzcyA9IChuYW1lLCBydWxlLCB0eXBlKSA9PiBcXFwi5rW36ZiU6KeG55WM77yM44CM5pel5pu0LeWFsVxcXCIgKyBuYW1lICsgXFxcIuadoeOAjei/veabtOWRqOWOhuWIhuS6q++8jOWkjeWItuaVtOadoeWPo+S7pOiHquWKqOWvvOWFpSRcXFwiICsgcnVsZSArIFxcXCIkXFxcIiArIHR5cGUgKyBcXFwiJOaXpeabtFxcXCIgKyBcXFwiQGltcG9ydD1qczokLnJlcXVpcmUoJ2ltcG9ydD9ydWxlPScrXFxcIiArIEpTT04uc3RyaW5naWZ5KE1ZX1JVTEUudGl0bGUpICsgXFxcIikoaW5wdXQpXFxcIjtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLlrozmlbTnvJbnoIFcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgZ2V0UGFzcyhubywgcmVzYjY0LCBcXFwiYVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNoYXJlID0gc2hhcmVQYXN0ZShyZXNiNjQsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyBnZXRQYXNzKG5vLCBiYXNlNjRFbmNvZGUoc2hhcmUpLCBcXFwiYlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdhZGQnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLnpLrkvovvvJrmsqflhYPlm74sMjQsMjZcXFxcblxcXFxu56S65L6L6K+05piO77yaXFxcXG7lvbHop4blkI3vvIzmm7TmlrDoh7MyNOmbhu+8jOWFsTI26ZuG44CCXFxcXG7mgLvpm4bmlbDlj6/kuI3lhpnvvIzpm4bmlbDlv4XpobvkuLrmlbDlrZfjgIJcXFxcbumXtOmalOespuWPtyAsIOeUqOiLseaWh+espuWPt+OAglxcXFxu5aSa5p2h5Y+v5o2i6KGM77yM5LiA5p2h5LiA6KGM44CCXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAtMSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2hpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCduYW1lYXknLGlucHV0KVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdhZGQnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGdlbmcgPT0gXFxcIuWRqOabtFxcXCIgPyAoXFxcIuekuuS+i++8mlxcXCIgKyBnZXRNeVZhcihcXFwibGlcXFwiLCBEYXkpICsgXFxcIiwxLDEwXFxcXG5cXFxcbuekuuS+i+ivtOaYju+8mlxcXFxu5ZGoXFxcIiArIGdldE15VmFyKFxcXCJsaVxcXCIsIERheSkgKyBcXFwi5pu05paw77yM5q+P5ZGo5pu05pawMembhu+8jDEwOjAw5pu05paw44CCXFxcXG7lpoLkuI3lhpnvvIzpu5jorqTkuLrlvZPliY3lkajvvIzmm7TmlrAx6ZuG77yMMTA6MDDmm7TmlrDjgIJcXFxcbjA45Li6ODowMO+8jDEw5Li6MTA6MDDvvIwwODMw5Li6ODozMOOAglxcXFxu5oyJ54Wn56S65L6L5qC85byP5YaZ5YWl44CCXFxcXG7lpJrmnaHpnIDkuI7kuIrmoYbnm7jlr7nlupTjgIJcXFwiKSA6IChcXFwi56S65L6L77yaMSwxMFxcXFxuXFxcXG7npLrkvovor7TmmI7vvJpcXFxcbuabtOaWsDHpm4bvvIwxMDowMOabtOaWsOOAglxcXFxu6buY6K6k5Li65pu05pawMembhu+8jDEwOjAw5pu05paw44CCXFxcXG4wOOS4ujg6MDDvvIwxMOS4ujEwOjAw77yMMDgzMOS4ujg6MzDjgIJcXFxcbuaMieeFp+ekuuS+i+agvOW8j+WGmeWFpeOAglxcXFxu5aSa5p2h6ZyA5LiO5LiK5qGG55u45a+55bqU44CCXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiAndGV4dGFyZWEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodDogLTEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9oaWdobGlnaHQ6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcigndXJsYXknLGlucHV0KVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdhZGQnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLliKDpmaTlkajmm7RcXFwiLCBcXFwi5Yig6Zmk5pel5pu0XFxcIl0sIDEpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHNoYW4oZ2VuZykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWIoOmZpOWFqOmDqFxcXCIgKyBnZW5nICsgXFxcIiDvvJ9cXFwiKS5jb25maXJtKChnZW5nKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGdlbiA9IGdlbmcgPT0gXFxcIuWRqOabtFxcXCIgPyBcXFwiemh1aVxcXCIgOiBcXFwicmlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvWkdaTC8nICsgZ2VuICsgJy5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwiYWRkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwic3dpdGNoXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7LliKDpmaRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZ2VuZylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliKDpmaTlkajmm7RcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2hhbihcXFwi5ZGo5pu0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2hhbihcXFwi5pel5pu0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6ICdhZGQnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5L+d5a2YXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoRGF5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZUFycmF5ID0gZ2V0TXlWYXIoJ25hbWVheScpLnNwbGl0KC9cXFxcclxcXFxufFxcXFxufFxcXFxyLyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsQXJyYXkgPSBnZXRNeVZhcigndXJsYXknKS5zcGxpdCgvXFxcXHJcXFxcbnxcXFxcbnxcXFxcci8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFMZW5ndGggPSBuYW1lQXJyYXkubGVuZ3RoID4gdXJsQXJyYXkubGVuZ3RoID8gbmFtZUFycmF5Lmxlbmd0aCA6IHVybEFycmF5Lmxlbmd0aDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2RhdGFMZW5ndGggPSBuYW1lQXJyYXkubGVuZ3RoO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBnZW5nID0gZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZ2VuID0gZ2VuZyA9PSBcXFwi5ZGo5pu0XFxcIiA/IFxcXCJ6aHVpXFxcIiA6IFxcXCJyaVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0RmlsZSA9IHJlYWRGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvJyArIGdlbiArICcuanMnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKCdjb25maWdBcnJheSA9JyArIHNldEZpbGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZGF0YUxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5hbWUgPSBpID4gbmFtZUFycmF5Lmxlbmd0aCAtIDEgPyAn56m65a2X56ymJyA6IChuYW1lQXJyYXlbaV0gPT0gJycgPyAn56m65a2X56ymJyA6IG5hbWVBcnJheVtpXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHpob3UgPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gKGkgPiB1cmxBcnJheS5sZW5ndGggLSAxID8gZ2V0TXlWYXIoXFxcImxpXFxcIiwgRGF5KSArIFxcXCIsMSwxMFxcXCIgOiAodXJsQXJyYXlbaV0gPT0gJycgPyBnZXRNeVZhcihcXFwibGlcXFwiLCBEYXkpICsgXFxcIiwxLDEwXFxcIiA6IC8sKFxcXFxkKSwoXFxcXGQrKS8udGVzdCh1cmxBcnJheVtpXSkgPyB1cmxBcnJheVtpXSA6IC8sKFxcXFxkKS8udGVzdCh1cmxBcnJheVtpXSkgPyB1cmxBcnJheVtpXSArIFxcXCIsMTBcXFwiIDogdXJsQXJyYXlbaV0gKyBcXFwiLDEsMTBcXFwiKSkgOiAoaSA+IHVybEFycmF5Lmxlbmd0aCAtIDEgPyBcXFwiMSwxLDEwXFxcIiA6ICh1cmxBcnJheVtpXSA9PSAnJyA/IFxcXCIxLDEsMTBcXFwiIDogLyhcXFxcZCksKFxcXFxkKykvLnRlc3QodXJsQXJyYXlbaV0pID8gXFxcIjEsXFxcIiArIHVybEFycmF5W2ldIDogLyhcXFxcZCkvLnRlc3QodXJsQXJyYXlbaV0pID8gXFxcIjEsXFxcIiArIHVybEFycmF5W2ldICsgXFxcIiwxMFxcXCIgOiBcXFwiMSxcXFwiICsgdXJsQXJyYXlbaV0pKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gYWRkKGNvbmZpZ0FycmF5LCBOYW1lLCB6aG91LCBnZW5nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maWdBcnJheS51bnNoaWZ0KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IE5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIndlZWtcXFwiOiB6aG91LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ5dXJsXFxcIjogXFxcImVtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiZ29uZ1xcXCIpLmFkZGl0aW9uKE5hbWUsIHpob3UsIGNvbmZpZ0FycmF5LCBnZW5nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFJlZ0V4cChOYW1lLnNwbGl0KFxcXCIsXFxcIilbMF0pLnRlc3QoSlNPTi5zdHJpbmdpZnkoY29uZmlnQXJyYXkpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuajgOa1i+WIsOW3suacieebuOWQjOeJh+WQje+8jOaYr+WQpuabv+aNou+8n1xcXCIpLmNvbmZpcm0oKGFkZCwgY29uZmlnQXJyYXksIE5hbWUsIHpob3UsIGdlbmcpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGQoY29uZmlnQXJyYXksIE5hbWUsIHpob3UsIGdlbmcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2E7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBhZGQsIGNvbmZpZ0FycmF5LCBOYW1lLCB6aG91LCBnZW5nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkKGNvbmZpZ0FycmF5LCBOYW1lLCB6aG91LCBnZW5nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0b2E7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIH0sIERheSksXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiAnYWRkJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoJ2FkZEZ1bmN0aW9uJywgYWRkQXJyYXkpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignc3dpdGNoJywgJ+W8gCcpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1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GFua19ibG9ja1xcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBcXFwiaWRfemR5emdcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcbiAgICBpZiAoIVJlZ0V4cChnZXRNeVZhcihcXFwibGlcXFwiLCBEYXkpKS50ZXN0KEpTT04uc3RyaW5naWZ5KGxpc3QpKSAmJiBnZW5nID09IFxcXCLlkajmm7RcXFwiIHx8IGxpc3QubGVuZ3RoID09IDAgJiYgZ2VuZyA9PSBcXFwi5pel5pu0XFxcIikge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIjxicj5cXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIGRlc2M6IGdlbmcgPT0gXFxcIuWRqOabtFxcXCIgPyBcXFwi5ZGoXFxcIiArIGdldE15VmFyKFxcXCJsaVxcXCIsIERheSkgKyBcXFwi6L+Y5rKh5pyJ5oOz6L+955qE5YmnXFxcIiA6IFxcXCLov5jmsqHmnInmg7Pov73nmoTliadcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2xzOiBcXFwiY2xzX3pkeXpnXFxcIixcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH07XFxuICAgIGxldCBqc29uID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9oaXN0b3J5XFxcIikpO1xcbiAgICB0cnkge1xcbiAgICAgICAgZm9yIChsZXQgaSBpbiBsaXN0KSB7XFxuICAgICAgICAgICAg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nNwbGl0KFxcXCIsXFxcIilbMl07XFxuICAgICAgICAgICAgICAgIGxldCBkZXMgPSAvXihcXFxcZCspJC8udGVzdCh0aXQzKTtcXG4gICAgICAgICAgICAgICAgbGV0IGRlZXMgPSAkLnJlcXVpcmUoXFxcImd1YW5cXFwiKS5IaXN0b3J5KGpzb24sIHRpdDEpO1xcbiAgICAgICAgICAgICAgICBsZXQgbmV3QXJyID0gbGlzdC5tYXAoZnVuY3Rpb24oaXRlbSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW1bJ25hbWUnXSA9PSB0aXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXRlbVsnenVqaSddICE9IGRlZXMgJiYgZGVlcyAhPSBcXFwi5peg6K6w5b2VXFxcIiB8fCBpdGVtWyd6dWppJ10gPT0gXFxcIuaXoOiusOW9lVxcXCIgfHwgIWl0ZW1bJ3p1amknXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtWyd6dWppJ10gPSBkZWVzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXRlbTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvJyArIGdlbiArICcuanMnLCBKU09OLnN0cmluZ2lmeShuZXdBcnIpKTtcXG4gICAgICAgICAgICAgICAgLy9sb2cocGFyc2VJbnQobGkuenVqaSkpXFxuICAgICAgICAgICAgICAgIC8vY29uc29sZS5sb2cobmV3QXJyKTtcXG4gICAgICAgICAgICAgICAgbGV0IFRKID0gZ2VuZyA9PSBcXFwi5ZGo5pu0XFxcIiA/IChkYXRldGltZS5zcGxpdChcXFwiI1xcXCIpWzFdID49IGl0ZW0gJiYgRGF5ID09IHdlayAmJiB0aXQyICE9IHRpdDMpIDogKGRhdGV0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AgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLlsIHpnaJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbWcgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLmo4DmtYvliLDlt7Llr7zlhaXlsIHpnaLvvIzmmK/lkKbmm7TmjaLvvJ9cXFwiKS5jb25maXJtKChpLCB0aXQxLCB0aXQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLkZtc2hlKGksIHRpdDEsIHRpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpLCB0aXQxLCB0aXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLkZtc2hlKGksIHRpdDEsIHRpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLpk77mjqVcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvYWxpKHBhbnx5dW5kcml2ZSl8aHR0cHxoaWtlci8udGVzdCh5dXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuajgOa1i+WIsOW3suWvvOWFpemTvuaOpe+8jOaYr+WQpuabtOaNou+8n1xcXCIpLmNvbmZpcm0oKHRpdCwgeXVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLkxpYW5qaWUodGl0LCB5dXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdCwgeXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5MaWFuamllKHRpdCwgeXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi5YiG5LqrXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5GZW54aWFuZyh0aXQsIHdlayk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLkv67mlLlcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLlhpdWdhaSh0aXQsIHdlayk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliKDpmaRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLlNoYW5jaHUodGl0LCB3ZWspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi56e75YqoXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5ZaWRvbmcodGl0LCB3ZWspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi6Laz6L+5XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5adWppKHRpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmn6XnnItcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB5dXJsID09IFxcXCJlbXB0eVxcXCIgPyAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLlNvdSh0aXQxKSA6IHl1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfSwgaSwgdGl0MSwgdGl0LCBsaS5pbWcsIHl1cmwsIGxpLndlZWssIGxpLnp1amkpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGxpLmltZyAhPSBudWxsID8gXFxcIm1vdmllXzFfdmVydGljYWxfcGljXFxcIiA6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oe30sIHN0b3JhZ2UwLmdldE15VmFyKFxcXCJleHRyYVxcXCIpLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9uZXdXaW5kb3c6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwiY2xzX3pkeXpnXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcImlkX2ZteHpcXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlVGl0bGU6IHRpdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoVGVybXM6IHRpdDEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5Tb3UodGl0MSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdDEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuW8ueW5lVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXQxKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5EYW5nbXUodGl0MSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdDEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWwgemdolxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpLCBrZXksIHRpdCwgaW1nKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW1nICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuajgOa1i+WIsOW3suWvvOWFpeWwgemdou+8jOaYr+WQpuabtOaNou+8n1xcXCIpLmNvbmZpcm0oKGksIGtleSwgdGl0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwieGl1XFxcIikuRm1zaGUoaSwga2V5LCB0aXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGksIGtleSwgdGl0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLkZtc2hlKGksIGtleSwgdGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGksIHRpdDEsIHRpdCwgbGkuaW1nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpk77mjqVcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodGl0LCB5dXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2FsaShwYW58eXVuZHJpdmUpfGh0dHB8aGlrZXIvLnRlc3QoeXVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5qOA5rWL5Yiw5bey5a+85YWl6ZO+5o6l77yM5piv5ZCm5pu05o2i77yfXFxcIikuY29uZmlybSgodGl0LCB5dXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLkxpYW5qaWUodGl0LCB5dXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0aXQsIHl1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5MaWFuamllKHRpdCwgeXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0aXQsIHl1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXQsIHdlaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuRmVueGlhbmcodGl0LCB3ZWspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0aXQsIGxpLndlZWspXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS/ruaUuVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXQsIHdlaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuWGl1Z2FpKHRpdCwgd2VrKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdGl0LCBsaS53ZWVrKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodGl0LCB3ZWspID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInhpdVxcXCIpLlNoYW5jaHUodGl0LCB3ZWspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0aXQsIGxpLndlZWspXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuenu+WKqFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh0aXQsIHdlaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuWWlkb25nKHRpdCwgd2VrKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgdGl0LCBsaS53ZWVrKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLotrPov7lcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodGl0KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5adWppKHRpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfTtcXG4gICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgIH07XFxufTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWRqOWOhuihqFwiLFwicGF0aFwiOlwiemhvdVwiLFwicnVsZVwiOlwiLy8kLmV4cG9ydHMuRGF0ZSA9IG5ldyBEYXRlKCk7XFxuXFxuLy/ml6XmnJ/ml7bpl7RcXG4kLmV4cG9ydHMueW1kaG0gPSBmdW5jdGlvbigpIHtcXG4gICAgY29uc3Q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A9PSBsaWsgPyBcXFwi4oCY4oCY4oCZ4oCZPGI+XFxcIiArIChcXFwi5ZGoXFxcIiArIGxpaykuZm9udGNvbG9yKFxcXCIjRkE3Mjk4XFxcIikgKyBcXFwiPC9iPlxcXCIgOiBnZXRNeVZhcihcXFwibGlcXFwiKSA9PSBsaWsgPyBcXFwi4oCY4oCY4oCZ4oCZPGI+5ZGoXFxcIiArIGxpayArIFxcXCI8L2I+XFxcIiA6IGxpayxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBsZXQgZGF0ZXRpbWUgPSAkLnJlcXVpcmUoXFxcInpob3VcXFwiKS55bWRobSgpO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJhZGRGdW5jdGlvblxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRldGltZS5zcGxpdChcXFwiI1xcXCIpWzFdXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcImxlaXhpblxcXCIsIFxcXCLov73mm7TlkajljoZcXFwiKSA9PSBcXFwi5ZGo5pu05YiX6KGoXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3RzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcIuWRqGxpc3RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsZCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWVrMShsZCwgbGlzdHMsIGRhdGV0aW1lLnNwbGl0KFxcXCIjXFxcIilbMl0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLmnKrliqDovb3lrozmiJDvvIzor7fph43or5VcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyhcXFwiY2xzX+WRqFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKFxcXCJpZF/lkajmlrBcXFwiLCBsZCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICBpZiAoZ2V0TXlWYXIoXFxcImxlaXhpblxcXCIsIFxcXCLov73mm7TlkajljoZcXFwiKSA9PSBcXFwi6L+95pu05ZGo5Y6GXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHpnID0gW107XFxuICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImxpc3RcXFwiKS5jdXN0emcoemcpO1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKFxcXCJjbHNfemR5emdcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihcXFwiaWRfemR5emdcXFwiLCB6Zyk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSwgbGksIGksIHdlZWssIHdlZWsxKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBcXFwiaWRf5ZGo5Y6GXFxcIiArIGlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfTtcXG59O1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6aaW6aG15pWw5o2uXCIsXCJwYXRoXCI6XCJob21lXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMuSG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lxcXCIpLnJlcGxhY2UoL+aIkeeahOaUtuiXj3zop4LnnIvorrDlvZUvLCBcXFwi5pS26JeP6K6w5b2VXFxcIikucmVwbGFjZSgv5ZGo5pu05YiX6KGofOacgOi/keabtOaWsC8sIFxcXCLmnIDov5Hlkajmm7RcXFwiKSA9PSBsaSA/IFxcXCLigJjigJjigJnigJk8Yj5cXFwiICsgKGxpLnJlcGxhY2UoL+aUtuiXj+iusOW9lS8sIGdldE15VmFyKFxcXCJsZWl4aW5cXFwiKSkucmVwbGFjZSgv5pyA6L+R5ZGo5pu0LywgZ2V0TXlWYXIoXFxcImxlaXhpblxcXCIpKSArIFxcXCI8L2I+XFxcIikuZm9udGNvbG9yKFxcXCIjRkE3Mjk4XFxcIikgOiBsaSxcXG4gICAgICAgICAgICBwaWM6IGFwaWkgKyBsZWl0dVt4XSArIFxcXCIucG5nXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fM19maWxsXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGxpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChsaSA9PSBcXFwi5pS26JeP6K6w5b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLmiJHnmoTmlLbol49cXFwiLCBcXFwi6KeC55yL6K6w5b2VXFxcIiwgXFxcIua1t+mYlOaUtuiXj1xcXCIsIFxcXCLmtbfpmJTorrDlvZVcXFwiXSwgMikuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIua1t+mYlOaUtuiXj1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2NvbGxlY3Rpb25cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5rW36ZiU6K6w5b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vaGlzdG9yeVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImxlaXhpblxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlXFxuICAgICAgICAgICAgICAgIGlmIChsaSA9PSBcXFwi5pyA6L+R5ZGo5pu0XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLlkajmm7TliJfooahcXFwiLCBcXFwi5pyA6L+R5pu05pawXFxcIl0sIDEpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImxlaXhpblxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJsZWl4aW5cXFwiLCBsaSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIC8vc2V0SXRlbShcXFwibGVpeGluXFxcIiwgbGkpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdzd2l0Y2gnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LCBsaSlcXG4gICAgICAgIH0pXFxuICAgIH07XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgfSwge1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICB9KTtcXG5cXG4gICAgbGV0IHp1cmwgPSBcXFwiaHR0cDovL3d3dy55YXR1LnR2OjIwODIvemhvdWxpLmFzcFxcXCI7XFxuICAgIGxldCBndXJsID0gXFxcImh0dHA6Ly93d3cueWF0dS50djoyMDgyL3p1aWppbi5hc3BcXFwiO1xcblxcbiAgICBmdW5jdGlvbiBXZWVrKHVybCwgZCkge1xcblxcbiAgICAgICAgLy/lkajmm7TliJfooahcXG4gICAgICAgIGZ1bmN0aW9uIHdlZWsxKGQsIGxpc3RzLCBudW0pIHtcXG4gICAgICAgICAgICBsZXQgbGwgPSBnZXRNeVZhcihcXFwic1xcXCIsIEpTT04uc3RyaW5naWZ5KHBhcnNlSW50KG51bSkgKyAobnVtID09IDAgPyArNiA6IC0xKSkpO1xcbiAgICAgICAgICAgIGxldCBsaXN0ID0gcGRmYShsaXN0c1tsbF0sIFxcXCJib2R5JiZ0cjpndCgxKVxcXCIpO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJpZF/lkajmlrBcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBmb3IgKGxldCBqIGluIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGxpID0gSlNPTi5zdHJpbmdpZnkobGlzdFtqXSkucmVwbGFjZSgvdGQvZywgXFxcInRkX3RkXFxcIik7XFxuICAgIC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IzI3NGM1ZVxcXCIpICsgcmVkdSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChbXFxcIuWKoOWFpeWRqOabtFxcXCIsIFxcXCLliqDlhaXml6Xmm7RcXFwiLCBcXFwi6LCD55So5pCc57SiXFxcIl0sIDEpLnNlbGVjdCgodGl0bGUsIGppc3UpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuiwg+eUqOaQnOe0olxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwieGl1XFxcIikuU291KHRpdGxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWKoOWFpeWRqOabtFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwic2ppYVxcXCIpLkxqaWEodGl0bGUsIGppc3UsIFxcXCLlkajmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIuWKoOWFpeaXpeabtFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwic2ppYVxcXCIpLkxqaWEodGl0bGUsIGppc3UsIFxcXCLml6Xmm7RcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgfSwgdGl0bGUsIGppc3UpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJjbHNf5ZGoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlYXJjaFRlcm1zOiB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIGxldCB6Z3psID0gW1xcXCLliqjmvKtcXFwiLCBcXFwi5Ymn6ZuGXFxcIl07XFxuICAgICAgICBsZXQgempsZWkgPSBnZXRJdGVtKFxcXCJ6bGtleVxcXCIsIFxcXCLliqjmvKtcXFwiKTtcXG4gICAgICAgICQucmVxdWlyZShcXFwiZ29uZ1xcXCIpLlhpYW9sZWkoZCwgemd6bCwgempsZWksIGRhdGV0aW1lLnNwbGl0KFxcXCIjXFxcIilbMF0pO1xcbiAgICAgICAgLy/lkajljobooahcXG4gICAgICAgICQucmVxdWlyZShcXFwiemhvdVxcXCIpLlpob3UoZCwgd2VlazEpO1xcbiAgICAgICAgbGV0IHp1cmwgPSB6amxlaSA9PSBcXFwi5Yqo5ryrXFxcIiA/IHVybCA6IHVybCArIFxcXCI/dHlwZT10dlxcXCI7XFxuXFxuICAgICAgICBsZXQgaHRtbCA9IGZldGNoUEMoenVybCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uOyBjaGFyc2V0PUdCSydcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxldCBsaXN0cyA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJi56bHRhYjpndCgwKVxcXCIpO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcIuWRqGxpc3RcXFwiLCBsaXN0cyk7XFxuICAgICAgICB3ZWVrMShkLCBsaXN0cywgZGF0ZXRpbWUuc3BsaXQoXFxcIiNcXFwiKVsyXSk7XFxuICAgIH07XFxuXFxuICAgIC8v5pyA6L+R5pu05pawXFxuICAgIGZ1bmN0aW9uIHp1aWppbih1cmwsIGQpIHtcXG4gICAgICAgIGZ1bmN0aW9uIHpqZ3goZCwgaHRtbCkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcImlkX3rov5FcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsZXQgemdObyA9IGdldEl0ZW0oXFxcInp1aWdlblxcXCIsIFxcXCLliqjmvKtcXFwiKTtcXG4gICAgICAgICAgICBsZXQgTm8gPSB6Z05vID09IFxcXCLliqjmvKtcXFwiID8gXFxcIjFcXFwiIDogemdObyA9PSBcXFwi55S15b2xXFxcIiA/IFxcXCIyXFxcIiA6IFxcXCIzXFxcIjtcXG4gICAgICAgICAgICBsZXQgbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJiNzaW5cXFwiICsgcGFyc2VJbnQoTm8pICsgXFxcIiYmdHI6Z3QoMClcXFwiKTtcXG5cXG4gICAgICAgICAgICBmb3IgKGxldCBrIGluIGxpc3QpIHtcXG4gICAgICAgICAgICAgICAgbGV0IGxpc3MgPSBKU09OLnN0cmluZ2lmeShsaXN0W2tdKS5yZXBsYWNlKC90ZC9nLCBcXFwidGRfdGRcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGxpcyA9IHBkZmEobGlzcywgXFxcImJvZHkmJnRkX3RkXFxcIik7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbGlzKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGkgPSBsaXNbaV07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGxpLCBcXFwiYSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVwID0gcGRmaChsaSwgXFxcInNwYW4sMSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJpcSA9IHBkZmgobGksIFxcXCJzcGFuLDImJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByaXFzID0gL1xcXFw6Ly50ZXN0KHJpcSkgPyBcXFwi4oCY4oCY4oCZ4oCZXFxcIiArIChcXFwiXFxcXHRcXFxcdFxcXFx05pel5pyfOiBcXFwiICsgcmlxKS5mb250Y29sb3IoXFxcIiMwMGNjOTlcXFwiKSA6IFxcXCJcXFxcdFxcXFx0XFxcXHTml6XmnJ86IFxcXCIgKyByaXE7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaG90ID0gL1xcXFwuZ2lmLy50ZXN0KHBkZmgobGksIFxcXCJpbWcmJnNyY1xcXCIpKSA/IFxcXCLigJjigJjigJnigJlcXFwiICsgKFxcXCI8Yj48c21hbGw+PHNtYWxsPkhPVDwvc21hbGw+PC9zbWFsbD48L2I+XFxcIikuZm9udGNvbG9yKFxcXCIjZmYxMTAwXFxcIikgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgobGksIFxcXCJzcGFuLDAmJlRleHRcXFwiKSArIFxcXCJcXFxcdFxcXFx0XFxcIiArIHRpdGxlICsgXFxcIlxcXFx0XFxcXHRcXFwiICsgaG90LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJjigJjigJnigJlcXFwiICsgKFxcXCLmm7TmlrA6IFxcXCIgKyB1cCkuZm9udGNvbG9yKFxcXCIjNkE1QUNEXFxcIikgKyByaXFzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChbXFxcIuWKoOWFpeWRqOabtFxcXCIsIFxcXCLliqDlhaXml6Xmm7RcXFwiLCBcXFwi6LCD55So5pCc57SiXFxcIl0sIDEpLnNlbGVjdCgodGl0bGUsIGppc3UpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLosIPnlKjmkJzntKJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJ4aXVcXFwiKS5Tb3UodGl0bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliqDlhaXlkajmm7RcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJzamlhXFxcIikuTGppYSh0aXRsZSwgamlzdSwgXFxcIuWRqOabtFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliqDlhaXml6Xmm7RcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJzamlhXFxcIikuTGppYSh0aXRsZSwgamlzdSwgXFxcIuaXpeabtFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRpdGxlLCB1cCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcImNsc1966L+RXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VhcmNoVGVybXM6IHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxldCB6amd4eCA9IFtcXFwi5Yqo5ryrXFxcIiwgXFxcIueUteW9sVxcXCIsIFxcXCLliafpm4ZcXFwiXTtcXG4gICAgICAgIGxldCB6amd4bGVpID0gZ2V0SXRlbShcXFwienVpZ2VuXFxcIiwgXFxcIuWKqOa8q1xcXCIpO1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJnb25nXFxcIikuWGlhb2xlaShkLCB6amd4eCwgempneGxlaSwgZGF0ZXRpbWUuc3BsaXQoXFxcIiNcXFwiKVswXSwgempneCk7XFxuXFxuICAgICAgICBsZXQgaHRtbCA9IGZldGNoUEModXJsLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb247IGNoYXJzZXQ9R0JLJ1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInpqaHRtbFxcXCIsIGh0bWwpO1xcbiAgICAgICAgempneChkLCBodG1sKTtcXG4gICAgfTtcXG5cXG4gICAgaWYgKGdldE15VmFyKFxcXCJsZWl4aW5cXFwiKSA9PSBcXFwi5ZGo5pu05YiX6KGoXFxcIikge1xcbiAgICAgICAgV2Vlayh6dXJsLCBkKTtcXG4gICAgfSBlbHNlXFxuICAgIGlmIChnZXRNeVZhcihcXFwibGVpeGluXFxcIikgPT0gXFxcIuacgOi/keabtOaWsFxcXCIpIHtcXG4gICAgICAgIHp1aWppbihndXJsLCBkKTtcXG4gICAgfSBlbHNlXFxuICAgIGlmIChnZXRNeVZhcihcXFwibGVpeGluXFxcIikgPT0gXFxcIuaIkeeahOaUtuiXj1xcXCIpIHtcXG4gICAgICAgIGxldCBqc29uID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9jb2xsZWN0aW9uXFxcIikpO1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJIaXN0b3J5XFxcIikuQ29sbGVjdGlvbihkLCBqc29uKTtcXG4gICAgfSBlbHNlXFxuICAgIGlmIChnZXRNeVZhcihcXFwibGVpeGluXFxcIikgPT0gXFxcIuingueci+iusOW9lVxcXCIpIHtcXG4gICAgICAgIGxldCBqaW9uID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9oaXN0b3J5XFxcIikpO1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJIaXN0b3J5XFxcIikuQ29sbGVjdGlvbihkLCBqaW9uKTtcXG4gICAgfSBlbHNlXFxuICAgIGlmIChnZXRNeVZhcihcXFwibGVpeGluXFxcIiwgXFxcIui/veabtOWRqOWOhlxcXCIpID09IFxcXCLov73mm7TlkajljoZcXFwiKSB7XFxuICAgICAgICBjbGVhck15VmFyKCdzd2l0Y2gnKTtcXG4gICAgICAgIGlmIChnZXRJdGVtKFxcXCJDaGFcXFwiLCBcXFwi5YWz6ZetXFxcIikgPT0gXFxcIuW8gOWQr1xcXCIpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuafpeaJvlxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLovpMg5YWlIOWFsyDplK4g5a2XIO+8gVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaW5wdXRcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJpbnB1dFxcXCIpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH07XFxuXFxuICAgICAgICBmdW5jdGlvbiBDaGFsaSgpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuafpeaJviBcXFwiICsgZ2V0TXlWYXIoXFxcImlucHV0XFxcIikuZm9udGNvbG9yKFxcXCIjRkE3Mjk4XFxcIikgKyBcXFwiIOe7k+aenFxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLov5Tlm55cXFxcdFxcXFx0XFxcIixcXG4gICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9rZS8yNS5wbmdcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCJpbnB1dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCJcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfTtcXG5cXG4gICAgICAgIGxldCB3ZHpnID0gW1xcXCLlkajmm7RcXFwiLCBcXFwi5pel5pu0XFxcIl07XFxuICAgICAgICBsZXQgemdsZWkgPSBnZXRJdGVtKFxcXCJ6aHVpZ2VuXFxcIiwgXFxcIuWRqOabtFxcXCIpO1xcbiAgICAgICAgJC5yZXF1aXJlKFxcXCJnb25nXFxcIikuWGlhb2xlaShkLCB3ZHpnLCB6Z2xlaSwgZGF0ZXRpbWUuc3BsaXQoXFxcIiNcXFwiKVswXSk7XFxuXFxuICAgICAgICBpZiAoZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKSA9PSBcXFwi5ZGo5pu0XFxcIikge1xcbiAgICAgICAgICAgIGlmICghZ2V0TXlWYXIoXFxcImlucHV0XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJ6aG91XFxcIikuWmhvdShkLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICQucmVxdWlyZShcXFwiamlhXFxcIikuY3VzdChkKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBDaGFsaSgpO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJsaXN0XFxcIikuY3VzdHpnKGQpO1xcbiAgICAgICAgfSBlbHNlXFxuICAgICAgICBpZiAoZ2V0SXRlbShcXFwiemh1aWdlblxcXCIsIFxcXCLlkajmm7RcXFwiKSA9PSBcXFwi5pel5pu0XFxcIikge1xcbi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xcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9zb3Ujbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjP3J1bGU95LqR55uY5ZCbLueugFxcXCI7XFxuICAgICAgICB9IGVsc2VcXG4gICAgICAgIGlmIChpbnB1dCA9PSBcXFwi6aOO5b2xXFxcIikge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZShjb25maWcu5L6d6LWWKTtcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2hvbWVA6aOO5b2xXFxcIikpLnByZVJ1bGUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGl0MSArICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZShjb25maWcu5L6d6LWWKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzb3VybCgpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuacquajgOa1i+WIsOmjjuW9seWwj+eoi+W6j++8jOehruiupOWvvOWFpe+8n1xcXCIpLmNvbmZpcm0oKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlUGFzdGUoXFxcIuS6kTZvb29vbGUveHh4eHh4L2V2dGk5dm1vZWs0YmFqbXRcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgIH0gZWxzZVxcbiAgICAgICAgaWYgKGlucHV0ID09IFxcXCLogZrlvbFcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIgKyB0aXQxICsgXFxcIiZydWxlPeiBmuW9seKImlxcXCI7XFxuICAgICAgICB9IGVsc2VcXG4gICAgICAgIGlmIChpbnB1dCA9PSBcXFwi6IGa6ZiFXFxcIikge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGRlbGV0ZShjb25maWcu5L6d6LWWKTtcXG4gICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2hvbWVA6IGa6ZiF4oiaXFxcIikpLnByZVJ1bGUpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiU3JjSnVfc291c3VvTmFtZVxcXCIsIHRpdDEpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiaGlrZXI6Ly9lbXB0eSNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNmdWxsVGhlbWUjIyNmeXBhZ2VcXFwiKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoY29uZmlnLuS+nei1lik7XFxuICAgICAgICAgICAgICAgICAgICBuZXdzb3VzdW9wYWdlKClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pyq5om+5YiwIOiBmumYhSDlsI/nqIvluo9cXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZVxcbiAgICAgICAgaWYgKGlucHV0ID09IFxcXCLpppnlvbFcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIgKyB0aXQxICsgXFxcIiZydWxlPemmmeaDheW9seinhlxcXCI7XFxuICAgICAgICB9O1xcbiAgICB9LCB0aXQxKTtcXG59O1xcblxcbi8v5by55bmVXFxuJC5leHBvcnRzLkRhbmdtdSA9ICh0aXQxKSA9PiB7XFxuICAgIHJldHVybiBcXFwi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iaiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAvL2NvbnNvbGUubG9nKGFycik7XFxuXFxuICAgICAgICAgICAgaWYgKC9odHRwLy50ZXN0KGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9aR1pMLycgKyBnZW4gKyAnLmpzJywgSlNPTi5zdHJpbmdpZnkoYXJyKSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn++8gVxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCB0aXQpLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBjbHM6IFxcXCJjbHNfZm1zY1xcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGxldCByID0gcmVxdWVzdCgnaHR0cHM6Ly9tLmRvdWJhbi5jb20vc2VhcmNoLz9xdWVyeT0nICsgZW5jb2RlVVJJQ29tcG9uZW50KGtleSkpXFxuICAgIGxldCBsaXN0ID0gcGRmYShyLCBcXFwiLnNlYXJjaC1yZXN1bHRzJiZpbWdcXFwiKTtcXG5cXG4gICAgZm9yIChsZXQgaSBpbiBsaXN0KSB7XFxuICAgICAgICBsZXQgcGljID0gcGRmaChsaXN0W2ldLCBcXFwiaW1nJiZzcmNcXFwiKTtcXG4gICAgICAgIExpc3QucHVzaCh7XFxuICAgICAgICAgICAgcGljOiBwaWMsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwaWMsIHRpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgZ2VuZyA9IGdldEl0ZW0oXFxcInpodWlnZW5cXFwiLCBcXFwi5ZGo5pu0XFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBnZW4gPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcInpodWlcXFwiIDogXFxcInJpXFxcIjtcXG4gICAgICAgICAgICAgICAgZXZhbCgnbGV0IGFyciA9JyArIHJlYWRGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvJyArIGdlbiArICcuanMnKSk7XFxuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0gYXJyW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9iai5uYW1lID09IHRpdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFycltpXSA9IE9iamVjdC5hc3NpZ24oe30sIG9iaiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IHBpY1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAvL2NvbnNvbGUubG9nKGFycik7XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvJyArIGdlbiArICcuanMnLCBKU09OLnN0cmluZ2lmeShhcnIpKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5oiQ5Yqf77yBXFxcIlxcbiAgICAgICAgICAgIH0sIHBpYywgdGl0KSxcXG4gICAgICAgICAgICBj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cGxpdChcXFwiLFxcXCIpWzBdID09IHdlay5zcGxpdChcXFwiLFxcXCIpWzBdKSB7XFxuICAgICAgICAgICAgICAgIGlmIChjb3VudCA9PSBpbnB1dCkge1xcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0SW5kZXggPSBpO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY291bnQrKztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9O1xcbiAgICAgICAgLy8g56Gu5L+d55uu5qCH57Si5byV5Zyo5ZCI55CG6IyD5Zu05YaFXFxuICAgICAgICBpZiAodGFyZ2V0SW5kZXggPj0gMCAmJiB0YXJnZXRJbmRleCA8PSBhcnIubGVuZ3RoKSB7XFxuICAgICAgICAgICAgLy8g5bCG5YWD57Sg5LuO5Y6f5L2N572u5Yig6ZmkXFxuICAgICAgICAgICAgYXJyLnNwbGljZShhcnIuaW5kZXhPZih0YXJnZXQpLCAxKTtcXG5cXG4gICAgICAgICAgICAvLyDlsIblhYPntKDmt7vliqDliLDnm67moIfkvY3nva5cXG4gICAgICAgICAgICBhcnIuc3BsaWNlKHRhcmdldEluZGV4LCAwLCB0YXJnZXQpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBjb25zb2xlLmVycm9yKFxcXCLmib7kuI3liLDnm67moIfntKLlvJXvvIzml6Dms5Xnp7vliqjlhYPntKBcXFwiKTtcXG4gICAgICAgIH07XFxuXFxuICAgICAgICAvLyDkv53lrZjmlofku7ZcXG4gICAgICAgIHNhdmVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvJyArIGdlbiArICcuanMnLCBKU09OLnN0cmluZ2lmeShhcnIpKTtcXG4gICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/np7vliqjoh7MgXFxcIiArIChwYXJzZUludChpbnB1dCkgK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ICAgICAgICAgIHZhbHVlOiAxMDAwLFxcbiAgICAgICAgICAgIHNlY1VuaXQ6IGZhbHNlXFxuICAgICAgICB9LFxcbiAgICAgICAg5LiHOiB7XFxuICAgICAgICAgICAgdmFsdWU6IDEwMDAwLFxcbiAgICAgICAgICAgIHNlY1VuaXQ6IHRydWVcXG4gICAgICAgIH0sXFxuICAgICAgICDkur86IHtcXG4gICAgICAgICAgICB2YWx1ZTogMTAwMDAwMDAwLFxcbiAgICAgICAgICAgIHNlY1VuaXQ6IHRydWVcXG4gICAgICAgIH1cXG4gICAgfTtcXG5cXG4gICAgZnVuY3Rpb24gQ2hpbmVzZVRvTnVtYmVyKGNoblN0cikge1xcbiAgICAgICAgdmFyIHJ0biA9IDA7XFxuICAgICAgICB2YXIgc2VjdGlvbiA9IDA7XFxuICAgICAgICB2YXIgbnVtYmVyID0gMDtcXG4gICAgICAgIHZhciBzZWNVbml0ID0gZmFsc2U7XFxuICAgICAgICB2YXIgc3RyID0gY2huU3RyLnNwbGl0KCcnKTtcXG5cXG4gICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3RyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgdmFyIG51bSA9IGNobk51bUNoYXJbc3RyW2ldXTtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIG51bSAhPT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgbnVtYmVyID0gbnVtO1xcbiAgICAgICAgICAgICAgICBpZiAoaSA9PT0gc3RyLmxlbmd0aCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHNlY3Rpb24gKz0gbnVtYmVyO1xcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB1bml0ID0gY2huTmFtZVZhbHVlW3N0cltpXV0udmFsdWU7XFxuICAgICAgICAgICAgICAgIHNlY1VuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS5zZWNVbml0O1xcblxcbiAgICAgICAgICAgICAgICAvLyDmt7vliqDku6XkuIvku6PnoIHmnaXlpITnkIbljZXkuKrljZXkvY3lrZfnrKbnmoTmg4XlhrVcXG4gICAgICAgICAgICAgICAgaWYgKG51bWJlciA9PT0gMCAmJiAhc2VjVW5pdCkge1xcbiAgICAgICAgICAgICAgICAgICAgc2VjdGlvbiA9IHVuaXQ7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBzZWN0aW9uICs9IChudW1iZXIgKiB1bml0KTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzZWNVbml0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcnRuICs9IHNlY3Rpb247XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2VjdGlvbiA9IDA7XFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICBudW1iZXIgPSAwO1xcbiAgICAgICAgICAgIH07XFxuICAgICAgICB9O1xcbiAgICAgICAgcmV0dXJuIHJ0biArIHNlY3Rpb247XFxuICAgIH07XFxuXFxuICAgIGZ1bmN0aW9uIHN0cihzdHIpIHtcXG4gICAgICAgIHJldHVybiBzdHIucmVwbGFjZSgvW14oXFxcXHU0ZTAwLVxcXFx1OWZhNSl8W2EtekEtWjAtOV0vZywgJycpO1xcbiAgICB9O1xcblxcbiAgICBsZXQgcm5hbWUgPSBSZWdFeHAoc3RyKE5hbWUpKTtcXG4gICAgbGV0IGNsaWNrID0gL+esrChcXFxcRCspKD866K+dfOWbnnzpm4Z85pyffOWNt3znq6ApLztcXG4gICAgdmFyIG1heE51bWJlcnMgPSBbXTtcXG4gICAgdmFyIExpbGFzdCA9IFtdO1xcbiAgICBmb3IgKGxldCBsaSBvZiBqc29uKSB7XFxuICAgICAgICBsZXQgdGl0bGUgPSAhbGkubVRpdGxlID8gbGkudGl0bGUgOiBsaS5tVGl0bGU7XFxuICAgICAgICBpZiAodHlwZW9mIGxpLmxhc3RDbGljayAhPSAndW5kZWZpbmVkJyAmJiAhLyhcXFxcZCspLShcXFxcZCsp6ZuGLy50ZXN0KGxpLmxhc3RDbGljaykpIHtcXG4gICAgICAgICAgICBsZXQgbGlsYXN0ID0gbGkubGFzdENsaWNrLnJlcGxhY2UoL0BALiovLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgaWYgKHJuYW1lLnRlc3Qoc3RyKHRpdGxlKSkgfHwgcm5hbWUudGVzdChzdHIobGlsYXN0KSkpIHtcXG4gICAgICAgICAgICAgICAgLy9sb2cobGlsYXN0KTtcXG4gICAgICAgICAgICAgICAgTGlsYXN0LnB1c2gobGlsYXN0KTtcXG4gICAgICAgICAgICAgICAgbGV0IG51bWJlcnM7XFxuICAgICAgICAgICAgICAgIGlmIChjbGljay50ZXN0KGxpbGFzdCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsYXN0ID0gbGlsYXN0Lm1hdGNoKGNsaWNrKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICghL+WNgXznmb585Y2DfOS4hy8udGVzdChsYXN0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSAwO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGFzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGlnaXQgPSBjaG5OdW1DaGFyW2xhc3RbaV1dO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlnaXQgIT09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gcmVzdWx0ICogMTAgKyBkaWdpdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bWJlcnMgPSBbU3RyaW5nKHJlc3VsdCldO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBudW1iZXJzID0gW1N0cmluZyhDaGluZXNlVG9OdW1iZXIobGFzdCkpXTtcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgamk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL1NFXFxcXGQrXFxcXC5cXFxcZCsvLnRlc3QobGlsYXN0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGppID0gbGlsYXN0Lm1hdGNoKC9TRVxcXFxkK1xcXFwuKFxcXFxkKykvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvU1xcXFxkK0VcXFxcZCsvLnRlc3QobGlsYXN0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGppID0gbGlsYXN0Lm1hdGNoKC9TXFxcXGQrRShcXFxcZCspLylbMV07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGppID0gbGlsYXN0Lm1hdGNoKC9cXFxcWyg/IVxcXFxkezR9fFxcXFxEfFxcXFxkK1thLXpBLVpdK1xcXFxkKilcXFxcZCtcXFxcXXwoPzp8XylcXFxcZCsoPz1ffFxcXFwufC0pfD7nrKw/KFxcXFxkKylbXFxcXHU0ZTAwLVxcXFx1OWZhNV0qPzx8KFxcXFxkKylcXFxcLlxcXFx3K3woXFxcXGQrKSg/Oumbhnzor5185ZuefOacn3zljbd856ugKXxeKD8hXFxcXGQrLVxcXFxkKylcXFxcRCpcXFxcZCtcXFxccyt8XihcXFxcZCspJHxcXFxccyhcXFxcZCspXFxcXHMvKTtcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAg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HtcXG4gICAgICAgICAgICAgICAgYXJyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIndlZWtcXFwiOiB3ZWVrLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImltZ1xcXCI6IHBpYyxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ5dXJsXFxcIjogcHVybFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoXFxcImdvbmdcXFwiKS5hZGRpdGlvbihuYW1lLCB3ZWVrLCBhcnIsIGdlbmcpO1xcbiAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgbGV0IGdlbiA9IGdlbmcgPT0gXFxcIuWRqOabtFxcXCIgPyBcXFwiemh1aVxcXCIgOiBcXFwicmlcXFwiO1xcbiAgICAgICAgICAgIGlmICghZmlsZUV4aXN0KCdoaWtlcjovL2ZpbGVzL3J1bGVzL1pHWkwvJyArIGdlbiArICcuanMnKSkge1xcbiAgICAgICAgICAgICAgICBjb25maWdBcnJheSA9IFtdO1xcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9aR1pMLycgKyBnZW4gKyAnLmpzJywgSlNPTi5zdHJpbmdpZnkoY29uZmlnQXJyYXkpKTtcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGV2YWwoJ2xldCBhcnIgPScgKyByZWFkRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9aR1pMLycgKyBnZW4gKyAnLmpzJykpO1xcbiAgICAgICAgICAgIGlmIChSZWdFeHAobmFtZS5zcGxpdChcXFwiLFxcXCIpWzBdKS50ZXN0KEpTT04uc3RyaW5naWZ5KGFycikpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLmo4DmtYvliLDlt7LmnInnm7jlkIzniYflkI3vvIzmmK/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gPyBnZXRNeVZhcihcXFwibGlcXFwiLCAkLnJlcXVpcmUoXFxcInpob3VcXFwiKS5XZWVrRGF5KCkpICsgXFxcIixcXFwiIDogXFxcIlxcXCIpICsgXFxcIjFcXFwiICsgXFxcIiwxMFxcXCI7XFxuICAgIHJldHVybiAkKGlucHUpLmlucHV0KChnZW5nKSA9PiB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBuYW1lID0gaW5wdXQuc3BsaXQoXFxcIlxcXFxuXFxcIilbMF07XFxuICAgICAgICAgICAgbGV0IHdlZWsgPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gaW5wdXQuc3BsaXQoXFxcIlxcXFxuXFxcIilbMV0gOiBcXFwiMSxcXFwiICsgaW5wdXQuc3BsaXQoXFxcIlxcXFxuXFxcIilbMV07XFxuXFxuICAgICAgICAgICAgZnVuY3Rpb24gYWRkKGFyciwgbmFtZSwgd2VlaywgZ2VuZykge1xcbiAgICAgICAgICAgICAgICBhcnIudW5zaGlmdCh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwid2Vla1xcXCI6IHdlZWssXFxuICAgICAgICAgICAgICAgICAgICBcXFwieXVybFxcXCI6IFxcXCJlbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJnb25nXFxcIikuYWRkaXRpb24obmFtZSwgd2VlaywgYXJyLCBnZW5nKTtcXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIGxldCBnZW4gPSBnZW5nID09IFxcXCLlkajmm7RcXFwiID8gXFxcInpodWlcXFwiIDogXFxcInJpXFxcIjtcXG4gICAgICAgICAgICBpZiAoIWZpbGVFeGlzdCgnaGlrZXI6Ly9maWxlcy9ydWxlcy9aR1pMLycgKyBnZW4gKyAnLmpzJykpIHtcXG4gICAgICAgICAgICAgICAgY29uZmln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