xiaomianao666

插件名:global

Jul 20th, 2023
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDmtbfop5LnpL7ljLrkuIrovaYKLy8gQG5hbWVzcGFjZSAgICBodHRwOi8vdGFtcGVybW9ua2V5Lm5ldC8KLy8gQHZlcnNpb24gICAgICAwLjQxCi8vIEBkZXNjcmlwdGlvbiAg5rW36KeS56S+5Yy66KeG6aKRL+WbvueJhy/lsIHnpoHnlKjmiLfkuLvpobXop6PmnpAKLy8gQGF1dGhvciAgICAgICBoamhqaGoKLy8gQGxpY2Vuc2UgICAgICBNSVQKLy8gQG1hdGNoICAgICAgICAqOi8vKi5oYWlqaWFvLmNvbS8qCi8vIEBpbmNsdWRlICAgICAgICAqOi8vaGoqLmNvbS8qCi8vIEBpbmNsdWRlICAgICAgICAqOi8vaGoqLnRvcC8qCi8vIEBtYXRjaCAgICAgICAgKjovLyovcG9zdC9kZXRhaWxzKgovLyBAbWF0Y2ggICAgICAgICo6Ly8qL2hvbWVwYWdlKgovLyBAaWNvbiAgICAgICAgIGh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vczIvZmF2aWNvbnM/c3o9NjQmZG9tYWluPWJpbmcuY29tCi8vIEBydW4tYXQgICAgICBkb2N1bWVudC1zdGFydAovLyBAZ3JhbnQgICAgICAgdW5zYWZlV2luZG93Ci8vIEBncmFudCAgICAgICAgR01feG1saHR0cFJlcXVlc3QKLy8gQGNvbm5lY3QgICAgICAqCi8vID09L1VzZXJTY3JpcHQ9PQooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIGZ1bmN0aW9uIGRlY29kZShzKSB7CiAgICAgICAgcmV0dXJuIGF0b2IoYXRvYihhdG9iKHMpKSk7CiAgICB9CgogICAgZnVuY3Rpb24gZW5jb2RlKHMpIHsKICAgICAgICByZXR1cm4gYnRvYShidG9hKGJ0b2EocykpKTsKICAgIH0KCiAgICBmdW5jdGlvbiBqZW5jb2RlKHMpIHsKICAgICAgICByZXR1cm4gZW5jb2RlKEpTT04uc3RyaW5naWZ5KHMsIGB1dGYtOGApKTsKICAgIH0KCiAgICBmdW5jdGlvbiBnZXRfcmVhbF9tM3U4X3BhdGgodXJsKSB7CiAgICAgICAgdmFyIHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKICAgICAgICByZXF1ZXN0Lm9wZW4oJ0dFVCcsIHVybCwgZmFsc2UpOwogICAgICAgIHJlcXVlc3Quc2VuZChudWxsKTsKICAgICAgICBpZiAocmVxdWVzdC5zdGF0dXMgIT09IDIwMCkgewogICAgICAgICAgICBjb25zb2xlLmxvZyhg6Kej5p6Q5aSx6LSlIWApOwogICAgICAgICAgICByZXR1cm4gdXJsOwogICAgICAgIH0KICAgICAgICBsZXQgdHNfcGF0aCA9IHJlcXVlc3QucmVzcG9uc2VUZXh0LnNwbGl0KCdcbicpWzZdOwogICAgICAgIGxldCBpZCA9IHRzX3BhdGgubWF0Y2goLyhbXHdfXStfPylbXGRdKy50cy8pWzFdOwogICAgICAgIGxldCBydXJsID0gdXJsLnJlcGxhY2UoLyhbXHdfXSspLm0zdTgvLCBgJHtpZH0ubTN1OGApOwogICAgICAgIHJldHVybiBydXJsOwogICAgfQoKICAgIGZ1bmN0aW9uIGdldF91c2VyX2RpY3QoaG9zdCwgaWQpIHsKICAgICAgICB2YXIgdXJsID0gYGh0dHBzOi8vJHtob3N0fS5jb20vYXBpL3RvcGljL25vZGUvdG9waWNzP3BhZ2U9MSZ1c2VySWQ9JHtpZH0mdHlwZT0wYDsKICAgICAgICB2YXIgcmVxdWVzdCA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpOwogICAgICAgIHJlcXVlc3Qub3BlbignR0VUJywgdXJsLCBmYWxzZSk7CiAgICAgICAgcmVxdWVzdC5zZW5kKG51bGwpOwogICAgICAgIGlmIChyZXF1ZXN0LnN0YXR1cyAhPT0gMjAwKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKGDnlKjmiLfkv6Hmga/op6PmnpDlpLHotKUhYCk7CiAgICAgICAgICAgIHJldHVybiB7fTsKICAgICAgICB9CiAgICAgICAgbGV0IHAgPSBKU09OLnBhcnNlKHJlcXVlc3QucmVzcG9uc2VUZXh0LCBgdXRmLThgKS5kYXRhOwogICAgICAgIHAgPSBKU09OLnBhcnNlKGRlY29kZShwKSwgYHV0Zi04YCk7CiAgICAgICAgbGV0IHRvdGFsID0gcC5wYWdlLnRvdGFsOwogICAgICAgIGxldCB1aWQgPSBgW2Jhbm5lZF1gOwogICAgICAgIGlmIChgcmVzdWx0c2AgaW4gcCkgewogICAgICAgICAgICB1aWQgPSBwLnJlc3VsdHNbMF0udXNlci5uaWNrbmFtZSArIGAgYCArIHVpZDsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgJ2lzRmF2b3JpdGUnOiBmYWxzZSwKICAgICAgICAgICAgJ2xpa2VDb3VudCc6IDEyLAogICAgICAgICAgICAndXNlcic6IHsKICAgICAgICAgICAgICAgICdpZCc6IHBhcnNlSW50KGlkKSwKICAgICAgICAgICAgICAgICduaWNrbmFtZSc6IHVpZCwKICAgICAgICAgICAgICAgICdhdmF0YXInOiAnMjknLAogICAgICAgICAgICAgICAgJ2Rlc2NyaXB0aW9uJzogYGhqIGNvbW11bml0eWAsCiAgICAgICAgICAgICAgICAndG9waWNDb3VudCc6IHRvdGFsLAogICAgICAgICAgICAgICAgJ3ZpZGVvQ291bnQnOiAwLAogICAgICAgICAgICAgICAgJ2NvbW1lbnRDb3VudCc6IDMwMywKICAgICAgICAgICAgICAgICdmYW5zQ291bnQnOiA1NywKICAgICAgICAgICAgICAgICdmYXZvcml0ZUNvdW50JzogMzksCiAgICAgICAgICAgICAgICAnc3RhdHVzJzogMCwKICAgICAgICAgICAgICAgICdzZXgnOiAxLAogICAgICAgICAgICAgICAgJ3ZpcCc6IDAsCiAgICAgICAgICAgICAgICAndmlwRXhwaXJlc1RpbWUnOiAnMDAwMS0wMS0wMSAwMDowMDowMCcsCiAgICAgICAgICAgICAgICAnY2VydGlmaWVkJzogZmFsc2UsCiAgICAgICAgICAgICAgICAnY2VydFZpZGVvJzogZmFsc2UsCiAgICAgICAgICAgICAgICAnY2VydFByb2Zlc3Nvcic6IGZhbHNlLAogICAgICAgICAgICAgICAgJ2ZhbW91cyc6IGZhbHNlLAogICAgICAgICAgICAgICAgJ2ZvcmJpZGRlbic6IGZhbHNlLAogICAgICAgICAgICAgICAgJ3RhZ3MnOiBudWxsLAogICAgICAgICAgICAgICAgJ3JvbGUnOiAwLAogICAgICAgICAgICAgICAgJ3BvcHVsYXJpdHknOiAxMCwKICAgICAgICAgICAgICAgICdkaWFtb25kQ29uc3VtZSc6IDAsCiAgICAgICAgICAgICAgICAndGl0bGUnOiB7ICdpZCc6IDAsICduYW1lJzogJycsICdjb25zdW1lJzogMCwgJ2NvbnN1bWVFbmQnOiAwLCAnaWNvbic6ICcnIH0sCiAgICAgICAgICAgICAgICAnZnJpZW5kU3RhdHVzJzogZmFsc2UsCiAgICAgICAgICAgICAgICAndm9pY2VTdGF0dXMnOiBmYWxzZSwKICAgICAgICAgICAgICAgICd2aWRlb1N0YXR1cyc6IGZhbHNlLAogICAgICAgICAgICAgICAgJ3ZvaWNlTW9uZXlUeXBlJzogMCwKICAgICAgICAgICAgICAgICd2b2ljZUFtb3VudCc6IDAsCiAgICAgICAgICAgICAgICAndmlkZW9Nb25leVR5cGUnOiAwLAogICAgICAgICAgICAgICAgJ3ZpZGVvQW1vdW50JzogMCwKICAgICAgICAgICAgICAgICdkZXBvc2l0TW9uZXknOiAwCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgZnVuY3Rpb24gcmVtb3ZlX3ZpcChib2R5KSB7CiAgICAgICAgYm9keS5ub2RlLnZpcExpbWl0ID0gMDsKICAgICAgICBsZXQgYXR0YWNobWVudHMgPSBib2R5LmF0dGFjaG1lbnRzOwogICAgICAgIGxldCBpbWFnZV91cmxzID0gW107CiAgICAgICAgbGV0IHZpZGVvX3VybHMgPSBgYDsKICAgICAgICBsZXQgaGFzX3ZpZGVvID0gLTE7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhdHRhY2htZW50cy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB2YXIgYXR0YSA9IGF0dGFjaG1lbnRzW2ldOwogICAgICAgICAgICBpZiAoYXR0YS5jYXRlZ29yeSA9PT0gJ2ltYWdlcycpIHsKICAgICAgICAgICAgICAgIGltYWdlX3VybHMucHVzaChgPGltZyBzcmM9IiR7YXR0YS5yZW1vdGVVcmx9IiBkYXRhLWlkPSIke2F0dGEuaWR9Ii8+YCkKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoYXR0YS5jYXRlZ29yeSA9PT0gJ3ZpZGVvJykgewogICAgICAgICAgICAgICAgaGFzX3ZpZGVvID0gaTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBsZXQgaW1hZ2VzID0gaW1hZ2VfdXJscy5qb2luKCk7CiAgICAgICAgaWYgKGhhc192aWRlbyA+PSAwKSB7CiAgICAgICAgICAgIGxldCBbbmJvZHksIHZdID0gcmVwbGFjZV9tM3U4KGJvZHksIGhhc192aWRlbyk7CiAgICAgICAgICAgIGJvZHkgPSBuYm9keTsKICAgICAgICAgICAgdmlkZW9fdXJscyA9IGA8dmlkZW8gc3JjPSIke3YucmVtb3RlVXJsfSIgZGF0YS1pZD0iJHt2LmlkfSIvPjwvdmlkZW8+YAogICAgICAgIH0KICAgICAgICBsZXQgY29udGVudCA9IGJvZHkuY29udGVudC5yZXBsYWNlKC9cW1vlm77niYfop4bpopFdK1xdPy8sIGBgKTsKICAgICAgICBjb250ZW50ID0gYm9keS5jb250ZW50LnJlcGxhY2UoL+atpOWkhOWGheWuueWUruS7ty4qP+aCqOi/mOayoeaciei0reS5sO+8jOivt+i0reS5sOWQjuafpeeci++8gS8sIGBgKTsKICAgICAgICBjb250ZW50ID0gJzxodG1sPjxoZWFkPjwvaGVhZD48Ym9keT4nICsgY29udGVudCArICc8YnIvPicgKyBpbWFnZXMgKyAnPGJyLz4nICsgdmlkZW9fdXJscyArICc8YnIvPjwvYm9keT48L2h0bWw+JzsKICAgICAgICBib2R5LmNvbnRlbnQgPSBjb250ZW50OwogICAgICAgIHJldHVybiBib2R5OwogICAgfQoKICAgIGZ1bmN0aW9uIHJlcGxhY2VfbTN1OChib2R5LCBoYXNfdmlkZW8pIHsKICAgICAgICBsZXQgYXR0YWNobWVudHMgPSBib2R5LmF0dGFjaG1lbnRzOwogICAgICAgIGxldCB2aWR4ID0gaGFzX3ZpZGVvOwogICAgICAgIGlmICh2aWR4IDwgMCkgewogICAgICAgICAgICByZXR1cm4gW2JvZHksIHVuZGVmaW5lZF07CiAgICAgICAgfQogICAgICAgIGlmIChib2R5LnNhbGUgPT09IG51bGwgfHwgYm9keS5zYWxlLm1vbmV5X3R5cGUgPT0gMCkgewogICAgICAgICAgICByZXR1cm4gW2JvZHksIGF0dGFjaG1lbnRzW3ZpZHhdXTsKICAgICAgICB9CiAgICAgICAgbGV0IHVybCA9IGF0dGFjaG1lbnRzW3ZpZHhdLnJlbW90ZVVybDsKICAgICAgICBsZXQgbTN1OF9wYXRoID0gZ2V0X3JlYWxfbTN1OF9wYXRoKHVybCk7CiAgICAgICAgaWYgKG0zdThfcGF0aCA9PT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgIGNvbnNvbGUubG9nKCfop4bpopHpk77mjqXojrflj5blpLHotKUhJyk7CiAgICAgICAgICAgIHJldHVybiBbYm9keSwgYm9keS5hdHRhY2htZW50c1t2aWR4XV07CiAgICAgICAgfQogICAgICAgIGJvZHkuYXR0YWNobWVudHNbdmlkeF0ucmVtb3RlVXJsID0gbTN1OF9wYXRoOwogICAgICAgIHJldHVybiBbYm9keSwgYm9keS5hdHRhY2htZW50c1t2aWR4XV07CiAgICB9CgogICAgZnVuY3Rpb24gcmVwbGFjZV9leGlzdF9pbWcoYm9keSkgewogICAgICAgIGxldCBjb250ZW50ID0gYm9keS5jb250ZW50OwogICAgICAgIGxldCBhdHRhY2htZW50cyA9IGJvZHkuYXR0YWNobWVudHM7CiAgICAgICAgbGV0IGFsbF9pbWcgPSB7fTsKICAgICAgICBsZXQgaGFzX3ZpZGVvID0gLTE7CiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBhdHRhY2htZW50cy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICB2YXIgYXR0YSA9IGF0dGFjaG1lbnRzW2ldOwogICAgICAgICAgICBpZiAoYXR0YS5jYXRlZ29yeSA9PT0gJ2ltYWdlcycpIHsKICAgICAgICAgICAgICAgIGFsbF9pbWdbYXR0YS5pZF0gPSBhdHRhLnJlbW90ZVVybDsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoYXR0YS5jYXRlZ29yeSA9PT0gJ3ZpZGVvJykgewogICAgICAgICAgICAgICAgaGFzX3ZpZGVvID0gaTsKICAgICAgICAgICAgICAgIHJldHVybiBbYm9keSwgdW5kZWZpbmVkLCBoYXNfdmlkZW9dOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGxldCByZV9pbWcgPSAvPGltZyBzcmM9XCJodHRwczpcL1wvW1x3XC5cL10rP1wvaW1hZ2VzXC8uKj9cIiBkYXRhLWlkPVwiKFxkKylcIi4qP1wvPi9nOwogICAgICAgIGZvciAobGV0IGUgb2YgY29udGVudC5tYXRjaEFsbChyZV9pbWcpKSB7CiAgICAgICAgICAgIGxldCBpZCA9IHBhcnNlSW50KGVbMV0pOwogICAgICAgICAgICBpZiAoaWQgaW4gYWxsX2ltZykgewogICAgICAgICAgICAgICAgLy8gbGV0IG5zcmMgPSBhbGxfaW1nW2lkXTsKICAgICAgICAgICAgICAgIC8vIGxldCBzcmMgPSBuZXcgUmVnRXhwKGAoPGltZyBzcmM9XCIpaHR0cHM6XC9cL1tcXHdcLlwvXSs/XC9pbWFnZXNcLy4qP1woIiBkYXRhLWlkPVwiJHtpZH1cIi4qP1wvPilgLCAnZycpOwogICAgICAgICAgICAgICAgLy8gY29udGVudCA9IGNvbnRlbnQucmVwbGFjZShzcmMsIGAkMSR7bnNyY30kMmApOwogICAgICAgICAgICAgICAgZGVsZXRlIGFsbF9pbWdbaWRdOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGJvZHkuY29udGVudCA9IGNvbnRlbnQ7CiAgICAgICAgcmV0dXJuIFtib2R5LCBhbGxfaW1nLCBoYXNfdmlkZW9dOwogICAgfQoKICAgIGZ1bmN0aW9uIG1vZGlmeV9kYXRhKGRhdGEpIHsKICAgICAgICBsZXQgYm9keSA9IEpTT04ucGFyc2UoZGVjb2RlKGRhdGEpKTsKICAgICAgICBpZiAoYm9keS5ub2RlLnZpcExpbWl0ICE9IDApIHsKICAgICAgICAgICAgYm9keSA9IHJlbW92ZV92aXAoYm9keSk7CiAgICAgICAgICAgIHJldHVybiBqZW5jb2RlKGJvZHkpOwogICAgICAgIH0KICAgICAgICBsZXQgW25ib2R5LCByZXN0X2ltZywgaGFzX3ZpZGVvXSA9IHJlcGxhY2VfZXhpc3RfaW1nKGJvZHkpOwogICAgICAgIGJvZHkgPSBuYm9keTsKICAgICAgICAvLyDlt7LotK3kubDnmoTluJblrZAKICAgICAgICBpZiAoYm9keS5jb250ZW50LmluY2x1ZGVzKGBbL3NlbGxdYCkpIHsKICAgICAgICAgICAgcmV0dXJuIGplbmNvZGUoYm9keSk7CiAgICAgICAgfQogICAgICAgIGlmICgnc2FsZScgaW4gYm9keSAmJiBib2R5LnNhbGUgIT09IG51bGwpIHsKICAgICAgICAgICAgYm9keS5zYWxlLmlzX2J1eSA9IHRydWU7CiAgICAgICAgICAgIGJvZHkuc2FsZS5idXlfaW5kZXggPSBwYXJzZUludChNYXRoLnJhbmRvbSgpICogKDUwMDAgLSAxMDAwICsgMSkgKyAxMDAwLCAxMCk7CiAgICAgICAgfQogICAgICAgIGlmIChoYXNfdmlkZW8gPj0gMCkgewogICAgICAgICAgICBsZXQgW25ib2R5LCB2XSA9IHJlcGxhY2VfbTN1OChib2R5LCBoYXNfdmlkZW8pOwogICAgICAgICAgICByZXR1cm4gamVuY29kZShuYm9keSk7CiAgICAgICAgfQogICAgICAgIGxldCBpbWdfZWxlbWVudHMgPSBbXQogICAgICAgIGZvciAoY29uc3QgW2lkLCBzcmNdIG9mIE9iamVjdC5lbnRyaWVzKHJlc3RfaW1nKSkgewogICAgICAgICAgICBpbWdfZWxlbWVudHMucHVzaChgPGltZyBzcmM9IiR7c3JjfSIgZGF0YS1pZD0iJHtpZH0iLz5gKTsKICAgICAgICB9CiAgICAgICAgbGV0IHNlbGxlZF9pbWcgPSBgW3NlbGxdYCArIGltZ19lbGVtZW50cy5qb2luKCkgKyBgWy9zZWxsXWA7CiAgICAgICAgbGV0IG5jb250ZW50ID0gYm9keS5jb250ZW50LnJlcGxhY2UoLzxzcGFuIGNsYXNzPVwic2VsbC1idG5cIi4qPFwvc3Bhbj4vLCBzZWxsZWRfaW1nKTsKICAgICAgICBib2R5LmNvbnRlbnQgPSBuY29udGVudDsKICAgICAgICByZXR1cm4gamVuY29kZShib2R5KTsKICAgIH0KCiAgICBmdW5jdGlvbiBtb2RpZnlfdXNlcihkYXRhLCBob3N0LCBpZCkgewogICAgICAgIGlmIChkYXRhLmVycm9yQ29kZSA9PT0gMCkgewogICAgICAgICAgICByZXR1cm4gZGF0YTsKICAgICAgICB9CiAgICAgICAgZGF0YS5pc0VuY3J5cHRlZCA9IHRydWU7CiAgICAgICAgZGF0YS5lcnJvckNvZGUgPSAwOwogICAgICAgIGRhdGEuc3VjY2VzcyA9IHRydWU7CiAgICAgICAgZGF0YS5tZXNzYWdlID0gIiI7CiAgICAgICAgbGV0IHVkaWN0ID0gZ2V0X3VzZXJfZGljdChob3N0LCBpZCk7CiAgICAgICAgZGF0YS5kYXRhID0gamVuY29kZSh1ZGljdCkKICAgICAgICByZXR1cm4gZGF0YQogICAgfQoKICAgIGNvbnN0IG9yaWdpbk9wZW4gPSBYTUxIdHRwUmVxdWVzdC5wcm90b3R5cGUub3BlbjsKICAgIGNvbnN0IHJlX3RvcGljID0gL1wvYXBpXC90b3BpY1wvXGQrLzsKICAgIGNvbnN0IHJlX3VzZXIgPSAvXC9hcGlcL3VzZXJcL2luZm9cL1xkKy87CgogICAgWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLm9wZW4gPSBmdW5jdGlvbiAoXywgdXJsKSB7CiAgICAgICAgLy8g5oum5oiqdG9waWMKICAgICAgICBpZiAocmVfdG9waWMudGVzdCh1cmwpKSB7CiAgICAgICAgICAgIGNvbnN0IHhociA9IHRoaXM7CiAgICAgICAgICAgIGNvbnN0IGdldHRlciA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoCiAgICAgICAgICAgICAgICBYTUxIdHRwUmVxdWVzdC5wcm90b3R5cGUsCiAgICAgICAgICAgICAgICAicmVzcG9uc2UiCiAgICAgICAgICAgICkuZ2V0OwogICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoeGhyLCAicmVzcG9uc2VUZXh0IiwgewogICAgICAgICAgICAgICAgZ2V0OiAoKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IGdldHRlci5jYWxsKHhocik7CiAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcyA9IEpTT04ucGFyc2UocmVzdWx0LCBgdXRmLThgKTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8g6L+Z6YeM5L+u5pS5ZGF0YQogICAgICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IG1vZGlmeV9kYXRhKHJlcy5kYXRhKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocmVzLCBgdXRmLThgKTsKICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflj5HnlJ/lvILluLghIOino+aekOWksei0pSEnKTsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CiAgICAgICAgfSBlbHNlIGlmIChyZV91c2VyLnRlc3QodXJsKSkgewogICAgICAgICAgICBjb25zdCB4aHIgPSB0aGlzOwogICAgICAgICAgICBjb25zdCBnZXR0ZXIgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKAogICAgICAgICAgICAgICAgWE1MSHR0cFJlcXVlc3QucHJvdG90eXBlLAogICAgICAgICAgICAgICAgInJlc3BvbnNlIgogICAgICAgICAgICApLmdldDsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHhociwgInJlc3BvbnNlVGV4dCIsIHsKICAgICAgICAgICAgICAgIGdldDogKCkgPT4gewogICAgICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSBnZXR0ZXIuY2FsbCh4aHIpOwogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXMgPSBKU09OLnBhcnNlKHJlc3VsdCwgYHV0Zi04YCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmdXJsID0geGhyLnJlc3BvbnNlVVJMOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgciA9IGZ1cmwubWF0Y2goL1xXKihcdyspXC5jb21cL2FwaVwvdXNlclwvaW5mb1wvKFxkKykvKTsKICAgICAgICAgICAgICAgICAgICAgICAgLy8g6L+Z6YeM5L+u5pS5ZGF0YQogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IG1vZGlmeV91c2VyKHJlcywgclsxXSwgclsyXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShkYXRhLCBgdXRmLThgKTsKICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKCflj5HnlJ/lvILluLghIOino+aekOWksei0pSEnKTsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZSk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIG9yaWdpbk9wZW4uYXBwbHkodGhpcywgYXJndW1lbnRzKTsKICAgIH07CgogICAgbGV0IGNsaWNrZWRfZmxhZyA9IGZhbHNlOwogICAgCiAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCJET01Ob2RlSW5zZXJ0ZWQiLCBmdW5jdGlvbiAoZXZlbnQpIHsKICAgICAgICBpZiAoIWNsaWNrZWRfZmxhZykgewogICAgICAgICAgICBmb3IgKGNvbnN0IGVsZW1lbnQgb2YgZG9jdW1lbnQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgnZWwtbWVzc2FnZS1ib3gnKSkgewogICAgICAgICAgICAgICAgaWYgKGVsZW1lbnQuaW5uZXJUZXh0LmluZGV4T2YoJ+S7pOeJjOW3sui/h+acnycpID4gLTEpIHsKICAgICAgICAgICAgICAgICAgICBjbGlja2VkX2ZsYWcgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgIGxldCBlID0gZWxlbWVudC5xdWVyeVNlbGVjdG9yKCJkaXYuZWwtbWVzc2FnZS1ib3hfX2hlYWRlciA+IGJ1dHRvbiIpOwogICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoKGUpID0+IHsgZS5jbGljaygpOyB9LCAxMDAsIGUpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmIChldmVudC5yZWxhdGVkTm9kZS5nZXRBdHRyaWJ1dGUoJ2lkJykgPT09ICd0aWRpby1jaGF0JykgewogICAgICAgICAgICB2YXIgZWxlcyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCcqJyk7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgZWxlc1tpXS5zdHlsZS51c2VyU2VsZWN0ID0gJ3RleHQnOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSwgZmFsc2UpOwoKfSkoKTs=
Add Comment
Please, Sign In to add comment