xiaomianao666

小程序:𝐉𝐚𝐯𝐃𝐁

Oct 26th, 2024
593
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@𝐉𝐚𝐯𝐃𝐁@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi8J2QifCdkJrwnZCv8J2Qg/CdkIEiLCJhdXRob3IiOiLOseaooeadvyZSIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly9qYXZkYjM2OC5jb20vIyNmeXBhZ2UiLCJ2ZXJzaW9uIjoyMDI0MDgwNSwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IuS6kTZvb29vbGUveHh4eHh4L3hvenhkd2ppNXJyaHJsNnYiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG5hZGRMaXN0ZW5lcihcIm9uQ2xvc2VcIiwgJC50b1N0cmluZygoKSA9PiB7XG4gICAgbGV0IGtleXMgPSBsaXN0TXlWYXJLZXlzKCk7XG4gICAgZm9yIChsZXQgaXQgb2Yga2V5cykge1xuICAgICAgICBjbGVhck15VmFyKGl0KTtcbiAgICB9XG59KSk7XG5cbmNvbnN0IOS4i+S4gOmhtSA9IFwicGQoaHRtbCwgJy5wYWdpbmF0aW9uJiZhW3JlbD1uZXh0XSYmaHJlZicpXCI7XG5jb25zdCBwYWdlID0gTVlfUEFHRTtcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UveWknKSkucnVsZSlcblxudmFyIOWumuS9jeS/oeaBryA9IFt7XG4gICAg5aSn57G75a6a5L2NOiA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cXHNhXFxzbW9tZW50Ly50ZXN0KGh0bWwpKSB7XG5kLnB1c2goe1xuICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn6I635Y+WY29va2llJy5mb250Y29sb3IoJyNGRjAwRkYnKS5iaWcoKSxcbiAgICAgICAgdXJsOiB0cnVlX3VybCArICQoJycpLnJ1bGUoKCkgPT4ge1xuICAgICAgICAgICAgdmFyIGQgPSBbXTtcbiAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZScsXG4gICAgICAgICAgICAgICAgdXJsOiBNWV9VUkwsXG4gICAgICAgICAgICAgICAgZGVzYzogJ2xpc3QmJnNjcmVlbicsXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgXCJVc2VyLUFnZW50XCI6IFwiTW96aWxsYS81LjAgKExpbnV4OyBBbmRyb2lkIDEyOyBTTS1HOTc1MCBCdWlsZC9TUDFBLjIxMDgxMi4wMTY7IHd2KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBWZXJzaW9uLzQuMCBDaHJvbWUvODkuMC40Mzg5LjcyIE1RUUJyb3dzZXIvNi4yIFRCUy8wNDYyNzkgTW9iaWxlIFNhZmFyaS81MzcuMzZcIiwvL1BDX1VBLCAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgc2hvd1Byb2dyZXNzOiBmYWxzZSxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHUpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IG5vZGVzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnI3RhZ3MnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY28gPSBmYmEuZ2V0Q29va2llKHUpO1xuLy92YXIgdWEgPSBmYmEuZ2V0VWEoKVxuLy9mYmEubG9nKCdjbzo6Ojo6OicgKyB1YSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCdjbzo6Ojo6OicgKyBjbyk7XG52YXIgaHRtbENvbnRlbnQgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuaW5uZXJIVE1MO1xuXG5pZigv5rC45LmF5Z+f5ZCNLy50ZXN0KGh0bWxDb250ZW50KSkge1xuICBcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZSgkJCQoKS5sYXp5UnVsZSgoY28pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9BcG9sbG8vQ29va2llL2phdmRiX2Nvb2tpZS50eHQnLCBjbyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn5bey6I635Y+WY29va2ll77yM5YiH5o2i5Yiw6aaW6aG1Jyk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBjbykpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2ssIDUwMCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2soKTtcbiAgICAgICAgICAgICAgICAgICAgfSwgTVlfVVJMKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmV0dXJuIHNldFJlc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FyYWxsOiBbXFxcInlpX2ZpcnN0cGFnZVxcXCJdLFxcbiAgICAgICAgZGVidWc6IGZhbHNlLFxcblxcbiAgICAgICAg6aKE6K6+KHBhcmFtKSB7XFxuICAgICAgICAgICAgaWYgKHBhcmFtID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICBwYXJhbSA9IFtdO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBPYmplY3Qua2V5cyhwYXJhbSkuZm9yRWFjaCgocHJvcGVydHkpID0+IHtcXG4gICAgICAgICAgICAgICAgLy8g5a+55q+P5Liq5bGe5oCn5ZCN5omn6KGM5pON5L2cXFxuICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gcGFyYW1bcHJvcGVydHldOyAvLyDojrflj5blsZ7mgKflgLxcXG4gICAgICAgICAgICAgICAgLy8g5Zyo6L+Z6YeM5omn6KGM5oKo55qE5pON5L2cXFxuICAgICAgICAgICAgICAgIHRoaXNbcHJvcGVydHldID0gdmFsdWU7XFxuICAgICAgICAgICAgICAgIGlmICh0aGlzLmRlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhwcm9wZXJ0eSArIFxcXCI6XFxcIiArIHZhbHVlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGV2YWxKU1J1bGUoaXRlbSxcXG4gICAgICAgICAgICBqc1J1bGUpIHtcXG4gICAgICAgICAgICBsZXQgcnVsZSA9IGpzUnVsZS5yZXBsYWNlKFxcXCJAanM6XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgIHJ1bGUgPSBydWxlLnRyaW0oKTtcXG4gICAgICAgICAgICAvL2xvZygkLnN0cmluZ2lmeShydWxlKSlcXG4gICAgICAgICAgICBsZXQgaW5wdXQgPSBpdGVtO1xcbiAgICAgICAgICAgIGlmIChydWxlLnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBldmFsKFxcXCJyZXN1bHQgPSBcXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgLyoqXFxuICAgICAgICAgICAgICAgICAqIOi/mOWOn+aIkCAkLnRvU3RyaW5nKC4uLikg55qE5pyA57uI57uT5p6c77yM6L6+5Yiw5pyA57uI5aSE55CG5pa55byP6Lef5LiK6Z2i55qEIGlmIOS4gOiHtOeahOebrueahFxcbiAgICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgZXZhbChcXFwicmVzdWx0ID0gXFxcIiArIFxcXCIoKCkgPT4ge1xcXCIgKyBydWxlICsgXFxcIn0pKClcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIHJlc3VsdCB8fCBcXFwiXFxcIjtcXG4gICAgICAgIH0sXFxuICAgICAgICBnZXRUaXRsZShzcmMsIGNhdGVnb3J5KSB7XFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgbGV0IHRpdGxlUnVsZSA9IGNhdGVnb3J5IHx8IFxcXCJhJiZUZXh0XFxcIjtcXG4gICAgICAgICAgICBpZiAodGl0bGVSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIHRpdGxlUnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBwYXJzZURvbUZvckh0bWwoc3JjLCB0aXRsZVJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdGl0bGUgfHwgXFxcIlxcXCI7XFxuICAgICAgICB9LFxcbiAgICAgICAgZ2V0VXJsKHNyYywgY2F0ZWdvcnkpIHtcXG4gICAgICAgICAgICBsZXQgdXJsID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgbGV0IHVybFJ1bGUgPSBjYXRlZ29yeS7pk77mjqUgfHwgXFxcImEmJmhyZWZcXFwiO1xcbiAgICAgICAgICAgIGlmICh1cmxSdWxlLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB0aGlzLmV2YWxKU1J1bGUoc3JjLCB1cmxSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cmwgPSBwZChzcmMsIHVybFJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodHlwZW9mIGNhdGVnb3J5LumTvuaOpeWkhOeQhiA9PSBcXFwiZnVuY3Rpb25cXFwiKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IGNhdGVnb3J5LumTvuaOpeWkhOeQhih1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gdXJsIHx8IFxcXCJcXFwiO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGlzTnVsbChwYXJhbSkge1xcbiAgICAgICAgICAgIGlmIChwYXJhbSA9PSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9LFxcbiAgICAgICAgaXNCb29sZWFuKHZhcmlhYmxlKSB7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB2YXJpYWJsZSAhPT0gXFxcImJvb2xlYW5cXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi5byA5ZCv5oqY5Y+g6K+35Lyg5YWl5biD5bCU5YC8XFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxcXG4gICAgICAgIOa4hemZpChsaXN0KSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAobGlzdC5jb25zdHJ1Y3RvciA9PSBTdHJpbmcpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmuIXpmaTmiqXplJk66K+35Lyg5YiX6KGoXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHRoaXMuY2xlYXJzID0gbGlzdDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlhajmuIUobGlzdCkge1xcbiAgICAgICAgICAgIGlmICh0aGlzLmlzTnVsbChsaXN0KSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIGMgPSB0aGlzLmNsZWFyYWxsO1xcbiAgICAgICAgICAgIGxpc3QgPSBjLmNvbmNhdChsaXN0KTtcXG4gICAgICAgICAgICB0aGlzLmNsZWFyYWxsID0gbGlzdDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDmupDnoIEoaW5wdXQpIHtcXG4gICAgICAgICAgICB0aGlzLmh0bWwgPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDnlYzpnaIoaW5wdXQpIHtcXG4gICAgICAgICAgICB0aGlzLmxheW91dCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOmhteeggShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMucGFnZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOeKtuaAgShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMuc3RhdGUgPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlvIDlkK/mkJzntKIoaW5wdXQpIHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5zZWFyY2ggPSBpbnB1dDtcXG4gICAgICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICAgIH0sXFxuICAgICAgICDlvIDlkK/mipjlj6AoaW5wdXQpIHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5pc0Jvb2xlYW4oaW5wdXQpO1xcbiAgICAgICAgICAgIHRoaXMub3BlbiA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIHNldFRpdGxlKGssIGksIHQpIHtcXG4gICAgICAgICAgICByZXR1cm4gayA9PSBpID8gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyB0LmZvbnRjb2xvcih0aGlzLuWIhuexu+minOiJsikgOiB0O1xcbiAgICAgICAgfSxcXG4gICAgICAgIGFjdGlvbihvYmopIHtcXG4gICAgICAgICAgICByZXR1cm4gW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmuIXpmaTnirbmgIFcXFwiLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygob2JqKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsb2cob2JqKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIob2JqLnN0YXRlKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY2F0ZV9idXR0b24nKTtcXG4gICAgICAgICAgICAgICAgICAgIG9iai5hbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIG9iai5jbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgfSwgb2JqKSxcXG4gICAgICAgICAgICB9LCBdO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGNoZWNrUGFyYW0oKSB7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHt9O1xcbiAgICAgICAgICAgIGlmICh0aGlzLnBhZ2UgPT0gMCAmJiB0eXBlb2YgcGFnZSA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuivt+S8oOWFpemhteeggVxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcGFnZSA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHRoaXMucGFnZTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIG9ialtcXFwi6aG156CBXFxcIl0gPSBwYWdlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0aGlzLmh0bWwgPT0gXFxcImVtcHR5XFxcIiAmJiB0eXBlb2YgaHRtbCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuivt+S8oOWFpea6kOeggVxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgaHRtbCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLmupDnoIFcXFwiXSA9IHRoaXMuaHRtbDtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIG9ialtcXFwi5rqQ56CBXFxcIl0gPSBodG1sO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0aGlzLmxheW91dCA9PSBcXFwidW5kZWZpbmVkXFxcIiAmJiB0eXBlb2YgZCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuivt+S8oOWFpeeVjOmdolxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZCA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLnlYzpnaJcXFwiXSA9IHRoaXMubGF5b3V0O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLnlYzpnaJcXFwiXSA9IGQ7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuIG9iajtcXG4gICAgICAgIH0sXFxuICAgICAgICDliJvlu7rliqjmgIHliIbnsbsocnVsZU9iaikge1xcbiAgICAgICAgICAgIGxldCBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgIGxldCBjYXRlcyA9IFtdO1xcbiAgICAgICAgICAgIGlmIChydWxlT2JqID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICBydWxlT2JqID0gW107XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8v5Yid5aeL5YyW5Y+Y6YeP5byA5aeLXFxuICAgICAgICAgICAgY29uc3QgcGFyYW0gPSB0aGlzLmNoZWNrUGFyYW0oKTtcXG4gICAgICAgICAgICBjb25zdCBwYWdlID0gcGFyYW0u6aG156CBO1xcbiAgICAgICAgICAgIGNvbnN0IGh0bWwgPSBwYXJhbS7mupDnoIE7XFxuICAgICAgICAgICAgY29uc3QgZCA9IHBhcmFtLueVjOmdojtcXG4gICAgICAgICAgICBjb25zdCDnirbmgIEgPSB0aGlzLnN0YXRlO1xcbiAgICAgICAgICAgIGNvbnN0IHNlYXJjaCA9IHRoaXMuc2VhcmNoO1xcbiAgICAgICAgICAgIGNvbnN0IGVtcHR5ID0gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgIGNvbnN0IOaKmOWPoOeKtuaAgSA9IHRoaXMub3BlbjtcXG4gICAgICAgICAgICB2YXIg5bGV5byAID0gdGhpcy7lsZXlvIA7XFxuICAgICAgICAgICAgdmFyIOaKmOWPoCA9IHRoaXMu5oqY5Y+gO1xcbiAgICAgICAgICAgIHZhciDlhajmuIUgPSB0aGlzLmNsZWFyYWxsO1xcbiAgICAgICAgICAgIHZhciDmuIXpmaQgPSB0aGlzLmNsZWFycztcXG4gICAgICAgICAgICAvL+WIneWni+WMluWPmOmHj+e7k+adn1xcbiAgICAgICAgICAgIGxldCBpbml0X2NhdGUgPSBuZXcgQXJyYXkoMjApLmZpbGwoXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICBjb25zdCBmb2xkID0gZ2V0TXlWYXIoTVlfUlVMRS5ncm91cCwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICBjb25zdCBjYXRlX3RlbXAgPSBKU09OLnBhcnNlKFxcbiAgICAgICAgICAgICAgICBnZXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkoaW5pdF9jYXRlKSlcXG4gICAgICAgICAgICApO1xcbiAgICAgICAgICAgIGlmIChzZWFyY2ggJiYgcGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiJ2hpa2VyOi8vc2VhcmNoP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUgKyBcXFwiJnM9JytpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi5pCc57Si5YWz6ZSu6K+NXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJrZXl3b3JkXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImtleXdvcmRcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY29uc3QgY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgIHJ1bGVPYmouZm9yRWFjaCgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICAvL2xvZyh4KVxcbiAgICAgICAgICAgICAgICBpZiAoeC5qc29uICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICAgICAgeC5qc29uLm1hcChrID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLnB1c2goSlNPTi5zdHJpbmdpZnkoaykucmVwbGFjZSgvXlxcXFxbfFxcXFxdJC9nLCAnJykpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgLy9jYXRlZ29yaWVzLnB1c2goeC5qc29uKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICh4LuS4gOe6p+WumuS9jSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7kuIDnuqflrprkvY0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShodG1sLCB4LuS4gOe6p+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHgu5aSn57G75a6a5L2NKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCB4LuWkp+exu+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBbcGRmYShodG1sLCB4LuWkp+exu+WumuS9jSkuam9pbignXFxcXG4nKV07XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG5cXG5cXG4gICAgICAgIHZhciDkuIDnuqcgPSBsaXN0Lm1hcCgocykgPT4ge1xcbiAgICAgICAgICB2YXIgc2xpc3QgPSBbXTtcXG4gICAgICAgICAgaWYgKCEoXFxcIuWwj+exu1xcXCIgaW4geCkpIHtcXG4gICAgICAgICAgICB4LuWwj+exuyA9IFxcXCJib2R5JiZhOm5vdCg6bWF0Y2hlcyjpppbpobUpKTpub3QoYTpub3QoW2hyZWZdKSlcXFwiO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIGlmICh4LuWwj+exuy5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShzLCB4LuWwj+exuyk7XFxuICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgc2xpc3QgPSBwZGZhKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICAvLy0t6aKd5aSW5aSE55CGLS1cXG4gICAgICAgICAgaWYgKCgn5aKe5YqgJyBpbiB4KSkge1xcbiAgICAgICAgICAgIGlmICh4LuWinuWKoC5jb25zdHJ1Y3RvciA9PSBTdHJpbmcpIHtcXG4gICAgICAgICAgICAgIHgu5aKe5YqgID0gZXZhbCh4LuWinuWKoCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHNsaXN0ID0geC7lop7liqAuY29uY2F0KHNsaXN0KTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgICBpZiAoKCfooaXlhYUnIGluIHgpKSB7XFxuICAgICAgICAgICAgaWYgKHgu6KGl5YWFLmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgeC7ooaXlhYUgPSBldmFsKHgu6KGl5YWFKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc2xpc3QgPSBzbGlzdC5jb25jYXQoeC7ooaXlhYUpO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIC8vLS3pop3lpJblpITnkIYtLVxcbiAgICAgICAgICB2YXIg5a6a5L2NID0gc2xpc3QubWFwKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gdGhpcy5nZXRUaXRsZShpdGVtLCB4Luagh+mimCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIHgpO1xcbiAgICAgICAgICAgIHZhciBvYmogPSB7XFxuICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAoKCdleHQnIGluIHgpKSB7XFxuICAgICAgICAgICAgICBvYmpbJ2V4dCddID0geC5leHQ7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAvL2xvZyjkuIDnuqcpXFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6py5sZW5ndGgpXFxuICAgICAgICAgICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaCjkuIDnuqcuam9pbihcXFwiXFxcXG5cXFwiKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICDkuIDnuqcuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMucHVzaChpdGVtLmpvaW4oXFxcIixcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICjmipjlj6DnirbmgIEpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT09IFxcXCIxXFxcIiA/IOaKmOWPoCA6IOWxleW8gCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0aXRsZSwgZm9sZCwgdSwgYWxsLCBleHBzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZm9sZCA9IGdldE15VmFyKE1ZX1JVTEUuZ3JvdXAsIGZvbGQpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIFvlsZXlvIAsIOaKmOWPoF0gPSBleHBzO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbGQgPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IGZpbmRJdGVtc0J5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ2NhdGVfYnV0dG9uJywgY3gpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh0aXRsZSArICdjYXRlX2J1dHRvbicpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY3ggPSBzdG9yYWdlMC5nZXRNeVZhcignY2F0ZV9idXR0b24nLCBbXSkubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4Wydjb2xfdHlwZSddID0geFsnY29sX3R5cGUnXSA/IHhbJ2NvbF90eXBlJ10gOiB4Wyd0eXBlJ107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcih0aXRsZSArICdjYXRlX2xpbmUnLCBjeClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHRpdGxlICsgJ2NhdGVfZXhwJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBmb2xkID09IDEgPyDlsZXlvIAgOiDmipjlj6AsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcIjFcXFwiID8gXFxcIjBcXFwiIDogXFxcIjFcXFwiKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfUlVMRS50aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9sZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAg54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDlhajmuIUsIFvlsZXlvIAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICDmipjlj6BcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9leHAnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IHRoaXMuYWN0aW9uKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGw6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsOiDmuIXpmaQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIGNhdGVnb3JpZXMuZm9yRWFjaCgoY2F0ZWdvcnksIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgLyppZiAo5bCP57G75a6a5L2NLmluY2x1ZGVzKFxcXCI7XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVswXSk7XFxuICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJfY2F0ZWdvcmllcy5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NLnNwbGl0KFxcXCI7XFxcIilbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhpbmRleClcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gSlNPTi5wYXJzZShgWyR7Y2F0ZWdvcnl9XWApO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coc3ViX2NhdGVnb3JpZXMpXFxuICAgICAgICAgICAgICAgICAgICAvLyBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICAvL31cXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5aSn57G7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IHRpdGxlID0gcGRmaChpdGVtLCBf5aSn57G75qCH6aKYKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS50aXRsZTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3UmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBqc29uID0gJydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyYW1zID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHBhZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhcnM6IOa4hemZpCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbGV0IHVybCA9IHBkKGl0ZW0sIF/lpKfnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qaWYgKOWkp+exu+WkhOeQhikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IOS4gOe6p+WIhuexu+WkhOeQhih1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2codXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aGlzLnNldFRpdGxlKGtleS50b1N0cmluZygpLCBjYXRlX3RlbXBbaW5kZXhdLCB0aXRsZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5I25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdfY2F0ZSA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wLmZvckVhY2goKGNhdGUsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfY2F0ZS5wdXNoKGluZGV4ID09PSAwID8gcGFyYW1zLmtleS50b1N0cmluZygpIDogXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9SVUxFLnRpdGxlICsgJ2NhdGVfbGluZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/lsI/nsbtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGV4dHJhcG9zID0gZmFsc2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qaWYgKGl0ZW0uaW5jbHVkZXMoJ3R5cGU9XFxcIkBleHRyYVxcXCInKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhcG9zID0gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygn6ZmE5Yqg5a6a5L2NJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChleHRyYXBvcykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gcGRmaChpdGVtLCBcXFwiYSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIFxcXCJhJiZzdGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIFxcXCJhJiZ2YWx1ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcImdcXFwiKSwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGpzb24gPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qc3dpdGNoICh0cnVlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXCJAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAXFxcIilbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGpzb24gPSBwZChpdGVtLCDliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKnZhciBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEBAJyk/e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVswXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZTpwZGZoKGl0ZW0s5YiG57G76ZO+5o6lLnNwbGl0KCdAQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOuWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVswXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdGl0bGUgPT0gXFxcIvCdkIXwnZCC8J2fkFxcXCIgPyBcXFwiaGlrZXI6Ly9wYWdlL2ZjMj91cmw9XFxcIiArIGdldE15VmFyKFxcXCJmYzJcXFwiKSArIFxcXCIjZnlwYWdlI25vSGlzdG9yeSNcXFwiIDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5qc29uLmNvbnN0cnVjdG9yID09PSBPYmplY3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJkdF9cXFwiICsgcGFyYW1zLmpzb24udHlwZSwgcGFyYW1zLmpzb24udmFsdWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoZm9sZCA9PT0gXFxcIjFcXFwiIHx8IOaKmOWPoOeKtuaAgSA9PSBmYWxzZSkge1xcbiAgICAgICAgICAgICAgICBpdGVtcyA9IGl0ZW1zLmNvbmNhdChjYXRlcyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgc3RvcmFnZT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ZygnbjonK25leHQpXFxuICAgICAgICAgICAgaWYgKG5leHQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKCfkuIvkuIDpobXpk77mjqXkuLrnqbonKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXN1bHQgPSB0cnVlO1xcbiAgICAgICAgICAgIGlmICh0cnVlX3VybCA9PSBuZXh0KSB7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IGZhbHNlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAvL2xvZyhcXFwi5Y+v6IO95LiN5a2Y5Zyo5LiL5LiA6aG15oiW6ICF5LiL5LiA6aG15a6a5L2N5pyJ6Zeu6aKYXFxcIik7XFxuICAgICAgICAgICAgLy9sb2coXFxcIumUmeivr+S/oeaBrzpcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICgobmV4dCA9PSBcXFwiXFxcIiB8fCBuZXh0ID09IHVuZGVmaW5lZCkgJiYgcGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgbmV4dCA9IHRydWVfdXJsO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvL3Jlc3VsdD1mYWxzZTtcXG4gICAgICAgICAgICBuZXh0ID0gZ2V0TXlWYXIo54q25oCBKTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vbG9nKCdsJyt0cnVlX3VybClcXG4gICAgICAgIC8vbG9nKCduJytuZXh0KVxcbiAgICAgICAgaWYgKHBhZ2UgIT0gMSkge1xcbiAgICAgICAgICAgIGlmICh0cnVlX3VybCA9PSBuZXh0ICYmICFyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gdHJ1ZTtcXG4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nID0gZXZhbChydWxlLmltZyk7XFxuICAgICAgICB9IGVsc2UgaWYgKHJ1bGUuYmFja2ltZykge1xcbiAgICAgICAgICAgIGltZyA9IHBkZmgoaXRlbSwgcnVsZS5pbWcpO1xcbiAgICAgICAgICAgIGltZyA9IHRoaXMuZ2V0QmFja0ltYWdlKGltZyk7XFxuICAgICAgICAgICAgaW1nID0gdGhpcy5odHRwSGFuZGxlKGltZyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGltZyA9IHBkZmgoaXRlbSwgcnVsZS5pbWcpO1xcbiAgICAgICAgICAgIGlmICghaW1nLnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBpbWcgPSBwZChpdGVtLCBydWxlLmltZyk7XFxuICAgICAgICAgICAgICAgIGltZyA9IHRoaXMuaHR0cEhhbmRsZShpbWcpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpbWcgKyBydWxlLnJlZjtcXG4gICAgfSxcXG4gICAgdXJsSGFuZGxlOiBmdW5jdGlvbihpdGVtLCBydWxlKSB7XFxuICAgICAgICB2YXIgaHJlZiA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKHJ1bGUudXJsLnN0YXJ0c1dpdGgoXFxcInBkXFxcIikpIHtcXG4gICAgICAgICAgICBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGhyZWYgPSBwZChpdGVtLCBydWxlLnVybCk7XFxuICAgICAgICB9XFxuICAgICAgICBocmVmID0gcnVsZS5pbXQgPyBocmVmICsgXFxcIiNpbW1lcnNpdmVUaGVtZSNcXFwiIDogaHJlZjtcXG4gICAgICAgIHJldHVybiBocmVmO1xcbiAgICB9LFxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihpdGVtLCBpbnB1dCkge1xcbiAgICAgICAgbGV0IG91dHB1dCA9IFxcXCJ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gIGpzb24gPSBKU09OLnBhcnNlKGpzb24pO1xcbiAgICAgICAgICAgIH0gY2F0Y2gge31cXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChqc29uW3J1bGUubGlzdF0gPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgYXJyLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5peg5YaF5a65PC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7fSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgZGVidWcgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmRlYnVnLCBmYWxzZSk7XFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXG4gICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgIGxvZygn5a6a5L2N5YiX6KGoOicgKyBydWxlLmxpc3QpO1xcbiAgICAgICAgfVxcbiAgICAgICAganNvbltydWxlLmxpc3RdLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBldmFsKHJ1bGUudGl0bGUpO1xcbiAgICAgICAgICAgIHZhciBkZXNjID0gZXZhbChydWxlLmRlc2MpO1xcbiAgICAgICAgICAgIHZhciBjb250ZW50ID0gZXZhbChydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSBldmFsKHJ1bGUuaW1nKSArIHJ1bGUucmVmO1xcbiAgICAgICAgICAgIHZhciBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHJ1bGUuaW10ID8gaHJlZiArIFxcXCIjaW1tZXJzaXZlVGhlbWUjXFxcIiA6IGhyZWY7XFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFwiXFxcIjtcXG5cXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgdXJsXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIHRoaXMuZGVidWdsb2coaSwgaXRlbSwgcnVsZSwgcngpO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBpZiAobGF6eSAhPSBcXFwiX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GNvbnRlbnQgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5jb250ZW50KTtcXG5cXG4gICAgICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHJ4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYzEucmVwbGFjZShcXFwi5ZCr5Lit5a2X56OB6Y+IXFxcIixcXFwi5ZCr5Lit5a2XXFxcIikgKyBcXFwiXFxcXHRcXFxcdFxcXCIgKyBkZXNjLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgIHVybDogKGVtcHR5ID8gJ2hpa2VyOi8vZW1wdHkjIycgOiAnJykgKyB1cmwgKyAnI25vSGlzdG9yeSNAcnVsZT1qczokLnJlcXVpcmUoXFxcImVqXFxcIiknLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn44CQ6Lez6aG144CRJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodHJ1ZV91cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoJycsICcx5YiwODHkuYvpl7TnmoTnmoTpobXnoIEnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmlucHV0KCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGlucHV0KSA+IDEgJiYgcGFyc2VJbnQoaW5wdXQpIDwgODEgJiYgcGFyc2VJbnQoaW5wdXQpICUgMSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGp1bXB1ID0gdHJ1ZV91cmwucmVwbGFjZSgvKFxcXFw/cGFnZT1cXFxcZCt8XFxcXCZwYWdlPVxcXFxkK3wkKS8sIChtYXRjaCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2guc3RhcnRzV2l0aCgnP3BhZ2U9JykgfHwgbWF0Y2guc3RhcnRzV2l0aCgnJnBhZ2U9JykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaC5jaGFyQXQoMCkgKyAncGFnZT0nICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRydWVfdXJsLmluY2x1ZGVzKCc/JykgPyAnJnBhZ2U9JyA6ICc/cGFnZT0nKSArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBqdW1wdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIGp1bXB1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S9oOW3sue7j+epv+i2iuWIsOS6hicgKyBpbnB1dCArICfpobUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7fovpPlhaXmraPnoa7nmoTpobXnoIFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRydWVfdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAobGF6eSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBkZFtcXFwidXJsXFxcIl0gPSB1cmwgKyBsYXp5O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnIucHVzaChkZCk7XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgTGlzdDogZnVuY3Rpb24oYXJyLCBodG1sLCBydWxlLCBw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MgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUudGl0bGUpO1xcbiAgICAgICAgICAgICAgICB2YXIgZGVzYyA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmRlc2MpO1xcbiAgICAgICAgICAgICAgICB2YXIgaW1nID0gdGhpcy5pbWdIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLnVybEhhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5jb250ZW50KTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgICAgICAgICAgIGNscyA9IFxcXCJsYXN0bWFya1xcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsICsgJz9wYWdlPWZ5cGFnZSNub0hpc3RvcnkjQHJ1bGU9anM6JC5yZXF1aXJlKFxcXCJ5alxcXCIpJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn44CQ6Lez6aG144CRJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodHJ1ZV91cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoJycsICcx5YiwMzHkuYvpl7TnmoTnmoTpobXnoIEnKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmlucHV0KCh0cnVlX3VybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcnNlSW50KGlucHV0KSA+IDEgJiYgcGFyc2VJbnQoaW5wdXQpIDwgODEgJiYgcGFyc2VJbnQoaW5wdXQpICUgMSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGp1bXB1ID0gdHJ1ZV91cmwucmVwbGFjZSgvKFxcXFw/cGFnZT1cXFxcZCt8XFxcXCZwYWdlPVxcXFxkK3wkKS8sIChtYXRjaCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2guc3RhcnRzV2l0aCgnP3BhZ2U9JykgfHwgbWF0Y2guc3RhcnRzV2l0aCgnJnBhZ2U9JykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBtYXRjaC5jaGFyQXQoMCkgKyAncGFnZT0nICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKHRydWVfdXJsLmluY2x1ZGVzKCc/JykgPyAnJnBhZ2U9JyA6ICc/cGFnZT0nKSArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCBqdW1wdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIGp1bXB1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S9oOW3sue7j+epv+i2iuWIsOS6hicgKyBpbnB1dCArICfpobUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/or7fovpPlhaXmraPnoa7nmoTpobXnoIFcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHRydWVfdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZV91cmwpXFxuICAgICAgICAgICAgICAgICAgICB9XVxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJwYWdlbGluZVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzbWFsbD7liqDovb3kuK0uLi48L3NtYWxsPlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcInBhZ2VudW1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJwYWdlbnVtXFxcIiwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5Yiw5bqV5LqGPC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogXFxcImxhc3RcXFwiLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbi8qXFxuICAgICAgICBpZiAobGlzdC5sZW5ndGggPT0gMCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7ml6DlhoXlrrk8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHt9LFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSovXFxuICAgICAgICBpZiAodGhpcy5uZXh0UGFnZSgpKSB7XFxuICAgICAgICAgICAgLy9sb2coJ3QnKTtcXG4gICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcigneWlfaXNuZXh0JywgJ3QnKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgLy9sb2coJ2YnKTtcXG4gICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcigneWlfaXNuZXh0JywgJ2YnKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChhdXRvKSB7XFxuICAgICAgICAgICAgLy9jcmVhdGVOZXh0UGFnZSgpO1xcbiAgICAgICAgICAgIGF1dG9QYWdlKCk7XFxuICAgICAgICB9XFxuICAgIH0sXFxufTtcXG5cXG52YXIgZXh0TWV0aG9kID0ge1xcbiAgICBUb1BhcmFtczogZnVuY3Rpb24oKSB7XFxuICAgICAgICB2YXIganNvbiA9IGFyZ3VtZW50c1swXTtcXG4gICAgICAgIHJldHVybiBPYmplY3Qua2V5cyhqc29uKVxcbiAgICAgICAgICAgIC5tYXAoKGtleSkgPT4ga2V5ICsgXFxcIj1cXFwiICsganNvbltrZXldKVxcbiAgICAgICAgICAgIC5qb2luKFxcXCImXFxcIik7XFxuICAgIH0sXFxuICAgIHVybFBhcnNlOiBmdW5jdGlvbih1KSB7XFxuICAgICAgICB2YXIgZGljdCA9IHt9O1xcbiAgICAgICAgZGljdC5Tb3VyY2UgPSB1O1xcbiAgICAgICAgbGV0IHBhcmFtcyA9ICh1cmwpID0+IHtcXG4gICAgICAgICAgICBsZXQgcXVlcnlQYXJhbXMgPSB7fTtcXG4gICAgICAgICAgICBsZXQgcmVnID0gLyhbXj89Jl0rKT0oW14/PSZdKykvZztcXG4gICAgICAgICAgICB1cmwucmVwbGFjZShyZWcsIGZ1bmN0aW9uKCkge1xcbiAgICAgICAgICAgICAgICBxdWVyeVBhcmFtc1thcmd1bWVudHNbMV1dID0gYXJndW1lbnRzWzJdO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBxdWVyeVBhcmFtcztcXG4gICAgICAgIH07XFxuICAgICAgICB2YXIgamF2YVVybCA9IEphdmFJbXBvcnRlcihqYXZhLm5ldC5VUkwpO1xcbiAgICAgICAgd2l0aChqYXZhVXJsKSB7XFxuICAgICAgICAgICAgdmFyIHVybCA9IG5ldyBVUkwodSk7XFxuICAgICAgICAgICAgZGljdC5Qcm90b2NvbCA9IHVybC5nZXRQcm90b2NvbCgpO1xcbiAgICAgICAgICAgIGRpY3QuSG9zdCA9IHVybC5nZXRIb3N0KCk7XFxuICAgICAgICAgICAgZGljdC5Qb3J0ID0gdXJsLmdldFBvcnQoKTtcXG4gICAgICAgICAgICBkaWN0LkZpbGUgPSB1cmwuZ2V0RmlsZSgpO1xcbiAgICAgICAgICAgIGRpY3QuUGF0aCA9IHVybC5nZXRQYXRoKCk7XFxuICAgICAgICAgICAgZGljdC5SZWYgPSB1cmwuZ2V0UmVmKCk7XFxuICAgICAgICAgICAgZGljdC5Ib3N0cyA9IGAke2RpY3QuUHJvdG9jb2x9Oi8vJHt1cmwuZ2V0SG9zdCgpfWA7XFxuICAgICAgICB9XFxuICAgICAgICBkaWN0LlBhcmFtcyA9IHBhcmFtcyh1KTtcXG4gICAgICAgIHJldHVybiBkaWN0O1xcbiAgICB9LFxcbiAgICBpc0VxdWFsOiBmdW5jdGlvbih4LCB5KSB7XFxuICAgICAgICBjb25zdCBvayA9IE9iamVjdC5rZXlzLFxcbiAgICAgICAgICAgIHR4ID0gdHlwZW9mIHgsXFxuICAgICAgICAgICAgdHkgPSB0eXBlb2YgeTtcXG4gICAgICAgIHJldHVybiB4ICYmIHkgJiYgdHggPT09IFxcXCJvYmplY3RcXFwiICYmIHR4ID09PSB0eSA/XFxuICAgICAgICAgICAgb2soeCkubGVuZ3RoID09PSBvayh5KS5sZW5ndGggJiZcXG4gICAgICAgICAgICBvayh4KS5ldmVyeSgoa2V5KSA9PiB0aGlzLmlzRXF1YWwoeFtrZXldLCB5W2tleV0pKSA6IHggPT09IHk7XFxuICAgIH0sXFxuICAgIGZpbmREaWZmZXJlbnRJbmRleDogZnVuY3Rpb24oc3RyMSwgc3RyMikge1xcbiAgICAgICAgY29uc3QgZGlmZkNoYXJzID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHN0cjIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBpZiAoc3RyMVtpXSAhPT0gc3RyMltpXSkge1xcbiAgICAgICAgICAgICAgICBkaWZmQ2hhcnMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBpbmRleDogaSxcXG4gICAgICAgICAgICAgICAgICAgIHMxOiBzdHIxW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgczI6IHN0cjJbaV0sXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBkaWZmQ2hhcnM7XFxuICAgIH0sXFxuICAgIHJlcGxhY2VDaGFyQXQ6IGZ1bmN0aW9uKHN0ciwgaW5kZXgsIHJlcGxhY2VtZW50KSB7XFxuICAgICAgICBpZiAoaW5kZXggPCAwIHx8IGluZGV4ID49IHN0ci5sZW5ndGgpIHtcXG4gICAgICAgICAgICByZXR1cm4gc3RyO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy9sb2coaW5kZXgpXFxuICAgICAgICBjb25zdCBhcnIgPSBzdHIuc3BsaXQoXFxcIlxcXCIpO1xcbiAgICAgICAgYXJyW2luZGV4XSA9IHJlcGxhY2VtZW50O1xcbiAgICAgICAgcmV0dXJuIGFyci5qb2luKFxcXCJcXFwiKTtcXG4gICAgfSxcXG4gICAgZ2V0T2JqZWN0S2V5c0RpZmY6IGZ1bmN0aW9uKG9iajEsIG9iajIpIHtcXG4gICAgICAgIGNvbnN0IGRpZmZlcmVudEtleXMgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGtleSBpbiBvYmoxKSB7XFxuICAgICAgICAgICAgaWYgKCFvYmoyLmhhc093blByb3BlcnR5KGtleSkgfHwgb2JqMVtrZXldICE9PSBvYmoyW2tleV0pIHtcXG4gICAgICAgICAgICAgICAgZGlmZmVyZW50S2V5cy5wdXNoKGtleSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgZm9yIChsZXQga2V5IGluIG9iajIpIHtcXG4gICAgICAgICAgICBpZiAoIW9iajEuaGFzT3duUHJvcGVydHkoa2V5KSkge1xcbiAgICAgICAgICAgICAgICBkaWZmZXJlbnRLZXlzLnB1c2goa2V5KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gZGlmZmVyZW50S2V5cztcXG4gICAgfSxcXG4gICAgZ2V0TmV4dFVybDogZnVuY3Rpb24oc291cmNlLCB0YXJnZXQsIHBhcmFtcykge1xcbiAgICAgICAgdmFyIHUxID0gdGhpcy51cmxQYXJzZShzb3VyY2UpO1xcbiAgICAgICAgdmFyIHUyID0gdGhpcy51cmxQYXJzZSh0YXJnZXQpO1xcbiAgICAgICAgdmFyIHBhID0gdW5kZWZpbmVkO1xcbiAgICAgICAgaWYgKHR5cGVvZiBwYXJhbXMgPT0gXFxcIm9iamVjdFxcXCIpIHtcXG4gICAgICAgICAgICBwYSA9IHBhcmFtcy5oYXNPd25Qcm9wZXJ0eShcXFwi54m55b6BXFxcIikgPyBwYXJhbXMu54m55b6BIDogdW5kZWZpbmVkO1xcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIG5leHR1cmwgPSBzb3VyY2U7XFxuICAgICAgICB2YXIgY2EgPSBPYmplY3Qua2V5cyh1Mi5QYXJhbXMpLmxlbmd0aCA9PSAwID8gXFxcIlxcXCIgOiBcXFwiP1xcXCI7XFxuICAgICAgICBpZiAocGEgIT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgdmFyIHJzID0gU3RyaW5nKHUyLlBhdGgpLnJlcGxhY2UobmV3IFJlZ0V4cChwYSksIFxcXCIkMWZ5cGFnZVxcXCIpO1xcbiAgICAgICAgICAgIG5leHR1cmwgPSB1Mi5Ib3N0cyArIHJzICsgY2EgKyB0aGlzLlRvUGFyYW1zKHUyLlBhcmFtcyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmICh0aGlzLmlzRXF1YWwodTEuUGFyYW1zLCB1Mi5QYXJhbXMpKSB7XFxuICAgICAgICAgICAgICAgIGlmIChkdF9kZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHUxLlBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKHUyLlBhdGgpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBkZiA9IHRoaXMuZmluZERpZmZlcmVudEluZGV4KFN0cmluZyh1MS5QYXRoKSwgU3RyaW5nKHUyLlBhdGgpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGR0X2RlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coZGYpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChkZi5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gZGZbMF0uaW5kZXg7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZiA9IGRmLmZpbHRlcigoeCkgPT4gL1xcXFxkKy8udGVzdCh4LnMyKSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmUgPSBmWzBdLmluZGV4O1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciBlcSA9IHRoaXMucmVwbGFjZUNoYXJBdChTdHJpbmcodTIuUGF0aCksIHJlLCBcXFwiZnlwYWdlXFxcIik7XFxuICAgICAgICAgICAgICAgIG5leHR1cmwgPSB1Mi5Ib3N0cyArIGVxICsgY2EgKyB0aGlzLlRvUGFyYW1zKHUyLlBhcmFtcyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIGVwID0gdGhpcy5nZXRPYmplY3RLZXlzRGlmZih1MS5QYXJhbXMsIHUyLlBhcmFtcylcXG4gICAgICAgICAgICAgICAgaWYgKGVwLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICB1MS5QYXJhbXNbZXBbMF1dID0gJ2Z5cGFnZSdcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlcCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIGVxID0gU3RyaW5nKHUxLlBhdGgpLnJlcGxhY2UoL1xcXFxkKy8sIFxcXCJmeXBhZ2VcXFwiKTtcXG4gICAgICAgICAgICAgICAgbmV4dHVybCA9IHUxLkhvc3RzICsgZXEgKyBjYSArIHRoaXMuVG9QYXJhbXModTEuUGFyYW1zKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZygnbmV4dDonK25leHR1cmwpXFxuICAgICAgICByZXR1cm4gbmV4dHVybDtcXG4gICAgfSxcXG59O1xcblxcbmZ1bmN0aW9uIGdldFRydWVsaW5rKG1hcmssIHVybCwgcGFnZSkge1xcbiAgICB2YXIgcCA9IGdldE15VmFyKG1hcmssIHVybCkucmVwbGFjZShcXFwiZnlwYWdlXFxcIiwgcGFnZSk7XFxuICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgIHJldHVybiBnZXRNeVZhcihcXFwieWlfZmlyc3RwYWdlXFxcIiwgcCk7XFxuICAgIH0gZWxzZSBpZiAocCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgcmV0dXJuIHA7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICByZXR1cm4gdXJsO1xcbiAgICB9XFxufVxcbi8v5p6E5bu6XFxuZnVuY3Rpb24gY3JlYXRlTmV4dFBhZ2UoKSB7XFxuICAgIGxldCBzdGFydG51bSA9IDE7XFxuICAgIHZhciBvYmogPSBhcmd1bWVudHNbMF07XFxuICAgIGlmICh0cnVlX3VybCAhPSBnZXRNeVZhcihcXFwieWlfcGFnZXVybFxcXCIsIFxcXCJcXFwiKSkge1xcbiAgICAgICAgY2xlYXJNeVZhcihcXFwieWlfcGFnZXVybFxcXCIpO1xcbiAgICB9XFxuICAgIGlmIChwYWdlID09IHN0YXJ0bnVtICYmIGdldE15VmFyKFxcXCJ5aV9wYWdldXJsXFxcIikgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgIHB1dE15VmFyKFxcXCJ5aV9maXJzdHBhZ2VcXFwiLCB0cnVlX3VybCk7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBuZXh0ID0gZXZhbCjkuIvkuIDpobUpO1xcbiAgICAgICAgICAgIC8vbG9nKFxcXCJuZXh0XFxcIik7XFxuICAgICAgICAgICAgLy9sb2cobmV4dCk7XFxuICAgICAgICB9IGNhdGNoIHtcXG4gICAgICAgICAgICBsb2coXFxcIuWPr+iDveS4jeWtmOWcqOS4i+S4gOmhteaIluiAheS4i+S4gOmhteWumuS9jeaciemXrumimFxcXCIpO1xcbiAgICAgICAgICAgIG5leHQgPSBcXFwiXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChuZXh0ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgdmFyIG54dXJsID0gZXh0TWV0aG9kLmdldE5leHRVcmwodHJ1ZV91cmwsIG5leHQsIG9iaik7XFxuICAgICAgICAgICAgLy9sb2coXFxcIm54dXJsOlxcXCIgKyBueHVybCk7XFxuICAgICAgICAgICAgcHV0TXlWYXIo54q25oCBLCBueHVybCk7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcInlpX3BhZ2V1cmxcXFwiLCBueHVybCk7XFxuICAgICAgICB9XFxuICAgIH1cXG59XFxuXFxuZnVuY3Rpb24gYXV0b1BhZ2UoKSB7XFxuICAgIGlmIChwYWdlID09IDEpI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LjAxNjsgd3YpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIFZlcnNpb24vNC4wIENocm9tZS84OS4wLjQzODkuNzIgTVFRQnJvd3Nlci82LjIgVEJTLzA0NjI3OSBNb2JpbGUgU2FmYXJpLzUzNy4zNlxcXCIsLy9QQ19VQSwgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICBzaG93UHJvZ3Jlc3M6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVjaygpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgbm9kZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcjdGFncycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY28gPSBmYmEuZ2V0Q29va2llKHUpO1xcbi8vdmFyIHVhID0gZmJhLmdldFVhKClcXG4vL2ZiYS5sb2coJ2NvOjo6Ojo6JyArIHVhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgIC8vICBmYmEubG9nKCdjbzo6Ojo6OicgKyBjbyk7XFxudmFyIGh0bWxDb250ZW50ID0gZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmlubmVySFRNTDtcXG5cXG5pZigv5rC45LmF5Z+f5ZCNLy50ZXN0KGh0bWxDb250ZW50KSkge1xcbiAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZSgkJCQoKS5sYXp5UnVsZSgoY28pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvQXBvbGxvL0Nvb2tpZS9qYXZkYl9jb29raWUudHh0JywgY28pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KCflt7Lojrflj5Zjb29raWXvvIzliIfmjaLliLDpppbpobUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgY28pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2ssIDUwMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIE1ZX1VSTClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBzZXRSZXN1bHQoZCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcbnRyeSB7XFxuICAgIC8v57yT5a2Y5LiL5LiA6aG1XFxuICAgIGxldCBuZXh0VXJsID0gcGQoaHRtbCwgXFxcImE6Y29udGFpbnMo5LiL5LiAKSYmaHJlZlxcXCIpO1xcbiAgICBwdXRNeVZhcihcXFwibmV4dFBhZ2VcXFwiLCBuZXh0VXJsIHx8IFxcXCJoaWtlcjovL2VtcHR5XFxcIik7XFxuICAgIC8vbG9nKFxcXCLkuIvkuIDpobXvvJpcXFwiICsgbmV4dFVybClcXG59IGNhdGNoIChlKSB7XFxuICAgIC8vY2xlYXJNeVZhcihcXFwibmV4dFBhZ2VcXFwiKTtcXG4gICAgbGV0IG5leHRVcmwgPSBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgIHRvYXN0KFxcXCLlpb3lg4/msqHmnInku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EnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAvLyBsaXN0LnB1c2gobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51bnNoaWZ0KG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9hcG9sbG8vamF2ZGIvamF2ZGJfYWN0b3IudHh0JywgSlNPTi5zdHJpbmdpZnkobGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGxpc3QuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgbGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX2FjdG9yLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBzdHIpLFxcbiAgICBleHRyYToge1xcXCJncmFkaWVudFxcXCI6dHJ1ZX1cXG59KTtcXG4gICAgfWNhdGNoe31cXG4gICAgICAgaWYgKHR5cGVvZiBwYWdlcyAhPT0gJ3VuZGVmaW5lZCcgJiYgcGFnZXMgIT09IG51bGwpIHtcXG4gICAgICAgICAgc2V0SXRlbSgncGFnZXMnLCBwYWdlcy50b1N0cmluZygpKTtcXG4gICAgICAgICB9IFxcblxcbi8v5ryU5ZGY5YiG57G7XFxuICAgdHJ5e1xcbiAgICAgICAgdmFyIGNhdGVnb3J5ID0gcGRmYShodG1sLFxcXCIuYWN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4gICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgIH0sdGl0bGUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHsgJ2JhY2tncm91bmRDb2xvcic6ICcjNjY2NjY2J31cXG4gICAgICAgICAgICAgICAgfSlcXG5pZihpbmRleD09NCl7XFxuICAgIGQucHVzaCh7Y29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCJ9KVxcbn1cXG4gICAgICAgICB9KVxcbiAgICAgICAgfWNhdGNoe31cXG4gLy/liIblibJcXG4gICAgZC5wdXNoKHtcXG4gICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSlcXG59XFxuXFxuaWYoIXRydWVfdXJsLmluY2x1ZGVzKFxcXCJzZWFyY2hcXFwiKSl7XFxudmFyIHBhZ2VzID0gZ2V0SXRlbSgncGFnZXMnKTtcXG59XFxudHJ5e1xcbmxldCBub3cgPSBnZXRJdGVtKCdub3cnKTtcXG5pZihwYWdlcz4xJiZwYWdlczwzNyl7XFxuZm9yICh2YXIgaiA9IDE7IGogPD0gcGFnZXM7IGogKyspe1xcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9wYWdlPVxcXFxkKy8sICdwYWdlPScraik7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogaiA9PU1ZX1BBR0UgfHwgbm93ID09KCBqICsgJ+mhtScpPyAn4oCc4oCc4oCd4oCdJyArIChqICsgJ+mhtScpLmZvbnRjb2xvcigncmVkJykgOiAoaiArICfpobUnKSxcXG4gICAgICAgIHVybDokKHVybCkubGF6eVJ1bGUoKGopID0+IHtcXG4gICAgICAgICAgICBzZXRJdGVtKFxcXCJub3dcXFwiLCggaiArICfpobUnKSk7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcInVybFxcXCIsI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0c1dpdGgoJyZwYWdlPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1hdGNoLmNoYXJBdCgwKSArICdwYWdlPScgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0cnVlX3VybC5pbmNsdWRlcygnPycpID8gJyZwYWdlPScgOiAnP3BhZ2U9JykgKyBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJ1cmxcXFwiLCBqdW1wdSk7ICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L2g5bey57uP56m/6LaK5Yiw5LqGJyArIGlucHV0ICsgJ+mhtSdcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+36L6T5YWl5q2j56Gu55qE6aG156CBXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIHRydWVfdXJsKVxcbiAgICB9LFxcbiAgICB0cnVlX3VybClcXG59XVxcbn1cXG4gIH0pO1xcbn0pXFxufWVsc2V7XFxuLypcXG4gIGZ1bmN0aW9uIGdldEJpZ1RleHQodGV4dCwgY291bnQpIHtcXG4gICAgaWYgKGNvdW50ID4gMCkge1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7XFxuICAgICAgICAgICAgdGV4dCA9IHRleHQuYmlnKCk7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IC1jb3VudDsgaSsrKSB7XFxuICAgICAgICAgICAgdGV4dCA9IHRleHQuc21hbGwo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VuJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIk1vemlsbGEvNS4wIChMaW51eDsgQW5kcm9pZCAxMjsgU00tRzk3NTAgQnVpbGQvU1AxQS4yMTA4MTIuMDE2OyB3dikgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgVmVyc2lvbi80LjAgQ2hyb21lLzg5LjAuNDM4OS43MiBNUVFCcm93c2VyLzYuMiBUQlMvMDQ2Mjc5IE1vYmlsZSBTYWZhcmkvNTM3LjM2XFxcIiwvL1BDX1VBLCAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgIHNob3dQcm9ncmVzczogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xldCBub2RlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJyN0YWdzJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjbyA9IGZiYS5nZXRDb29raWUodSk7XFxuLy92YXIgdWEgPSBmYmEuZ2V0VWEoKVxcbi8vZmJhLmxvZygnY286Ojo6OjonICsgdWEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coJ2NvOjo6Ojo6JyArIGNvKTtcXG52YXIgaHRtbENvbnRlbnQgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQuaW5uZXJIVE1MO1xcblxcbmlmKC/msLjkuYXln5/lkI0vLnRlc3QoaHRtbENvbnRlbnQpKSB7XFxuICBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5wYXJzZUxhenlSdWxlKCQkJCgpLmxhenlSdWxlKChjbykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9BcG9sbG8vQ29va2llL2phdmRiX2Nvb2tpZS50eHQnLCBjbyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoJ+W3suiOt+WPlmNvb2tpZe+8jOWIh+aNouWIsOmmlumhtScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBjbykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChjaGVjaywgNTAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBjaGVjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgfSwgTVlfVVJMKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIHNldFJlc3VsdChkKTtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICB9KTtcXG59XFxuXFxudHJ5e1xcbnZhciB0aXRsZSA9IHBkZmgoaHRtbCwnaDImJnN0cm9uZyYmVGV4dCcpICsgJyAnICsgcGRmaChodG1sLCdoMiYmLmN1cnJlbnQtdGl0bGUmJlRleHQnKTtcXG52YXIgZGVzY3QgPSBwZGZoKGh0bWwsJ2gyJiYuY3VycmVudC10aXRsZSYmVGV4dCcpO1xcbiAgIGlmKHRpdGxlICE9PW51bGwgJiYgIXRpdGxlLmluY2x1ZGVzKFxcXCLpl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0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICBpZDogJ3RyYW5zZGVzYycsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3t0aXRsZTogJ+e9kemhtScsIGpzOiAkLnRvU3RyaW5nKCgpPT57IFxcbiAgICAgICAgcmV0dXJuIFxcXCJ3ZWI6Ly9cXFwiICsgTVlfVVJMXFxuICAgICAgICAgICAgICAgICAgICAgICB9KX0se3RpdGxlOiAn5aSN5Yi2JywganM6ICQudG9TdHJpbmcoKHRpdGxlKT0+eyBcXG4gICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyB0aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgIH0sdGl0bGUpfSx7dGl0bGU6ICfnmb7luqbnv7vor5EnLCBqczogJC50b1N0cmluZygodGl0bGUpPT57IFxcbiAgICAgICAgcmV0dXJuIFxcXCJ4NTovL2h0dHBzOi8vZmFueWkuYmFpZHUuY29tLyNqcC96aC9cXFwiICsgdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgIH0sdGl0bGUpfSx7dGl0bGU6ICdEZWVwbOe/u+ivkScsIGpzOiAkLnRvU3RyaW5nKCh0aXRsZSk9PnsgXFxuICAgICAgICByZXR1cm4gXFxcIng1Oi8vaHR0cHM6Ly93d3cuZGVlcGwuY29tL3poL3RyYW5zbGF0b3ItbW9iaWxlI2phL3poL1xcXCIgKyB0aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgfSx0aXRsZSl9LHt0aXRsZTogJ+iwt+atjOe/u+ivkScsIGpzOiAkLnRvU3RyaW5nKCh0aXRsZSk9PnsgXFxuICAgICAgICByZXR1cm4gXFxcIng1Oi8vaHR0cHM6Ly90cmFuc2xhdGUuZ29vZ2xlLmNvbS8/aGw9emgtQ04mc2w9amEmdGw9emgtQ04mdGV4dD1cXFwiICsgdGl0bGVcXG4gICAgICAgICAgICAgICAgICAgICAgIH0s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aWJsZTpmYWxzZX1cXG59KVxcblxcbi8v5aSW6YOo6LWE5rqQ6LCD55SoXFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdG9vbCcsIHt9KSkucnVsZSk7XFxuXFxuZC5wdXNoKHtcXG4gICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG59KVxcblxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgXFxcIi5wcmV2aWV3LWltYWdlcyYmLnRpbGUtaXRlbSwxOlxcXCIpXFxuICAgICAgICAgIC8vICBpZiAobGlzdC5sZW5ndGg8MSkge1xcbmQucHVzaCh7XFxuICAgIGNvbF90eXBlOiAnYmlnX2JsYW5rX2Jsb2NrJ1xcbn0se1xcbiAgICBjb2xfdHlwZTogJ2JpZ19ibGFua19ibG9jaydcXG59KVxcbi8vfVxcbiAgICAgICAgICAgIGlmIChsaXN0Lmxlbmd0aD4wKSB7XFxuICAgICAgICAgICAgICAgIHZhciBwaWNudW0gPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdJyArIChwaWNudW0gKyBsaXN0Lmxlbmd0aCArXFxcIiBQXFxcIikuZm9udGNvbG9yKFxcXCIjMUU5MEZGXFxcIikuc21hbGwoKSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSwgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyAkKFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC5sYXp5UnVsZSgobGlzdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihcXFwicGljbGlzdFxcXCIsIFxcXCLmlLbotbdcXFwiKSA9PSBcXFwi5pS26LW3XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKCdwaWNudW0nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgXFxcIuOAkOaUtui1t+WbvueJh+OAkVxcXCIuZm9udGNvbG9yKFxcXCIjRkYwMEZGXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyAkKFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGF6eVJ1bGUoKGxpc3QpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IGxpc3QubGVuZ3RoIC0gMTsgaSA+PSAwOyBpLS0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oJ3ByZXZpZXdwaWMnICsgaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbSgnbm9waWNsaXN0Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJwaWNsaXN0XFxcIiwgXFxcIuaUtui1t1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwibm9waWNsaXN0XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gbGlzdC5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcigncGljbnVtJywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKGxpc3RbaV0sIFxcXCJhJiZocmVmXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicGljXzFfZnVsbFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogJ3ByZXZpZXdwaWMnICsgaVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwicGljbGlzdFxcXCIsIFxcXCLlsZXlvIBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSBsaXN0Lmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbSgncHJldmlld3BpYycgKyBpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oJ25vcGljbGlzdCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInBpY2xpc3RcXFwiLCBcXFwi5pS26LW3XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2gge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCksICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2gge31cXG5cXG52YXIgbGlzdFZpZGVvcyA9IEpTT04ucGFyc2UoZmV0Y2hQQygnaGlrZXI6Ly9maWxlcy9ydWxlcy9hcG9sbG8vamF2ZGIvam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IH0sIOivhuWIq+eggSlcXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn56OB5Yqb5pCc5qCH6aKYJyxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9zb3U/cnVsZT3no4HlipvlkJsu566AJnA9ZnlwYWdlJnNlYXJjaFRlcm1zPVxcXCIgKyB0aXRsZVxcbiAgICAgICAgICAgICAgICB9LCB0aXRsZSlcXG4gICAgICAgICAgICB9XVxcbiAgICAgICAgfSA6ICcnXFxuICAgIH0pO1xcbiAgICBpZiAoaW5kZXggPT0gMCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdCxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIHN0ciA9IGZldGNoUEMoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX3ZpZGVvLnR4dCcpO1xcbiAgICAgICAgICAgICAgICBpZiAoIXN0cikge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBbbmFtZV07XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX3ZpZGVvLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gSlNPTi5wYXJzZShzdHIpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QuaW5kZXhPZihuYW1lKSA9PSAnLTEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAvLyBsaXN0LnB1c2gobmFtZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51bnNoaWZ0KG5hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9ydWxlcy9hcG9sbG8vamF2ZGIvamF2ZGJfdmlkZW8udHh0JywgSlNPTi5zdHJpbmdpZnkobGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgIHZhciBpbmRleCA9IGxpc3QuaW5kZXhPZihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgbGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvYXBvbGxvL2phdmRiL2phdmRiX3ZpZGVvLnR4dCcsIEpTT04uc3RyaW5naWZ5KGxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBzdHIpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgZXh0cmE6IHtpZDogXFxcInBpY251bVxcXCJ9XFxuICAgICAgICB9KTtcXG5kLnB1c2goe1xcbmNvbF90eXBlOlxcXCJibGFua19ibG9ja1xcXCJcXG59KVxcbiAgICB9XFxufSk7XFxuXFxuLy/niYfllYZcXG50cnkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLniYfllYY6XFxcIixcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyx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6Ka94pGgPC9mb250PjwvbWlkZGxlPicsXFxuICAgICAgICB1cmw6IE1ZX1VSTCArICQoJycpLmxhenlSdWxlKCjor4bliKvnoIEpID0+IHtcXG4gICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IHBkZmgoaHRtbCxcXFwiLm1lc3NhZ2UtYm9keSYmc291cmNlJiZzcmNcXFwiKVxcbiAgICAgICAgICAgICAgICAgICBpZiggIXVybC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikmJnVybCE9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSBcXFwiaHR0cHM6XFxcIiArIHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZih1cmw9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mspLmnInpoJDopr3lkq9cXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgICB9Y2F0Y2h7cmV0dXJuIFxcXCJ0b2FzdDovL+aykuaciemgkOimveWSr1xcXCJ9XFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsICAgICAgICBcXG4gICAgICAgICAgICAgICAgIH0pXFxuICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPG1pZGRsZT48Zm9udCBjb2xvcj0jMTNCNjZBPvCfk7rpoJDopr3ikaE8L2ZvbnQ+PC9taWRkbGU+JyxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiICsgJCgnJykubGF6eVJ1bGUoKOivhuWIq+eggSkgPT4ge1xcbiAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgc2VhcmNoID0gXFxcImh0dHBzOi8vamF2c3VidGl0bGVkLmNvbS96aC9zZWFyY2g/a2V5d29yZHM9XFxcIiArIOivhuWIq+eggVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGNvZGV1cmwgPSBcXFwiaHR0cHM6Ly9qYXZzdWJ0aXRsZWQuY29tL1xcXCIgKyBwZGZoKHJlcXVlc3Qoc2VhcmNoKSxcXFwiYm9keSYmLnZpZGVvYm94JiZhJiZocmVmXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwbGF5bGlzdCA9IGZldGNoKGNvZGV1cmwpLm1hdGNoKC9odHRwcz86XFxcXC9cXFxcL1xcXFxTK1xcXFwubTN1OC8pWzBdXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGxheWhkID0gZmV0Y2gocGxheWxpc3QpLm1hdGNoKC9bXlxcXCJcXFxcbl0rXFxcXC5tM3U4L2cpLnBvcCgpXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJsID0gcGxheWxpc3QucmVwbGFjZShcXFwicGxheWxpc3QubTN1OFxcXCIscGxheWhkKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybFxcbiAgICAgICAgICAgICB9Y2F0Y2h7cmV0dXJuIFxcXCJ0b2FzdDovL+aMguair+aIluaykuaciemgkOimveWSr1xcXCJ9XFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsICAgICAgIFxcbiAgICAgICAgICAgICAgICAgfSlcXG52YXIg55+t6KmVID0gcGRmaChodG1sLFxcXCIudGFicyYmbGlbZGF0YS1tb3ZpZS10YWItdGFyZ2V0PXJldmlld1RhYl0mJlRleHRcXFwiKVxcbnZhciBjaWxpID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnYm9keSYmLml0ZW0uY29sdW1ucy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JyArIG1hdGNoMiArICcuKiknLCAnaScpO1xcbiAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UocmVnZXgsICckMScpO1xcbn1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiB0aXRsZVxcbiAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKFxcXCIudG9ycmVudFxcXCIsXFxcIlxcXCIpXFxuICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoXFxcIi5tcDRcXFwiLFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9AL2csXFxcIlxcXFx0XFxcXHRcXFwiKVxcbiAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC9tcDQvZ2ksXFxcIlxcXCIpLFxcbiAgICAgICAgZGVzYzogdGFnLnJlcGxhY2UoL1xcXFxzLyxcXFwiXFxcIikgKyAnXFxcXHTwn5OAJyArIHNpemUgKyAnXFxcXHRcXFxcdPCfl5MnICtwYXJzZURvbUZvckh0bWwodmlkZW8sICcudGltZSYmVGV4dCcpLFxcbiAgICAgICAgcGljX3VybDogJ2h0dHBzOi8vaW1nLnZpbnVhLmNuL2ltYWdlcy9PY3Fwai5wbmcnLFxcbiAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5bm75b2xJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wZW5BcHBJbnRlbnQoJ2NvbS54aW5nc3UuZG93bmxvYWRlcicsICdjb20uZTRhLnJ1bnRpbWUuYW5kcm9pZC5tYWluQWN0aXZpdHknLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlbnREYXRhOiB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfpl6rlrZjkupEnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3BlbkFwcEludGVudCgnY29tLnNoYW54aWF6YWlkb3duJywgJ2NvbS5lNGEucnVudGltZS5hbmRyb2lkLm1haW5BY3Rpdml0eScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudERhdGE6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+S6jOmptCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuQXBwSW50ZW50KCdjb20ucWlrY2xvdWQucWlrJywgJ2NvbS5lNGEucnVudGltZS5hbmRyb2lkLm1haW5BY3Rpdml0eScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudERhdGE6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+aCn+epuicsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuQXBwSW50ZW50KCdjb20ueWZvby53a0Rvd25sb2FkZXInLCAnY29tLnlmb28ud2tEb3dubG9hZGVyLk1haW5BY3Rpdml0eScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudERhdGE6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+Wwj+eZvScsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuQXBwSW50ZW50KCd4Yi5kb3dubG9hZC5jb20nLCAnaW8uZGNsb3VkLlBhbmRvcmFFbnRyeScsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVudERhdGE6IHVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+i/hembtycsXFxuICAgICAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcGVuQXBwSW50ZW50KCdjb20ueHVubGVpLmRvd25sb2FkcHJvdmlkZXIubGl0ZScsICdjb20ueHVubGVpLmRvd25sb2FkcHJvdmlkZXIubGF1bmNoLkxhdW5jaEFjdGl2aXR5Jywge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW50RGF0YTogdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfSx7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICdQaWtwYWsnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJwaWtwYWthcHA6Ly9teXBpa3Bhay5jb20veHBhbi9tYWluX3RhYj90YWI9MSZhZGRfdXJsPVxcXCIgKyB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgfV1cXG59XFxuICAgIH0pO1xcbn0pXFxufWNhdGNoe31cXG4gICAgICAgfWVsc2UgaWYgKGluZGV4ID09IDEpIHtcXG50cnl7XFxuICAgICAgIHZhciB1cmwgPSBwZChodG1sLFxcXCIudGFicyYmbGlbZGF0YS1tb3ZpZS10YWItdGFyZ2V0PXJldmlld1RhYl0mJmEmJmRhdGEtdXJsXFxcIilcXG4gICAgICAgdmFyIGggPSBmZXRjaCh1cmwsIHtcXG4gICAgaGVhZGVyczoge1xcbiAgICAgICAgY29va2llOiBmZXRjaFBDKCdoaWtlcj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tcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge2xpbmVWaXNpYmxlOmZhbHNlfVxcbiAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgfSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jMTNCNjZBPuabtOWkmuefreipleWPr+aIkOS4ulZJUOaIluiHs+WumOaWuUFwcOS4reafpeecizwvZm9udD48L3NtYWxsPicsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOivhuWIq+eggSkgPT4geyAgICAgICAgICAgICAgIFxcbiAgICAgICAgIG9wZW5BcHBJbnRlbnQoJ3h4eC5wb3JuaHViLmZ1Y2snLCAneHh4LnBvcm5odWIuZnVjay5NYWluQWN0aXZpdHknLCB7aW50ZW50RGF0YTog6K+G5Yir56CBfSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsg6K+G5Yir56CBXFxuICAgICAgICAgICAgICAgICAgfSzor4bliKvnoIEpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge2xpbmVWaXNpYmxlOmZhbHNlfVxcbiAgICAgICAgICAgICAgIH0pXFxufWNhdGNoe31cXG4gICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICBwbGF5TGlzdHMoKSAgICAgICAgXFxuICAgICAgICAgICAgfVxcblxcbnNldFRhYnModGFicywgTVlfVVJMKTtcXG5zZXRMaXN0cyhsaXN0cywgZ2V0TXlWYXIoTVlfVVJMLCAnMCcpKTtcXG5cXG5cXG5cXG50cnl7XFxudmFyIGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2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biAgICB2YXIgbGlzdCA9IEpTT04ucGFyc2Uoc3RyKTtcXG4gICAgbGlzdC5mb3JFYWNoKChsaXN0KSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBsaXN0LnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgIGltZzogbGlzdC5zcGxpdCgnQEAnKVsxXSxcXG4gICAgICAgICAgICB1cmw6IGxhYmVsID09IFxcXCLmvJTlk6FcXFwiPydoaWtlcjovL3BhZ2UveWonOidoaWtlcjovL3BhZ2UvZWonLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBsYWJlbCA9PSBcXFwi5ryU5ZOhXFxcIiA/ICdjYXJkX3BpY18zJyA6ICdtb3ZpZV8yJyxcXG4gICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICB1cmw6IGxpc3Quc3BsaXQoJ0BAJylbMl0ucmVwbGFjZShnZXRNeVZhcigneW9uZ2ppdScpLE1ZX0hPTUUpLFxcbiAgICAgICAgICAgICAgcGFnZVRpdGxlOiBsaXN0LnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Y+W5raI5pS26JePJyxcXG4gICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygobGlzdCwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9IEpTT04ucGFyc2UoZmV0Y2hQQyh1KSB8fCAnW10nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IGRhdGEuZmlsdGVyKHggPT4geCAhPSBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHUsIEpTT04uc3RyaW5naWZ5KGRhdGEpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgcmV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FxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnLFxcbiAgICAgICAgICAgICAgICB1cmw6IE1ZX1VSTCxcXG4gICAgICAgICAgICAgICAgZGVzYzogJ2xpc3QmJnNjcmVlbicsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJNb3ppbGxhLzUuMCAoTGludXg7IEFuZHJvaWQgMTI7IFNNLUc5NzUwIEJ1aWxkL1NQMUEuMjEwODEyLjAxNjsgd3YpIEFwcGxlV2ViS2l0LzUzNy4zNiAoS0hUTUwsIGxpa2UgR2Vja28pIFZlcnNpb24vNC4wIENocm9tZS84OS4wLjQzODkuNzIgTVFRQnJvd3Nlci82LjIgVEJTLzA0NjI3OSBNb2JpbGUgU2FmYXJpLzUzNy4zNlxcXCIsLy9QQ19VQSwgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICBzaG93UHJvZ3Jlc3M6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjaGVjaygpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgbm9kZXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcjdGFncycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgY28gPSBmYmEuZ2V0Q29va2llKHUpO1xcbi8vdmFyIHVhID0gZmJhLmdldFVhKClcXG4vL2ZiYS5sb2coJ2NvOjo6Ojo6JyArIHVhKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgLy8gICBmYmEubG9nKCdjbzo6Ojo6OicgKyBjbyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjby5pbmNsdWRlcygncmVtZW1iZXJfbWVfdG9rZW4nKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLnBhcnNlTGF6eVJ1bGUoJCQkKCkubGF6eVJ1bGUoKGNvKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL3J1bGVzL0Fwb2xsby9Db29raWUvamF2ZGJfY29va2llLnR4dCcsIGNvKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6LSm5Y+35bey55m75b2VJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjayh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGNvKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGNoZWNrLCA1MDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoZWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBNWV9VUkwpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcblxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0olwiLFwicGF0aFwiOlwic2VhcmNoXCIsXCJydWxlXCI6XCIgICAgICAgIGlmIChwYWdlID09PSAxKSB7XFxuICAgICAgICAgICAgdmFyIHRhYnMgPSBbXFxcIuW9seeJh1xcXCIsIFxcXCLmvJTlkZhcXFwiLCBcXFwi5Y+v5pKt5pS+XFxcIiwgXFxcIuS4reWtl1xcXCIsIFxcXCLno4Hpk75cXFwiLCBcXFwi5riF5Y2VXFxcIl1cXG4gICAgICAgICAgICB2YXIgbGlzdHMgPSBbXFxcImFsbFxcXCIsIFxcXCJhY3RvclxcXCIsIFxcXCJwbGF5YWJsZVxcXCIsIFxcXCJjbnN1YlxcXCIsIFxcXCJkb3dubG9hZFxcXCIsIFxcXCJsaXN0XFxcIl1cXG5cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0VGFicyh0YWJzKSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpIGluIHRhYnMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoXFxcInRhYlxcXCIsICcwJykgPT0gaSA/ICfigJjigJjigJnigJk8c3Ryb25nPjxmb250IGNvbG9yPVxcXCIjNEVCN0U0XFxcIj4nICsgdGFic1tpXSArICc8L2ZvbnQ+PC9zdHJvbmc+JyA6IHRhYnNbaV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5sYXp5UnVsZSgoaSwgbGlzdHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJ0YWJcXFwiLCBpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdrZXknKSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrZXlzID0gbGlzdE15VmFyS2V5cygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGtleXMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJ0YWJcXFwiLCBpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIGdldFB1YmxpY0l0ZW0oJ2phdmRiMCcpICsgXFxcIi9zZWFyY2g/Zj1cXFwiICsgbGlzdHNbaV0gKyBcXFwiJnE9XFxcIiArIGdldE15VmFyKCdrZXknKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGksIGxpc3RzKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0TGlzdHMobGlzdHMsIGluZGV4KSB7XFxuICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBwbGF5TGlzdHMoKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5KOXFxcIiArIHRhYnNbaW5kZXhdICsgXFxcIvCfko5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAn5pCc57Si5L2g5oOz6KaB55qEJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJC50b1N0cmluZygobGlzdHMsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigna2V5JywgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5cyA9IGxpc3RNeVZhcktleXMoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBrZXlzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigneWlfZmlyc3RwYWdlJywgZ2V0UHVibGljSXRlbSgnamF2ZGIwJykrXFxcIi9zZWFyY2g/Zj1cXFwiICsgbGlzdHNbaW5kZXhdICsgXFxcIiZxPVxcXCIgKyBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgbGlzdHMsIGluZGV4KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ2tleScsICcnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ2tleScsIGlucHV0KVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdHMoKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgc2V0VGFicyh0YWJzLCB0cnVlX3VybCk7XFxuICAgICAgICAgICAgc2V0TGlzdHMobGlzdHMsIGdldE15VmFyKCd0YWInLCAnMCcpKTtcXG4gICAgICAgIH07XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLikaDkuIDnuqflpJbpg6hGYzJcIixcInBhdGhcIjpcImZjMlwiLFwicnVsZVwiOlwianM6IFxcbi8vc2V4ODA4NkBnbWFpbC5jb21cXG4vL2h0dHBzOi8vamF2bGlzdC5tZS9wb3N0LnBocFxcblxcbmFkZExpc3RlbmVyKFxcXCJvbkNsb3NlXFxcIiwgKCkgPT4ge1xcbiAgICAgICAvLyBjbGVhck15VmFyKFxcXCJmY3VybFxcXCIpO1xcbn0pO1xcblxcbiAgICB2YXIgZCA9IFtdXFxuXFxuICAgIFxcbiAgICBzZXRSZXN1bHQoZClcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuavj+aXpeS4gOiogFwiLFwicGF0aFwiOlwieWl5YW5cIixcInJ1bGVcIjpcIi8vYXV0aG9yOueyieWmuVxcbmZ1bmN0aW9uIHNhdmVfZGF5X3NheV9jYWNoZSgpIHtcXG4gICAgbGV0IGRheV9zYXlfY2FjaGUgPSB7fVxcbiAgICBsZXQgZGF5X3NheV9odG1sID0gZmV0Y2goJ2h0dHBzOi8vdjE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Y2FjaGUoKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGRheV9zYXkgPSBkYXlfc2F5X2NhY2hlWydjb250ZW50J11cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGRheV9zYXkgPSBzYXZlX2RheV9zYXlfY2FjaGUoKVxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIHtcXG4gICAgICAgIGRheV9zYXkgPSAnJ1xcbiAgICB9XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLnv7vor5FcIixcInBhdGhcIjpcInRyYW5zXCIsXCJydWxlXCI6XCIgICAgLy/nv7vor5FcXG4gICAgZnVuY3Rpb24gdHJhbnNsYXRlKHRleHQpe1xcbiAgICAgICAgdmFyIHN3aXRjaHRyYW5zID0gZ2V0SXRlbSgnc3dpdGNodHJhbnMnLCflsI/niZvnv7vor5EnKTtcXG4gICAgICAgIGlmIChzd2l0Y2h0cmFucyA9PSB0cnVlIHx8IHN3aXRjaHRyYW5zID09IFxcXCLlvankupHlsI/or5FcXFwiKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdmFyIHRvID0gJ3poJ1xcbiAgICAgICAgICAgICAgICB2YXIgZnJvbSA9ICdhdXRvJ1xcblxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gaW5pdF9kYXRhKHNvdXJjZV9sYW5nLCB0YXJnZXRfbGFuZykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZTogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldGVjdDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgb3NfdHlwZTogJ2lvcycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZV9pZDogJ0YxRjkwMkY3LTE3ODAtNEM4OC04NDhELTcxRjM1RDg4QTYwMicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zX3R5cGU6IHNvdXJjZV9sYW5nICsgJzInICsgdGFyZ2V0X2xhbmcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lZGlhOiAndGV4dCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RfaWQ6IDQyNDIzODMzNSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcl9pZDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRpY3Q6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZ2V0UmFuZG9tTnVtYmVyKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJhbmQgPSBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiA5OTk5OSkgKyAxMDAwMDBcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmFuZCAqIDEwMDBcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY29uc3QgcG9zdF9kYXRhID0gaW5pdF9kYXRhKGZyb20sIHRvKVxcbiAgICAgICAgICAgICAgICBwb3N0X2RhdGEuc291cmNlID0gdGV4dFxcbiAgICAgICAgICAgICAgICBwb3N0X2RhdGEucmVxdWVzdF9pZCA9IGdldFJhbmRvbU51bWJlcigpXFxuICAgICAgICAgICAgICAgIGxldCByZXMgPSBmZXRjaCgnaHR0cHM6Ly9pbnRlcnByZXRlci5jeWFwaS5jbi92MS90cmFuc2xhdG9yJywge1xcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnQ29udGVudC1UeXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd4LWF1dGhvcml6YXRpb24nOiAndG9rZW4gc3NkajI3M2tzZGl3aTkyM2JzZDknLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1c2VyLWFnZW50JzogJ2NhaXl1bkludGVycHJldGVyLzUgQ0ZOZXR3b3JrLzE0MDQuMC41IERhcndpbi8yMi4zLjAnLFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IHBvc3RfZGF0YSxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IEpTT04ucGFyc2UocmVzKVxcbiAgICAgICAgICAgICAgICAgICAgLnRhcmdldFxcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0ICsgXFxcIuOAkOKYge+4j+OAkVxcXCJcXG4gICAgICAgICAgICB9IGNhdGNoIHtcXG4gICAgICAgICAgICAgICAgbG9nKFxcXCLnv7vor5HlpLHotKXvvIzkvb/nlKjljp/mlodcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRleHRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2UgaWYgKHN3aXRjaHRyYW5zID09IFxcXCLlsI/niZvnv7vor5FcXFwiKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IFxcXCJodHRwczovL2FwaS5uaXV0cmFucy5jb20vTml1VHJhbnNTZXJ2ZXIvdHJhbnNsYXRpb25cXFwiO1xcbiAgICAgICAgICAgICAgICB2YXIgYXBpID0gZ2V0SXRlbSgnYXBpJyk7XFxuICAgICAgICAgICAgICAgIGlmIChhcGkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZXh0ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxhbmcgPSBcXFwiaHR0cHM6Ly90ZXN0Lm5pdXRyYW5zLmNvbS9OaXVUcmFuc1NlcnZlci9sYW5ndWFnZT9zcmNfdGV4dD1cXFwiICsgdGV4dCArIFxcXCImc291cmNlPXRleHRcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmcm9tID0gSlNPTi5wYXJzZShmZXRjaChsYW5nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDEwMDBcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmxhbmd1YWdlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXN1bHQgPSBwb3N0KHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNfdGV4dDogdGV4dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206IGZyb20sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bzogXFxcInpoXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwaWtleTogYXBpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiAxMjIzXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRhdGEgPSBKU09OLnBhcnNlKHJlc3VsdClcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YS50Z3RfdGV4dCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZGF0YS50Z3RfdGV4dCArIFxcXCLjgJDwn5Cu44CRXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhcXFwi57+76K+R5aSx6LSl77yM5L2/55So5Y6f5paHXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coXFxcIue/u+ivkeWksei0pe+8jOWOn+aWh+S4uuepulxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi6aKE5aSE55CG6K+35aGr5YaZ57+76K+RYXBpXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGNhdGNoIHtcXG4gICAgICAgICAgICAgICAgbG9nKFxcXCLnv7vor5HlpLHotKXvvIzkvb/nlKjljp/mlodcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRleHRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiB0ZXh0XFxuICAgICAgICB9XFxuICAgIH07XFxuXFxuJC5leHBvcnRzLnRyYW5zbGF0ZSA9IHRyYW5zbGF0ZVwifV0iLCJpY29uIjoiaHR0cHM6Ly9pbWcudmludWEuY24vaW1hZ2VzL3pyTGtRLnBuZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment