Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_全网VIP视频免费破解【专注一个脚本只做一件事件】@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICAgICAgIOWFqOe9kVZJUOinhumikeWFjei0ueegtOino+OAkOS4k+azqOS4gOS4quiEmuacrOWPquWBmuS4gOS7tuS6i+S7tuOAkQovLyBAbmFtZXNwYWNlICAgICAgICAgaHR0cDovL3RhbXBlcm1vbmtleS5uZXQvCi8vIEB2ZXJzaW9uICAgICAgICAgICAxLjYuNgovLyBAZGVzY3JpcHRpb24gICAgICAg5YWo572RVklQ6KeG6aKR5YWN6LS556C06Kej44CQ5LiT5rOo5LiA5Liq6ISa5pys5Y+q5YGa5LiA5Lu25LqL5Lu244CR44CC5pSv5oyB77ya6IW+6K6v44CB54ix5aWH6Im644CB5LyY6YW344CB6IqS5p6c44CBcHB0duOAgeS5kOinhuetieWFtuWug+e9keerme+8mwovLyBAaWNvbiAgICAgICAgICAgICAgZGF0YTppbWFnZS9qcGVnO2Jhc2U2NCwvOWovNEFBUVNrWkpSZ0FCQVFFQWtBQ1FBQUQvL2dBVVUyOW1kSGRoY21VNklGTnVhWEJoYzNSbC85c0FRd0FEQWdJREFnSURBd01EQkFNREJBVUlCUVVFQkFVS0J3Y0dDQXdLREF3TENnc0xEUTRTRUEwT0VRNExDeEFXRUJFVEZCVVZGUXdQRnhnV0ZCZ1NGQlVVLzlzQVF3RURCQVFGQkFVSkJRVUpGQTBMRFJRVUZCUVVGQlFVRkJRVUZCUVVGQlFVRkJRVUZCUVVGQlFVRkJRVUZCUVVGQlFVRkJRVUZCUVVGQlFVRkJRVUZCUVUvOEFBRVFnQUdnQWVBd0VpQUFJUkFRTVJBZi9FQUI4QUFBRUZBUUVCQVFFQkFBQUFBQUFBQUFBQkFnTUVCUVlIQ0FrS0MvL0VBTFVRQUFJQkF3TUNCQU1GQlFRRUFBQUJmUU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uY29tLyoKLy8gQG1hdGNoICAgICAgICAgICAgICo6Ly8qLmJpbGliaWxpLmNvbS8qCi8vIEBtYXRjaCAgICAgICAgICAgICAqOi8vKi5wcHR2LmNvbS8qCgovLyBAcmVxdWlyZSAgICAgICAgICAgaHR0cHM6Ly9jZG4uYm9vdGNkbi5uZXQvYWpheC9saWJzL2pxdWVyeS8zLjIuMS9qcXVlcnkubWluLmpzCi8vIEBjb25uZWN0ICAgICAgICAgICBhcGkuYmlsaWJpbGkuY29tCi8vIEBncmFudCAgICAgICAgICAgICB1bnNhZmVXaW5kb3cKLy8gQGdyYW50ICAgICAgICAgICAgIEdNX2FkZFN0eWxlCi8vIEBncmFudCAgICAgICAgICAgICBHTV9vcGVuSW5UYWIKLy8gQGdyYW50ICAgICAgICAgICAgIEdNX2dldFZhbHVlCi8vIEBncmFudCAgICAgICAgICAgICBHTV9zZXRWYWx1ZQovLyBAZ3JhbnQgICAgICAgICAgICAgR01feG1saHR0cFJlcXVlc3QKLy8gQGdyYW50ICAgICAgICAgICAgIEdNX2xvZwovLyBAY2hhcnNldAkJICAgICAgVVRGLTgKLy8gQGxpY2Vuc2UgICAgICAgICAgIEdQTCBMaWNlbnNlCi8vID09L1VzZXJTY3JpcHQ9PQoKY29uc3QgdXRpbCA9IChmdW5jdGlvbiAoKSB7CgogICAgZnVuY3Rpb24gZmluZFRhcmdldEVsZW1lbnQodGFyZ2V0Q29udGFpbmVyKSB7CiAgICAgICAgY29uc3QgYm9keSA9IHdpbmRvdy5kb2N1bWVudDsKICAgICAgICBsZXQgdGFiQ29udGFpbmVyOwogICAgICAgIGxldCB0cnlUaW1lID0gMDsKICAgICAgICBjb25zdCBtYXhUcnlUaW1lID0gMTIwOwogICAgICAgIGxldCBzdGFydFRpbWVzdGFtcDsKICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gewogICAgICAgICAgICBmdW5jdGlvbiB0cnlGaW5kRWxlbWVudCh0aW1lc3RhbXApIHsKICAgICAgICAgICAgICAgIGlmICghc3RhcnRUaW1lc3RhbXApIHsKICAgICAgICAgICAgICAgICAgICBzdGFydFRpbWVzdGFtcCA9IHRpbWVzdGFtcDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNvbnN0IGVsYXBzZWRUaW1lID0gdGltZXN0YW1wIC0gc3RhcnRUaW1lc3RhbXA7CgogICAgICAgICAgICAgICAgaWYgKGVsYXBzZWRUaW1lID49IDUwMCkgewogICAgICAgICAgICAgICAgICAgIEdNX2xvZygi5p+l5om+5YWD57Sg77yaIiArIHRhcmdldENvbnRhaW5lciArICLvvIznrKwiICsgdHJ5VGltZSArICLmrKEiKTsKICAgICAgICAgICAgICAgICAgICB0YWJDb250YWluZXIgPSBib2R5LnF1ZXJ5U2VsZWN0b3IodGFyZ2V0Q29udGFpbmVyKTsKICAgICAgICAgICAgICAgICAgICBpZiAodGFiQ29udGFpbmVyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUodGFiQ29udGFpbmVyKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCsrdHJ5VGltZSA9PT0gbWF4VHJ5VGltZSkgewogICAgICAgICAgICAgICAgICAgICAgICByZWplY3QoKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBzdGFydFRpbWVzdGFtcCA9IHRpbWVzdGFtcDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoIXRhYkNvbnRhaW5lciAmJiB0cnlUaW1lIDwgbWF4VHJ5VGltZSkgewogICAgICAgICAgICAgICAgICAgIHJlcXVlc3RBbmltYXRpb25GcmFtZSh0cnlGaW5kRWxlbWVudCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHJlcXVlc3RBbmltYXRpb25GcmFtZSh0cnlGaW5kRWxlbWVudCk7CiAgICAgICAgfSk7CiAgICB9CgogICAgZnVuY3Rpb24gdXJsQ2hhbmdlUmVsb2FkKCkgewogICAgICAgIGNvbnN0IG9sZEhyZWYgPSB3aW5kb3cubG9jYXRpb24uaHJlZjsKICAgICAgICBsZXQgaW50ZXJ2YWwgPSBzZXRJbnRlcnZhbCgoKSA9PiB7CiAgICAgICAgICAgIGxldCBuZXdIcmVmID0gd2luZG93LmxvY2F0aW9uLmhyZWY7CiAgICAgICAgICAgIGlmIChvbGRIcmVmICE9PSBuZXdIcmVmKSB7CiAgICAgICAgICAgICAgICBjbGVhckludGVydmFsKGludGVydmFsKTsKICAgICAgICAgICAgICAgIHdpbmRvdy5sb2NhdGlvbi5yZWxvYWQoKTsKICAgICAgICAgICAgfQogICAgICAgIH0sIDUwMCk7CiAgICB9CgogICAgZnVuY3Rpb24gcmVvbXZlVmlkZW8oKSB7CiAgICAgICAgc2V0SW50ZXJ2YWwoKCkgPT4gewogICAgICAgICAgICBmb3IgKGxldCB2aWRlbyBvZiBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgidmlkZW8iKSkgewogICAgICAgICAgICAgICAgaWYgKHZpZGVvLnNyYykgewogICAgICAgICAgICAgICAgICAgIHZpZGVvLnJlbW92ZUF0dHJpYnV0ZSgic3JjIik7CiAgICAgICAgICAgICAgICAgICAgdmlkZW8ubXV0ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgIHZpZGVvLmxvYWQoKTsKICAgICAgICAgICAgICAgICAgICB2aWRlby5wYXVzZSgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSwgNTAwKTsKICAgIH0KCiAgICBmdW5jdGlvbiBzeW5jUmVxdWVzdChvcHRpb24pIHsKICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4gewogICAgICAgICAgICBvcHRpb24ub25sb2FkID0gKHJlcykgPT4gewogICAgICAgICAgICAgICAgcmVzb2x2ZShyZXMpOwogICAgICAgICAgICB9OwogICAgICAgICAgICBvcHRpb24ub25lcnJvciA9IChlcnIpID0+IHsKICAgICAgICAgICAgICAgIHJlamVjdChlcnIpOwogICAgICAgICAgICB9OwogICAgICAgICAgICBHTV94bWxodHRwUmVxdWVzdChvcHRpb24pOwogICAgICAgIH0pOwogICAgfQoKICAgIHJldHVybiB7CiAgICAgICAgcmVxOiAob3B0aW9uKSA9PiBzeW5jUmVxdWVzdChvcHRpb24pLAogICAgICAgIGZpbmRUYXJnZXRFbGU6ICh0YXJnZXRFbGUpID0+IGZpbmRUYXJnZXRFbGVtZW50KHRhcmdldEVsZSksCiAgICAgICAgdXJsQ2hhbmdlUmVsb2FkOiAoKSA9PiB1cmxDaGFuZ2VSZWxvYWQoKSwKICAgICAgICByZW9tdmVWaWRlbzogKCkgPT4gcmVvbXZlVmlkZW8oKQogICAgfQp9KSgpOwoKCmNvbnN0IHN1cGVyVmlwID0gKGZ1bmN0aW9uICgpIHsKCiAgICBjb25zdCBfQ09ORklHXyA9IHsKICAgICAgICBpc01vYmlsZTogbmF2aWdhdG9yLnVzZXJBZ2VudC5tYXRjaCgvKEFuZHJvaWR8d2ViT1N8aVBob25lfGlQYWR8aVBvZHxCbGFja0JlcnJ5fElFTW9iaWxlfE9wZXJhIE1pbmkpL2kpLAogICAgICAgIGN1cnJlbnRQbGF5ZXJOb2RlOiBudWxsLAogICAgICAgIHZpcEJveElkOiAndmlwX2p4X2JveCcgKyBNYXRoLmNlaWwoTWF0aC5yYW5kb20oKSAqIDEwMDAwMDAwMCksCiAgICAgICAgZmxhZzogImZsYWdfdmlwIiwKICAgICAgICBhdXRvUGxheWVyS2V5OiAiYXV0b19wbGF5ZXJfa2V5IiArIHdpbmRvdy5sb2NhdGlvbi5ob3N0LAogICAgICAgIGF1dG9QbGF5ZXJWYWw6ICJhdXRvX3BsYXllcl92YWx1ZV8iICsgd2luZG93LmxvY2F0aW9uLmhvc3QsCiAgICAgICAgdmlkZW9QYXJzZUxpc3Q6IFsKICAgICAgICAgICAgeyJuYW1lIjogIue7vOWQiC9C56uZIiwgInR5cGUiOiAiMSwzIiwgInVybCI6ICJodHRwczovL2p4Lmpzb25wbGF5ZXIuY29tL3BsYXllci8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAiQ0siLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vd3d3LmNrcGxheWVyLnZpcC9qaWV4aS8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAiWVQiLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vangueWFuZ3R1LnRvcC8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAiUGxheWVyLUpZIiwgInR5cGUiOiAiMSwzIiwgInVybCI6ICJodHRwczovL2p4LnBsYXllcmp5LmNvbS8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAieXBhcnNlIiwgInR5cGUiOiAiMSwyIiwgInVybCI6ICJodHRwczovL2p4LnlwYXJzZS5jb20vaW5kZXgucGhwP3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjogIjgwOTAiLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vd3d3LjgwOTBnLmNuLz91cmw9In0sCiAgICAgICAgICAgIHsibmFtZSI6ICLliZblhYMiLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vd3d3LnBvdXl1bi5jb20vP3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjogIuiZvuexsyIsICJ0eXBlIjogIjEsMyIsICJ1cmwiOiAiaHR0cHM6Ly9qeC54bWZsdi5jb20vP3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjogIuWFqOawkSIsICJ0eXBlIjogIjEsMyIsICJ1cmwiOiAiaHR0cHM6Ly80My4yNDAuNzQuMTAyOjQ0MzM/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAiT0siLCAidHlwZSI6ICIxLDMiLCAidXJs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TciLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vY2ttb3YuY2N5ampkLmNvbS9ja21vdi8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAicWlhbnFpIiwgInR5cGUiOiAiMSwzIiwgInVybCI6ICJodHRwczovL2FwaS5xaWFucWkubmV0L3ZpcC8/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAibGFvYmFuZHEiLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vdmlwLmxhb2JhbmRxLmNvbS9qaWV4aS5waHA/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAicGxheW0zdTgiLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vd3d3LnBsYXltM3U4LmNuL2ppZXhpLnBocD91cmw9In0sCiAgICAgICAgICAgIHsibmFtZSI6ICLml6DlkI3lsI/nq5kiLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vd3d3LmFkbWluaXN0cmF0b3J3LmNvbS92aWRlby5waHA/dXJsPSJ9LAogICAgICAgICAgICB7Im5hbWUiOiAi55uY5Y+kIiwgInR5cGUiOiAiMSwzIiwgInVybCI6ICJodHRwczovL2dvLnloMDUyMy5jbi95LmN5P3VybD0ifSwKICAgICAgICAgICAgeyJuYW1lIjogIkJsYm8iLCAidHlwZSI6ICIxLDMiLCAidXJsIjogImh0dHBzOi8vanguYmxiby5jYzo0NDMzLz91cmw9In0sCiAgICAgICAgXSwKICAgICAgICBwbGF5ZXJDb250YWluZXJzOiBbCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGhvc3Q6ICJ2LnFxLmNvbSIsCiAgICAgICAgICAgICAgICBjb250YWluZXI6ICIjbW9kX3BsYXllciwjcGxheWVyLWNvbnRhaW5lciwuY29udGFpbmVyLXBsYXllciIsCiAgICAgICAgICAgICAgICBuYW1lOiAiRGVmYXVsdCIsCiAgICAgICAgICAgICAgICBkaXNwbGF5Tm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LWxheWVyIiwgImFbZG93bi1hcHAtYW5kcm9pZC11cmxdIiwgIltuYW1lPW0tZXh0ZW5kQmFyXSIsICJbY2xhc3MqPUNoYW5uZWxIb21lQmFubmVyXSIsICJzZWN0aW9uLm0taG90V29yZHMtYm90dG9tIl0KICAgICAgICAgICAgfSwKICAgICAgICAgICAge2hvc3Q6ICJ3d3cuaXEuY29tIiwgY29udGFpbmVyOiAiLmludGwtdmlkZW8td3JhcCIsIG5hbWU6ICJEZWZhdWx0IiwgZGlzcGxheU5vZGVzOiBbXX0sCiAgICAgICAgICAgIHtob3N0OiAidi55b3VrdS5jb20iLCBjb250YWluZXI6ICIjcGxheWVyIiwgbmFtZTogIkRlZmF1bHQiLCBkaXNwbGF5Tm9kZXM6IFsiI2lmcmFtYVdyYXBwZXIiLCAiI2NoZWNrb3V0X2NvdW50ZXJfbWFzayIsICIjY2hlY2tvdXRfY291bnRlcl9wb3B1cCJdfSwKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgaG9zdDogIm0ueW91a3UuY29tIiwKICAgICAgICAgICAgICAgIGNvbnRhaW5lcjogIiNwbGF5ZXIsLmg1LWRldGFpbC1wbGF5ZXIiLAogICAgICAgICAgICAgICAgbmFtZTogIkRlZmF1bHQiLAogICAgICAgICAgICAgICAgZGlzcGxheU5vZGVzOiBbIi5jYWxsRW5kX2JveCIsICIuaDUtZGV0YWlsLWd1aWRlIiwgIi5oNS1kZXRhaWwtdmlwLWd1aWRlIl0KICAgICAgICAgICAgfSwKICAgICAgICAgICAge2hvc3Q6ICJ0di5zb2h1LmNvbSIsIGNvbnRhaW5lcjogIiNwbGF5ZXIiLCBuYW1lOiAiRGVmYXVsdCIsIGRpc3BsYXlOb2RlczogW119LAogICAgICAgICAgICB7aG9zdDogImZpbG0uc29odS5jb20iLCBjb250YWluZXI6ICIjcGxheWVyV3JhcCIsIG5hbWU6ICJEZWZhdWx0IiwgZGlzcGxheU5vZGVzOiBbXX0sCiAgICAgICAgICAgIHtob3N0OiA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HsKICAgICAgICAgICAgdGhpcy5wYXJzZSA9ICgpID0+IHsKICAgICAgICAgICAgICAgIHV0aWwuZmluZFRhcmdldEVsZSgnYm9keScpCiAgICAgICAgICAgICAgICAgICAgLnRoZW4oKGNvbnRhaW5lcikgPT4gdGhpcy5wcmVIYW5kbGUoY29udGFpbmVyKSkKICAgICAgICAgICAgICAgICAgICAudGhlbigoY29udGFpbmVyKSA9PiB0aGlzLmdlbmVyYXRlRWxlbWVudChjb250YWluZXIpKQogICAgICAgICAgICAgICAgICAgIC50aGVuKChjb250YWluZXIpID0+IHRoaXMuYmluZEV2ZW50KGNvbnRhaW5lcikpCiAgICAgICAgICAgICAgICAgICAgLnRoZW4oKGNvbnRhaW5lcikgPT4gdGhpcy5hdXRvUGxheShjb250YWluZXIpKQogICAgICAgICAgICAgICAgICAgIC50aGVuKChjb250YWluZXIpID0+IHRoaXMucG9zdEhhbmRsZShjb250YWluZXIpKTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgcHJlSGFuZGxlKGNvbnRhaW5lcikgewogICAgICAgICAgICBfQ09ORklHXy5jdXJyZW50UGxheWVyTm9kZS5kaXNwbGF5Tm9kZXMuZm9yRWFjaCgoaXRlbSwgaW5kZXgpID0+IHsKICAgICAgICAgICAgICAgIHV0aWwuZmluZFRhcmdldEVsZShpdGVtKQogICAgICAgICAgICAgICAgICAgIC50aGVuKChvYmopID0+IG9iai5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnKQogICAgICAgICAgICAgICAgICAgIC5jYXRjaChlID0+IGNvbnNvbGUud2Fybigi5LiN5a2Y5Zyo5YWD57SgIiwgZSkpOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHJlc29sdmUoY29udGFpbmVyKSk7CiAgICAgICAgfQoKICAgICAgICBnZW5lcmF0ZUVsZW1lbnQoY29udGFpbmVyKSB7CiAgICAgICAgICAgIEdNX2Fk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mFwO3RleHQtb3ZlcmZsb3c6IGVsbGlwc2lzOy1vLXRleHQtb3ZlcmZsb3c6ZWxsaXBzaXM7fQogICAgICAgICAgICAgICAgICAgICAgICAjJHtfQ09ORklHXy52aXBCb3hJZH0gLnZpcF9saXN0IGxpOmhvdmVye2NvbG9yOiMxYzg0YzY7IGJvcmRlcjoxcHggc29saWQgIzFjODRjNjt9CiAgICAgICAgICAgICAgICAgICAgICAgICMke19DT05GSUdfLnZpcEJveElkfSAudmlwX2xpc3QgdWx7cGFkZGluZy1sZWZ0OiAxMHB4O30KICAgICAgICAgICAgICAgICAgICAgICAgIyR7X0NPTkZJR18udmlwQm94SWR9IC52aXBfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXJ7d2lkdGg6NXB4OyBoZWlnaHQ6MXB4O30KICAgICAgICAgICAgICAgICAgICAgICAgIyR7X0NPTkZJR18udmlwQm94SWR9IC52aXBfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWJ7Ym94LXNoYWRvdzppbnNldCAwIDAgNXB4IHJnYmEoMCwgMCwgMCwgMC4yKTsgYmFja2dyb3VuZDojQThBOEE4O30KICAgICAgICAgICAgICAgICAgICAgICAgIyR7X0NPTkZJR18udmlwQm94SWR9IC52aXBfbGlzdDo6LXdlYmtpdC1zY3JvbGxiYXItdHJhY2t7Ym94LXNoYWRvdzppbnNldCAwIDAgNXB4IHJnYmEoMCwgMCwgMCwgMC4yKTsgYmFja2dyb3VuZDojRjFGMUYxO30KICAgICAgICAgICAgICAgICAgICAgICAgIyR7X0NPTkZJR18udmlwQm94SWR9IGxpLnNlbGVjdGVke2NvbG9yOiMxYzg0YzY7IGJvcmRlcjoxcHggc29saWQgIzFjODRjNjt9CgkJCQkJCWApOwoKICAgICAgICAgICAgaWYgKF9DT05GSUdfLmlzTW9iaWxlKSB7CiAgICAgICAgICAgICAgICBHTV9hZGRTdHlsZShgCiAgICAgICAgICAgICAgICAgICAgIyR7X0NPTkZJR18udmlwQm94SWR9IHt0b3A6MzAwcHg7fQogICAgICAgICAgICAgICAgICAgICMke19DT05GSUdfLnZpcEJveElkfSAudmlwX2xpc3Qge3dpZHRoOjMwMHB4O30KICAgICAgICAgICAgICAgICAgICBgKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgbGV0IHR5cGVfMV9zdHIgPSAiIjsKICAgICAgICAgICAgbGV0IHR5cGVfMl9zdHIgPSAiIjsKICAgICAgICAgICAgbGV0IHR5cGVfM19zdHIgPSAiIjsKICAgICAgICAgICAgX0NPTkZJR18udmlkZW9QYXJzZUxpc3QuZm9yRWFjaCgoaXRlbSwgaW5kZXgpID0+IHsKICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUuaW5jbHVkZXMoIjEiKSkgewogICAgICAgICAgICAgICAgICAgIHR5cGVfMV9zdHIgKz0gYDxsaSBjbGFzcz0ibnEtbGkiIHRpdGxlPSIke2l0ZW0ubmFtZX0xIiBkYXRhLWluZGV4PSIke2luZGV4fSI+JHtpdGVtLm5hbWV9PC9saT5gOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKGl0ZW0udHlwZS5pbmNsdWRlcygiMiIpKSB7CiAgICAgICAgICAgICAgICAgICAgdHlwZV8yX3N0ciArPSBgPGxpIGNsYXNzPSJ0Yy1saSIgdGl0bGU9IiR7aXRlbS5uYW1lfSIgZGF0YS1pbmRleD0iJHtpbmRleH0iPiR7aXRlbS5uYW1lfTwvbGk+YDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGlmIChpdGVtLnR5cGUuaW5jbHVkZXMoIjMiKSkgewogICAgICAgICAgICAgICAgICAgIHR5cGVfM19zdHIgKz0gYDxsaSBjbGFzcz0idGMtbGkiIHRpdGxlPSIke2l0ZW0ubmFtZX0iIGRhdGEtaW5kZXg9IiR7aW5kZXh9Ij4ke2l0ZW0ubmFtZX08L2xpPmA7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgbGV0IGF1dG9QbGF5ID0gISFHTV9nZXRWYWx1ZShfQ09ORklHXy5hdXRvUGxheWVyS2V5LCBudWxsKSA/ICLlvIAiIDogIuWFsyI7CgogICAgICAgICAgICAkKGNvbnRhaW5lcikuYXBwZW5kKGAKICAgICAgICAgICAgICAgIDxkaXYgaWQ9IiR7X0NPTkZJR18udmlwQm94SWR9Ij4KICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPSJ2aXBfaWNvbiI+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9ImltZ19ib3giIHRpdGxlPSLpgInmi6nop6PmnpDmupAiIHN0eWxlPSJjb2xvcjp3aGl0ZTtmb250LXNpemU6MTZweDtmb250LXdlaWdodDpib2xkO2JvcmRlci1yYWRpdXM6NXB4OyI+PHNwYW4gc3R5bGU9ImNvbG9yOiByZWQ7Ij5WPC9zcGFuPkk8c3BhbiBzdHlsZT0iY29sb3I6IHllbGxvdzsiPlA8L3NwYW4+PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9InZpcF9saXN0Ij4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGgzIHN0eWxlPSJjb2xvcjojMWM4NGM2OyBmb250LXdlaWdodDogYm9sZDsgZm9udC1zaXplOiAxNnB4OyBwYWRkaW5nOjVweCAwcHg7Ij5b5YaF5bWM5pKt5pS+XTwvaDM+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHVsPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAke3R5cGVfMV9zdHJ9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9ImNsZWFyOmJvdGg7Ij48L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3VsPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxoMyBzdHlsZT0iY29sb3I6IzFjODRjNjsgZm9udC13ZWlnaHQ6IGJvbGQ7IGZvbnQtc2l6ZTogMTZweDsgcGFkZGluZzo1cHggMHB4OyI+W+W8ueeql+aSreaUvuW4pumAiembhl08L2gzPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx1bD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHt0eXBlXzJfc3RyfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IHN0eWxlPSJjbGVhcjpib3RoOyI+PC9kaXY+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC91bD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8aDMgc3R5bGU9ImNvbG9yOiMxYzg0YzY7IGZvbnQtd2VpZ2h0OiBib2xkOyBmb250LXNpemU6IDE2cHg7IHBhZGRpbmc6NXB4IDBweDsiPlvlvLnnqpfmkq3mlL7kuI3luKbpgInpm4ZdPC9oMz4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dWw+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR7dHlwZV8zX3N0cn0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBzdHlsZT0iY2xlYXI6Ym90aDsiPjwvZGl2PgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdWw+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgc3R5bGU9InRleHQtYWxpZ246bGVmdDtjb2xvcjojRkZGO2ZvbnQtc2l6ZToxMHB4O3BhZGRpbmc6MHB4IDEwcHg7bWFyZ2luLXRvcDoxMHB4OyI+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGI+6Ieq5Yqo6Kej5p6Q5Yqf6IO96K+05piO77yaPC9iPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxicj4mbmJzcDsmbmJzcDsx44CB6Ieq5Yqo6Kej5p6Q5Yqf6IO96buY6K6k5YWz6Zet77yI6Ieq5Yqo6Kej5p6Q5Y+q5pSv5oyB5YaF5bWM5pKt5pS+5rqQ77yJCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGJyPiZuYnNwOyZuYnNwOzLjgIHlvIDlkK/oh6rliqjop6PmnpDvvIznvZHpobXmiZPlvIDlkI7ohJrmnKzlsIbmoLnmja7lvZPliY3pgInkuK3nmoTop6PmnpDmupDoh6rliqjop6PmnpDop4bpopHjgILlpoLop6PmnpDlpLHotKXvvIzor7fmiYvliqjpgInmi6nkuI3lkIznmoTop6PmnpDmupDlsJ3or5UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8YnI+Jm5ic3A7Jm5ic3A7M+OAgeayoeaciemAieS4reino+aekOa6kOWwhumaj+acuumAieWPluS4gOS4qgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxicj4mbmJzcDsmbmJzcDs044CB5aaC5p+Q5Lqb572R56uZ5pyJ5Lya5ZGY5Y+v5Lul5YWz6Zet6Ieq5Yqo6Kej5p6Q5Yqf6IO9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0iaW1nX2JveCIgaWQ9InZpcF9hdXRvIiBzdHlsZT0iY29sb3I6d2hpdGU7Zm9udC1zaXplOjE2cHg7Zm9udC13ZWlnaHQ6Ym9sZDtib3JkZXItcmFkaXVzOjVweDsiIHRpdGxlPSLmmK/lkKbmiZPlvIDoh6rliqjop6PmnpDjgILoi6Xoh6rliqjop6PmnpDlpLHotKXvvIzor7fmiYvliqjpgInmi6nlhbblroPmjqXlj6PlsJ3or5XvvIHvvIEiPiR7YXV0b1BsYXl9PC9kaXY+CiAgICAgICAgICAgICAgICA8L2Rpdj5gKTsKICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHJlc29sdmUoY29udGFpbmVyKSk7CiAgICAgICAgfQoKICAgICAgICBiaW5kRXZlbnQoY29udGFpbmVyKSB7CiAgICAgICAgICAgIGNvbnN0IHZpcEJveCA9ICQoYCMke19DT05GSUdfLnZpcEJveElkfWApOwogICAgICAgICAgICBpZiAoX0NPTkZJR18uaXNNb2JpbGUpIHsKICAgICAgICAgICAgICAgIHZpcEJveC5maW5kKCIudmlwX2ljb24iKS5vbigiY2xpY2siLCAoKSA9PiB2aXBCb3guZmluZCgiLnZpcF9saXN0IikudG9nZ2xlKCkpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdmlwQm94LmZpbmQoIi52aXBfaWNvbiIpLm9uKCJtb3VzZW92ZXIiLCAoKSA9PiB2aXBCb3guZmluZCgiLnZpcF9saXN0Iikuc2hvdygpKTsKICAgICAgICAgICAgICAgIHZpcEJveC5maW5kKCIudmlwX2ljb24iKS5vbigibW91c2VvdXQiLCAoKSA9PiB2aXBCb3guZmluZCgiLnZpcF9saXN0IikuaGlkZSgpKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgbGV0IF90aGlzID0gdGhpczsKICAgICAgICAgICAgdmlwQm94LmZpbmQoIi52aXBfbGlzdCAubnEtbGkiKS5lYWNoKChsaUluZGV4LCBpdGVtKSA9PiB7CiAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoImNsaWNrIiwgKCkgPT4gewogICAgICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gcGFyc2VJbnQoJChpdGVtKS5hdHRyKCJkYXRhLWluZGV4IikpOwogICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKF9DT05GSUdfLmF1dG9QbGF5ZXJWYWwsIGluZGV4KTsKICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZShfQ09ORklHXy5mbGFnLCAidHJ1ZSIpOwogICAgICAgICAgICAgICAgICAgIF90aGlzLnNob3dQbGF5ZXJXaW5kb3coX0NPTkZJR18udmlkZW9QYXJzZUxpc3RbaW5kZXhdKTsKICAgICAgICAgICAgICAgICAgICB2aXBCb3guZmluZCgiLnZpcF9saXN0IGxpIikucmVtb3ZlQ2xhc3MoInNlbGVjdGVkIik7CiAgICAgICAgICAgICAgICAgICAgJChpdGVtKS5hZGRDbGFzcygic2VsZWN0ZWQiKTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgdmlwQm94LmZpbmQoIi52aXBfbGlzdCAudGMtbGkiKS5lYWNoKChsaUluZGV4LCBpdGVtKSA9PiB7CiAgICAgICAgICAgICAgICBpdGVtLmFkZEV2ZW50TGlzdGVuZXIoImNsaWNrIiwgKCkgPT4gewogICAgICAgICAgICAgICAgICAgIGNvbnN0IGluZGV4ID0gcGFyc2VJbnQoJChpdGVtKS5hdHRyKCJkYXRhLWluZGV4IikpOwogICAgICAgICAgICAgICAgICAgIGNvbnN0IHZpZGVvT2JqID0gX0NPTkZJR18udmlkZW9QYXJzZUxpc3RbaW5kZXhdOwogICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSB2aWRlb09iai51cmwgKyB3aW5kb3cubG9jYXRpb24uaHJlZjsKICAgICAgICAgICAgICAgICAgICBHTV9vcGVuSW5UYWIodXJsLCB7YWN0aXZlOiB0cnVlLCBpbnNlcnQ6IHRydWUsIHNldFBhcmVudDogdHJ1ZX0pOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgLy/lj7PplK7np7vliqjkvY3nva4KICAgICAgICAgICAgdmlwQm94Lm1vdXNlZG93bihmdW5jdGlvbiAoZSkgewogICAgICAgICAgICAgICAgaWYgKGUud2hpY2ggIT09IDMpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCkKICAgICAgICAgICAgICAgIHZpcEJveC5jc3MoImN1cnNvciIsICJtb3ZlIik7CiAgICAgICAgICAgICAgICBjb25zdCBwb3NpdGlvbkRpdiA9ICQodGhpcykub2Zmc2V0KCk7CiAgICAgICAgICAgICAgICBsZXQgZGlzdGVuY2VYID0gZS5wYWdlWCAtIHBvc2l0aW9uRGl2LmxlZnQ7CiAgICAgICAgICAgICAgICBsZXQgZGlzdGVuY2VZID0gZS5wYWdlWSAtIHBvc2l0aW9uRGl2LnRvcDsKCiAgICAgICAgICAgICAgICAkKGRvY3VtZW50KS5tb3VzZW1vdmUoZnVuY3Rpb24gKGUpIHsKICAgICAgICAgICAgICAgICAgICBsZXQgeCA9IGUucGFnZVggLSBkaXN0ZW5jZVg7CiAgICAgICAgICAgICAgICAgICAgbGV0IHkgPSBlLnBhZ2VZIC0gZGlzdGVuY2VZOwogICAgICAgICAgICAgICAgICAgIGNvbnN0IHdpbmRvd1dpZHRoID0gJCh3aW5kb3cpLndpZHRoKCk7CiAgICAgICAgICAgICAgICAgICAgY29uc3Qgd2luZG93SGVpZ2h0ID0gJCh3aW5kb3cpLmhlaWdodCgpOwoKICAgICAgICAgICAgICAgICAgICBpZiAoeCA8IDApIHsKICAgICAgICAgICAgICAgICAgICAgICAgeCA9IDA7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh4ID4gd2luZG93V2lkdGggLSB2aXBCb3gub3V0ZXJXaWR0aCh0cnVlKSAtIDEwMCkgewogICAgICAgICAgICAgICAgICAgICAgICB4ID0gd2luZG93V2lkdGggLSB2aXBCb3gub3V0ZXJXaWR0aCh0cnVlKSAtIDEwMDsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIGlmICh5IDwgMCkgewogICAgICAgICAgICAgICAgICAgICAgICB5ID0gMDsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHkgPiB3aW5kb3dIZWlnaHQgLSB2aXBCb3gub3V0ZXJIZWlnaHQodHJ1ZSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgeSA9IHdpbmRvd0hlaWdodCAtIHZpcEJveC5vdXRlckhlaWdodCh0cnVlKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgdmlwQm94LmNzcygibGVmdCIsIHgpOwogICAgICAgICAgICAgICAgICAgIHZpcEJveC5jc3MoInRvcCIsIHkpOwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAkKGRvY3VtZW50KS5tb3VzZXVwKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICAkKGRvY3VtZW50KS5vZmYoJ21vdXNlbW92ZScpOwogICAgICAgICAgICAgICAgICAgIHZpcEJveC5jc3MoImN1cnNvciIsICJwb2ludGVyIik7CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICQoZG9jdW1lbnQpLmNvbnRleHRtZW51KGZ1bmN0aW9uIChlKSB7CiAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpOwogICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiByZXNvbHZlKGNvbnRhaW5lcikpOwogICAgICAgIH0KCiAgICAgICAgYXV0b1BsYXkoY29udGFpbmVyKSB7CiAgICAgICAgICAgIGNvbnN0IHZpcEJveCA9ICQoYCMke19DT05GSUdfLnZpcEJveElkfWApOwogICAgICAgICAgICB2aXBCb3guZmluZCgiI3ZpcF9hdXRvIikub24oImNsaWNrIiwgZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgaWYgKCEhR01fZ2V0VmFsdWUoX0NPTkZJR18uYXV0b1BsYXllcktleSwgbnVsbCkpIHsKICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZShfQ09ORklHXy5hdXRvUGxheWVyS2V5LCBudWxsKTsKICAgICAgICAgICAgICAgICAgICAkKHRoaXMpLmh0bWwoIuWFsyIpOwogICAgICAgICAgICAgICAgICAgICQodGhpcykuYXR0cigidGl0bGUiLCAi5piv5ZCm5omT5byA6Ieq5Yqo6Kej5p6Q44CC6Iul6Ieq5Yqo6Kej5p6Q5aSx6LSl77yM6K+35omL5Yqo6YCJ5oup5YW25a6D5o6l5Y+j5bCd6K+V77yB77yBIik7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKF9DT05GSUdfLmF1dG9QbGF5ZXJLZXksICJ0cnVlIik7CiAgICAgICAgICAgICAgICAgICAgJCh0aGlzKS5odG1sKCLlvIAiKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHdpbmRvdy5sb2NhdGlvbi5yZWxvYWQoKTsKICAgICAgICAgICAgICAgIH0sIDIwMCk7CiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgaWYgKCEhR01fZ2V0VmFsdWUoX0NPTkZJR18uYXV0b1BsYXllcktleSwgbnVsbCkpIHsKICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0UGxheWVyKGNvbnRhaW5lcik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHJlc29sdmUoY29udGFpbmVyKSk7CiAgICAgICAgfQoKICAgICAgICBzZWxlY3RQbGF5ZXIoY29udGFpbmVyKSB7CiAgICAgICAgICAgIGxldCBpbmRleCA9IEdNX2dldFZhbHVlKF9DT05GSUdfLmF1dG9QbGF5ZXJWYWwsIDIpOwogICAgICAgICAgICBsZXQgYXV0b09iaiA9IF9DT05GSUdfLnZpZGVvUGFyc2VMaXN0W2luZGV4XTsKICAgICAgICAgICAgbGV0IF90aCA9IHRoaXM7CiAgICAgICAgICAgIGlmIChhdXRvT2JqLnR5cGUuaW5jbHVkZXMoIjEiKSkgewogICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgX3RoLnNob3dQbGF5ZXJXaW5kb3coYXV0b09iaik7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmlwQm94ID0gJChgIyR7X0NPTkZJR18udmlwQm94SWR9YCk7CiAgICAgICAgICAgICAgICAgICAgdmlwQm94LmZpbmQoYC52aXBfbGlzdCBbdGl0bGU9IiR7YXV0b09iai5uYW1lfTEiXWApLmFkZENsYXNzKCJzZWxlY3RlZCIpOwogICAgICAgICAgICAgICAgICAgICQoY29udGFpbmVyKS5maW5kKCIjdmlwX2F1dG8iKS5hdHRyKCJ0aXRsZSIsIGDoh6rliqjop6PmnpDmupDvvJoke2F1dG9PYmoubmFtZX1gKTsKICAgICAgICAgICAgICAgIH0sIDI1MDApOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBzaG93UGxheWVyV2luZG93KHZpZGVvT2JqKSB7CiAgICAgICAgICAgIHV0aWwuZmluZFRhcmdldEVsZShfQ09ORklHXy5jdXJyZW50UGxheWVyTm9kZS5jb250YWluZXIpCiAgICAgICAgICAgICAgICAudGhlbigoY29udGFpbmVyKSA9PiB7CiAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZSA9IHZpZGVvT2JqLnR5cGU7CiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHZpZGVvT2JqLnVybCArIHdpbmRvdy5sb2NhdGlvbi5ocmVmOwogICAgICAgICAgICAgICAgICAgIGlmICh0eXBlLmluY2x1ZGVzKCIxIikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdXRpbC5yZW9tdmVWaWRlbygpOwogICAgICAgICAgICAgICAgICAgICAgICAkKGNvbnRhaW5lcikuZW1wdHkoKTsKICAgICAgICAgICAgICAgICAgICAgICAgJChjb250YWluZXIpLmVtcHR5KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpZnJhbWVEaXZDc3MgPSAid2lkdGg6MTAwJTtoZWlnaHQ6MTAwJTt6LWluZGV4Ojk5OTk5OTsiOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoX0NPTkZJR18uaXNNb2JpbGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmcmFtZURpdkNzcyA9ICJ3aWR0aDoxMDAlO2hlaWdodDoyMjBweDt6LWluZGV4Ojk5OTk5OTsiOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChfQ09ORklHXy5pc01vYmlsZSAmJiB3aW5kb3cubG9jYXRpb24uaHJlZi5pbmRleE9mKCJpcWl5aS5jb20iKSAhPT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmcmFtZURpdkNzcyA9ICJ3aWR0aDoxMDAlO2hlaWdodDoyMjBweDt6LWluZGV4Ojk5OTk5OTttYXJnaW4tdG9wOi01Ni4yNSU7IjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAkKGNvbnRhaW5lcikuYXBwZW5kKGA8ZGl2IHN0eWxlPSIke2lmcmFtZURpdkNzc30iPjxpZnJhbWUgaWQ9ImlmcmFtZS1wbGF5ZXItNGE1YjZjIiBzcmM9IiR7dXJsfSIgc3R5bGU9ImJvcmRlcjpub25lOyIgYWxsb3dmdWxsc2NyZWVuPSJ0cnVlIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIj48L2lmcmFtZT48L2Rpdj5gKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICB9CgogICAgICAgIHBvc3RIYW5kbGUoY29udGFpbmVyKSB7CiAgICAgICAgICAgIGlmICghIUdNX2dldFZhbHVlKF9DT05GSUdfLmF1dG9QbGF5ZXJLZXksIG51bGwpKSB7CiAgICAgICAgICAgICAgICB1dGlsLnVybENoYW5nZVJlbG9hZCgpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbGV0IG9sZEhyZWYgPSB3aW5kb3cubG9jYXRpb24uaHJlZjsKICAgICAgICAgICAgICAgIGxldCBpbnRlcnZhbCA9IHNldEludGVydmFsKCgpID0+IHsKICAgICAgICAgICAgICAgICAgICBsZXQgbmV3SHJlZiA9IHdpbmRvdy5sb2NhdGlvbi5ocmVmOwogICAgICAgICAgICAgICAgICAgIGlmIChvbGRIcmVmICE9PSBuZXdIcmVmKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG9sZEhyZWYgPSBuZXdIcmVmOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFHTV9nZXRWYWx1ZShfQ09ORklHXy5mbGFnLCBudWxsKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnRlcnZhbCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cubG9jYXRpb24ucmVsb2FkKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9LCAxMDAwKTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICB9CgogICAgY2xhc3MgRGVmYXVsdENvbnN1bWVyIGV4dGVuZHMgQmFzZUNvbnN1bWVyIHsKICAgIH0KCiAgICByZXR1cm4gewogICAgICAgIHN0YXJ0OiAoKSA9PiB7CiAgICAgICAgICAgIEdNX3NldFZhbHVlKF9DT05GSUdfLmZsYWcsIG51bGwpOwogICAgICAgICAgICBsZXQgbWFsbENhc2UgPSAnRGVmYXVsdCc7CiAgICAgICAgICAgIGxldCBwbGF5ZXJOb2RlID0gX0NPTkZJR18ucGxheWVyQ29udGFpbmVycy5maWx0ZXIodmFsdWUgPT4gdmFsdWUuaG9zdCA9PT0gd2luZG93LmxvY2F0aW9uLmhvc3QpOwogICAgICAgICAgICBpZiAocGxheWVyTm9kZSA9PT0gbnVsbCB8fCBwbGF5ZXJOb2RlLmxlbmd0aCA8PSAwKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4od2luZG93LmxvY2F0aW9uLmhvc3QgKyAi6K+l572R56uZ5pqC5LiN5pSv5oyB77yM6K+36IGU57O75L2c6ICF77yM5L2c6ICF5bCG5Lya56ys5LiA5pe26Ze05aSE55CG77yI5rOo5oSP77ya6K+36K6w5b6X5o+Q5L6b5pyJ6Zeu6aKY55qE572R5Z2A77yJIik7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgX0NPTkZJR18uY3VycmVudFBsYXllck5vZGUgPSBwbGF5ZXJOb2RlWzBdOwogICAgICAgICAgICBtYWxsQ2FzZSA9IF9DT05GSUdfLmN1cnJlbnRQbGF5ZXJOb2RlLm5hbWU7CiAgICAgICAgICAgIGNvbnN0IHRhcmdldENvbnN1bWVyID0gZXZhbChgbmV3ICR7bWFsbENhc2V9Q29uc3VtZXJgKTsKICAgICAgICAgICAgdGFyZ2V0Q29uc3VtZXIucGFyc2UoKTsKICAgICAgICB9CiAgICB9Cgp9KSgpOwoKKGZ1bmN0aW9uICgpIHsKICAgIHN1cGVyVmlwLnN0YXJ0KCk7Cn0pKCk7
Add Comment
Please, Sign In to add comment