Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWKoOi9veaWh+S7tlwiLFwicGF0aFwiOlwiTG9hZEZpbGVzXCIsXCJydWxlXCI6XCJqczpcXG5jb25zdCBQYXRocyA9IGphdmEubmlvLmZpbGUuUGF0aHM7XFxuY29uc3QgRmlsZXMgPSBqYXZhLm5pby5maWxlLkZpbGVzO1xcbmNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3QgVGhyZWFkID0gamF2YS5sYW5nLlRocmVhZDtcXG5jb25zdCB7XFxuICAgIFR5cGVJY29uT2JqZWN0LFxcbiAgICB0eXBlUGljLFxcbiAgICBkZWZhdWx0SWNvbixcXG4gICAgZGlySWNvblxcbn0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9JY29uTWFwXFxcIik7XFxuY29uc3QgVHlwZUljb24gPSBuZXcgTWFwKE9iamVjdC5lbnRyaWVzKFR5cGVJY29uT2JqZWN0KSk7XFxuXFxuZnVuY3Rpb24gZ2V0RXh0ZW5zaW9uKG9yaWdpbmFsRmlsZW5hbWUpIHtcXG4gICAgb3JpZ2luYWxGaWxlbmFtZSA9IFN0cmluZyhvcmlna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dG9uXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHBhdGgsIGNvbmZpZ3MsIGNvdW50KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBsb2FkID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvTG9hZEZpbGVzXFxcIikubG9hZEZpbGU7XFxuICAgICAgICAgICAgICAgIGxldCBsYXN0Q291bnQgPSBmaW5kSXRlbShgJHtjb25maWdzLnVpZH0j5Y+Y6YePYCkuZXh0cmEuY291bnQgfHwgY291bnQ7XFxuICAgICAgICAgICAgICAgIGxldCBkZWwgPSBbXTtcXG5cXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IGNvdW50ICsgMTsgaSA8PSBsYXN0Q291bnQ7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsLnB1c2goYCR7Y29uZmlncy51aWR9I+i3r+W+hCR7aX1gKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoZGVsLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oZGVsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsb2FkKHBhdGgsIGNvbmZpZ3MpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgIH0sIGRpclBhdGhzLnRvU3RyaW5nKCksIGNvbmZpZ3MsIGkgKyAxKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogYCR7Y29uZmlncy51aWR9I+i3r+W+hCR7aSsxfWBcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPlj5jph49gLFxcbiAgICAgICAgICAgIGNvdW50OiBjb3VudCxcXG4gICAgICAgICAgICBjdXJyZW50UGF0aDogZGlyUGF0aC50b1N0cmluZygpXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsZXQgdGFyZ2V0VHlwZSA9IG5ldyBSZWdFeHAoY29uZmlncy5maWxlVHlwZSk7XFxuICAgIGxldCBmaWxlcztcXG4gICAgdHJ5e1xcbiAgICAgICAgZmlsZXMgPSBGaWxlcy5saXN0KGRpclBhdGgpO1xcbiAgICB9Y2F0Y2goZSl7XFxuICAgICAgICBpZihlLm1lc3NhZ2UuaW5jbHVkZXMoXFxcImphdmEubmlvLmZpbGUuQWNjZXNzRGVuaWVkRXhjZXB0aW9uXFxcIikpe1xcbiAgICAgICAgICAgIHRvYXN0KFxcXCLmnYPpmZDkuI3otrM6XFxcIitlLmxpbmVOdW1iZXIpO1xcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgdG9hc3QoXFxcIuWHuumUmeS6hlxcXCIpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuO1xcbiAgICB9XFxuICAgIGlmKGZpbGVzID09IG51bGwpeyBcXG4gICAgICAgIHJldHVybjtcXG4gICAgfVxcbiAgICBmaWxlcy5mb3JFYWNoKChkaXJQYXRoKSA9PiB7XFxuICAgICAgICBsZXQgbmFtZSA9IFN0cmluZyhkaXJQYXRoLmdldEZpbGVOYW1lKCkpO1xcbiAgICAgICAgbGV0IHBhdGggPSBTdHJpbmcoZGlyUGF0aC50b1N0cmluZygpKTtcXG4gICAgICAgIGlmIChGaWxlcy5pc0RpcmVjdG9yeShkaXJQYXRoKSkge1xcbiAgICAgICAgICAgIHdqai5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShyZWZyZXNoRGlyLCBwYXRoLCBjb25maWdzKSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogZGlySWNvbixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgY2xzOiBgJHtjb25maWdzLnVpZH0u5paH5Lu2X+WkuWBcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChjb25maWdzLnBhdHRlcm4gPT09IDApIHtcXG4gICAgICAgICAgICBsZXQgdHlwZSA9IGdldEV4dGVuc2lvbihuYW1lKTtcXG4gICAgICAgICAgICBpZiAoY29uZmlncy5maWxlVHlwZSAmJiAhdGFyZ2V0VHlwZS50ZXN0KHR5cGUpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHBpY191cmwgPSAodHlwZVBpYy5pbmNsdWRlcyh0eXBlKSA/IHBhdGggOiBUeXBlSWNvbi5nZXQodHlwZSkpIHx8IGRlZmF1bHRJY29uO1xcbiAgICAgICAgICAgIHdqLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGDnoa7orqTpgInmi6kke25hbWV9YCkuY29uZmlybShjaG9vc2UsIHBhdGgsIGNvbmZpZ3MsIHR5cGUpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBwaWNfdXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGAke2NvbmZpZ3MudWlkfS7mlofku7Zf5aS5YFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfS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nB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKHJlZnJlc2hEaXIsIHBhdGgsIGNvbmZpZ3MsIHRydWUpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkaXJJY29uLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGAke2NvbmZpZ3MudWlkfS7mkJzntKIt5paH5Lu25aS5YFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGNvbmZpZ3MucGF0dGVybiA9PT0gMCkge1xcbiAgICAgICAgICAgIGxldCB0eXBlID0gZ2V0RXh0ZW5zaW9uKG5hbWUpO1xcbiAgICAgICAgICAgIGlmIChjb25maWdzLmZpbGVUeXBlICYmICF0YXJnZXRUeXBlLnRlc3QodHlwZSkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgcGljX3VybCA9ICh0eXBlUGljLmluY2x1ZGVzKHR5cGUpID8gcGF0aCA6IFR5cGVJY29uLmdldCh0eXBlKSkgfHwgZGVmYXVsdEljb247XFxuICAgICAgICAgICAgd2oucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoYOehruiupOmAieaLqVxcXFxuJHtwYXRofWApLmNvbmZpcm0oY2hvb3NlLCBwYXRoLCBjb25maWdzLCB0eXBlLCB0cnVlKSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogcGljX3VybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAg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hLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLmkJzntKJcXFwiLFxcbiAgICAgICAgdXJsOiBcXFwiaW5wdXQ9aW5wdXQudHJpbSgpO2lucHV0PydoaWtlcjovL3BhZ2UvU2VhcmNoI25vUmVmcmVzaCMjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI2Z1bGxUaGVtZSM/a2V5PScrYmFzZTY0RW5jb2RlKGlucHV0KTonJ1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPmkJzntKLmoYYxYCxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygodWlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcihgJHt1aWR9OmJhY2tgLCBcXFwiXFxcIikgPT09IFxcXCJ0cnVlXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihgJHt1aWR9OmJhY2tgKTtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgY29uZmlncy51aWQpLFxcbiAgICAgICAgICAgIGNvbmZpZ3M6IGNvbmZpZ3NcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIC8vbmV3IGVuZFxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5Y+Y6YePYCxcXG4gICAgICAgICAgICBjb3VudDogY291bnQsXFxuICAgICAgICAgICAgY3VycmVudFBhdGg6IGNvbmZpZ3MuaW5pdGlhbFBhdGhcXG4gICAgICAgIH1cXG4gICAgfSwge1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJibGFua19ibG9ja1xcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j6Lev5b6EJHtjb3VudH1gXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBpZiAoY29uZmlncy5wYXR0ZXJuID09PSAxKSB7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yib5bu655uu5b2VXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIlxcXCIpLmlucHV0KChjb25maWdzKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICBpZiAoIWlucHV0KSByZXR1cm4gXFxcInRvYXN0Oi8v5LiN5pSv5oyB56m655m95paH5Lu25ZCNXFxcIjtcXG4gICAgICAgICAgICAgICAgY29uc3QgUGF0aHMgPSBqYXZhLm5pby5maWxlLlBhdGhzO1xcbiAgICAgICAgICAgICAgICBjb25zdCBGaWxlcyA9IGphdmEubmlvLmZpbGUuRmlsZXM7XFxuICAgICAgICAgICAgICAgIGxldCBwYXRoID0gZmluZEl0ZW0oYCR7Y29uZmlncy51aWR9I+WPmOmHj2ApLmV4dHJhLmN1cnJlbnRQYXRoO1xcbiAgICAgICAgICAgICAgICBsZXQgbmV3UGF0aCA9IFBhdGhzLmdldChwYXRoLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgIGlmIChGaWxlcy5leGlzdHMobmV3UGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liJvlu7rlpLHotKU65bey5a2Y5ZyoXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRmlsZXMuY3JlYXRlRGlyZWN0b3J5KG5ld1BhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsb2FkID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvTG9hZEZpbGVzXFxcIikubG9hZEZpbGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9hZChwYXRoLCBjb25maWdzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yib5bu65oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yib5bu65aSx6LSlOlxcXCIgKyBlLnRvU3RyaW5nKCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBjb25maWdzKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAmOKAmOmAieaLqeatpOaWh+S7tuWkueKAmeKAmVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChjYWxsYmFjaywgdWlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBwYXRoID0gZmluZEl0ZW0oYCR7dWlkfSPlj5jph49gKS5leHRyYS5jdXJyZW50UGF0aDtcXG4gICAgICAgICAgICAgICAgbGV0IGNhbGxiYWNrRnVuYyA9IG5ldyBGdW5jdGlvbihcXFwiUEFUSFxcXCIsIGByZXR1cm4gJHtjYWxsYmFja31gKTtcXG4gICAgICAgICAgICAgICAgbGV0IGNhbGxiYWNrUmVzdWx0ID0gY2FsbGJhY2tGdW5jKHBhdGgpO1xcbiAgICAgICAgICAgICAgICBpZiAoY2FsbGJhY2tSZXN1bHQgPT09IHRydWUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjYWxsYmFja1Jlc3VsdCA9PT0gZmFsc2UpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrUmVzdWx0O1xcbiAgICAgICAgICAgIH0sIGNvbmZpZ3MuY2FsbGJhY2ssIGNvbmZpZ3MudWlkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogYCR7Y29uZmlncy51aWR9I+aWh+S7tuWkuWBcXG4gICAgICAgIH1cXG4gICAgfSwge1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPmlofku7ZgXFxuICAgICAgICB9XFxuICAgIH0sIHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIHNldFJlc3VsdChkYXRhKTtcXG5cXG4gICAgVGhyZWFkLnNsZWVwKDEwMCk7XFxuICAgIGxvYWQoZGlyUGF0aCwgY29uZmlncyk7XFxufSkoKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Zu+5qCH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ERhdGUubm93KCkpLnRvU3RyaW5nKDM2KTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGxldCBjb25maWdzID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgY2FsbGJhY2s6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBwYXR0ZXJuOiAwLFxcbiAgICAgICAgICAgIGluaXRpYWxQYXRoOiBnZXRQYXRoKFxcXCJoaWtlcjovL2ZpbGVzL1xcXCIpLnNsaWNlKDYpXFxuICAgICAgICB9LCBNWVBBUkFNUyk7XFxuICAgICAgICBjb25maWdzLnVpZCA9IGdldElkKDQpO1xcblxcbiAgICAgICAgaWYgKCFmaWxlRXhpc3QoXFxcImhpa2VyOi8vZmlsZXMvaWNvbi/mlofku7bnsbvlnotcXFwiKSkge1xcbiAgICAgICAgICAgIHRoaXMubG9hZEljb24oKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIChmdW5jdGlvbigpIHtcXG4gICAgICAgICAgICBsZXQgZGlyUGF0aCA9IFBhdGhzLmdldChjb25maWdzLmluaXRpYWxQYXRoKTtcXG4gICAgICAgICAgICBsZXQgZmlsZSA9IGRpclBhdGgudG9GaWxlKCk7XFxuICAgICAgICAgICAgaWYgKCFmaWxlLmV4aXN0cygpIHx8ICFmaWxlLmlzRGlyZWN0b3J5KCkpIHtcXG4gICAgICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLkuI3lrZjlnKjor6Xmlofku7blpLlcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgY291bnQgPSBOdW1iZXIoZGlyUGF0aC5nZXROYW1lQ291bnQoKSk7XFxuICAgICAgICAgICAgbGV0IGRhdGEgPSBbXTtcXG4gICAgICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5Y+Y6YePYFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j6Lev5b6EJHtjb3VudH1gXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAoY29uZmlncy5wYXR0ZXJuID09PSAxKSB7XFxuICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumAieaLqeatpOaWh+S7tuWkuVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGNhbGxiYWNrLCB1aWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGZpbmRJdGVtKGAke3VpZH0j6YCJ5oup5paH5Lu25aS5YCkuZXh0cmEucGF0aDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY2FsbGJhY2tGdW5jID0gbmV3IEZ1bmN0aW9uKFxcXCJQQVRIXFxcIiwgYHJldHVybiAke2NhbGxiYWNrfWApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFja0Z1bmMocGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9LCBjb25maWdzLmNhbGxiYWNrLCBjb25maWdzLnVpZCksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogYCR7Y29uZmlncy51aWR9I+mAieaLqeaWh+S7tuWkuWAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aDogY29uZmlncy5pbml0aWFsUGF0aFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5paH5Lu25aS5YFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPmlofku7ZgXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZGF0YSk7XFxuXFxuICAgICAgICAgICAgVGhyZWFkLnNsZWVwKDEwMCk7XFxuICAgICAgICAgICAgbG9hZChkaXJQYXRoLCBjb25maWdzKTtcXG4gICAgICAgIH0pKClcXG4gICAgfSxcXG4gICA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ICAgICAgbGV0IGxvYWQgPSBmLmluaXQoKTtcXG4gICAgICAgICAgICBsb2FkKHBhdGgsIGNvbmZpZ3MpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oYCR7Y29uZmlncy51aWR9I+mAieaLqeaWh+S7tuWkuWAsIHtcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgICAgICBpZDogYCR7Y29uZmlncy51aWR9I+mAieaLqeaWh+S7tuWkuWBcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBmdW5jdGlvbiBjaG9vc2UocGF0aCwgY2FsbGJhY2ssIHR5cGUpIHtcXG4gICAgICAgICAgICBsZXQgY2FsbGJhY2tGdW5jID0gbmV3IEZ1bmN0aW9uKFxcXCJQQVRIXFxcIixcXFwiVFlQRVxcXCIsIGByZXR1cm4gJHtjYWxsYmFja31gKTtcXG4gICAgICAgICAgICBpZiAoY2FsbGJhY2tGdW5jKHBhdGgsIHR5cGUpKSB7XFxuICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uKHBhdGgsIGNvbmZpZ3MpIHtcXG4gICAgICAgICAgICBsZXQgd2pqID0gW107XFxuICAgICAgICAgICAgbGV0IHdqID0gW107XFxuICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKGAke2NvbmZpZ3MudWlkfS7mlofku7Yo5aS5KWApO1xcbiAgICAgICAgICAgIGxldCBkaXJQYXRoID0gcGF0aCBpbnN0YW5jZW9mIFBhdGhzID8gcGF0aCA6IFBhdGhzLmdldChwYXRoKTtcXG4gICAgICAgICAgICBsZXQgY291bnQgPSBOdW1iZXIoJC5sb2coZGlyUGF0aC5nZXROYW1lQ291bnQoKSkpO1xcbiAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihgJHtjb25maWdzLnVpZH0j6Lev5b6EJHtjb3VudH1gLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiL1xcXCIgKyBkaXJQYXRoLmdldEZpbGVOYW1lKCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGF0aCwgY29uZmlncywgY291bnQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBmID0gcmVxdWlyZShcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NDUwM1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxvYWQgPSBmLmluaXQoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBsYXN0Q291bnQgPSBmaW5kSXRlbShgJHtjb25maWdzLnVpZH0j5Y+Y6YePYCkuZXh0cmEuY291bnQgfHwgY291bnQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZGVsID0gW107XFxuXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gY291bnQgKyAxOyBpIDw9IGxhc3RDb3VudDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsLnB1c2goYCR7Y29uZmlncy51aWR9I+i3r+W+hCR7aX1gKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmIChkZWwubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oZGVsKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxvYWQocGF0aCwgY29uZmlncyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICB9LCBkaXJQYXRoLnRvQWJzb2x1dGVQYXRoKCksIGNvbmZpZ3MsIGNvdW50KSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j6Lev5b6EJHtjb3VudCsxfWBcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPlj5jph49gLFxcbiAgICAgICAgICAgICAgICAgICAgY291bnQ6IGNvdW50ICsgMVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGV0IHRhcmdldFR5cGUgPSBuZXcgUmVnRXhwKGNvbmZpZ3MuZmlsZVR5cGUpO1xcbiAgICAgICAgICAgIEZpbGVzLmxpc3QoZGlyUGF0aCkuZm9yRWFjaCgoZGlyUGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IFN0cmluZyhkaXJQYXRoLmdldEZpbGVOYW1lKCkpO1xcbiAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IFN0cmluZyhkaXJQYXRoLnRvQWJzb2x1dGVQYXRoKCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoRmlsZXMuaXNEaXJlY3RvcnkoZGlyUGF0aCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHdqai5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUocmVmcmVzaCwgcGF0aCwgY29uZmlncyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogZGlySWNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBgJHtjb25maWdzLnVpZH0u5paH5Lu2KOWkuSlgXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29uZmlncy5wYXR0ZXJuID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGdldEV4dGVuc2lvbihuYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWdzLmZpbGVUeXBlICYmICF0YXJnZXRUeXBlLnRlc3QodHlwZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGljX3VybCA9ICh0eXBlUGljLmluY2x1ZGVzKHR5cGUpID8gcGF0aCA6IFR5cGVJY29uLmdldCh0eXBlKSkgfHwgZGVmYXVsdEljb247XFxuICAgICAgICAgICAgICAgICAgICB3ai5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoYOehruiupOmAieaLqSR7bmFtZX1gKS5jb25maXJtKGNob29zZSwgcGF0aCwgY29uZmlncy5jYWxsYmFjaywgdHlwZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogcGljX3VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBgJHtjb25maWdzLnVpZH0u5paH5Lu2KOWkuSlgXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICBpZiAod2pqLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGAke2NvbmZpZ3MudWlkfSPmlofku7blpLlgLCB3amopO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAod2oubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoYCR7Y29uZmlncy51aWR9I+aWh+S7tmAsIHdqKTtcXG4gICAgICAgICAgICB9XFxuXFxuICAgICAgICB9XFxuICAgIH1cXG59KVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pCc57SiXCIsXCJwYXRoXCI6XCJTZWFyY2hcIixcInJ1bGVcIjpcImpzOlxcbmxldCBkYXRhID0gW107XFxuLy9uZXdcXG5sZXQgY29uZmlncyA9IE1ZX1BBUkFNUy5jb25maWdzO1xcbmxldCBrZXkgPSBiYXNlNjREZWNvZGUoZ2V0UGFyYW0oXFxcImtleVxcXCIpKTtcXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuKdjFxcXCIsXFxuICAgIGRlc2M6IFxcXCLmkJzntKJcXFwiLFxcbiAgICB1cmw6IFxcXCJiYWNrKGZhbHNlKTtcXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGRlZmF1bHRWYWx1ZToga2V5LFxcbiAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKGNvbmZpZ3MpID0+IHtcXG4gICAgICAgICAgICBpbnB1dCA9IGlucHV0LnRyaW0oKTtcXG4gICAgICAgICAgICBsZXQgdmFsdWUxID0gZmluZEl0ZW0oYCR7Y29uZmlncy51aWR9I+aQnOe0oi3lj5jph49gKXx8e307XFxuICAgICAgICAgICAgdXBkYXRlSXRlbShgJHtjb25maWdzLnVpZH0j5pCc57SiLeWPmOmHj2AsIHtcXG4gICAgICAgICAgICAgICAgZGVzYzogaW5wdXQsXFxuICAgICAgICAgICAgICAgIHVybDogdmFsdWUxLnVybCArIDFcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBqYXZhLmxhbmcuVGhyZWFkLnNsZWVwKDYwMCk7XFxuICAgICAgICAgICAgbGV0IHZhbHVlMiA9IGZpbmRJdGVtKGAke2NvbmZpZ3MudWlkfSPmkJzntKIt5Y+Y6YePYCl8fHt9O1xcbiAgICAgICAgICAgIGlmICh2YWx1ZTIuZGVzYyA9PT0gaW5wdXQmJnZhbHVlMi5kZXNjIT09IHZhbHVlMS5kZXNjKSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oYCR7Y29uZmlncy51aWR9I+aQnOe0oi3nirbmgIFgLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOaQnOe0ouS4rSDSieKAneKAnVxcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGxldCBsb2FkID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvTG9hZEZpbGVzXFxcIikubG9hZFNlYXJjaDtcXG4gICAgICAgICAgICAgICAgbG9hZChpbnB1dCwgY29uZmlncyk7XFxuICAgICAgICAgICAgICAgIGxldCB2YWx1ZTMgPSBmaW5kSXRlbShgJHtjb25maWdzLnVpZH0j5pCc57SiLeWPmOmHj2ApfHx7fTtcXG4gICAgICAgICAgICAgICAgaWYodmFsdWUzLnVybCE9PXVuZGVmaW5lZCYmdmFsdWUzLnVybD09PXZhbHVlMi51cmwpe1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbShgJHtjb25maWdzLnVpZH0j5pCc57SiLeeKtuaAgWAsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAmOKAmOWKoOi9veWujOaIkOKAmeKAmVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIFxcbiAgICAgICAgfSwgY29uZmlncyksXFxuICAgIH1cXG59KTtcXG4vL25ldyBlbmRcXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIuKAnOKAnOaQnOe0ouS4rSDSieKAneKAnVxcXCIsXFxuICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgIHVybDpcXFwidG9hc3Q6Ly/mkJzntKLmlofku7blpLlcXFwiLFxcbiAgICBleHRyYTp7XFxuICAgICAgICBpZDpgJHtjb25maWdzLnVpZH0j5pCc57SiLeeKtuaAgWBcXG4gICAgfVxcbn0se1xcbiAgICB0aXRsZTogZmluZEl0ZW0oYCR7Y29uZmlncy51aWR9I+WPmOmHj2ApLmV4dHJhLmN1cnJlbnRQYXRoLFxcbiAgICBjb2xfdHlwZTpcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgIHVybDpcXFwidG9hc3Q6Ly/mkJzntKLmlofku7blpLlcXFwiXFxufSx7XFxuICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxufSwge1xcbiAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPmkJzntKIt5paH5Lu25aS5YFxcbiAgICB9XFxufSwge1xcbiAgICBjb2xfdHlwZT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RsZTogZGlyUGF0aHMuZ2V0RmlsZU5hbWUoKSArIFxcXFxcXFwiID5cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChwYXRoLCBjb25maWdzLCBjb3VudCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBsb2FkID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL0xvYWRGaWxlc1xcXFxcXFwiKS5sb2FkRmlsZTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgbGFzdENvdW50ID0gZmluZEl0ZW0oYCR7Y29uZmlncy51aWR9I+WPmOmHj2ApLmV4dHJhLmNvdW50IHx8IGNvdW50O1xcXFxuICAgICAgICAgICAgICAgIGxldCBkZWwgPSBbXTtcXFxcblxcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSBjb3VudCArIDE7IGkgPD0gbGFzdENvdW50OyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsLnB1c2goYCR7Y29uZmlncy51aWR9I+i3r+W+hCR7aX1gKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYgKGRlbC5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oZGVsKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgbG9hZChwYXRoLCBjb25maWdzKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9LCBkaXJQYXRocy50b1N0cmluZygpLCBjb25maWdzLCBpICsgMSksXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxu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gbGV0IG5hbWUgPSBTdHJpbmcoZGlyUGF0aC5nZXRGaWxlTmFtZSgpKTtcXFxcbiAgICAgICAgbGV0IHBhdGggPSBTdHJpbmcoZGlyUGF0aC50b1N0cmluZygpKTtcXFxcbiAgICAgICAgaWYgKEZpbGVzLmlzRGlyZWN0b3J5KGRpclBhdGgpKSB7XFxcXG4gICAgICAgICAgICB3amoucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUocmVmcmVzaERpciwgcGF0aCwgY29uZmlncyksXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogZGlySWNvbixcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGAke2NvbmZpZ3MudWlkfS7mlofku7Zf5aS5YFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKGNvbmZpZ3MucGF0dGVybiA9PT0gMCkge1xcXFxuICAgICAgICAgICAgbGV0IHR5cGUgPSBnZXRFeHRlbnNpb24obmFtZSk7XFxcXG4gICAgICAgICAgICBpZiAoY29uZmlncy5maWxlVHlwZSAmJiAhdGFyZ2V0VHlwZS50ZXN0KHR5cGUpKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IHBpY191cmwgPSAodHlwZVBpYy5pbmNsdWRlcyh0eXBlKSA/IHBhdGggOiBUeXBlSWNvbi5nZXQodHlwZSkpIHx8IGRlZmF1bHRJY29uO1xcXFxuICAgICAgICAgICAgd2oucHVzaCh7XFxcXG4gICAgICAgICA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XRoID0gZmluZEl0ZW0oYCR7Y29uZmlncy51aWR9I+WPmOmHj2ApLmV4dHJhLmN1cnJlbnRQYXRoO1xcXFxuICAgIGxldCB0YXJnZXRUeXBlID0gbmV3IFJlZ0V4cChjb25maWdzLmZpbGVUeXBlKTtcXFxcbiAgICBsZXQgd2pqID0gW107XFxcXG4gICAgbGV0IHdqID0gW107XFxcXG4gICAgZmluZEZpbGUobmV3IEZpbGUocGF0aCksIGtleSwgKGZpbGUsIGlzRGlyZWN0b3J5KSA9PiB7XFxcXG4gICAgICAgIGxldCBuYW1lID0gU3RyaW5nKGZpbGUuZ2V0TmFtZSgpKTtcXFxcbiAgICAgICAgbGV0IHBhdGggPSBTdHJpbmcoZmlsZS5nZXRQYXRoKCkpO1xcXFxuICAgICAgICBpZiAoaXNEaXJlY3RvcnkpIHtcXFxcbiAgICAgICAgICAgIHdqai5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZShyZWZyZXNoRGlyLCBwYXRoLCBjb25maWdzLCB0cnVlKSxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkaXJJY29uLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogYCR7Y29uZmlncy51aWR9LuaQnOe0oi3mlofku7blpLlgXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gZWxzZSBpZiAoY29uZmlncy5wYXR0ZXJuID09PSAwKSB7XFxcXG4gICAgICAgICAgICBsZXQgdHlwZSA9IGdldEV4dGVuc2lvbihuYW1lKTtcXFxcbiAgICAgICAgICAgIGlmIChjb25maWdzLmZpbGVUeXBlICYmICF0YXJnZXRUeXBlLnRlc3QodHlwZSkpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm47XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBsZXQgcGljX3VybCA9ICh0eXBlUGljLmluY2x1ZGVzKHR5cGUpID8gcGF0aCA6IFR5cGVJY29uLmdldCh0eXBlKSkgfHwgZGVmYXVsdEljb247XFxcXG4gICAgICAgICAgICB3ai5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoYOehruiupOmAieaLqVxcXFxcXFxcbiR7cGF0aH1gKS5jb25maXJtKGNob29zZSwgcGF0aCwgY29uZmlncywgdHlwZSwgdHJ1ZSksXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogcGljX3VybCxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGAke2NvbmZpZ3MudWlkfS7mkJzntKIt5paH5Lu2YFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSk7XFxcXG4gICAgVGhyZWFkLnNsZWVwKDUwKTtcXFxcbiAgICBpZiAod2pqLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgYWRkSXRlbUFmdGVyKGAke2NvbmZpZ3MudWlkfSPmkJzntKIt5paH5Lu25aS5YCwgd2pqKTtcXFxcbiAgICAgICAgLy9UaHJlYWQuc2xlZXAoNTApO1xcXFxuICAgIH1cXFxcbiAgICBpZiAod2oubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICBhZGRJdGVtQWZ0ZXIoYCR7Y29uZmlncy51aWR9I+aQnOe0oi3mlofku7ZgLCB3aik7XFxcXG4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c2U2NEVuY29kZShpbnB1dCk6JydcXFxcXFxcIixcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiaW5wdXRcXFxcXFxcIixcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5pCc57Si5qGGMWAsXFxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygodWlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKGAke3VpZH06YmFja2AsIFxcXFxcXFwiXFxcXFxcXCIpID09PSBcXFxcXFxcInRydWVcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGAke3VpZH06YmFja2ApO1xcXFxuICAgICAgICAgICAgICAgICAgICBiYWNrKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIGNvbmZpZ3MudWlkKSxcXFxcbiAgICAgICAgICAgIGNvbmZpZ3M6IGNvbmZpZ3NcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuICAgIC8vbmV3IGVuZFxcXFxuICAgIGRhdGEucHVzaCh7XFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCIsXFxcXG4gICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICBpZDogYCR7Y29uZmlncy51aWR9I+WPmOmHj2AsXFxcXG4gICAgICAgICAgICBjb3VudDogY291bnQsXFxcXG4gICAgICAgICAgICBjdXJyZW50UGF0aDogY29uZmlncy5pbml0aWFsUGF0aFxcXFxuICAgICAgICB9XFxcXG4gICAgfSwge1xcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPot6/lvoQke2NvdW50fWBcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuICAgIGlmIChjb25maWdzLnBhdHRlcm4gPT09IDEpIHtcXFxcbiAgICAgICAgZGF0YS5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWIm+W7uuebruW9lVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiXFxcXFxcXCIpLmlucHV0KChjb25maWdzKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSBpbnB1dC50cmltKCk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKCFpbnB1dCkgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kuI3mlK/mjIHnqbrnmb3mlofku7blkI1cXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICBjb25zdCBQYXRocyA9IGphdmEubmlvLmZpbGUuUGF0aHM7XFxcXG4gICAgICAgICAgICAgICAgY29uc3QgRmlsZXMgPSBqYXZhLm5pby5maWxlLkZpbGVzO1xcXFxuICAgICAgICAgICAgICAgIGxldCBwYXRoID0gZmluZEl0ZW0oYCR7Y29uZmlncy51aWR9I+WPmOmHj2ApLmV4dHJhLmN1cnJlbnRQYXRoO1xcXFxuICAgICAgICAgICAgICAgIGxldCBuZXdQYXRoID0gUGF0aHMuZ2V0KHBhdGgsIGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoRmlsZXMuZXhpc3RzKG5ld1BhdGgpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5Yib5bu65aSx6LSlOuW3suWtmOWcqFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBGaWxlcy5jcmV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ICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5Y+Y6YePYFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJibGFua19ibG9ja1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j6Lev5b6EJHtjb3VudH1gXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBpZiAoY29uZmlncy5wYXR0ZXJuID09PSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgZGF0YS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi6YCJ5oup5q2k5paH5Lu25aS5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChjYWxsYmFjaywgdWlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IGZpbmRJdGVtKGAke3VpZH0j6YCJ5oup5paH5Lu25aS5YCkuZXh0cmEucGF0aDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjYWxsYmFja0Z1bmMgPSBuZXcgRnVuY3Rpb24oXFxcXFxcXCJQQVRIXFxcXFxcXCIsIGByZXR1cm4gJHtjYWxsYmFja31gKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYWxsYmFja0Z1bmMocGF0aCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgY29uZmlncy5jYWxsYmFjaywgY29uZmlncy51aWQpLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogYCR7Y29uZmlncy51aWR9I+mAieaLqeaWh+S7tuWkuWAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXRoOiBjb25maWdzLmluaXRpYWxQYXRoXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGRhdGEucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5paH5Lu25aS5YFxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGAke2NvbmZpZ3MudWlkfSPmlofku7ZgXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSk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LmluaXQoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxhc3RDb3VudCA9IGZpbmRJdGVtKGAke2NvbmZpZ3MudWlkfSPlj5jph49gKS5leHRyYS5jb3VudCB8fCBjb3VudDtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRlbCA9IFtdO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSBjb3VudCArIDE7IGkgPD0gbGFzdENvdW50OyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbC5wdXNoKGAke2NvbmZpZ3MudWlkfSPot6/lvoQke2l9YCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGRlbC5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGRlbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgbG9hZChwYXRoLCBjb25maWdzKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIH0sIGRpclBhdGgudG9BYnNvbHV0ZVBhdGgoKSwgY29uZmlncywgY291bnQpLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j6Lev5b6EJHtjb3VudCsxfWBcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5Y+Y6YePYCxcXFxcbiAgICAgICAgICAgICAgICAgICAgY291bnQ6IGNvdW50ICsgMVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgbGV0IHRhcmdldFR5cGUgPSBuZXcgUmVnRXhwKGNvbmZpZ3MuZmlsZVR5cGUpO1xcXFxuICAgICAgICAgICAgRmlsZXMubGlzdChkaXJQYXRoKS5mb3JFYWNoKChkaXJQYXRoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBTdHJpbmcoZGlyUGF0aC5nZXRGaWxlTmFtZSgpKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcGF0aCA9IFN0cmluZyhkaXJQYXRoLnRvQWJzb2x1dGVQYXRoKCkpO1xcXFxuICAgICAgICAgICAgICAgIGlmIChGaWxlcy5pc0RpcmVjdG9yeShkaXJQYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB3amoucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKHJlZnJlc2gsIHBhdGgsIGNvbmZpZ3MpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogZGlySWNvbixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImF2YXRhclxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IGAke2NvbmZpZ3MudWlkfS7mlofku7Yo5aS5KWBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjb25maWdzLnBhdHRlcm4gPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSBnZXRFeHRlbnNpb24obmFtZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb25maWdzLmZpbGVUeXBlICYmICF0YXJnZXRUeXBlLnRlc3QodHlwZSkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGljX3VybCA9ICh0eXBlUGljLmluY2x1ZGVzKHR5cGUpID8gcGF0aCA6IFR5cGVJY29uLmdldCh0eXBlKSkgfHwgZGVmYXVsdEljb247XFxcXG4gICAgICAgICAgICAgICAgICAgIHdqLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoYOehruiupOmAieaLqSR7bmFtZX1gKS5jb25maXJtKGNob29zZSwgcGF0aCwgY29uZmlncy5jYWxsYmFjaywgdHlwZSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBwaWNfdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYXZhdGFyXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogYCR7Y29uZmlncy51aWR9LuaWh+S7tijlpLkpYFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICAgICAgaWYgKHdqai5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGAke2NvbmZpZ3MudWlkfSPmlofku7blpLlgLCB3amopO1xcXFxuICA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OiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCIsXFxcXG4gICAgdXJsOiAwLFxcXFxuICAgIGV4dHJhOiB7XFxcXG4gICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5pCc57SiLeWPmOmHj2BcXFxcbiAgICB9XFxcXG59LCB7XFxcXG4gICAgY29sX3R5cGU6IFxcXFxcXFwibGluZV9ibGFua1xcXFxcXFwiLFxcXFxuICAgIGV4dHJhOiB7XFxcXG4gICAgICAgIGlkOiBgJHtjb25maWdzLnVpZH0j5pCc57SiLeaWh+S7tmBcXFxcbiAgICB9XFxcXG59LCB7XFxcXG4gICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxufSwge1xcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxufSk7XFxcXG5zZXRSZXN1bHQoZGF0YSk7XFxcIn1dXCJ9IiwidGl0bGUiOiIifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement