Advertisement
xiaomianao666

邀您一起看:[杀人者的难堪]

Feb 12th, 2024
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥[杀人者的难堪]@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuWkuOWFi+WIl+ihqEFQSVwiLFwicGF0aFwiOlwiUXVhcmtTaGFyZUFwaVwiLFwicnVsZVwiOlwianM6XFxuLy9AYXV0aG9yIExveURnSWtcXG5sZXQgaHR0cFJlcXVlc3QgPSAkLnJlcXVpcmUoXFxcImh0dHBSZXF1ZXN0XFxcIik7XFxuY29uc3QgYmFzZVVybCA9IFxcXCJodHRwczovL3Bhbi5xdWFyay5jblxcXCI7XFxuXFxuZnVuY3Rpb24gUXVhcmtTaGFyZUFwaShzaGFyZUlkLCBzaGFyZVB3ZCkge1xcbiAgICB0aGlzLnNoYXJlSWQgPSBzaGFyZUlkO1xcbiAgICB0aGlzLnNoYXJlUHdkID0gc2hhcmVQd2Q7XFxuICAgIHRoaXMucmVmcmVzaENhbGxCYWNrID0gKCgpID0+IHZvaWQgMCk7XFxuICAgIC8vdGhpcy5zaGFyZVRva2VuID0gc2hhcmVUb2tlbiB8fCB0aGlzLmdldFNoYXJlVG9rZW4oKTtcX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GUpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBlcnIgPSB0aGlzLmVycm9yVHlwZUNhbGxiYWNrKGVyciwgcmVzKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0aGlzLnJldHJ5Q291bnQpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHRyeVJlc3VsdCA9IHRoaXMuZXJyb3JDYWxsYmFja1dpdGhSZXRyeShlcnIsIHJlcywgdGhpcyk7XFxuICAgICAgICAgICAgICAgIGlmICh0cnlSZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudC0tO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQodG9Kc29uKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudCA9IDA7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5lcnJvckNhbGxiYWNrKGVyciwgcmVzKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmVycm9yQ2FsbGJhY2soZXJyLCByZXMpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgc2V0T3B0aW9ucyhvcHRpb25zKSB7XFxuICAgICAgICB0aGlzLm9wdGlvbnMgPSBPYmplY3QuYXNzaWduKHt9LCBvcHRpb25zLCB7XFxuICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIG1lcmdlSGVhZEFuZEJvZHkob3B0aW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XCJxdWFya19wbGF5TW9kZVxcXCIsIFxcXCLovaznoIFcXFwiKSxcXG4gICAgICAgIHVybDogJChbXFxcIui9rOeggVxcXCIsIFxcXCLljp/nlLtcXFwiXSwgMiwgXFxcIuaSreaUvuaooeW8j1xcXCIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgc2V0SXRlbShcXFwicXVhcmtfcGxheU1vZGVcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5YiH5o2i5oiQ5YqfXFxcIjtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uX3NtYWxsXzRcXFwiLFxcbiAgICAgICAgcGljX3VybDogXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS9pbWcvYWxpX3BsYXkuc3ZnXFxcIixcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIui0puWPt+eZu+W9lVxcXCIsXFxuICAgICAgICB1cmw6ICQoW1xcXCLovpPlhaVDb29raWVcXFwiLCBcXFwi572R6aG155m75b2VXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi572R6aG155m75b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9sb2dpblxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaVDb29raWVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoJC5yZXF1aXJlKFxcXCJ0b29sXFxcIikuaXNMb2dpbkNvb2tpZShpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJxdWFya0Nv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FxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHN0eWxlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVJZCxcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlUHdkLFxcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVUb2tlbjogcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZUlkOiBpdGVtLmZpZCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogZ2V0SGVhZChpdGVtLm9ial9jYXRlZ29yeSkgKyBpdGVtLmZpbGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogJC5kYXRlRm9ybWF0KGl0ZW0udXBkYXRlZF9hdCwgJ3l5eXktTU0tZGQnKSArICcgICcgKyBmb3JtYXRTaXplKGl0ZW0uc2l6ZSksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGl0ZW0udGh1bWJuYWlsLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoZmlkLCBmaWRfdG9rZW4sIHB3ZF9pZCwgc3Rva2VuLCBjYXRlZ29yeSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxDYWNoZSA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJwbGF5VXJsQ2FjaGVcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocGxheVVybENhY2hlW2ZpZF0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybENhY2hlW2ZpZF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAkLnJlcXVpcmUoXFxcInBsYXlcXFwiKS5nZXRQbGF5VXJsKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBsYXlVcmxDYWNoZVtmaWRdID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJwbGF5VXJsQ2FjaGVcXFwiLCBwbGF5VXJsQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uZmlkLCBpdGVtLnNoYXJlX2ZpZF90b2tlbiwgc2hhcmVJZCwgcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLCBpdGVtLm9ial9jYXRlZ29yeSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzdHlsZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLmZpZCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5bGlzdCAnICsgaXRlbS5vYmpfY2F0ZWdvcnlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcXG4gICAgICAgIH0pO1xcbiAgICB9KTtcXG59IGNhdGNoIChlKSB7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZS5tZXNzYWdlLFxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICBjb2xfdHlwZTog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XBlLCB7XFxuICAgIGFkZChjb29raWUpIHtcXG4gICAgICAgIGxldCBjb29raWVzID0gW107XFxuICAgICAgICBpZiAodHlwZW9mIGNvb2tpZSA9PT0gXFxcInN0cmluZ1xcXCIpIHtcXG4gICAgICAgICAgICBjb29raWVzID0gY29va2llLnNwbGl0KFxcXCI7XFxcIik7XFxuICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoY29va2llKSkge1xcbiAgICAgICAgICAgIGNvb2tpZXMgPSBjb29raWU7XFxuICAgICAgICB9XFxuICAgICAgICBjb29raWVzLmZvckVhY2godiA9PiB7XFxuICAgICAgICAgICAgdiA9IHYuc3BsaXQoXFxcIj1cXFwiKTtcXG4gICAgICAgICAgICB0aGlzLmNvb2tpZVt2WzBdLnRyaW0oKV0gPSB2WzFdLnRyaW0oKTtcXG4gICAgICAgIH0pO1xcbiAgICB9LFxcbiAgICBnZXQoKSB7XFxuICAgICAgICByZXR1cm4gT2JqZWN0LmVudHJpZXModGhpcy5jb29raWUpLm1hcCh2ID0+IHZbMF0gKyBcXFwiPVxcXCIgKyB2WzFdKS5qb2luKFxcXCI7XFxcIik7XFxuICAgIH1cXG59KTtcXG5jb25zdCBjb29raWVNYW5hZ2UgPSBuZXcgQ29va2llTWFuYWdlKGNvb2tpZSk7XFxuXFxuZnVuY3Rpb24gd2FpdFNsZWVwKHRpbWUpIHtcXG4gICAgamF2YS5sYW5nLlRocmVhZC5zbGVlcCh0aW1lIHx8IDYwMCk7XFxufVxcblxcbmZ1bmN0aW9uIHJlcXVlc3RIdHRwKHVybCkge1xcbiAgICByZXR1cm4gbmV3IGh0dHBSZXF1ZXN0KHVybClcXG4gICAgICAgIC5zdWNjZXNzKChib2R5LCByZXMpID0+IHtcXG4gICAgICAgICAgICBpZiAoYm9keS5zdGF0dXMgIT09IDIwMCkge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYm9keS5tZXNzYWdlKTtcXG4gICAgICAgICAgICB9XF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1xcbiAgICAgICAgICAgIGZpZFxcbiAgICAgICAgXSxcXG4gICAgICAgIFxcXCJleGNsdWRlX2ZpZHNcXFwiOiBbXVxcbiAgICB9KS5zdGFydCh0cnVlKTtcXG59XFxuXFxuZnVuY3Rpb24gdGFzayh0YXNrX2lkLCByZXRyeV9pbmRleCkge1xcbiAgICByZXR1cm4gcmVxdWVzdEh0dHAoXFxcImh0dHBzOi8vZHJpdmUucXVhcmsuY24vMS9jbG91ZGRyaXZlL3Rhc2tcXFwiKS5idWlsZFVybCh7XFxuICAgICAgICBwcjogXFxcInVjcHJvXFxcIixcXG4gICAgICAgIGZyOiBcXFwicGNcXFwiLFxcbiAgICAgICAgdGFza19pZDogdGFza19pZCxcXG4gICAgICAgIHJldHJ5X2luZGV4OiByZXRyeV9pbmRleFxcbiAgICB9KS5zdGFydCh0cnVlKTtcXG59XFxuXFxuZnVuY3Rpb24gcXVlcnlUYXNrKHRhc2tfaWQpIHtcXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCA2OyBpKyspIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IHJlcyA9IHRhc2sodGFza19pZCwgaSArIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICBpZiAocmVzLmRhdGEuc3RhdHVzID09PSAyKSB7XFxuICAgICAgICAgICAgICAgIHdhaXRTbGVlcCgxMDAwKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlcy5kYXRhLnNhdmVfYXMuc2F2ZV9hc190b3BfZmlkc1swXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd2FpdFNsZWVwKDMwMCk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICB9XFxuICAgIHJldHVybiB2b2lkKDApO1xcbn1cXG5cXG5mdW5jdGlvbiBxdWVyeVRhc2tTdGF0dXModGFza19pZCkge1xcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IDY7IGkrKykge1xcbiAgICAgICAgdHJ5IHtcX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LmdldCgpO1xcbiAgICAgICAgICAgIHZpZGVvTGlzdC5maWx0ZXIodiA9PiB2LmFjY2Vzc2FibGUpLmZvckVhY2godiA9PiB7XFxuICAgICAgICAgICAgICAgIHBsYXlMaXN0Lm5hbWVzLnB1c2godi5yZXNvbHV0aW9uKTtcXG4gICAgICAgICAgICAgICAgcGxheUxpc3QudXJscy5wdXNoKHYudmlkZW9faW5mby51cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiKTtcXG4gICAgICAgICAgICAgICAgcGxheUxpc3QuaGVhZGVycy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIFJlZmVyZXI6IFxcXCJodHRwOi8vcGFuLnF1YXJrLmNuL1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb29raWU6IHBsYXlDb29raWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJjb20uc3R1Yi5TdHViQXBwLzEuMy4wIChMaW51eDtBbmRyb2lkIDE0KSBBbmRyb2lkWE1lZGlhMy8xLjEuMVxcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY3JlYXRlRGVsZXRlVGFzayhhc2ZpZCk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHBsYXlMaXN0KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGV0IHBsYXlVcmwgPSBnZXREb3dubG9hZFVybChhc2ZpZCkuZGF0YVswXS5kb3dubG9hZF91cmw7XFxuICAgICAgICAgICAgbGV0IHBsYXlDb29raWUgPSBjb29raWVNYW5hZ2UuZ2V0KCk7XFxuICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0ge1xcbiAgICAgICAgICAgICAgICBuYW1lczogW1xcXCLljp/nlLtcXFwiXSxcXG4gICAgICAgICAgICAgICAgdXJsczogW3BsYXlVcmwgKyBcXFwiI2lzVmlkZW89d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oKCkgPT4ge1xcbiAgICAgICAgICAgIHNldEl0ZW0oJ3N0eWxlJywgaW5wdXQpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIHBpY191cmw6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vaW1nL2FsaV9pY29uLnN2Z1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfNFxcXCJcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0SXRlbShcXFwic29ydEtleVxcXCIsIFxcXCLlkI3np7DmraPluo9cXFwiKSxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhzb3J0KSwgMSwgJ+ivt+mAieaLqScpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgc2V0SXRlbShcXFwic29ydEtleVxcXCIsIGlucHV0KVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIHBpY191cmw6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vaW1nL2FsaV9zb3J0LnN2Z1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfNFxcXCJcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0SXRlbShcXFwicXVhcmtfcGxheU1vZGVcXFwiLCBcXFwi6L2s56CBXFxcIiksXFxuICAgICAgICB1cmw6ICQoW1xcXCLovaznoIFcXFwiLCBcXFwi5Y6f55S7XFxcIl0sIDIsIFxcXCLmkq3mlL7mqKHlvI9cXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIHNldEl0ZW0oXFxcInF1YXJrX3BsYXlNb2RlXFxcIiwgaW5wdXQpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIh+aNouaIkOWKn1xcXCI7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl9zbWFsbF80XFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vaW1nL2FsaV9wbGF5LnN2Z1xcXCIsXFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLotKblj7fnmbvlvZVcXFwiLFxcbiAgICAgICAgdXJsOiAkKFtcXFwi6L6T5YWlQ29va2llXFxcIiwgXFxcIue9kemhteeZu+W9lVxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PT0gXFxcIue9kemhteeZu+W9lVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UvbG9naW5cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6K+36L6T5YWlQ29va2llXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCQucmVxdWlyZShcXFwidG9vbFxcXCIpLmlzTG9naW5Db29raWUoaW5wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBpbnB1dC5yZXBsYWNlKC9cXFxccy9nLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/orr7nva7miJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIC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ICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldEhlYWQoaXRlbS5vYmpfY2F0ZWdvcnkpICsgaXRlbS5maWxlX25hbWUsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICQuZGF0ZUZvcm1hdChpdGVtLnVwZGF0ZWRfYXQsICd5eXl5LU1NLWRkJykgKyAnICAnICsgZm9ybWF0U2l6ZShpdGVtLnNpemUpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdGVtLnRodW1ibmFpbCxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VXJsQ2FjaGUgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwicGxheVVybENhY2hlXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBsYXlVcmxDYWNoZVtmaWRdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmxDYWNoZVtmaWRdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gJC5yZXF1aXJlKFxcXCJwbGF5XFxcIikuZ2V0UGxheVVybChmaWQsIGZpZF90b2tlbiwgcHdkX2lkLCBzdG9rZW4sIGNhdGVnb3J5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwbGF5VXJsQ2FjaGVbZmlkXSA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGxheVVybENhY2hlXFxcIiwgcGxheVVybENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV9maWRfdG9rZW4sIHNoYXJlSWQsIHF1YXJrU2hhcmVBcGkuZ2V0VG9rZW4oKSwgaXRlbS5vYmpfY2F0ZWdvcnkpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogc3R5bGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5maWQsXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheWxpc3QgJyArIGl0ZW0ub2JqX2NhdGVnb3J5XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGUubWVzc2FnZSxcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBpZiAoZS5tZXNzYWdlLmluY2x1ZGVzKFxcXCLmj5Dlj5bnoIFcXFwiKSkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIui+k+WFpeaPkOWPlueggVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKCkuaW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ICAgICAgICBpZiAodHJ5UmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudC0tO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5zdGFydCh0b0pzb24pO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudCA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmVycm9yQ2FsbGJhY2soZXJyLCByZXMpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JDYWxsYmFjayhlcnIsIHJlcyk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9LFxcXFxuICAgIHNldE9wdGlvbnMob3B0aW9ucykge1xcXFxuICAgICAgICB0aGlzLm9wdGlvbnMgPSBPYmplY3QuYXNzaWduKHt9LCBvcHRpb25zLCB7XFxcXG4gICAgICAgICAgICB3aXRoSGVhZGVyczogdHJ1ZVxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxcXG4gICAgfSxcXFxcbiAgICBtZXJnZUhlYWRBbmRCb2R5KG9wdGlvbnMpIHtcXFxcbiAgICAgICAgb3B0aW9ucyA9IG9wdGlvbnMgfHwge307XFxcXG4gICAgICAgIE9iamVjdC5hc3NpZ24odGhpcy5vcHRpb25zLmhlYWRlcnN8fHt9LCBvcHRpb25zLmhlYWRlcnMpO1xcXFxuICAgICAgICBpZiAodHlwZW9mIHRoaXMub3B0aW9ucy5ib2R5ID09PSBcXFxcXFxcIm9iamVjdFxcXFxcXFwiICYmIHR5cGVvZiBvcHRpb25zLmJvZHkgPT09IFxcXFxcXFwib2JqZWN0XFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAg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xcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vcGFnZS9sb2dpblxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJChcXFxcXFxcIlxcXFxcXFwiLCBcXFxcXFxcIuivt+i+k+WFpUNvb2tpZVxcXFxcXFwiKS5pbnB1dCgoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcXFxcXCJ0b29sXFxcXFxcXCIpLmlzTG9naW5Db29raWUoaW5wdXQpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXFxcXFwicXVhcmtDb29raWVcXFxcXFxcIiwgaW5wdXQucmVwbGFjZSgvXFxcXFxcXFxzL2csIFxcXFxcXFwiXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL0Nvb2tpZeagvOW8j+mUmeivr1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJpY29uX3NtYWxsXzRcXFxcXFxcIixcXFxcbiAgICAgICAgcGljX3VybDogXFxcXFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vaW1nL2FsaV9hcGkuc3ZnXFxcXFxcXCIsXFxcXG4gICAgfSk7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1x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xcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlSWQsXFxcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlUHdkLFxcXFxuICAgICAgICAgICAgICAgICAgICBzaGFyZVRva2VuOiBxdWFya1NoYXJlQXBpLmdldFRva2VuKCksXFxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVJZDogaXRlbS5maWQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldEhlYWQoaXRlbS5vYmpfY2F0ZWdvcnkpICsgaXRlbS5maWxlX25hbWUsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogJC5kYXRlRm9ybWF0KGl0ZW0udXBkYXRlZF9hdCwgJ3l5eXktTU0tZGQnKSArICcgICcgKyBmb3JtYXRTaXplKGl0ZW0uc2l6ZSksXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaXRlbS50aHVtYm5haWwsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBsYXlVcmxDYWNoZSA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXFxcXFwicGxheVVybENhY2hlXFxcXFxcXCIsIHt9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBsYXlVcmxDYWNoZVtmaWRdKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcGxheVVybENhY2hlW2ZpZF07XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gJC5yZXF1aXJlKFxcXFxcXFwicGxheVxcXFxcXFwiKS5nZXRQbGF5VXJsKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGxheVVybENhY2hlW2ZpZF0gPSB1cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFxcXFxcInBsYXlVcmxDYWNoZVxcXFxcXFwiLCBwbGF5VXJsQ2FjaGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uZmlkLCBpdGVtLnNoYXJlX2ZpZF90b2tlbiwgc2hhcmVJZCwgcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLCBpdGVtLm9ial9jYXRlZ29yeSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IHN0eWxlLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLmZpZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheWxpc3QgJyArIGl0ZW0ub2JqX2NhdGVnb3J5XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcXFxuICAgICAgICB9KTtcXFxcbiAgICB9KTtcXFxcbn0gY2F0Y2ggKGUpIHtcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogZS5tZXNzYWdlLFxcXFxuICAgICAgICB1cmw6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XCJwYXRoXFxcIjpcXFwidG9vbFxcXCIsXFxcInJ1bGVcXFwiOlxcXCJqczpcXFxcblxcXFxuJC5leHBvcnRzPXtcXFxcbiAgICBpc0xvZ2luQ29va2llKGNvb2tpZSl7XFxcXG4gICAgICAgIHJldHVybiAhIShjb29raWUgJiYgY29va2llLmluY2x1ZGVzKFxcXFxcXFwiX1VQX0Y3RV84RF89XFxcXFxcXCIpICYmIGNvb2tpZS5pbmNsdWRlcyhcXFxcXFxcIl9fdWlkPVxcXFxcXFwiKSAmJiBjb29raWUuaW5jbHVkZXMoXFxcXFxcXCJfX3B1dXM9XFxcXFxcXCIpKTtcXFxcbiAgICB9XFxcXG59O1xcXCJ9XVwiLFwicHJveHlcIjpcIlwifSIsInRpdGxlIjoiW+adgOS6uuiAheeahOmavuWgql0ifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement