Advertisement
xiaomianao666

邀您一起看:夸克网盘

Sep 6th, 2022
987
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥夸克网盘@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIjEyM3BhblwiLFwicGF0aFwiOlwiMTIzcGFuXCIsXCJydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbnRyeSB7XFxuICAgIGNvbnN0IHtcXG4gICAgICAgIGZpbGVMaXN0LFxcbiAgICAgICAgZ2V0SWNvblxcbiAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvY29kZVxcXCIpXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuKame+4j+iuvue9rlxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2Uvc2V0dGluZ3NcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICB9KVxcbiAgICBpZiAoZ2V0SXRlbShcXFwidG9rZW5cXFwiLCBcXFwiXFxcIikgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgIHZhciBwYXRocyA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJwYXRoczEyM1xcXCIsIFt7XFxuICAgICAgICAgICAgbmFtZTogXFxcIuagueebruW9lVxcXCIsXFxuICAgICAgICAgICAgaWQ6IFxcXCIwXFxcIlxcbiAgICAgICAgfV0pXFxuICAgICAgICBpZiAocGF0aHMubGVuZ3RoID4gMSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiPFxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMucG9wKClcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJwYXRoczEyM1xcXCIsIHBhdGhzKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCBwYXRocylcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaXRlbSwgcGF0aHMsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaWRcXFwiLCBpdGVtLmlkKVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzMTIzXFxcIiwgcGF0aHMuc2xpY2UoMCwgaW5kZXggKyAxKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgcGF0aHMsIGluZGV4KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgZmlsZUxpc3QocGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQpLmRhdGEuSW5mb0xpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICB2YXIgaW1nID0gZ2V0SWNvbihpdGVtKVxcbiAgICAgICAgICAgIGlmIChpdGVtLlR5cGUgPT0gMSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpZCwgbmFtZSwgcGF0aHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzMTIzXFxcIiwgcGF0aHMpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uRmlsZUlkLCBpdGVtLkZpbGVOYW1lLCBwYXRocylcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gaXRlbS5Eb3dubG9hZFVybFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5GaWxlTmFtZSxcX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fSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2NvZGUxXFxcIilcXG4gICAgICAgIGxldCBwYXRocyA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJwYXRoc2JhaWR1XFxcIiwgW3tcXG4gICAgICAgICAgICBwYXRoOiBcXFwiL1xcXCIsXFxuICAgICAgICAgICAgbmFtZTogXFxcIuWutlxcXCJcXG4gICAgICAgIH1dKVxcbiAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzYmFpZHVcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChidWlsZFVybChcXFwiaHR0cHM6Ly9wYW4uYmFpZHUuY29tL3Jlc3QvMi4wL3hwYW4vZmlsZVxcXCIsIHtcXG4gICAgICAgICAgICBcXFwiYWNjZXNzX3Rva2VuXFxcIjogZ2V0SXRlbShcXFwiYWNjZXNzX3Rva2VuYmFpZHVcXFwiKSxcXG4gICAgICAgICAgICBcXFwibWV0aG9kXFxcIjogXFxcImxpc3RcXFwiLFxcbiAgICAgICAgICAgIFxcXCJkaXJcXFwiOiBwYXRoc1twYXRocy5sZW5ndGggLSAxXS5wYXRoLFxcbiAgICAgICAgICAgIFxcXCJ3ZWJcXFwiOiBcXFwid2ViXFxcIixcXG4gICAgICAgICAgICBcXFwibGltaXRcXFwiOiAwLFxcbiAgICAgICAgICAgIFxcXCJsaW1pdFxcXCI6IDIwMFxcbiAgICAgICAgfSkpKVxcbiAgICAgICAgcmVzLmxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICBpZiAoaXRlbS5pc2RpciA9PSAxKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAkKCkubGF6eVJ1bGUoKGl0ZW0sIHBhdGhzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRocy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5zZXJ2ZXJfZmlsZW5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNiYWlkdVxcXCIsIHBhdGhzKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBwYXRocylcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQubW92aWUuaW5jbHVkZXMoZ2V0SHptKGl0ZW0uc2VydmVyX2ZpbGVuYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoXFxcIm1vdmllXFxcIiwgaXRlbS5mc19pZCwgaXRlbS5wYXRoKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0oaXRlbS5zZXJ2ZXJfZmlsZW5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhcXFwiYXVkaW9cXFwiLCBpdGVtLmZzX2lkLCBpdGVtLnBhdGgpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhnZXRIem0oaXRlbS5zZXJ2ZXJfZmlsZW5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhcXFwiaW1nXFxcIiwgaXRlbS5mc19pZCwgaXRlbS5wYXRoKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKFxcXCJcXFwiLCBpdGVtLmZzX2lkLCBpdGVtLnBhdGgpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnNlcnZlcl9maWxlbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgICAgICB0b2FzdChcXFwi5Ye6546w6ZSZ6K+v77yM6K+35p+l55yL5pel5b+XXFxcIikgICAgICAgIFxcbiAgICB9XFxufVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcImNvZGUxXCIsXCJwYXRoXCI6XCJjb2RlMVwiLFwicnVsZVwiOlwiJC5leHBvcnRzLmdldEljb24gPSBmdW5jdGlvbihjb250ZW50KSB7XFxuICAgIGxldCB7XFxuICAgICAgICBnZXRIem1cXG4gICAgfSA9ICQucm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ICAgICAgICAgICAgICAgXFxcImRsaW5rXFxcIjogXFxcIjFcXFwiXFxuICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwicGFuLmJhaWR1LmNvbVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pKS5saXN0WzBdLmRsaW5rICsgXFxcIiZhY2Nlc3NfdG9rZW49XFxcIiArIGdldEl0ZW0oXFxcImFjY2Vzc190b2tlblxcXCIpXFxuICAgICAgICB9XFxuICAgICAgICBpZiAoZXh0ID09IFxcXCJtb3ZpZVxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICB1cmxzOiBbcmVzICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIl0sXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcInBhbi5iYWlkdS5jb21cXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIGlmIChleHQgPT0gXFxcImF1ZGlvXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFtyZXMgKyBcXFwiI2lzTXVzaWM9dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwicGFuLmJhaWR1LmNvbVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKGV4dCA9PSBcXFwiaW1nXFxcIikge1xcbiAgICAgICAgICAgIHJldH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pID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJwaWtwYWthcHA6Ly9teXBpa3Bhay5jb20veHBhbi9tYWluX3RhYj90YWI9MSZhZGRfdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQoaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgICAgICBwYXRocy5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHBhdGhzLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNwaWtwYWtcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKHJlcXVlc3QoYnVpbGRVcmwoXFxcImh0dHBzOi8vYXBpLWRyaXZlLm15cGlrcGFrLmNvbS9kcml2ZS92MS9maWxlc1xcXCIsIHtcXG4gICAgICAgICAgICBcXFwicGFyZW50X2lkXFxcIjogcGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQsXFxuICAgICAgICAgICAgXFxcInRodW1ibmFpbF9zaXplXFxcIjogXFxcIlNJWkVfTEFSR0VcXFwiLFxcbiAgICAgICAgICAgIFxcXCJ3aXRoX2F1ZGl0XFxcIjogXFxcInRydWVcXFwiLFxcbiAgICAgICAgICAgIFxcXCJsaW1pdFxcXCI6IFxcXCIxMDAwXFxcIixcXG4gICAgICAgICAgICBcXFwiZmlsdGVyc1xcXCI6ICd7XFxcInBoYXNlXFxcIjp7XFxcImVxXFxcIjpcXFwiUEhBU0VfVFlQRV9DT01QTEVURVxcXCJ9LFxcXCJ0cmFzaGVkXFxcIjp7XFxcImVxXFxcIjpmYWxzZX19JyxcXG4gICAgICAgICAgICBcXFwicGFnZV90b2tlblxcXCI6IFxcXCJcXFwiXFxuICAgICAgICB9KSwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgXFxcIkF1dGhvcml6YXRpb25cXFwiOiBcXFwiQmVhcmVyIFxcXCIgKyBnZXRJdGVtKFxcXCJhY2Nlc3NfdG9rZW5cXFwiKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pKVxcbiAgICAgICAgbGlzdC5maWxlcy5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGlmIChpdGVtLmtpbmQgPT0gXFxcImRyaXZlI2ZvbGRlclxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybGwgPSAkKCkubGF6eVJ1bGUoKHBhdGhzLCBpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRocy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5pZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNwaWtwYWtcXFwiLCBwYXRocylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgcGF0aHMsIGl0ZW0pXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLm1vdmllLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcblxcbiAgICAgICAgICAgICAgICB2YXIgZXh0ID0gXFxcIiNpc1ZpZGVvPXRydWUjXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0oaXRlbS5uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGV4dCA9IFxcXCIjaXNNdXNpYz10cnVlI1xcXCJcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQuaW1nLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgZXh0ID0gXFxcIiMuanBnXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBleHQgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCBleHQpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBgaHR0cHM6Ly9hcGktZHJpdmUubXlwaWtwYWsuY29tL2RyaXZlL3YxL2ZpbGVzLyR7aXRlbS5pZH0/X21hZ2ljPTIwMjEmdGh1bWJuYWlsX3NpemU9U0laRV9MQVJHRWBcXG4gICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdCh1LCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkF1dGhvcml6YXRpb25cXFwiOiBcXFwiQmVhcmVyIFxcXCIgKyBnZXRJdGVtKFxcXCJhY2Nlc3NfdG9rZW5cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIHJlcy5tZWRpYXMpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRtcCA9IGl0ZW0ubGlua1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXAudXJsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0bXAudXJsICsgZXh0XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGl0ZW0sIGV4dClcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaWNvbl9saW5rLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogaXRlbS5raW5kID09IFxcXCJkcml2ZSNmb2xkZXJcXFwiID8gdXJsbCA6IHVybFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB0b2FzdChcXFwi5qOA5rWL5Yiw6ZSZ6K+vXFxcIilcXG4gICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgIH1cXG59XFxuXFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiY29kZTJcIixcInBhdGhcIjpcImNvZGUyXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMubG9naW4gPSBmdW5jdGlvbih1c2VybmFtZSwgcGFzc3dvcmQpIHtcXG4gICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocG9zdChcXFwiaHR0cHM6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0pXFxuc2V0UmVzdWx0KGQpXCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLlpKnnv7zkupHnm5hcIixcInBhdGhcIjpcIuWkqee/vOS6keebmFwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG50cnkge1xcbiAgICBpZiAoZmlsZUV4aXN0KFxcXCIxODkudHh0XFxcIikpIHtcXG4gICAgICAgIGNvbnN0IHtcXG4gICAgICAgICAgICBnZXRGaWxlcyxcXG4gICAgICAgICAgICBnZXRJY29uXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvY29kZTNcXFwiKVxcbiAgICAgICAgdmFyIHBhdGhzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcInBhdGhzdHlcXFwiLCBbe1xcbiAgICAgICAgICAgIFxcXCJpZFxcXCI6IC0xMSxcXG4gICAgICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLlrrZcXFwiXFxuICAgICAgICB9XSlcXG4gICAgICAgIHBhdGhzLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgocGF0aHMsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJwYXRoc3R5XFxcIiwgcGF0aHMuc2xpY2UoMCwgaSArIDEpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9LCBwYXRocywgaSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgICAgIGxldCBsaXN0ID0gZ2V0RmlsZXMocGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQpXFxuICAgICAgICBsaXN0LmZpbGVMaXN0QU8uZm9sZGVyTGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8zMjM5NDM1MS9kci8tL3Jhdy9tYXN0ZXIvaW1nL+aWh+S7tuexu+WeizIv5paH5Lu25aS5LnN2Z1xcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaWQsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGhzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzdHlcXFwiLCBwYXRocylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgcGF0aHMsIGl0ZW0uaWQsIGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgICAgIGxpc3QuZmlsZUxpc3RBTy5maWxlTGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIHZhciBpbWcgPSBnZXRJY29uKGl0ZW0ubmFtZSlcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoaWQsIG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRIem1cXG4gICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9jb2RlXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSByZWFkRmlsZShcXFwiMTg5LnR4dFxcXCIpXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IFxcXCJodHRwczovL2Nsb3VkLjE4OS5jbi9hcGkvcG9ydGFsL2dldEZpbGVJbmZvLmFjdGlvblxcXCJcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXMgPSBKU09OLnBhcnNlKHJlcXVlc3QoYnVpbGRVcmwodSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJmaWxlSWRcXFwiOiBpZFxcbiAgICAgICAgICAgICAgICAgICAgfSksIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBjb29raWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJBY2NlcHRcXFwiOiBcXFwiYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQubW92aWUuaW5jbHVkZXMoZ2V0SHptKG5hbWUpKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtcXFwiaHR0cHM6XFxcIiArIHJlcy5kb3dubG9hZFVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQS5yZXBsYWNlKC87L2csIFxcXCLvvJvvvJtcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0obmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogW1xcXCJodHRwczpcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBjb29raWUucmVwbGFjZSgvOy9nLCBcXFwi77yb77ybXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFBDX1VBLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhnZXRIem0obmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJodHRwczpcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgYCMuanBnQFVzZXItQWdlbnQ9JHtQQ19VQX1AQ29va2llPSR7Y29va2llfWBcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJkb3dubG9hZDovL2h0dHBzOlxcXCIgKyByZXMuZG93bmxvYWRVcmwgKyBgQFVzZXItQWdlbnQ9JHtQQ19VQX1AQ29va2llPSR7Y29va2llfWBcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgaXRlbS5pZCwgaXRlbS5uYW1lKVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZC51bnNoaWZ0KHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIueZu+mZhlxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2xvZ2luM1xcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIlxcbiAgICAgICAgfSlcXG4gICAgfVxcbn0gY2F0Y2ggKGUpIHtcXG4gICAgZC51bnNoaWZ0KHtcXG4gICAgICAgIHRpdGxlOiBcXFwi55m76ZmGXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9sb2dpbjNcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlc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7Lojrflj5bliLBjb29raWVcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5iYWNrKCk7ICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIHVhOiBQQ19VQSxcXG4gICAgICAgIGNhbkJhY2s6IHRydWVcXG4gICAgfVxcbn0pXFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5aS45YWL572R55uYXCIsXCJwYXRoXCI6XCLlpLjlhYvnvZHnm5hcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxudHJ5IHtcXG4gICAgaWYgKGZpbGVFeGlzdChcXFwicXVhcmsudHh0XFxcIikpIHtcXG4gICAgICAgIGNvbnN0IHtcXG4gICAgICAgICAgICBnZXRJY29uLFxcbiAgICAgICAgICAgIGdldEh6bSxcXG4gICAgICAgICAgICBnZXRMaW5rXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvY29kZTRcXFwiKVxcbiAgICAgICAgdmFyIGNvb2tpZSA9IHJlYWRGaWxlKFxcXCJxdWFyay50eHRcXFwiKVxcbiAgICAgICAgbGV0IHVzZXJpbmZvID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJodHRwczovL3Bhbi5xdWFyay5jbi9hY2NvdW50L2luZm9cXFwiLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkpXFxuICAgICAgICBsZXQgcGF0aHMgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwicGF0aHNcXFwiLCBbe1xcbiAgICAgICAgICAgIFxcXCJpZFxcXCI6IFxcXCIwXFxcIixcXG4gICAgICAgICAgICBcXFwibmFtZVxcXCI6IFxcXCLmoLnnm67lvZVcXFwiXFxuICAgICAgICB9XSlcXG4gICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdXNlcmluZm8uZGF0YS5uaWNrbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiB1c2VyaW5mby5kYXRhLmF2YXRhclVyaSxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3NldHRpbmdzNFxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgocGF0aHMsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNcXFwiLCBwYXRocy5zbGljZSgwLCBpICsgMSkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzID0gSlNPTi5wYXJzZShyZXF1ZXN0KGJ1aWxkVXJsKFxcXCJodHRwczovL2RyaXZlLnF1YXJrLmNuLzEvY2xvdWRkcml2ZS9maWxlL3NvcnRcXFwiLCB7XFxuICAgICAgICAgICAgXFxcInBkaXJfZmlkXFxcIjogcGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQsXFxuICAgICAgICAgICAgXFxcImZyXFxcIjogXFxcInBjXFxcIixcXG4gICAgICAgICAgICBcXFwicHJcXFwiOiBcXFwidWNwcm9cXFwiLFxcbiAgICAgICAgICAgIFxcXCJfc2l6ZVxcXCI6IDEwLFxcbiAgICAgICAgICAgIFxcXCJfZmV0Y2hfdG90YWxcXFwiOiBcXFwiMVxcXCIsXFxuICAgICAgICAgICAgXFxcIl9zb3J0XFxcIjogXFxcImZpbGVfdHlwZTphc2MsZmlsZV9uYW1lOmFzY1xcXCIsXFxuICAgICAgICAgICAgXFxcIl9wYWdlXFxcIjogZ2V0UGFyYW0oXFxcInBhZ2VcXFwiKVxcbiAgICAgICAgfSksIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJDb29raWVcXFwiOiBjb29raWUsXFxuICAgICAgICAgICAgICAgIFxcXCJBY2NlcHRcXFwiOiBcXFwiYXBwbGljYXRpb24vanNvbiwgdGV4dC9wbGFpbiwgKi8qXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY24vXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pKVxcbiAgICAgICAgcmVzLmRhdGEubGlzdC5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGlmICghaXRlbS5maWxlKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAkKCkubGF6eVJ1bGUoKGl0ZW0sIHBhdGhzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwYXRocy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5maWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogaXRlbS5maWxlX25hbWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGF0aHNcXFwiLCBwYXRocylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgcGF0aHMpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLm1vdmllLmluY2x1ZGVzKGdldEh6bShpdGVtLmZpbGVfbmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKGl0ZW0sIGNvb2tpZSwgXFxcIm1vdmllXFxcIilcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQuYXVkaW8uaW5jbHVkZXMoZ2V0SHptKGl0ZW0uZmlsZV9uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoaXRlbSwgY29va2llLCBcXFwiYXVkaW9cXFwiKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5pbWcuaW5jbHVkZXMoZ2V0SHptKGl0ZW0uZmlsZV9uYW1lKSkpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoaXRlbSwgY29va2llLCBcXFwiaW1nXFxcIilcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhpdGVtLCBjb29raWUpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLmZpbGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgY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AgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXCJcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcImZpZHNcXFwiOiBbZmlkXVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KSlcXG4gICAgICAgIGlmIChleHQgPT0gXFxcIm1vdmllXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIHVybHM6IFtyZXMuZGF0YVswXS5kb3dubG9hZF91cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiXSxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGNvb2tpZS5yZXBsYWNlKC87L2csIFxcXCLvvJvvvJtcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2UgaWYgKGV4dCA9PSBcXFwiYXVkaW9cXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgdXJsczogW3Jlcy5kYXRhWzBdLmRvd25sb2FkX3VybCArIFxcXCIjaXNNdXNpYz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llLnJlcGxhY2UoLzsvZywgXFxcIu+8m++8m1xcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBcXFwiaHR0cHM6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Toge1xcbiAgICAgICAganM6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgIHZhciB1cmwgPSBsb2NhdGlvbi5ocmVmXFxuICAgICAgICAgICAgaWYgKHVybCA9PSBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY24vbGlzdCMvbGlzdC9hbGxcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCBjb29raWUgPSBmYmEuZ2V0Q29va2llKHVybCk7XFxuICAgICAgICAgICAgICAgIGlmIChjb29raWUgIT0gbnVsbCAmJiBjb29raWUubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLnB1dFZhcih1cmwsIGNvb2tpZSk7XFxuICAgICAgICAgICAgICAgICAgICBhbGVydChcXFwi5bey6I635Y+W5YiwY29va2llXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBmYmEuYmFjaygpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICB1YTogUENfVUEsXFxuICAgICAgICBjYW5CYWNrOiB0cnVlXFxuICAgIH1cXG59KVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWFs+S6jlwiLFwicGF0aFwiOlwiYWJvdXRcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxuYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgY2xlYXJNeVZhcihcXFwiY1xcXCIpO1xcbn0pKTtcXG5kLnB1c2goJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvYWJvdXQyXFxcIikpO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwiXFxcIixcXG4gICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgIGxldCBjID0gcGFyc2VJbnQoZ2V0TXlWYXIoXFxcImNcXFwiLCBcXFwiMVxcXCIpKVxcbiAgICAgICAgaWYgKGMgPj0gNSkge1xcbiAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4qemmqOaPkOekulxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLnoa7lrpropoHlvIDlkK/lvIDlj5HogIXmqKHlvI/lkJfvvJ/ms6jmhI/lvIDlkK/or6XmqKHlvI/liJnooajnpLrlkI7nu63mgqjnmoTmiYDmnInmk43kvZzlnYfkuLrkuLvop4Log73liqjmk43kvZzvvIzmiYDkuqfnlJ/nmoTkuIDliIfpl67popjkuI7otKPku7vlnYfnlLHmgqjoh6rlt7Hmib/mi4VcXFwiLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImRldlxcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey5byA5ZCv5byA5Y+R6ICF5qih5byPXFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcImNcXFwiLCBjICsgMSArIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgZGVzYzogXFxcIlxcXCIsXFxuICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgbG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XCIpKSB7XFxuICAgICAgICBjb25zdCB7XFxuICAgICAgICAgICAgZ2V0SWNvbixcXG4gICAgICAgICAgICBnZXRIem0sXFxuICAgICAgICAgICAgZ2V0TGlua1xcbiAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2NvZGU0XFxcIilcXG4gICAgICAgIHZhciBjb29raWUgPSByZWFkRmlsZShcXFwicXVhcmsudHh0XFxcIilcXG4gICAgICAgIGxldCB1c2VyaW5mbyA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY24vYWNjb3VudC9pbmZvXFxcIiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IGNvb2tpZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pKVxcbiAgICAgICAgbGV0IHBhdGhzID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcInBhdGhzXFxcIiwgW3tcXG4gICAgICAgICAgICBcXFwiaWRcXFwiOiBcXFwiMFxcXCIsXFxuICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBcXFwi5qC555uu5b2VXFxcIlxcbiAgICAgICAgfV0pXFxuICAgICAgICBpZiAoTVlfUEFHRSA9PSAxKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJpbmZvLmRhdGEubmlja25hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogdXNlcmluZm8uZGF0YS5hdmF0YXJVcmksXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9zZXR0aW5nczRcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCJcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBhdGhzLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHBhdGhzLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzXFxcIiwgcGF0aHMuc2xpY2UoMCwgaSArIDEpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCBwYXRocywgaSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVxdWVzdChidWlsZFVybChcXFwiaHR0cHM6Ly9kcml2ZS5xdWFyay5jbi8xL2Nsb3VkZHJpdmUvZmlsZS9zb3J0XFxcIiwge1xcbiAgICAgICAgICAgIFxcXCJwZGlyX2ZpZFxcXCI6IHBhdGhzW3BhdGhzLmxlbmd0aCAtIDFdLmlkLFxcbiAgICAgICAgICAgIFxcXCJmclxcXCI6IFxcXCJwY1xcXCIsXFxuICAgICAgICAgICAgXFxcInByXFxcIjogXFxcInVjcHJvXFxcIixcXG4gICAgICAgICAgICBcXFwiX3NpemVcXFwiOiAxMCxcXG4gICAgICAgICAgICBcXFwiX2ZldGNoX3RvdGFsXFxcIjogXFxcIjFcXFwiLFxcbiAgICAgICAgICAgIFxcXCJfc29ydFxcXCI6IFxcXCJmaWxlX3R5cGU6YXNjLGZpbGVfbmFtZTphc2NcXFwiLFxcbiAgICAgICAgICAgIFxcXCJfcGFnZVxcXCI6IGdldFBhcmFtKFxcXCJwYWdlXFxcIilcXG4gICAgICAgIH0pLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogY29va2llLFxcbiAgICAgICAgICAgICAgICBcXFwiQWNjZXB0XFxcIjogXFxcImFwcGxpY2F0aW9uL2pzb24sIHRleHQvcGxhaW4sICovKlxcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJSZWZlcmVyXFxcIjogXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL1xcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSlcXG4gICAgICAgIHJlcy5kYXRhLmxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICBpZiAoIWl0ZW0uZmlsZSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpdGVtLCBwYXRocykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZmlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0uZmlsZV9uYW1lXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcInBhdGhzXFxcIiwgcGF0aHMpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0sIHBhdGhzKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5tb3ZpZS5pbmNsdWRlcyhnZXRIem0oaXRlbS5maWxlX25hbWUpKSkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhpdGVtLCBjb29raWUsIFxcXCJtb3ZpZVxcXCIpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmF1ZGlvLmluY2x1ZGVzKGdldEh6bShpdGVtLmZpbGVfbmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKGl0ZW0sIGNvb2tpZSwgXFxcImF1ZGlvXFxcIilcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQuaW1nLmluY2x1ZGVzKGdldEh6bShpdGVtLmZpbGVfbmFtZSkpKSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKGl0ZW0sIGNvb2tpZSwgXFxcImltZ1xcXCIpXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoaXRlbSwgY29va2llKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5maWxlX25hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogZ2V0SWNvbihpdGVtKSxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi55m76ZmGXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2Uvc2V0dGluZ3M0XFxcIlxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgIH1cXG59IGNhdGNoIChlKSB7XFxuICAgIGxvZyhlLm1lc3NhZ2UpXFxufVxcbnNldFJlc3VsdChkK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sIGluZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChpdGVtLCBwYXRocywgaW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcXFxcXCJpZFxcXFxcXFwiLCBpdGVtLmlkKVxcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBhdGhzMTIzXFxcXFxcXCIsIHBhdGhzLnNsaWNlKDAsIGluZGV4ICsgMSkpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgcGF0aHMsIGluZGV4KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgZmlsZUxpc3QocGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQpLmRhdGEuSW5mb0xpc3QuZm9yRWFjaChpdGVtID0+IHtcXFxcbiAgICAgICAgICAgIHZhciBpbWcgPSBnZXRJY29uKGl0ZW0pXFxcXG4gICAgICAgICAgICBpZiAoaXRlbS5UeXBlID09IDEpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJCgpLmxhenlSdWxlKChpZCwgbmFtZSwgcGF0aHMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwicGF0aHMxMjNcXFxcXFxcIiwgcGF0aHMpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbS5GaWxlSWQsIGl0ZW0uRmlsZU5hbWUsIHBhdGhzKVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gaXRlbS5Eb3dubG9hZFVybFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5GaWxlTmFtZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5pyq55m75b2VXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3NldHRpbmdzXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIlxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbn0gY2F0Y2ggKGUpIHtcXFxcbiAgICBsb2coZS5tZXNzYWdlKVxc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yXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsbCA9ICQoKS5sYXp5UnVsZSgocGF0aHMsIGl0ZW0pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5pZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBhdGhzcGlrcGFrXFxcXFxcXCIsIHBhdGhzKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpdGVtKVxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLm1vdmllLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgdmFyIGV4dCA9IFxcXFxcXFwiI2lzVmlkZW89dHJ1ZSNcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmF1ZGlvLmluY2x1ZGVzKGdldEh6bShpdGVtLm5hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciBleHQgPSBcXFxcXFxcIiNpc011c2ljPXRydWUjXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5pbWcuaW5jbHVkZXMoZ2V0SHptKGl0ZW0ubmFtZSkpKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIGV4dCA9IFxcXFxcXFwiIy5qcGdcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZXh0ID0gXFxcXFxcXCJcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgdmFyIHVybCA9ICQoKS5sYXp5UnVsZSgoaXRlbSwgZXh0KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHUgPSBgaHR0cHM6Ly9hcGktZHJpdmUubXlwaWtwYWsuY29tL2RyaXZlL3YxL2ZpbGVzLyR7aXRlbS5pZH0/X21hZ2ljPTIwMjEmdGh1bWJuYWlsX3NpemU9U0laRV9MQVJHRWBcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVzID0gSlNPTi5wYXJzZShyZXF1ZXN0KHUsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJBdXRob3JpemF0aW9uXFxcXFxcXCI6IFxcXFxcXFwiQmVhcmVyIFxcXFxcXFwiICsgZ2V0SXRlbShcXFxcXFxcImFjY2Vzc190b2tlblxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSkpXFxcXG4gICAgICAgICAgICAgICAgZm9yIChpdGVtIG9mIHJlcy5tZWRpYXMpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0bXAgPSBpdGVtLmxpbmtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXAudXJsKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRtcC51cmwgKyBleHRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIGl0Z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GU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBhdGhzdHlcXFxcXFxcIiwgcGF0aHMuc2xpY2UoMCwgaSArIDEpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0sIHBhdGhzLCBpKVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgbGV0IGxpc3QgPSBnZXRGaWxlcyhwYXRoc1twYXRocy5sZW5ndGggLSAxXS5pZClcXFxcbiAgICAgICAgbGlzdC5maWxlTGlzdEFPLmZvbGRlckxpc3QuZm9yRWFjaChpdGVtID0+IHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBpbWc6IFxcXFxcXFwiaHR0cHM6Ly9naXRjb2RlLm5ldC9xcV8zMjM5NDM1MS9kci8tL3Jhdy9tYXN0ZXIvaW1nL+aWh+S7tuexu+WeizIv5paH5Lu25aS5LnN2Z1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChwYXRocywgaWQsIG5hbWUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGF0aHMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwicGF0aHN0eVxcXFxcXFwiLCBwYXRocylcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9LCBwYXRocywgaXRlbS5pZCwgaXRlbS5uYW1lKVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgbGlzdC5maWxlTGlzdEFPLmZpbGVMaXN0LmZvckVhY2goaXRlbSA9PiB7XFxcXG4gICAgICAgICAgICB2YXIgaW1nID0gZ2V0SWNvbihpdGVtLm5hbWUpXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGlkLCBuYW1lKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldEh6bVxcXFxuICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2NvZGVcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvb2tpZSA9IHJlYWRGaWxlKFxcXFxcXFwiMTg5LnR4dFxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IFxcXFxcXFwiaHR0cHM6Ly9jbG91ZC4xODkuY24vYXBpL3BvcnRhbC9nZXRGaWxlSW5mby5hY3Rpb25cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzID0gSlNPTi5wYXJzZShyZXF1ZXN0KGJ1aWxkVXJsKHUsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiZmlsZUlkXFxcXFxcXCI6IGlkXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJDb29raWVcXFxcXFxcIjogY29va2llLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQWNjZXB0XFxcXFxcXCI6IFxcXFxcXFwiYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IFBDX1VBXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoJC5tb3ZpZS5pbmNsdWRlcyhnZXRIem0obmFtZSkpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtcXFxcXFxcImh0dHBzOlxcXFxcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgXFxcXFxcXCIjaXNWaWRlbz10cnVlI1xcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29va2llXFxcXFxcXCI6IGNvb2tpZS5yZXBsYWNlKC87L2csIFxcXFxcXFwi77yb77ybXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogUENfVUEucmVwbGFjZSgvOy9nLCBcXFxcXFxcIu+8m++8m1xcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0obmFtZSkpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHM6IFtcXFxcXFxcImh0dHBzOlxcXFxcXFwiICsgcmVzLmRvd25sb2FkVXJsICsgXFxcXFxcXCIjaXNWaWRlbz10cnVlI1xcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiQ29va2llXFxcXFxcXCI6IGNvb2tpZS5yZXBsYWNlKC87L2csIFxcXFxcXFwi77yb77ybXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogUENfVUEucmVwbGFjZSgvOy9nLCBcXFxcXFxcIu+8m++8m1xcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5pbWcuaW5jbHVkZXMoZ2V0SHptKG5hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAg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FwicXVhcmsudHh0XFxcXFxcXCIpKSB7XFxcXG4gICAgICAgIGNvbnN0IHtcXFxcbiAgICAgICAgICAgIGdldEljb24sXFxcXG4gICAgICAgICAgICBnZXRIem0sXFxcXG4gICAgICAgICAgICBnZXRMaW5rXFxcXG4gICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvY29kZTRcXFxcXFxcIilcXFxcbiAgICAgICAgdmFyIGNvb2tpZSA9IHJlYWRGaWxlKFxcXFxcXFwicXVhcmsudHh0XFxcXFxcXCIpXFxcXG4gICAgICAgIGxldCB1c2VyaW5mbyA9IEpTT04ucGFyc2UocmVxdWVzdChcXFxcXFxcImh0dHBzOi8vcGFuLnF1YXJrLmNuL2FjY291bnQvaW5mb1xcXFxcXFwiLCB7XFxcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJDb29raWVcXFxcXFxcIjogY29va2llXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pKVxcXFxuICAgICAgICBsZXQgcGF0aHMgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFxcXFxcInBhdGhzXFxcXFxcXCIsIFt7XFxcXG4gICAgICAgICAgICBcXFxcXFxcImlkXFxcXFxcXCI6IFxcXFxcXFwiMFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgXFxcXFxcXCJuYW1lXFxcXFxcXCI6IFxcXFxcXFwi5qC555uu5b2VXFxcXFxcXCJcXFxcbiAgICAgICAgfV0pXFxcXG4gICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJpbmZvLmRhdGEubmlja25hbWUsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiB1c2VyaW5mby5kYXRhLmF2YXRhclVyaSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiaGlrZXI6Ly9wYWdlL3NldHRpbmdzNFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcGF0aHMuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHBhdGhzLCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBhdGhzXFxcXFxcXCIsIHBhdGhzLnNsaWNlKDAsIGkgKyAxKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBwYXRocywgaSlcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgcmVzID0gSlNPTi5wYXJzZShyZXF1ZXN0KGJ1aWxkVXJsKFxcXFxcXFwiaHR0cHM6Ly9kcml2ZS5xdWFyay5jbi8xL2Nsb3VkZHJpdmUvZmlsZS9zb3J0XFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgIFxcXFxcXFwicGRpcl9maWRcXFxcXFxcIjogcGF0aHNbcGF0aHMubGVuZ3RoIC0gMV0uaWQsXFxcXG4gICAgICAgICAgICBcXFxcXFxcImZyXFx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HtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLmZpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0uZmlsZV9uYW1lXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXFxcXFwicGF0aHNcXFxcXFxcIiwgcGF0aHMpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbSwgcGF0aHMpXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKCQubW92aWUuaW5jbHVkZXMoZ2V0SHptKGl0ZW0uZmlsZV9uYW1lKSkpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gZ2V0TGluayhpdGVtLCBjb29raWUsIFxcXFxcXFwibW92aWVcXFxcXFxcIilcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoJC5hdWRpby5pbmNsdWRlcyhnZXRIem0oaXRlbS5maWxlX25hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKGl0ZW0sIGNvb2tpZSwgXFxcXFxcXCJhdWRpb1xcXFxcXFwiKVxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICgkLmltZy5pbmNsdWRlcyhnZXRIem0oaXRlbS5maWxlX25hbWUpKSkge1xcXFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBnZXRMaW5rKGl0ZW0sIGNvb2tpZSwgXFxcXFxcXCJpbWdcXFxcXFxcIilcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IGdldExpbmsoaXRlbSwgY29va2llKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS5maWxlX25hbWUsXFxcXG4gICAgICAgICAgICAgICAgaW1nOiBnZXRJY29uKGl0ZW0pLFxcXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi55m76ZmGXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9zZXR0aW5nczRcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbn0gY2F0Y2ggKGUpIHtcXFxcbiAgICBsb2coZS5tZXNzYWdlKVxcXFxufVxcXFxuc2V0UmVzdWx0KGQpO1xcXCJ9LHtcXFwiY29sX3R5cGVcXFwiOlxcXCJtb3ZpZV8zXFxcIixcXFwibmFtZVxcXCI6XFxcImNvZGU0XFxcIixcXFwicGF0aFxcXCI6XFxcImNvZGU0XFxcIixcXFwicnVsZVxcXCI6XFxcIiQuZXhwb3J0cy5nZXRJY29uID0gZnVuY3Rpb24oY29udGVudCkge1xcXFxuICAgIGxldCB7XFxcXG4gICAgICAgIGdldEh6bVxcXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcXFxcXCJoaWtlcjovL3BhZ2UvY29kZVxcXFxcXFwiKVxcXFxuICAgIGxldCByb290ID0gXFx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