Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@番·仓@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxudmFyIGNocCA9IFtdO1xudHJ5IHtcbiAgICB2YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcbiAgICB2YXIgY29udHMgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiYuc29ydC1pdGVtJyk7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoY29udHNbaV0sICdib2R5JiZhJyk7XG4gICAgICAgIGNocC5wdXNoKGxpc3QubGVuZ3RoKTtcbiAgICB9ICAgICBcbn0gY2F0Y2ggKGUpIHt9XG5zZXRSZXN1bHQoJ+abtOaWsOiHszonICsgKE1hdGgubWF4LmFwcGx5KG51bGwsIGNocCkpKTsiLCJ0aXRsZSI6IueVqsK35LuTIiwiYXV0aG9yIjoiUiIsInVybCI6Imhpa2VyOi8vZW1wdHkjIy9mb3J1bS0xLmh0bSMjZnlwYWdlIiwidmVyc2lvbiI6MjAyMzExMDgsImNvbF90eXBlIjoibW92aWVfMiIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoiYWxsIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZCA9IFtdO1xuZXZhbChKU09OLnBhcnNlKHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9yZXBhaXInKSkucnVsZSk7XG5hZGRMaXN0ZW5lcihcIm9uQ2xvc2VcIiwgJC50b1N0cmluZygoKSA9PiB7XG4gICAgbGV0IGtleXMgPSBsaXN0TXlWYXJLZXlzKC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3RoLCBuYW1lcy5sZW5ndGgpOyBqKyspIHtcbmlmKGFycltqXT09J+i3s+mhtScpe1xuICAgICAgICAgICAgIGQucHVzaCh7XHJcbiAgICAgICAgICAgIHRpdGxlOm5vdyA9PW5hbWVzW2pdPyAn4oCc4oCc4oCd4oCdJyArIG5hbWVzW2pdLmZvbnRjb2xvcigncmVkJykgOiBuYW1lc1tqXSxcclxuICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxyXG4gICAgICAgICAgICB1cmw6ICQoMjMsICfor7fovpPlhaXopoHot7PovazliLDnmoTpobXmlbAnKS5pbnB1dCgodHJ1ZV91cmwsayxuYW1lcyxqKSA9PiB7XHJcbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4ocGFyc2VJbnQoaW5wdXQpKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ovpPlhaXmnInor68s6K+36L6T5YWl5LiA5LiqMX4nICsgayArICfnmoTmlbDlrZcnXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBsZXQgdG9QYWdlID0gcGFyc2VJbnQoaW5wdXQpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHRvUGFnZSA8IDEgfHwgdG9QYWdlID4gaykge1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ovpPlhaXmnInor68s6K+36L6T5YWl5LiA5LiqMX4nICsgayArICfnmoTmlbDlrZcnXHJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgaWYoL2ZvcnVtXFwtXFxkK1xcLVxcZCsvLnRlc3QodHJ1ZV91cmwpKXtcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXGQrXFwuaHRtLywgdG9QYWdlICsgJy5odG0nKTtcbiAgICAgICAgICAgICAgfWVsc2V7XG52YXIgdXJsID0gdHJ1ZV91cmwucmVwbGFjZSgvXFwuaHRtLywgJy0nICsgdG9QYWdlICsgJy5odG0nKTtcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcIm5vd1wiLCBuYW1lc1tqXSk7XG4gICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCB1cmwpO1xuICAgICAgICAgICAgICAgIHB1dE15VmFyKCd5aV9maXJzdHBhZ2UnLCB1cmwpO1xuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i3s+i2iuWIsOS6huesrCcgKyB0b1BhZ2UgKyAn6aG1J1xyXG4gICAgICAgICAgICB9LHRydWVfdXJsLCBrLG5hbWVzLGopLFxyXG4gICAgICAgIH0pO1xuXG59ZWxzZXtcblxuaWYoYXJyW2pdPT0n6ZqP5py6Jyl7XG4gICAgICAgICAgICAgIGFycltqXSA9IE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIGspICsxICAgXG59ZWxzZSBpZihhcnJbal09PSflsL7pobUnK2spe1xuICAgICAgICAgICAgICBhcnJbal0gPSBrXG59ZWxzZSBpZihhcnJbal09PTEpe1xuICAgICAgICAgICAgICBuYW1lc1tqXSA9IFwi6aaW6aG1XCJcbn1lbHNlIGlmKGFycltqXT09J+i3s+mhtScpe1xuICAgICAgICAgICAgIGFycltqXSA9IDIyM1xufVxuXG4gICAgICAgICAgaWYoL2ZvcnVtXFwtXFxkK1xcLVxcZCsvLnRlc3QodHJ1ZV91cmwpKXtcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXGQrXFwuaHRtLywgYXJyW2pdICsgJy5odG0nKTtcbiAgICAgICAgICAgICAgfWVsc2V7XG52YXIgdXJsID0gdHJ1ZV91cmwucmVwbGFjZSgvXFwuaHRtLywgJy0nICsgYXJyW2pdICsgJy5odG0nKTtcbiAgICAgICAgICAgICAgfVxuXG4gICAgZC5wdXNoKHtcbiAgICAgICAgdGl0bGU6bm93ID09bm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V0dXJuIFtcXG4gICAgICAgIHtcXG4gICAgICAgICAgdGl0bGU6IFxcXCLmuIXpmaTnirbmgIFcXFwiLFxcbiAgICAgICAgICBqczogJC50b1N0cmluZygob2JqKSA9PiB7XFxuICAgICAgICAgICAgbG9nKG9iaik7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIpO1xcbiAgICAgICAgICAgIG9iai5hbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBvYmouY2wuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgfSxcXG4gICAgICBdO1xcbiAgICB9LFxcbiAgICBjaGVja1BhcmFtKCkge1xcbiAgICAgIHZhciBvYmogPSB7fTtcXG4gICAgICBpZiAodGhpcy5wYWdlID09IDAgJiYgdHlwZW9mIHBhZ2UgPT0gXFxcInVuZGVmaW5lZFxcXCIpIHtcXG4gICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgfSBlbHNlIHtcXG4gICAgICAgIGlmICh0eXBlb2YgcGFnZSA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gdGhpcy5wYWdlO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHBhZ2U7XFxuICAgICAgICB9XFxuICAgICAgfVxcbiAgICAgIGlmICh0aGlzLmh0bWwgPT0gXF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fnsbvlrprkvY0pLmpvaW4oJ1xcXFxuJyldO1xcbiAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHZhciDkuIDnuqcgPSBsaXN0Lm1hcCgocykgPT4ge1xcbiAgICAgICAgICB2YXIgc2xpc3QgPSBbXTtcXG4gICAgICAgICAgaWYgKCEoXFxcIuWwj+exu1xcXCIgaW4geCkpIHtcXG4gICAgICAgICAgICB4LuWwj+exuyA9IFxcXCJib2R5JiZhOm5vdCg6bWF0Y2hlcyjpppbpobUpKTpub3QoYTpub3QoW2hyZWZdKSlcXFwiO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIGlmICh4LuWwj+exuy5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShzLCB4LuWwj+exuyk7XFxuICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgc2xpc3QgPSBwZGZhKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICB2YXIg5a6a5L2NID0gc2xpc3QubWFwKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCB4Luagh+mimCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIHgpO1xcbiAgICAgICAgICAgIHZhciBvYmogPSB7IHRpdGxlOiB0aXRsZSwgdXJsOiB1cmwgfTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkob2JqKTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIHJldHVybiDlrprkvY07XFxuICAgICAgICB9KTtcXG4gICAgICAgIC8vbG9nKOS4gOe6pylcXG4gICAgICAgIC8vbG9nKOS4gOe6py5sZW5ndGgpXFxuICAgICAgICBpZiAo5LiA57qnLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgIGNhdGVnb3JpZXMucHVzaCjkuIDnuqcuam9pbihcXFwiXFxcXG5cXFwiKSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICDkuIDnuqcuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChpdGVtLmpvaW4oXFxcIixcXFwiKSk7XFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coY2F0ZWdvcmllcylcXG4gICAgICB9KTtcXG4gICAgICBpZiAo5oqY5Y+g54q25oCBKSB7XFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT09IFxcXCIxXFxcIiA/IOaKmOWPoCA6IOWxleW8gCxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoXFxuICAgICAgICAgICAgICAoZm9sZCwgdSwgYWxsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX1JVTEUuZ3JvdXAsIGZvbGQgPT09IFxcXCIxXFxcIiA/IFxcXCIwXFxcIiA6IFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgIC8qYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTsqL1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgZm9sZCxcXG4gICAgICAgICAgICAgIOeKtuaAgSxcXG4gICAgICAgICAgICAgIOWFqOa4hVxcbiAgICAgICAgICAgICksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgbG9uZ0NsaWNrOiB0aGlzLmFjdGlvbih7XFxuICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcbiAgICAgICAgICAgICAgICBjbDog5riF6ZmkLFxcbiAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgfVxcbiAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICBjYXRlZ29yaWVzLmZvckVhY2goKGNhdGVnb3J5LCBpbmRleCkgPT4ge1xcbiAgICAgICAgLy9sb2coY2F0ZWdvcmllcylcXG4gICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgLyppZiAo5bCP57G75a6a5L2NLmluY2x1ZGVzKFxcXCI7XFxcIikpIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVswXSk7XFxuICAgICAgICAgIGlmIChzdWJfY2F0ZWdvcmllcy5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NLnNwbGl0KFxcXCI7XFxcIilbMV0pO1xcbiAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gSlNPTi5wYXJzZShgWyR7Y2F0ZWdvcnl9XWApO1xcbiAgICAgICAgLy8gc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0pO1xcbiAgICAgICAgLy99XFxuICAgICAgICBpZiAoaW5kZXggPT09IDApIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuXFxuICAgICAgICAgICAgLy9sZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIF/lpKfnsbvmoIfpopgpO1xcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0ZW0udGl0bGU7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3UmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQganNvbj0nJ1xcbiAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICBcXG4gICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICBjbGVhcnM6IOa4hemZpCxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAvL2xldCB1cmwgPSBwZChpdGVtLCBf5aSn57G76ZO+5o6lKTtcXG4gICAgICAgICAgICBsZXQgdXJsID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxuICAgICAgICAgICAgICB1cmwgPSDkuIDnuqfliIbnsbvlpITnkIYodXJsKTtcXG4gICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmFsbGNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgfSwgcGFyYW1zKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChmb2xkID09PSBcXFwiMVxcXCIgfHwg5oqY5Y+g54q25oCBID09IGZhbHNlKSB7XFxuICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgIHZhciBleHRyYXBvcyA9IGZhbHNlO1xcbiAgICAgICAgICAgIC8qaWYgKGl0ZW0uaW5jbHVkZXMoJ3R5cGU9XFxcIkBleHRyYVxcXCInKSkge1xcbiAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcbiAgICAgICAgICAgICAgLy9sb2coJ+mZhOWKoOWumuS9jScpXFxuICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgaWYgKGV4dHJhcG9zKSB7XFxuICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCBcXFwiYSYmc3RhdGVcXFwiKSxcXG4gICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwgXFxcImEmJnZhbHVlXFxcIiksXFxuICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAvL3ZhciB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKTtcXG4gICAgICAgICAgICAgIHZhciB0aXRsZSA9IGl0ZW0udGl0bGU7XFxuICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICB2YXIganNvbiA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgLypzd2l0Y2ggKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgLy8ganNvbiA9IHBkKGl0ZW0sIOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXG4gICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxuICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICBqc29uOiBqc29uLFxcbiAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgIGFsbGNsZWFyczog5YWo5riFLFxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHlcXFwiICsgXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHBhcmFtcykgPT4ge1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxcbiAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgIH0pO1xcbiAgICB9XFxuICAgIH0sXFxuICB9O1xcbiAgb2JqLumihOiuvihvcHRpb25zKTtcXG4gIHJldHVybiBvYmo7XFxufVxcblxcbiAgLy8u54q25oCBKFxcXCJ1cmxcXFwiKVxcbiAgLy8u55WM6Z2iKGQpXFxuICAvLy7mupDnoIEoeGh0bWwpXFxuICAvLy7lhajmuIUoW1xcXCIxXFxcIiwgXFxcIjJcXFwiXSlcXG4gIC8vLua4hemZpCgpXFxuICAvLy7lvIDlkK/mipjlj6AoKVxcbiAgLy8u6aG156CBKHBhZ2UpXFxuICAvLy7liJvlu7rliqjmgIHliIbnsbso5a6a5L2N5YiX6KGoKTtcXG5cXG5mdW5jdG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cXFwiICsgdXJsLFxcbiAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgaWQ6IGlkLFxcbiAgICAgICAgICAgIGNsczogY2xzLFxcbiAgICAgICAgICB9LFxcbiAgICAgICAgfSk7XFxuICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEgJiYgc2hvdykge1xcbiAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIGlkOiBcXFwicGFnZWxpbmVcXFwiLFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICBpZDogXFxcInBhZ2VudW1cXFwiLFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgIH0pO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgIHVwZGF0ZUl0ZW0oXFxcInBhZ2VudW1cXFwiLCB7XFxuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5Yiw5bqV5LqGPC9zbWFsbD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AgICAgICAgICAgICB2YXIgYXYgPSBcXFwiaHR0cHM6Ly90aGlzYXYuY29tL2NuL1xcXCIgKyDor4bliKvnoIE7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdiwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogJ01vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGltZW91dDo1MDAwXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICBldmFsKGh0bWwubWF0Y2goL2V2YWwuKj9cXFxcbi8pWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgLy8g6I635Y+W55S76LSo5YiX6KGo77yM5bm25Y675pyA6auY55S76LSoXFxuICAgICAgICAgICAgICAgICAgICBsZXQgZ3JvdXBfcXVhbGl0eSA9IGZldGNoKHNvdXJjZSx7aGVhZGVyczp7XFxcIm9yaWdpblxcXCI6XFxcImh0dHBzOi8vdGhpc2F2LmNvbVxcXCJ9fSlcXG4gICAgICAgICAgICAgICAgICAgIGhnaGVzdF9xdWFsaXR5ID0gZ3JvdXBfcXVhbGl0eS5tYXRjaCgvXiguKilcXFxcLm0zdTgkL2dtKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNvdXJjZS5yZXBsYWNlKFxcXCJwbGF5bGlzdC5tM3U4XFxcIiwgaGdoZXN0X3F1YWxpdHlbaGdoZXN0X3F1YWxpdHkubGVuZ3RoLTFdKSArICc7e09yaWdpbkBodHRwczovL3RoaXNhdi5jb219JyAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgfWNhdGNoe3JldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwifVxcb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gICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHZhciBwbGF5cyA9IGJmKHVybHMpLm1hcChoPT5oLm1hdGNoKC9zcmM9XFxcIiguKj8pXFxcIi8pWzFdLnNwbGl0KFxcXCImXFxcIilbMF0ucmVwbGFjZShcXFwiP2lkPVxcXCIsXFxcImhscy9cXFwiKSArIFxcXCIubTN1OFxcXCIpICAgXFxuICAgICAgICAgICAgIHJldHVybiB7dXJsczpwbGF5c31cXG4gICAgICAgfWNhdGNoe1xcbiAgICAgICAgIHRyeXtcXG4gICAgICAgICAgICAgdmFyIGF2ID0gXFxcImh0dHBzOi8vbWlzc2F2LnRvL3NlYXJjaC9tb3ZpZS9cXFwiICsg6K+G5Yir56CBLnJlcGxhY2UoL1xcXFwtfFxcXFxfLyxcXFwiJTIwXFxcIik7ICBcXG4gICAgICAgICAgICAgdmFyIHVybHMgPSBbXTsgICAgXFxuICAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShmZXRjaChhdix7dGltZW91dDo1MDAwfSksXFxcIi52aWRlb3MtbGlzdCYmYXJ0aWNsZVxcXCIpO1xcbiAgICAgICAgICAgIGZvcih2YXIgaiBpbiBsaXN0KXtcXG4gICAgICAgICAgICAgIHVybHMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBkZmgobGlzdFtqXSxcXFwiYSYmaHJlZlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIHBsYXlzID0gYmYodXJscykubWFwKGg9PmgubWF0Y2goL3NyYz1cXFwiKC4qPylcXFwiLylbMV0uc3BsaXQoXFxcIiZcXFwiKVswXS5yZXBsYWNlKFxcXCI/aWQ9XFxcIixcXFwiaGxzL1xcXCIpICsgXFxcIi5tM3U4XFxcIikgICBcXG4gICAgICAgICAgICAgcmV0dXJuIHt1cmxzOnBsYXlzfVxcbiAgICAgIC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W9seeJh1xcXCJcXG4gICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInZpZGVvOi8vXFxcIiArIGF2O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKSxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWycyNDAnXSxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycqLmRvcHBpb2Nkbi4qJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnZG1tLmNvLmpwJ10sXFxuICAgICAgICAgICAgICAgIC8vdmlkZW9SdWxlczogWycqbTN1OConXSxcXG4gICAgICAgICAgICAgICAgY2FjaGVNM3U4OiB0cnVlLFxcbiAgICAgICAgICAgICAgIGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjor4bliKvnoIEpPT57IHJldHVybiBcXFwiaHR0cHM6Ly9uamF2LnR2L3poL3YvXFxcIiArIOivhuWIq+eggTt9LOivhuWIq+eggSl9XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG59KTtcXG5cXG4vL2F2MDFcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPjxtaWRkbGU+PGZvbnQgY29sb3I9XFxcIiM3NTEyN0FcXFwiPiBBVjAxPC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjIuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9vd2wtMTAvNTAwL25pbTUzMl8xMV9wdXJwbGVfb3dsX2tpZF9iaXJ0aGRheV9mYWNlX2V5ZS0xMjgucG5nJyxcXG4gICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgo6K+G5Yir56CBKSA9PiB7XFxuICAgICAgICAgICAgICAgICB2YXIgYXYgPSBcXFwiaHR0cHM6Ly93d3cuYXYwMS50di9cXFwiICsg6K+G5Yir56CBOyBcXG4vL2xvZyhhdilcXG4gICAgICAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2goYXYse3RpbWVvdXQ6NTAwMH0pXFxuICAgICAgICAgICAgICAgICB2YXIgY29kZSA9IHBkZmgoaHRtbCwnI3BseXJfdmlkZW8mJnBvc3RlcicpXFxubG9nKGNvZGUpXFxuICAgICAgICAgICAgICAgICBpZighY29kZSl7ICAgICAgICAgXFxuICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5oyC5qKv5oiW5rKh5pyJ5q2k5b2x54mHXFxcIlxcbiAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFwidmlkZW86Ly9cXFwiICsgYXY7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHZpZGVvRXhjbHVkZVJ1bGVzOiBbJ2RvcHBpb2NkbiddLFxcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWycyNDAnXSxcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnNDgwJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnLmRvcHBpb2Nkbi4nXSxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWydkbW0uY28uanAnXSxcXG4gICAgICAgICAgICAgICAgLy92aWRlb1J1bGVzOiBbJyptM3U4KiddLFxcbiAgICAgICAgICAgICAgICBjYWNoZU0zdTg6IHRydWUsXFxuICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PnsgcmV0dXJuIFxcXCJodHRwczovL3d3dy5hdjAxLnR2L1xcXCIgKyDor4bliKvnoIE7fSzor4bliKvnoIEpfV1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxufSk7XFxuXFxuLy9KYWJsZVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PG1pZGRsZT48Zm9udCBjb2xvcj1cXFwiI0ZGOEMwMFxcXCI+IEphYmxlPC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjMuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9jYXQtcG93ZXItcHJlbWl1bS8xMjAvY2F0X2Zvb2Rsb3ZlLTEyOC5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL2phYmxlLnR2L3ZpZGVvcy9cXFwiICsg6K+G5Yir56CBICsgXFxcIi9cXFwiOyBcXG4vL2xvZyhhdilcXG4gICAgICAgICAgICAgICAgLy8gcmVxdWVzdChcXFwiaHR0cHM6Ly9qYWJsZS50di9cXFwiKVxcbiAgICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXG4gICAgICAgICAgICAgICAgIHZhciB1cmwgPSBodG1sLm1hdGNoKC9odHRwcz86XFxcXC9cXFxcL1xcXFxTKz9cXFxcLm0zdTgvKVswXVxcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgICAgICAgfWNhdGNoe3JldHVybiBcXFwidG9hc3Q6Ly/msqHmnInmjILmoq/lrZDmiJbmsqHmnInmraTlvbHniYdcXFwifVxcbiAgICAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKSxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcbiAgICBleHRyYTogeyBsb25nQ2xpY2s6IFt7dGl0bGU6ICfmn6XnnIvnvZHlnYAnLCBqczogJC50b1N0cmluZygo6K+G5Yir56CBKT0+eyByZXR1cm4gXFxcImh0dHBzOi8vamFibGUudHYvdmlkZW9zL1xcXCIgKyDor4bliKvnoIEgKyBcXFwiL1xcXCI7fSzor4bliKvnoIEpfV0gfVxcbn0pO1xcblxcbi8vVGhpc3NBVuegtOino1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PG1pZGRsZT48Zm9udCBjb2xvcj1cXFwiI0ZFRkUwMFxcXCI+54Sh56K856C06KejPC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjQuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9zb2NpYWwtbWVkaWEtZmxhdC03LzY0L1NvY2lhbC1tZWRpYV9TbmFwY2hhdC0xMjgucG5nJyxcXG4gICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgo6K+G5Yir56CBKSA9PiB7XFxuICAgICAgICAgICAgICAgICB2YXIgYXYgPSBcXFwiaHR0cHM6Ly90aGlzYXYuY29tL2NuL1xcXCIgKyDor4bliKvnoIEgKyBcXFwiLXVuY2Vuc29yZWQtbGVha1xcXCI7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdiwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogJ01vemlsbGEvNS4wIChXaW5kb3dzIE5UIDEwLjApJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGltZW91dDo1MDAwXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICBldmFsKGh0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RkZcXFwiPiBuSmF256C06KejPC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjAuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9DdXRlTW9uc3RlcnNQTkcvMTI4L2JsdWVfbW9uc3Rlci5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL25qYXYudHYvemgvdi9cXFwiICsg6K+G5Yir56CBICsgXFxcIi11bmNlbnNvcmVkLWxlYWtlZFxcXCI7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXG4gICAgICAgICAgICAgICAgIGlmKCFodG1sIHx8IGh0bWwuaW5jbHVkZXMoXFxcIuivt+ajgOafpeWcsOWdgOagj+S4reeahOe9keWdgFxcXCIpKXsgICAgICAgICBcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwiXFxuICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBhdjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICB9LOivhuWIq+eggSksXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnKi5kb3BwaW9jZG4uKiddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJ2RtbS5jby5qcCddLFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sX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xcbiAgICAgICAgICAgIHJldHVybiBcXFwieWpicm93c2VyOi8vc2VhcmNoP3E9aHR0cHM6Ly9zdXBqYXYuY29tL3poLz9zPVxcXCIgKyDor4bliKvnoIFcXG4gICAgICAgICAgICAgICAgICAgICAgIH0s6K+G5Yir56CBKX0se3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PnsgXFxuICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vc3VwamF2LmNvbS96aC8/cz1cXFwiICsg6K+G5Yir56CBXFxuICAgICAgICAgICAgICAgICAgICAgICB9LOivhuWIq+eggSl9XVxcbiAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuLy/ogZrmkJxcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPjxtaWRkbGU+PGZvbnQgY29sb3I9XFxcIiM2N0UwRkFcXFwiPuiBmuaQnCDigKIgUjwvZm9udD48L21pZGRsZT4nLFxcbiAgICBwaWNfdXJsOiAnaHR0cHM6Ly9jZG40Lmljb25maW5kZXIuY29tL2RhdGEvaWNvbnMvZXNzZW50aWFscy03Mi8yNC8wMDJfLV9TZWFyY2gtMTI4LnBuZycsXFxuICAgIHVybDogXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIiArIOivhuWIq+eggSArIFxcXCImcnVsZT3lpb3nnIvop4bpopEmc2ltcGxlPWZhbHNlXFxcIixcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcbiAgICBleHRyYTogeyAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgIGxvbmdDbGljazogW3t0aXRsZTogJ0phdi5HdXJ1JywganM6ICQudG9TdHJpbmcoKOivhuWIq+eggSk9PnsgcmV0dXJuIFxcXCJodHRwczovL2phdi5ndXJ1Lz9zPVxcXCIgKyDor4bliKvnoIE7fSzor4bliKvnoIEpfSx7dGl0bGU6ICdKYXZCYW5nZXJzJyw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bTtcXG4gIH1cXG59KTtcXG5cXG5mb3IgKHZhciBqID0gMDsgaiA8IE1hdGgubWluKGFyci5sZW5ndGgsIG5hbWVzLmxlbmd0aCk7IGorKykge1xcbmlmKGFycltqXT09J+i3s+mhtScpe1xcbiAgICAgICAgICAgICBkLnB1c2goe1xcclxcbiAgICAgICAgICAgIHRpdGxlOm5vdyA9PW5hbWVzW2pdPyAn4oCc4oCc4oCd4oCdJyArIG5hbWVzW2pdLmZvbnRjb2xvcigncmVkJykgOiBuYW1lc1tqXSxcXHJcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcclxcbiAgICAgICAgICAgIHVybDogJCgyMywgJ+ivt+i+k+WFpeimgei3s+i9rOWIsOeahOmhteaVsCcpLmlucHV0KCh0cnVlX3VybCxrLG5hbWVzLGopID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHBhcnNlSW50KGlucHV0KSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ovpPlhaXmnInor68s6K+36L6T5YWl5LiA5LiqMX4nICsgayArICfnmoTmlbDlrZcnXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRvUGFnZSA9IHBhcnNlSW50KGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHRvUGFnZSA8IDEgfHwgdG9QYWdlID4gaykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i+k+WFpeacieivryzor7fovpPlhaXkuIDkuKoxficgKyBrICsgJ+eahOaVsOWtlydcXHJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICBpZigvZm9ydW1cXFxcLVxcXFxkK1xcXFwtXFxcXGQrLy50ZXN0KHRydWVfdXJsKSl7XFxudmFyIHVybCA9IHRydWVfdXJsLnJlcGxhY2UoL1xcXFxkK1xcXFwuaHRtLywgdG9QYWdlICsgJy5odG0nKTtcXG4gICAgICAgICAgICAgIH1lbHNle1xcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXFxcLmh0bS8sICctJyArIHRvUGFnZSArICcuaHRtJyk7XFxuICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcIm5vd1xcXCIsIG5hbWVzW2pdKTtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCB1cmwpO1xcbiAgICAgICAgICAgICAgICAvL3B1dE15VmFyKCd5aV9maXJzdHBhZ2UnLCB1cmwpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i3s+i2iuWIsOS6huesrCcgKyB0b1BhZ2UgKyAn6aG1J1xcclxcbiAgICAgICAgICAgIH0sdHJ1ZV91cmwsIGssbmFtZXMsaiksXFxyXFxuICAgICAgICB9KTtcXG5cXG59ZWxzZXtcXG5cXG5pZihhcnJbal09PSfpmo/mnLonKXtcXG4gICAgICAgICAgICAgIGFycltqXSA9IE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIGspICsxICAgXFxufWVsc2UgaWYoYXJyW2pdPT0n5bC+6aG1JytrKXtcXG4gICAgICAgICAgICAgIGFycltqXSA9IGtcXG59ZWxzZSBpZihhcnJbal09PTEpe1xcbiAgICAgICAgICAgICAgbmFtZXNbal0gPSBcXFwi6aaW6aG1XFxcIlxcbn1lbHNlIGlmKGFycltqXT09J+i3s+mhtScpe1xcbiAgICAgICAgICAgICBhcnJbal0gPSAyMjNcXG59XFxuXFxuICAgICAgICAgIGlmKC9mb3J1bVxcXFwtXFxcXGQrXFxcXC1cXFxcZCsvLnRlc3QodHJ1ZV91cmwpKXtcXG52YXIgdXJsID0gdHJ1ZV91cmwucmVwbGFjZSgvXFxcXGQrXFxcXC5odG0vLCBhcnJbal0gKyAn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bignOyAnKTtcXG4gICAgfSxcXG4gICAgc2V0OiBmdW5jdGlvbih2YWx1ZSkge1xcbiAgICAgICAgdmFyIGxpc3QgPSBbXTtcXG4gICAgICAgIGlmICh2YWx1ZS5pbmNsdWRlcygnOycpKSB7XFxuICAgICAgICAgICAgbGlzdCA9IHZhbHVlLnNwbGl0KCc7Jyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGxpc3QgPSBbdmFsdWVdO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGlzdC5mb3JFYWNoKHggPT4ge1xcbiAgICAgICAgICAgIHZhciBpbmRleCA9IHguaW5kZXhPZihcXFwiPVxcXCIpO1xcbiAgICAgICAgICAgIHZhciBrZXkgPSB4LnN1YnN0cmluZygwLCBpbmRleCkudHJpbSgpO1xcbiAgICAgICAgICAgIHZhciB2YWx1ZSA9IHguc3Vic3RyaW5nKGluZGV4ICsgMSk7XFxuICAgICAgICAgICAgY29va2llc1trZXldID0gdmFsdWU7XFxuICAgICAgICB9KVxcbiAgICB9XFxufSk7XFxuXFxuZnVuY3Rpb24gZ3VhcmQodXJsLCBoZWFkb2JqKSB7XFxuICAgIHZhciBoZWFkID0gaGVhZG9iaiA/IGhlYWRvYmo6e1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgIENvb2tpZTogZ2V0Q29va2llKHVybCksXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgdmFyIGh0bWwgPSBmZXRjaCh1cmwsIGhlYWQpO1xcbiAgICBpZiAoaHRtbC5pbmNsdWRlcygnX2d1YXJkL2F1dG8uanMnKSkge1xcbiAgICAgICAgZG9jdW1lbnRbXFxcImNvb2tpZVxcXCJdID0gZ2V0Q29va2llKHVybCk7XFxuICAgICAgICBldmFsKGZldGNoKGdldEhvbWUodXJsKSArICcvX2d1YXJkL2F1dG8uanMnKSlcXG4gICAgICAgIGh0bWwgPSBmZXRjaCh1cmwsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOi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