Advertisement
xiaomianao666

邀您一起看:番·仓________风吹花海轻舞,醉卧番仓梦乡。

Jun 13th, 2024
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥番·仓________风吹花海轻舞,醉卧番仓梦乡。@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczpcXG52YXIgY2hwID0gW107XFxudHJ5IHtcXG4gICAgdmFyIGh0bWwgPSBnZXRSZXNDb2RlKCk7XFxuICAgIHZhciBjb250cyA9IHBhcnNlRG9tRm9yQXJyYXkoaHRtbCwgJ2JvZHkmJi5zb3J0LWl0ZW0nKTtcXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGNvbnRzW2ldLCAnYm9keSYmYScpO1xcbiAgICAgICAgY2hwLnB1c2gobGlzdC5sZW5ndGgpO1xcbiAgICB9ICAgICBcXG59IGNhdGNoIChlKSB7fVxcbnNldFJlc3VsdCgn5pu05paw6IezOicgKyAoTWF0aC5tYXguYXBwbHkobnVsbCwgY2hwKSkpO1wiLFwibGlzdFRvQ2xlYXJBc3NvY2lhdGVkRktcIjpbXSxcImxpc3RUb0NsZWFyU2VsZkZLXCI6W10sXCJwYWdlTGlzdFwiOlt7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5LiA57qn5YiG57G75YiX6KGoXCIsXCJwYXRoXCI6XCJ5aVwiLFwicnVsZ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IHtcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgIH1cXG4gICAgICByZXR1cm4gZmFsc2U7XFxuICAgIH0sXFxuICAgIGlzQm9vbGVhbih2YXJpYWJsZSkge1xcbiAgICAgIGlmICh0eXBlb2YgdmFyaWFibGUgIT09IFxcXCJib29sZWFuXFxcIikge1xcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFwiKTtcXG4gICAgICB9XFxuICAgIH0sXFxuICAgIOa4hemZpChsaXN0KSB7XFxuICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICB9XFxuICAgICAgaWYgKGxpc3QuY29uc3RydWN0b3IgPT0gU3RyaW5nKSB7XFxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFwiKTtcXG4gICAgICB9XFxuICAgICAgdGhpcy5jbGVhcnMgPSBsaXN0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDlhajmuIUobGlzdCkge1xcbiAgICAgIGlmICh0aGlzLmlzTnVsbChsaXN0KSkge1xcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgfVxcbiAgICAgIHZhciBjID0gdGhpcy5jbGVhcmFsbDtcXG4gICAgICBsaXN0ID0gYy5jb25jYXQobGlzdCk7XFxuICAgICAgdGhpcy5jbGVhcmFsbCA9IGxpc3Q7XFxuICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIOa6kOeggShpbnB1dCkge1xcbiAgICAgIHRoaXMuaHRtbCA9IGlucHV0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDnlYzpnaIoaW5wdXQpIHtcXG4gICAgICB0aGlzLmxheW91dCA9IGlucHV0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDpobXnoIEoaW5wdXQpIHtcXG4gICAgICB0aGlzLnBhZ2UgPSBpbnB1dDtcXG4gICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAg54q25oCBKGlucHV0KSB7XFxuICAgICAgdGhpcy5zdGF0ZSA9IGlucHV0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDlvIDlkK/mkJzntKIoKSB7XFxuICAgICAgdGhpcy5zZWFyY2ggPSB0cnVlO1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDlvIDlkK/mipjlj6AoaW5wdXQpIHtcXG4gICAgICBpZiAoaW5wdXQgPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICBpbnB1dCA9IHRydWU7XFxuICAgICAgfVxcbiAgICAgIHRoaXMuaXNCb29sZWFuKGlucHV0KTtcXG4gICAgICB0aGlzLm9wZW4gPSBpbnB1dDtcXG4gICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAgc2V0VGl0bGUoaywgaSwgdCkge1xcbiAgICAgIHJldHVybiBrID09IGkgPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKHRoaXMu5YiG57G76aKc6ImyKSA6IHQ7XFxuICAgIH0sXFxuICAgIGFjdGlvbihvYmopIHtcXG4gICAgICByZXR1cm4gW1xcbiAgICAgICAge1xcbiAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICBsb2cob2JqKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKG9iai5zdGF0ZSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICBj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XG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgfSxcXG4gICAgICAgIH0pO1xcbiAgICAgIH1cXG4gICAgICBjb25zdCBjYXRlZ29yaWVzID0gW107XFxuICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgaWYoeC7kuIDnuqflrprkvY0pe1xcbiAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7kuIDnuqflrprkvY0pO1xcbiAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYoeC7lpKfnsbvlrprkvY0pe1xcbiAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7lpKfnsbvlrprkvY0pO1xcbiAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIGxpc3QgPSBbcGRmYShodG1sLCB4LuWkp+exu+WumuS9jSkuam9pbignXFxcXG4nKV07XFxuICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIOS4gOe6pyA9IGxpc3QubWFwKChzKSA9PiB7XFxuICAgICAgICAgIHZhciBzbGlzdCA9IFtdO1xcbiAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgaWYgKHgu5bCP57G7LnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgIHNsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIHZhciDlrprkvY0gPSBzbGlzdC5tYXAoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIHgu5qCH6aKYKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgeCk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHsgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCB9O1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgLy9sb2co5LiA57qnKVxcbiAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgIH0pO1xcbiAgICAgIGlmICjmipjlj6DnirbmgIEpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgIChmb2xkLCB1LCBhbGwpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcIjFcXFwiID8gXFxcIjBcXFwiIDogXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAg54q25oCBLFxcbiAgICAgICAgICAgICAg5YWo5riFXFxuICAgICAgICAgICAgKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICBsb25nQ2xpY2s6IHRoaXMuYWN0aW9uKHtcXG4gICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgYWxsOiDlhajmuIUsXFxuICAgICAgICAgICAgICAgIGNsOiDmuIXpmaQsXFxuICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICB9XFxuICAgICAgaWYgKHBhZ2UgPT0gM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AgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBqc29uPScnXFxuICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIC8vbGV0IHVybCA9IHBkKGl0ZW0sIF/lpKfnsbvpk77mjqUpO1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAvKmlmICjlpKfnsbvlpITnkIYpIHtcXG4gICAgICAgICAgICAgIHVybCA9IOS4gOe6p+WIhuexu+WkhOeQhih1cmwpO1xcbiAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgIC8vbG9nKHVybClcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09IFxcXCIxXFxcIiB8fCDmipjlj6DnirbmgIEgPT0gZmFsc2UpIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgdmFyIGV4dHJhcG9zID0gZmFsc2U7XFxuICAgICAgICAgICAgLyppZiAoaXRlbS5pbmNsdWRlcygndHlwZT1cXFwiQGV4dHJhXFxcIicpKSB7XFxuICAgICAgICAgICAgICBleHRyYXBvcyA9IHRydWU7XFxuICAgICAgICAgICAgICAvL2xvZygn6ZmE5Yqg5a6a5L2NJylcXG4gICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICBpZiAoZXh0cmFwb3MpIHtcXG4gICAgICAgICAgICAgIHZhciB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcImEmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIHZhciBqc29uID0ge1xcbiAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIFxcXCJhJiZzdGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCBcXFwiYSYmdmFsdWVcXFwiKSxcXG4gICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgIHZhciBqc29uID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAvKnN3aXRjaCAodHJ1ZSkge1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVswXSksXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTog5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAvLyBqc29uID0gcGQoaXRlbSwg5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgLyp2YXIganNvbj3liIbnsbvpk77mjqUuaW5jbHVkZXMoJ0BAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMV0pLFxcbiAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKCk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJ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xcInBhZ2VudW1cXFwiKTtcXG4gICAgICAgIGRlbGV0ZUl0ZW0oXFxcInBhZ2VsaW5lXFxcIik7XFxuICAgICAgICB2YXIgaWQgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciBjbHMgPSBcXFwiXFxcIjtcXG4gICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXG4gICAgICAgIHZhciBkZXNjID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYyk7XFxuICAgICAgICB2YXIgaW1nID0gdGhpcy5pbWdIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICB2YXIgY29udGVudCA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgY2xzID0gXFxcImxhc3RtYXJrXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZXI/dXJsPVxcXCIgKyB1cmwsXFxuICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgIH0sXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgaWQ6IFxcXCJwYWdlbGluZVxcXCIsXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c21hbGw+5Yqg6L295LitLi4uPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIGlkOiBcXFwicGFnZW51bVxcXCIsXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgdXBkYXRlSXRlbShcXFwicGFnZW51bVxcXCIsIHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7liLDlupXkuoY8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgaWQ6IFxcXCJsYXN0XFxcIixcXG4gICAgICAgIH0sXFxuICAgICAgfSk7XFxuICAgIH1cXG4gICAgaWYgKGxpc3QubGVuZ3RoID09IDA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AgKFdpbmRvd3MgTlQgMTAuMCknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSx0aW1lb3V0OjUwMDBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvZXZhbC4qP1xcXFxuLylbMF0pXFxuICAgICAgICAgICAgICAgICB2YXIgc291cmNlMTkyMCA9IHNvdXJjZTEyODAucmVwbGFjZShcXFwiMTI4MHg3MjBcXFwiLFxcXCIxOTIweDEwODBcXFwiKVxcbiAgICAgICAgICAgICAgICAgdmFyIGNvZGUgPSBKU09OLnBhcnNlKGZldGNoKHNvdXJjZTE5MjAse29ubHlIZWFkZXJzOnRydWUsdGltZW91dDozMDAwfSkpLnN0YXR1c0NvZGU7XFxuICAgICAgICAgICAgICAgICBpZihjb2RlICE9PSAyMDApe1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHNvdXJjZTEyODAgXFxuLy8rICc7e1JlZmVyZXJAaHR0cHM6Ly90aGlzYXYuY29tfSdcXG59ZWxzZXtcXG4gICAgICAgICAgICAgICAgIHJldHVybiBzb3VyY2UxOTIwIFxcbi8vKyAnO3tSZWZlcmVyQGh0dHBzOi8vdGhpc2F2LmNvbX0nXFxuICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgIH1jYXRjaHtyZXR1cm4gXFxcInRvYXN0Oi8v5oyC5qKv5oiW5rKh5pyJ5q2k5b2x54mHXFxcIn1cXG4gICAgICAgICAgICAgICAgICB9LOeVquWPtyksXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6IHsgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOeVquWPtyk9PnsgcmV0dXJuIFxcXCJodHRwczovL3RoaXNhdi5jb20vY24vXFxcIiArIOeVquWPtzt9LOeVquWPtyl9XSB9XFxufSk7XFxuXFxuLy9NSVNTQVZc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4gICAgICAgICB0cnl7XFxuICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL21pc3Nhdi50by9zZWFyY2gvbW92aWUvXFxcIiArIOeVquWPty5yZXBsYWNlKC9cXFxcLXxcXFxcXy8sXFxcIiUyMFxcXCIpOyAgXFxuICAgICAgICAgICAgIHZhciB1cmxzID0gW107ICAgIFxcbiAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoZmV0Y2goYXYse3RpbWVvdXQ6NTAwMH0pLFxcXCIudmlkZW9zLWxpc3QmJmFydGljbGVcXFwiKTtcXG4gICAgICAgICAgICBmb3IodmFyIGogaW4gbGlzdCl7XFxuICAgICAgICAgICAgICB1cmxzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwZGZoKGxpc3Rbal0sXFxcImEmJmhyZWZcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHZhciBwbGF5cyA9IGJmKHVybHMpLm1hcChoPT5oLm1hdGNoKC9zcmM9XFxcIiguKj8pXFxcIi8pWzFdLnNwbGl0KFxcXCImXFxcIilbMF0ucmVwbGFjZShcXFwiP2lkPVxcXCIsXFxcImhscy9cXFwiKSArIFxcXCIubTN1OFxcXCIpICAgXFxuICAgICAgICAgICAgIHJldHVybiB7dXJsczpwbGF5c31cXG4gICAgICAgICAgfWNhdGNoe3JldHVybiBcXFwidG9hc3Q6Ly/msqHmnInmraTlvbHniYdcXFwifVxcbiAgICAgICB9ICAgXFxuICAgICAgICAgICAgICAgICAgfSznlarlj7cpLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxuICAgIGV4dHJhOiB7IGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjnlarlj7cpPT57IHJldHVybiBcXFwiaHR0cHM6Ly9taXNzYXYudG8vc2VhcmNoL21vdmllL1xcXCIgKyDnlarlj7d9LOeVquWPtyl9XSB9XFxufSk7XFxuXFxuLy9uamF2XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjMUU5MEZGXFxcIj4gbkphdi50djwvZm9udD48L21pZGRsZT4nLFxcbiAgICBwaWNfdXJsOiAnaHR0cHM6Ly9jZG4yLmljb25maW5kZXIuY29tL2RhdGEvaWNvbnMvc29jaWFsLWljb25zLTMzLzEyOC9GYWNlYm9va19NZXNzZW5nZXItMTI4LnBuZycsXFxuICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOeVquWPtykgPT4ge1xcbiAgICAgICAgICAgICAgICAgdmFyIGF2ID0gXFxcImh0dHBzOi8vbmphdi50di96aC92L1xcXCIgKyDnlarlj7c7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXG4gICAgICAgICAgICAgICAgIGlmKCFodG1sIHx8IGh0bWwuaW5jbHVkZXMoXFxcIuivt+ajgOafpeWcsOWdgOagj+S4reeahOe9keWdgFxcXCIpKXsgICAgICAgICBcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwiXFxuICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBhdjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICB9LOeVquWPtyksXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnKi5kb3BwaW9jZG4uKiddLFxcbiAgICAgICAgICAgICAgIC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luayoeacieatpOW9seeJh1xcXCJcXG4gICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInZpZGVvOi8vXFxcIiArIGF2O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgIH0s55Wq5Y+3KSxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWydkb3BwaW9jZG4nXSxcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxuICAgICAgICAgICAgICAgIHZpZGVvRXhjbHVkZVJ1bGVzOiBbJzQ4MCddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5kb3BwaW9jZG4uJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnZG1tLmNvLmpwJ10sXFxuICAgICAgICAgICAgICAgIC8vdmlkZW9SdWxlczogWycqbTN1OConXSxcXG4gICAgICAgICAgICAgICAgY2FjaGVNM3U4OiB0cnVlLFxcbiAgICAgICAgICAgICAgIGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjnlarlj7cpPT57IHJldHVybiBcXFwiaHR0cHM6Ly93d3cuYXYwMS50di9cXFwiICsg55Wq5Y+3O30s55Wq5Y+3KX1dXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbn0pO1xcblxcbi8vSmFibGVcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogJ+KAmOKAmOKAmeKAmTxiPjxtaWRkbGU+PGZvbnQgY29sb3I9XFxcIiNGRjhDMDBcXFwiPiBKYWJsZTwvZm9udD48L21pZGRsZT4nLFxcbiAgICBwaWNfdXJsOiAnaHR0cHM6Ly9jZG4zLmljb25maW5kZXIuY29tL2RhdGEvaWNvbnMvY2F0LXBvd2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ZGRsZT4nLFxcbiAgICBwaWNfdXJsOiAnaHR0cHM6Ly9jZG40Lmljb25maW5kZXIuY29tL2RhdGEvaWNvbnMvc29jaWFsLW1lZGlhLWZsYXQtNy82NC9Tb2NpYWwtbWVkaWFfU25hcGNoYXQtMTI4LnBuZycsXFxuICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOeVquWPtykgPT4ge1xcbiAgICAgICAgICAgICAgICAgdmFyIGF2ID0gXFxcImh0dHBzOi8vdGhpc2F2LmNvbS9jbi9cXFwiICsg55Wq5Y+3ICsgXFxcIi11bmNlbnNvcmVkLWxlYWtcXFwiOyBcXG4vL2xvZyhhdilcXG4gICAgICAgICAgICAgIHRyeXtcXG4gICAgICAgICAgICAgICAgIHZhciBodG1sID0gZmV0Y2goYXYsIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wKSdcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9LHRpbWVvdXQ6NTAwMFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC9ldmFsLio/XFxcXG4vKVswXSlcXG4gICAgICAgICAgICAgICAgIHZhciBzb3VyY2UxOTIwID0gc291cmNlMTI4MC5yZXBsYWNlKFxcXCIxMjgweDcyMFxcXCIsXFxcIjE5MjB4MTA4MFxcXCIpXFxuICAgICAgICAgICAgICAgICB2YXIgY29kZSA9IEpTT04ucGFyc2UoZmV0Y2goc291cmNlMTkyMCx7b25seUhlYWRlcnM6dHJ1ZSx0aW1lb3V0OjMwMDB9KSkuc3RhdHVzQ29kZTtcXG4gICAgICAgICAgICAgICAgIGlmKGNvZGUgIT09IDIwMCl7XFxuICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlMTI4MCBcXG4vLysgJzt7UmVmZXJ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W91dDo1MDAwfSlcXG4gICAgICAgICAgICAgICAgIGlmKCFodG1sIHx8IGh0bWwuaW5jbHVkZXMoXFxcIuivt+ajgOafpeWcsOWdgOagj+S4reeahOe9keWdgFxcXCIpKXsgICAgICAgICBcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwiXFxuICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBhdjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICB9LOeVquWPtyksXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnKi5kb3BwaW9jZG4uKiddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJ2RtbS5jby5qcCddLFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sXFxuICAgICAgICAgICAgICAgIGNhY2hlTTN1ODogdHJ1ZSxcXG4gICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7dGl0bGU6ICfmn6XnnIvnvZHlnYAnLCBqczogJC50b1N0cmluZygo55Wq5Y+3KT0+eyByZXR1cm4gXFxcImh0dHBzOi8vbmphdi50di96aC92L1xcXCIgKyDnlarlj7cgKyBcXFwiLXVuY2Vuc29yZWQtbGVha2VkXFxcIjt9LOeVquWPtyl9XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG59KTtcXG5cXG4vL1N1cGphdlxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PG1pZGRsZT48Zm9udCBjb2xvcj1cXFwiI0EzMjk4NlxcXCI+U3VwamF2PC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjMuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9sb2dvcy1icmFuZHMtMy8yNC9sb2dvX2JyYW5kX2JyYW5kc19sb2dvc19za3JpbGwtMTI4LnBuZycsXFxuICAgIHVybDogXFxcIng1Oi8vaHR0cHM6Ly9zdXBqYXYuY29tL3poLz9zPVxcXCIgKyDnlarlj7csXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZSxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5Y+s5ZSk6Zuo6KeBJywganM6ICQudG9TdHJpbmcoKOeVquWPtyk9PnsgXFxub3BlbkFwcEludGVudCgnY29tLnl1amlhbi5SZXNpZGVNZW51RGVtbycsICdjbi55dWppYW4uTWFpbkFjdGl2aXR5Jywge2ludGVudERhdGE6ICdodHRwczovL3N1cGphdi5jb20vemgvP3M9JyArIOeVquWPt30pXFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iwg+eUqOmbqOingea1j+iniOWZqFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgIH0s55Wq5Y+3KX0se3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOeVquWPtyk9PnsgXFxuICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vc3VwamF2LmNvbS96aC8/cz1cXFwiICsg55Wq5Y+3XFxuICAgICAgICAgICAgICAgICAgICAgICB9LOeVquWPtyl9XVxcbiAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuLy/no4HlipvlkJsu566AXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjRUY0ODI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iqMX4nICsgayArICfnmoTmlbDlrZcnXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRvUGFnZSA9IHBhcnNlSW50KGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHRvUGFnZSA8IDEgfHwgdG9QYWdlID4gaykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i+k+WFpeacieivryzor7fovpPlhaXkuIDkuKoxficgKyBrICsgJ+eahOaVsOWtlydcXHJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICBpZigvZm9ydW1cXFxcLVxcXFxkK1xcXFwtXFxcXGQrLy50ZXN0KHRydWVfdXJsKSl7XFxudmFyIHVybCA9IHRydWVfdXJsLnJlcGxhY2UoL1xcXFxkK1xcXFwuaHRtLywgdG9QYWdlICsgJy5odG0nKTtcXG4gICAgICAgICAgICAgIH1lbHNle1xcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXFxcLmh0bS8sICctJyArIHRvUGFnZSArICcuaHRtJyk7XFxuICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcIm5vd1xcXCIsIG5hbWVzW2pdKTtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCB1cmwpO1xcbiAgICAgICAgICAgICAgICAvL3B1dE15VmFyKCd5aV9maXJzdHBhZ2UnLCB1cmwpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXHJcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i3s+i2iuWIsOS6huesrCcgKyB0b1BhZ2UgKyAn6aG1J1xcclxcbiAgICAgICAgICAgIH0sdHJ1ZV91cmwsIGssbmFtZXMsaiksXFxyXFxuICAgICAgICB9KTtcXG5cXG59ZWxzZXtcXG5cXG5pZihhcnJbal09PSfpmo/mnLonKXtcXG4gICAgIC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i8vcGFnZS9zc1xcXCIpJyxcXG4gICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gIH0pO1xcbn0pXFxuLypcXG5kLnB1c2goe1xcbiAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaycsXFxufSkqL1xcblxcbnZhciBjb250cyA9IHBkZmEoaHRtbCwgJy5zb3UtdGFneXVuJiYuc291LXRhZycpO1xcbmZvciAodmFyIGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICB2YXIgbGlzdCA9IHBkZmEoY29udHNbaV0sICdib2R5JiZhJyk7IFxcbmQucHVzaCh7XFxuICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJyxcXG59KTtcXG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgbGlzdC5sZW5ndGg7IGorKykgeyAgICAgICBcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChsaXN0W2pdLCAnYSYmVGV4dCcpLFxcbiAgICAgICAgICAgICAgICB1cmw6IHBkKGxpc3Rbal0sICdhJiZocmVmJykrJyMjZnlwYWdlQHJ1bGU9anM6JC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2Uvc3NcXFwiKScsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsICAgICAgICAgICAgXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG52YXIgbGlzID0gcGRmYShodG1sLCAnYm9keSYmLnBpYy1ob21lJiZsaScpO1xcbmxpcy5mb3JFYWNoKHggPT4geyAgIFxcbiAgICBkLnB1c2goe1xcbiAgICAgICB0aXRsZTogcGRmaCh4LCAnYSYmVGV4dCcpLFxcbiAgICAgICBpbWc6IHBkKHgsICdpbWcmJnNyYycpLFxcbiAgICAgICB1cmw6IHBkKHgsICdhJiZocmVmJykrJyMjZnlwYWdlQHJ1bGU9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B1dCA9PSB1bmRlZmluZWQpIHtcXFxcbiAgICAgICAgaW5wdXQgPSB0cnVlO1xcXFxuICAgICAgfVxcXFxuICAgICAgdGhpcy5pc0Jvb2xlYW4oaW5wdXQpO1xcXFxuICAgICAgdGhpcy5vcGVuID0gaW5wdXQ7XFxcXG4gICAgICByZXR1cm4gdGhpcztcXFxcbiAgICB9LFxcXFxuICAgIHNldFRpdGxlKGssIGksIHQpIHtcXFxcbiAgICAgIHJldHVybiBrID09IGkgPyBcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiICsgdC5mb250Y29sb3IodGhpcy7liIbnsbvpopzoibIpIDogdDtcXFxcbiAgICB9LFxcXFxuICAgIGFjdGlvbihvYmopIHtcXFxcbiAgICAgIHJldHVybiBbXFxcXG4gICAgICAgIHtcXFxcbiAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmuIXpmaTnirbmgIFcXFxcXFxcIixcXFxcbiAgICAgICAgICBqczogJC50b1N0cmluZygob2JqKSA9PiB7XFxcXG4gICAgICAgICAgICBsb2cob2JqKTtcXFxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIob2JqLnN0YXRlKTtcXFxcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcXFxcXCJoZWFkLmNhdGVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICBvYmouYWxsLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgb2JqLmNsLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICB9LCBvYmopLFxcXFxuICAgICAgICB9LFxcXFxuICAgICAgXTtcXFxcbiAgICB9LFxcXFxuICAgI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cXFxcbiAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB2YXIg5LiA57qnID0gbGlzdC5tYXAoKHMpID0+IHtcXFxcbiAgICAgICAgICB2YXIgc2xpc3QgPSBbXTtcXFxcbiAgICAgICAgICBpZiAoIShcXFxcXFxcIuWwj+exu1xcXFxcXFwiIGluIHgpKSB7XFxcXG4gICAgICAgICAgICB4LuWwj+exuyA9IFxcXFxcXFwiYm9keSYmYTpub3QoOm1hdGNoZXMo6aaW6aG1KSk6bm90KGE6bm90KFtocmVmXSkpXFxcXFxcXCI7XFxcXG4gICAgICAgICAgfVxcXFxuICAgICAgICAgIGlmICh4LuWwj+exuy5zdGFydHNXaXRoKFxcXFxcXFwiQGpzOlxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgc2xpc3QgPSB0aGlzLmV2YWxKU1J1bGUocywgeC7lsI/nsbspO1xcXFxuICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcXFxuICAgICAgICAgIH1cXFxcbiAgICAgICAgICB2YXIg5a6a5L2NID0gc2xpc3QubWFwKChpdGVtKSA9PiB7XFxcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIHgu5qCH6aKYKTtcXFxcbiAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLmdldFVybChpdGVtLCB4KTtcXFxcbiAgICAgICAgICAgIHZhciBvYmogPSB7IHRpdGxlOiB0aXRsZSwgdXJsOiB1cmwgfTtcXFxcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopO1xcXFxuICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgIHJldHVybiDlrprkvY07XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICAvL2xvZyjkuIDnuqcpXFxcXG4gICAgICAgIC8vbG9nKOS4gOe6py5sZW5ndGgpXFxcXG4gICAgICAg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BcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgZm9sZCxcXFxcbiAgICAgICAgICAgICAg54q25oCBLFxcXFxuICAgICAgICAgICAgICDlhajmuIVcXFxcbiAgICAgICAgICAgICksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICBsb25nQ2xpY2s6IHRoaXMuYWN0aW9uKHtcXFxcbiAgICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcXFxuICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcXFxuICAgICAgICAgICAgICAgIGNsOiDmuIXpmaQsXFxcXG4gICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgfVxcXFxuICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcXFxuICAgICAgY2F0ZWdvcmllcy5mb3JFYWNoKChjYXRlZ29yeSwgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgLy9sb2coY2F0ZWdvcmllcylcXFxcbiAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxcXG4gICAgICAgIC8qaWYgKOWwj+exu+WumuS9jS5pbmNsdWRlcyhcXFxcXFxcIjtcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jS5zcGxpdChcXFxcXFxcIjtcXFxcXFxcIilbMF0pO1xcXFxuICAgICAgICAgIGlmIChzdWJfY2F0ZWdvcmllcy5sZW5ndGggPT0gMCkge1xcXFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/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IHBhZ2U6IHBhZ2UsXFxcXG4gICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcXFxuICAgICAgICAgICAgICBqc29uOiBqc29uLFxcXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcXFxuICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXFxcbiAgICAgICAgICAgIH07XFxcXG5cXFxcbiAgICAgICAgICAgIC8vbGV0IHVybCA9IHBkKGl0ZW0sIF/lpKfnsbvpk77mjqUpO1xcXFxuICAgICAgICAgICAgbGV0IHVybCA9IGl0ZW0udXJsO1xcXFxuICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxcXG4gICAgICAgICAgICAgIHVybCA9IOS4gOe6p+WIhuexu+WkhOeQhih1cmwpO1xcXFxuICAgICAgICAgICAgfSovXFxcXG4gICAgICAgICAgICAvL2xvZyh1cmwpXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICB0aXRsZTogdGhpcy5zZXRUaXRsZShrZXkudG9TdHJpbmcoKSwgY2F0ZV90ZW1wW2luZGV4XSwgdGl0bGUpLFxcXFxuICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJzY3JvbGxfYnV0dG9uXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgIHVybDogJChcXFxcXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFxcXFxcIjBcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJoZWFkLmNhdGVcXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkobmV3X2NhdGUpKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcXFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJkdF9cXFxcXFxcIiArIHBhcmFtcy5qc29uLnR5cGUsIHBhcmFtcy5qc29uLnZhbHVlKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgfSwgcGFyYW1zKSxcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiLFxcXFxuICAgICAgICA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ICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcXFxuICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnRpdGxlO1xcXFxuICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFxcXFxcInVuZGVmaW5lZFxcXFxcXFwiICYmIOaOkumZpCAhPSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFxcXFxcImdcXFxcXFxcIiksIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgdmFyIGpzb24gPSBcXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAvKnN3aXRjaCAodHJ1ZSkge1xcXFxuICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXFxcXFwiQEBAXFxcXFxcXCIpOlxcXFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdHlwZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcXFxcXCJAQEBcXFxcXFxcIilbMF0pLFxcXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcXFxcXCJAQEBcXFxcXFxcIilbMV0pLFxcXFxuICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGNhc2Ug5YiG57G76ZO+5o6lLmluY2x1ZGVzKFxcXFxcXFwiQEBcXFxcXFxcIik6XFxcXG4gICAgICAgICAgICAgICAgICBqc29uID0ge1xcXFxuICAgICAgICAgICAgICAgICAgICB0eXBlOiDliIbnsbvpk77mjqUuc3BsaXQoXFxcXFxcXCJAQFxcXFxcXFwiKVswXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXFxcXFwiQEBcXFxcXFxcIilbMV0pLFxcXFxuICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxcXG4gICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxcXG4gICAgICAgICAgICAgICAgICAvLyBqc29uID0gcGQoaXRlbSwg5YiG57G76ZO+5o6lKTtcXFxcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICB9Ki9cXFxcbiAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcXFxuICAgICAgICAgICAgICAvKnZhciBqc29uPeWIhuexu+mTvuaOpS5pbmNsdWRlcygnQEBAJyk/e1xcXFxuICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMV0pLFxcXFxuICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpO1xcXFxuICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXFxcbiAgICAgICAgICAgICAgICAgICAgdHlwZTrliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMF0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAJylbMV0pLFxcXFxuICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxcXG4gICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxcXG4gICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICBpbmRleDogaW5kZXgsXFxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcXFxuICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcXFxuICAgICAgICAgICAgICBqc29uOiBqc29uLFxcXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcXFxuICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICB0aXRsZTogdGhpcy5zZXRUaXRsZShrZXkudG9TdHJpbmcoKSwgY2F0ZV90ZW1wW2luZGV4XSwgdGl0bGUpLFxcXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIgKyBcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiaGVhZC5jYXRlXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ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FxcXFxcXCJsYXN0aWRfXFxcXFxcXCIgKyBwYWdlO1xcXFxuICAgICAgICAgIGNscyA9IFxcXFxcXFwibGFzdG1hcmtcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICBkZXNjOiBkZXNjLFxcXFxuICAgICAgICAgIHBpY191cmw6IGltZyxcXFxcbiAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VyP3VybD1cXFxcXFxcIiArIHVybCxcXFxcbiAgICAgICAgICBjb250ZW50OiBjb250ZW50LFxcXFxuICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcXFxuICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICBpbWc6IGltZyxcXFxcbiAgICAgICAgICAgIGlkOiBpZCxcXFxcbiAgICAgICAgICAgIGNsczogY2xzLFxcXFxuICAgICAgICAgIH0sXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEgJiYgc2hvdykge1xcXFxuICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICBpZDogXFxcXFxcXCJwYWdlbGluZVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLigJzigJzigJ3igJ08c21hbGw+5Yqg6L295LitLi4uPC9zbWFsbD5cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtl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2xvcj1cXFxcXFxcIiNGRjAwMDBcXFxcXFxcIj4gVGhpc0FWPC9mb250PjwvbWlkZGxlPicsXFxcXG4gICAgcGljX3VybDogJ2h0dHBzOi8vY2RuNC5pY29uZmluZGVyLmNvbS9kYXRhL2ljb25zL2xvZ29zLWFuZC1icmFuZHMvNTEyLzIzMl9OaW50ZW5kb19Td2l0Y2hfbG9nby0xMjgucG5nJyxcXFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjnlarlj7cpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgdmFyIGF2ID0gXFxcXFxcXCJodHRwczovL3RoaXNhdi5jb20vY24vXFxcXFxcXCIgKyDnlarlj7c7IFxcXFxuLy9sb2coYXYpXFxcXG4gICAgICAgICAgICAgIHRyeXtcXFxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdiwge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdNb3ppbGxhLzUuMCAoV2luZG93cyBOVCAxMC4wKSdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGltZW91dDo1MDAwXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgZXZhbChodG1sLm1hdGNoKC9ldmFsLio/XFxcXFxcXFxuLylbMF0pXFxcXG4gICAgICAgICAgICAgICAgIHZhciBzb3VyY2UxOTIwID0gc291cmNlMTI4MC5yZXBsYWNlKFxcXFxcXFwiMTI4MHg3MjBcXFxcXFxcIixcXFxcXFxcIjE5MjB4MTA4MFxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICB2YXIgY29kZSA9IEpTT04ucGFyc2UoZmV0Y2goc291cmNlMTkyMCx7b25seUhlYWRlcnM6dHJ1ZSx0aW1lb3V0OjMwMDB9KSkuc3RhdHVzQ29kZTtcXFxcbiAgICAgICAgIC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lyX3ZpZGVvJiZwb3N0ZXInKVxcXFxubG9nKGNvZGUpXFxcXG4gICAgICAgICAgICAgICAgIGlmKCFjb2RlKXsgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ2aWRlbzovL1xcXFxcXFwiICsgYXY7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgIH0s55Wq5Y+3KSxcXFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxcXG4gICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWydkb3BwaW9jZG4nXSxcXFxcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWycyNDAnXSxcXFxcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWyc0ODAnXSxcXFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5kb3BwaW9jZG4uJ10sXFxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWydkbW0uY28uanAnXSxcXFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sXFxcXG4gICAgICAgICAgICAgICAgY2FjaGVNM3U4OiB0cnVlLFxcXFxuICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOeVquWPtyk9PnsgcmV0dXJuIFxcXFxcXFwiaHR0cHM6Ly93d3cuYXYwMS50di9cXFxcXFxcIiArIOeVquWPtzt9LOeVquWPtyl9XVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxufSk7XFxcXG5cXFxcbi8vSmFibGVcXFxcbmQucHVzaCh7XFxcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXFxcXFwiI0ZGOEMwMFxcXFxcXFwiPiBKYWJsZTwvZm9udD48L21pZGRsZT4nLFxcXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjMuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9jYXQtcG93ZXItcHJlbWl1bS8xMjAvY2F0X2Zvb2Rsb3ZlLTEyOC5wbmcnLFxcXFxuICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOeVquWPtykgPT4ge1xcXFxuICAgICAgICAgICAgICAgICB2YXIgYXYgPSBcXFxcXFxcImh0dHBzOi8vamFibGUudHYvdmlkZW9zL1xcXFxcXFwiICsg55Wq5Y+3ICsgXFxcXFxcXCIvXFxcXFxcXCI7IFxcXFxuLy9sb2coYXYpXFxcXG4gICAgICAgICAgICAgICAgLy8gcmVxdWVzdChcXFxcXFxcImh0dHBzOi8vamFibGUudHYvXFxcXFxcXCIpXFxcXG4gICAgICAgICAgICAgIHRyeXtcXFxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXFxcbiAgICAgICAgICAgICAgICAgdmFyIHVybCA9IGh0bWwubWF0Y2goL2h0dHBzPzpcXFxcXFxcXC9cXFxcXFxcXC9cXFxcXFxcXFMrP1xcXFxcXFxcLm0zdTgvKVswXVxcXFxuICAgICAgICAgICAgICAgICByZXR1cm4gdXJsXFxcXG4gICAgICAgICAgICAgICAgIH1jYXRjaHtyZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+ayoeacieaMguair+WtkOaIluayoeacieatpOW9seeJh1xcXFxcXFwifVxcXFxuICAgICAgICAgICAgICAgICAgfSznlarlj7cpLFxcXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXFxcbiAgICBleHRyYTogeyBsb25nQ2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GVsc2Uge1xcXFxuICAgIHJldHVybiBpdGVtO1xcXFxuICB9XFxcXG59KTtcXFxcblxcXFxuZm9yICh2YXIgaiA9IDA7IGogPCBNYXRoLm1pbihhcnIubGVuZ3RoLCBuYW1lcy5sZW5ndGgpOyBqKyspIHtcXFxcbmlmKGFycltqXT09J+i3s+mhtScpe1xcXFxuICAgICAgICAgICAgIGQucHVzaCh7XFxcXHJcXFxcbiAgICAgICAgICAgIHRpdGxlOm5vdyA9PW5hbWVzW2pdPyAn4oCc4oCc4oCd4oCdJyArIG5hbWVzW2pdLmZvbnRjb2xvcigncmVkJykgOiBuYW1lc1tqXSxcXFxcclxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxyXFxcXG4gICAgICAgICAgICB1cmw6ICQoMjMsICfor7fovpPlhaXopoHot7PovazliLDnmoTpobXmlbAnKS5pbnB1dCgodHJ1ZV91cmwsayxuYW1lcyxqKSA9PiB7XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBpZiAoaXNOYU4ocGFyc2VJbnQoaW5wdXQpKSkge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ovpPlhaXmnInor68s6K+36L6T5YWl5LiA5LiqMX4nICsgayArICfnmoTmlbDlrZcnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXHJcXFxcbiAgICAgICAgICAgICAgICBsZXQgdG9QYWdlID0gcGFyc2VJbnQoaW5wdXQpO1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgaWYgKHRvUGFnZSA8IDEgfHwgdG9QYWdlID4gaykge1xcXFxyXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ovpPlhaXmnInor68s6K+36L6T5YWl5LiA5LiqMX4nICsgayArICfnmoTmlbDlrZcnXFxcXHJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICA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4LnN1YnN0cmluZyhpbmRleCArIDEpO1xcXFxuICAgICAgICAgICAgY29va2llc1trZXldID0gdmFsdWU7XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxufSk7XFxcXG5cXFxcbmZ1bmN0aW9uIGd1YXJkKHVybCwgaGVhZG9iaikge1xcXFxuICAgIHZhciBoZWFkID0gaGVhZG9iaiA/IGhlYWRvYmo6e1xcXFxuICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICBDb29raWU6IGdldENvb2tpZSh1cmwpLFxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIHZhciBodG1sID0gZmV0Y2godXJsLCBoZWFkKTtcXFxcbiAgICBpZiAoaHRtbC5pbmNsdWRlcygnX2d1YXJkL2F1dG8uanMnKSkge1xcXFxuICAgICAgICBkb2N1bWVudFtcXFxcXFxcImNvb2tpZVxcXFxcXFwiXSA9IGdldENvb2tpZSh1cmwpO1xcXFxuICAgICAgICBldmFsKGZldGNoKGdldEhvbWUodXJsKSArICcvX2d1YXJkL2F1dG8uanMnKSlcXFxcbiAgICAgICAgaHRtbCA9IGZldGNoKHVybCwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgIENvb2tpZTogZG9jdW1lbnRbXFxcXFxcXCJjb29raWVcXFxcXFxcIl0sXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICAvL2xvZyhkb2N1bWVudFtcXFxcXFxcImNvb2tpZVxcXFxcXFwiXSlcXFxcbiAgICByZXR1cm4gaHRtbFxcXFxufVxcXFxuXFxcXG5mdW5jdGlvbiBjc3BsaXQoYSwgYiwgYykge1xcXFxuICAgIGIgPSBwYXJzZUludChiLCAxMCkgfHwgNzY7XFxcXG4gICAgYyA9IGMgfHwgJ1xcXFxcXFxcclxcXFxcXFxcbic7XFxcXG4gICAgaWYgKGIgPCAxKSB7XFxcXG4gICAgICAgIHJldHVybiBmYWxzZVxcXFxuICAgIH1cXFxcbiAgICByZXR1cm4gYS5tYXRjaChuZXcgUmVnRXhwKFxcXFxcXFwiLnswLFxcXFxcXFwiICsgYiArIFxcXFxcXFwifVxcXFxcXFwiLFxcXFxcXFwiZ1xcXFxcXFwiKSkuam9pbihjKVxcXFxufVxcXFxuXFxcXG5mdW5jdGlvbiByZXVybChhKSB7XFxcXG4gICAgdmFyIGIgPSAnJztcXFxcbiAgICB2YXIgYyA9IGNzcGxpdChhLCA4KS5zcGxpdCgnXFxcXFxcXFxyXFxcXFxcXFxuJyk7XFxcXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAoYy5sZW5ndGggLSAxKTsgaSsrKSB7XFxcXG4gICAgICAgIGIgPSBiICsgU3RyaW5nLmZyb21DaGFyQ29kZSgocGFyc2VJbnQoY1tpXSwgMikgLSAxMCkudG9TdHJpbmcoMTApKVxcXFxuICAgIH1cXFxcbiAgICByZXR1cm4gYlxcXFxufVxcXCJ9XVwiLFwicHJveHlcIjpcIlwifSIsInBpY1VybCI6InVuZGVmaW5lZC92aWV3L2ltZy9jYW5nNS5wbmciLCJ0aXRsZSI6IueVqsK35LuTX19fX19fX1/po47lkLnoirHmtbfovbvoiJ7vvIzphonljafnlarku5PmoqbkuaHjgIIifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement