Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥你还没有书哦~~点我进入设置@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwi5rqQ55uu5b2VXCIsXCJwYXRoXCI6XCJzb3VyY2VcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxudmFyIG0gPSBNWV9QQVJBTVMucnVsZXNcXG52YXIgYmFzZXVybCA9IG0uYm9va1NvdXJjZVVybFxcbmlmIChtLnJ1bGVFeHBsb3JlLmJvb2tMaXN0KSB7XFxuICAgIHZhciBydWxlID0gbS5ydWxlRXhwbG9yZVxcbn0gZWxzZSB7XFxuICAgIHZhciBydWxlID0gbS5ydWxlU2VhcmNoXFxufVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi5pCc57SiXFxcIixcXG4gICAgZGVzYzogXFxcIuivt+i+k+WFpeaQnOe0ouWFs+mUruivjVxcXCIsXFxuICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICBwdXRNeVZhcihcXFwia3dcXFwiLCBpbnB1dCk7XFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9zZWFyY2g/cD1meXBhZ2Uma3c9XFxcIiArIGlucHV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GJvb2t1cmwpICsgXFxcIiNhdXRvQ2FjaGUjI2ltbWVyc2l2ZVRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IChhdXRob3IgPyBwYXJzZURvbUZvckh0bWwoaXRlbSwgYXV0aG9yKSA6IFxcXCJcXFwiKSArIFxcXCJcXFxcblxcXCIgKyAoaW50cm8gPyBwYXJzZURvbUZvckh0bWwoaXRlbSwgaW50cm8pIDogXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImJvb2tOYW1lXFxcIjogcGFyc2VEb21Gb3JIdG1sKGl0ZW0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvdmVyXFxcIjogKGNvdmVyID8gcGFyc2VEb20oaXRlbSwgY292ZXIpICsgXFxcIkBSZWZlcmVyPVxcXCIgOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIlRvY1xcXCI6IE1ZX1BBUkFNUy5hbGwucnVsZVRvYyxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50XFxcIjogTVlfUEFSQU1TLmFsbC5ydWxlQ29udGVudFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiX6KGo5Yqg6L295aSx6LSl77yaXFxcIiArIGxpc3RydWxlLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0pXFxuICAgIH1cXG59IGNhdGNoIChlKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuWKoOi9veWksei0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WVkdS9saXN0Lmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShsaXN0KSlcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ID0gZmV0Y2goaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHQpXFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcIiArIG1kNShuYW1lKSArIFxcXCIuanNvblxcXCIsIHQpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcIlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a+85YWl5aSx6LSlXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICB9LCBpbnB1dClcXG4gICAgICAgIH0pXFxuICAgIH0pXFxuICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9saXN0Lmpzb25cXFwiKSlcXG4gICAgbGlzdC51cmxzLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICBkZXNjOiBpdGVtLnVybCxcXG4gICAgICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaRcXFwiLCBcXFwi57yW6L6R5ZCN56ewXFxcIiwgXFxcIue8lui+keWcsOWdgFxcXCIsIFxcXCLmm7TmlrBcXFwiXSkuc2VsZWN0KChsaXMsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBsaXNcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliKDpmaRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu6K6k5Yig6Zmk77yfXFxcIikuY29uZmlybSgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcIiArIG1kNShsaXN0LnVybHNbaV0ubmFtZSkgKyBcXFwiLmpzb25cXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudXJscy5zcGxpY2UoaSwgMSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi57yW6L6R5ZCN56ewXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51cmxzW2ldLm5hbWUgPSBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9saXN0Lmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShsaXN0KSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09IFxcXCLnvJbovpHlnLDlnYBcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIikuaW5wdXQoKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVybHNbaV0udXJsID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBmZXRjaChsaXN0LnVybHNbaV0udXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIEpTT04ucGFyc2UodClcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcIiArIG1kNShsaXN0LnVybHNbaV0ubmFtZSkgKyBcXFwiLmpzb25cXFwiLCB0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5pu05paw5oiQ5YqfXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5pu05paw5aSx6LSlXFxcIilcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGxpc3QsIGkpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIlxcbiAgICAgICAgfSlcXG4gICAgfSlcXG59IGNhdGNoIChlKSB7XFxuICAgIGQucHVza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GxldCByID0gcnVsZS5jb250ZW50LnJlcGxhY2UoXFxcIkBcXFwiLCBcXFwiJiZcXFwiKS5yZXBsYWNlKFxcXCJ0ZXh0XFxcIiwgXFxcIlRleHRcXFwiKS5yZXBsYWNlKC9cXFxcLlswLTldL2csIGZ1bmN0aW9uKGEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBhLnJlcGxhY2UoXFxcIi5cXFwiLCBcXFwiLFxcXCIpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsZXQgcjEgPSByLnNwbGl0KFxcXCImJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgcjIgPSByMS5zbGljZSgwLCByMS5sZW5ndGggLSAxKS5qb2luKFxcXCImJlxcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyID0gcGRmYShyZXMsIFxcXCJib2R5JiZcXFwiICsgcjIpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhhcnIpO1xcbiAgICAgICAgICAgICAgICB2YXIgdHQgPSBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgIGl0ID0gaXQucmVwbGFjZShuZXcgUmVnRXhwKFxcXCJcXFxcblxcXCIsIFxcXCJnXFxcIiksIFxcXCItLWJyLS1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGl0KTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0ID0gcGRmaChpdCwgXFxcIlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHQgPSB0LnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiLS1ici0tXFxcIiwgXFxcImdcXFwiKSwgXFxcIjxicj5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxldCB0MiA9IHQuc3BsaXQoXFxcIjxicj5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0MiBvZiB0Mikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcIlxcXCIgfHwgaXQyLmxlbmd0aCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXQyLnN0YXJ0c1dpdGgoXFxcIuOAgFxcXCIpICYmICFpdDIuc3RhcnRzV2l0aChcXFwiJm5ic3A7Jm5ic3A7XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQyID0gXFxcIiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwO1xcXCIgKyBpdDIudHJpbSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZS5yZXBsYWNlUmVnZXgpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQyID0gaXQyLnJlcGxhY2UobmV3IFJlZ0V4cChydWxlLnJlcGxhY2VSZWdleC5yZXBsYWNlKFxcXCIjI1xcXCIsIFxcXCJcXFwiKSwgXFxcImdcXFwiKSwgXFxcIlxcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpdDIgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHQgKz0gaXQyICsgXFxcIlxcXFxuXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICA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IixcIm5hbWVcIjpcIui9rOaNolwiLFwicGF0aFwiOlwiY29udmVydGVyXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSB7XFxuICAgIGdldEFycmF5OiAoaHRtbCwgcnVsZSkgPT4ge1xcbiAgICAgICAgbGV0IHIxID0gcnVsZS5zcGxpdChcXFwiIVxcXCIpWzBdLnNwbGl0KFxcXCJ8fFxcXCIpO1xcbiAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJlxcXCIgKyByMVswXS5yZXBsYWNlKFxcXCIgXFxcIiwgXFxcIiYmXFxcIikucmVwbGFjZShcXFwiQFxcXCIsIFxcXCImJlxcXCIpKTtcXG4gICAgICAgIGlmIChyMS5sZW5ndGggPiAxKSB7XFxuICAgICAgICAgICAgbGV0IHIyID0gcjFbMV0uc3BsaXQoXFxcIjpcXFwiKTtcXG4gICAgICAgICAgICBsZXQgcjMgPSBbXTtcXG4gICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByMikge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBwYXJzZUludChpdCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaXNOYU4oaSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHIzLnB1c2goaSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBhcnIyID0gW107XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgaWYgKHIzLmluZGV4T2YoaSkgPCAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIyLnB1c2goYXJyW2ldKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICA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AoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgIC8v5aSa57q/56iL5Yqg6L29XFxuICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXG4gICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gc2VhcmNoKHJ1bGUsIHMsIDEpO1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGFyYW06IGl0LFxcbiAgICAgICAgICAgIGlkOiBcXFwicnVsZUBcXFwiICsgaXQubmFtZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxuICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgICAgICAvL2xvZyhcXFwibGlzdGVuZXI6IFxcXCIgKyAocmVzdWx0IHx8IFtdKS5sZW5ndGgpXFxuICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmogPSBwYXJhbS5qICsgMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2hNdXN0ID09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWl0LnRpdGxlIHx8ICFpdC50aXRsZS5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGV4dHJhID0gaXQuZXh0cmEgfHwge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuaWQgPSBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmo7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEuYm9va05hbWUgPSBpdC50aXRsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmNvdmVyID0gaXQucGljX3VybCB8fCBpdC5pbWdcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUuaW5jbHVkZXMoXFxcIuKAnOKAnOKAneKAnVxcXCIpID8gaXQudGl0bGUgOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIGl0LnRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiPGVtPnw8L2VtPlxcXCIsIFxcXCJnXFxcIiksIFxcXCJcXFwiKS5yZXBsYWNlKG5ldyBSZWdFeHAocywgXFxcImdcXFwiKSwgXFxcIjxzdHJvbmc+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjogIzFFOTBGRlxcXFxcXFwiPlxcXCIgKyBzICsgXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwgfHwgaXQuaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCB8fCBpdC5pbWcgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxcXG4gICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICBpOiAwLFxcbiAgICAgICAgICAgIGo6IC0xXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0oui+he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RpdGxlOiBwYXJzZURvbUZvckh0bWwoaXRlbSwgbmFtZSksXFxuICAgICAgICAgICAgICAgIGltZzogcGFyc2VEb20oaXRlbSwgY292ZXIsIHVybCksXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9tZW51P3VybD1cXFwiICsgcGFyc2VEb20oaXRlbSwgYm9va3VybCwgdXJsKSArIFxcXCIjYXV0b0NhY2hlIyNpbW1lcnNpdmVUaGVtZSNcXFwiLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBydWxlLmJvb2tTb3VyY2VOYW1lICsgXFxcIlxcXFxuXFxcIiArIHBhcnNlRG9tRm9ySHRtbChpdGVtLCBhdXRob3IpICsgXFxcIlxcXFxuXFxcIiArIHBhcnNlRG9tRm9ySHRtbChpdGVtLCBpbnRybyksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiVG9jXFxcIjogcnVsZS5ydWxlVG9jLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvbnRlbnRcXFwiOiBydWxlLnJ1bGVDb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImJvb2tOYW1lXFxcIjogcGFyc2VEb21Gb3JIdG1sKGl0ZW0sIG5hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImNvdmVyXFxcIjogcGFyc2VEb20oaXRlbSwgY292ZXIsIHVybClcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJldHVybiBkO1xcbiAgICB9LFxcbiAgICBsaXN0UnVsZXM6IChwYWdlLCBydWxlKSA9PiB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIC8v5bm25Y+R5pWw6YePXFxuICAgICAgICAgICAgbGV0IHNpemUgPSAyMDtcXG4gICAgICAgICAgICBsZXQgZGF0YTEgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIpKVxcbiAgICAgICAgICAgIGxldCBsaXN0ID0gSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9cXFwiICsgbWQ1KGdldE15VmFyKFxcXCJ0YWJcXFwiLCBkYXRhMS51cmxzWzBdLm5hbWUpKSArIFxcXCIuanNvblxcXCIpKVxcbiAgICAgICAgICAgIGxldCBydWxlcyA9IFtdO1xcbiAgICAgICAgICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHMgPSBKU09OLnN0cmluZ2lmeShpdGVtKVxcbiAgICAgICAgICAgICAgICBpZiAocy5pbmNsdWRlcyhcXFwiPGpzPlxcXCIpIHx8IHMuaW5jbHVkZXMoXFxcIkBqczpcXFwiKSB8fCBzLmluY2x1ZGVzKFxcXCIkLlxcXCIpIHx8IHMuaW5jbHVkZXMoXFxcIvCflJ5cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5wdXNoKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKCFwYWdlICYmICFydWxlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBydWxlcy5tYXAoaXQgPT4gaXQubmFtZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChydWxlICE9IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGVzLmZpbHRlcihpID0+IGkubmFtZSA9PSBydWxlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gKHBhZ2UgLSAxKSAqIHNpemU7XFxuICAgICAgICAgICAgaWYgKHJ1bGVzLmxlbmd0aCA8IHN0YXJ0ICsgMSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gW107XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBsZW4gPSBzaXplO1xcbiAgICAgICAgICAgIGlmIChydWxlcy5sZW5ndGggPCBwYWdlICogc2l6ZSkge1xcbiAgICAgICAgICAgICAgICBsZW4gPSBydWxlcy5sZW5ndGggLSBzdGFydFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgYWxsID0gcnVsZXMubGVuZ3RoO1xcbiAgICAgICAgICAgIGxldCB1c2UgPSAocGFnZSAtIDEpICogc2l6ZSArIGxlbjtcXG4gICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICBhbGw6IGFsbCxcXG4gICAgICAgICAgICAgICAgdXNlOiB1c2UsXFxuICAgICAgICAgICAgICAgIGRhdGE6IHJ1bGVzLnNsaWNlKHN0YXJ0LCBzdGFydCArIGxlbilcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIGFsbDogMCxcXG4gICAgICAgICAgICAgICAgdXNlOiAwLFxcbiAgICAgICAgICAgICAgICBkYXRhOiBbXVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfVxcbn1cIn1dLFwic2F2ZWRcIjpmYWxzZSxcInRpdGxlXCI6XCLmgqbor7tcIixcInZlcnNpb25cIjowLFwidXJsXCI6XCJoaWtlcjovL3BhZ2UvY29uZmlnXCIsXCJjb2xfdHlwZVwiOlwidGV4dF9jZW50ZXJfMVwiLFwiZmluZF9ydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbnRyeSB7XFxuICAgIGlmICghZmlsZUV4aXN0KFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIpKSB7XFxuICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgJ3tcXFwidXJsc1xcXCI6W119JylcXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLmt7vliqDorqLpmIVcXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCJcXFwiLCBcXFwi6K6i6ZiF5ZCN56ewXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K6i6ZiF6ZO+5o6lXFxcIikuaW5wdXQoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIpKVxcbiAgICAgICAgICAgICAgICBsaXN0LnVybHMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dFxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGZldGNoKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgSlNPTi5wYXJzZSh0KVxcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXCIgKyBtZDUobmFtZSkgKyBcXFwiLmpzb25cXFwiLCB0KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCJcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeWksei0pVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICB9KVxcbiAgICB9KVxcbiAgICBsZXQgbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIikpXFxuICAgIGxpc3QudXJscy5mb3JFYWNoKChpdGVtLCBpKSA9PiB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgZGVzYzogaXRlbS51cmwsXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFwi5Yig6ZmkXFxcIiwgXFxcIue8lui+keWQjeensFxcXCIsIFxcXCLnvJbovpHlnLDlnYBcXFwiLCBcXFwi5pu05pawXFxcIl0pLnNlbGVjdCgobGlzLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gbGlzXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5Yig6ZmkXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruiupOWIoOmZpO+8n1xcXCIpLmNvbmZpcm0oKGxpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXCIgKyBtZDUobGlzdC51cmxzW2ldLm5hbWUpICsgXFxcIi5qc29uXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVybHMuc3BsaWNlKGksIDEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGxpc3QpKSAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcIue8lui+keWQjeensFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QudXJsc1tpXS5uYW1lID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbGlzdCwgaSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi57yW6L6R5Zyw5Z2AXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51cmxzW2ldLnVybCA9IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGxpc3QpKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0ID0gZmV0Y2gobGlzdC51cmxzW2ldLnVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L1xcXCIgKyBtZDUobGlzdC51cmxzW2ldLm5hbWUpICsgXFxcIi5qc29uXFxcIiwgdClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuabtOaWsOaIkOWKn1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuabtOaWsOWksei0pVxcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBsaXN0LCBpKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCJcXG4gICAgICAgIH0pXFxuICAgIH0pXFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLplJnor6/vvJpcXFwiICsgZS5tZXNzYWdlLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0pXFxufVxcbnNldFJlc3VsdChkKTtcIixcImdyb3VwXCI6XCLikafpmIXor7tcIixcInVhXCI6XCJtb2JpbGVcIixcInByZVJ1bGVcIjpcIlwiLFwicGFnZXNcIjpcIlt7XFxcImNvbF90eXBlXFxcIjpcXFwidGV4dF8xXFxcIixcXFwibmFtZVxcXCI6XFxcIua6kOebruW9lVxcXCIsXFxcInBhdGhcXFwiOlxcXCJzb3VyY2VcXFwiLFxcXCJydWxlXFxcIjpcXFwianM6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aaguS4jeaUr+aMgVxcXFxcXFwiXFxcXG4gICAgICAgICAgICByZXR1cm5cXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHZhciB1cmwgPSBcXFxcXFxcImhpa2VyOi8vcGFnZS9zb3VyY2U/cD1meXBhZ2VcXFxcXFxcIlxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5ib29rU291cmNlTmFtZSArIGAoJHtpdGVtLmJvb2tTb3VyY2VHcm91cH0pYCxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiB1cmwsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwicnVsZXNcXFxcXFxcIjogaXRlbVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0pXFxcXG59IGVsc2Uge1xcXFxuICAgIHNldFJlc3VsdChbe1xcXFxuICAgICAgICB0aXRsZTogXFxcXFxcXCLkvaDov5jmsqHmnInkuablk6bvvZ7vvZ7ngrnmiJHov5vlhaXorr7nva5cXFxcXFxcIixcXFxcbiAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vcGFnZS9jb25maWdcXFxcXFxcIixcXFxcbiAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiXFxcXG4gICAgfV0pXFxcXG59XFxcXG5zZXRSZXN1bHQoZCk7XFxcIn0se1xcXCJjb2xfdHlwZVxcXCI6XFxcIm1vdmllXzFfdmVydGljYWxfcGljXFxcIixcXFwibmFtZVxcXCI6XFxcIuWIl+ihqFxcXCIsXFxcInBhdGhcXFwiOlxcXCJib29rc1xcXCIsXFxcInJ1bGVcXFwiOlxcXCJqczpcXFxcbnZhciBkID0gW107XFxcXG50cnkge1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ICAgbGlzdC51cmxzLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICBuYW1lOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB3cml0ZUZpbGUoXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXFxcXFwiLCBKU09OLnN0cmluZ2lmeShsaXN0KSlcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGZldGNoKGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICBKU09OLnBhcnNlKHQpXFxcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFxcXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvXFxcXFxcXCIgKyBtZDUobmFtZSkgKyBcXFxcXFxcIi5qc29uXFxcXFxcXCIsIHQpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5aSx6LSlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgfSwgaW5wdXQpXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSlcXFxcbiAgICBsZXQgbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2goXFxcXFxcXCJoaWtlcjovL2ZpbGVzL3l1ZWR1L2xpc3QuanNvblxcXFxcXFwiKSlcXFxcbiAgICBsaXN0LnVybHMuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcXFxuICAgICAgICBkLnB1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LnvJbovpHlkI3np7BcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiKS5pbnB1dCgobGlzdCwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC51cmxzW2ldLm5hbWUgPSBpbnB1dFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy95dWVkdS9saXN0Lmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkobGlzdCkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGxpc3QsIGkpXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFxcXFxcIue8lui+keWcsOWdgFxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXFxcXFwiXFxcXFxcXCIpLmlucHV0KChsaXN0LCBpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0LnVybHNbaV0udXJsID0gaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFxcXFxcImhpa2VyOi8vZmlsZXMveXVlZHUvbGlzdC5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KGxpc3QpKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICB9LCBsaXN0LCBpKVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IGZldGNoKGxpc3QudXJsc1tpXS51cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBKU09OLn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0tYnItLVxcXFxcXFwiLCBcXFxcXFxcImdcXFxcXFxcIiksIFxcXFxcXFwiPGJyPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHQgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgdDIgPSB0LnNwbGl0KFxcXFxcXFwiPGJyPlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQyIG9mIHQyKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXQyID09IFxcXFxcXFwiXFxcXFxcXCIgfHwgaXQyLmxlbmd0aCA9PSAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaXQyLnN0YXJ0c1dpdGgoXFxcXFxcXCLjgIBcXFxcXFxcIikgJiYgIWl0Mi5zdGFydHNXaXRoKFxcXFxcXFwiJm5ic3A7Jm5ic3A7XFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaXQyID0gXFxcXFxcXCImbmJzcDsmbmJzcDsmbmJzcDsmbmJzcDtcXFxcXFxcIiArIGl0Mi50cmltKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAocnVsZS5yZXBsYWNlUmVnZXgpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdDIgPSBpdDIucmVwbGFjZShuZXcgUmVnRXhwKHJ1bGUucmVwbGFjZVJlZ2V4LnJlcGxhY2UoXFxcXFxcXCIjI1xcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKSwgXFx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gICAgICAgIGZvciAobGV0IGl0IG9mIHIyKSB7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGkgPSBwYXJzZUludChpdCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpc05hTihpKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgcjMucHVzaChpKTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IGFycjIgPSBbXTtcXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHIzLmluZGV4T2YoaSkgPCAwKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGFycjIucHVzaChhcnJbaV0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiBhcnIyO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxvZyhcXFxcXFxcIuiOt+WPluWksei0pe+8jOWksei0peWumuS9je+8mlxcXFxcXFwiICsgcjFbMF0ucmVwbGFjZShcXFxcXFxcIiBcXFxcXFxcIiwgXFxcXFxcXCImJlxcXFxcXFwiKS5yZXBsYWNlKFxcXFxcXFwiQFxcXFxcXFwiLCBcXFxcXFxcIiYmXFxcXFxcXCIpKVxcXFxuICAgICAgICByZXR1cm4gYXJyO1xcXFxuICAgIH0sXFxcXG4gICAgZ2V0VGV4dDogKGh0bWwsIHJ1bGUpID0+IHtcXFxcbiAgICAgICAgdmFyIHJ1ID0gcnVsZS5yZXBsYWNlKFxcXFxcXFwiQFxcXFxcXFwiLCBcXFxcXFxcIiYmXFxcXFxcXCIpLnJ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MsIHtcXFxcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAvL2xvZyhcXFxcXFxcImxpc3RlbmVyOiBcXFxcXFxcIiArIChyZXN1bHQgfHwgW10pLmxlbmd0aClcXFxcbiAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXFxcbiAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByZXN1bHQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmogPSBwYXJhbS5qICsgMTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaE11c3QgPT0gXFxcXFxcXCIxXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWl0LnRpdGxlIHx8ICFpdC50aXRsZS5pbmNsdWRlcyhzKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZXh0cmEgPSBpdC5leHRyYSB8fCB7fTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmlkID0gXFxcXFxcXCJfX2FwcFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwiQFxcXFxcXFwiICsgcGFyYW0uajtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmJvb2tOYW1lID0gaXQudGl0bGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmNvdmVyID0gaXQucGljX3VybCB8fCBpdC5pbWdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUocGFnZWlkLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLmluY2x1ZGVzKFxcXFxcXFwi4oCc4oCc4oCd4oCdXFxcXFxcXCIpID8gaXQudGl0bGUgOiBcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiICsgaXQudGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKFxcXFxcXFwiPGVtPnw8L2VtPlxcXFxcXFwiLCBcXFxcXFxcImdcXFxcXFxcIiksIFxcXFxcXFwiXFxcXFxcXCIpLnJlcGxhY2UobmV3IFJlZ0V4cChzLCBcXFxcXFxcImdcXFxcXFxcIiksIFxcXFxcXFwiPHN0cm9uZz48c3BhbiBzdHlsZT1cXFxcXFxcXFxcXFxcXFwiY29sb3I6ICMxRTkwRkZcXFxcXFxcXFxcXFxcXFwiPlxcXFxcXFwiICsgcyArIFxcXFxcXFwiPC9zcGFuPjwvc3Ryb25nPlxcXFxcXFwiKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBpdC5kZXNjLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwgfHwgaXQuaW1nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdC5waWNfdXJsIHx8IGl0LmltZyA/ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycgOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG5cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcXFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yqg6L2956ysXFxcXFxcXCIgKyBNWV9QQUdFICsgXFxcXFxcXCLpobXkuK3vvIzov5vluqbvvJpcXFxcXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFxcXFxcIi9cXFxcXFxcIiArIHBhcmFtLmFsbCxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSxcXFxcbiAgICAgICAgcGFyYW06IHtcXFxcbiAgICAgICAgICAgIGFsbDogZGF0YS5sZW5ndGgsXFxcXG4gICAgICAgICAgICBpOiAwLFxcXFxuICAgICAgICAgICAgajogLTFcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxufVxcXCJ9LHtcXFwiY29sX3R5cGVcXFwiOlxcXCJtb3ZpZV8zXFxcIixcXFwibmFtZVx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c3QuZm9yRWFjaChpdGVtID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcyA9IEpTT04uc3RyaW5naWZ5KGl0ZW0pXFxcXG4gICAgICAgICAgICAgICAgaWYgKHMuaW5jbHVkZXMoXFxcXFxcXCI8anM+XFxcXFxcXCIpIHx8IHMuaW5jbHVkZXMoXFxcXFxcXCJAanM6XFxcXFxcXCIpIHx8IHMuaW5jbHVkZXMoXFxcXFxcXCIkLlxcXFxcXFwiKSB8fCBzLmluY2x1ZGVzKFxcXFxcXFwi8J+UnlxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5wdXNoKGl0ZW0pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgaWYgKCFwYWdlICYmICFydWxlKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGVzLm1hcChpdCA9PiBpdC5uYW1lKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmIChydWxlICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gcnVsZXMuZmlsdGVyKGkgPT4gaS5uYW1lID09IHJ1bGUpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gKHBhZ2UgLSAxKSAqIHNpemU7XFxcXG4gICAgICAgICAgICBpZiAocnVsZXMubGVuZ3RoIDwgc3RhcnQgKyAxKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IGxlbiA9IHNpemU7XFxcXG4gICAgICAgICAgICBpZiAocnVsZXMubGVuZ3RoIDwgcGFnZSAqIHNpemUpIHtcXFxcbiAgICAgICAgICAgICAgICBsZW4gPSBydWxlcy5sZW5ndGggLSBzdGFydFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgbGV0IGFsbCA9IHJ1bGVzLmxlbmd0aDtcXFxcbiAgICAgICAgICAgIGxldCB1c2UgPSAocGFnZSAtIDEpICogc2l6ZSArIGxlbjtcXFxcbiAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgYWxsOiBhbGwsXFxcXG4gICAgICAgICAgICAgICAgdXNlOiB1c2UsXFxcXG4gICAgICAgICAgICAgICAgZGF0YTogcnVsZXMuc2xpY2Uoc3RhcnQsIHN0YXJ0ICsgbGVuKVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICBhbGw6IDAsXFxcXG4gICAgICAgICAgICAgICAgdXNlOiAwLFxcXFxuICAgICAgICAgICAgICAgIGRhdGE6IFtdXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG59XFxcIn1dXCIsXCJwcm94eVwiOlwiXCJ9IiwidGl0bGUiOiLkvaDov5jmsqHmnInkuablk6bvvZ7vvZ7ngrnmiJHov5vlhaXorr7nva4ifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement