Advertisement
xiaomianao666

邀您一起看:本地资源管理|设置

Oct 21st, 2024
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥本地资源管理|设置@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmlsZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuICAgIGlmICghZmlsZS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wQ291bnQgPSBNYXRoLmNlaWwocmF0aW8gKiAxMCk7XFxuICAgICAgICAgICAgaXNTdWNjZXNzID0gdHJ1ZTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuIvovb3ov5vluqbvvJpcXFwiICsgc3VjY2Vzc0NJRC5sZW5ndGggKyBcXFwiL1xcXCIgKyB0YXNrQ291bnQsXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KHN0cmlwQ291bnQpLmZvbnRjb2xvcihcXFwiI2ZmYWMyZFxcXCIpICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwIC0gc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZTVlMWU0XFxcIikgKyBcXFwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3ov5vluqZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgfSBlbHNlIGlmIChDSUQgPT09IC0xKSB7XFxuICAgICAgICAgICAgZmFpbE5hbWUucHVzaChpZCk7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICBjb3VudCA9IHRhc2tDb3VudDtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGlmICh0YXNrQ291bnQgIT09IGNvdW50KSByZXR1cm47XFxuICAgICAgICBpZiAoc3VjY2Vzc0NJRC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AgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+WkhOeQhuWksei0pV1cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZhaWxUZWFtLmxlbmd0aCA+IDAgJiYgc3RhdHVzID09PSBcXFwiMVxcXCIpIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjRcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl0j5bey5YGc5q2i5omA5pyJ5Lu75Yqh77yM5L2G5bey5pyJ6L+b5bqm5LiN5Lya5raI5aSxI1xcXCIpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvph43mlrDlvIDlp4tdXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiYnJlYWtcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjJcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIuS4i+i9veS7u+WKoVtcXFwiICsgaW5mby5ib29rTmFtZSArIFxcXCJd5bey5YWo6YOo5oiQ5Yqf5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7X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LnBpY0Rvd25sb2FkKHBpY1swXSwgdGFza1BhcmFtLmNoYXB0ZXJQYXRoICsgKHRhc2tQYXJhbS5pICsgMSkgKyBcXFwiLmpwZ1xcXCIsIHBpY1sxXSwgdGFza1BhcmFtLmRlY29kZSk7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcih0YXNrUGFyYW0uTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCJcXFwiKSA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRhc2tQYXJhbS5DSUQ7XFxuICAgIH1cXG4gICAgbGV0IGNvdW50ID0gMDtcXG4gICAgbGV0IHRvdGFsQ291bnQgPSAwO1xcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcblxcbiAgICBmdW5jdGlvbiBsaXN0ZW5lcihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgdG90YWxDb3VudCsrO1xcblxcbiAgICAgICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeS4i+i9veWksei0pe+8mlxcXCIgKyBpZCArIFxcXCI8RVJST1JAIFxcXCIgKyBlcnJvciArIFxcXCI+XFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChyZXN1bHQgPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeW3suWBnOatou+8mlxcXCIgKyBpZCk7XFxuICAgICAgICAgICAgICAgIHRvdGFsQ291bnQgPSBwYXJhbS5waXZDb3VudDtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgICAgICAgICBsZXQgcmF0aW8gPSAoKGNvdW50IC8gcGFyYW0ucGl2Q291bnQpKS50b0ZpeGVkKDQpO1xcbiAgICAgICAgICAgICAgICBsZXQgc3RyaXBDb3VudCA9IE1hdGguY2VpbChyYXRpbyAqIDEwKTtcXG4gICAgICAgICAgICAgICAgaWYgKHBhcmFtLnBpdkNvdW50ID09PSB0b3RhbENvdW50ICYmIHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWNjZXNzQ0lELnB1c2gocGFyYW0uQ0lEKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5LiL6L296L+b5bqm77yaXFxcIiArIChzdWNjZXNzQ0lELmxlbmd0aCkgKyBcXFwiL1xcXCIgKyBwYXJhbS50b3RhbCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KHN0cmlwQ291bnQpLmZvbnRjb2xvcihcXFwiI2ZmYWMyZFxcXCIpICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwIC0gc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZTVlMWU0XFxcIikgKyBcXFwiIFxcXCIgKyBTdHJpbmcoKHJhdGlvICogMTAwKSkuc2xpY2UoMCwgNSkgKyBcXFwiJVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9vei/m+W6plxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5a6M5oiQ5LiL6L2977yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgIT09IHBhcmFtLnBpdkNvdW50KSByZXR1cm47XFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgPT09IGNvdW50KSB7XFxuICAgICAgICAgICAgICAgIEZpbGUucmVuYW1lRmlsZShwYXJhbS5jaGFwdGVyUGF0aCwgcGFyYW0uQ0lEICsgXFxcIiRBJFxcXCIgKyBUb29sLnRleHRTaGllbGQocGFyYW0udGl0bGUpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdG90YWxDb3VudCA9IGNvdW50ID0gMDtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImJyZWFrXFxcIjtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsZXQgdGFza1RlYW0gPSBbXTtcXG4gICAgbGV0IG1haW5QYXRoID0gQ29uZmlnLmNvbWljUGF0aCArIFxcXCIvXFxcIiArIGluZm8ucnVsZU5hbWUgKyBcXFwiL1xcXCIgKyBUb29sLnRleHRTaGllbGQoaW5mby5ib29rTmFtZSkgKyBcXFwiL1xcXCI7XFxuICAgIGlmIChpbmZvLmJvb2tUb3BQaWMpIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGJvb2tUb3BQaWMgPSBUb29sLmhpa2VyUGljKGluZm8uYm9va1RvcFBpYyk7XFxuICAgICAgICAgICAgVG9vbC5waWNEb3dubG9hZChib29rVG9wUGljWzBdLCBtYWluUGF0aCArIG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4gICAgICAgICAgICBwdXRMb2coXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor68+IFxcXCIgKyBlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHBpY0xpc3QubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCI85ryr55S75Zu+54mH6Kej5p6Q6ZSZ6K+v77ya5Zu+54mH6ZO+5o6l6L+U5Zue5Li656m6PlxcXCIpO1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcbiAgICAgICAgcGljTGlzdCA9IHBpY0xpc3QuZmlsdGVyKHAgPT4gcCk7XFxuICAgICAgICB2YXIgdGFza1RlYW0gPSBwaWNMaXN0Lm1hcCgodXJsLCBpKSA9PiAoe1xcbiAgICAgICAgICAgIGZ1bmM6IHRhc2ssXFxuICAgICAgICAgICAgaWQ6IGksXFxuICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGk6IGksXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJQYXRoOiBjaGFwdGVyUGF0aCxcXG4gICAgICAgICAgICAgICAgTVlfSUQ6IE1ZX0lELFxcbiAgICAgICAgICAgICAgICBkZWNvZGU6IGluZm8uZGVjb2RlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpO1xcbiAgICAgICAgYmUodGFza1RlYW0sIHtcXG4gICAgICAgICAgICBmdW5jOiBsaXN0ZW5lcixcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBwaXZDb3VudDogcGljTGlzdC5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIHRvdGFsOiBjaGFwdGVyVGVhbS5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIG9yZGVyOiBvcmRlcixcXG4gICAgICAgICAgICAgICAgQ0lEOiBpdGVtLk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ufTtcXG4kLmV4cG9ydHMgPSBmdW5jdGlvbihpdGVtLCBpbmZvLCBvcmRlciwgTVlfSUQpIHtcXG4gICAgcmV0dXJuICRleGVbaW5mby50eXBlXShpdGVtLCBpbmZvLCBvcmRlciwgTVlfSUQpO1xcbn07XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCIjZi7pgJrnlKjlt6XlhbdcIixcInBhdGhcIjpcIlRvb2wuanNcIixcInJ1bGVcIjpcImNvbnN0IHYgPSB7XFxuICAgIHNwbGl0KHRleHQsIHRhcmdldCwgY291bnQpIHtcXG4gICAgICAgIGNvdW50ID0gY291bnQgPT09IHVuZGVmaW5lZCA/IDEgOiBjb3VudDtcXG4gICAgICAgIGxldCBhcnJheSA9IFt0ZXh0XTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY291bnQ7IGkrKykge1xcbiAgICAgICAgICAgIHRleHQgPSBhcnJheVtpXTtcXG4gICAgICAgICAgICBsZXQgaW5kZXggPSB0ZXh0LmluZGV4T2YodGFyZ2V0KTtcXG4gICAgICAgICAgICBpZiAoaW5kZXggPT09IC0xKSB7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnJheVtpXSA9IHRleHQuc2xpY2UoMCwgaW5kZXgpO1xcbiAgICAgICAgICAgIGFycmF5W2kgKyAxXSA9IHRleHQuc2xpY2UoaW5kZXggKyB0YXJnZXQubGVuZ3RoKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBhcnJheTtcXG4gICAgfSxcXG4gICAgY2h1bmsoYXJyLCBzaXplKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gW107XFxuICAgICAgICBmb3IgKHZhciBpID0gMCwgbGVuID0gYXJyLmxlbmd0aDsgaSA8IGxlbjsgaSArPSBzaXplKSB7XFxuICAgICAgICAgICAgcmVzdWx0LnB1c2goYXJyLnNsaWNlKGksIGkgKyBzaXplKSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9LFxcbiAgICBoaWtlclBpYyh1cmwpIHtcXG4gICAgICAgIHZhciBoZWFkZXJzID0ge307XFxuICAgICAgICBsZXQgdXJscyA9IHVybC5zcGxpdChcXFwiQFxcXCIpO1xcbiAgICAgICAgbGV0IHBpY1VybCA9IHVybHMuc2hpZnQoKTtcXG4gICAgICAgIGxldCBsZW5ndGggPSB1cmxzLmxlbmd0aDtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgW2tleSwgdmFsdWVdID0gdi5zcGxpdCh1cmxzW2ldLCBcXFwiPVxcXCIpO1xcbiAgICAgICAgICAgIGlmIChrZXkgPT09IFxcXCJoZWFkZXJzXFxcIikge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihoZWFkZXJzLCBKU09OLnBhcnNlKHZhbHVlKSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkuaW5jbHVkZXMoXFxcIi5cXFwiKSB8fCBrZXkuaW5jbHVkZXMoXFxcIj9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICBwaWNVcmwgKz0gXFxcIkBcXFwiICsga2V5ICsgKHZhbHVlID8gXFxcIj1cXFwiICsgdmFsdWUgOiBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChrZXkgIT09IFxcXCJqc1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyc1trZXldID0gdmFsdWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFtwaWNVcmwsIGhlYWRlcnNdO1xcbiAgICB9LFxcbiAgICByYW5nZShzdGFydCwgZW5kKSB7XFxuICAgICAgICByZXR1cm4gQXJyYXkoZW5kIC0gc3RhcnQpLmZpbGwoMCkubWFwKChlbCwgaSkgPT4gc3RhcnQgKyBpKTtcXG4gICAgfSxcXG4gICAgcGljRG93bmxvYWQodXJsLCBwYXRoLCBoZWFkZXJzLCBkZWNpcGhlKSB7XFxuICAgICAgICBpZiAodHlwZW9mIGRlY2lwaGUgPT09IFxcXCJzdHJpbmdcXFwiICYmIGRlY2lwaGUubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIGxldCBpbnN0cmVhbTtcXG4gICAgICAgICAgICBsZXQgb3V0c3RyZWFtO1xcbiAgICAgICAgICAgIGxldCBmaWxlO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGZpbGUgPSBuZXcgamF2YS5pby5GaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBpZiAoZmlsZS5leGlzdHMoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBkaXIgPSBmaWxlLmdldFBhcmVudEZpbGUoKTtcXG4gICAgICAgICAgICAgICAgaWYgKGRpciAhPSBudWxsICYmICFkaXIuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRpci5ta2RpcnMoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpbnN0cmVhbSA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogaGVhZGVycyxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtOiB0cnVlXFxuICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICBvdXRzdHJlYW0gPSBuZXcgamF2YS5pby5GaWxlT3V0cHV0U3RyZWFtKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBsZXQgdCA9ICQuaGlrZXIuaW5wdXQsXFxuICAgICAgICAgICAgICAgICAgICBjID0gJC5oaWtlci51cmw7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSBpbnN0cmVhbTtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSB1cmw7XFxuICAgICAgICAgICAgICAgIGxldCBwaWNpbiA9IChuZXcgRnVuY3Rpb24oXFxcInJldHVybiBcXFwiICsgZGVjaXBoZSkpKCk7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSB0O1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IGM7XFxuICAgICAgICAgICAgICAgIGxldCBidWYgPSBqYXZhLmxhbmcucmVmbGVjdC5BcnJheS5uZXdJbnN0YW5jZShqYXZhLmxhbmcuQnl0ZS5UWVBFLCAxMDI0KTtcXG4gICAgICAgICAgICAgICAgbGV0IGxlbjtcXG4gICAgICAgICAgICAgICAgd2hpbGUgKChsZW4gPSBwaWNpbi5yZWFkKGJ1ZikpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICBvdXRzdHJlYW0ud3JpdGUoYnVmLCAwLCBsZW4pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBpZiAoZmlsZSBpbnN0YW5jZW9mIGphdmEuaW8uRmlsZSAmJiBmaWxlLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmaWxlLmRlbGV0ZSgpO1xcbiAgICAgICAgICAgICAgICB9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RcXFwiKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKFxcXCIudGdudW1cXFwiKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgIH0sIHR5cGUpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgIH0pO1xcbiAgICBpZiAodHlwZSA9PT0gXFxcInR4dFxcXCIpIHtcXG4gICAgICAgIGxldCB0eHRWaWV3ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZXh0ZXJuYWxpbXBvcnRUeHQudmlld1xcXCIpO1xcbiAgICAgICAgcmV0dXJuIHR4dFZpZXcobGF5b3V0KTtcXG4gICAgfVxcbiAgICBsZXQgdGFnID0gRmlsZS5nZXRGaWxlUGF0aChDb25maWdbdHlwZSArIFxcXCJQYXRoXFxcIl0sIFxcXCJkaXJcXFwiKTtcXG4gICAgaWYgKHRhZy5sZW5ndGggPT09IDApIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLorr7nva5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOW4ruWKqeKAneKAnVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2hlbHAudmlldyNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5Iz9rZXl3b3JkPW5vdmVsQ29taWNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8aDEgc3R5bGU9XFxcInRleHQtYWxpZ246IGNlbnRlcjtcXFwiPuWVpemDveayoeacieiAtjwvaDE+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIHNldFJlc3VsdChsYXlvdXQpO1xcbiAgICB9XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHVybDogJ1xcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIraW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuaQnOS9oOaDs+imgeeahCNcXFwiICsgdHlwZSArIFxcXCIjLi4uLi4uXFxcIixcXG4gICAgICAgIHRpdGxlOiBcXFwi8J+UjVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgcnVsZXM6ICQudG9TdHJpbmcoKHRhZywgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyMSA9IFtdO1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRhZy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgYXJyMS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwidGl0bGVcXFwiOiB0YWdbaV0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoX3VybFxcXCI6IFxcXCJoaWtlcjovL2VtcHR5P2lzQWxsPTEmc2VhcmNoVGVybXM9KiomdHlwZT1cXFwiICsgdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwic2VhcmNoRmluZFxcXCI6IFxcXCJqczokLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9TZWFyY2gudmlldz9ydWxlPScrTVlfUlVMRS5fdGl0bGUpO1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShhcnIxKTtcXG4gICAgICAgICAgICB9LCB0YWcsIHR5cGUpLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3NlYXJjaEtleScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdzZWFyY2hLZXknLGlucHV0KVxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi4oCY4oCY4pqZ6K6+572u4oCZ4oCZXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvU2V0dGluZy52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uXFxuICAgICAgICB9XFxuICAgIH0pO1xcblxcblxcbiAgICBmb3IgKGxldCBpIGluIHRhZykge1xcbiAgICAgICAgbGV0IGl0ID0gdGFnW2ldO1xcbiAgICAgICAgaWYgKHRnbnVtID09PSBpKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnFxcXCIgKyBpdC5uYW1lICsgXFxcIuKAneKAnVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChbXFxcIuWIoOmZpOivpeebruW9lVxcXCIsIFxcXCLot7PovazlsI/nqIvluo9cXFwiLCBcXFwi5omT5byA5Lmm5p62XFxcIl0sIDEsIFxcXCLpgInmi6nmk43kvZxcXFwiKS5zZWxlY3QoKGl0LCB0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoXFxcIui3s+i9rOWwj+eoi+W6j1xcXCIgPT09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2hvbWVAXFxcIiArIGl0Lm5hbWU7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoXFxcIuWIoOmZpOivpeebruW9lVxcXCI9PT1pbnB1dCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gdGhlbihbXFxcIuivpeaTjeS9nOS4jeS8muWIoOmZpOWwj+eoi+W6j++8jOS9huivpeWwj+eoi+W6j+S4i+i9veeahOaJgOaciea8q+eUu+Wwhuiiq+WIoOmZpFxcXCJdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi6K+l5pON5L2c5LiN5Lya5Yig6Zmk5bCP56iL5bqP77yM5L2G6K+l5bCP56iL5bqP5LiL6L2955qE5omA5pyJIOa8q+eUuy/lsI/or7Qg5bCG6KKr5Yig6ZmkXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiLnRnbnVtXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIGl0LnBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvQm9va3JhY2sudmlldz9ydWxlPeacrOWcsOi1hOa6kOeuoeeQhiZydWxlTmFtZT1cXFwiK2l0Lm5hbWUrXFxcIiZ0eXBlPVxcXCIrdHlwZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXQsIHR5cGUpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0Lm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCIudGdudW1cXFwiLCBpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsZXQgcGF0aCA9IHRhZ1t0Z251bV0ucGF0aDtcXG4gICAgbGV0IG1obGlzdCA9IEZpbGUuZ2V0RmlsZVBhdGgocGF0aCwgXFxcImRpclxcXCIpO1xcblxcbiAgICBpZiAobWhsaXN0Lmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCLllaXpg73msqHmnInogLZcXFwiLmJpZygpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGxheW91dCk7XFxuICAgIH1cXG4gICAgbGV0IHBhZ2VVcmwgPSB0eXBlID09PSBcXFwibm92ZWxcXFwiID8gXFxcImhpa2VyOi8vcGFnZS9Ob3ZlbEJyb3dzZXIudmlld1xcXCIgOiBcXFwiaGlrZXI6Ly9wYWdlL0NvbWljQnJvd3Nlci52aWV3XFxcIjtcXG4gICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgIGxldCBwaWMgPSBmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgaXRlbS5wYXRoICsgXFxcIi9cXFwiICsgaXRlbS5uYW1lICsgXFxcIi5qcGdcXFwiKSA/IGl0ZW0ucGF0aCArIFxcXCIvXFxcIiArIGl0ZW0ubmFtZSArIFxcXCIuanBnXFxcIiA6IENvbmZpZy5kZWZfUGljO1xcbiAgICAgICAgbGV0IG5hbWVzPVN0cmluZyhpdGVtLm5hbWUpLnNwbGl0KFxcXCIkXFxcIik7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IG5hbWVzWzBdLFxcbiAgICAgICAgICAgIGRlc2M6IG5hbWVzWzFdLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBpYyxcXG4gICAgICAgICAgICB1cmw6IHR5cGUgPT09IFxcXCJub3ZlbFxcXCIgP3BhZ2VVcmwgKyBcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGU6JChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFnZVVybCwgcGF0aCk9PntcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuc2luZ2xlRW50ZXIocGFnZVVybCwgcGF0aCk7XFxuICAgICAgICAgICAgfSwgcGFnZVVybCwgaXRlbS5wYXRoKSxcXG4gICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbihpdGVtLCB7XFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuZGVsZXRlRmlsZUZvckJvb2socGF0aClcXG4gICAgICAgICAgICAgICAgICA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Ckge1xcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGdldFRpdGxlKGl0ZW0ubmFtZSk7XFxuICAgICAgICAgICAgYXJyYXkucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2NvbWljQ29tcGF0aWJsZS52aWV3I2F1dG9QYWdlIyNyZWFkVGhlbWUjP3BhdGg9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChpdGVtLnBhdGgpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9Db21pY19TdHlsZSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaXRlbS5wYXRoICsgXFxcIi8xLmpwZ1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0VGl0bGUyKGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxufSBlbHNlIHtcXG4gICAgZm9yIChsZXQgaXRlbSBvZiBtaGxpc3QpIHtcXG4gICAgICAgIGxldCBuYW1lID0gZ2V0VGl0bGUyKGl0ZW0ubmFtZSk7XFxuICAgICAgICBhcnJheS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOWIoOmZpFtcXFwiICsgbmFtZSArIFxcXCJd77yfXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxl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nZpZXdcXFwiO1xcbmZvciAobGV0IHNvbkRpciBvZiBjb21pY1J1bGVEaXJzKSB7XFxuICAgIGxldCBjb21pY0xpc3QgPSBGaWxlLmdldEZpbGVQYXRoKHNvbkRpci5wYXRoLCBcXFwiZGlyXFxcIik7XFxuICAgIGZvciAobGV0IGNvbWljIG9mIGNvbWljTGlzdCkge1xcbiAgICAgICAgaWYgKHNlYXJjaFRlc3QoY29taWMubmFtZSkpIHtcXG4gICAgICAgICAgICBzZWFyY2hSZXN1bHQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjb21pYy5uYW1lLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBjb21pYy5wYXRoICsgXFxcIi9cXFwiICsgY29taWMubmFtZSArIFxcXCIuanBnXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBwYWdlVXJsICsgXFxcIj9ydWxlPVxcXCIgKyBNWV9SVUxFLl90aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogc29uRGlyLm5hbWUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBjb21pY1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxufVxcbnNldFJlc3VsdChzZWFyY2hSZXN1bHQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI3Yu6K6+572uXCIsXCJwYXRoXCI6XCJTZXR0aW5nLnZpZXdcIixcInJ1bGVcIjpcImpzOlxcbnNldFBhZ2VUaXRsZShNWV9SVUxFLnRpdGxlICsgXFxcInzorr7nva5cXFwiKTtcXG5jb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNcXFwiKTtcXG5cXG5sZXQgbGF5b3V0ID0gW107XFxuXFxubGF5b3V0LnB1c2goe1xcbiAgICB0aXRsZTogXFxcIjxzdHJvbmc+5Z+656GA6K6+572uPC9zdHJvbmc+XFxcIi5iaWco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WtlcjovL2ltYWdlcy9ob21lX2xhdGVcXFwiKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgZm9yIChsZXQgaSA9IHN0YXJ0OyBpIDw9IDQ7IGkrKykge1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlm77niYdcXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJtb3ZpZV8zXFxcIixcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfcGljXFxcIiArIGksXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShzZXREZWZhdWx0UGljLCBcXFwiaGlrZXI6Ly9pbWFnZXMvaG9tZV9waWNcXFwiICsgaSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuiHquWumuS5ieKelVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIuiHquWumuS5iXVybFxcXCIsIFxcXCLpgInmi6nmlofku7bot6/lvoRcXFwiXSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi6Ieq5a6a5LmJdXJsXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLovpPlhaXlm77niYfnmoTot6/lvoTmiJbogIXpk77mjqVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgMCkgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgQ29uZmlnLmRlZl9QaWMgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpLCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSAkLnJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmlsZVNlbGVjdC5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIDApIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IFxcXCJmaWxlOi8vXFxcIiArIFBBVEg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiOmRlZmF1bHRQaWNCYWNrXFxcIiwgXFxcInRydWVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qcGd8LmpwZWd8LmdpZnwucG5nfC5zdmd8LmJtcFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXCJjb25maXJtXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yZTogXFxcInNlbGVjdFBhdGhDYWNoZTJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeVBhdGg6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwicmVwbGFjZVJ1bGVcXFwiOlxcbiAgICAgICAgaWYgKE1ZX1BBUkFNUy5pc1JlZnJlc2gpIHtcXG4gICAgICAgICAgICBhZGRMaXN0ZW5lcihcXFwib25DbG9zZVxcXCIsICQudG9TdHJpbmcoKCkgPT4gcmVmcmVzaFBhZ2UoKSkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLmm7/mjaLop4TliJl86K6+572uXFxcIik7XFxuICAgICAgICBsZXQgcnVsZUxpc3QgPSBbXTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn6ZSZ6K+v5o+Q56S6JyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+abv+aNouaVsOaNruivu+WPluWksei0pe+8jOaYr+WQpuWIneWni+WMlu+8n1xcXFxu6K+l5pON5L2c5Lya5riF6Zmk5L2g55qE5pu/5o2i5pWw5o2uISEhJyxcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5Yid5aeL5YyW5a6M5oiQXFxcIik7XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgLy90b2FzdChcXFwi5Y+W5raIXFxcIik7XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaWsOW7uuabv+aNolxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2lzTmV3PXRydWVcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlh7rop4TliJlcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5a+85Ye6XFxcIiArIHJ1bGVMaXN0Lmxlbmd0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ZVRleHQpIHJldHVybiBcXFwidG9hc3Q6Ly/ojrflj5bmlofku7bkuLrnqbpcXFwiO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdSdWxlTGlzdCA9IEpTT04ucGFyc2UocnVsZVRleHQpO1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBuZXdDb3VudCA9IDAsXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCA9IDA7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbmV3UnVsZUxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBuZXdSdWxlID0gbmV3UnVsZUxpc3RbaV07XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcInJlcGxhY2VtZW50XFxcIikgfHwgIW5ld1J1bGUuaGFzT3duUHJvcGVydHkoXFxcInBhdHRlcm5cXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFwibmFtZVxcXCIpIHx8IChuZXdSdWxlLnNjb3BlQ29udGVudCA9PT0gdW5kZWZpbmVkID8gZmFsc2UgOiAhbmV3UnVsZS5zY29wZUNvbnRlbnQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBuZXdSdWxlLmlkO1xcbiAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkSW5kZXggPSBydWxlTGlzdC5maW5kSW5kZXgocnVsZSA9PiBydWxlLmlkID09PSBpZCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaWRJbmRleCA+IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5zcGxpY2UoaWRJbmRleCwgMSwgbmV3UnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3QucHVzaChuZXdSdWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbG9nKFxcXCJcXFxcbui3r+W+hO+8mlxcXCIgKyBpbnB1dCArIFxcXCJcXFxcbuaAu+inhOWImeaVsO+8mlxcXCIgKyBuZXdSdWxlTGlzdC5sZW5ndGggKyBcXFwiXFxcXG7mm7TmlrDop4TliJkgXFxcIiArIHVwZGF0ZUNvdW50ICsgXFxcIiDmnaFcXFxcdOaWsOWinuinhOWImSBcXFwiICsgbmV3Q291bnQgKyBcXFwiIOadoVxcXCIpO1xcbiAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlzYmFjaykgYmFjaygpO1xcbiAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5aSx6LSlXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5a+85YWl6KeE5YiZXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLlpJbpg6jmlofku7ZcXFwiLCBcXFwi5YaF6YOo5paH5Lu2XFxcIl0sIDEsIFxcXCLop4TliJnlr7zlhaVcXFwiKS5zZWxlY3QoKGltcG9ydFJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi5aSW6YOo5paH5Lu2XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJmaWxlU2VsZWN0Oi8vXFxcIiArICQudG9TdHJpbmcoaW1wb3J0UnVsZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKGltcG9ydFJ1bGUsIHRydWUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanNvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXCJjb25maXJtXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBtZW1vcnk6IFxcXCJzZWxlY3RQYXRoQ2FjaGVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGltcG9ydFJ1bGUpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBmb3IgKGxldCBpID0gMCwgbGVuID0gcnVsZUxpc3QubGVuZ3RoOyBpIDwgbGVuOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgcmVwbGFjZVJ1bGUgPSBydWxlTGlzdFtpXTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiByZXBsYWNlUnVsZS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGksXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJ1bGVMaXN0ID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIpIHx8IFxcXCJbXVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGcgPSBydWxlTGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9kZWxldGVJdGVtQnlDbHMoaWQgKyBcXFwiLlxcXCIgKyBpbmRleCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5Yig6Zmk5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBpZCwgaSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi57yW6L6RXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2luZGV4PVxcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBpZCArIFxcXCIuXFxcIiArIGlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgYnJlYWs7XFxuICAgIGNhc2UgXFxcImNvbnRlbnRzXFxcIjpcXG4gICAgICAgIGxldCBmID0gcmVxdWlyZShcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCIpO1xcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXCLnm67lvZXorr7nva586K6+572uXFxcIik7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLpgInmi6nmlofku7blpLlcXFwiLFxcbiAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoZi5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gZmluZEl0ZW0oaWQpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgICAgICAgICBpbml0aWFsUGF0aDogQ29uZmlnLmhvbWVQYXRoLFxcbiAgICAgICAgICAgICAgICByZXF1aXJlVXJsOiBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCIsXFxuICAgICAgICAgICAgICAgIHBhdHRlcm46IDFcXG4gICAgICAgICAgICB9KSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIuaUr+aMgWhpa2VyOi8vZmlsZXPot6/lvoQo6K+l5pON5L2c5LiN5Lya5Yid5aeL5YyW55uu5b2VKVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBDb25maWcuaG9tZVBhdGgsXFxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKChpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoaWQsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgICAgICAgICBpZDogaWRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuehruiupFxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcX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ZWdleFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdmFsdWUgPSB2YWx1ZSA9PT0gXFxcInRydWVcXFwiID8gdHJ1ZSA6IGZhbHNlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBqc29uW2tleV0gPSB2YWx1ZTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgY29weShKU09OLnN0cmluZ2lmeShqc29uKSk7XFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiXFxufSk7XFxubGF5b3V0LnB1c2goe1xcbiAgICB0aXRsZTogXFxcIueymOi0tFxcXCIsXFxuICAgIHVybDogJChcXFwie3tjbGlwYm9hcmR9fVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGpzb24gPSBKU09OLnBhcnNlKGlucHV0KTtcXG4gICAgICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShqc29uKSB8fCBqc29uLnBhdHRlcm4gPT0gdW5kZWZpbmVkKSByZXR1cm47XFxuICAgICAgICAgICAgbGV0IGF0dCA9IFtcXFwibmFtZVxcXCIsIFxcXCJpc1JlZ2V4XFxcIiwgXFxcInBhdHRlcm5cXFwiLCBcXFwicmVwbGFjZW1lbnRcXFwiXTtcXG4gICAgICAgICAgICBhdHQuZm9yRWFjaChrZXkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiLmVkaXRSZXBsYWNlUnVsZS5cXFwiICsga2V5LCBTdHJpbmcoanNvbltrZXldKSk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29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gICAgICAgICAgICAgICAgaXNUcnVlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICRpZCxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiL2Jvb2tJbmZvLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShib29rSW5mbykpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCArIGksIHJlcGxhY2VSdWxlLCBNWV9QQVJBTVMucGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5YWz6ZetXFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoJGlkLCByZXBsYWNlUnVsZSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGlmICghZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWFs+mXrVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBbXVxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIikpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLnNlbGVjdGVkLnNwbGljZShib29rSW5mby5z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XCLns7vnu5/pgInmi6nlmahcXFwiLCBcXFwi5rW36ZiU6YCJ5oup5ZmoXFxcIl0sIDEsIFxcXCLpgInmi6nlmajnsbvlnotcXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIuezu+e7n+mAieaLqeWZqFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJmaWxlU2VsZWN0Oi8vXFxcIiArICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEvKFxcXFwudHh0fC5lcHViKSQvaS50ZXN0KGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLpgInmi6nkuobplJnor6/nmoTmlofku7bnsbvlnotcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Db25maWcuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlTWF0Y2ggPSBpbnB1dC5tYXRjaCgvXFxcXC8oW15cXFxcL10qPykoXFxcXC50eHR8XFxcXC5lcHViKSQvaSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbm92ZWxOYW1lID0gZmlsZU1hdGNoWzFdLnJlcGxhY2UoXFxcIl9maWxlU2VsZWN0X1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGggPSBDb25maWcuZXh0ZXJuYWxJbXBvcnRQYXRoICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGlucHV0LnJlcGxhY2UoXFxcImZpbGU6Ly9cXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlhaXmj5DnpLpcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50OiBcXFwi5bey5a2Y5ZyoW1xcXCIgKyBub3ZlbE5hbWUgKyBcXFwiXeaYr+WQpuimhueblj9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5a+85YWl5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIjtcXG4gICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSAkLnJlcXVpcmUocmVxdWlyZVVybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmaWxlTWF0Y2ggPSBQQVRILm1hdGNoKC9cXFxcLyhbXlxcXFwvXSo/KShcXFxcLnR4dHxcXFxcLmVwdWIpJC9pKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm92ZWxOYW1lID0gZmlsZU1hdGNoWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGggPSBDb25maWcuZXh0ZXJuYWxJbXBvcnRQYXRoICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gUEFUSDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuW3suWtmOWcqFtcXFwiICsgbm92ZWxOYW1lICsgXFxcIl3mmK/lkKbopobnm5Y/XFxcIikuY29uZmlybSgocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgcGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLnR4dHwuZXB1YlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmU6IFxcXCJzZWxlY3RQYXRoQ2FjaGUxXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIG1lbW9yeVBhdGg6IHRydWVcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGV0IG9wdGlvbnMgPSBbXFxcIumYheivu1xcXCIsIFxcXCLliIbkuqtcXFwiLCBcXFwi5Yig6ZmkXFxcIiwgXFxcIuaJk+W8gOaWueW8j1xcXCJdO1xcblxcbiAgICBsZXQgcGF0dGVybiA9IGdldE15VmFyKFxcXCI6dHh0UGF0dGVyblxcXCIsIG9wdGlvbnNbMF0pO1xcbiAgICBsZXQgaWQgPSBEYXRlLm5vdygpICsgXFxcIjrmqKHlvI9cXFwiO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogcGF0dGVybixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8zXFxcIixcXG4gICAgICAgIHVybDogJChvcHRpb25zLCAxLCBcXFwi5pON5L2c5qih5byPXFxcIikuc2VsZWN0KChpZCkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCI6dHh0UGF0dGVyblxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpbnB1dFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSwgaWQpLFxcbiAgICAgICAgZXh0cmE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mlsZXMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHBhdGggKyBcXFwiLmpzb25cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHBhdGggKyBcXFwiLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGF0aClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgpO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIFxcXCLpmIXor7tcXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gKHR5cGU9PT1cXFwiLnR4dFxcXCI/XFxcImhpa2VyOi8vcGFnZS90eHRQYXJzZXIudmlld1xcXCI6XFxcImhpa2VyOi8vcGFnZS9lcHViUGFyc2VyLnZpZXcjYXV0b0NhY2hlI1xcXCIpK1xcXCI/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZTtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgY2FzZSBcXFwi5omT5byA5pa55byPXFxcIjpcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJvcGVuRmlsZTovL2ZpbGU6Ly9cXFwiICsgcGF0aDtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG4gICAgZm9yIChsZXQgbm92ZWwgb2YgZmlsZXMpIHtcXG4gICAgICAgIGxldCB0eXBlID0gbm92ZWwubmFtZS5zdWJzdHJpbmcobm92ZWwubmFtZS5sYXN0SW5kZXhPZihcXFwiLlxcXCIpKTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUob3BlcmF0aW9uLCBub3ZlbC5wYXRoLCBub3ZlbC5uYW1lLCB0eXBlKSxcXG4gICAgICAgICAgICBkZXNjOiBcXFwi5aSn5bCP77yaXFxcIiArIEZpbGUuZ2V0RmlsZVNpemUobm92ZWwucGF0aCkgKyBcXFwiXFxcXG7kv67mlLnml7bpl7TvvJpcXFwiICsgJC5kYXRlRm9ybWF0KG5vdmVsLmxhc3RNb2RpZmllZCwgXFxcInl5eXktTU0tZGQgSEg6bW06c3NcXFwiKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgcGF0aDogbm92ZWwucGF0aCxcXG4gICAgICAgICAgICAgICAgaXNDYWNoZTogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5vdmVsLm5hbWUsXFxuICAgICAgICAgICAgICAgIGlkOiBub3ZlbC5wYXRoLFxcbiAgICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIhuS6q1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcInNoYXJlOi8vXFxcIiArIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6ZiF6K+7XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeSgodHlwZT09PVxcXCIudHh0XFxcIj9cXFwiaGlrZXI6Ly9wYWdlL3R4dFBhcnNlci52aWV3XFxcIjpcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcIikrXFxcIj9ydWxlPVxcXCIgKyBNWV9SVUxFLnRpdGxlKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuaJk+W8gOaWueW8j1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogSlNPTi5zdHJpbmdpZnkoXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXCIgKyBub3ZlbC5wYXRoKVxcbiAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcImxvbmdQcmVzcy5qc1xcXCIpLmRlbGV0ZUZpbGVGb3JUeHQocGF0aClcXG4gICAgICAgICAgICAgICAgICAgIH0sIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH1dXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgaWYgKGZpbGVzLmxlbmd0aCA9PT0gMCkge1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6K6+572uXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvU2V0dGluZy52aWV3I25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIixcXG4gICAgICAgICAgICBjb2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hbEltcG9ydFBhdGgsIENvbmZpZy5jb250ZW50c0NhY2hlKTtcXG4gICAgaWYgKGlzQ2FjaGUmJmZpbGVFeGlzdChjYWNoZVBhdGgpKSB7XFxuICAgICAgICB0cnkge1xcblxcbiAgICAgICAgICAgIGxldCBjID0gSlNPTi5wYXJzZShyZXF1ZXN0KGNhY2hlUGF0aCkpO1xcbiAgICAgICAgICAgIGNoYXB0ZXJOYW1lcyA9IGMuY2hhcHRlck5hbWVzO1xcbiAgICAgICAgICAgIGludGVydmFscyA9IGMuaW50ZXJ2YWxzO1xcbiAgICAgICAgICAgIGhhc1ByZWZhY2UgPSBjLmhhc1ByZWZhY2U7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumHjeaWsOino+aekOebruW9lVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShwYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXCIuanNvblxcXCIpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6ZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6XFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgc2V0UmVzdWx0KFt7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHN0cm9uZz7nm67lvZXop6PmnpDlpLHotKUo6YeN5paw6Kej5p6QKTwvc3Ryb25nPlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShwYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBwYXRoK1xcXCIuanNvblxcXCIpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XSk7XFxuICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgfVxcblxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuato+WcqOino+aekOebruW9lVxcXCIpO1xcbiAgICAgICAgbGV0IHR4dCA9IHJlcXVlc3QocGF0aCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgLy9cXFwiY29udGVudC10eXBlXFxcIjogXFxcInRleHQvcGxhaW47IGNoYXJzdD1cXFwiICsgY2hhcnN0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgcGF0dGVybiA9IHJlZ3MuZ2V0VG9jUnVsZSh0eHQpO1xcbiAgICAgICAgaWYgKCFwYXR0ZXJuKSB7XFxuICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pTwvc3Ryb25nPlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBiYWNrKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XSk7XFxuICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IG1hdGNoZXIgPSBwYXR0ZXJuLm1hdGNoZXIodHh0KTtcXG4gICAgICAgIGxldCBwb2ludGVyID0gMDtcXG4gICAgICAgIHdoaWxlIChtYXRjaGVyLmZpbmQoKSkge1xcbiAgICAgICAgICAgIGxldCBzdGFydCA9IG1hdGNoZXIuc3RhcnQoKTtcXG4gICAgICAgICAgICBsZXQgZW5kID0gbWF0Y2hlci5lbmQoKTtcXG4gICAgICAgICAgICBsZXQgdCA9IG1hdGNoZXIuZ3JvdXAoKTtcXG4gICAgICAgICAgICBpZiAocG9pbnRlciA9PT0gMCAmJiBzdGFydCA+IDMwKSB7XFxuICAgICAgICAgICAgICAgIGhhc1ByZWZhY2UgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBjaGFwdGVyTmFtZXMucHVzaCh0KTtcXG4gICAgICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgc3RhcnRdKTtcXG4gICAgICAgICAgICBwb2ludGVyID0gZW5kO1xcbiAgICAgICAgfVxcbiAgICAgICAgaW50ZXJ2YWxzLnB1c2goW3BvaW50ZXIsIHR4dC5sZW5ndGhdKTtcXG4gICAgICAgIGlmIChpc0NhY2hlKSB7XFxuICAgICAgICAgICAgd3JpdGVGaWxlKGNhY2hlUGF0aCwgSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZXM6IGNoYXB0ZXJOYW1lcyxcXG4gICAgICAgICAgICAgICAgaW50ZXJ2YWxzOiBpbnRlcnZhbHMsXFxuICAgICAgICAgICAgICAgIGhhc1ByZWZhY2U6IGhhc1ByZWZhY2VcXG4gICAgICAgICAgICB9KSk7XFxuICAgICAgICB9XFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICB9XFxuXFxuXFxuICAgIGlmIChoYXNQcmVmYWNlKSB7XFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbMF07XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLluo/oqIBcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvVFhUVmlld2VyLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lOiBcXFwi5bqP6KiAXFxcIixcXG4gICAgICAgICAgICAgICAgc3RhcnQ6IGludGVydmFsWzBdLFxcbiAgICAgICAgICAgICAgICBlbmQ6IGludGVydmFsWzFdLFxcbiAgICAgICAg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5YiG6LWb5ri4XSl856+HKD8h5bygKSkpLnswLDMwfSRcXFwiLFxcbiAgICAgICAgXFxcImV4YW1wbGVcXFwiOiBcXFwi56ys5LiA56ugIOagh+WHhueahOeypOivreWwseaYr+i/meagt1xcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMVxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaWRcXFwiOiAtMyxcXG4gICAgICAgIFxcXCJlbmFibGVcXFwiOiBmYWxzZSxcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIuebruW9lSjljLnphY3nroDku4spXFxcIixcXG4gICAgICAgIFxcXCJydWxlXFxcIjogXFxcIig/PD1b44CAXFxcXFxcXFxzXSkoPzooPzrlhoXlrrl85paH56ugKT/nroDku4t85paH5qGIfOWJjeiogHzluo/nq6B85qWU5a2QfOato+aWhyg/IeWujHznu5MpfOe7iOeroHzlkI7orrB85bC+5aOwfOeVquWklnznrKw/XFxcXFxcXFxzezAsNH1bXFxcXFxcXFxk44CH6Zu25LiA5LqM5Lik5LiJ5Zub5LqU5YWt5LiD5YWr5Lmd5Y2B55m+5Y2D5LiH5aO56LSw5Y+B6IKG5LyN6ZmG5p+S5o2M546W5ou+5L2w5LufXSs/XFxcXFxcXFxzezAsNH0oPzrnq6B86IqCKD8h6K++KXzljbd86ZuGKD8hW+WQiOWSjF0pfOmDqCg/IVvliIbotZvmuLhdKXzlm54oPyFb5ZCI5p2l5LqL5Y67XSl85Zy6KD8hW+WSjOWQiOavlOeUteaYr10pfOevhyg/IeW8oCkpKS57MCwzMH0kXFxcIixcXG4gICAgICAgIFxcXCJleGFtcGxlXFxcIjogXFxcIueugOS7iyDogIHlpKvor7jokZvmnZHlpKtcXFwiLFxcbiAgICAgICAgXFxcInNlcmlhbE51bWJlclxcXCI6IDJcXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgXFxcImlkXFxcIjogLTQsXFxuICAgICAgICBcXFwiZW5hYmxlXFxcIj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gICAgICAgXFxcImV4YW1wbGVcXFwiOiBcXFwi44CO5Yqg5Liq55u06KeS5byV5Y+35pu05LiT5Lia44CPXFxcIixcXG4gICAgICAgIFxcXCJzZXJpYWxOdW1iZXJcXFwiOiAxMVxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaWRcXFwiOiAtMTQsXFxuICAgICAgICBcXFwiZW5hYmxlXFxcIjogdHJ1ZSxcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIueJueauiuespuWPtyDmoIfpopgo5Y2V5LiqKVxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCIoPzw9W1xcXFxcXFxcc+OAgF17MCw0fSkoPzpb4piG4piF4pym4pynXS57MSwzMH18KD865YaF5a65fOaWh+eroCk/566A5LuLfOaWh+ahiHzliY3oqIB85bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJYpWyDjgIBdezAsNH0kXFxcIixcXG4gICAgICAgIFxcXCJleGFtcGxlXFxcIjogXFxcIuKYhuOAgeaZi+axn+S9nOiAheacgOWWnOasoueahOagvOW8j1xcXCIsXFxuICAgICAgICBcXFwic2VyaWFsTnVtYmVyXFxcIjogMTJcXG4gICAgfSxcXG4gICAge1xcbiAgICAgICAgXFxcImlkXFxcIjogLTE1LFxcbiAgICAgICAgXFxcImVuYWJsZVxcXCI6IHRydWUsXFxuICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLnq6Av5Y23IOW6j+WPtyDmoIfpophcXFwiLFxcbiAgICAgICAgXFxcInJ1bGVcXFwiOiBcXFwiXlsgXFxcXFxcXFx044CAXXswLDR9KD86KD865YaF5a65fOaWh+eroCk/566A5LuLfOaWh+ahiHzliY3oqIB85bqP56ugfOallOWtkHzmraPmlocoPyHlrox857uTKXznu4jnq6B85ZCO6K6wfOWwvuWjsHznlarlpJZ8W+WNt+eroF1bXFxcXFxcXFxk44CH6Zu25LiA5LqM5Lik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cXFwiICsgaW5mby5wYXJzZUNvZGUpO1xcbiAgICAgICAgcGljTGlzdCA9IGdldFBpY0xpc3QoaXRlbS51cmwsIGl0ZW0udXJsLCBvcmRlciwgaXRlbS50aXRsZSk7XFxuICAgICAgICBpZiAodHlwZW9mIHBpY0xpc3QgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxuICAgICAgICAgICAgcGljTGlzdCA9IHBpY0xpc3QucmVwbGFjZShcXFwicGljczovL1xcXCIsIFxcXCJcXFwiKS5zcGxpdChcXFwiJiZcXFwiKTtcXG4gICAgICAgIH1cXG4gICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgZS5tZXNzYWdlID0gXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor68+IFxcXCIgKyBlLm1lc3NhZ2U7XFxuICAgICAgICB0aHJvdyBlO1xcbiAgICB9XFxuICAgIHBpY0xpc3QgPSBwaWNMaXN0LmZpbHRlcihwID0+IHApO1xcbiAgICBjb25zdCBMID0gcGljTGlzdC5sZW5ndGg7XFxuICAgIGlmIChMID09PSAwKSB7XFxuICAgICAgICB0b2FzdChcXFwi5Zu+54mH6ZO+5o6l5Li656m6XFxcIik7XFxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor6/vvJrlm77niYfpk77mjqXov5Tlm57kuLrnqbo+XFxcIik7XFxuICAgIH1cXG4gICAgaWYgKGluZm8uYm9va1RvcFBpYykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgYm9va1RvcFBpYyA9IFRvb2wuaGlrZXJQaWMoaW5mby5ib29rVG9wUGljKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKGJvb2tUb3BQaWNbMF0sIG1haW5QYXRoICsgaW5mby5ib29rTmFtZSArIGlkICsgXFxcIi5qcGdcXFwiLCBib29rVG9wUGljWzFdLCBpbmZvLmRlY29kZSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgbG9nKFxcXCI85bCB6Z2i5LiL6L296ZSZ6K+vPiBcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBsZXQgZXJyb3JOdW0gPSAwO1xcbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IEw7IGkrKykge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgcGljID0gVG9vbC5oaWtlclBpYyhwaWNMaXN0W2ldKTtcXG4gICAgICAgICAgICBUb29sLnBpY0Rvd25sb2FkKHBpY1swXSwgY2hhcHRlclBhdGggKyAoaSArIDEpICsgXFxcIi5qcGdcXFwiLCBwaWNbMV0sIGluZm8uZGVjb2RlKTtcXG4gICAgICAgICAgICBpZiAoaW50ZXJydXB0ICYmIGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiXFxcIikgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGVycm9yTnVtID0gMDtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBpZiAoZXJyb3JOdW0gPCAxMCkge1xcbiAgICAgICAgICAgICAgICBpLS07XFxuICAgICAgICAgICAgICAgIGVycm9yTnVtKys7XFxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuICAgIEZpbGUucmVuYW1lRmlsZShjaGFwdGVyUGF0aCwgb3JkZXIgKyBcXFwiJEEkXFxcIiArIFRvb2wudGV4dFNoaWVsZChpdGVtLnRpdGxlKSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI3Yu5ryr55S75YW85a65X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yYW5rSXNSZXZlcnNlID8gXFxcIuKGk1xcXCIgOiBcXFwi4oaRXFxcIjtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgdGl0bGViID0gXFxcIuKGlVxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHRpdGxlYSArIHRpdGxlYixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJhbmtNZXRob2QgPSBnZXRJdGVtKFxcXCJib29rcmFjazpyYW5rTWV0aG9kXFxcIiwgXFxcIuezu+e7n1xcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgcmFua0lzUmV2ZXJzZSA9IGdldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2VcXFwiLCBcXFwiXFxcIik7XFxuXFxuICAgICAgICAgICAgICAgIGlmIChyYW5rTWV0aG9kID09PSBuYW1lKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocmFua0lzUmV2ZXJzZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXCIxXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtJc1JldmVyc2VcXFwiLCByYW5rSXNSZXZlcnNlKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImJvb2tyYWN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Y29sX3R5cGU6Y29sX3R5cGUsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsb25nUHJlc3MuanNcXFwiKS5kZWxldGVGaWxlRm9yQm9vayhwYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0ZW0uZ2V0UGF0aCgpKVxcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZ2V0UGF0aCgpLFxcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLmdldFBhdGgoKSxcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5nZXROYW1lKClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBpZiAocmFua0lzUmV2ZXJzZSkge1xcbiAgICAgICAgYm9va0xpc3QucmV2ZXJzZSgpO1xcbiAgICB9XFxuXFxuICAgIHNldFJlc3VsdChsYXlvdXQuY29uY2F0KGJvb2tMaXN0KSk7XFxufSkoKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLuaWh+S7tuaOkuW6j1wiLFwicGF0aFwiOlwiZmlsZVJhbmsuanNcIixcInJ1bGVcIjpcImpzOlxcbmNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcIkZpbGUuanNcXFwiKTtcXG5sZXQgY2huTnVtQ2hhciA9IHtcXG4gICAg6Zu2OiAwLFxcbiAgICDkuIA6IDEsXFxuICAgIOS6jDogMixcXG4gICAg5LiJOiAzLFxcbiAgICDlm5s6IDQsXFxuICAgIOS6lDogNSxcXG4gICA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7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsZXQgdW5pdCA9IGNobk5hbWVWYWx1ZVtzdHJbaV1dLnZhbHVlO1xcbiAgICAgICAgICAgIHNlY1VuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS5zZWNVbml0O1xcbiAgICAgICAgICAgIGlmIChzZWNVbml0KSB7XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAoc2VjdGlvbiArIG51bWJlcikgKiB1bml0O1xcbiAgICAgICAgICAgICAgICBydG4gKz0gc2VjdGlvbjtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiA9IDA7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiArPSAobnVtYmVyICogdW5pdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIG51bWJlciA9IDA7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgcmV0dXJuIHJ0biArIHNlY3Rpb247XFxufVxcblxcbmZ1bmN0aW9uIG5hbWVDb21wYXJlKGEsIGIpIHtcXG4gICAgaWYgKGEgPT0gbnVsbCB8fCBiID09IG51bGwpXFxuICAgICAgICByZXR1cm4gYSA9PSBudWxsID8gYiA9PSBudWxsID8gMCA6IC0xIDogMTtcXG5cXG4gICAgYSA9IGEucmVwbGFjZSgvKFvpm7bkuIDkuozkuInlm5vkupTlha3kuIPlhavkuZ3ljYHnmb7ljYPkuIfkur9dKS9nLCBmdW5jdGlvbihtYXRjaCwgcDEsIHAyLCBwMywgb2Zmc2V0LCBzdHJpbmcpIHtcXG4gICAgICAgIC8vIHAxIGlzIG5vbmRpZ2l0cywgcDIgZGlnaXRzLCBhbmQgcDMgbm9uLWFscGhhbnVtZXJpY3NcXG4gICAgICAgIHJldHVybiBDaGluZXNlVG9OdW1iZXIocDEpO1xcbiAgICB9KVxcbiAgICBiID0gYi5yZXBsYWNlKC8oW+mbtuS4gOS6jO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iwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlt7Lnu4/mmK/mnIDmlrDniYjmnKzkuoZcXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5piv5pyA5paw54mI5pys5LqGXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHRpZCArIFxcXCIj6K6+572uX+abtOaWsFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5pyJ5paw54mI5pys6L+Y5pyq5pu05pawXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoXFxcIuacieaWsOeJiOacrOi/mOacquabtOaWsFxcXCIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInJ1bGU6Ly81clczNlppVTZLZUc1NVdNNzcrbGFHOXRaVjl5ZFd4bFgzVnliTysvcFdoMGRIQTZMeTlvYVd0bGNpNXViMnRwWVM1d2NtVnpjeTlvYVd0bGNuVnNaUzl5ZFd4bGJHbHpkQzVxYzI5dVAybGtQVE0xTlRrPVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0odGlkICsgXFxcIiPorr7nva5f5pu05pawXFxcIiwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuS/oeaBr+iOt+WPluWksei0pVxcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pu05paw5L+h5oGv6I635Y+W5aSx6LSlXFxcIjtcXG4gICAgICAgIH1cXG4gICAgfSwgTVlfUEFSQU1TLnZlcnNpb24sIHRpZCksXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBpZDogdGlkICsgXFxcIiPorr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iMVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZXJyb3JOdW0gPSAwO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpID09PSA5KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHJldHVybiB0YXNrUGFyYW0uQ0lEO1xcXFxuICAgIH1cXFxcbiAgICBsZXQgY291bnQgPSAwO1xcXFxuICAgIGxldCB0b3RhbENvdW50ID0gMDtcXFxcbiAgICBsZXQgc3VjY2Vzc0NJRCA9IFtdO1xcXFxuXFxcXG4gICAgZnVuY3Rpb24gbGlzdGVuZXIocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICB0b3RhbENvdW50Kys7XFxcXG5cXFxcbiAgICAgICAgICAgIGlmIChlcnJvciAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeS4i+i9veWksei0pe+8mlxcXFxcXFwiICsgaWQgKyBcXFxcXFxcIjxFUlJPUkAgXFxcXFxcXCIgKyBlcnJvciArIFxcXFxcXFwiPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdWx0ID09PSAtMSkge1xcXFxuICAgICAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIltsaXN0ZW5lcl3lt7LlgZzmraLvvJpcXFxcXFxcIiArIGlkKTtcXFxcbiAgICAgICAgICAgICAgICB0b3RhbENvdW50ID0gcGFyYW0ucGl2Q291bnQ7XFx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gICBpZDogTVlfSUQgKyBcXFxcXFxcInx85LiL6L296L+b5bqmXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIC8vcHV0TG9nKFxcXFxcXFwiW2xpc3RlbmVyXeW3suWujOaIkOS4i+i9ve+8mlxcXFxcXFwiICsgaWQpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHRvdGFsQ291bnQgIT09IHBhcmFtLnBpdkNvdW50KSByZXR1cm47XFxcXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCA9PT0gY291bnQpIHtcXFxcbiAgICAgICAgICAgICAgICBGaWxlLnJlbmFtZUZpbGUocGFyYW0uY2hhcHRlclBhdGgsIHBhcmFtLkNJRCArIFxcXFxcXFwiJEEkXFxcXFxcXCIgKyBUb29sLnRleHRTaGllbGQocGFyYW0udGl0bGUpKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHRvdGFsQ291bnQgPSBjb3VudCA9IDA7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJicmVha1xcXFxcXFwiO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBsZXQgdGFza1RlYW0gPSBbXTtcXFxcbiAgICBsZXQgbWFpblBhdGggPSBDb25maWcuY29taWNQYXRoICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBpbmZvLnJ1bGVOYW1lICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBUb29sLnRleHRTaGllbGQoaW5mby5ib29rTmFtZSkgKyBcXFxcXFxcIi9cXFxcXFxcIjtcXFxcbiAgICBpZiAoaW5mby5ib29rVG9wUGljKSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBsZXQgYm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ywgaXRlbS50aXRsZSk7XFxcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHBpY0xpc3QgPT09IFxcXFxcXFwic3RyaW5nXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICBwaWNMaXN0ID0gcGljTGlzdC5yZXBsYWNlKFxcXFxcXFwicGljczovL1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKS5zcGxpdChcXFxcXFxcIiYmXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBwdXRMb2coXFxcXFxcXCI85ryr55S75Zu+54mH6Kej5p6Q6ZSZ6K+vPiBcXFxcXFxcIiArIGUubWVzc2FnZSk7XFxcXG4gICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpZiAocGljTGlzdC5sZW5ndGggPT09IDApIHtcXFxcbiAgICAgICAgICAgIHB1dExvZyhcXFxcXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor6/vvJrlm77niYfpk77mjqXov5Tlm57kuLrnqbo+XFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgcGljTGlzdCA9IHBpY0xpc3QuZmlsdGVyKHAgPT4gcCk7XFxcXG4gICAgICAgIHZhciB0YXNrVGVhbSA9IHBpY0xpc3QubWFwKCh1cmwsIGkpID0+ICh7XFxcXG4gICAgICAgICAgICBmdW5jOiB0YXNrLFxcXFxuICAgICAgICAgICAgaWQ6IGksXFxcXG4gICAgICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgIGk6IGksXFxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoLFxcXFxuICAgICAgICAgICAgICAgIE1ZX0lEOiBNWV9JRCxcXFxcbiAgICAg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XFxuICAgICAgICAgICAgICAgIGxldCBkaXIgPSBmaWxlLmdldFBhcmVudEZpbGUoKTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZGlyICE9IG51bGwgJiYgIWRpci5leGlzdHMoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBkaXIubWtkaXJzKCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGluc3RyZWFtID0gZmV0Y2godXJsLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMsXFxcXG4gICAgICAgICAgICAgICAgICAgIGlucHV0U3RyZWFtOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICBvdXRzdHJlYW0gPSBuZXcgamF2YS5pby5GaWxlT3V0cHV0U3RyZWFtKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgIGxldCB0ID0gJC5oaWtlci5pbnB1dCxcXFxcbiAgICAgICAgICAgICAgICAgICAgYyA9ICQuaGlrZXIudXJsO1xcXFxuICAgICAgICAgICAgICAgICQuaGlrZXIuaW5wdXQgPSBpbnN0cmVhbTtcXFxcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IHVybDtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcGljaW4gPSAobmV3IEZ1bmN0aW9uKFxcXFxcXFwicmV0dXJuIFxcXFxcXFwiICsgZGVjaXBoZSkpKCk7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IHQ7XFxcXG4gICAgICAgICAgICAgICAgJC5oaWtlci51cmwgPSBjO1xcXFxuICAgICAgICAgICAgICAgIGxldCBidWYgPSBqYXZhLmxhbmcucmVmbGVjdC5BcnJheS5uZXdJbnN0YW5jZShqYXZhLmxhbmcuQnl0ZS5UWVBFLCAxMDI0KTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbGVuO1xcXFxuICAgICAgICAgICAgICAgIHdoaWxlICgobGVuID0gcGljaW4ucmVhZChidWYpKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBvdXRzdHJlYW0ud3JpdGUoYnVmLCAwLCBsZW4pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXFxcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGlmIChmaWxlIGluc3RhbmNlb2YgamF2YS5pby5GaWxlICYmIGZpbGUuZXhpc3RzKCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZS5kZWxldGUoKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwiPOino+WvhuS4i+i9vUVycm9yPlxcXFxcXFwiICsgZS50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgIHRocm93IGU7XFxcXG4gICAgICAgICAgICB9IGZpbmFsbHkge1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcXFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXFxcbiAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHVybCwgcGF0aCwgaGVhZGVycyk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuICAgIHRleHRTaGllbGQodGV4dCkge1xcXFxuICAgICAgICBsZXQgZSA9IC8jfDp8JnxcXFxcXFxcXHx8XFxcXFxcXFxefEB8XFxcXFxcXFw8fFxcXFxcXFxcPn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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXFxcXFwiLnRnbnVtXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQucGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0Jvb2tyYWNrLnZpZXc/cnVsZT3mnKzlnLDotYTmupDnrqHnkIYmcnVsZU5hbWU9XFxcXFxcXCIraXQubmFtZStcXFxcXFxcIiZ0eXBlPVxcXFxcXFwiK3R5cGU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBpdCwgdHlwZSlcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZShpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCIudGdudW1cXFxcXFxcIiwgaSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9LCBpKSxcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuICAgIGxldCBwYXRoID0gdGFnW3RnbnVtXS5wYXRoO1xcXFxuICAgIGxldCBtaGxpc3QgPSBGaWxlLmdldEZpbGVQYXRoKHBhdGgsIFxcXFxcXFwiZGlyXFxcXFxcXCIpO1xcXFxuXFxcXG4gICAgaWYgKG1obGlzdC5sZW5ndGggPT09IDApIHtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi4oCc4oCc4oCd4oCdXFxcXFxcXCIgKyBcXFxcXFxcIuWVpemDveayoeacieiAtlxcXFxcXFwiLmJpZygpLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGxheW91dCk7XFxcXG4gICAgfVxcXFxuICAgIGxldCBwYWdlVXJsID0gdHlwZSA9PT0gXFxcXFxcXCJub3ZlbFxcXFxcXFwiID8gXFxcXFxcXCJoaWtlcjovL3BhZ2UvTm92ZWxCcm93c2VyLn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1xcXFxuICAgICAgICAgICAgYXJyYXkucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIHVybDogaXRlbS5wYXRoICsgbGF6eSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogQ29uZmlnLmRlZl9Db21pY19TdHlsZSxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdGVtLnBhdGggKyBcXFxcXFxcIi8xLmpwZ1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGZvciAobGV0IGl0ZW0gb2YgbWhsaXN0KSB7XFxcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBnZXRUaXRsZShpdGVtLm5hbWUpO1xcXFxuICAgICAgICAgICAgYXJyYXkucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL3BhZ2UvY29taWNDb21wYXRpYmxlLnZpZXcjYXV0b1BhZ2UjI3JlYWRUaGVtZSM/cGF0aD1cXFxcXFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChpdGVtLnBhdGgpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX0NvbWljX1N0eWxlLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGl0ZW0ucGF0aCArIFxcXFxcXFwiLzEuanBnXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGF0aDogaXRlbS5wYXRoLFxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0VGl0bGUyKGl0ZW0ubmFtZSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICA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cIjtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBmb3IgKGxldCBjYWNoZSBvZiBjYWNoZURpcikge1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjYWNoZS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi5aSn5bCP77yaXFxcXFxcXCIgKyBGaWxlLmdldEZpbGVTaXplKGNhY2hlLnBhdGgpICsgXFxcXFxcXCJcXFxcXFxcXG7mj4/ov7DvvJpcXFxcXFxcIiArIChrbm93bkxpc3QuZ2V0KGNhY2hlLm5hbWUpIHx8IFxcXFxcXFwi5pyq55+l55uu5b2VW+mjjumZqeacquefpV1cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwi56Gu6K6k5riF6ZmkIFxcXFxcXFwiICsgY2FjaGUubmFtZSArIFxcXFxcXFwiID9cXFxcXFxcIikuY29uZmlybShjbGVhbkNhY2hlLCBjYWNoZS5wYXRoKVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLlhajpg6jmuIXpmaQoXFxcXFxcXCIgKyBGaWxlLmdldEZpbGVTaXplKENvbmZpZy5ob21lUGF0aCkgKyBcXFxcXFxcIilcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXF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UnVsZShzZXREZWZhdWx0UGljLCBcXFxcXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfcGljXFxcXFxcXCIgKyBpKVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6Ieq5a6a5LmJ4p6VXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChbXFxcXFxcXCLoh6rlrprkuYl1cmxcXFxcXFxcIiwgXFxcXFxcXCLpgInmi6nmlofku7bot6/lvoRcXFxcXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFxcXFxcIuiHquWumuS5iXVybFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwiXFxcXFxcXCIsIFxcXFxcXFwi6L6T5YWl5Zu+54mH55qE6Lev5b6E5oiW6ICF6ZO+5o6lXFxcXFxcXCIpLmlucHV0KCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgMCkgfHwgXFxcXFxcXCJ7fVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gaW5wdXQ7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFxcXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSAkLnJlcXVpcmUocmVxdWlyZVVybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBDb25maWcgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwiY29uZmlnLmpzb25cXFxcXFxcIiwgMCkgfHwgXFxcXFxcXCJ7fVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgUEFUSDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcImNvbmZpZy5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiOmRlZmF1bHRQaWNCYWNrXFxcXFxcXCIsIFxcXFxcXFwidHJ1ZVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxcXG4gICAgICAgICAgICAg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xcIltdXFxcXFxcXCIpO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBjb25maXJtKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+mUmeivr+aPkOekuicsXFxcXG4gICAgICAgICAgICAgICAgY29udGVudDogJ+abv+aNouaVsOaNruivu+WPluWksei0pe+8jOaYr+WQpuWIneWni+WMlu+8n1xcXFxcXFxcbuivpeaTjeS9nOS8mua4hemZpOS9oOeahOabv+aNouaVsOaNriEhIScsXFxcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuWIneWni+WMluWujOaIkFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAvL3RvYXN0KFxcXFxcXFwi5Y+W5raIXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuaWsOW7uuabv+aNolxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9lZGl0UmVwbGFjZVJ1bGUudmlldyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMjbm9SZWZyZXNoIz9pc05ldz10cnVlXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzNcXFxcXFxcIlxcXFxuICAgICAgICB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FzT3duUHJvcGVydHkoXFxcXFxcXCJwYXR0ZXJuXFxcXFxcXCIpIHx8ICFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXFxcXFwibmFtZVxcXFxcXFwiKSB8fCAobmV3UnVsZS5zY29wZUNvbnRlbnQgPT09IHVuZGVmaW5lZCA/IGZhbHNlIDogIW5ld1J1bGUuc2NvcGVDb250ZW50KSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gbmV3UnVsZS5pZDtcXFxcbiAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRJbmRleCA9IHJ1bGVMaXN0LmZpbmRJbmRleChydWxlID0+IHJ1bGUuaWQgPT09IGlkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlkSW5kZXggPiAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnNwbGljZShpZEluZGV4LCAxLCBuZXdSdWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5wdXNoKG5ld1J1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChpc2JhY2spIHtc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bGVjdCgoaW1wb3J0UnVsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcXFxcXCLlpJbpg6jmlofku7ZcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJmaWxlU2VsZWN0Oi8vXFxcXFxcXCIgKyAkLnRvU3RyaW5nKGltcG9ydFJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcXFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gcmVxdWlyZShyZXF1aXJlVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZyhpbXBvcnRSdWxlLCB0cnVlKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IHJlcXVpcmVVcmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanNvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DbGlja1R5cGU6IFxcXFxcXFwiY29uZmlybVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5OiBcXFxcXFxcInNlbGVjdFBhdGhDYWNoZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIGltcG9ydFJ1bGUpLFxcXFxuICAgICAgICAgICAgY29s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lcGxhY2VSdWxlLmpzb25cXFxcXFxcIikgfHwgXFxcXFxcXCJbXVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGcgPSBydWxlTGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2RlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXFxcXFwiLlxcXFxcXFwiICsgaW5kZXgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXFxcXFwi5Yig6Zmk5oiQ5YqfXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgaWQsIGkpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLnvJbovpFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VkaXRSZXBsYWNlUnVsZS52aWV3I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyNub1JlZnJlc2gjP2luZGV4PVxcXFxcXFwiICsgaSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcXFxcXCIuXFxcXFxcXCIgKyBpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFxcXFxcIi5cXFxcXFxcIiArIGlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBicmVhaztcXFxcbiAgICBjYXNlIFxcXFxcXFwiY29udGVudHNcXFxcXFxcIjpcXFxcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiKTtcXFxcbiAgICAgICAgc2V0UGFnZVRpdGxlKFxcXFxcXFwi55uu5b2V6K6+572ufOiuvue9rlxcXFxcXFwiKTtcXFxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6YCJ5oup5paH5Lu25aS5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KGYuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShpZCkuZXh0cmE7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcXFxuICAgICAgICAgICAgICAgIH0sIGlkKSxcXFxcbiAgICAgICAgICAgICAgICBpbml0aWFsUGF0aDogQ29uZmlnLmhvbWVQYXRoLFxcXFxuICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHBhdHRlcm46IDFcXFxcbiAgICAgICAgICAgIH0pKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImlucHV0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBkZXNjOiBcXFxcXFxcIuaUr+aMgWhpa2VyOi8vZmlsZXPot6/lvoQo6K+l5pON5L2c5LiN5Lya5Yid5aeL5YyW55uu5b2VKVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IENvbmZpZy5ob21lUGF0aCxcXFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygoaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoaWQsIGlucHV0KTtcXFxcbiAgICAgICAgICAg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SBDb25maWcuY29udGVudHNDYWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBpbnB1dC5yZXBsYWNlKFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWvvOWFpeaPkOekulxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXFxcXFwi5bey5a2Y5ZyoW1xcXFxcXFwiICsgbm92ZWxOYW1lICsgXFxcXFxcXCJd5piv5ZCm6KaG55uWP1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFxcXFxcIuWvvOWFpeaIkOWKn1xcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVxdWlyZVVybCA9IFxcXFxcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIGxldCBmaWxlU2VsZWN0ID0gJC5yZXF1aXJlKHJlcXVpcmVVcmwpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcXFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBDb25maWcgPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IFBBVEgubWF0Y2goL1xcXFxcXFxcLyhbXlxcXFxcXFxcL10qPykoXFxcXFxcXFwudHh0fFxcXFxcXFxcLmVwdWIpJC9pKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoID0gQ29uZmlnLmV4dGVybmFsSW1wb3J0UGF0aCArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0b3BhdGhDYWNoZSA9IENvbmZpZy5jb250ZW50c0NhY2hlICsgbm92ZWxOYW1lICsgZmlsZU1hdGNoWzJdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBQQVRIO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIuW3suWtmOWcqFtcXFxcXFxcIiArIG5vdmVsTmFtZSArIFxcXFxcXFwiXeaYr+WQpuimhueblj9cXFxcXFxcIikuY29uZmlybSgocGF0aCwgdG9wYXRoLCB0b3BhdGhDYWNoZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoLCB0cnVlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFxcXFxcImZpbGU6Ly9cXFxcXFxcIiArIHRvcGF0aENhY2hlKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5kZWxldGVGaWxlcyh0b3BhdGhDYWNoZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXFxcXFwiLnR4dHwuZXB1YlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcXFxcXCJjb25maXJtXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JlOiBcXFxcXFxcInNlbGVjdFBhdGhDYWNoZTFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgbWVtb3J5UGF0aDogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KSxcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICB9XFxcXG4gICAgfSk7XFxcXG4gICAgbGV0IG9wdGlvbnMgPSBbXFxcXFxcXCLpmIXor7tcXFxcXFxcIiwgXFxcXFxcXCLliIbkuqtcXFxcXFxcIiwg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ICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHBhdGggKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYXRoKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgIGNhc2UgXFxcXFxcXCLpmIXor7tcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gKHR5cGU9PT1cXFxcXFxcIi50eHRcXFxcXFxcIj9cXFxcXFxcImhpa2VyOi8vcGFnZS90eHRQYXJzZXIudmlld1xcXFxcXFwiOlxcXFxcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcXFxcXCIpK1xcXFxcXFwiP3J1bGU9XFxcXFxcXCIgKyBNWV9SVUxFLnRpdGxlO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgY2FzZSBcXFxcXFxcIuaJk+W8gOaWueW8j1xcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXFxcXFwiICsgcGF0aDtcXFxcbiAgICAgICAgIC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QcmVmYWNlO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIumHjeaWsOino+aekOebruW9lVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocGF0aCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSwgcGF0aCtcXFxcXFxcIi5qc29uXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOmZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6XFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlKOmHjeaWsOino+aekCk8L3N0cm9uZz5cXFxcXFxcIi5iaWcoKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKHBhdGgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZShwYXRoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcXFxcXCIuanNvblxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XSk7XFxcXG4gICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgIH1cXFxcblxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXFxcXFwi5q2j5Zyo6Kej5p6Q55uu5b2VXFxcXFxcXCIpO1xcXFxuICAgICAgICBsZXQgdHh0ID0gcmVxdWVzdChwYXRoLCB7XFxcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgLy9cXFxcXFxcImNvbnRlbnQtdHlwZVxcXFxcXFwiOiBcXFxcXFxcInRleHQvcGxhaW47IGNoYXJzdD1cXFxcXFxcIiArIGNoYXJzdFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgbGV0IHBhdHRlcm4gPSByZWdzLmdldFRvY1J1bGUodHh0KTtcXFxcbiAgICAgICAgaWYgKCFwYXR0ZXJuKSB7XFxcXG4gICAgICAg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leHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lOiBcXFxcXFxcIuW6j+iogFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHN0YXJ0OiBpbnRlcnZhbFswXSxcXFxcbiAgICAgICAgICAgICAgICBlbmQ6IGludGVydmFsWzFdLFxcXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxcXG4gICAgICAgICAgICAgICAgY2hhcnN0OiBjaGFyc3RcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhcHRlck5hbWVzLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgIGxldCBuYW1lID0gY2hhcHRlck5hbWVzW2ldO1xcXFxuICAgICAgICBsZXQgaW50ZXJ2YWwgPSBpbnRlcnZhbHNbaSArIDFdO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9UWFRWaWV3ZXIudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxcXG4gICAgICAgICAgICAgICAgZW5kOiBpbnRlcnZhbFsxXSxcXFxcbiAgICAgICAgICAgICAgICBjaGFwdGVyTmFtZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICBwYXRoOiBwYXRoLFxcXFxuICAgICAgICAgICAgICAgIGNoYXJzdDogY2hhcnN0XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBz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ID09PSBuYW1lKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcXFxcXCJcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJhbmtJc1JldmVyc2UgPSBcXFxcXFxcIjFcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcXFxcXCIsIHJhbmtJc1JldmVyc2UpO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcXFxcXCJib29rcmFjazpyYW5rSXNSZXZlcnNlXFxcXFxcXCIsIFxcXFxcXFwiXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwiYm9va3JhY2s6cmFua01ldGhvZFxcXFxcXFwiLCBuYW1lKTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSwgbmFtZSlcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIGxldCByYW5rTWV0aG9kTWFwID0ge1xcXFxuICAgICAgICBcXFxcXFxcIuezu+e7n1xcXFxcXFwiOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICBcXFxcXFxcIuWkp+Wwj1xcXFxcXFwiOiBcXFxcXFxcInNpemVcXFxcXFxcIixcXF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XFxcXG4gICAgICAgICAgICBudW1iZXIgPSBudW07XFxcXG4gICAgICAgICAgICBpZiAoaSA9PT0gc3RyLmxlbmd0aCAtIDEpIHtcXFxcbiAgICAgICAgICAgICAgICBzZWN0aW9uICs9IG51bWJlcjtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGxldCB1bml0ID0gY2huTmFtZVZhbHVlW3N0cltpXV0udmFsdWU7XFxcXG4gICAgICAgICAgICBzZWNVbml0ID0gY2huTmFtZVZhbHVlW3N0cltpXV0uc2VjVW5pdDtcXFxcbiAgICAgICAgICAgIGlmIChzZWNVbml0KSB7XFxcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiA9IChzZWN0aW9uICsgbnVtYmVyKSAqIHVuaXQ7XFxcXG4gICAgICAgICAgICAgICAgcnRuICs9IHNlY3Rpb247XFxcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiA9IDA7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gKz0gKG51bWJlciAqIHVuaXQpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbnVtYmVyID0gMDtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICByZXR1cm4gcnRuICsgc2VjdGlvbjtcXFxcbn1cXFxcblxcXFxuZnVuY3Rpb24gbmFtZUNvbXBhcmUoYSwgYikge1xcXFxuICAgIGlmIChhID09IG51bGwgfHwgYiA9PSBudWxsKVxcXFxuICAgICAgICByZXR1cm4gYSA9PSBudWxsID8gYiA9PSBudWxsID8gMCA6IC0xIDogMTtcXFxcblxcXFxuICAgIGEgPSBhLnJlcGxhY2UoLyhb6Zu25LiA5LqM5LiJ5Zub5LqU5YWt5LiD5YWr5Lmd5Y2B55m+5Y2D5LiH5Lq/XSkvZywgZnVuY3Rpb24obWF0Y2gsIHAxLCBwMiwgcDMsIG9mZnNldCwgc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