Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:网页插件¥js_url¥LocalParse_Dn@base64://Ly89PT09PT09PT09PT3lhY3ll4XosIPnlKg9PT09PT09PT09PT0KLy89PT09PT1A5pat5b+144CBQOWPkeeyqua2guWimeOAgUDliqrlips9PT09PT0KLy/vvI3vvI3vvI09Xl9ePQoKICAgIHZhciB2ZXJzaW9uID0gMi40OwogICAgdmFyIF9teVNldCA9IHsKICAgICAgICBxeTogJycsIHlrOiAnJywgdHg6ICcnLCBtZzogJycsIGJsOiAnJywgb3RoOiAnJywgcWp1OiAn6buY6K6kJywKICAgICAgICBjamNhY2hlOiAnaGlrZXI6Ly9maWxlcy9jYWNoZS9QYXJzZV9Ebi5qcycsCiAgICAgICAgeDVjYWNoZTogJ2hpa2VyOi8vZmlsZXMvY2FjaGUvUGFyc2VfRG4uaHRtbCcsCiAgICAgICAgY2o6ICdodHRwczovL2NvZGUuYWxpeXVuLmNvbS9BSTk1Ny9IaWtlci9yYXcvbWFzdGVyL3YvQ2xvdWRQYXJzZS1WMl9Ebi5qcycsCiAgICAgICAgeDVVcmw6ICdodHRwczovL2NvZGUuYWxpeXVuLmNvbS9BSTk1Ny9IaWtlci9yYXcvbWFzdGVyL3YvUGFyc2VfRG4uaHRtbCcsCiAgICAgICAgeDVSb3V0ZTogJ2ZpbGU6Ly8vc3RvcmFnZS9lbXVsYXRlZC8wL0FuZHJvaWQvZGF0YS9jb20uZXhhbXBsZS5oaWtlcnZpZXcvZmlsZXMvRG9jdW1lbnRzL2NhY2hlL1BhcnNlX0RuLmh0bWwnCiAgICB9OwogICAgdmFyIG15U2VsZWN0ID0gJ1wKICAgICAgICA8b3B0aW9uPnl1bjE3MTc8L29wdGlvbj5cCiAgICAgICAgPG9wdGlvbj5wYXJ3aXg8L29wdGlvbj5cCiAgICAgICAgPG9wdGlvbj5SUk1pPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+5rWG57OKPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+5rWG57OKMjwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPlhNRkxWPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+5pm66IO96Kej5p6QPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+QmFpRHU8L29wdGlvbj5cCiAgICAgICAgPG9wdGlvbj5RaUxpbjwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPld1SUdlbjwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPll1bkJvPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+WWk0N0c8L29wdGlvbj5cCiAgICAgICAgPG9wdGlvbj5QYW5HdTwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPlJSTWkyPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+bTN1OFRWPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+RGlhb1NpPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+RnVYaW5nPC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+cGFyd2l4Mjwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPuS4g+WTpeino+aekDwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPumGieS7meino+aekDwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPua1huezijM8L29wdGlvbj5cCiAgICAgICAgPG9wdGlvbj5CTOino+aekO+8iOacieW5v+WRiu+8iTwvb3B0aW9uPlwKICAgICAgICA8b3B0aW9uPmh0dHBzOi8vanh4LnNteXM4LmNuL2luZGV4LnBocD91cmw9PC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+aHR0cHM6Ly9va2p4LmNjLz91cmw9PC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+aHR0cHM6Ly9hcGkueWl5aXppLmNuL2p4Lz91cmw9PC9vcHRpb24+XAogICAgICAgIDxvcHRpb24+aHR0cHM6Ly9qeC5tM3U4LnR2L2ppZXhpLz91cmw9PC9vcHRpb24+XAogICAgICAg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vcGxheWVyLz91cmw9CiAqIOW5sumlrSjkurrkurrov7cpOiBodHRwczovL2p4Lnp1aS5jbS8/dXJsPQogKiBodHRwczovLzIuNjZtb3ZpZS50b3AvcGxheWVyLz91cmw9CiAqIAogKi8KCgp2YXIgdG9vbHMgPSB7CiAgICBNRDU6IGZ1bmN0aW9uIChkYXRhKSB7CiAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTsKICAgICAgICByZXR1cm4gQ3J5cHRvSlMuTUQ1KGRhdGEpLnRvU3RyaW5nKENyeXB0b0pTLmVuYy5IZXgpOwogICAgfSwKICAgIEFFUzogZnVuY3Rpb24gKHRleHQsIGtleSwgaXYsIGlzRW5jcnlwdCkgewogICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7CiAgICAgICAgdmFyIGtleSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKGtleSk7CiAgICAgICAgdmFyIGl2ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UoaXYpOyAKICAgICAgICBpZihpc0VuY3J5cHQpIHsKICAgICAgICAgICAgcmV0dXJuIENyeXB0b0pTLkFFUy5lbmNyeXB0KHRleHQsIGtleSwgewogICAgICAgICAgICAgICAgaXY6IGl2LAogICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsCiAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczcKICAgICAgICAgICAgfSkudG9TdHJpbmcoKTsKICAgICAgICB9OwogICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh0ZXh0LCBrZXksIHsKICAgICAgICAgICAgaXY6IGl2LAogICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczcKICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7CiAgICB9LAogICAgLy9hc2NpaQogICAgbmV4dENoYXJhY3RlcjogZnVuY3Rpb24gKGFzY2lpVm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bnRzL2NhY2hlL3ZpZGVvcy5tM3U4Iyc7CiAgICB9LAogICAgbWFvc3M6IGZ1bmN0aW9uIChqeHVybCwgcmVmKSB7CiAgICAgICAgdHJ5ewogICAgICAgICAgICBpZihyZWYpewogICAgICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KGp4dXJsLCB7aGVhZGVyczogeydSZWZlcmVyJzogcmVmfX0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KGp4dXJsKTsKICAgICAgICAgICAgfQogICAgICAgICAgICB1cmwgPSBkZWNvZGVVUklDb21wb25lbnQodG9vbHMuQUVTKGh0bWwuc3BsaXQoJyJ1cmwiOiInKVsxXS5zcGxpdCgnIicpWzBdLCAiZHZ5WVJRbG5QUkNNZFFTZSIsIGh0bWwuc3BsaXQoJ2J0X3Rva2VuID0gIicpWzFdLnNwbGl0KCciJylbMF0pKTsKICAgICAgICAgICAgcmV0dXJuIHVybDsKICAgICAgICB9IGNhdGNoKGUpIHsKICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgIH0KICAgIH0sCiAgICBMTFE6IGZ1bmN0aW9uIChqeHVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIGFwaSA9IGp4dXJsLnNwbGl0KCc/dXJsPScpWzBdICsgImFwaS5waHAiOwogICAgICAgICAgICB2YXIgYjY0aWQgPSBiYXNlNjRFbmNvZGUoanh1cmwuc3BsaXQoJ3VybD0nKVsxXSk7CiAgICAgICAgICAgIHZhciBwYXJzZWlkID0gdG9vbHMuY2Flc2FyQ2lwaGVyKGI2NGlkLCAtMSk7CiAgICAgICAgICAgIHZhciBqc29uID0gSlNPTi5wYXJzZShyZXF1ZXN0KGFwaSwge2hlYWRlcnM6IHsnUmVmZXJlcic6IGp4dXJsIH0sIG1ldGhvZDogJ1BPU1QnLCBib2R5OiAndXJsPScgKyBwYXJzZWlkIH0pKTsKICAgICAgICAgICAgdXJsID0gKGpzb24uY29kZSA9PSAyMDAgPyBiYXNlNjREZWNvZGUodG9vbHMuY2Flc2FyQ2lwaGVyKGpzb24udXJsLCAtMSkpIDogJycpOwogICAgICAgICAgICByZXR1cm4gdXJsOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIHBhcndpeDogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHZhciBsYXp5ID0gZnVuY3Rpb24ocHJlZml4KSB7CiAgICAgICAgICAgIHRyeXsvL2Zyb209PiDpgJfliKvnnIsgaHR0cDovL3d3dy5kb3ViaWVrYW4ubmV0LyDvvZwg6L+95Ymn6L6+5Lq6IGh0dHA6Ly92aXBtdi50di8g772cIOmbtumbtuS4g+W9seinhiBodHRwczovL3d3dy4wMDd0cy5jYyDlj5vpgIbogIUKICAgICAgICAgICAgICAgIHZhciByZWYgPSBwcmVmaXggKyAnP3Y9JyArIHZpcFVybDsKICAgICAgICAgICAgICAgIHZhciBqeHVybCA9IHByZWZpeCArICdhbmFseXNpcy5waHA/dj0nICsgdmlwVXJsOwogICAgICAgICAgICAgICAgdmFyIHVybCA9IHJlcXVlc3Qoanh1cmwsIHtoZWFkZXJzOiB7J1JlZmVyZXInOiByZWYgfX0pLm1hdGNoKC91cmxzID0gIiguKj8pIi8pWzFdOwogICAgICAgICAgICAgICAgcmV0dXJuIHVybDsKICAgICAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgICAgIH0KICAgICAgICB9OwogICAgICAgIHZhciB1cmwgPSB0aGlzLm1hb3NzKCdodHRwczovL3ZpcDEyM2thbi52aXAvbTN1OC5waHA/dXJsPScgKyB2aXBVcmwpOwogICAgICAgIC8vdmFyIGp4dXJsID0gJ2h0dHBzOi8vdGl0YW4ubWd0di5jb20udm9kangudG9wLz91cmw9JyArIHZpcFVybDsKICAgICAgICByZXR1cm4gdXJsLmluZGV4T2YoJ2h0dHAnKSA9PS0xID8gbGF6eSgnaHR0cHM6Ly9wbGF5ZXIud2ViMTE0My50b3AvdmlwLzEvJykgOiB1cmw7CiAgICB9LAogICAgcGFyd2l4MjogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsgLy9mcm9tIOWNl+W6nOW9seinhgogICAgICAgICAgICB2YXIganh1cmwgPSAnaHR0cHM6Ly9hcGkueGt2aWRlby5kZXNpZ24vbTN1OC5waHA/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLm1hb3NzKGp4dXJsKTsKICAgICAgICAgICAgcmV0dXJuIHVybC5pbmRleE9mKCdtZ3R2LmNvbScpID4tMSA/IHVybCArICc7e1VzZXItQWdlbnRAYXBwJiZSZWZlcmVyQGh0dHBzOi8vd3d3Lm1ndHYuY29tfScgOiB1cmw7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgUlJNaTogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIGp4dXJsID0gJ2h0dHBzOi8vdmlwLnN1c291LnR2L3BsYXllci8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChqeHVybCk7CiAgICAgICAgICAgIHZhciB1cmwgPSBodG1sLm1hdGNoKC91cmwiOiAiKC4qPykiLylbMV07CiAgICAgICAgICAgIHJldHVybiB1cmw7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgUlJNaTI6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB2YXIgcmVmID0gJ2h0dHBzOi8vcm9ja2V0LmRhaWRhaXR2LnRvcDo0MzgxMC9kcC8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgdmFyIGp4dXJsID0gJ2h0dHBzOi8vcm9ja2V0LmRhaWRhaXR2LnRvcDo0MzgxMC9kcC9hbmFseXNpcy5waHA/dj0nICsgdmlwVXJsOwogICAgICAgIHZhciBodG1sID0gcmVxdWVzdChqeHVybCwge2hlYWRlcnM6IHsnUmVmZXJlcic6IHJlZn19KTsKICAgICAgICB2YXIgdXJsID0gaHRtbC5tYXRjaCgvdXJscyA9ICIoLio/KSIvKVsxXTsKICAgICAgICByZXR1cm4gdXJsOwogICAgfSwKICAgIOS4g+WTpeino+aekDogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIHJlZiA9ICdodHRwczovL2p4Lm1ta3YuY24vdHYucGhwP3VybD0nICsgdmlwVXJsOwogICAgICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3QoJ2h0dHBzOi8vangubW1rdi5jbi9qaWV4aS5waHA/dXJsPScgKyB2aXBVcmwsIHtoZWFkZXJzOiB7J1JlZmVyZXInOiByZWZ9fSk7CiAgICAgICAgICAgIHZhciB1cmwgPSBodG1sLm1hdGNoKC92aWRlbyBzcmM9IiguKj8pIi8pWzFdOwogICAgICAgICAgICByZXR1cm4gdXJsOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIOaZuuiDveino+aekDogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIHJlZiA9ICdodHRwOi8vYXBpLm1haXppbWFsbC5jb20vaW5kZXgucGhwP3VybD0nICsgdmlwVXJsOwogICAgICAgICAgICB2YXIganh1cmwgPSAnaHR0cDovL3ZvZC5tYWl6aW1hbGwuY29tL2ppZXhpLnBocD91cmw9JyArIHZpcFVybDsKICAgICAgICAgICAgcmV0dXJuIHRoaXMubWFvc3Moanh1cmwsIHJlZik7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAg6YaJ5LuZ6Kej5p6QOiBmdW5jdGlvbiAodmlwVXJsKSB7CiAgICAgICAgdHJ5ewogICAgICAgICAgICB2YXIganh1cmwgPSAnaHR0cHM6Ly9qeC56dWkuY20vP3VybD0nICsgdmlwVXJsOwogICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5tYW9zcyhqeHVybCk7CiAgICAgICAgICAgIHJldHVybiB1cmwgPT0gJycgPyB0aGlzLm1hb3NzKCdodHRwczovLzEuYXBpLjgwdHZzLmNuLz91cmw9JyArIHZpcFVybCkgOiB1cmw7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgQkzop6PmnpA6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB2YXIgcmVmID0gJ2h0dHBzOi8vdmlwLmJsamlleC5jb20vP3Y9JyArIHZpcFVybDsKICAgICAgICB2YXIgeXVybCA9ICdodHRwczovL3ZpcC5ibGppZXguY29tL2FwaS5waHA/b3V0PWpzb25wJnVybD0nICsgdmlwVXJsOwogICAgICAgIHZhciBodG1sID0gcmVxdWVzdCh5dXJsLCB7aGVhZGVyczogeydSZWZlcmVyJzogcmVmfX0pOwogICAgICAgIHZhciB1cmwgPSAoaHRtbC5tYXRjaCgvdXJsIjoiKC4qPykiLylbMV0gKyAnJykucmVwbGFjZSgvXFwvZywgJycpOwogICAgICAgIHJldHVybiB1cmw7CiAgICB9LAogICAgQmFpRHU6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB0cnl7CiAgICAgICAgICAgIC8vICdodHRwczovL2FwaS4xMGR5Lm5ldC8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciBsYXp5ID0gZnVuY3Rpb24ocGFyc2UsIHJlZil7CiAgICAgICAgICAgICAgICB0cnl7CiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KHBhcnNlK3ZpcFVybCwge2hlYWRlcnM6eydSZWZlcmVyJzogcmVmfX0pOwogICAgICAgICAgICAgICAgICAgIHJldHVybiBodG1sLm1hdGNoKC91cmxzID0gIiguKj8pIi8pWzFdOwogICAgICAgICAgICAgICAgfSBjYXRjaChlKSB7cmV0dXJuICcnfQogICAgICAgICAgICB9OwogICAgICAgICAgICB2YXIgdXJsID0gbGF6eSgiaHR0cHM6Ly92aXAuOGJ5cy5jbi8/dXJsPSIsICJodHRwOi8vd3d3LjkyOGthbi5jb20vIik7CiAgICAgICAgICAgIHJldHVybiB1cmwuaW5kZXhPZignaHR0cCcpPT0tMSA/IGxhenkoImh0dHBzOi8vcGxheS4ydWM4LmNvbS95YW9kaWFuL2FuYWx5c2lzLnBocD92PSIsICJodHRwczovL3BsYXkuMnVjOC5jb20veWFvZGlhbi8/dXJsPSIgKyB2aXBVcmwpIDogdXJsOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIGppYW5naHU6IGZ1bmN0aW9uIChqeHVybCwgcmVmKSB7CiAgICAgICAgdHJ5ewogICAgICAgICAgICBpZihyZWYpewogICAgICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KGp4dXJsLCB7aGVhZGVyczogeydSZWZlcmVyJzogcmVmfX0pOwogICAgICAgICAgICB9ZWxzZXsKICAgICAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChqeHVybCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIHVybCA9IGh0bWwubWF0Y2goL3NvdXJjZSBzcmM9IiguKj8pIi8pWzFdOwogICAgICAgICAgICByZXR1cm4gdXJsOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIOa1huezijogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHZhciBwYXJzZSA9ICdodHRwczovL2ppYW5naHUuamlleGlsYWlrYW4uY29tL2ppZXhpLz91cmw9JzsKICAgICAgICB2YXIgcGFyc2UyID0gJ2h0dHA6Ly9hcGkuamhkeXcudmlwLz91cmw9JzsKICAgICAgICB2YXIgdXJsID0gdGhpcy5qaWFuZ2h1KHBhcnNlK3ZpcFVybCk7CiAgICAgICAgcmV0dXJuIHVybCA9PSAnJyA/IHRoaXMuamlhbmdodShwYXJzZTIrdmlwVXJsKSA6IHVybDsKICAgIH0sCiAgICDmtYbns4oyWDogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIHl1cmwgPSAnaHR0cDovL2p4LnNob3V5aWh1by50b3AvP3VybD0nICsgdmlwVXJsOwogICAgICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3QoeXVybCk7CiAgICAgICAgICAgIHZhciB1cmwgPSBodG1sLm1hdGNoKC91cmxzID0gIiguKj8pIi8pWzFdOwogICAgICAgICAgICByZXR1cm4gdXJsOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIOa1huezijI6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICAvLyAnaHR0cHM6Ly93d3cuZGFiYW90di5jbi8nOwogICAgICAgIHZhciByZWYgPSAnaHR0cHM6Ly93d3cuMzdkeXcuY29tLyc7CiAgICAgICAgdmFyIGp4dXJsID0gJ2h0dHBzOi8vYXBpLmpoZHl3LnZpcC9qaWV4aS8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgdmFyIHVybCA9IHRoaXMuamlhbmdodShqeHVybCwgcmVmKTsKICAgICAgICBpZih1cmwuaW5kZXhPZignamh5dW4ubXA0P2tleScpIT0tMSl7CiAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UocmVxdWVzdCh1cmwsIHtyZWRpcmVjdDpmYWxzZSwgd2l0aEhlYWRlcnM6dHJ1ZX0pKS5oZWFkZXJzLmxvY2F0aW9uICsgJyc7CiAgICAgICAgfQogICAgICAgIHJldHVybiB1cmw7CiAgICB9LAogICAg5rWG57OKMzogZnVuY3Rpb24gKHZpcFVybCkgey8vZnJvbT0+5b2x6KeG5bel5Zy6CiAgICAgICAgdmFyIHJlZiA9ICdodHRwczovL3BsYXkuZHVzaGU1MjAuY29tLz91cmw9JyArIHZpcFVybDsKICAgICAgICB2YXIganh1cmwgPSAnaHR0cHM6Ly9wbGF5LmR1c2hlNTIwLmNvbS9qaWFuZ2h1LnBocD91cmw9JyArIHZpcFVybDsKICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3Qoanh1cmwsIHtoZWFkZXJzOiB7J1JlZmVyZXInOiByZWZ9fSk7CiAgICAgICAgdmFyIHVybCA9IGh0bWwubWF0Y2goL3NvdXJjZSBzcmM9IiguKj8pIi8pWzFdOwogICAgICAgIHJldHVybiB1cmw7CiAgICB9LAogICAgWE1GTFY6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB0cnl7Ly9mcm9tIOiTneWFieW9semfsyA3a+i1hOa6kAogICAgICAgICAgICB2YXIgc2VjcmV0ID0gZnVuY3Rpb24gKGEpewogICAgICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTsKICAgICAgICAgICAgICAgIHZhciBiID0gQ3J5cHRvSlMuTUQ1KGEpOwogICAgICAgICAgICAgICAgdmFyIGMgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShiKTsKICAgICAgICAgICAgICAgIHZhciBkID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UoJ3JlbjE2M2NvbTUyMDEzMTQnKTsKICAgICAgICAgICAgICAgIHZhciBlID0gQ3J5cHRvSlMuQUVTLmVuY3J5cHQoYSwgYywgewogICAgICAgICAgICAgICAgICAgIGl2OiBkLAogICAgICAgICAgICAgICAgICAgIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLAogICAgICAgICAgICAgICAgICAgIHBhZGRpbmc6IENyeXB0b0pTLnBhZC5aZXJvUGFkZGluZwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICByZXR1cm4gZS50b1N0cmluZygpCiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIHJlZiA9ICdodHRwczovL2p4LnhtZmx2LmNvbS8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChyZWYpOwogICAgICAgICAgICBldmFsKCcnICsgaHRtbC5tYXRjaCgvdmFyIHRpbWUgPVtcc1xTXSo/dmFyIGZ2a2V5W1xzXFNdKj87LykpOwogICAgICAgICAgICB2YXIgYm9keXMgPSAndGltZT0nK3RpbWUgKyAnJnVybD0nK3ZpcFVybCArICcmd2FwPTEnICsgJyZ2a2V5PScrdmtleSArICcmZnZrZXk9JytzZWNyZXQoZnZrZXkpOwogICAgICAgICAgICB2YXIgdXJsID0gSlNPTi5wYXJzZSgKICAgICAgICAgICAgICAgIHJlcXVlc3QoJ2h0dHBzOi8vangueG1mbHYuY29tL3htZmx2LTEuU1ZHJywgewogICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHsnUmVmZXJlcic6IHJlZn0sCiAgICAgICAgICAgICAgICAgICAgYm9keTogYm9keXMsIG1ldGhvZDogJ1BPU1QnCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICApLnVybDsKICAgICAgICAgICAgcmV0dXJuIHVybDsKICAgICAgICB9IGNhdGNoKGUpIHsKICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgIH0KICAgIH0sCiAgICDnjKvop6PmnpA6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB0cnl7Ly/lpIfnlKggaHR0cDovL3d3dy4ydWM4LmNvbS9tZW5ncGxheS8yMjY2Mi0xLTEuaHRtbAogICAgICAgICAgICBldmFsKHJlcXVlc3QoUGFyc2VTLkNpdHlJUCkpOwogICAgICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3QoJ2h0dHBzOi8va2suamlhanVqbi5jb20vMjU2Lz91cmw9JyArIHZpcFVybCwKICAgICAgICAgICAgICAgIHtoZWFkZXJzOiB7J1JlZmVyZXInOiAnaHR0cDovL3d3dy5iYjYwMjkuY29tLyd9fQogICAgICAgICAgICApOwogICAgICAgICAgICB2YXIgdmtleSA9IGh0bWwubWF0Y2goL3ZrZXkgPSAnKC4qPyknLylbMV07CiAgICAgICAgICAgIHZhciBib2R5cyA9ICd2a2V5PScrdmtleSArICcmaXA9JytyZXR1cm5DaXR5U04uY2lwICsgJyZkcD0nK3JldHVybkNpdHlTTi5jbmFtZTsKICAgICAgICAgICAgdmFyIHVybCA9IEpTT04ucGFyc2UoCiAgICAgICAgICAgICAgICByZXF1ZXN0KCdodHRwczovL2trLmppYWp1am4uY29tLzI1Ni9hcGlfLnBocCcsIHtib2R5OiBib2R5cywgbWV0aG9kOiAnUE9TVCcgfSkKICAgICAgICAgICAgKS51cmw7CiAgICAgICAgICAgIHJldHVybiB1cmwgKyAnI2lnbm9yZUltZz10cnVlIyc7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgV3VJR2VuOiBmdW5jdGlvbiAodmlwVXJsKSB7CiAgICAgICAgLy9mcm9tPT7niLHot5/op6PmnpAgCiAgICAgICAgdmFyIHJlZiA9ICdodHRwczovL3ZpcC4ya3R2Yi5jb20vcGxheWVyLz91cmw9JyArIHZpcFVybDsKICAgICAgICB2YXIgeXVybCA9ICdodHRwczovL3ZpcC4ya3R2Yi5jb20vcGxheWVyZGFtdS8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KHl1cmwsIHtoZWFkZXJzOiB7J1JlZmVyZXInOiByZWZ9fSk7CiAgICAgICAgdmFyIHVybCA9IGh0bWwubWF0Y2goL3VybCI6IFwnKC4qPylcJy8pWzFdOwogICAgICAgIHJldHVybiBiYXNlNjREZWNvZGUodXJsKTsKICAgIH0sCiAgICBNb29uOiBmdW5jdGlvbiAodmlwVXJsKSB7CiAgICAgICAgdHJ5eyAgICAKICAgICAgICAgICAgZXZhbChyZXF1ZXN0KFBhcnNlUy5DaXR5SVApKTsKICAgICAgICAgICAgdmFyIHByZWZpeCA9ICdodHRwczovL2FwaS55dWVsaWFuZ2p4LmNvbS8nOwogICAgICAgICAgICB2YXIganh1cmwgPSBwcmVmaXggKyAnP3VybD0nICsgdmlwVXJsOwogICAgICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3Qoanh1cmwpOwogICAgICAgICAgICB2YXIgdmtleSA9IGh0bWwubWF0Y2goL3ZhciB2a2V5ID0gJyguKj8pJy8pWzFdOwogICAgICAgICAgICB2YXIgY29kZXMgPSAoaHRtbC5tYXRjaCgvXC5wb3N0XCgnKFtcc1xTXSo/fSkvKVsxXSkuc3BsaXQoIicsIik7CiAgICAgICAgICAgIHZhciBhcGkgPSBwcmVmaXggKyBjb2Rlc1swXTsKICAgICAgICAgICAgZXZhbCgndmFyIGRhdGE9JyArIGNvZGVzWzFdICsgJzsnKTsKICAgICAgICAgICAgdmFyIGJvZHlzID0gJ3ZrZXk9JytkYXRhLnZrZXkgKyAnJmlwPScrZGF0YS5pcCArICcmZHA9JytkYXRhLmRwOwogICAgICAgICAgICB2YXIgdXJsID0gSlNPTi5wYXJzZShyZXF1ZXN0KGFwaSwge2hlYWRlcnM6IHsnUmVmZXJlcic6IGp4dXJsIH0sIGJvZHk6IGJvZHlzLCBtZXRob2Q6ICdQT1NUJyB9KSkudXJsOwogICAgICAgICAgICByZXR1cm4gdXJsOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIFFpTGluOiBmdW5jdGlvbiAodmlwVXJsKSB7CiAgICAgICAgLy9mcm9tPT4g6buReuW9seinhue6v+WFrSBodHRwOi8veXMuNmhlaXouY29tLyDvvZwg6JOd5YWJ5b2x6Z+zIGh0dHBzOi8vd3d3Ljg4OGtrdHYuY29tLwogICAgICAgIC8vdmFyIHJlZiA9ICdodHRwczovL2p4LnN1angudG9wL2ppZXhpLnBocC8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgdmFyIGxhenkgPSBmdW5jdGlvbigpewogICAgICAgICAgICB0cnl7Ly9mcm9tPT4gaHR0cHM6Ly9qeC5lcHRlcHQuY29tLz91cmw9IOWlh+iJugogICAgICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KCdodHRwczovL2J5anguZXB0ZXB0LmNvbS8/dXJsPScgKyB2aXBVcmwpOwogICAgICAgICAgICAgICAgcmV0dXJuIGh0bWwubWF0Y2goL3VybHMgPSAiKC4qPykiLylbMV07CiAgICAgICAgICAgIH0gY2F0Y2goZSkge3JldHVybiAnJ30KICAgICAgICB9OwogICAgICAgIHZhciB1cmwgPSBsYXp5KCk7CiAgICAgICAgdmFyIGp4dXJsID0gJ2h0dHBzOi8vYXYuaHRvby52aXAvbTN1OC5waHA/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgcmV0dXJuIHVybCA9PSAnJyA/IHRoaXMubWFvc3Moanh1cmwpIDogdXJsOwogICAgfSwKICAgIGZlbmdsaW46IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB0cnl7CiAgICAgICAgICAgIHZhciByZWYgPSAnaHR0cHM6Ly9hcGkuZmVuZ2xpbnlzLm5ldC8nOwogICAgICAgICAgICB2YXIgcGFyc2UgPSAnaHR0cHM6Ly90aXRhbi5tZ3R2LmNvbS5ra2Zsdi5uZXQvP3VybD0nOwogICAgICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3QocGFyc2UrdmlwVXJsLCB7aGVhZGVyczp7J1JlZmVyZXInOiByZWYgfX0pOwogICAgICAgICAgICB2YXIgdXJsID0gaHRtbC5tYXRjaCgvd2luZG93LmF0b2JcKCcoLio/KScvKVsxXTsKICAgICAgICAgICAgcmV0dXJuIGJhc2U2NERlY29kZSh1cmwpOwogICAgICAgIH0gY2F0Y2goZSl7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgeXVuYm9YOiBmdW5jdGlvbiAodmlwVXJsLCBkYXRhKSB7CiAgICAgICAgdHJ5ewogICAgICAgICAgICB2YXIgcmVmID0gJ2h0dHBzOi8vd3d3LjEyMzFkLmNvbS8nOwogICAgICAgICAgICB2YXIgcGFyc2UgPSAnaHR0cHM6Ly9qeC55dW5ib3lzLmNuLz91cmw9JyArIHZpcFVybDsKICAgICAgICAgICAgdmFyIGFwaSA9ICdodHRwczovL2p4Lnl1bmJveXMuY24vYXBpLnBocCc7CiAgICAgICAgICAgIGlmKGRhdGEpewogICAgICAgICAgICAgICAgcmVmID0gZGF0YVswXTsgcGFyc2UgPSBkYXRhWzFdOyBhcGkgPSBkYXRhWzNdOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGV2YWwoJ3ZhciBqc29uPScgKyByZXF1ZXN0KHBhcnNlLCB7aGVhZGVyczogeydSZWZlcmVyJzogcmVmfX0pLnNwbGl0KCdwb3N0KCJhcGkucGhwIiwnKVsxXS5zcGxpdCgnLGZ1bmN0aW9uJylbMF0ucmVwbGFjZSgvJ290aGVyLio/XClcLC8sJycpLnJlcGxhY2UoJ2Zvcm0nLCcxJykpOwogICAgICAgICAgICB2YXIgdXJsID0gSlNPTi5wYXJzZShyZXF1ZXN0KGFwaSwgewogICAgICAgICAgICAgICAgaGVhZGVyczogeydSZWZlcmVyJzogcGFyc2UgfSwKICAgICAgICAgICAgICAgIGJvZHk6ICd1cmw9Jytqc29uLnVybCArICcmcmVmZXJlcj0nK2pzb24ucmVmZXJlciArICcmdGltZT0nK2pzb24udGltZSArICcmdHlwZT0mb3RoZXI9JytiYXNlNjRFbmNvZGUoanNvbi51cmwpICsgJyZpb3M9MSZreXM9Jytqc29uLmt5cywKICAgICAgICAgICAgICAgIG1ldGhvZDonUE9TVCcKICAgICAgICAgICAgfSkpLnVybDsKICAgICAgICAgICAgcmV0dXJuIHVybDsKICAgICAgICB9IGNhdGNoKGUpIHsKICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgIH0KICAgIH0sCiAgICBZdW5CbzogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIGp4dXJsID0gJ2h0dHBzOi8vangueXVuYm95cy5jbi8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdChqeHVybCwge2hlYWRlcnM6IHsnUmVmZXJlcic6ICdodHRwczovL3d3dy4xMjMxZC5jb20vJywgJ1VzZXItQWdlbnQnOiBQQ19VQX19KTsKICAgICAgICAgICAgdmFyIGt5cyA9IGh0bWwubWF0Y2goL2FyIGt5cyA9ICcoLio/KScvKVsxXTsKICAgICAgICAgICAgdmFyIHVybCA9IEpTT04ucGFyc2UocmVxdWVzdCgnaHR0cHM6Ly9qeC55dW5ib3lzLmNuL2FwaS5waHAnLCB7CiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7J1JlZmVyZXInOiBqeHVybCB9LAogICAgICAgICAgICAgICAgYm9keTogJ3VybD0nK3ZpcFVybCArICcma3lzPScra3lzICsgJyZpb3M9MCZyZWY9MCcsCiAgICAgICAgICAgICAgICBtZXRob2Q6J1BPU1QnCiAgICAgICAgICAgIH0pKS51cmw7CiAgICAgICAgICAgIHJldHVybiB1cmw7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgUGFuR3U6IGZ1bmN0aW9uICh2aXBVcmwsIGRhdGEpIHsKICAgICAgICB0cnl7CiAgICAgICAgICAgIHZhciByZWYgPSAnaHR0cHM6Ly93d3cucGFuZ3VqaWV4aS5jb20vJzsKICAgICAgICAgICAgdmFyIHBhcnNlID0gJ2h0dHBzOi8vcGFuZ3VhcGkubnRyeWpkLm5ldC9qaWV4aS8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciBhcGkgPSAgJ2h0dHBzOi8vcGFuZ3VhcGkubnRyeWpkLm5ldC9qaWV4aS9hcGkucGhwJzsKICAgICAgICAgICAgLy92YXIgcmVmID0gJ2h0dHBzOi8veG15c3R2LmNvbS8nOwogICAgICAgICAgICAvL3ZhciBwYXJzZSA9ICdodHRwczovL3d3dy45OWtwdy5jb20vcGFuZ3UvaW5kZXgucGhwP3VybD0nICsgdGFpbFVybDsKICAgICAgICAgICAgLy92YXIgYXBpID0gJ2h0dHBzOi8vd3d3Ljk5a3B3LmNvbS9wYW5ndS9hcGkucGhwJzsKICAgICAgICAgICAgaWYoZGF0YSl7CiAgICAgICAgICAgICAgICByZWYgPSBkYXRhWzBdOyBwYXJzZSA9IGRhdGFbMV07IGFwaSA9IGRhdGFbMl07CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy9ldmFsKCd2YXIganNvbj0nICsgaHRtbC5tYXRjaCgvXC5wb3N0Lio/KHtbXHNcU10qP30pLylbMV0ucmVwbGFjZSgvJ290aGVyLio/XClcLC8sJycpICsgJzsnKTsKICAgICAgICAgICAgdmFyIFRpbWUgPSAoTWF0aC5mbG9vcihuZXcgRGF0ZSgpLmdldFRpbWUoKSAvIDEwMDApICogMSkudG9TdHJpbmcoKTsKICAgICAgICAgICAgdmFyIHVybCA9IEpTT04ucGFyc2UocmVxdWVzdChhcGksIHsKICAgICAgICAgICAgICAgIGhlYWRlcnM6IHsnUmVmZXJlcic6IHBhcnNlIH0sCiAgICAgICAgICAgICAgICBib2R5OiAndXJsPScrdmlwVXJsICsgJyZyZWZlcmVyPScgKyBiYXNlNjRFbmNvZGUocGFyc2UpICsgJyZyZWY9MSZ0aW1lPScrVGltZSArICcmdHlwZT0mb3RoZXI9JytiYXNlNjRFbmNvZGUodmlwVXJsKSArICcmaW9zPTAnLAogICAgICAgICAgICAgICAgbWV0aG9kOidQT1NUJwogICAgICAgICAgICB9KSkudXJsOwogICAgICAgICAgICByZXR1cm4gdXJsOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIERpYW9TaTogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIC8vZnJvbT0+IDI555S15b2x6ZmiIGh0dHBzOi8vd3d3LjI5ZmFidS5jb20vCiAgICAgICAgdmFyIGRlY3J5cHQgPSBmdW5jdGlvbih0ZXh0KXsKICAgICAgICAgICAgdmFyIGtleSA9IHRvb2xzLk1ENSgnZGlhb3NpYXBpJykudG9TdHJpbmcoKTsKICAgICAgICAgICAgdmFyIGl2ID0ga2V5LnN1YnN0cmluZygwLCAxNik7CiAgICAgICAgICAgIHZhciBuZXdrZXkgPSBrZXkuc3Vic3RyaW5nKDE2KTsKICAgICAgICAgICAgcmV0dXJuIHRvb2xzLkFFUyh0ZXh0LCBuZXdrZXksIGl2LCB0cnVlKTsKICAgICAgICB9OwogICAgICAgIHZhciB5dXJsID0gJ2h0dHBzOi8vZHMueXlrc3NjLmNuOjg5ODkvZGlhb3NpangvP3VybD0nICsgdmlwVXJsOwogICAgICAgIHZhciBUaW1lID0gKE1hdGguZmxvb3IobmV3IERhdGUoKS5nZXRUaW1lKCkgLyAxMDAwKSAqIDEpLnRvU3RyaW5nKCkKICAgICAgICB2YXIgdXJsID0gYmFzZTY0RW5jb2RlKGRlY3J5cHQodmlwVXJsKSk7CiAgICAgICAgdmFyIHRpbWUgPSBiYXNlNjRFbmNvZGUoZGVjcnlwdChUaW1lKSk7CiAgICAgICAgdmFyIHVybCA9IEpTT04ucGFyc2UoCiAgICAgICAgICAgICAgICByZXF1ZXN0KCdodHRwczovL2RzLnl5a3NzYy5jbjo4OTg5L2RpYW9zaWp4L2FwaS5waHAnLCB7CiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogeydSZWZlcmVyJzogeXVybH0sCiAgICAgICAgICAgICAgICAgICAgYm9keTogJ3R5cGU9ZGVmYXVsdCcgKyAnJnVybD0nK3VybCArICcmdGltZT0nK3RpbWUsIG1ldGhvZDogJ1BPU1QnCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICApLnVybDsKICAgICAgICByZXR1cm4gdXJsOwogICAgfSwKICAgIOS4g+aYn1g6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB0cnl7CiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdCgnaHR0cHM6Ly9qeC5xeGtray5jbi9kbS8/dXJsPScgKyB2aXBVcmwpOwogICAgICAgICAgICB2YXIgdXJsID0gaHRtbC5tYXRjaCgvdXJsIjoiKC4qPykiLylbMV07CiAgICAgICAgICAgIHJldHVybiB1cmw7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgbTN1OFRWOiBmdW5jdGlvbiAodmlwVXJsKSB7CiAgICAgICAgdHJ5ewogICAgICAgICAgICAvL3ZhciBwYXJzZSA9ICdodHRwOi8vbTN1OC50di5qYW5hbi5uZXQvanNvbi5waHA/dXJsPSc7CiAgICAgICAgICAgIC8vdmFyIHVybCA9IEpTT04ucGFyc2UocmVxdWVzdChwYXJzZSt2aXBVcmwpKS51cmw7CiAgICAgICAgICAgIHZhciByZWYgPSAnaHR0cHM6Ly93d3cuNGtkdi5jb20vJzsKICAgICAgICAgICAgdmFyIGp4dXJsID0gJ2h0dHBzOi8vanguNGtkdi5jb20vP3VybD0nICsgdmlwVXJsOwogICAgICAgICAgICByZXR1cm4gdGhpcy5tYW9zcyhqeHVybCk7CiAgICAgICAgfSBjYXRjaChlKSB7CiAgICAgICAgICAgIHJldHVybiAnJzsKICAgICAgICB9CiAgICB9LAogICAgeXVuMTcxNzogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIGlzeWsgPSB2aXBVcmwuaW5kZXhPZigneW91a3UnKTsKICAgICAgICAgICAgdmFyIHJlZiA9ICdodHRwczovL3d3dy4xNzE3eXVuLmNvbS9qeC90eS5waHA/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciBwYXJzZSA9ICdodHRwczovLzE3MTcubnRyeWpkLm5ldC8wNTI2Lz91cmw9JyArIHZpcFVybDsKICAgICAgICAgICAgdmFyIGFwaSA9ICdodHRwczovLzE3MTcubnRyeWpkLm5ldC8wNTI2L2FwaS5waHAnOwogICAgICAgICAgICByZXR1cm4gaXN5ayA9PS0xID8gdGhpcy5QYW5HdSh2aXBVcmwsIFtyZWYsIHBhcnNlLCBhcGldKSA6IHRoaXMuUGFuR3UodmlwVXJsLCBbcmVmKycsdmlwOicsIHBhcnNlKycsdmlwOicsIGFwaV0pOwogICAgICAgIH0gY2F0Y2goZSkgewogICAgICAgICAgICByZXR1cm4gJyc7CiAgICAgICAgfQogICAgfSwKICAgIFlpNDdHOiBmdW5jdGlvbiAodmlwVXJsKSB7CiAgICAgICAgdHJ5ewogICAgICAgICAgICB2YXIgcmVmID0gJ2h0dHBzOi8vanguMTQ3Zy5jYy8/dXJsPScgKyB2aXBVcmw7CiAgICAgICAgICAgIHZhciBqeHVybCA9ICdodHRwczovL2FwaS4xNDdnLmNjL20zdTgucGhwP3VybD0nICsgdmlwVXJsOwogICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5tYW9zcyhqeHVybCwgcmVmKTsKICAgICAgICAgICAgcmV0dXJuIHVybDsKICAgICAgICB9IGNhdGNoKGUpIHsKICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgIH0KICAgIH0sCiAgICBGdVhpbmc6IGZ1bmN0aW9uICh2aXBVcmwpIHsKICAgICAgICB0cnl7CiAgICAgICAgICAgIC8vaWYodmlwVXJsLmluZGV4T2YoJ3YueW91a3UnKSE9LTEpewogICAgICAgICAgICAvLyAgICB2aXBVcmwgPSAoSlNPTi5wYXJzZShyZXF1ZXN0KHZpcFVybCwge3JlZGlyZWN0OmZhbHNlLCB3aXRoSGVhZGVyczp0cnVlfSkpLmhlYWRlcnMubG9jYXRpb24gKyAnJykucmVwbGFjZSgvXD8uKi8sJycpOwogICAgICAgICAgICAvL30KICAgICAgICAgICAgdmFyIHJlZiA9ICdodHRwczovL2p4Lnh1ZXR1aWd1YW5nLmNuL2ppZXhpLz91cmw9JyArIHZpcFVybDsKICAgICAgICAgICAgdmFyIHBhcnNlID0gcmVmOwogICAgICAgICAgICB2YXIgYXBpID0gJ2h0dHBzOi8vangueHVldHVpZ3VhbmcuY24vamlleGkvYXBpdV9meC5waHAnOwogICAgICAgICAgICByZXR1cm4gdGhpcy5QYW5HdSh2aXBVcmwsIFtyZWYsIHBhcnNlLCBhcGldKTsKICAgICAgICB9IGNhdGNoKGUpIHsKICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgIH0KICAgIH0sCiAgICBlZWVvbDogZnVuY3Rpb24gKHZpcFVybCkgewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIHBhcnNlID0gJ2h0dHBzOi8vdmlkZW8uZWVlb2wuY24vangucGhwP3VybD0nOwogICAgICAgICAgICB2YXIgaHRtbCA9IGZldGNoKHBhcnNlK3ZpcFVybCkuc3BsaXQoIl91cmwiKVsyXTsKICAgICAgICAgICAgdmFyIHVybCA9IGh0bWwubWF0Y2goLyA9ICcoLio/KScvKVsxXTsKICAgICAgICAgICAgcmV0dXJuIHVybDsKICAgICAgICB9IGNhdGNoKGUpIHsKICAgICAgICAgICAgcmV0dXJuICcnOwogICAgICAgIH0KICAgIH0sCn07CgpmdW5jdGlvbiBheXRtUGFyc2UgKHZpcFVybCkgewogICAgdmFyIGhvc3QgPSB2aXBVcmwubWF0Y2goL1wuKC4qPylcLy8pWzFdOwogICAgc3dpdGNoIChteVNldC5xanUpIHsKICAgICAgICBjYXNlICLpu5jorqQiOiBzd2l0Y2ggKGhvc3QpIHsKICAgICAgICAgICAgY2FzZSAicXEuY29tIjogc3RyID0gbXlTZXQudHg7CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICJpcWl5aS5jb20iOiBzdHIgPSBteVNldC5xeTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgInlvdWt1LmNvbSI6IHN0ciA9IG15U2V0LnlrOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAibWd0di5jb20iOiBzdHIgPSBteVNldC5tZzsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgImJpbGliaWxpLmNvbSI6IHN0ciA9IG15U2V0LmJsOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgZGVmYXVsdDogc3RyID0gbXlTZXQub3RoOwogICAgICAgICAgICBicmVhazsKICAgICAgICB9CiAgICAgICAgYnJlYWs7CiAgICAgICAgZGVmYXVsdDogc3RyID0gbXlTZXQucWp1OwogICAgICAgIGJyZWFrOwogICAgfQogICAgaWYoc3RyLmluZGV4T2YoJ2h0dHAnKT09LTEpewogICAgICAgIHRyeXsKICAgICAgICAgICAgdmFyIHVybCA9IFBhcnNlU1tzdHJdKHZpcFVybCk7CiAgICAgICAgICAgIGlmKHVybFswXT09Jy8nKXsgdXJsID0gJ2h0dHBzOicgKyB1cmwgfQogICAgICAgICAgICBpZih1cmwuaW5kZXhPZignPWh0dHAnKSE9LTEpewogICAgICAgICAgICAgICAgdXJsID0gJ2h0dHAnICsgZGVjb2RlVVJJQ29tcG9uZW50KHVybC5zcGxpdCgnPWh0dHAnKVsxXSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLyppZih1cmwubWF0Y2goL21ndHYuY29tL2cpPT0nbWd0di5jb20nKXsKICAgICAgICAgICAgICAgIHVybCA9IHVybCArICc7e1JlZmVyZXJAaHR0cHM6Ly93d3cubWd0di5jb219JzsKICAgICAgICAgICAgfSBlbHNlICovCiAgICAgICAgICAgIGlmKHVybC5pbmRleE9mKCcuZmx2JykhPS0xKXsKICAgICAgICAgICAgICAgIHVybCA9IHVybCArICc7e1VzZXItQWdlbnRAYXBwJiZSZWZlcmVyQCcgKyB2aXBVcmwgKyAnfSc7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHVybCA9PSAnJyA/ICcnIDogdXJsICsgJyNpc1ZpZGVvPXRydWUjJzsKICAgICAgICB9IGNhdGNoKGUpIHsKICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+ino+aekOWksei0pe+8jOW7uuiuruWIh+aNouino+aekCc7CiAgICAgICAgfQogICAgfSBlbHNlIHsKICAgICAgICByZXR1cm4gc3RyICsgdmlwVXJsOwogICAgfQp9OwoKdmFyIHBsYXlQYXJzZSA9IHsKICAgIHBsYXllcl94eDogZnVuY3Rpb24gKGp1cmwsIExhYmVsKSB7CiAgICAgICAgcmV0dXJuICQoanVybCkubGF6eVJ1bGUoKGspID0+IHsKICAgICAgICAgICAgdmFyIGpzVXJsID0ga1sxXTsKICAgICAgICAgICAgdmFyIExhYmVsID0ga1swXTsKICAgICAgICAgICAgdmFyIGZhID0gWydsZXR2JywgJ3BwdHYnLCAncXEnLCAneW91a3UnLCAncWl5aScsICdpcWl5aScsICdtZ3R2JywgJ2JpbGliaWxpJywgJ3NvaHUnICwnbWlndScsICdtMTkwNScsICd2aXAnXTsKICAgICAgICAgICAgdmFyIGh0bWwgPSBwYXJzZURvbShyZXF1ZXN0KGlucHV0KSwgTGFiZWwpOwogICAgICAgICAgICBldmFsKGh0bWwucmVwbGFjZSgvcGxheWVyXy4qPz17LywncGRhdGE9eycpKTsKICAgICAgICAgICAgZXZhbChmZXRjaChqc1VybCkpOwogICAgICAgICAgICBpZihwZGF0YS51cmwuc3Vic3RyKDAsOCkubWF0Y2goL0pULi5KVC4uLykpewogICAgICAgICAgICAgICAgcGRhdGEudXJsID0gYmFzZTY0RGVjb2RlKHBkYXRhLnVybCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYocGRhdGEudXJsLnN1YnN0cigwLDgpLm1hdGNoKC8lLi4lLi4vKSl7CiAgICAgICAgICAgICAgICBwZGF0YS51cmwgPSB1bmVzY2FwZShwZGF0YS51cmwpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmKGZhLmluY2x1ZGVzKHBkYXRhLmZyb20pPT10cnVlKXsKICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UocGRhdGEudXJsKTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHJldHVybiBwZGF0YS51cmwgKyAnI2lzVmlkZW89dHJ1ZSMnOwogICAgICAgICAgICB9CiAgICAgICAgfSwgW0xhYmVsLCBqc1VybF0pCiAgICB9Cn07CgoKZnVuY3Rpb24gc2V0UGFyc2UoKXsKICAgIGZ1bmN0aW9uIGNqVXBkYXRlKCl7CiAgICAgICAgdmFyIGpzRmlsZSA9IGZldGNoKF9teVNldC5jaik7CiAgICAgICAgd3JpdGVGaWxlKF9teVNldC5jamNhY2hlLCBqc0ZpbGUpOwogICAgfQogICAgZnVuY3Rpb24geDVVcGRhdGUoKXsKICAgICAgICB2YXIgeDVGaWxlID0gZmV0Y2goX215U2V0Lng1VXJsKTsKICAgICAgICB3cml0ZUZpbGUoX215U2V0Lng1Y2FjaGUsIHg1RmlsZSk7CiAgICB9CiAgICBpZighZmV0Y2goX215U2V0LmNqY2FjaGUpKXsKICAgICAgIGNqVXBkYXRlKCk7CiAgICB9CiAgICBpZighZmV0Y2goX215U2V0Lng1Y2FjaGUpKXsKICAgICAgIHg1VXBkYXRlKCk7CiAgICB9CiAgICBkLnB1c2goewogICAgICAgIGRlc2M6ICc1MzAnLAogICAgICAgIHVybDogX215U2V0Lng1Um91dGUsCiAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZScKICAgIH0pOwogICAgcHV0VmFyKCJteVNlbGVjdCIsIG15U2VsZWN0KTsKICAgIGlmKGdldFZhcigiRG5QYWdlIik9PSLlvIAiKXsKICAgICAgICB2YXIgb2xkdmVyc2lvbiA9IHZlcnNpb247CiAgICAgICAgdHJ5e2V2YWwoZmV0Y2goX215U2V0LmNqKSl9Y2F0Y2goZSl7dmVyc2lvbiA9IDB9OwogICAgICAgIHZhciB0aXRsZSA9ICfjgIDjgIDlj6/og73msqHmnInmm7TmlrDlk6bvvIHor7fnlZnmhI/orrrlnZvpgJrnn6XjgIInOwogICAgICAgIGlmKHZlcnNpb24gPiBvbGR2ZXJzaW9uKXsKICAgICAgICAgICAgdGl0bGUgPSAn44CA44CA6ISa5pys5bey5ZCM5q2l5pyA5paw54mI77yB6KeE5YiZ5pu05paw57u05oqk5ZyoUee+pOaIluiAheiuuuWdm+WPkeW4gyc7CiAgICAgICAgICAgIGNqVXBkYXRlKCk7CiAgICAgICAgICAgIHg1VXBkYXRlKCk7CiAgICAgICAgfQogICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vZnRwLmJtcC5vdmgvaW1ncy8yMDIxLzAyLzU1MjM4ODQwMzI3NWZkNmYuanBnJywKICAgICAgICAgICAgdGl0bGU6IHRpdGxlLAogICAgICAgICAgICBkZXNjOiAn54K55Ye76L+b5YWl6K665Z2b5biW5a2Q5YiX6KGoJywKICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9oYWlrdW9zaGlqaWUuY24vdXNlci8xOTU4JywKICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xJwogICAgICAgIH0pOwogICAgfQp9
Add Comment
Please, Sign In to add comment