xiaomianao666

插件名:global_媒体流捕获

Oct 27th, 2024
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:网页插件¥js_url¥global_媒体流捕获@base64://Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICDlqpLkvZPmtYHmjZXojrcKLy8gQG5hbWVzcGFjZSAgICBodHRwczovL2dpdGh1Yi5jb20vTW9tbzcwNzU3NzA0NS9tZWRpYS1zb3VyY2UtZXh0cmFjdAovLyBAdmVyc2lvbiAgICAgIDAuMi43Ci8vIEBkZXNjcmlwdGlvbiAg5o2V6I63SFRNTOinhumikea1ge+8jOW5tuS4i+i9veeahOWunueOsOOAgueQhuiuuuS4iuWPr+S7peaNleiOt+S7u+aEj+WcqOe6v+inhumikeaIluebtOaSreeahOWqkuS9k+a1gQovLyBAbGljZW5zZSAgICAgIEFHUEwtMy4wCi8vIEBhdXRob3IgICAgICAgTW9tbzcwNzU3NzA0NQovLyBAbWF0Y2ggICAgICAgICo6Ly8qLyoKLy8gQGV4Y2x1ZGUgICAgICBodHRwOi8vYmxvZy5sdWNrbHktbWp3LmNuL3Rvb2wtc2hvdy9tZWRpYS1zb3VyY2UtZXh0cmFjdC9wbGF5ZXIvcGxheWVyLmh0bWwKLy8gQGdyYW50ICAgICAgICBub25lCi8vIEBydW4tYXQgICAgICAgZG9jdW1lbnQtc3RhcnQKLy8gQGRvd25sb2FkVVJMIGh0dHBzOi8vdXBkYXRlLmdyZWFzeWZvcmsub3JnL3NjcmlwdHMvNDUxMTkzLyVFNSVBQSU5MiVFNCVCRCU5MyVFNiVCNSU4MSVFNiU4RCU5NSVFOCU4RSVCNy51c2VyLmpzCi8vIEB1cGRhdGVVUkwgaHR0cHM6Ly91cGRhdGUuZ3JlYXN5Zm9yay5vcmcvc2NyaXB0cy80NTExOTMvJUU1JUFBJTkyJUU0JUJEJTkzJUU2JUI1JTgxJUU2JThEJTk1JUU4JThFJUI3Lm1ldGEuanMKLy8gPT0vVXNlclNjcmlwdD09CgooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwogICAgKGZ1bmN0aW9uICgpIHsKICAgICAgICBpZiAoZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ21lZGlhLXNvdXJjZS1leHRyYWN0JykpIHsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIH0KCiAgICAgICAgLy8g6L2u6K+i55uR5ZCsIGlmcmFtZSDnmoTliqDovb0KICAgICAgICBzZXRJbnRlcnZhbCgoKSA9PiB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBBcnJheS5wcm90b3R5cGUuZm9yRWFjaC5jYWxsKGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdpZnJhbWUnKSwgKGlmcmFtZSkgPT4gewogICAgICAgICAgICAgICAgICAgIC8vIOiLpSBpZnJhbWUg5L2/55So5LqGIHNhbmRib3gg6L+b6KGM5pON5L2c57qm5p2f77yM5Yig6Zmk5Y6f5pyJIGlmcmFtZe+8jOaLt+i0neWFtuWkh+S7ve+8jOWIoOmZpCBzYW5kYm94IOWxnuaAp++8jOmHjeaWsOi9veWFpQogICAgICAgICAgICAgICAgICAgIC8vIOiLpSBpZnJhbWUg5bey6L295YWl77yM5YaN5L+u5pS5IHNhbmRib3gg5bGe5oCn77yM5bCG5L+u5pS55peg5pWI44CC5pWF6YCa6L+H5paw5bu6IGlmcmFtZSDnmoTmlrnlvI/nu5Xov4cKICAgICAgICAgICAgICAgICAgICBpZiAoaWZyYW1lLmhhc0F0dHJpYnV0ZSgnc2FuZGJveCcpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHBhcmVudE5vZGUgPSBpZnJhbWUucGFyZW50Tm9kZTsKICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGVtcElmcmFtZSA9IGlmcmFtZS5jbG9uZU5vZGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgdGVtcElmcmFtZS5yZW1vdmVBdHRyaWJ1dGUoInNhbmRib3giKTsKICAgICAgICAgICAgICAgICAgICAgICAgaWZyYW1lLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnROb2RlLmFwcGVuZENoaWxkKHRlbXBJZnJhbWUpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9IGNhdGNoIChlcnJvcikgewogICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpOwogICAgICAgICAgICB9CiAgICAgICAgfSwgMTAwMCk7CgoKICAgICAgICBsZXQgZG93bmxvYWREYXRlID0gbmV3IERhdGUoKTsgLy8g5rWB5LiL6L295pe26Ze05qCH6K+GCiAgICAgICAgbGV0IGlzQ2xvc2UgPSBmYWxzZSwgaXNFbmRPZlN0cmVhbSA9IGZhbHNlOyAvLyDmmK/lkKblhbPpl60KICAgICAgICBsZXQgaXNTdHJlYW1Eb3dubG9hZCA9IGZhbHNlOyAvLyDmmK/lkKbkvb/nlKjmtYHlvI/kuIvovb0KICAgICAgICBsZXQgX3NvdXJjZUJ1ZmZlckxpc3QgPSBbXTsgLy8g5aqS5L2T6L2o6YGTCiAgICAgICAgY29uc3QgJHNob3dCdG4gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsgLy8g5bGV56S65oyJ6ZKuCiAgICAgICAgY29uc3QgJGJ0bkRvd25sb2FkID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2Jyk7IC8vIOS4i+i9veaMiemSrgogICAgICAgIGNvbnN0ICRidG5TdHJlYW1Eb3dubG9hZCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ2RpdicpOyAvLyDmtYHlvI/kuIvovb3mjInpkq4KICAgICAgICBjb25zdCAkZG93bmxvYWROdW0gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsgLy8g5bey5o2V6I636KeG6aKR54mH5q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FsbCgnKicpOwogICAgICAgICAgICAgICAgZm9yIChjb25zdCAkZG9tIG9mICRkb21MaXN0KSB7CiAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgJGRvbS5wbGF5YmFja1JhdGUgPSByYXRlOwogICAgICAgICAgICAgICAgICAgICAgICAkZG9tLm11dGVkID0gcmF0ZSAhPT0gMTsKICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUuZXJyb3IoZS5tZXNzYWdlKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgIH0KCiAgICAgICAgLy8g6I635Y+W6aG26YOoIHdpbmRvdyB0aXRsZe+8jOWboOWPr+iDveWtmOWcqOi3qOWfn+mXrumimO+8jOaVheS9v+eUqCB0cnkgY2F0Y2gg6L+b6KGM5L+d5oqkCiAgICAgICAgZnVuY3Rpb24gZ2V0RG9jdW1lbnRUaXRsZSgpIHsKICAgICAgICAgICAgbGV0IHRpdGxlID0gZG9jdW1lbnQudGl0bGU7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICB0aXRsZSA9IHdpbmRvdy50b3AuZG9jdW1lbnQudGl0bGU7CiAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhlcnJvcik7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRpdGxlOwogICAgICAgIH0KCgogICAgICAgIHZhciBfaHRtID0gX2h0bSB8fCB7fTsKICAgICAgICAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgaG0gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJzY3JpcHQiKTsKICAgICAgICAgICAgaG0uc3JjID0gImh0dHBzOi8vaG0uYmFpZHUuY29tL2htLmpzPzFmMTJiMDg2NWQ4NjZhZTFiOTM1MTQ4NzBkOTNjZTg5IjsKICAgICAgICAgICAgdmFyIHMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJzY3JpcHQiKTsKICAgICAgICAgICAgcy5wYXJlbnROb2RlLmluc2VydEJlZm9yZShobSwgcyk7CiAgICAgICAgfSkoKTsKCiAgICAgICAgLy8g5rWB5byP5LiL6L29CiAgICAgICAgZnVuY3Rpb24gX3N0cmVhbURvd25sb2FkKCkgewogICAgICAgICAgICAvLyDlr7nlupTnirbmgIHmnKrkuIvovb3nu5PmnZ/nmoTlqpLkvZPovajpgZMKICAgICAgICAgICAgY29uc3QgcmVtYWluU291cmNlQnVmZmVyTGlzdCA9IFtdOwogICAgICAgICAgICBmb3IgKGNvbnN0IHRhcmdldCBvZiBfc291cmNlQnVmZmVyTGlzdCkgewogICAgICAgICAgICAgICAgLy8g5a+55bqU55qEIE1TRSDnirbmgIHkuLrlt7LkuIvovb3lrozmiJDnirbmgIEKICAgICAgICAgICAgICAgIGlmICh0YXJnZXQuTVNFSW5zdGFuY2UucmVhZHlTdGF0ZSA9PT0gJ2VuZGVkJykgewogICAgICAgICAgICAgICAgICAgIHRhcmdldC5zdHJlYW1Xcml0ZXIuY2xvc2UoKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgcmVtYWluU291cmNlQnVmZmVyTGlzdC5wdXNoKHRhcmdldCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8g5rWB5byP5LiL6L2977yM6YeK5pS+5bey5LiL6L295a6M5oiQ55qE5aqS5L2T6L2o6YGT77yM5Zue5pS25YaF5a2YCiAgICAgICAgICAgIF9zb3VyY2VCdWZmZXJMaXN0ID0gcmVtYWluU291cmNlQnVmZmVyTGlzdDsKICAgICAgICAgICAgc2hvd1RpcCgn6KeG6aKR5bey5LiL6L29Jyk7CiAgICAgICAgICAgIC8vIOmHjee9rueKtuaAgQogICAgICAgICAgICBkb3dubG9hZERhdGUgPSBuZXcgRGF0ZSgpOwogICAgICAgICAgICBpc1N0cmVhbURvd25sb2FkID0gZmFsc2U7CiAgICAgICAgICAgICRidG5Eb3dubG9hZC5zdHlsZS5kaXNwbGF5ID0gJGJ0blN0cmVhbURvd25sb2FkLnN0eWxlLmRpc3BsYXkgPSAnYmxvY2snOwogICAgICAgICAgICAkZG93bmxvYWROdW0uaW5uZXJIVE1MID0gYOW3suaNleiOtyAwIOS4queJh+autWA7CiAgICAgICAgICAgIGlzRW5kT2ZTdHJlYW0gPSBmYWxzZTsKICAgICAgICB9CgogICAgICAgIC8vIOaZrumAmuS4i+i9vQogICAgICAgIGZ1bmN0aW9uIF9kb3dubG9hZCgpIHsKICAgICAgICAgICAgY29uc3QgZGF0ZSA9IG5ldyBEYXRlKCk7CiAgICAgICAgICAgIGZvciAoY29uc3QgdGFyZ2V0IG9mIF9zb3VyY2VCdWZmZXJMaXN0KSB7CiAgICAgICAgICAgICAgICBjb25zdCBtaW1lID0gdGFyZ2V0Lm1pbWUuc3BsaXQoJzsnKVswXTsKICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBtaW1lLnNwbGl0KCIvIik7CiAgICAgICAgICAgICAgICBjb25zdCBmaWxlQmxvYiA9IG5ldyBCbG9iKHRhcmdldC5idWZmZXJMaXN0LCB7dHlwZTogbWltZX0pOyAvLyDliJvlu7rkuIDkuKpCbG9i5a+56LGh77yM5bm26K6+572u5paH5Lu255qEIE1JTUUg57G75Z6LCiAgICAgICAgICAgICAgICBjb25zdCBhID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpOwogICAgICAgICAgICAgICAgYS5kb3dubG9hZCA9IGAke3R5cGVbMF19XyR7ZGF0ZS5nZXRGdWxsWWVhcigpLnRvU3RyaW5nKCkucGFkU3RhcnQoNCwgJzAnKX0ke2RhdGUuZ2V0TW9udGgoKS50b1N0cmluZygpLnBhZFN0YXJ0KDIsICcwJyl9JHtkYXRlLmdldERheSgpLnRvU3RyaW5nKCkucGFkU3RhcnQoMiwgJzAnKX1fJHtkYXRlLmdldEhvdXJzKCkudG9TdHJpbmcoKS5wYWRTdGFydCgyLCAnMCcpfSR7ZGF0ZS5nZXRNaW51dGVzKCkudG9TdHJpbmcoKS5wYWRTdGFydCgyLCAnMCcpfSR7ZGF0ZS5nZXRTZWNvbmRzKCkudG9TdHJpbmcoKS5wYWRTdGFydCgyLCAnMCcpfS4ke3R5cGVbMV19YDsKICAgICAgICAgICAgICAgIGEuaHJlZiA9IFVSTC5jcmVhdGVPYmplY3RVUkwoZmlsZUJsb2IpOwogICAgICAgICAgICAgICAgYS5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnOwogICAgICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChhKTsKICAgICAgICAgICAgICAgIC8vIOemgeatoiBjbGljayDkuovku7blhpLms6HvvIzpgb/lhY3lhajlsYDmi6bmiKoKICAgICAgICAgICAgICAgIGEub25jbGljayA9IGZ1bmN0aW9uIChlKSB7CiAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGEuY2xpY2soKTsKICAgICAgICAgICAgICAgIGEucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICBpZiAoaXNFbmRPZlN0cmVhbSA9PT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgIF9zb3VyY2VCdWZmZXJMaXN0ID0gW107CiAgICAgICAgICAgICAgICAgICAgJGRvd25sb2FkTnVtLmlubmVySFRNTCA9IGDlt7LmjZXojrcgMCDkuKrniYfmrrVgOwogICAgICAgICAgICAgICAgICAgIGlzRW5kT2ZTdHJlYW0gPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICBzaG93VGlwKCfop4bpopHlt7LkuIvovb0nKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgZm9yIChjb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hSBNZWRpYVNvdXJjZSDnirbmgIHlj5jmm7QKICAgICAgICAgICAgICAgICAgICBfZW5kT2ZTdHJlYW0uY2FsbCh0aGlzKTsKICAgICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBfZW5kT2ZTdHJlYW0uY2FsbCh0aGlzKTsKICAgICAgICAgICAgfTsKCiAgICAgICAgICAgIC8vIOW9leWPlui1hOa6kAogICAgICAgICAgICBsZXQgX2FkZFNvdXJjZUJ1ZmZlciA9IE1lZGlhU291cmNlLnByb3RvdHlwZS5hZGRTb3VyY2VCdWZmZXI7CiAgICAgICAgICAgIE1lZGlhU291cmNlLnByb3RvdHlwZS5hZGRTb3VyY2VCdWZmZXIgPSBmdW5jdGlvbiAobWltZSkgewogICAgICAgICAgICAgICAgaWYgKCFpc0Nsb3NlKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRW5kT2ZTdHJlYW0gJiYgX3NvdXJjZUJ1ZmZlckxpc3QubGVuZ3RoID4gMCkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoY29uZmlybSgn5qOA5rWL5Yiw5paw55qE6KeG6aKR5rWB77yM5piv5ZCm5LiL6L295bey5o2V6I6377yfXG7ngrnlh7vigJznoa7lrprigJ3kuIvovb3lt7LmjZXojrdcbueCueWHu+KAnOWPlua2iOKAnemHjeaWsOaNleiOtycpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBfZG93bmxvYWQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ21lZGlhLXNvdXJjZS1jYXB0dXJlJykgPT09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgX2FwcGVuZERvbSgpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBsZXQgc291cmNlQnVmZmVyID0gX2FkZFNvdXJjZUJ1ZmZlci5jYWxsKHRoaXMsIG1pbWUpOwogICAgICAgICAgICAgICAgICAgIGxldCBfYXBwZW5kID0gc291cmNlQnVmZmVyLmFwcGVuZEJ1ZmZlcjsKICAgICAgICAgICAgICAgICAgICBsZXQgYnVmZmVyTGlzdCA9IFtdOwogICAgICAgICAgICAgICAgICAgIGNvbnN0IF9zb3VyY2VCdWZmZXIgPSB7CiAgICAgICAgICAgICAgICAgICAgICAgIG1pbWUsCiAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlckxpc3QsCiAgICAgICAgICAgICAgICAgICAgICAgIE1TRUluc3RhbmNlOiB0aGlzLAogICAgICAgICAgICAgICAgICAgIH07CgogICAgICAgICAgICAgICAgICAgIC8vIOWmguaenCBzdHJlYW1TYXZlciDlt7Lmj5DliY3liqDovb3lrozmiJDvvIzliJnliJ3lp4vljJblr7nlupTnmoQgc3RyZWFtV3JpdGVyCiAgICAgICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpbmRvdy5zdHJlYW1TYXZlcikgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZSA9IG1pbWUuc3BsaXQoJzsnKVswXS5zcGxpdCgnLycpWzFdOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgX3NvdXJjZUJ1ZmZlci5zdHJlYW1Xcml0ZXIgPSBzdHJlYW1TYXZlci5jcmVhdGVXcml0ZVN0cmVhbShgJHt0eXBlWzBdfV8ke2Rvd25sb2FkRGF0ZS5nZXRGdWxsWWVhcigpLnRvU3RyaW5nKCkucGFkU3RhcnQoNCwgJzAnKX0ke2Rvd25sb2FkRGF0ZS5nZXRNb250aCgpLnRvU3RyaW5nKCkucGFkU3RhcnQoMiwgJzAnKX0ke2Rvd25sb2FkRGF0ZS5nZXREYXkoKS50b1N0cmluZygpLnBhZFN0YXJ0KDIsICcwJyl9XyR7ZG93bmxvYWREYXRlLmdldEhvdXJzKCkudG9TdHJpbmcoKS5wYWRTdGFydCgyLCAnMCcpfSR7ZG93bmxvYWREYXRlLmdldE1pbnV0ZXMoKS50b1N0cmluZygpLnBhZFN0YXJ0KDIsICcwJyl9JHtkb3dubG9hZERhdGUuZ2V0U2Vjb25kcygpLnRvU3RyaW5nKCkucGFkU3RhcnQoMiwgJzAnKX0uJHt0eXBlWzFdfWApLmdldFdyaXRlcigpCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnJvcikgewogICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGVycm9yKTsKICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgIF9zb3VyY2VCdWZmZXJMaXN0LnB1c2goX3NvdXJjZUJ1ZmZlcik7CiAgICAgICAgICAgICAgICAgICAgc291cmNlQnVmZmVyLmFwcGVuZEJ1ZmZlciA9IGZ1bmN0aW9uIChidWZmZXIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgJGRvd25sb2FkTnVtLmlubmVySFRNTCA9IGDlt7LmjZXojrcgJHtfc291cmNlQnVmZmVyTGlzdC5sZW5ndGh9IOS4queJh+autWA7CgogICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNTdHJlYW1Eb3dubG9hZCAmJiBfc291cmNlQnVmZmVyLnN0cmVhbVdyaXRlcikgeyAvLyDmtYHlvI/kuIvovb0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9zb3VyY2VCdWZmZXIuc3RyZWFtV3JpdGVyLndyaXRlKG5ldyBVaW50OEFycmF5KGJ1ZmZlcikpOwogICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyDmma7pgJogYmxvYiDkuIvovb0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlckxpc3QucHVzaChidWZmZXIpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIF9hcHBlbmQuY2FsbCh0aGlzLCBidWZmZXIpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gc291cmNlQnVmZmVyOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogICAgICAgICAgICBNZWRpYVNvdXJjZS5wcm90b3R5cGUuYWRkU291cmNlQnVmZmVyLnRvU3RyaW5nID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgcmV0dXJuICdmdW5jdGlvbiBhZGRTb3VyY2VCdWZmZXIoKSB7IFtuYXRpdmUgY29kZV0gfSc7CiAgICAgICAgICAgIH07CiAgICAgICAgfQoKICAgICAgICAvLyDmt7vliqDmk43kvZznmoQgZG9tCiAgICAgICAgZnVuY3Rpb24gX2FwcGVuZERvbSgpIHsKICAgICAgICAgICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdtZWRpYS1zb3VyY2UtZXh0cmFjdCcpKSB7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgJGNvbnRhaW5lci5zZXRBdHRyaWJ1dGUoInN0eWxlIiwgJ3Bvc2l0aW9uOiBmaXhlZDsgdG9wOiA1MHB4OyByaWdodDogNTBweDsgdGV4dC1hbGlnbjogcmlnaHQ7IHotaW5kZXg6IDk5OTk7Jyk7CiAgICAgICAgICAgIGNvbnN0IGJhc2VTdHlsZSA9ICdmbG9hdDpyaWdodDsgY2xlYXI6Ym90aDsgbWFyZ2luLXRvcDogMTBweDsgcGFkZGluZzogMCAyMHB4OyBjb2xvcjogd2hpdGU7IGN1cnNvcjogcG9pbnRlcjsgZm9udC1zaXplOiAxNnB4OyBmb250LXdlaWdodDogYm9sZDsgbGluZS1oZWlnaHQ6IDQwcHg7IHRleHQtYWxpZ246IGNlbnRlcjsgYm9yZGVyLXJhZGl1czogNHB4OyBiYWNrZ3JvdW5kLWNvbG9yOiAjMzQ5OGRiOyBib3gtc2hhZG93OiAwIDNweCA2cH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AgICAgICAkZG93bmxvYWROdW0uc3R5bGUuZGlzcGxheSA9ICdub25lJzsKICAgICAgICAgICAgICAgICRidG5TdHJlYW1Eb3dubG9hZC5zdHlsZS5kaXNwbGF5ID0gJ25vbmUnOwogICAgICAgICAgICAgICAgJGJ0bkRvd25sb2FkLnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CiAgICAgICAgICAgICAgICAkY2xvc2VCdG4uc3R5bGUuZGlzcGxheSA9ICdub25lJzsKICAgICAgICAgICAgICAgICR0ZW5SYXRlLnN0eWxlLmRpc3BsYXkgPSAnbm9uZSc7CiAgICAgICAgICAgICAgICAkc2hvd0J0bi5zdHlsZS5kaXNwbGF5ID0gJ2lubGluZS1ibG9jayc7CiAgICAgICAgICAgICAgICBfc291cmNlQnVmZmVyTGlzdCA9IFtdOwogICAgICAgICAgICAgICAgaXNDbG9zZSA9IHRydWU7CiAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgLy8g5pi+56S65o6n5Yi26Z2i5p2/CiAgICAgICAgICAgICRzaG93QnRuLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgaWYgKCFpc1N0cmVhbURvd25sb2FkKSB7CiAgICAgICAgICAgICAgICAgICAgJGJ0bkRvd25sb2FkLnN0eWxlLmRpc3BsYXkgPSAnaW5saW5lLWJsb2NrJzsKICAgICAgICAgICAgICAgICAgICAkYnRuU3RyZWFtRG93bmxvYWQuc3R5bGUuZGlzcGxheSA9ICdpbmxpbmUtYmxvY2snOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgJGRvd25sb2FkTnVtLnN0eWxlLmRpc3BsYXkgPSAnaW5saW5lLWJsb2NrJzsKICAgICAgICAgICAgICAgICRjbG9zZUJ0bi5zdHlsZS5kaXNwbGF5ID0gJ2lubGluZS1ibG9jayc7CiAgICAgICAgICAgICAgICAkdGVuUmF0ZS5zdHlsZS5kaXNwbGF5ID0gJ2lubGluZ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N0YXJ0KDIsICcwJyl9JHtkb3dubG9hZERhdGUuZ2V0TWludXRlcygpLnRvU3RyaW5nKCkucGFkU3RhcnQoMiwgJzAnKX0ke2Rvd25sb2FkRGF0ZS5nZXRTZWNvbmRzKCkudG9TdHJpbmcoKS5wYWRTdGFydCgyLCAnMCcpfS4ke3R5cGVbMV19YCkuZ2V0V3JpdGVyKCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZUJ1ZmZlci5idWZmZXJMaXN0LmZvckVhY2goYnVmZmVyID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZUJ1ZmZlci5zdHJlYW1Xcml0ZXIud3JpdGUobmV3IFVpbnQ4QXJyYXkoYnVmZmVyKSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VCdWZmZXIuYnVmZmVyTGlzdCA9IFtdOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSkKCiAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdodG1sJylbMF0uaW5zZXJ0QmVmb3JlKCRjb250YWluZXIsIGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdoZWFkJylbMF0pOwogICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZENoaWxkKCRidG5TdHJlYW1Eb3dubG9hZCk7CiAgICAgICAgICAgICRjb250YWluZXIuYXBwZW5kQ2hpbGQoJGRvd25sb2FkTnVtKTsKICAgICAgICAgICAgJGNvbnRhaW5lci5hcHBlbmRDaGlsZCgkYnRuRG93bmxvYWQpOwogICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZENoaWxkKCR0ZW5SYXRlKTsKICAgICAgICAgICAgJGNvbnRhaW5lci5hcHBlbmRDaGlsZCgkY2xvc2VCdG4pOwogICAgICAgICAgICAkY29udGFpbmVyLmFwcGVuZENoaWxkKCRzaG93QnRuKTsKCiAgICAgICAgICAgIC8vIOWKoOi9vSBzdHJlYW0g5rWB5byP5LiL6L295ZmoCiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBsZXQgJHN0cmVhbVNhdmVyID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnc2NyaXB0Jyk7CiAgICAgICAgICAgICAgICAkc3RyZWFtU2F2ZXIuc3JjID0gJ2h0dHBzOi8vdXB5dW4ubHVja2x5LW1qdy5jbi9saWIvc3RyZWFtLXNhdmVyLmpzJzsKICAgICAgICAgICAgICAgIGRvY3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQoJHN0cmVhbVNhdmVyKTsKICAgICAgICAgICAgICAgICRzdHJlYW1TYXZlci5hZGRFdmVudExpc3RlbmVyKCdsb2FkJywgKCkgPT4gewogICAgICAgICAgICAgICAgICAgICRidG5TdHJlYW1Eb3dubG9hZC5zdHlsZS5kaXNwbGF5ID0gJ2lubGluZS1ibG9jayc7CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHsKICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZXJyb3IpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSkoKTsKCiAgICBpZiAod2luZG93ID09PSB0b3ApIHsKICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsIGV2ZW50ID0+IHsKICAgICAgICAgICAgaWYgKGV2ZW50LnNvdXJjZSAhPT0gd2luZG93KSB7CiAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgIGxldCBzcWwgPSBldmVudC5kYXRhLnNwbGl0KCJceDAwIik7CiAgICAgICAgICAgICAgICAgICAgaWYgKHNxbFswXSA9PT0gInNob3dUaXAiICYmIHNxbFsxXS5jb25zdHJ1Y3RvciA9PT0gU3RyaW5nKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcWxbMl0pIHNob3dUaXAoc3FsWzFdLCBzcWxbMl0pOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgICAgICAvLyDmjpLpmaQg5LiL5qCH6LaK55WM6ZSZ6K+vIOWPiiDmjIfku6TlpITnkIbplJnor68KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgfQoKICAgIGZ1bmN0aW9uIHNob3dUaXAobXNnLCBzdHlsZSA9IGBgKSB7CiAgICAgICAgLy8g6K+l5Ye95pWw6ZyA6KaB5ZyodG9w5YaF6L+Q6KGM77yM5ZCm5YiZ5Y+v6IO95pi+56S65byC5bi4CiAgICAgICAgbGV0IHJvb3QgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKGA6cm9vdGApOwogICAgICAgIGlmICh3aW5kb3cgPT09IHRvcCkgewogICAgICAgICAgICBsZXQgdGlwID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcigiOnJvb3Q+dGlwIik7CiAgICAgICAgICAgIGlmICh0aXAgJiYgdGlwLm5vZGVUeXBlID09PSAxKSB7CiAgICAgICAgICAgICAgICAvLyDpmLLmraLkuK3pgJTmlrDnmoRzaG93VGlw5LqL5Lu25Yib5bu65aSa5LiqdGlw6YCg5oiQ5Y2h6aG/CiAgICAgICAgICAgICAgICB0aXAucmVtb3ZlKCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdGlwID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgidGlwIik7CiAgICAgICAgICAgIC8vIHBvaW50ZXItZXZlbnRzOiBub25lOyDnpoHnlKjpvKDmoIfkuovku7bvvIxpbnB1dOagh+etvuS9v+eUqCBkaXNhYmxlZD0nZGlzYWJsZWQnIOemgeeUqGlucHV05qCH562+CiAgICAgICAgICAgIHRpcC5zZXRBdHRyaWJ1dGUoInN0eWxlIiwgc3R5bGUgKyAicG9pbnRlci1ldmVudHM6IG5vbmU7IG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kgPiAwID8gKHRpbWUgLSAxKSAvIHRpbWUgOiAwKSkgKyAiLDEpIDEgbm9ybWFsIjsKICAgICAgICAgICAgcm9vdC5hcHBlbmRDaGlsZCh0aXApOwogICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgdGlwLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgICAgIC8vIOaOkumZpHJvb3TmsqHmnInmib7liLB0aXAKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwgdGltZSAqIDEwMDApOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHRvcC5wb3N0TWVzc2FnZSgic2hvd1RpcFx4MDAiICsgbXNnICsgIlx4MDAiICsgc3R5bGUsICIqIik7CiAgICAgICAgfQogICAgfQp9KSgpOw==
Add Comment
Please, Sign In to add comment