Chrome-Plugin-Settings/Tampermonkey/tampermonkey-backup-chrome-2022-04-15T20-19-14-243Z.txt
2022-04-15 22:33:14 +02:00

1 line
2.3 MiB
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"created_by":"Tampermonkey","version":"1","scripts":[{"name":"Direct Google","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["/^https?\\:\\/\\/(www|news|maps|docs|cse|encrypted|mail)\\.google\\./"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-end","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1479475891050,"data":{}},"enabled":true,"position":1,"file_url":"https://rawgit.com/zanetu/direct_google/beta/direct_google.user.js","uuid":"80f863ba-ec02-4309-8fb5-f33390a9763c","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBEaXJlY3QgR29vZ2xlCi8vIEBuYW1lc3BhY2UgICAgaHR0cDovL3VzZXJzY3JpcHRzLm9yZy91c2Vycy85MjE0MwovLyBAdmVyc2lvbiAgICAgIDMuNwovLyBAZGVzY3JpcHRpb24gIFJlbW92ZXMgR29vZ2xlIHJlZGlyZWN0cyBhbmQgZXhwb3NlcyAiQ2FjaGVkIiBsaW5rcy4gCi8vIEBpbmNsdWRlICAgICAgL15odHRwcz9cOlwvXC8od3d3fG5ld3N8bWFwc3xkb2NzfGNzZXxlbmNyeXB0ZWR8bWFpbClcLmdvb2dsZVwuLwovLyBAYXV0aG9yICAgICAgIHphbmV0dQovL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l0aGlzLnN0eWxlLm1hcmdpblJpZ2h0ID0gJzAuNWVtJwoJCQkkKHRoaXMpLmNsb3Nlc3QoJ2Rpdi5hY3Rpb24tbWVudS5hYl9jdGwsIGRpdi5fbkJiJykKCQkJLmFmdGVyKCQodGhpcykpCgkJCS8vbWF0ZXJpYWwgZGVzaWduCgkJCS5wYXJlbnQoKS5jc3MoJ3doaXRlLXNwYWNlJywgJ25vd3JhcCcpCgkJfQoJKQp9Cgp2YXIgbW8gPSB3aW5kb3cuTXV0YXRpb25PYnNlcnZlciB8fCB3aW5kb3cuV2ViS2l0TXV0YXRpb25PYnNlcnZlcgppZihtbykgewoJdmFyIG9ic2VydmVyID0gbmV3IG1vKGhhbmRsZUNoYW5nZSkKCW9ic2VydmVyLm9ic2VydmUoZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LCB7Y2hpbGRMaXN0OiB0cnVlLCBzdWJ0cmVlOiB0cnVlfSkKfQovL2ZvciBjaHJvbWUgdjE4LSwgZmlyZWZveCB2MTQtLCBpbnRlcm5ldCBleHBsb3JlciB2MTEtLCBvcGVyYSB2MTUtIGFuZCBzYWZhcmkgdjYtCmVsc2UgewoJc2V0SW50ZXJ2YWwoaGFuZGxlQ2hhbmdlLCA1MDApCn0KaGFuZGxlQ2hhbmdlKCk=","requires":[{"meta":{"name":"jquery.min.js","url":"http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js","ts":1649334315592,"mimetype":"text/javascript"},"source":"LyohIGpRdWVyeSB2MS44LjMganF1ZXJ5LmNvbSB8IGpxdWVyeS5vcmcvbGljZW5zZSAqLwooZnVuY3Rpb24oZSx0KXtmdW5jdGlvbiBfKGUpe3ZhciB0PU1bZV09e307cmV0dXJuIHYuZWFjaChlLnNwbGl0KHkpLGZ1bmN0aW9uKGUsbil7dFtuXT0hMH0pLHR9ZnVuY3Rpb24gSChlLG4scil7aWYocj09PXQmJmUubm9kZVR5cGU9PT0xKXt2YXIgaT0iZGF0YS0iK24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YmZGVmaW5lKCJqcXVlcnkiLFtdLGZ1bmN0aW9uKCl7cmV0dXJuIHZ9KX0pKHdpbmRvdyk7"}]},{"name":"Wii-homebrew.com better header","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["http://forum.wii-homebrew.com*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1479475938124,"data":{}},"enabled":false,"position":2,"uuid":"dee7f03b-b8a7-49ad-a4a2-424456050e8f","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBXaWktaG9tZWJyZXcuY29tIGJldHRlciBoZWFkZXIKLy8gQG5hbWVzcGFjZSAgICBodHRwOi8vdGFtcGVybW9ua2V5Lm5ldC8KLy8gQHZlcnNpb24gICAgICAwLjEKLy8gQGRlc2NyaXB0aW9uICB0cnkgdG8gdGFrZSBvdmVyIHRoZSB3b3JsZCEKLy8gQGF1dGhvciAgICAgICBBbm8KLy8gQG1hdGNoICAgICAgICBodHRwOi8vZm9ydW0ud2lpLWhvbWVicmV3LmNvbSoKLy8gQGdyYW50ICAgICAgICBub25lCi8vID09L1VzZXJTY3JpcHQ9PQovKiBqc2hpbnQgLVcwOTcgKi8KJ3VzZSBzdHJpY3QnOwoKLy8gVGhpcyBmZXRjaGVzIGFsbCBvZiB0aGUgPGltZz4gdGFncyBhbmQgc3RvcmVzIHRoZW0gaW4gInRhZ3MiLgp2YXIgdGFncyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1lKCdpbWcnKTsKCi8v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Jld0xvZ28ucG5nJyk7CiAgdGFnc1tpXS5zcmMgPSB0YWdzW2ldLnNyYy5yZXBsYWNlKCdodHRwOi8vZm9ydW0ud2lpLWhvbWVicmV3LmNvbS93Y2YvaW1hZ2VzL3N0eWxlTG9nby0yZjUzMzY3YmE4YTU2NzEzYTk3YTI4ZWRiM2M0MWFmODNjMmFhNzMyLnBuZycsICdodHRwOi8vaW1nLnBvbnl3YXZlLmRlL2RpL0lHUEEvV2lpSG9tZWJyZXdMb2dvLnBuZycpOwogIHRhZ3NbaV0uc3JjID0gdGFnc1tpXS5zcmMucmVwbGFjZSgnaHR0cDovL2ZvcnVtLndpaS1ob21lYnJldy5jb20vd2NmL2ltYWdlcy9EZXNpZ25zL01hcmlvL3dpbnRlci9vbGRMb2dvRWRpdGVkLnBuZycsICdodHRwOi8vaW1nLnBvbnl3YXZlLmRlL2RpL0lHUEEvV2lpSG9tZWJyZXdMb2dvLnBuZycpOwp9"},{"name":"Removes the autoplay up next feature","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["*://www.youtube.com/*"],"orig_noframes":true,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1479475994064,"data":{}},"enabled":true,"position":3,"file_url":"https://gist.github.com/Yonezpt/51adf278a24488f75ff0/raw/f6faf0c2c6e7f2523cc88711405b2d9895700921/YT%2520RMV-AP-UN.user.js","uuid":"6a0b83b8-68d9-47ef-873f-038e77944d0c","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQHZlcnNpb24gIDEuMC4yCi8vIEBuYW1lICAgICBSZW1vdmVzIHRoZSBhdXRvcGxheSB1cCBuZXh0IGZlYXR1cmUKLy8gQG1hdGNoICAgICo6Ly93d3cueW91dHViZS5jb20vKgovLyBAcnVuLWF0ICAgZG9jdW1lbnQtc3RhcnQKLy8gQGdyYW50ICAgIG5vbmUKLy8gQG5vZnJhbWVzCi8vID09L1VzZXJTY3JpcHQ9PQooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwogICAgZnVuY3Rpb24gcmVtb3ZlQVBVTigpIHsKICAgICAgICB2YXIgYXV0b3BsYXliYXIgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCdhdXRvcGxheS1iYXInKVswXTsKICAgICAgICBpZiAoYXV0b3BsYXliYXIpIHsKICAgICAgICAgICAgYXV0b3BsYXliYXIucmVtb3ZlQXR0cmlidXRlKCdjbGFzcycpOwogICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCdjaGVja2JveC1vbi1vZmYnKVswXS5yZW1vdmUoKTsKICAgICAgICB9CiAgICB9CiAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcigncmVhZHlzdGF0ZWNoYW5nZScsIHJlbW92ZUFQVU4sIHRydWUpOwogICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoJ3NwZmRvbmUnLCByZW1vdmVBUFVOKTsKfSgpKTs="},{"name":"MyDealz Enhancer","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["http://www.mydealz.de/*","https://www.mydealz.de/*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1479476020177,"data":{}},"enabled":false,"position":4,"file_url":"https://greasyfork.org/scripts/10885-mydealz-enhancer/code/MyDealz%20Enhancer.user.js","uuid":"d341b7fc-e2cb-48b8-a685-e33f7f30cf50","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIE15RGVhbHogRW5oYW5jZXIKLy8gQG5hbWVzcGFjZSAgIG15ZGVhbHpfZW5oYW5jZXIKLy8gQGRlc2NyaXB0aW9uIFZlcmJlc3NlcnQgRnVua3Rpb25lbiB2b24gTXlEZWFseiwgb2RlciBzdGVsbHQgc2llIHdpZWRlciBoZXIKLy8gQGF1dGhvcglCQUVSbmFkbwovLyBAY29udHJpYnV0b3IJbG9sbmlja25hbWUgKHJlbW9kZWxOYXZCYXIsIGdyYWJRdW90ZSwgbWF4UXVvdGVzLCBlcnJvci1kaXNwbGF5IFthdmF0YXIgYm9yZGVyXSkKLy8gQGNvbnRyaWJ1dG9yCXJpY2hpMmsgKG1vZGlmeVNlYXJjaC1UZWlsZSwgc2hvd1VzZXJJbmZvLCBlbWJlZFlvdXR1YmUsIG1pbmltaXplUXVvdGVzLCBkZWFsVGV4dFByZXZpZXcpCi8vIEBjb250cmlidXRvcgl2aWVsbGVpY2h0bWFubjEgKEltYWdlIFByZXZpZXcpCi8vIEBjb250cmlidXRvcglOaWNvIChpbnNlcnREaXJlY3RMaW5rLUlkZWUpCi8vIEBpbmNsdWRlICAgICBodHRwOi8vd3d3Lm15ZGVhbHouZGUvKgovLyBAaW5jbHVkZSAgICAgaHR0cHM6Ly93d3cubXlkZWFsei5kZS8qCi8vIEB2ZXJzaW9uICAgICAxLjUuMDE3Ci8vIEByZXF1aXJlCWh0dHA6Ly9jb2RlLmpxdWVyeS5jb20vanF1ZXJ5LTIuMS40Lm1pbi5qcwovLyBAZ3JhbnQgICAgICAgR01fZ2V0VmFsdWUKLy8gQGdyYW50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lfbm9FcnJvciA9IGZhbHNlOwoJCX0KCgkJaWYoX25vRXJyb3IpIHsKCQkJaWYoc2V0dGluZ3MuYmVoYXZpb3Iuc2hvd0dyZWVuRG90cykgewoJCQkJJCgnLnVzZXJCYXItbGluayAuYXZhdGFyLWltYWdlJykuY3NzKCdib3JkZXInLCAnMXB4IGRvdHRlZCAjMDBmZjAwJyk7CgkJCX0KCQl9IGVsc2UgewoJCQkkKCcudXNlckJhci1saW5rIC5hdmF0YXItaW1hZ2UnKS5jc3MoJ2JvcmRlcicsICcxcHggZG90dGVkICNhYTAwMDAnKTsKCQl9Cgl9CgoJaW5pdCgpOwp9CgovLyBFcnN0IGxhZGVuLCB3ZW5uIERPTSBmZXJ0aWcgaXN0CmlmKGRvY3VtZW50LnJlYWR5U3RhdGUgPT0gJ2ludGVyYWN0aXZlJykgewoJTW9kaWZ5UGFnZSgpOwp9IGVsc2UgewoJJChkb2N1bWVudCkucmVhZHkoTW9kaWZ5UGFnZSk7Cn0=","requires":[{"meta":{"name":"jquery-2.1.4.min.js","url":"http://code.jquery.com/jquery-2.1.4.min.js","ts":1479476020290,"mimetype":"text/javascript"},"source":"LyohIGpRdWVyeSB2Mi4xLjQgfCAoYykgMjAwNSwgMjAxNSBqUXVlcnkgRm91bmRhdGlvbiwgSW5jLiB8IGpxdWVyeS5vcmcvbGljZW5zZSAqLwohZnVuY3Rpb24oYSxiKXsib2JqZWN0Ij09dHlwZW9mIG1vZHVsZSYmIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUuZXhwb3J0cz9tb2R1bGUuZXhwb3J0cz1hLmRvY3VtZW50P2IoYSwhMCk6ZnVuY3Rpb24oYSl7aWYoIWEuZG9jdW1lbnQpdGhyb3cgbmV3IEVycm9yKCJqUXVlcnkgcmVxdWlyZXMgYSB3aW5kb3cgd2l0aCBhIGRvY3VtZW50Iik7cmV0dXJuIGIoYSl9OmIoYSl9KCJ1bmRlZmluZWQiIT10eXBlb2Ygd2luZG93P3dpbmRvdzp0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iYoYS5qUXVlcnk9YS4kPW4pLG59KTsK"}]},{"name":"Direct Google Images","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["/^https?\\:\\/\\/(www|encrypted)\\.google\\./"],"orig_matches":[],"orig_noframes":true,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1479476075894,"data":{}},"enabled":true,"position":5,"file_url":"https://rawgit.com/zanetu/direct_google_images/beta/direct_google_images.user.js","uuid":"e740f07b-df0c-4a85-ab0c-05d7d8572962","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBEaXJlY3QgR29vZ2xlIEltYWdlcwovLyBAbmFtZXNwYWNlICAgIGh0dHA6Ly9ncmVhc3lmb3JrLm9yZy9lbi91c2Vycy80NjEKLy8gQHZlcnNpb24gICAgICAwLjk5Ci8vIEBkZXNjcmlwdGlvbiAgUHJvdmlkZXMgZGlyZWN0IGxpbmtzIGluIEdvb2dsZSBJbWFnZXMuCi8vIEBpbmNsdWRlICAgICAgL15odHRwcz9cOlwvXC8od3d3fGVuY3J5cHRlZClcLmdvb2dsZVwuLwovLyBAYXV0aG9yICAgICAgIHphbmV0dQovLyBAbGljZW5zZSAgICAgIEdQTCB2ZXJzaW9uIDIgb3IgYW55IGxhdGVyIHZlcnNpb247IGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy9ncGwtMi4wLnR4dAovLyBAZ3JhbnQgICAgICAgIEdNX2FkZFN0eWxlCi8vIEBydW4tYXQgICAgICAgZG9jdW1lbnQtc3RhcnQKLy8gQG5vZnJ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bGljayhhQ29udGFpbmVyKQoJCQl9CgkJCWlmKGlzRGlyZWN0KGFDb250YWluZXIpKSB7CgkJCQlpZignbW91c2VlbnRlcicgIT09IGV2ZW50LnR5cGUpIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpCgkJCQlyZXR1cm4KCQkJfQoJCQlpZignbW91c2VlbnRlcicgPT09IGV2ZW50LnR5cGUpIHsKCQkJCWlmKCFtb2RpZnlHb29nbGVJbWFnZShhQ29udGFpbmVyKSkgewoJCQkJCXZhciBvYnNlcnZlciA9IG5ldyBNdXRhdGlvbk9ic2VydmVyKGZ1bmN0aW9uKG11dGF0aW9uUmVjb3JkcykgewoJCQkJCQlmb3IodmFyIGogaW4gbXV0YXRpb25SZWNvcmRzKSB7CgkJCQkJCQltb2RpZnlHb29nbGVJbWFnZShtdXRhdGlvblJlY29yZHNbal0udGFyZ2V0KQoJCQkJCQl9CgkJCQkJfSkKCQkJCQlvYnNlcnZlci5vYnNlcnZlKGFDb250YWluZXIsIHthdHRyaWJ1dGVzOiB0cnVlfSkKCQkJCQl0cmlnZ2VyTW91c2VFdmVudCh0LCAnbW91c2Vkb3duJykKCQkJCX0KCQkJfQoJCX0sIHRydWUpCgl9Cn0K"},{"name":"Anti-Adblock Killer | Reek","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":true,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":["*"],"orig_excludes":[],"orig_includes":["http://*/*","https://*/*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1569177800622,"data":{"autoPlay":"bfalse","checkList":"bfalse","checkUpdate":"btrue","debug":"bfalse","forceVLC":"bfalse","logDetected":"bfalse","logExcluded":"bfalse","logInsertedNodes":"bfalse","logInterceptedScripts":"bfalse","logPlayer":"bfalse","logRemovedNodes":"bfalse","logXhr":"bfalse","nextchecklist":"s1488491840311","nextcheckupdate":"s1569782600622","videoHD":"bfalse"}},"enabled":false,"position":6,"file_url":"https://raw.githubusercontent.com/reek/anti-adblock-killer/master/anti-adblock-killer.user.js","uuid":"7bd1dfa1-b3cd-47d6-ad60-b5a8ebbebf6b","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgQW50aS1BZGJsb2NrIEtpbGxlciB8IFJlZWsKLy8gQG5hbWVzcGFjZSBodHRwczovL3VzZXJzY3JpcHRzLm9yZy9zY3JpcHRzL3Nob3cvMTU1ODQwCi8vIEBkZXNjcmlwdGlvbiBIZWxwcyB5b3Uga2VlcCB5b3VyIEFkLUJsb2NrZXIgYWN0aXZlLCB3aGVuIHlvdSB2aXNpdCBhIHdlYnNpdGUgYW5kIGl0IGFza3MgeW91IHRvIGRpc2FibGUuCi8vIEBhdXRob3IgUmVlayB8IHJlZWtzaXRlLmNvbQovLyBAdmVyc2lvbiAxMC4wCi8vIEBlbmNvZGluZyB1dGYtOAovLyBAbGljZW5zZSBodHRwczovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnktc2EvNC4wLwovLyBAaWNvbiBodHRwczovL3Jhdy5naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9tYXN0ZXIvYW50aS1hZGJsb2NrLWtpbGxlci1pY29uLnBuZwovLyBAaG9tZXBhZ2UgaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci8KLy8gQHR3aXR0ZXJVUkwgaHR0cHM6Ly90d2l0dGVyLmNvbS9hbnRpYWRia2lsbGVyCi8vIEBjb250YWN0VVJMIGh0dHBzOi8vcmVlay5naXRodWIuaW8vYW50aS1hZGJsb2NrLWtpbGxlci8jY29udGFjdA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BBZGJsb2NrIEtpbGxlciwgd2hvIHJlcG9ydCBwcm9ibGVtcywgd2hvIHdyaXRlIHRoZSByZXZpZXcsIHdoaWNoIGFkZCB0byB0aGVpciBmYXZvcml0ZXMsIG1ha2luZyBkb25hdGlvbnMsIHdoaWNoIHN1cHBvcnQgdGhlIHByb2plY3QgYW5kIGhlbHAgaW4gaXRzIGRldmVsb3BtZW50IG9yIHByb21vdGUuCgo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgTWlycm9ycwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgogIEdpdGh1YjogaHR0cDovL3Rpbnl1cmwuY29tL21jcmEzZG4KICBHcmVhc3lmb3JrOiBodHRwOi8vdGlueXVybC5jb20vcGJiZG5oNgogIE9wZW51c2VyanM6IGh0dHA6Ly90aW55dXJsLmNvbS9ubnFqZTMyCiAgTW9ua2V5R3V0czogaHR0cDovL3Rpbnl1cmwuY29tL2thNWZjcW0KICBVc2Vyc2NyaXB0czogaHR0cDovL3Rpbnl1cmwuY29tL3E4eGNlamwKCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICBEb2N1bWVudGF0aW9uCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCiAgR3JlYXNlbW9ua2V5OiBodHRwOi8vdGlueXVybC5jb20veWVlZm5qNQogIFNjcmlwdGlzaDogaHR0cDovL3Rpbnl1cmwuY29tL2NuZDlua2QKICBUYW1wZXJtb25rZXk6IGh0dHA6Ly90aW55dXJsLmNvbS9wZHl0ZmRlCiAgVmlvbGVudG1vbmtleTogaHR0cDovL3Rpbnl1cmwuY29tL24zNHduNmoKICBOaW5qYUtpdDogaHR0cDovL3Rpbnl1cmwuY29tL3Bra205dWcKCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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jbHVkZXMgZG9tYWlucy4nLAogICAgICAgIGluZm8gOiAnJwogICAgICB9LAogICAgICBsb2dYaHIgOiB7CiAgICAgICAgZ3JvdXAgOiAnZGVidWcnLAogICAgICAgIHR5cGUgOiAnY2hlY2tib3gnLAogICAgICAgIHZhbHVlIDogZmFsc2UsCiAgICAgICAgbGFiZWwgOiAnTG9nIEhUVFAgcmVxdWVzdHMnLAogICAgICAgIGluZm8gOiAnJwogICAgICB9LAogICAgICBsb2dQbGF5ZXIgOiB7CiAgICAgICAgZ3JvdXAgOiAnZGVidWcnLAogICAgICAgIHR5cGUgOiAnY2hlY2tib3gnLAogICAgICAgIHZhbHVlIDogZmFsc2UsCiAgICAgICAgbGFiZWwgOiAnTG9nIHBsYXllciBpbnN0YW5jZXMuJywKICAgICAgICBpbmZvIDogJycKICAgICAgfSwKICAgICAgbG9nSW50ZXJjZXB0ZWRTY3JpcHRzIDogewogICAgICAgIGdyb3VwIDogJ2RlYnVnJywKICAgICAgICB0eXBlIDogJ2NoZWNrYm94JywKICAgICAgICB2YWx1ZSA6IGZhbHNlLAogICAgICAgIGxhYmVsIDogJ0xvZyBpbnRlcmNlcHRlZCBzY3JpcHRzLicsCiAgICAgICAgaW5mbyA6ICcnCiAgICAgIH0sCiAgICAgIGxvZ0RldGVjdGVkIDogewogICAgICAgIGdyb3VwIDogJ2RlYnVnJywKICAgICAgICB0eXBlIDogJ2NoZWNrYm94JywKICAgICAgICB2YWx1ZSA6IGZhbHNlLAogICAgICAgIGxhYmVsIDogJ0xvZyBkZXRlY3RlZCBhbnRpLWFkYmxvY2tzLicsCiAgICAgICAgaW5mbyA6ICcnCiAgICAgIH0KICAgIH0sCiAgICByZWdpc3RlclNldHRpbmdzIDogZnVuY3Rpb24gKCkgewogICAgICBmb3IgKHZhciBvcHROYW1lIGluIEFhay5vcHRpb25zKSB7CiAgICAgICAgaWYgKEFhay5vcHRpb25zLmhhc093blByb3BlcnR5KG9wdE5hbWUpKQogICAgICAgICAgQWFrLm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5lZCcsCiAgICAgICAgICBHTV9zZXRDbGlwYm9hcmQgOiB0eXBlb2YgR01fc2V0Q2xpcGJvYXJkICE9ICd1bmRlZmluZWQnCiAgICAgICAgfTsKICAgICAgfQogICAgfSwKICAgIGdvIDogZnVuY3Rpb24gKHVybCkgewogICAgICB3aW5kb3cubG9jYXRpb24uaHJlZiA9IHVybDsKICAgIH0sCiAgICByZWZyZXNoIDogZnVuY3Rpb24gKCkgewogICAgICB3aW5kb3cubG9jYXRpb24uaHJlZiA9IHdpbmRvdy5sb2NhdGlvbi5ocmVmOwogICAgfSwKICAgIHJlbG9hZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgd2luZG93LmxvY2F0aW9uLnJlbG9hZCh0cnVlKTsKICAgIH0sCiAgICBjb250YWlucyA6IGZ1bmN0aW9uIChzdHJpbmcsIHNlYXJjaCkgewogICAgICByZXR1cm4gc3RyaW5nLmluZGV4T2Yoc2VhcmNoKSAhPSAtMTsKICAgIH0sCiAgICBnZXRCcm93c2VyIDogZnVuY3Rpb24gKCkgewogICAgICB2YXIgdWEgPSB3aW5kb3cubmF2aWdhdG9yLnVzZXJBZ2VudDsKICAgICAgaWYgKEFhay5jb250YWlucyh1YSwgJ0ZpcmVmb3gnKSkgewogICAgICAgIHJldHVybiAiRmlyZWZveCI7CiAgICAgIH0gZWxzZSBpZiAoQWFrLmNvbnRhaW5zKHVhLCAnU2xlaXBuaXInKSkgewogICAgICAgIHJldHVybiAiU2xlaXBuaXIiOyAvLyBNb2JpbGUKICAgICAgfSBlbHNlIGlmIChBYWsuY29udGFpbnModWEsICdVQ0Jyb3dzZXInKSkgewogICAgICAgIHJldHVybiAiVUNCcm93c2VyIjsgLy8gTW9iaWxlCiAgICAgIH0gZWxzZSBpZiAoQWFrLmNvbnRhaW5zKHVhLCAnRG9sZmluJykpIHsKICAgICAgICByZXR1cm4gIkRvbHBoaW4iOyAvLyBNb2JpbGUKICAgICAgfSBlbHNlIGlmIChBYWsuY29udGFpbnModWEsICdNU0lFJykpIHsKICAgICAgICByZXR1cm4gIkludGVybmV0RXhwbG9yZXIiOwogICAgICB9IGVsc2UgaWYgKEFhay5jb250YWlucyh1YSwgJ01pZG9yaScpKSB7CiAgICAgICAgcmV0dXJuICJNaWRvcmkiOwogICAgICB9IGVsc2UgaWYgKEFhay5jb250YWlucyh1YSwgJ09wZXJhJykgfHwgQWFrLmNvbnRhaW5zKHVhLCAnT1BSJykpIHsKICAgICAgICByZXR1cm4gIk9wZXJhIjsKICAgICAgfSBlbHNlIGlmIChBYWsuY29udGFpbnModWEsICdDaHJvbWUnKSkgewogICAgICAgIHJldHVybiAiQ2hyb21lIjsKICAgICAgfSBlbHNlIGlmIChBYWsuY29udGFpbnModWEsICdTYWZhcmknKSkgewogICAgICAgIHJldHVybiAiU2FmYXJpIjsKICAgICAgfSBlbHNlIGlmIChBYWsuY29udGFpbnModWEsICdLb25xdWVyb3InKSkgewogICAgICAgIHJldHVybiAiS29ucXVlcm9yIjsKICAgICAgfSBlbHNlIGlmIChBYWsuY29udGFpbnModWEsICdQYWxlTW9vbicpKSB7CiAgICAgICAgcmV0dXJuICJQYWxlTW9vbiI7IC8vIGZvcmsgZmlyZWZveAogICAgICB9IGVsc2UgaWYgKEFhay5jb250YWlucyh1YSwgJ0N5YmVyZm94JykpIHsKICAgICAgICByZXR1cm4gIkN5YmVyZm94IjsgLy8gZm9yayBmaXJlZm94CiAgICAgIH0gZWxzZSBpZiAoQWFrLmNvbnRhaW5zKHVhLCAnU2VhTW9ua2V5JykpIHsKICAgICAgICByZXR1cm4gIlNlYU1vbmtleSI7IC8vIGZvcmsgZmlyZWZveAogICAgICB9IGVsc2UgaWYgKEFhay5jb250YWlucyh1YSwgJ0ljZXdlYXNlbCcpKSB7CiAgICAgICAgcmV0dXJuICJJY2V3ZWFzZWwiOyAvLyBmb3JrIGZpcmVmb3gKICAgICAgfSBlbHNlIHsKICAgICAgICByZXR1cm4gdWE7CiAgICAgIH0KICAgIH0sCiAgICBnZXRWZX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DoxMHB4OycsCiAgICAgICAgICB3aWR0aCA6ICczNjBweCcsCiAgICAgICAgICBoZWlnaHQgOiAnMTIwcHgnLAogICAgICAgICAgZnJhbWVib3JkZXIgOiAwLAogICAgICAgICAgc2Nyb2xsaW5nIDogJ25vJywKICAgICAgICAgIC8vc3JjIDogJy8vbG9jYWxob3N0L2dpdC9hbnRpLWFkYmxvY2sta2lsbGVyLXBhZ2VzL25vdGlmaWNhdGlvbi5odG1sIycgKyBidG9hKG1lc3NhZ2UpLAogICAgICAgICAgc3JjIDogJy8vcmVlay5naXRodWIuaW8vYW50aS1hZGJsb2NrLWtpbGxlci9ub3RpZmljYXRpb24uaHRtbCMnICsgd2luZG93LmJ0b2EobWVzc2FnZSksCiAgICAgICAgICBhcHBlbmQgOiAnYm9keScsCiAgICAgICAgICBjYWxsYmFjayA6IGZ1bmN0aW9uIChzZWxmKSB7CgogICAgICAgICAgICAvLyBtYW51YWxseSByZW1vdmUKICAgICAgICAgICAgQWFrLm9uRXZlbnQod2luZG93LCAibWVzc2FnZSIsIGZ1bmN0aW9uIChldmVudCkgewogICAgICAgICAgICAgIGlmIChldmVudC5kYXRhID09ICJyZW1vdmVOb3RpZmljYXRpb24iKSB7CiAgICAgICAgICAgICAgICBzZWxmLnJlbW92ZSgpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwgZmFsc2UpOwoKICAgICAgICAgICAgLy8gYXV0b21hdGljYWxseSByZW1vdmUKICAgICAgICAgICAgd2luZG93LnNldFRpbWVvdXQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgIHNlbGYucmVtb3ZlKCk7CiAgICAgICAgICAgIH0sIGRlbGF5IHx8IDNlNCk7CiAgICAgICAgICB9CiAgICAgICAgfSk7CgogICAgICB9CiAgICB9LAogICAgY2hlY2tMaXN0IDogZnVuY3Rpb24gKCkgewogICAgICBpZiAoQWFrLnVzZUdNICYmIEFhay5vcHRzLmNoZWNrTGlzdCAmJiBBYWsuaXNUb3BmcmFtZSkgewogICAgICAgIEFhay5zY2hlZHVsZSgxLCAnbmV4dGNoZWNrbGlzdCcsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5yZWFkeShmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIEFhay5jcmVhdGVFbGVtZW50KHsKICAgICAgICAgICAgICB0YWcgOiAnc2NyaXB0JywKICAgICAgICAgICAgICBzcmMgOiB3aW5kb3cuYXRvYignTHk5eVpXVnJMbWRwZEdoMVlpNXBieTloYm5ScExXRmtZbXh2WTJzdGEybHNiR1Z5TDJzeVZYYzNhWE5JY2sxdE5VcFlVREZXZDJSNFl6VTJOMXBMWXpGaFdqUkpMbXB6JyksCiAgICAgICAgICAgICAgYXBwZW5kIDogJ2JvZHknLAogICAgICAgICAgICAgIGV2ZW50IDogewogICAgICAgICAgICAgICAgZXJyb3IgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgIHRoaXMucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICAgIEFhay5pbmZvKCdBYWtMaXN0IGRldGVjdGVkICEnKTsKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBsb2FkIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgICBBYWsud2FybignQWFrTGlzdCBub3QgZGV0ZWN0ZWQgIScpOwogICAgICAgICAgICAgICAgICBBYWsubm90aWZpY2F0aW9uKCdJdCBzZWVtcyB0aGF0IHlvdSBoYXZlIG5vdCBzdWJzY3JpYmVkIG9yIGRpc2FibGVkIDxiPkFha0xpc3Q8L2I+LiA8YSBocmVmPSInICsgQWFrLnN1YnNjcmliZVVSTCArICciIHRhcmdldD0iX2JsYW5rIj5TdWJzY3JpYmU8L2E+IG9yIDxhIGhyZWY9IicgKyBBYWsuc2V0dGluZ3NVUkwgKyAnIiB0YXJnZXQ9Il9ibGFuayI+RGlzYWJsZSB0aGlzIGFsZXJ0PC9hPicpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KTsKICAgICAgICB9KTsKICAgICAgfQogICAgfSwKICAgIGNoZWNrVXBkYXRlIDogZnVuY3Rpb24gKGF1dG8pIHsKCiAgICAgIHZhciBjaGVjayA9IGZ1bmN0aW9uIChub3RpZnlGYWxzZSkgewogICAgICAgIEFhay5yZXF1ZXN0KHsKICAgICAgICAgIHVybCA6IEFhay5kb3dubG9hZFVSTCwKICAgICAgICAgIG9ubG9hZCA6IGZ1bmN0aW9uIChyZXNwb25zZSkgewogICAgICAgICAgICB2YXIgcmVzID0gcmVzcG9uc2UucmVzcG9uc2VUZXh0OwogICAgICAgICAgICB2YXIgc3RhdHVzID0gcmVzcG9uc2Uuc3RhdHVzOwogICAgICAgICAgICBpZiAoc3RhdHVzID09IDIwMCkgewogICAgICAgICAgICAgIHZhciBsb2NhbCA9IEFhay5nZXRWZXJzaW9uKCk7CiAgICAgICAgICAgICAgdmFyIHJlbW90ZSA9IE51bWJlcihyZXMubWF0Y2goL0B2ZXJzaW9uXHMrKFxkK1wuXGQrKS8pWzFdKTsKICAgICAgICAgICAgICBpZiAobG9jYWwgPCByZW1vdGUpIHsKICAgICAgICAgICAgICAgIEFhay5ub3RpZmljYXRpb24oJ0FudGktQWRibG9jayBLaWxsZXIgdicgKyByZW1vdGUgKyAnIGlzIGF2YWlsYWJsZSA8YSB0YXJnZXQ9Il9ibGFuayIgaHJlZj0iJyArIEFhay5kb3dubG9hZFVSTCArICciPkluc3RhbGw8L2E+LicpOwogICAgICAgICAgICAgIH0gZWxzZSBpZiAobm90aWZ5RmFsc2UpIHsKICAgICAgICAgICAgICAgIEFhay5ub3RpZmljYXRpb24oJ05vIHVwZGF0ZSBmb3VuZC4nKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9KTsKICAgICAgfTsKCiAgICAgIGlmIChhdXRvKSB7IC8vIGF1dG8gbW9kZQogICAgICAgIGlmIChBYWsudXNlR00gJiYgQWFrLm9wdHMuY2hlY2tVcGRhdGUgJiYgQWFrLmlzVG9wZnJhbWUpIHsKICAgICAgICAgIEFhay5yZWFkeShmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIEFhay5zY2hlZHVsZSg3LCAnbmV4dGNoZWNrdXBkYXRlJywgZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgIGNoZWNrKGZhbHNlKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0gZWxzZSB7IC8vIG1hbnVhbCBtb2RlCiAgICAgICAgaWYgKEFhay5pc1RvcGZyYW1lKSB7CiAgICAgICAgICBjaGVjayh0cnVlKTsKICAgICAgICB9CiAgICAgIH0KCiAgICB9LAogICAgb3BlbkluVGFiIDogZnVuY3Rpb24gKHVybCkgewogICAgICBpZiAodHlwZW9mIEdNX29wZW5JblRhYiAhPSAndW5kZWZpbmVkJykgewogICAgICAgIEdNX29wZW5JblRhYih1cmwpOwogICAgICB9IGVsc2UgewogICAgICAgIHZhciBuZXdXaW5kb3cgPSB3aW5kb3cub3Blbih1cmwsICJfYmxhbmsiKTsKICAgICAgICBuZXdXaW5kb3cuZm9jdXMoKTsKICAgICAgfQogICAgfSwKICAgIHJlcXVlc3QgOiBmdW5jdGlvbiAoc2V0dGluZ3MpIHsKICAgICAgc2V0dGluZ3MudXJsID0gc2V0dGluZ3MudXJsIHx8ICcnOwogICAgICBzZXR0aW5ncy5tZXRob2QgPSBzZXR0aW5ncy5tZXRob2QgfHwgJ0dFVCc7CiAgICAgIHNldHRpbmdzLmhlYWRlcnMgPSBzZXR0aW5ncy5oZWFkZXJzIHx8IHt9OwogICAgICBzZXR0aW5ncy50aW1lb3V0ID0gc2V0dGluZ3MudGltZW91dCB8fCAyZTQ7IC8vIDIwcwogICAgICBpZiAoc2V0dGluZ3MuZGF0YSB8fCBzZXR0aW5ncy5tZXRob2QgPT0gJ1BPU1Qn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gICAgICAgLy8gZG9jOiBodHRwOi8vdGlueXVybC5jb20vb2R6NjY0YQogICAgICAgIC8vIGRvYzogaHR0cDovL3Rpbnl1cmwuY29tL3A5enJ1em4KICAgICAgICB2YXIgeGhyID0gbmV3IHdpbmRvdy5YTUxIdHRwUmVxdWVzdCgpOwogICAgICAgIHhoci5vcGVuKCdQT1NUJywgJ2h0dHA6Ly9yZWVrc2l0ZS5jb20vcHVibGljL3hoci5waHAnLCB0cnVlKTsKICAgICAgICB4aHIuc2V0UmVxdWVzdEhlYWRlcignQ29udGVudC10eXBlJywgJ2FwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCcpOwogICAgICAgIHhoci5vbmxvYWQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICB2YXIgcmVzID0geGhyLnJlc3BvbnNlVGV4dDsKICAgICAgICAgIHZhciBqc29uID0gSlNPTiAmJiBKU09OLnBhcnNlKHJlcyk7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoeGhyLCAicmVzcG9uc2VUZXh0IiwgewogICAgICAgICAgICBlbnVtZXJhYmxlIDogdHJ1ZSwKICAgICAgICAgICAgY29uZmlndXJhYmxlIDogdHJ1ZSwKICAgICAgICAgICAgd3JpdGFibGUgOiB0cnVlLAogICAgICAgICAgICB2YWx1ZSA6IGpzb24ucmVzcG9uc2UKICAgICAgICAgIH0pOwogICAgICAgICAgc2V0dGluZ3Mub25sb2FkKHhocik7CiAgICAgICAgfTsKICAgICAgICB4aHIuc2VuZChBYWsuc2VyaWFsaXplKHNldHRpbmdzKSk7CiAgICAgIH0KICAgIH0sCiAgICBkZWxldGVWYWx1ZSA6IGZ1bmN0aW9uIChuYW1lKSB7CiAgICAgIGlmICh0eXBlb2YgR01fZGVsZXRlVmFsdWUgIT09ICJ1bmRlZmluZWQiICYmICFuYW1lKSB7CiAgICAgICAgdmFyIHZhbHMgPSBHTV9saXN0VmFsdWVzKCk7CiAgICAgICAgZm9yICh2YXIgaSBpbiB2YWxzKSB7CiAgICAgICAgICBpZiAodmFscy5oYXNPd25Qcm9wZXJ0eShpKSkKICAgICAgICAgICAgR01fZGVsZXRlVmFsdWUodmFsc1tpXSk7CiAgICAgICAgfQogICAgICB9IGVsc2UgaWYgKHR5cGVvZiBHTV9kZWxldGVWYWx1ZSAhPT0gInVuZGVmaW5lZCIpIHsKICAgICAgICBHTV9kZWxldGVWYWx1ZShuYW1lKTsKICAgICAgfQogICAgfSwKICAgIHNldFZhbHVlIDogZnVuY3Rpb24gKG5hbWUsIHZhbHVlKSB7CiAgICAgIGlmICh0eXBlb2YgR01fc2V0VmFsdWUgIT09ICJ1bmRlZmluZWQiKSB7CiAgICAgICAgR01fc2V0VmFsdWUobmFtZSwgdmFsdWUpOwogICAgICB9CiAgICB9LAogICAgZ2V0VmFsdWUgOiBmdW5jdGlvbiAobmFtZSkgewogICAgICBpZiAodHlwZW9mIEdNX2xpc3RWYWx1ZXMgIT09ICJ1bmRlZmluZWQiICYmICFuYW1lKSB7CiAgICAgICAgdmFyIGxpc3QgPSB7fTsKICAgICAgICB2YXIgdmFscyA9IEdNX2xpc3RWYWx1ZXMoKTsKICAgICAgICBmb3IgKHZhciBpIGluIHZhbHMpIHsKICAgICAgICAgIGlmICh2YWxzLmhhc093blByb3BlcnR5KGkpKQogICAgICAgICAgICBsaXN0W3ZhbHNbaV1dID0gR01fZ2V0VmFsdWUodmFsc1tpXSk7CiAgICAgICAgfQogICAgICAgIHJldHVybiBsaXN0OwogICAgICB9IGVsc2UgaWYgKHR5cGVvZiBHTV9nZXRWYWx1ZSAhPT0gInVuZGVmaW5lZCIgJiYgdHlwZW9mIEdNX2dldFZhbHVlKG5hbWUpICE9PSAidW5kZWZpbmVkIikgewogICAgICAgIHJldHVybiBHTV9nZXRWYWx1ZShuYW1lKTsKICAgICAgfSBlbHNlIHsKICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgfQogICAgfSwKICAgIHNldExvY2FsIDogZnVuY3Rpb24g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c3QoewogICAgICAgIHVybCA6IHVybCwKICAgICAgICBvbmxvYWQgOiBmdW5jdGlvbiAocmVzdWx0KSB7CiAgICAgICAgICB2YXIgcmF3U2NyaXB0ID0gcmVzdWx0LnJlc3BvbnNlVGV4dDsKICAgICAgICAgIChuZXcgRnVuY3Rpb24oJ0FhaycsIHJhd1NjcmlwdCArICdcblxyJyArIEFhay5pbnRvU3RyaW5nKGNhbGxiYWNrKSkpKEFhayk7CiAgICAgICAgfQogICAgICB9KTsKICAgIH0sCiAgICBpbnRvU3RyaW5nIDogZnVuY3Rpb24gKGEpIHsKICAgICAgaWYgKHR5cGVvZiBhID09PSAnZnVuY3Rpb24nKSB7CiAgICAgICAgdmFyIHN0ciA9IGEudG9TdHJpbmcoKTsKICAgICAgICB2YXIgZmlyc3QgPSBzdHIuaW5kZXhPZigieyIpICsgMTsKICAgICAgICB2YXIgbGFzdCA9IHN0ci5sYXN0SW5kZXhPZigifSIpOwogICAgICAgIHJldHVybiBzdHIuc3Vic3RyKGZpcnN0LCBsYXN0IC0gZmlyc3QpLnRyaW0oKTsKICAgICAgfSBlbHNlIGlmICh0eXBlb2YgZW50cnkgPT09ICdvYmplY3QnKSB7CiAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KGEpOwogICAgICB9IGVsc2UgeyAvLyBhcnJheSBvciBzdHJpbmcKICAgICAgICByZXR1cm4gYS50b1N0cmluZygpOwogICAgICB9CiAgICB9LAogICAgaW50b0FycmF5IDogZnVuY3Rpb24gKGEpIHsKICAgICAgaWYgKHR5cGVvZiBhID09PSAnb2JqZWN0JykgewogICAgICAgIHJldHVybiBPYmplY3Qua2V5cyhhKS5tYXAoZnVuY3Rpb24gKGtleSkgewogICAgICAgICAgcmV0dXJuIGFba2V5XTsKICAgICAgICB9KTsKICAgICAgfSBlbHNlIGlmICh0eXBlb2YgYSA9PT0gJ3N0cmluZycpIHsKICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShhKTsKICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KGEpKSB7CiAgICAgICAgcmV0dXJuIGE7CiAgICAgIH0KICAgIH0sCiAgICBpbnRvT2JqZWN0IDogZnVuY3Rpb24gKGEpIHsKICAgICAgaWYgKHR5cGVvZiBhID09PSAnc3RyaW5nJykgewogICAgICAgIHJldHVybiBKU09OLnBhcnNlKGEpOwogICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoYSkpIHsKICAgICAgICBmb3IgKHZhciBpID0gMCwgbyA9IHt9OyBpIDwgYS5sZW5ndGg7ICsraSkgewogICAgICAgICAgb1tpXSA9IGFbaV07CiAgICAgICAgfQogICAgICAgIHJldHVybiBvOwogICAgICB9IGVsc2UgaWYgKHR5cGVvZiBhID09PSAnb2JqZWN0JykgewogICAgICAgIHJldHVybiBhOwogICAgICB9CiAgICB9LAogICAgaGFzRWxlbWVudCA6IGZ1bmN0aW9uIChzZWxlY3RvciwgY2FsbGJhY2ssIHRpbWVvdXQpIHsKICAgICAgdmFyIHJlcGVhdCA9IHRpbWVvdXQgfHwgMTA7CiAgICAgIHZhciBsb29wID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgICAgICAgdmFyIGVsZW0gPSBBYWsuZ2V0RWxlbWVudChzZWxlY3Rvcik7CiAgICAgICAgICBpZiAoZWxlbSkgewogICAgICAgICAgICBjYWxsYmFjayhlbGVtKTsKICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChsb29wKTsKICAgICAgICAgIH0KICAgICAgICAgIHJlcGVhdCA9IChyZXBlYXQpID8gcmVwZWF0IC0gMSA6IGNsZWFySW50ZXJ2YWwobG9vcCk7CiAgICAgICAgfSwgMWUzKTsKICAgIH0sCiAgICByZW1vdmVFbGVtZW50IDogZnVuY3Rpb24gKGVsZW0pIHsKICAgICAgaWYgKGVsZW0gaW5zdGFuY2VvZiB3aW5kb3cuSFRNTEVsZW1lbnQpIHsKICAgICAgICBlbGVtLnJlbW92ZSgpOwogICAgICB9IGVsc2UgaWYgKHR5cGVvZiBlbGVtID09PSAic3RyaW5nIikgewogICAgICAgIGVsZW0gPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKGVsZW0pOwogICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlbS5sZW5ndGg7IGkrKykgewogICAgICAgICAgZWxlbVtpXS5yZW1vdmUoKTsKICAgICAgICB9CiAgICAgIH0KICAgIH0sCiAgICBnZXRFbGVtZW50IDogZnVuY3Rpb24gKHNlbGVjdG9yLCBjb250ZXh0Tm9kZSkgewogICAgICBpZiAodHlwZW9mIHNlbGVjdG9yID09PSAnc3RyaW5nJykgewogICAgICAgIGlmIChzZWxlY3Rvci5pbmRleE9mKCcvJykgPT09IDApIHsgLy8gZXg6IC8vaW1nW0BjbGFzcz0icGhvdG8iXQogICAgICAgICAgcmV0dXJuIGRvY3VtZW50LmV2YWx1YXRlKHNlbGVjdG9yLCBjb250ZXh0Tm9kZSB8fCBkb2N1bWVudCwgbnVsbCwgd2luZG93LlhQYXRoUmVzdWx0LkZJUlNUX09SREVSRURfTk9ERV9UWVBFLCBudWxsKS5zaW5nbGVOb2RlVmFsdWU7CiAgICAgICAgfQogICAgICAgIHJldHVybiAoY29udGV4dE5vZGUgfHwgZG9jdW1lbnQpLnF1ZXJ5U2VsZWN0b3Ioc2VsZWN0b3IpOwogICAgICB9IGVsc2UgaWYgKHNlbGVjdG9yIGluc3RhbmNlb2Ygd2luZG93LkhUTUxFbGVtZW50KSB7CiAgICAgICAgcmV0dXJuIHNlbGVjdG9yOwogICAgICB9CiAgICB9LAogICAgY3JlYXRlRWxlbWVudCA6IGZ1bmN0aW9uIChwcm9wcykgewogICAgICB2YXIgZWxlbSwKICAgICAgbm9kZSA9IHt9OwogICAgICBmb3IgKHZhciBuYW1lIGluIHByb3BzKSB7CiAgICAgICAgaWYgKHByb3BzLmhhc093blByb3BlcnR5KG5hbWUpKSB7CiAgICAgICAgICBzd2l0Y2ggKG5hbWUpIHsKICAgICAgICAgIGNhc2UgInRhZyI6CiAgICAgICAgICAgIG5vZGUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KHByb3BzW25hbWVdKTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJ0ZXh0IjoKICAgICAgICAgICAgdmFyIHRleHQgPSAoJ2lubmVyVGV4dCcgaW4gZG9jdW1lbnQpID8gJ2lubmVyVGV4dCcgOiAndGV4dENvbnRlbnQnOwogICAgICAgICAgICBub2RlW3RleHRdID0gcHJvcHNbbmFtZV07CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAiaHRtbCI6CiAgICAgICAgICAgIG5vZGUuaW5uZXJIVE1MID0gcHJvcHNbbmFtZV07CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAiY2xhc3NpZCI6CiAgICAgICAgICAgIG5vZGUuY2xhc3NOYW1lID0gcHJvcHNbbmFtZV07CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgY2FzZSAiYXBwZW5kIjoKICAgICAgICAgICAgZWxlbSA9IEFhay5nZXRFbGVtZW50KHByb3BzW25hbWVdKTsKICAgICAgICAgICAgZWxlbS5hcHBlbmRDaGlsZChub2RlKTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJwcmVwZW5kIjoKICAgICAgICAgICAgZWxlbSA9IEFhay5nZXRFbGVtZW50KHByb3BzW25hbWVdKTsKICAgICAgICAgICAgaWYgKGVsZW0uY2hpbGROb2Rlcy5sZW5ndGgpIHsKICAgICAgICAgICAgICBlbGVtLmluc2VydEJlZm9yZShub2RlLCBlbGVtLmNoaWxkTm9kZXNbMF0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgIGVsZW0uYXBwZW5kQ2hpbGQobm9kZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJiZWZvcmUiOgogICAgICAgICAgICBlbGVtID0gQWFrLmdldEVsZW1lbnQocHJvcHNbbmFtZV0pOwogICAgICAgICAgICBlbGVtLnBhcmVudE5vZGUuaW5zZXJ0QmVmb3JlKG5vZGUsIGVsZW0pOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGNhc2UgImFmdGVyIjoKICAgICAgICAgICAgZWxlbSA9IEFhay5nZXRFbGVtZW50KHByb3BzW25hbWVdKTsKICAgICAgICAgICAgZWxlbS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShub2RlLCBlbGVtLm5leHRTaWJsaW5nKTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJyZXBsYWNlIjoKICAgICAgICAgICAgZWxlbSA9IEFhay5nZXRFbGVtZW50KHByb3BzW25hbWVdKTsKICAgICAgICAgICAgZWxlbS5wYXJlbnROb2RlLnJlcGxhY2VDaGlsZChub2RlLCBlbGVtKTsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJldmVudCI6CiAgICAgICAgICAgIGZvciAodmFyIGV2TmFtZSBpbiBwcm9wcy5ldmVudCkgewogICAgICAgICAgICAgIGlmIChwcm9wcy5ldmVudC5oYXNPd25Qcm9wZXJ0eShldk5hbWUpKQogICAgICAgICAgICAgICAgbm9kZS5hZGRFdmVudExpc3RlbmVyKGV2TmFtZSwgcHJvcHMuZXZlbnRbZXZOYW1lXSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICJjYWxsYmFjayI6CiAgICAgICAgICAgIHByb3BzW25hbWVdKG5vZGUpOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIG5vZGUuc2V0QXR0cmlidXRlKG5hbWUsIHByb3BzW25hbWVdKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KICAgICAgcmV0dXJuIG5vZGU7CiAgICB9LAogICAgYWRkQmFpdEVsZW1lbnQgOiBmdW5jdGlvbiAoc3RyT3B0cykgeyAvLy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AgICAgICBub2RlLmlubmVySFRNTCA9IHByb3BzW25hbWVdOwogICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICJjbGFzcyI6CiAgICAgICAgICAgICAgbm9kZS5jbGFzc05hbWUgPSBwcm9wc1tuYW1lXTsKICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICBub2RlLnNldEF0dHJpYnV0ZShuYW1lLCBwcm9wc1tuYW1lXSk7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0KICAgIH0sCiAgICBhZGRTdHlsZSA6IGZ1bmN0aW9uIChjc3MpIHsKICAgICAgY3NzID0gY3NzLnJlcGxhY2UoLzsvZywgJyAhaW1wb3J0YW50OycpOwogICAgICBpZiAodHlwZW9mIEdNX2FkZFN0eWxlICE9ICd1bmRlZmluZWQnKSB7CiAgICAgICAgR01fYWRkU3R5bGUoY3NzKTsKICAgICAgfSBlbHNlIHsKICAgICAgICBkb2N1bWVudC5oZWFkLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ3N0eWxlJykpLmlubmVySFRNTCA9IGNzczsKICAgICAgfQogICAgfSwKICAgIGxvYWRTdHlsZSA6IGZ1bmN0aW9uIChzcmMpIHsKICAgICAgdmFyIHN0eWxlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnbGluaycpOwogICAgICBzdHlsZS5yZWwgPSAic3R5bGVzaGVldCI7CiAgICAgIHN0eWxlLmhyZWYgPSBzcmM7CiAgICAgIGRvY3VtZW50LmhlYWQuYXBwZW5kQ2hpbGQoc3R5bGUpOwogICAgfSwKICAgIGdldFN0eWxlIDogZnVuY3Rpb24gKHNlbGVjdG9yLCBwcm9wKSB7CiAgICAgIHZhciBlbGVtID0gQWFrLmdldEVsZW1lbnQoc2VsZWN0b3IpOwogICAgICBpZiAoZWxlbS5jdXJyZW50U3R5bGUpIHsKICAgICAgICByZXR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gKyBBYWsuZW5jb2RlVVJJKG9ialtwcm9wXSkpOwogICAgICAgIH0KICAgICAgICByZXR1cm4gYXJyLmpvaW4oJyYnKTsKICAgICAgfQogICAgICByZXR1cm4gb2JqOwogICAgfSwKICAgIHVuc2VyaWFsaXplIDogZnVuY3Rpb24gKHN0cikgewogICAgICBzdHIgPSBBYWsuZGVjb2RlSFRNTChzdHIpOwogICAgICB2YXIgYXJyID0gc3RyLnNwbGl0KCcmJyk7CiAgICAgIHZhciBvYmogPSB7fTsKICAgICAgYXJyLmZvckVhY2goZnVuY3Rpb24gKGVudHJ5KSB7CiAgICAgICAgaWYgKGVudHJ5ICE9PSAnJyAmJiBlbnRyeS5zcGxpdCgnPScpKSB7CiAgICAgICAgICB2YXIgc3BsaXRzID0gZW50cnkuc3BsaXQoJz0nKTsKICAgICAgICAgIG9ialtzcGxpdHNbMF1dID0gQWFrLmRlY29kZVVSSShzcGxpdHNbMV0pOwogICAgICAgIH0KICAgICAgfSk7CiAgICAgIHJldHVybiBvYmo7CiAgICB9LAogICAgdW5zZXRQcm9wZXJ0aWVzIDogZnVuY3Rpb24gKG9iaiwgcHJvcHMpIHsKICAgICAgcHJvcHMgPSAodHlwZW9mIHByb3BzID09ICdzdHJpbmcnKSA/IHByb3BzLnNwbGl0KCcsJykgOiBwcm9wczsKICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwcm9wcy5sZW5ndGg7IGkrKykgewogICAgICAgIHZhciBwcm9wID0gcHJvcHNbaV07CiAgICAgICAgaWYgKG9iai5oYXNPd25Qcm9wZXJ0eShwcm9wKSkgewogICAgICAgICAgZGVsZXRlIG9ialtwcm9wXTsKICAgICAgICB9CiAgICAgIH0KICAgICAgcmV0dXJuIG9iajsKICAgIH0sCiAgICBzZXRQcm9wZXJ0aWVzIDogZnVuY3Rpb24gKG9iajEsIG9iajIpIHsKICAgICAgZm9yICh2YXIgcHJvcCBpbiBvYmoyKSB7CiAgICAgICAgaWYgKG9iajIuaGFzT3duUHJvcGVydHkocHJvcCkpCiAgICAgICAgICBvYmoxW3Byb3BdID0gb2JqMltwcm9wXTsKICAgICAgfQogICAgICByZXR1cm4gb2JqMTsKICAgIH0sCiAgICBmaXhQcm90b2NvbFVSTCA6IGZ1bmN0aW9uICh1cmwpIHsKICAgICAgaWYgKC9eaHR0cC8udGVzdCh1cmwpKSB7IC8vIGFic29sdXRlCiAgICAgICAgcmV0dXJuIHVybDsKICAgICAgfSBlbHNlIGlmICgvXlwvXC8vLnRlc3QodXJsKSkgeyAvLyByZWxhdGl2ZQogICAgICAgIHJldHVybiAnaHR0cDonICsgdXJsOwogICAgICB9IGVsc2UgeyAvLyBub25lCiAgICAgICAgcmV0dXJuICdodHRwOi8vJyArIHVybDsKICAgICAgfQogICAgfSwKICAgIGZha2VGdWNrQWRCbG9jayA6IGZ1bmN0aW9uIChpbnN0YW5jZU5hbWUsIGNsYXNzTmFtZSkgewoKICAgICAgLy8gaW5qZWN0IGZha2UgZnVja2FkYmx1Y2sKICAgICAgQWFrLmFkZFNjcmlwdChBYWsuaW50b1N0cmluZyhmdW5jdGlvbiAoKSB7CgogICAgICAgICAgdmFyIENMQVNTTkFNRSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIHNlbGYgPSB0aGlzOwogICAgICAgICAgICB2YXIgY2FsbE5vdERldGVjdGVkID0gZmFsc2U7CiAgICAgICAgICAgIHRoaXMuZGVidWcgPSB7CiAgICAgICAgICAgICAgc2V0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgcmV0dXJuIHNlbGY7CiAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICBnZXQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogICAgICAgICAgICB0aGlzLm9uRGV0ZWN0ZWQgPSBmdW5jdGlvbiAoY2FsbGJhY2spIHsKICAgICAgICAgICAgICB0aGlzLm9uKHRydWUsIGNhbGxiYWNrKTsKICAgICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICAgICAgfTsKICAgICAgICAgICAgdGhpcy5vbk5vdERldGVjdGVkID0gZnVuY3Rpb24gKGNhbGxiYWNrKSB7CiAgICAgICAgICAgICAgdGhpcy5vbihmYWxzZSwgY2FsbGJhY2spOwogICAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICAgICB9OwogICAgICAgICAgICB0aGlzLm9uID0gZnVuY3Rpb24gKGRldGVjdGVkLCBjYWxsYmFjaykgewogICAgICAgICAgICAgIGlmICghZGV0ZWN0ZWQpIHsKICAgICAgICAgICAgICAgIGNhbGxOb3REZXRlY3RlZCA9IGNhbGxiYWNrOwogICAgICAgICAgICAgICAgc2V0VGltZW91dChjYWxsYmFjaywgMSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGNvbnNvbGUuaW5mbyhbJ0FudGlBZGJLaWxsZXInLCBsb2NhdGlvbi5ob3N0LCAnRnVja0FkQmxvY2snXSk7CiAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIHRoaXMuc2V0T3B0aW9uID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICAgICB9OwogICAgICAgICAgICB0aGlzLm9wdGlvbnMgPSB7CiAgICAgICAgICAgICAgc2V0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICBnZXQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH07CiAgICAgICAgICAgIHRoaXMuY2hlY2sgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgaWYgKGNhbGxOb3REZXRlY3RlZCkKICAgICAgICAgICAgICAgIGNhbGxOb3REZXRlY3RlZCgpOwogICAgICAgICAgICB9OwogICAgICAgICAgICB0aGlzLmVtaXRFdmVudCA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICAgICAgfTsKICAgICAgICAgICAgdGhpcy5jbGVhckV2ZW50ID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgICB9OwoKICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzKHdpbmRvdywgewogICAgICAgICAgICBDTEFTU05BTUUgOiB7CiAgICAgICAgICAgICAgdmFsdWUgOiBDTEFTU05BTUUsCiAgICAgICAgICAgICAgd3JpdGFibGUgOiBmYWxzZQogICAgICAgICAgICB9CiAgICAgICAgICB9KTsKCiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydGllcyh3aW5kb3csIHsKICAgICAgICAgICAgSU5TVEFOQ0VOQU1FIDogewogICAgICAgICAgICAgIHZhbHVlIDogbmV3IENMQVNTTkFNRSgpLAogICAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CgogICAgICAgIH0pLnJlcGxhY2UoL0lOU1RBTkNFTkFNRS9nLCBpbnN0YW5jZU5hbWUgfHwgJ2Z1Y2tBZEJsb2NrJykKICAgICAgICAucmVwbGFjZSgvQ0xBU1NOQU1FL2csIGNsYXNzTmFtZSB8fCAnRnVja0FkQmxvY2snKSk7CgogICAgfSwgLy8gRXZlbnRzCiAgICBvbkV2ZW50IDogZnVuY3Rpb24gKGVsZW1lbnQsIHR5cGUsIGxpc3RlbmVyLCBidWJibGVzKSB7CiAgICAgIGlmICh3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcikgeyAvLyBGb3IgYWxsIG1ham9yIGJyb3dzZXJzLCBleGNlcHQgSUUgOCBhbmQgZWFybGllcgogICAgICAgIChlbGVtZW50IHx8IHdpbmRvdykuYWRkRXZlbnRMaXN0ZW5lcih0eXBlLCBsaXN0ZW5lciwg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gPSBkb2N1bWVudC5jcmVhdGVFdmVudCgnQ3VzdG9tRXZlbnQnKTsKICAgICAgICBldmVudC5pbml0Q3VzdG9tRXZlbnQoJ29uJyArIHR5cGUsIGJ1YmJsZXMgfHwgZmFsc2UsIGNhbmNlbGFibGUgfHwgZmFsc2UsIHsKICAgICAgICAgICJkZXRhaWwiIDogZGV0YWlsIHx8IHVuZGVmaW5lZAogICAgICAgIH0pOwogICAgICB9CiAgICAgIChlbGVtZW50IHx8IHdpbmRvdykuZGlzcGF0Y2hFdmVudChldmVudCk7CiAgICB9LAogICAgZGV0ZWN0ZWQgOiBmdW5jdGlvbiAobmFtZSkgewogICAgICBpZiAoQWFrLm9wdHMuZGVidWcgJiYgQWFrLm9wdHMubG9nRGV0ZWN0ZWQpIHsKICAgICAgICBBYWsuZW1pdEV2ZW50KHdpbmRvdywgJ2RldGVjdGVkJywgbmFtZSk7CiAgICAgIH0KICAgIH0sCiAgICByZWFkeSA6IGZ1bmN0aW9uIChjYWxsYmFjaykgewogICAgICBBYWsub25FdmVudCh3aW5kb3csICdsb2FkJywgY2FsbGJhY2spOwogICAgfSwKICAgIHBsYXllciA6IGZ1bmN0aW9uICgpIHsKCiAgICAgIHZhciBQbGF5ZXIgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgdGhpcy50YXJnZXQgPSB7fTsKICAgICAgICB0aGlzLnBsYXllciA9IHt9OwogICAgICAgIHRoaXMubmFtZSA9IG51bGw7CiAgICAgICAgdGhpcy52ZXJzaW9uID0gbnVsbDsKICAgICAgICB0aGlzLmxpYnJhcnkgPSBudWxsOwogICAgICAgIHRoaXMuZmFsbGJhY2sgPSAndmxjJzsKICAgICAgICB0aGlzLmF1dG9wbGF5ID0gQWFrLm9wdHMuYXV0b1BsYXk7CiAgICAgICAgdGhpcy5hcmdzID0gbnVsbDsKICAgICAgICB0aGlzLnNldHVwID0ge307CiAgICAgICAgdGhpcy5vcHRpb25zID0gewogICAgICAgICAgYnVpbGQgOiAnZW1iZWQ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yaWJ1dGVzLmhlaWdodCA9IHRoaXMudGFyZ2V0Lm5vZGUuaGVpZ2h0IHx8IHRoaXMudGFyZ2V0Lm5vZGUuY2xpZW50SGVpZ2h0IHx8ICc0ODBweCc7CiAgICAgICAgICB0aGlzLmF0dHJpYnV0ZXMud2lkdGggPSB0aGlzLnRhcmdldC5ub2RlLndpZHRoIHx8IHRoaXMudGFyZ2V0Lm5vZGUuY2xpZW50V2lkdGggfHwgJzY0MHB4JzsKICAgICAgICB9LAogICAgICAgIGdldE1pbWVUeXBlIDogZnVuY3Rpb24gKHR5cGUpIHsKICAgICAgICAgIC8vIGRvYzogaHR0cDovL3Rpbnl1cmwuY29tL2pyczhmZ3oKICAgICAgICAgIHN3aXRjaCAodHlwZS50b0xvd2VyQ2FzZSgpKSB7CiAgICAgICAgICBjYXNlICdtcDQnOgogICAgICAgICAgICByZXR1cm4gJ3ZpZGVvL21wNCc7CiAgICAgICAgICBjYXNlICd3ZWJtJzoKICAgICAgICAgICAgcmV0dXJuICd2aWRlby93ZWJtJzsKICAgICAgICAgIGNhc2UgJ29nZyc6CiAgICAgICAgICBjYXNlICdvZ3YnOgogICAgICAgICAgICByZXR1cm4gJ3ZpZGVvL29nZyc7CiAgICAgICAgICBjYXNlICdmbHYnOgogICAgICAgICAgICByZXR1cm4gJ3ZpZGVvL3gtZmx2JzsKICAgICAgICAgIGNhc2UgJ2hscyc6CiAgICAgICAgICAgIHJldHVybiAnYXBwbGljYXRpb24veC1tcGVnVVJMJzsKICAgICAgICAgIGNhc2UgJ2hkcyc6CiAgICAgICAgICAgIHJldHVybiAnYXBwbGljYXRpb24vZjRtK3htbCc7CiAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICByZXR1cm4gdHlwZTsKICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIGJ1aWxkaW5nIDogZnVuY3Rpb24gKHRhZ05hbWUpIHsKICAgICAgICAgIHZhciBzZWxmID0gdGhpczsKCiAgICAgICAgICBpZiAoQWFrLm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cy5oYXNPd25Qcm9wZXJ0eShhdHRyTmFtZSkpCiAgICAgICAgICAgICAgICB0aGlzLnBsYXllci5ub2RlLnNldEF0dHJpYnV0ZShhdHRyTmFtZSwgdGhpcy5hdHRyaWJ1dGVzW2F0dHJOYW1lXSk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGlmICh0aGlzLmF0dHJpYnV0ZXMuYXV0b3BsYXkpIHsgLy8gZml4IGJ1ZyBkdXBsaWNhdGUgcGxheWluZyBvbiBmaXJlZm94L2Nocm9tZQogICAgICAgICAgICAgIHRoaXMucGxheWVyLm5vZGUub25sb2Fkc3RhcnQgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAvL3RoaXMucGxheSgpOwogICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIHRoaXMucGxheWVyLm5vZGUub25lcnJvciA9IGZ1bmN0aW9uICgpIHsgLy8gc3dpdGNoIHRvIHBsdWdpbiBwbGF5ZXIKICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIHNlbGYuYXJnc1swXSA9IHNlbGYucGxheWVyLm5vZGU7CiAgICAgICAgICAgICAgICBzZWxmLnZsY3BsYXllci5hcHBseShzZWxmLCBzZWxmLmFyZ3MpOwogICAgICAgICAgICAgIH0sIDUwMDApOwogICAgICAgICAgICB9OwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGRlZmF1bHQ6IC8vIGVtYmVkCiAgICAgICAgICAgIHRoaXMucGxheWVyLm5vZGUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdlbWJlZCcpOwogICAgICAgICAgICBmb3IgKGF0dHJOYW1lIGluIHRoaXMuYXR0cmlidXRlcykgewogICAgICAgICAgICAgIGlmICh0aGlzLmF0dHJpYnV0ZXMuaGFzT3duUHJvcGVydHkoYXR0ck5hbWUpKQogICAgICAgICAgICAgICAgdGhpcy5wbGF5ZXIubm9kZS5zZXRBdHRyaWJ1dGUoYXR0ck5hbWUsIHRoaXMuYXR0cmlidXRlc1thdHRyTmFtZV0pOwogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgICB0aGlzLnBsYXllci5odG1sID0gdGhpcy5wbGF5ZXIubm9kZS5vdXRlckhUTUw7CiAgICAgICAgICB0aGlzLnBsYXllci50YWcgPSB0aGlzLnBsYXllci5ub2RlLnRhZ05hbWU7CiAgICAgICAgICB0aGlzLmluc2VydGluZygpOwogICAgICAgIH0sCiAgICAgICAgaW5zZXJ0aW5nIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgc3dpdGNoICh0aGlzLm9wdGlvbnMuaW5zZXJ0KSB7CiAgICAgICAgICBjYXNlICdpbm5lcic6CiAgICAgICAgICAgIHRoaXMudGFyZ2V0Lm5vZGUuaW5uZXJIVE1MID0gdGhpcy5wbGF5ZXIuaHRtbDsKICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICBjYXNlICdhcHBlbmQnOgogICAgICAgICAgICB0aGlzLnRhcmdldC5wYXJlbnQucmVwbGFjZUNoaWxkKHRoaXMucGxheWVyLm5vZGUpOwogICAgICAgICAgICBicmVhazsKICAgICAgICAgIGRlZmF1bHQ6IC8vIHJlcGxhY2UKICAgICAgICAgICAgdGhpcy50YXJnZXQucGFyZW50LnJlcGxhY2VDaGlsZCh0aGlzLnBsYXllci5ub2RlLCB0aGlzLnRhcmdldC5ub2RlKTsKICAgICAgICAgIH0KICAgICAgICAgIGlmIChBYWsub3B0cy5sb2dQbGF5ZXIpIHsKICAgICAgICAgICAgQWFrLmxvZygncGxheWVyJywgdGhpcyk7CiAgICAgICAgICB9CiAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICB9LAogICAgICAgIGVkaXRpbmcgOiBmdW5jdGlvbiAoZWxlbSwgb3B0cykgeyAvLyByZXZpZXcKICAgICAgICAgIEFhay5oYXNFbGVtZW50KGVsZW0sIGZ1bmN0aW9uICh0aGlzRWxlbWVudCkgewogICAgICAgICAgICB2YXIgb2JqLAogICAgICAgICAgICBzd2YsCiAgICAgICAgICAgIHZhbHVlLAogICAgICAgICAgICBwYXJ0cywKICAgICAgICAgICAgcGFyYW0sCiAgICAgICAgICAgIGF0dHJpYnV0ZXMsCiAgICAgICAgICAgIGF0dHJOYW1lOwogICAgICAgICAgICB2YXIgc28gPSB0aGlzRWxlbWVudDsKICAgICAgICAgICAgdmFyIGNsb25lID0gc28uY2xvbmVOb2RlKHRydWUpOwoKICAgICAgICAgICAgLy8gc2V0IGF0dHJpaWJ1dGVzCiAgICAgICAgICAgIGlmIChvcHRzLnNldEF0dHJpYnV0ZSkgewogICAgICAgICAgICAgIGF0dHJpYnV0ZXMgPSBvcHRzLnNldEF0dHJpYnV0ZTsKICAgICAgICAgICAgICBmb3IgKGF0dHJOYW1lIGluIGF0dHJpYnV0ZXMpIHsKICAgICAgICAgICAgICAgIGlmIChjbG9uZS5xdWVyeVNlbGVjdG9yKCdwYXJhbVtuYW1lPSInICsgYXR0ck5hbWUgKyAnIl0nKSkgewogICAgICAgICAgICAgICAgICBjbG9uZS5xdWVyeVNlbGVjdG9yKCdwYXJhbVtuYW1lPSInICsgYXR0ck5hbWUgKyAnIl0nKS52YWx1ZSA9IGF0dHJpYnV0ZXNbYXR0ck5hbWVdOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjbG9uZS5nZXRBdHRyaWJ1dGUoYXR0ck5hbWUpKSB7CiAgICAgICAgICAgICAgICAgIGNsb25lLnNldEF0dHJpYnV0ZShhdHRyTmFtZSwgYXR0cmlidXRlc1thdHRyTmFtZV0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgLy8gdW5zZXQgYXR0cmlidXRlcwogICAgICAgICAgICBpZiAob3B0cy51bnNldEF0dHJpYnV0ZXMpIHsKICAgICAgICAgICAgICBhdHRyaWJ1dGVzID0gb3B0cy5kZWxBdHRyaWJ1dGVzOwogICAgICAgICAgICAgIGZvciAoYXR0ck5hbWUgaW4gYXR0cmlidXRlcykgewogICAgICAgICAgICAgICAgaWYgKGNsb25lLnF1ZXJ5U2VsZWN0b3IoJ3BhcmFtW25hbWU9IicgKyBhdHRyTmFtZSArICciXScpKSB7CiAgICAgICAgICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KGNsb25lLnF1ZXJ5U2VsZWN0b3IoJ3BhcmFtW25hbWU9IicgKyBhdHRyTmFtZSArICciXScpKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2xvbmUuZ2V0QXR0cmlidXRlKGF0dHJOYW1lKSkgewogICAgICAgICAgICAgICAgICBkZWxldGUgYXR0cmlidXRlc1thdHRyTmFtZV07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CgogICAgICAgICAgICBpZiAob3B0cy5zZXRGbGFzaHZhcnMgfHwgb3B0cy51bnNldEZsYXNodmFycykgewogICAgICAgICAgICAgIGlmIChjbG9uZS5xdWVyeVNlbGVjdG9yKCdwYXJhbVtuYW1lPSJmbGFzaHZhcnMiXScpKSB7CiAgICAgICAgICAgICAgICBwYXJhbSA9IGNsb25lLnF1ZXJ5U2VsZWN0b3IoJ3BhcmFtW25hbWU9ImZsYXNodmFycyJdJyk7CiAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhcmFtLnZhbHVlOwogICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2xvbmUuZ2V0QXR0cmlidXRlKCdmbGFzaHZhcnMnKSkgewogICAgICAgICAgICAgICAgdmFsdWUgPSBjbG9uZS5nZXRBdHRyaWJ1dGUoJ2ZsYXNodmFycycpOwogICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2xvbmUuZ2V0QXR0cmlidXRlKCdkYXRhJykgJiYgY2xvbmUuZ2V0QXR0cmlidXRlKCdkYXRhJykuaW5kZXhPZignPycpID49IDApIHsKICAgICAgICAgICAgICAgIHBhcnRzID0gY2xvbmUuZ2V0QXR0cmlidXRlKCdkYXRhJykuc3BsaXQoJz8nLCAyKTsKICAgICAgICAgICAgICAgIHN3ZiA9IHBhcnRzLnNoaWZ0KCk7CiAgICAgICAgICAgICAgICB2YWx1ZSA9IHBhcnRzLnNoaWZ0KCk7CiAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICBvYmogPSBBYWsudW5zZXJpYWxpemUodmFsdWUpOwogICAgICAgICAgICAgIGlmIChvcHRzLnNldEZsYXNodmFycykgewogICAgICAgICAgICAgICAgb2JqID0gQWFrLnNldFByb3BlcnRpZXMob2JqLCBvcHRzLnNldEZsYXNodmFycyk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIGlmIChvcHRzLnVuc2V0Rmxhc2h2YXJzKSB7CiAgICAgICAgICAgICAgICBvYmogPSBBYWsudW5zZXRQcm9wZXJ0aWVzKG9iaiwgb3B0cy51bnNldEZsYXNodmFycyk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIHZhbHVlID0gQWFrLnNlcmlhbGl6ZShvYmopOwoKICAgICAgICAgICAgICBpZiAocGFyYW0pIHsKICAgICAgICAgICAgICAgIHBhcmFtLnZhbHVlID0gdmFsdWU7CiAgICAgICAgICAgICAgfSBlbHNlIGlmIChzd2YpIHsKICAgICAgICAgICAgICAgIGNsb25lLnNldEF0dHJpYnV0ZSgnZGF0YScsIHN3ZiArICc/JyArIHZhbHVlKTsKICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgY2xvbmUuc2V0QXR0cmlidXRlKCdmbGFzaHZhcnMnLCB2YWx1ZSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vIHJlcGxhY2UKICAgICAgICAgICAgQWFrLmxvZyhzbywgY2xvbmUsIG9iaik7CiAgICAgICAgICAgIEFhay5yZXBsYWNlRWxlbWVudChzbywgY2xvbmUpOwogICAgICAgICAgfSk7CiAgICAgICAgfSwKICAgICAgICBlbWJlZGRpbmcgOiBmdW5jdGlv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KQogICAgICAgICAgLy8gbm90ZTogcHJvYmxlbSB3aXRoIHNzbAogICAgICAgICAgLy8gc2V0dXA6IGh0dHA6Ly90aW55dXJsLmNvbS9oaHJnamFwLCBodHRwOi8vdGlueXVybC5jb20vZ3FzNDZ0bQogICAgICAgICAgLy8gYXBpOiBodHRwczovL2RldmVsb3Blci5qd3BsYXllci5jb20vanctcGxheWVyL2RvY3MvZGV2ZWxvcGVyLWd1aWRlL2FwaS9qYXZhc2NyaXB0X2FwaV9yZWZlcmVuY2UvCiAgICAgICAgICAvLyBobHM6IGh0dHA6Ly90aW55dXJsLmNvbS9weGw5c2NxCiAgICAgICAgICAvLyBobHMtdGVzdGVyOiBodHRwOi8vZGVtby5qd3BsYXllci5jb20vc3RyZWFtLXRlc3Rlci8KICAgICAgICAgIC8vIHJ0bXAtZGVtbzogaHR0cHM6Ly93d3cuc2NhbGVlbmdpbmUuY29tL2p3NgogICAgICAgICAgLy8gaWZyYW1lOiBodHRwOi8vdGlueXVybC5jb20vODZhZ2c2OAoKICAgICAgICAgIHRoaXMuZ2V0VGFyZ2V0Tm9kZShpZCk7CiAgICAgICAgICB0aGlzLmFyZ3MgPSBhcmd1bWVudHM7CiAgICAgICAgICB0aGlzLmF0dHJpYnV0ZXMgPSBBYWsuc2V0UHJvcGVydGllcyh0aGlzLmF0dHJpYnV0ZXMsIGF0dHJpYnV0ZXMgfHwge30pOwogICAgICAgICAgdGhpcy5vcHRpb25zID0gQWFrLnNldFByb3BlcnRpZXModGhpcy5vcHRpb25zLCBvcHRpb25zIHx8IHt9KTsKCiAgICAgICAgICB0aGlzLnNldHVwID0gc2V0dXA7CiAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmNyb3NzU2V0dXAgPT09IHRydWUpIHsKICAgICAgICAgICAgdGhpcy5zZXR1cCA9IHsKICAgICAgICAgICAgICBjb250cm9scyA6IHRydWUsCiAgICAgICAgICAgICAgZmlsZSA6IHNldHVwLnNvdXJjZSwKICAgICAgICAgICAgICBhYm91dHRleHQgOiBBYWsubmFtZSwKICAgICAgICAgICAgICBhYm91dGxpbmsgOiBBYWsuaG9tZVVSTCwKICAgICAgICAgICAgICB3aWR0aCA6IHNldHVwLndpZHRoIHx8IHRoaXMuYXR0cmlidXRlcy53aWR0aCwKICAgICAgICAgICAgICBoZWlnaHQgOiBzZXR1cC5oZWlnaHQgfHwgdGhpcy5hdHRyaWJ1dGVzLmhlaWdodCwKICAgICAgICAgICAgICBhdXRvc3RhcnQgOiBzZXR1cC5hdXRvcGxheSB8fCB0aGlzLmF1dG9wbGF5LAogICAgICAgICAgICAgIHByaW1hcnkgOiAnaHRtbDUnLAogICAgICAgICAgICAgIHByZWxvYWQgOiAnYXV0bycsCiAgICAgICAgICAgICAgc2tpbiA6IHsgLy8gU2V2ZW4gfCBTaXggfCBGaXZlIHwgR2xvdyB8IEJlZWxkZW4gfCBWYXBvciB8IEJla2xlIHwgUm91bmRzdGVyIHwgU3Rvcm10cm9vcGVyCiAgICAgICAgICAgICAgICBuYW1lIDogc2V0dXAuc2tpbiB8fCAic2l4IiAvLyBkZWZhdWx0IHNraW4gSldQNgogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfTsKICAgICAgICAgICAgaWYgKFsnbXA0JywgJ3dlYm0nLCAnb2dnJywgJ29ndiddLmluZGV4T2Yoc2V0dXAudHlwZSkgPT09IC0xKSB7CiAgICAgICAgICAgICAgdGhpcy5zZXR1cC5wcmltYXJ5ID0gJ2ZsYXNoJzsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoc2V0dXAudHlwZSA9PT0gJ2hscycpIHsKICAgICAgICAgICAgICB0aGlzLnNldHVwLmhsc2h0bWwgPSB0cnVlOwogICAgICAgICAgICB9CiAgICAgICAgICB9CgogICAgICAgICAgdGhpcy5hdHRyaWJ1dGVzLnNyY2RvYyA9ICc8aHRtbD48aGVhZD48c3R5bGUgdHlwZT0idGV4dC9jc3MiPkBmb250LWZhY2V7Zm9udC1mYW1pbHk6anctaWNvbnM7c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vIHBsdWdpbnM6IGh0dHBzOi8vZ2l0aHViLmNvbS92aWRlb2pzL3ZpZGVvLmpzL3dpa2kvUGx1Z2lucwoKICAgICAgICAgIHRoaXMuZ2V0VGFyZ2V0Tm9kZShpZCk7CiAgICAgICAgICB0aGlzLmFyZ3MgPSBhcmd1bWVudHM7CiAgICAgICAgICB0aGlzLmF0dHJpYnV0ZXMgPSBBYWsuc2V0UHJvcGVydGllcyh0aGlzLmF0dHJpYnV0ZXMsIGF0dHJpYnV0ZXMgfHwge30pOwogICAgICAgICAgdGhpcy5vcHRpb25zID0gQWFrLnNldFByb3BlcnRpZXModGhpcy5vcHRpb25zLCBvcHRpb25zIHx8IHt9KTsKCiAgICAgICAgICB0aGlzLnNldHVwID0gc2V0dXA7CiAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmNyb3NzU2V0dXAgPT09IHRydWUpIHsKICAgICAgICAgICAgdGhpcy5zZXR1cCA9IHsKICAgICAgICAgICAgICBjb250cm9scyA6IHRydWUsCiAgICAgICAgICAgICAgcHJlbG9hZCA6ICdhdXRvJywKICAgICAgICAgICAgICB3aWR0aCA6IHNldHVwLndpZHRoIHx8IHRoaXMuYXR0cmlidXRlcy53aWR0aCwKICAgICAgICAgICAgICBoZWlnaHQgOiBzZXR1cC5oZWlnaHQgfHwgdGhpcy5hdHRyaWJ1dGVzLmhlaWdodCwKICAgICAgICAgICAgICB0ZWNoT3JkZXIgOiBbImh0bWw1IiwgImZsYXNoIl0sCiAgICAgICAgICAgICAgYXV0b3BsYXkgOiBzZXR1cC5hdXRvcGxheSB8fCB0aGlzLmF1dG9wbGF5LAogICAgICAgICAgICAgIHNvdXJjZXMgOiBbewogICAgICAgICAgICAgICAgICB0eXBlIDogdGhpcy5nZXRNaW1lVHlwZShzZXR1cC50eXBlKSwKICAgICAgICAgICAgICAgICAgc3JjIDogc2V0dXAuc291cmNlCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgXQogICAgICAgICAgICB9OwogICAgICAg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IGlmIChzZXR1cC50eXBlID09PSAnaGxzJykgewogICAgICAgICAgICAgIHRoaXMuc2V0dXAuc3dmID0gbG9jYXRpb24ucHJvdG9jb2wgKyAnLy9yZWxlYXNlcy5mbG93cGxheWVyLm9yZy82LjAuNS9mbG93cGxheWVyaGxzLnN3Zic7CiAgICAgICAgICAgICAgdGhpcy5zZXR1cC5lbmdpbmUgPSAnaGxzanMnOwogICAgICAgICAgICB9IGVsc2UgaWYgKFsnbXA0JywgJ3dlYm0nLCAnb2dnJywgJ29ndiddLmluZGV4T2Yoc2V0dXAudHlwZSkgPT09IC0xKSB7CiAgICAgICAgICAgICAgdGhpcy5zZXR1cC5zd2YgPSBsb2NhdGlvbi5wcm90b2NvbCArICcvL3JlbGVhc2VzLmZsb3dwbGF5ZXIub3JnLzYuMC41L2Zsb3dwbGF5ZXIuc3dmJzsKICAgICAgICAgICAgICB0aGlzLnNldHVwLmVuZ2luZSA9ICdmbGFzaCc7CiAgICAgICAgICAgICAgdGhpcy5zZXR1cC50eXBlID0gJ3ZpZGVvL2ZsYXNoJzsKICAgICAgICAgICAgfQogICAgICAgICAgICB0aGlzLnNldHVwLmNsaXAgPSB7CiAgICAgICAgICAgICAgc291cmNlcyA6IFt7CiAgICAgICAgICAgICAgICAgIHR5cGUgOiB0aGlzLmdldE1pbWVUeXBlKHRoaXMuc2V0dXAudHlwZSB8fCBzZXR1cC50eXBlKSwKICAgICAgICAgICAgICAgICAgc3JjIDogc2V0dXAuc291cmNlCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgXQogICAgICAgICAgICB9OwogICAgICAgICAgfQoKICAgICAgICAgIHRoaXMuYXR0cmlidXRlcy5zcmNkb2MgPSAnPGh0bWw+PGhlYWQ+PGxpbmsgcmVsPSJzdHlsZXNoZWV0IiBocmVmPSInICsgbG9jYXRpb24ucHJvdG9jb2wgKyAnLy9yZWxlYXNlcy5mbG93cGxheWVyLm9yZy82LjAuNS9za2luL2Z1bmN0aW9uYWwuY3NzI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gogICAgICAgICAgaWYgKC9cL2FudGktYWRibG9jay1raWxsZXIoLXBhZ2VzKT9cLyQvLnRlc3QobG9jYXRpb24ucGF0aG5hbWUpKSB7CiAgICAgICAgICAgIHZhciBzZXR0aW5nc0JveCA9IEFhay5nZXRFbGVtZW50KCcjYWFrLXNldHRpbmdzLWJveCcpOwogICAgICAgICAgICB2YXIgc2V0dGluZ3NOb3RpY2UgPSBBYWsuZ2V0RWxlbWVudCgnI2Fhay1zZXR0aW5ncy1ub3RpY2UnKTsKCiAgICAgICAgICAgIGlmICghQWFrLnVzZUdNKSB7CiAgICAgICAgICAgICAgc2V0dGluZ3NOb3RpY2UucXVlcnlTZWxlY3RvcignZGl2JykuaW5uZXJIVE1MID0gJ0luIG5hdGl2ZSBtb2RlLCB5b3UgbXVzdCBlZGl0IHRoZSBvcHRpb25zIG1hbnVhbGx5OiA8YSBocmVmPSInICsgQWFrLm5hdGl2ZVVSTCArICciPlNlZTwvYT4nOwogICAgICAgICAgICB9IGVsc2UgaWYgKHNldHRpbmdzQm94ICYmIHNldHRpbmdzTm90aWNlKSB7CiAgICAgICAgICAgICAgc2V0dGluZ3NOb3RpY2Uuc3R5bGUuZGlzcGxheSA9ICdub25lJzsKICAgICAgICAgICAgICBzZXR0aW5nc0JveC5zdHlsZS5kaXNwbGF5ID0gJ2Jsb2NrJzsKICAgICAgICAgICAgICBBYWsuaW5mbygnR00gc3RvcmFnZTonLCBBYWsuZ2V0VmFsdWUoKSk7CiAgICAgICAgICAgICAgQWFrLmluZm8oJ0dNIG9wdGlvbnM6JywgQWFrLm9wdHMpOwogICAgICAgICAgICAgIEFhay5pbmZvKCdHTSBhcGk6JywgQWFrLnVzZUdNICYmIEFhay5hcGlHTSgpKTsKCiAgICAgICAgICAgICAgLy8gdXNlciBjb25maWcKICAgICAgICAgICAgICBBYWsuY3JlYXRlRWxlbWVudCh7CiAgICAgICAgICAgICAgICB0YWcgOiAnZGl2JywKICAgICAgICAgICAgICAgIGh0bWwgOiAnVmVyc2lvbjogJyArIEFhay5nZXRWZXJzaW9uKCkgKyAnIDxicj5BYWtTY3JpcHQ6IHRydWUgPGJyPkFha0xpc3Q6ICcgKyAoIUFhay5nZXRFbGVtZW50KCcjazJVdzdpc0hyTW01SlhQMVZ3ZHhjNTY3WktjMWFaNEknKSkgKyAnIDxicj5Ccm93c2VyOiAnICsgQWFrLmdldEJyb3dzZXIoKSArICcgPGJyPlNjcmlwdE1hbmFnZXI6ICcgKyBBYWsuZ2V0U2NyaXB0TWFuYWdlcigpLAogICAgICAgICAgICAgICAgYXBwZW5kIDogJyNhYWstc2V0dGluZ3MtY29uZmlnJwogICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAvLyBjcmVhdGUgb3B0aW9ucyAKICAgICAgICAgICAgICBmb3IgKHZhciBvcHROYW1lIGluIEFhay5vcHRpb25zKSB7CiAgICAgICAgICAgICAgICBpZiAoQWFrLm9wdGlvbnMuaGFzT3duUHJvcGVydHkob3B0TmFtZSkpIHsKICAgICAgICAgICAgICAgICAgdmFyIG9wdCA9IEFhay5vcHRpb25zW29wdE5hbWVdOwogICAgICAgICAgICAgICAgICB2YXIgY2hlY2tlZCA9IEFhay5vcHRzW29wdE5hbWVdID09PSB0cnVlID8gImNoZWNrZWQiIDogJyc7CiAgICAgICAgICAgICAgICAgIEFhay5jcmVhdGVFbGVtZW50KHsKICAgICAgICAgICAgICAgICAgICB0YWcgOiAnZGl2JywKICAgICAgICAgICAgICAgICAgICBodG1sIDogJzxpbnB1dCBpZD0iJyArIG9wdE5hbWUgKyAnIiBjbGFzcz0iY3NzLWNoZWNrYm94IiAnICsgY2hlY2tlZCArICcgdHlwZT0iJyArIG9wdC50eXBlICsgJyIvPjxsYWJlbCBmb3I9IicgKyBvcHROYW1lICsgJyIgdGl0bGU9IicgKyBvcHQuaW5mbyArICciIGNsYXNzPSJjc3MtbGFiZWwiPicgKyBvcHQubGFiZWwgKyAnPC9sYWJlbD4nLAogICAgICAgICAgICAgICAgICAgIGFwcGVuZCA6ICcjYWFrLXNldHRpbmdzLScgKyBvcHQuZ3JvdXAKICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAvLyBzYXZlIG9wdGlvbnMgCiAgICAgICAgICAgICAgQWFrLm9uRXZlbnQoQWFrLmdldEVsZW1lbnQoIiNhYWstc2V0dGluZ3Mtc2F2ZSIpLCAiY2xpY2siLCBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICB2YXIgZWxlbXMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcuY3NzLWNoZWNrYm94Jyk7CiAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGVsZW1zLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgIHZhciBlbGVtID0gZWxlbXNbaV07CiAgICAgICAgICAgICAgICAgIGlmIChlbGVtLmNoZWNrZWQpIHsKICAgICAgICAgICAgICAgICAgICBBYWsuc2V0VmFsdWUoZWxlbS5pZCwgdHJ1ZSk7CiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgQWFrLnNldFZhbHVlKGVsZW0uaWQsIGZhbHNlKTsKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgd2luZG93LmFsZXJ0KCdTYXZlZCAhJyk7CiAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgIC8vIENsZWFyIEdNIHN0b3JhZ2UKICAgICAgICAgICAgICBBYWsuYWRkQ29tbWFuZHMoewogICAgICAgICAgICAgICAgY2FwdGlvbiA6ICdDbGVhciBHTSBzdG9yYWdlJywKICAgICAgICAgICAgICAgIGV4ZWN1dGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgIEFhay5kZWxldGVWYWx1ZSgpOwogICAgICAgICAgICAgICAgICB3aW5kb3cuYWxlcnQoJ0NsZWFyZWQgIScpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICB1c2Vyc2NyaXB0c19kb21haW5zIDogeyAvLyBSZWRpcmVjdCB0byBHaXRodWIKICAgICAgICBob3N0IDogWyd1c2Vyc2NyaXB0cy5vcmcnLCAndXNlcnNjcmlwdHMub3JnOjgwODAnLCAndXNlcnNjcmlwdHMtbWlycm9yLm9yZyddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBpZiAoLzE1NTg0MCQvLnRlc3QobG9jYXRpb24ucGF0aG5hbWUpKSB7CiAgICAgICAgICAgIEFhay5nbyhBYWsuaG9tZVVSTCk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICBvcGVudXNlcmpzX29yZyA6IHsKICAgICAgICBob3N0IDogWydvcGVudXNlcmpzLm9yZyddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBlbGVtZW50ID0gQWFrLmdldEVsZW1lbnQoJ2FbaHJlZiQ9Ii9pc3N1ZXMiXScpOwogICAgICAgICAgaWYgKC9BbnRpLUFkYmxvY2tfS2lsbGVyX1JlZWsvLnRlc3QobG9jYXRpb24ucGF0aG5hbWUpICYmIGVsZW1lbnQpIHsKICAgICAgICAgICAgQWFrLmNvbmZpcm1SZXBvcnQoZWxlbWVudCk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICBncmVhc3lmb3JrX29yZyA6IHsKICAgICAgICBob3N0IDogWydncmVhc3lmb3JrLm9yZyddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBlbGVtZW50ID0gQWFrLmdldEVsZW1lbnQoJ2FbaHJlZiQ9Ii9mZWVkYmFjayJdJyk7CiAgICAgICAgICBpZiAoLy1hbnRpLWFkYm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gICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldExvY2FsKCdub2FkJywgZmFsc2UpOwogICAgICAgICAgQWFrLmFkZFN0eWxlKCIjZ0FkcyB7IGhlaWdodDogMTdweDsgfSAjZ0FkMiB7IGhlaWdodDogMTdweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgdXB0b2JveF91cHRvc3RyZWFtIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8zNTEKICAgICAgICBob3N0IDogWyd1cHRvYm94LmNvbScsICd1cHRvc3RyZWFtLmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyBPbGQgc29sdXRpb24gW2RlcHJlY2F0ZWRdCiAgICAgICAgICB2YXIgaWQgPSBsb2NhdGlvbi5wYXRobmFtZS5tYXRjaCgvWzAtOWEtel17MTJ9Lyk7CiAgICAgICAgICBpZiAoaWQgIT09IG51bGwpIHsKICAgICAgICAgICAgQWFrLmFkZFN0eWxlKCIjIiArIGlkWzBdICsgIiB7IGhlaWdodDogMTJweDsgfSIpOwogICAgICAgICAgfQogICAgICAgICAgLy8gTmV3IDEyLjA1LjIwMTQKICAgICAgICAgIC8vICsgYWJwIHJ1bGUgKGFsdGVybmF0aXZlIHNvbHV0aW9uKQogICAgICAgICAgQWFrLmFkZFN0eWxlKCIjYWRibG9ja3RyYXAgeyBoZWlnaHQ6IDEycHg7IH0iKTsKICAgICAgICB9LAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIHJlbW92ZSBhZHMKICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KCcqW3NyY149Imh0dHA6Ly9hZHMudXB0b2JveC5jb20vIl0sKltocmVmXj0iaHR0cDovL2Fkcy51cHRvYm94LmNvbS8iXScpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgYW5pc3Vic2lhX2NvbSA6IHsKICAgICAgICBob3N0IDogWydhbmlzdWJzaWEuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vICsgYWJwIHJ1bGUgI0AjLmFkc2FudGlsb2sKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLmFkc2FudGlsb2sgeyBoZWlnaHQ6IDVweDsgfSIpOwogICAgICAgIH0sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3LmpBbnRpQmxvY2sgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICAgIEFhay51dy5DZWtCbG9rID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgfQogICAgICB9LAogICAgICBmcmVlZ2FtZXNlcnZlcmhvc3RfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xNTEyCiAgICAgICAgaG9zdCA6IFsnZnJlZWdhbWVzZXJ2ZXJob3N0LmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoIiNmYWIxMyB7IGhlaWdodDogMTFweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZWxhaG1hZF9jb20gOiB7CiAgICAgICAgaG9zdCA6IFsnZWxhaG1hZC5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFN0eWxlKCIjYWRibG9jayB7IGhlaWdodDogMXB4OyB9Iik7CiAgICAgICAgfQogICAgICB9LAogICAgICBtcnR6Y21wM19uZXQgOiB7CiAgICAgICAgaG9zdCA6IFsnbXJ0emNtcDMubmV0J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICA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ICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoImRpdi5hZGR0aGlzX25hdGl2ZV90b29sYm94ICsgZGl2W2lkXSB7IGhlaWdodDogMTJweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZmlsZWNvcmVfY29fbnogOiB7CiAgICAgICAgaG9zdCA6IFsnZmlsZWNvcmUuY28ubnonXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFN0eWxlKCIuYWRzZW5zZSB7IGhlaWdodDogNXB4OyB9Iik7CiAgICAgICAgfQogICAgICB9LAogICAgICB0aG9tYXNfbl9ydXRoX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMTExMQogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS9mdTd2a1VBMQogICAgICAgIGhvc3QgOiBbJ3Rob21hcy1uLXJ1dGguY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLkdvb2dsZSB7IGhlaWdodDogNXB4OyB9Iik7CiAgICAgICAgfQogICAgICB9LAogICAgICBpbnRlcmZhbnNfb3JnIDogewogICAgICAgIC8vIHRlc3Q6IGh0dHA6Ly93d3cuaW50ZXJmYW5zLm9yZy9mb3J1bS8KICAgICAgICBob3N0IDogWydpbnRlcmZhbnMub3JnJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLmFkX2dsb2JhbF9oZWFkZXIgeyBoZWlnaHQ6IDFweDsgZGlzcGxheTogbm9uZTsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbWF4ZGVicmlkZXVyX2NvbSA6IHsKICAgICAgICBob3N0IDogWydtYXhkZWJyaWRldXIuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLmNsZWFyICsgZGl2W2lkXSB7IGhlaWdodDogMTJweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgdG9wem9uZV9pdCA6IHsKICAgICAgICBob3N0IDogWyd0b3B6b25lLmx0J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLmZvcnVtQWQgeyBoZWlnaHQ6IDFweDsgZGlzcGxheTogbm9uZTsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbmFuYTEwX2NvX2lsIDogewogICAgICAgIGhvc3QgOiBbJy5uYW5hMTAuJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI2FkdmVydC10cmFja2VyIHsgaGVpZ2h0OiAxcHg7IH0iKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHBsZWpfdHYgOiB7CiAgICAgICAgaG9zdCA6IFsncGxlai50diddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoIi5hZHZlcnRfYm94IHsgaGVpZ2h0OiAxcHg7IH0iKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIG1hbmdhbWludF9jb20gOiB7CiAgICAgICAgLy8gbm90ZTogYWRkZWQgcnVsZSB0byBhbGxvdyAiLmFkNzI4IgogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dyZWFzeWZvcmsub3JnL2lkL2ZvcnVtL2Rpc2N1c3Npb24vODUyNAogICAgICAgIGhvc3QgOiBbJ21hbmdhbWludC5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFN0eWxlKCIuYWQ3MjggeyBoZWlnaHQ6IDMxcHg7IH0iKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGRlYnJpZGV1cnN0cmVhbV9mciA6IHsKICAgICAgICBob3N0IDogWydkZWJyaWRldXJzdHJlYW0uZnInXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFN0eWxlKCIjY29udGVudCBkaXZbaWRdW2FsaWduPWNlbnRlcl0geyBoZWlnaHQ6IDEycHg7IH0iKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHByZWVtbGlua3NfY29tIDogewogICAgICAgIGhvc3QgOiBbJ3ByZWVtbGlua3MuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI2RpdmFkcyB7IGhlaWdodDogMXB4OyB9Iik7CiAgICAgICAgfQogICAgICB9LAogICAgICBoZW50YWlfdG8gOiB7CiAgICAgICAgaG9zdCA6IFsnaGVudGFpLnRvJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI2hlbnRhaXRvMTIzIHsgaGVpZ2h0OiAxMXB4OyB9Iik7CiAgICAgICAgfQogICAgICB9LAogICAgICBwcm90b3R1cmtfY29tIDogewogICAgICAgIGhvc3QgOiBbJ3Byb3RvdHVyay5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFN0eWxlKCIjcmVrbGFtIHsgaGVpZ2h0OiAxcHg7IH0iKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIG11ZmFfZGUgOiB7CiAgICAgICAgaG9zdCA6IFsnbXVmYS5kZSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoIiNsZWFkZXJib2FyZCB7IGhlaWdodDogNXB4OyB9Iik7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoIiNsYXJnZS1yZWN0YW5nbGUgeyBoZWlnaHQ6IDVweDsgfSIpOwogICAgICAgICAgQWFrLmFkZFN0eWxlKCIjYWQtaGVhZGVyLTQ2OHg2MCB7IGhlaWdodDogNXB4OyB9Iik7CiAgICAgICAgfQogICAgICB9LAogICAgICB3YXRjaGFyYWJfY29tIDogewogICAgICAgIGhvc3QgOiBbJ3dhdGNoYXJhYi5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gKyBhZHAgcnVsZSB3YXRjaGFyYWIuY29tI0AjI2FkYmxvY2sKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI2FkYmxvY2sgeyBoZWlnaHQ6IDVweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZnJlZWRvbWlwX2NvbSA6IHsKICAgICAgICBob3N0IDogWydmcmVlZG9tLWlwLmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoIi5wdWJfdmVydGljYWwgaW5zLCAucHViX3ZlcnRpY2FsIGRpdiB7IGhlaWdodDogMTFweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgd2FrYW5pbV90diA6IHsKICAgICAgICBob3N0IDogWyd3YWthbmltLnR2J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI2RldGVjdG9yIHsgZGlzcGxheTogbm9uZTsgfSIpOwogICAgICAgICAgQWFrLmFkZFN0eWxlKCIjbm9wdWIgeyBkaXNwbGF5OiBibG9jazsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgc2ltcGx5X2RlYnJpZF9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzMzMgogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS9iN01BWVhzNAogICAgICAgIGhvc3QgOiBbJ3NpbXBseS1kZWJyaWQuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5hZHNieWdvb2dsZSA9IHt9OwogICAgICAgICAgQWFrLnV3LmFkc2J5Z29vZ2xlLmxvYWRlZCA9IHRydWU7CiAgICAgICAgfQogICAgICB9LAogICAgICBtYW5nYTlfY29tIDogewogICAgICAgIGhvc3QgOiBbJ21hbmdhOS5jb20nLCAnbWFuZ2FiZWUuY28nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFN0eWxlKCIuYWRibG9jayB7IGhlaWdodDogMzFweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgb25lbWFuZ2EyX2NvbSA6IHsKICAgICAgICBob3N0IDogWydvbmVtYW5nYTIuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLmFmc19hZHMgeyBoZWlnaHQ6IDVweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbWFuZ2FiaXJkX2NvbSA6IHsKICAgICAgICBob3N0IDogWydtYW5nYWJpcmQuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLmFmc19hZHMgeyBoZWlnaHQ6IDVweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAga29kaWxpdmVfZXUgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzE1MjgKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6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8xMjkwCiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL0NQemQyU3d4CiAgICAgICAgaG9zdCA6IFsnd29ya3VwbG9hZC5jb20nXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiLmFkQmxvY2ssIC5hZHNieWdvb2dsZSwgI3NhZCB7IGhlaWdodDogMTFweDsgfSIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgdG9kYXlfaW4gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9aW50b2RheS5pbgogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPWJ1c2luZXNzdG9kYXkuaW4KICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vZ3o1MzlHN20KICAgICAgICBob3N0IDogWyJpbnRvZGF5LmluIiwgImJ1c2luZXNzdG9kYXkuaW4iXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24oKSB7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoJyNhZGJvY2tlcl9hbHQgeyBkaXNwbGF5OiBub25lOyB9Jyk7CiAgICAgICAgICBBYWsudXcub3BlblBvcHVwID0gZnVuY3Rpb24oKXt9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgamNfbXBfY29tIDogewogICAgICAgIC8vIGJ5OiBHaXdheXVtZQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xNTk3CiAgICAgICAgaG9zdCA6IFsiamMtbXAuY29tIl0sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uKCkgewogICAgICAgICAgQ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Iik7CiAgICAgICAgfQogICAgICB9LAogICAgICBmb3JiZXNfY29tIDogewogICAgICAgIC8vIGJ5OiBHaXdheXVtZQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy84NjUKICAgICAgICBob3N0IDogWydmb3JiZXMuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIGlmICh3aW5kb3cubG9jYXRpb24ucGF0aG5hbWUuaW5kZXhPZignL3dlbGNvbWUnKSA+IC0xKSB7CiAgICAgICAgICAgIEFhay5zZXRDb29raWUoJ3dlbGNvbWVBZCcsICd0cnVlJywgODY0MDAwMDAsICcvJyk7CiAgICAgICAgICAgIEFhay5zZXRDb29raWUoJ2RhaWx5V2VsY29tZUNvb2tpZScsICd0cnVlJywgODY0MDAwMDAsICcvJyk7CiAgICAgICAgICAgIHdpbmRvdy5sb2NhdGlvbiA9IEFhay5nZXRDb29raWUoJ3RvVXJsJykgfHwgJ2h0dHA6Ly93d3cuZm9yYmVzLmNvbS8nOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgYmFpdF9hZHNieWdvb2dsZSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNTQ3CiAgICAgICAgaG9zdCA6IFsnYml0Y29pbmFsaWVucy5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZEJhaXRFbGVtZW50KCdpbnMuYWRzYnlnb29nbGUnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGJhaXRfdGVzdGVyIDogewogICAgICAgIGhvc3QgOiBbJ29zb2FyY2FkZS5jb20nLCAnZDNicmlkNHkwdS5pbmZvJywgJ2ZpbGVpY2UubmV0JywgJ25vc3Rl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bS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzE2NTIKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vNDc0Tlp6UEoKICAgICAgICBob3N0IDogWydtaWwuaW5rJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRCYWl0RWxlbWVudCgnZGl2I2Fkc19kaXYnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGN1YmV1cGxvYWRfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dyZWFzeWZvcmsub3JnL2VuL2ZvcnVtL2Rpc2N1c3Npb24vNTkxOQogICAgICAgIGhvc3QgOiBbJ2N1YmV1cGxvYWQuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5jcmVhdGVFbGVtZW50KHsKICAgICAgICAgICAgdGFnIDogJ2lmcmFtZScsCiAgICAgICAgICAgIG5hbWUgOiAnaWZyYW1lJywKICAgICAgICAgICAgc3JjIDogJ2Fib3V0OmJsYW5rJywKICAgICAgICAgICAgc3R5bGUgOiAnZGlzcGxheTpub25lOycsCiAgICAgICAgICAgIGFwcGVuZCA6IGRvY3VtZW50LmRvY3VtZW50RWxlbWVudAogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBzdHJlYW00ZnJlZV9ldSA6IHsKICAgICAgICBob3N0IDogWydzdHJlYW00ZnJlZS5ldSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyArYWJwIGFsdCBzb2x1dGlvbgogICAgICAgICAgQWFrLmFkZEJhaXRFbGVtZW50KCdkaXYjanBheWRheScpOwogICAgICAgICAgQWFrLnV3LmpwYXlkYXlfYWxlcnQgPSAxOwogICAgICAgIH0KICAgICAgfSwKICAgICAgXzNkbmV3c19ydSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9ncmVhc3lmb3JrLm9yZy9ydS9mb3J1bS9kaXNjdXNzaW9uLzU3NTAKICAgICAgICBob3N0IDogWyczZG5ld3MucnUnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldENvb2tpZSgnYWRibG9ja3dhcm4nLCAxKTsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI2VhckFkcyB7IHdpZHRoOiA0MDFweDsgfSIpOwogICAgICAgICAgQWFrLmFkZEJhaXRFbGVtZW50KCdkaXYjZWFyQWRzJyk7CiAgICAgICAgICBBYWsudXcuX19BVF9kZXRlY3RlZCA9IHRydWU7CiAgICAgICAgfQogICAgICB9LAogICAgICBfM2RzdGhlbV9lcyA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT0zZHN0aGVtCiAgICAgICAgaG9zdCA6IFsnM2RzdGhlbS5lcyddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvL0Fhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkge30pOwogICAgICAgIH0sCiAgICAgICAgb25CZWZvcmVTY3JpcHQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgLyoKICAgICAgICAgIHJldHVybiBbewogICAgICAgICAgICAgIGNvbnRhaW5zIDogJ21haW4uanMnLAogICAgICAgICAgICAgIGV4dGVybmFsIDogdHJ1ZSwKICAgICAgICAgICAgICBvdmVycmlkZSA6ICcvL3Bhc3RlYmluLmNvbS9yYXcvMnlHUlBoUlonCiAgICAgICAgICAgIH0KICAgICAgICAgIF07CiAgICAgICAgKi8KICAgICAgICB9CiAgICAgIH0sCiAgICAgIF84bXVzZXNfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPThtdXNlcwogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dyZWFzeWZvcmsub3JnL2ZvcnVtL2Rpc2N1c3Npb24vODUxNQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dyZWFzeWZvcmsub3JnL2VuL2ZvcnVtL2Rpc2N1c3Npb24vNjQwNwogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS9iTU5EeGVjcwogICAgICAgIGhvc3QgOiBbJzhtdXNlcy5jb20nXSwKICAgICAgICBvbkJlZm9yZVNjcmlwdCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHJldHVybiBbewogICAgICAgICAgICAgIGNvbnRhaW5zIDogInR5cGVvZiBleG8iLAogICAgICAgICAgICAgIGV4dGVybmFsIDogZmFsc2UsCiAgICAgICAgICAgICAgcmVtb3ZlIDogdHJ1ZQogICAgICAgICAgICB9CiAgICAgICAgICBdOwogICAgICAgIH0KICAgICAgfSwKICAgICAgaGFwcHl0cmlwc19jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9aGFwcHl0cmlwcwogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS9FV1NFYm52dgogICAgICAgIGhvc3QgOiBbJ2hhcHB5dHJpcHMuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRSZWFkT25seSgnY2FuUnVuJywgdHJ1ZSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBsZ19maXJtd2FyZV9yb21fY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPWxnLWZpcm13YXJlLXJvbS5jb20KICAgICAgICBob3N0IDogWydsZy1maXJtd2FyZS1yb20uY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRSZWFkT25seSgna2lsbGFkcycsIHRydWUpOwogICAgICAgIH0KICAgICAgfSwgICAgICAKICAgICAgbWlkX2RheV9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9bWlkLWRheS5jb20KICAgICAgICBob3N0IDogWydtaWQtZGF5LmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0UmVhZE9ubHkoJ2NhblJ1bicsIHRydWUpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgYmFkdHZfbmV0d29yayA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1iYWR0di5pdAogICAgICAgIGhvc3QgOiBbJ2JhZHR2Lml0JywgJ2JhZHRhc3RlLml0JywgJ2JhZGdhbWVzLml0JywgJ2JhZGNvbWljcy5pdCddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCdhZEJsb2NrQ2hlY2tlZCcsICdkaXNhdHRpdm8nKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGluZGVwZW5kZW50X2NvX3VrIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPWluZGVwZW5kZW50LmNvLnVrCiAgICAgICAgaG9zdCA6IFsnaW5kZXBlbmRlbnQuY28udWsnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldENvb2tpZSgnYWRibG9ja19kZXRlY3RlZCcsICdpZ25vcmVkJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBlc21hc19jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9ZXNtYXMuY29tCiAgICAgICAgaG9zdCA6IFsnZXNtYXMuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRSZWFkT25seSgnb3BlbmVkX2FkYmJsb2NrJywgZmFsc2UpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgcGlub3kxdHZfbmV0d29yayA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1waW5veTF0dgogICAgICAgIGhvc3QgOiBbJ3Bpbm95MXR2LiddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0UmVhZE9ubHkoJ2FsbG93YWRzJywgMSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBld2FsbHN0cmVldGVyX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1ld2FsbHN0cmVldGVyLmNvbQogICAgICAgIGhvc3QgOiBbJ2V3YWxsc3RyZWV0ZXIuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRSZWFkT25seSgnT0FTX3JkbCcsIDEpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgYnVzaW5lc3Nfc3RhbmRhcmRfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta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IGhvc3QgOiBbJ2luZGlhdGltZXMuY29tJywgJ3NhbWF5YW0uY29tJywgJ2JhbmdhbG9yZW1pcnJvci5jb20nXSwKICAgICAgICBvbkJlZm9yZVNjcmlwdCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHJldHVybiBbewogICAgICAgICAgICAgIGNvbnRhaW5zIDogJ1xcXFx4NjFcXFxceDY0XFxcXHg2MicsCiAgICAgICAgICAgICAgZXh0ZXJuYWwgOiBmYWxzZSwKICAgICAgICAgICAgICByZW1vdmUgOiB0cnVlCiAgICAgICAgICAgIH0sIHsKICAgICAgICAgICAgICBjb250YWlucyA6ICdmdW5jdGlvbiBpbml0QmxvY2snLAogICAgICAgICAgICAgIGV4dGVybmFsIDogZmFsc2UsCiAgICAgICAgICAgICAgcmVtb3ZlIDogdHJ1ZQogICAgICAgICAgICB9CiAgICAgICAgICBdOwogICAgICAgIH0KICAgICAgfSwKICAgICAgdGhlY2hpdmVfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xNDUzCiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL1RkcFB5cmJiCiAgICAgICAgaG9zdCA6IFsndGhlY2hpdmUuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydGllcyh3aW5kb3csIHsKICAgICAgICAgICAgICBzdGVwaGFuZURldGVjdG9yIDogewogICAgICAgICAgICAgICAgdmFsdWUgOiB7CiAgICAgICAgICAgICAgICAgIGhvb2sgOiBmdW5jdGlvbiAoY2IpIHsKICAgICAgICAgICAgICAgICAgICBjYihmYWxzZSk7CiAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgIGluaXQgO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AgICAgICAgICAgICAgICB2YXIgZXhlYyA9IHJlc3VsdC5yZXBsYWNlKCIkKCcuYXJ0aWNsZS1jb250ZW50JykiLCAiJCgnLmFydGljbGUtY29udGVudC0yJykiKTsKICAgICAgICAgICAgICAgIG5ldyBGdW5jdGlvbihleGVjKSgpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICQoIi5hcnRpY2xlLWNvbnRlbnQiKS5hZnRlcignPGRpdiBjbGFzcz0iYXJ0aWNsZS1jb250ZW50LTIiPjwvZGl2PicpLnJlbW92ZSgpOwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBybXByZXB1c2JfY29tIDogewogICAgICAgIGhvc3QgOiBbJ3JtcHJlcHVzYi5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldENvb2tpZSgnam90X3ZpZXdlcicsIDMpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbmVvZHJpdmVfY28gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEwMDEKICAgICAgICBob3N0IDogWyduZW9kcml2ZS5jbyddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gUHJldmVudCBwb3B1bmRlcgogICAgICAgICAgQWFrLnNldENvb2tpZSgnS2lmUG9wQ250JywgMSwgbnVsbCwgJy9lbWJlZC8nKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGhlbnRhaWhhdmVuX29yZyA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL2dvcmhpbGwvdUJsb2NrL2lzc3Vlcy8xMzQwCiAgICAgICAgaG9zdCA6IFsnaGVudGFpaGF2ZW4ub3JnJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoK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Agb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI3Rlc3QgeyBoZWlnaHQ6IDI1MHB4OyB9Iik7CiAgICAgICAgICBBYWsuYWRkQmFpdEVsZW1lbnQoJ2RpdiN0ZXN0Jyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBqa2FuaW1lX25ldCA6IHsKICAgICAgICBob3N0IDogWydqa2FuaW1lLm5ldCddLAogICAgICAgIC8vIEBAfHxqa2FuaW1lLm5ldC9hc3NldHMvanMvYWR2ZXJ0aXNlbWVudDIuanMKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZEJhaXRFbGVtZW50KCdkaXYjcmVjbycpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgXzcyMHBta3ZfY29tIDogewogICAgICAgIGhvc3QgOiBbJzcyMHBta3YuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRCYWl0RWxlbWVudCgnZGl2I2FkdmVydCcpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgcGFpZHZlcnRzX2NvbSA6IHsKICAgICAgICBob3N0IDogWydwYWlkdmVydHMuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRCYWl0RWxlbWVudCgnZGl2LmFmc19hZHMnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGl0YWxpYXR2X29yZyA6IHsKICAgICAgICBob3N0IDogWydpdGFsaWF0di5vcmcnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZEJhaXRFbGVtZW50KCdkaXYjZmFiMTMnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGNocmlzc21vb3ZlX2NvbSA6IHsKICAgICAgICBob3N0IDogWydjaHJpc3Ntb292ZS5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy9BYWsuYWRkQmFpdEVsZW1lbnQoJ2RpdiNhZHNlcnZlcicpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZXZlbnRodWJzX2NvbSA6IHsKICAgICAgICBob3N0IDogWydldmVudGh1YnMuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRCYWl0RWxlbWVudCgnZGl2I2JsYWh5YmxhY2kxJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBzdXBlcmFuaW1lc19jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEyOTUKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vRkRQQUtqVFEKICAgICAgICBob3N0IDogWydzdXBlcmFuaW1lcy5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZEJhaXRFbGVtZW50KCdkaXYjYmFubmVyTG9qYScpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZm9ydW1fcGFjX3JvbV9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzI0MwogICAgICAgIGhvc3QgOiBbJ2ZvcnVtLnBhYy1yb20uY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRCYWl0RWxlbWVudCgnZGl2LmJhbm5lcl9hZHMnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGxpdHZfdHYgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxs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AgICAgZ2VuZXJhdHVwcmVtaXVtX2JpeiA6IHsKICAgICAgICBob3N0IDogWydnZW5lcmF0dXByZW1pdW0uYml6J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIERpc2FibGUgQ29uZmlybSBCb3gKICAgICAgICAgIC8vQWFrLnV3LmNvbmZpcm0gPSBmdW5jdGlvbiAoKXt9OwogICAgICAgICAgQWFrLnNldENvb2tpZSgnZ2VuZXJhJywgZmFsc2UpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbmV3c3RhdGVzbWFuX2NvbSA6IHsKICAgICAgICBob3N0IDogWyduZXdzdGF0ZXNtYW4uY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRDb29raWUoJ2RvbmF0aW9uUG9wdXAnLCAnaGlkZScpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgYWRzd2l6el9jb20gOiB7CiAgICAgICAgLy8gYnk6IFNrcjR0Y2hHcjNhenlNb25raUJhbGxsbGxsWnp6egogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy84MDkKICAgICAgICBob3N0IDogWyd5ZXMuZm0nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFNjcmlwdChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIHdpbmRvdy5jb21fYWRzd2l6el9zeW5jaHJvX2luaXRpYWxpemUgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZGVyc3RhbmRhcmRfYXQgOiB7CiAgICAgICAgLy8gYnk6IEFsZXhhbmRlcjI1NQogICAgICAgIC8vIHBhdGNoOiBodHRwOi8vcGFzdGViaW4uY29tL3Jhdy5waHA/aT1yN1E0RHJmQgogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPWRlcnN0YW5kYXJkCiAgICAgICAgaG9zdCA6IFsnZGVyc3RhbmRhcmQuYXQnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewoKICAgICAgICAgIHZhciBtYWtlSVNPVGltZXN0YW1wVVRDID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgcGFkID0gZnVuY3Rpb24gKGFtb3VudCwgd2lkdGgpIHsKICAgICAgICAgICAgICB2YXIgcGFkZGluZyA9ICIiOwogICAgICAgICAgICAgIHdoaWxlIChwYWRkaW5nLmxlbmd0aCA8IHdpZHRoIC0gMSAmJiBhbW91bnQgPCBNYXRoLnBvdygxMCwgd2lkdGggLSBwYWRkaW5nLmxlbmd0aCAtIDEpKSB7CiAgICAgICAgICAgICAgICBwYWRkaW5nICs9ICIwIjsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgcmV0dXJuIHBhZGRpbmcgKyBhbW91bnQudG9TdHJpbmcoKTsKICAgICAgICAgICAgfTsKCiAgICAgICAgICAgIHZhciBkYXRlID0gbmV3IERhdGUoKTsKICAgICAgICAgICAgcmV0dXJuIFtwYWQoZGF0ZS5nZXRVVENGdWxsWWVhcigpLCA0KSwgIi0iLAogICAgICAgICAgICAgIHBhZChkYXRlLmdldFVUQ01vbnRoKCkgKyAxLCAyKSwgIi0iLAogICAgICAgICAgICAgIHBhZChkYXRlLmdldFVUQ0RhdGUoKSwgMiksICJUIiwKICAgICAgICAgICAgICBwYWQoZGF0ZS5nZXRVVENIb3VycygpLCAyKSwgIjoiLAogICAgICAgICAgICAgIHBhZChkYXRlLmdldFVUQ01pbnV0ZXMoKSwgMiksICI6IiwKICAgICAgICAgICAgICBwYWQoZGF0ZS5nZXRVVENTZWNvbmRzKCksIDIpXS5qb2luKCk7CiAgICAgICAgICB9OwoKICAgICAgICAgIGRvY3VtZW50LmNvb2tpZS5zcGxpdCgnOyAnKS5mb3JFYWNoKGZ1bmN0aW9uIChjb29raWUpIHsKICAgICAgICAgICAgLy8gRmluZCBtYWluIHN0b3JhZ2UgY29va2llCiAgICAgICAgICAgIGlmIChjb29raWUuc3Vic3RyKDAsIDYpID09ICJNR1VJRD0iKSB7CiAgICAgICAgICAgICAgLy8gRGVjb21wb3NlIGluZm9ybWF0aW9uIGZyb20gbWFpbiBzdG9yYWdlIGNvb2tpZQogICAgICAgICAgICAgIHZhciB2YWx1ZXMgPSB7fTsKICAgICAgICAgICAgICBjb29raWUuc3Vic3RyKDYpLnNwbGl0KCImIikuZm9yRWFjaChmdW5jdGlvbiAoYXNzaWdubWVudCkgewogICAgICAgICAgICAgICAgdmFyIHBvcyA9IGFzc2lnbm1lbnQuaW5kZXhPZignPScpOwogICAgICAgICAgICAgICAgaWYgKHBvcyA+IC0xKSB7CiAgICAgICAgICAgICAgICAgIHZhbHVlc1thc3NpZ25tZW50LnN1YnN0cigwLCBwb3MpXSA9IGFzc2lnbm1lbnQuc3Vic3RyKHBvcyArIDEpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAvLyBVcGRhdGUgImZpcnN0IHZpZXdlZCIgdGltZXN0YW1wCiAgICAgICAgICAgICAgdmFsdWVzLlRpbWVzdGFtcCA9IG1ha2VJU09UaW1lc3RhbXBVVEMoKTsKCiAgICAgICAgICAgICAgLy8gUmVjb21wb3NlIGluZm9ybWF0aW9uIGluIG1haW4gc3RvcmFnZSBjb29raWUKICAgICAgICAgICAgICBjb29raWUgPSAiTUdVSUQ9IjsKICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gdmFsdWVzKSB7CiAgICAgICAgICAgICAgICBpZiAodmFsdWVzLmhhc093blByb3BlcnR5KGtleSkpIHsKICAgICAgICAgICAgICAgICAgY29va2llICs9IGtleSArICI9IiArIHZhbHVlc1trZXldICsgIiYiOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICBjb29raWUgPSBjb29raWUuc3Vic3RyKDAsIChjb29raWUubGVuZ3RoIC0gMSkpOwoKICAgICAgICAgICAgICAvLyBVcGRhdGUgY29va2llCiAgICAgICAgICAgICAgZG9jdW1lbnQuY29va2llID0gY29va2llOwogICAgICAgICAgICB9CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHRla19kb21haW5zIDogewogICAgICAgIC8vIGJ5OiBSZWVrLCBBbGV4YW5kZXIyNTUKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNzg4CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzUxMgogICAgICAgIGhvc3QgOiBbJ3Rlay5ubycsICdnYW1lci5ubycsICd0ZWtub2ZpbC5ubycsICdpbnNpZGV0ZWxlY29tLm5vJywgJ3ByaXNndWlkZS5ubycsICdkaXNrdXNqb24ubm8nLCAndGVrbm9qb2JiLm5vJywgJ2FrYW0ubm8nLCAnaGFyZHdhcmUubm8nLCAnYW1vYmlsLm5vJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewoKICAgICAgICAgIC8qCiAgICAgICAgICB2YXIgYWRfZnJhbWUgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJpZnJhbWUiKTsKICAgICAgICAgIGFkX2ZyYW1lLm5hbWUgPSAiX2ZyYW1lIjsKICAgICAgICAgIGFkX2ZyYW1lLnN0eWxlLmRpc3BsYXkgPSAibm9uZSI7CiAgICAgICAgICBkb2N1bWVudC5ib2R5LmFwcGVuZENoaWxkKGFkX2ZyYW1lKTsKICAgICAgICAgIGFkX2ZyYW1lLmNvbnRlbnRXaW5kb3cud3JhcHBlZEpTT2JqZWN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ZXMvNTYyCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzQ4NAogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlMi5vcmcvNTN5bWdoWDEKICAgICAgICBob3N0IDogWydiZXRhLnNwZWVkdGVzdC5uZXQnXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5hZHNPb2tsYUNvbVJlYWNoYWJsZSA9IHRydWU7CiAgICAgICAgICBBYWsudXcuc2NyaXB0c0xvYWRlZCA9IGZ1bmN0aW9uICgpIHt9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgYmluYnVja3NfY29tIDogewogICAgICAgIC8vIGJ5OiBBbGV4YW5kZXIyNTUKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNTQ1CiAgICAgICAgaG9zdCA6IFsnYmluYnVja3MuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3LnRlc3RKdWljeVBheSA9IHRydWU7CiAgICAgICAgICBBYWsudXcudGVzdFNlbnNlUGF5ID0gdHJ1ZTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHdoaXNreXByaWNlc19kb21haW5zIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xMjg0CiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL0VwcjV0UkVMCiAgICAgICAgaG9zdCA6IFsnd2hpc2t5cHJpanplbi5jb20nLCAnd2hpc2t5cHJpY2VzLmNvLnVrJywgJ3doaXNreXByZWlzZS5jb20nLCAnd2hpc2t5cHJpeC5mciddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3Lk9BX3Nob3cgPSB0cnVlOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbmljb2Jsb2dfb3JnIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xMTg0CiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL01OSHBMczJWCiAgICAgICAgaG9zdCA6IFsnbmljb2Jsb2cub3JnJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgdmFyIGVsID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignLnNyYycpOwogICAgICAgICAgZWwucmVtb3ZlQXR0cmlidXRlKCdjbGFzcycpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZGlfc2UgOiB7CiAgICAgICAgLy8gbm90ZTogYWRkIHRoaXMgcnVsZSBmb3IgY2hyb21lIHVzZXIKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMTMxOQogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS85YkRQUXpNWAogICAgICAgIGhvc3QgOiBbJ2RpLnNlJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNoZWFkZXJfb3ZlcmxheScpOwogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNtZXNzYWdlX21vZGFsJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBtZWdvZ29fbmV0IDogewogICAgICAgIC8vIGlzc3VlOiBQTQogICAgICAgIC8vIHNvdXJjZTE6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vY2NIUWczaG4KICAgICAgICAvLyBzb3VyY2UyOiBodHRwOi8vcGFzdGViaW4uY29tL2drMHZFUUhOCiAgICAgICAgLy8gbm90ZTogdHdvIGFkYmxvY2sgY2hlY2sKICAgICAgICBob3N0IDogWydtZWdvZ28ubmV0J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYWsudXcsICJhZEJsb2NrIiwgewogICAgICAgICAgICBlbnVtZXJhYmxlIDogdHJ1ZSwKICAgICAgICAgICAgd3JpdGFibGUgOiBmYWxzZSwKICAgICAgICAgICAgdmFsdWUgOiBmYWxzZQogICAgICAgICAgfSk7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWFrLnV3LCAic2hvd0FkQmxvY2tNZXNzYWdlIiwgewogICAgICAgICAgICBlbnVtZXJhYmxlIDogdHJ1ZSwKICAgICAgICAgICAgd3JpdGFibGUgOiBmYWxzZSwKICAgICAgICAgICAgdmFsdWUgOiBmdW5jdGlvbiAoKSB7fQogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBsaWJlcnRhZGRpZ2l0YWxfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xNjQyCiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tLzZGenAwdnJFCiAgICAgICAgaG9zdCA6IFsnbGliZXJ0YWRkaWdpdGFsLmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWFrLnV3LCAiYWRfYWxyZWFkeV9wbGF5ZWQiLCB7CiAgICAgICAgICAgIGVudW1lcmFibGUgOiB0cnVlLAogICAgICAgICAgICB3cml0YWJsZSA6IGZhbHNlLAogICAgICAgICAgICB2YWx1ZSA6IHRydWUKICAgICAgICAgIH0pOwogICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFhay51dywgInB1ZWRlTW9zdHJhckFkcyIsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgIHZhbHVlIDogdHJ1ZQogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LCAgICAgCiAgICAgIGZvbGhhX3VvbF9jb21fYnIgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEzOTYKICAgICAgICAvLyBzb3VyY2U6IGYoICggdHlwZW9mIHBheXdhbGxfYWNjZXNzID09ICJ1bmRlZmluZWQiIHx8IHBheXdhbGxfYWNjZXNzICE9IHRydWUgKSAmJiAoIHR5cGVvZiBmb2xoYV9hZHMgPT0gInVuZGVmaW5lZCIgfHwgZm9saGFfYWRzICE9IHRydWUgKSApIHsKICAgICAgICBob3N0IDogWydmb2xoYS51b2wuY29tLmJyJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYWsudXcsICJwYXl3YWxsX2FjY2VzcyIsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgIHZhbHVlIDogdHJ1ZQogICAgICAgICAgfSk7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWFrLnV3LCAiZm9saGFfYWRzIiwgewogICAgICAgICAgICBlbnVtZXJhYmxlIDogdHJ1ZSwKICAgICAgICAgICAgd3JpdGFibGUgOiBmYWxzZSwKICAgICAgICAgICAgdmFsdWUgOiB0cnVlCiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGdhbWVyX2NvbV90dyA6IHsKICAgICAgICAvLyBieTogbW1pczEwMDAKICAgICAgICAvLyB1c2Vyc2NyaXB0OiBodHRwczovL2dyZWFzeWZvcmsub3JnL2VuL3NjcmlwdHMvMTY1MjUKICAgICAgICAvLyBpc3N1ZTogOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy85NzUKICAgICAgICBob3N0IDogWydnYW1lci5jb20udHcnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFhay51dywgJ0FudGlBZCcsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgIHZhbHVlIDogbnVsbAogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBhcm1vcmdhbWVzX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvODQ1CiAgICAgICAgaG9zdCA6IFsnYXJtb3JnYW1lcy5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFhay51dywgJ2dhX2RldGVjdCcsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgIHZhbHVlIDogbnVsbAogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBtYW5nYWhvc3RfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy85NTcKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNTU4CiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL0dycGJKRU5BCiAgICAgICAgaG9zdCA6IFsnbWFuZ2Fob3N0LmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWFrLnV3LCAidGVzdERpc3BsYXkiLCB7CiAgICAgICAgICAgIGVudW1lcmFibGUgOiB0cnVlLAogICAgICAgICAgICB3cml0YWJsZSA6IGZhbHNlLAogICAgICAgICAgICB2YWx1ZSA6IGZhbHNlCiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHZpZGVvd29vZF90diA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMTMzOQogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3ZpZGVvd29vZC50di9idWlsZC9hc3NldHMvanMvcGVtYmVkLTk3YTY0MGY2MjUuanMKICAgICAgICBob3N0IDogWyd2aWRlb3dvb2QudHYnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3Lm9wZW4gPSBmdW5jdGlvbiAoKSB7fTsgLy8gcHJldmVudCBwb3B1cAogICAgICAgICAgQWFrLnV3LmNvbmZpZyA9IHt9OwogICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KEFhay51dy5jb25maWcsICJhZGJfcmVtaW5kIiwgewogICAgICAgICAgICBlbnVtZXJhYmxlIDogdHJ1ZSwKICAgICAgICAgICAgd3JpdGFibGUgOiBmYWxzZSwKICAgICAgICAgICAgdmFsdWUgOiBmYWxzZQogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBpbmZvam9ic19jb21fYnIgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEzMzkKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vTFBnNjA5M1UKICAgICAgICAvLyByZWRpcmVjdDogaHR0cDovL3d3dy5pbmZvam9icy5jb20uYnIvbm9wdWJsaWNpdHkuYXNweAogICAgICAgIGhvc3QgOiBbJ2luZm9qb2JzLmNvbS5iciddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuYWRkU2NyaXB0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIHdlYlVJID0gd2ViVUkgfHwge307CiAgICAgICAgICAgIHdlYlVJLlV0aWxzID0gd2ViVUkuVXRpbHMgfHwge307CiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh3ZWJVSS5VdGlscywgIlN0b3BBZEJsb2NrIiwgewogICAgICAgICAgICAgIGVudW1lcmFibGUgOiB0cnVlLAogICAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgICAgdmFsdWUgOiBmdW5jdGlvbiAoKSB7fQogICAgICAgICAgICB9KTsKICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGNsb3Vkd2ViY29weV9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzcxNAogICAgICAgIGhvc3QgOiBbJ2Nsb3Vkd2ViY29weS5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgdmFyIHNldFRpbWVvdXRDbG9uZSA9IEFhay51dy5zZXRUaW1lb3V0OwogICAgICAgICAgQWFrLnV3LnNldFRpbWVvdXQgPSBudWxsOwogICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIEFhay51dy5zZXRUaW1lb3V0ID0gc2V0VGltZW91dENsb25lOwogICAgICAgICAgfSwgNTAwMCk7CiAgICAgICAgfQogICAgICB9LAogICAgICBuYXJraXZlX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNTY5CiAgICAgICAgaG9zdCA6IFsnbmFya2l2ZS5jb20nXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5hZGJsb2NrX3N0YXR1cyA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgfTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHByZWdlbl9uZXQgOiB7CiAgICAgICAgaG9zdCA6IFsncHJlZ2VuLm5ldCddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyBza2lwIHBhZ2UgaW5mbwogICAgICAgICAgQWFrLnNldENvb2tpZSgncGduJywgMSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBwaHlzX29yZyA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNzY4CiAgICAgICAgaG9zdCA6IFsncGh5cy5vcmcnXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5jaGtBQiA9IGZ1bmN0aW9uICgpIHt9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgb252YXNvcnRpcl9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9b252YXNvcnRpci5jb20KICAgICAgICBob3N0IDogWydvbnZhc29ydGlyLmNvbSddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gK2FicCBydWxlIGFsdCBzb2x1dGlvbgogICAgICAgICAgQWFrLnV3LkplQmxvcXVlID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgfQogICAgICB9LAogICAgICBmdWxsaGR6ZXZraV9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9ZnVsbGhkemV2a2kuY29tCiAgICAgICAgaG9zdCA6IFsnZnVsbGhkemV2a2kuY29tJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyArYWJwIHJ1bGUgYWx0IHNvbHV0aW9uCiAgICAgICAgICBBYWsudXcuY2hlY2sgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHZpbGxlX2lkZWFsZV9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzI1OAogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS8xNm1ubWVNYwogICAgICAgIGhvc3QgOiBbJ3ZpbGxlLWlkZWFsZS5jb20nXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vICthYnAgcnVsZSBhbHQgc29sdXRpb24KICAgICAgICAgIEFhay51dy5leGVjc3AgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIG5vdHJlX3BsYW5ldGVfaW5mbyA6IHsKICAgICAgICAvLyBpc3N1ZTog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20vQkZyRFBNNmIKICAgICAgICBob3N0IDogWydtdGxibG9nLmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWFrLnV3LCAncHVhYnMnLCB7CiAgICAgICAgICAgIGVudW1lcmFibGUgOiB0cnVlLAogICAgICAgICAgICB2YWx1ZSA6IGZ1bmN0aW9uICgpIHt9CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGFuaXptX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZToKICAgICAgICBob3N0IDogWydhbml6bS5jb20nXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5zdG9wQWRCbG9jayA9IHt9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgZGlhcmlvaW5mb3JtYWNpb25fY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xNTUwCiAgICAgICAgaG9zdCA6IFsnZGlhcmlvaW5mb3JtYWNpb24uY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYWsudXcsICdwcl9va3ZhbGlkYScsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHZhbHVlIDogdHJ1ZQogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBjbmJldGFfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xMzAxCiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL3ZYTkN6dHd4CiAgICAgICAgaG9zdCA6IFsnY25iZXRhLmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWFrLnV3LCAnSkInLCB7CiAgICAgICAgICAgIGVudW1lcmFibGUgOiB0cnVlLAogICAgICAgICAgICB2YWx1ZSA6IGZ1bmN0aW9uICgpIHt9CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHRoZW1hcmtlcl9oYWFyZXR6IDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xMjkyCiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL20wOGRrRFQ0CiAgICAgICAgaG9zdCA6IFsndGhlbWFya2VyLmNvbScsICdoYWFyZXR6LmNvLmlsJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYWsudXcsICdBZEJsb2NrVXRpbCcsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHZhbHVlIDoge30KICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgcGlwb2Nhc190diA6IHsKICAgICAgICAvLyBpc3N1ZToKICAgICAgICBob3N0IDogWydwaXBvY2FzLnR2J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIEFsc28gYWRkZWQgaW4gZGlzYWJsZUFsZXJ0Ym94CiAgICAgICAgICAvLyBObyBwb3B1cAogICAgICAgICAgQWFrLnNldENvb2tpZSgncG9wdXBfdXNlcl9sb2dpbicsICd5ZXMnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIF8xNW1pbl9sdCA6IHsKICAgICAgICAvLyBub3RlOiByZWd1bGFyeSB1cGRhdGUgc2NyaXB0CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9MTVtaW4uaXQKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vWVdmM0hUcXIKICAgICAgICAvLyB0ZXN0OiBodHRwOi8vdGlueXVybC5jb20vaDZjNDMzNgogICAgICAgIGhvc3QgOiBbJzE1bWluLmx0J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShBYWsudXcsICdST1VURScsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgIHZhbHVlIDogJ19iZV9yZWtsYW1vcycKICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgc2MyY2FzdHNfY29tIDogewogICAgICAgIC8vIGJ5OiBHaXdheXVtZQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xNTk5CiAgICAgICAgaG9zdCA6IFsnc2MyY2FzdHMuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uKCkgewogICAgICAgICAgQWFrLmFkZFNjcmlwdChmdW5jdGlvbigpIHsKICAgICAgICAgICAgd2luZG93Ll9nYXEgPSB7IHB1c2g6ZnVuY3Rpb24oKSB7fSB9OwogICAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkod2luZG93LCAic2hvd2RpYWxvZyIsIHsKICAgICAgICAgICAgICB2YWx1ZTogZnVuY3Rpb24oKSB7fSwKICAgICAgICAgICAgICBjb25maWd1cmFibGU6IGZhbHNlLAogICAgICAgICAgICAgIHdyaXRhYmxlOiBmYWxzZQogICAgICAgICAgICB9KTsKICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KHdpbmRvdywgInNob3dQb3B1cDIiLCB7CiAgICAgICAgICAgICAgdmFsdWU6IGZ1bmN0aW9uKCkge30sCiAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZSwKICAgICAgICAgICAgICB3cml0YWJsZTogZmFsc2UKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHZndW5ldHdvcmtfY29tIDogewogICAgICAgIC8vIGlzc3VlOgogICAgICAgIGhvc3QgOiBbJ3ZndW5ldHdvcmsuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldENvb2tpZSgnc3RvcEl0JywgMSk7CiAgICAgICAgICB2YXIgY2xvc2UgPSBBYWsuZ2V0RWxlbWVudCgnI3NvbWVfYWRfYmxvY2tfa2V5X2Nsb3NlJyk7CiAgICAgICAgICBpZiAoY2xvc2UpIHsKICAgICAgICAgICAgY2xvc2UuY2xpY2soKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIGxpbmtjcnlwdF93cyA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMjg2CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvcHVsbC82NwogICAgICAgIGhvc3QgOiBbJ2xpbmtjcnlwdC53cyddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRFbGVtZW50KCcjYWRfY29udCcsIHsKICAgICAgICAgICAgaWQgOiAnJywKICAgICAgICAgICAgc3R5bGUgOiAnZGlzcGxheTpibG9jazsnCiAgICAgICAgICB9KTsKICAgICAgICAgIEFhay5zZXRFbGVtZW50KCcjY29udGFpbmVyX2NoZWNrJywgewogICAgICAgICAgICBzdHlsZSA6ICdkaXNwbGF5Om5vbmU7JwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBldmVudG9zcHB2X21lIDogewogICAgICAgIC8vIGlzc3VlOiAKICAgICAgICBob3N0IDogWydldmVudG9zcHB2Lm1lJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNuZjM3Jyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBib2xvcl90b2xpX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNTUyCiAgICAgICAgaG9zdCA6IFsnYm9sb3ItdG9saS5jb20nXSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBhZHMgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCdiYW5uZXInKTsKICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYWRzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHZhciBhZCA9IGFkc1tpXTsKICAgICAgICAgICAgYWQuaW5uZXJIVE1MID0gJzxicj4nOwogICAgICAgICAgICBhZC5zdHlsZS5oZWlnaHQgPSAnMXB4JzsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIHZpdm9fc3ggOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzI4MAogICAgICAgIGhvc3QgOiBbJ3Zpdm8uc3gnXSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBhbGVydCA9IEFhay5nZXRFbGVtZW50KCcjYWxlcnQtdGhyb3R0bGUnKTsKICAgICAgICAgIGlmIChhbGVydCkgewogICAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudChhbGVydCk7CiAgICAgICAgICB9CiAgICAgICAgICB2YXIgYnV0dG9uID0gQWFrLmdldEVsZW1lbnQoJ2J1dHRvbiNhY2Nlc3MnKTsKICAgICAgICAgIGlmIChidXR0b24pIHsKICAgICAgICAgICAgYnV0dG9uLnJlbW92ZUF0dHJpYnV0ZSgnaWQnKTsKICAgICAgICAgICAgYnV0dG9uLnJlbW92ZUF0dHJpYnV0ZSgnZGlzYWJsZWQnKTsKICAgICAgICAgICAgYnV0dG9uLmlubmVySFRNTCA9ICdDb250aW51ZSB0byB2aWRlbyc7CiAgICAgICAgICB9CiAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIGlucHV0ID0gQWFrLmdldEVsZW1lbnQoJ2lucHV0W25hbWU9InRocm90dGxlIl0nKTsKICAgICAgICAgICAgaWYgKGlucHV0KSB7CiAgICAgICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoaW5wdXQpOwogICAgICAgICAgICB9CiAgICAgICAgICB9LCAxMDAwKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGx1eHlhZF9jb20gOiB7IC8vIHNraXAgcmVkaXJlY3QgbXlhbmltZXMubGkKICAgICAgICAvLyBpc3N1ZToKICAgICAgICBob3N0IDogWydsdXh5YWQuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgaWYgKCcvSW5mb3JtYXRpb24ucGhwJyA9PSBsb2NhdGlvbi5wYXRobmFtZSkgewogICAgICAgICAgICB2YXIgaHJlZiA9IGxvY2F0aW9uLmhyZWY7CiAgICAgICAgICAgIGxvY2F0aW9uLmhyZWYgPSBocmVmLnN1YnN0cihocmVmLmluZGV4T2YoJ3VybD0nKSArIDQsIGhyZWYubGVuZ3RoKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIG1ycGlyYWN5X2RvbWFpbnMgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzE0MDUKICAgICAgICBob3N0IDogWydtcnBpcmFjeS54eXonLCAnbXJwaXJhY3kuY2x1YiddLAogICAgICAgIG9uQmVmb3JlU2NyaXB0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgICAgY29udGFpbnMgOiAnRGVzYXRpdmEgbyBBZEJsb2NrIHBhcmEgY29udGludWFyJywKICAgICAgICAgICAgICBleHRlcm5hbCA6IGZhbHNlLAogICAgICAgICAgICAgIHJlbW92ZSA6IHRydWUKICAgICAgICAgICAgfQogICAgICAgICAgXTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGRicGxhbmV0X25ldCA6IHsKICAgICAgICAvLyBpc3N1ZTogUE0KICAgICAgICBob3N0IDogWydkYnBsYW5ldC5uZXQnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldENvb2tpZSgnbmV3bm9Nb3JlQWRzTm93JywgMSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBhaWRlbXVfZnIgOiB7CiAgICAgICAgLy8gaXNzdWU6CiAgICAgICAgaG9zdCA6IFsnYWlkZW11LmZyJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRDb29raWUoJ2FkYmxvY2tQb3B1cCcsIHRydWUpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZWFtaV9pbiA6IHsKICAgICAgICAvLyBpc3N1ZToKICAgICAgICBob3N0IDogWydlYW1pLmluJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCdhZF9sb2NrZWQnLCAxKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGJpZ2Rvd25sb2FkZXJfY29tIDogewogICAgICAgIC8vIGlzc3VlOgogICAgICAgIGhvc3QgOiBbJ2JpZ2Rvd25sb2FkZXIuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNhbnRpX2FkYmxvY2snKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGZyZWVza2llcl9jb20gOiB7CiAgICAgICAgLy8gYnk6IEdvcmhpbGwKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNjM5CiAgICAgICAgLy8gbm90ZTogYWxzbyBhZGRlZCBsaXN0IHJ1bGUKICAgICAgICBob3N0IDogWydmcmVlc2tpZXIuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgdmFyIGVsID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImFkYi1ub3QtZW5hYmxlZCIpOwogICAgICAgICAgaWYgKGVsICE9PSBudWxsKSB7CiAgICAgICAgICAgIGVsLnN0eWxlLnJlbW92ZVByb3BlcnR5KCJkaXNwbGF5Iik7CiAgICAgICAgICB9CiAgICAgICAgICBlbCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJ2aWRlb0NvbnRhaW5lciIpOwogICAgICAgICAgaWYgKGVsICE9PSBudWxsKSB7CiAgICAgICAgICAgIGVsLnN0eWxlLnJlbW92ZVByb3BlcnR5KCJkaXNwbGF5Iik7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICBnYW1ldHJhaWxlcnNfY29tIDogewogICAgICAgIC8vIGlzc3VlOgogICAgICAgIGhvc3QgOiBbJ2dhbWV0cmFpbGVycy5jb20nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudCgnI2FkX2Jsb2NraW5nJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBzY2FuX29uZXBpZWNlX25hcnV0b19teCA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNTgyCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzI3OQogICAgICAgIGhvc3QgOiBbJ3NjYW4tbXguY29tJywgJ29uZXBpZWNlLW14Lm5ldCcsICduYXJ1dG8tbXgubmV0J10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuYWRfYmxvY2tfdGVzdCA9IGZ1bmN0aW9uICgpIHt9OwogICAgICAgIH0sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldEVsZW1lbnQoJyN5b3AnLCB7CiAgICAgICAgICAgIGlkIDogJycKICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgLy8gQml0Y29pbnMKICAgICAgYml0Y29pbmtlcl9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzIzMAogICAgICAgIGhvc3QgOiBbJ2JpdGNvaW5rZXIuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5jbGFpbSA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgICB9OwogICAgICAgIH0sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNFMzNGQ0NjWDJmVycpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbW9vbmRvZ2VfY29faW4gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzM4NAogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8yMzIKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMjMzCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzIzNgogICAgICAgIGhvc3QgOiBbJ21vb25kb2dlLmNvLmluJywgJ21vb25saXRlY28uaW4nLCAnbW9vbmJpdC5jby5pbicsICdiaXRjb2luemVicmEuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNBQiwgI0U0NDJEdiwgI2VDQzVoJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBiaXRjb2luZXJfbmV0IDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8zNDkKICAgICAgICBob3N0IDogWydiaXRjb2luZXIubmV0JywgJ2xpdGVjb2luZXIubmV0J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRCYWl0RWxlbWVudCgnZGl2I3Rlc3RlcicpOwogICAgICAgICAgQWFrLmFkZEJhaXRFbGVtZW50KCdkaXYjYWQtdG9wJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBiaXRjb2luc19ueF90YyA6IHsKICAgICAgICAvLyBpc3N1ZToKICAgICAgICBob3N0IDogWydmcmVlYml0Y29pbnMubngudGMnLCAnZ2V0Yml0Y29pbnMubngudGMnXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5hZF9ibG9ja190ZXN0ID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgZnJlZWNvaW5zNF9tZSA6IHsKICAgICAgICAvLyBpc3N1ZToKICAgICAgICBob3N0IDogWydmcmVlY29pbnM0Lm1lJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuY2hlY2sgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgIH07CiAgICAgICAgfQogICAgICB9LAogICAgICB0b3JyZW50X3R2X3J1IDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy81MzcKICAgICAgICBob3N0IDogWyd0b3JyZW50LXR2LnJ1J10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuY19Pb19BZHZlcnRfU2hvd24gPSB0cnVlOwogICAgICAgIH0KICAgICAgfSwKICAgICAgY3d0dl9jb20gOiB7CiAgICAgICAgLy8gYnk6IEthbGJhc2l0CiAgICAgICAgLy8gcHVsbDogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9wdWxsLzc2MwogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8zNDAKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNzYyCiAgICAgICAgaG9zdCA6IFsnY3d0di5jb20nXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5DV1RWSXNBZEJsb2NraW5nID0gdW5kZWZpbmVkOwogICAgICAgIH0KICAgICAgfSwKICAgICAgYmlsZF9kZSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1iaWxkCiAgICAgICAgaG9zdCA6IFsnYmlsZC5kZSddLAogICAgICAgIG9uQmVmb3JlU2NyaXB0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgICAgY29udGFpbnMgOiAnaHR0cDovL3d3dy5iaWxkLmRlL3dhL2xsL2JpbGQtZGUvdW5hbmdlbWVsZGV0LTQyOTI1NTE2LmJpbGQuaHRtbCcsCiAgICAgICAgICAgICAgZXh0ZXJuYWwgOiBmYWxzZSwKICAgICAgICAgICAgICByZXBsYWNlIDogWydqYXZhc2NyaXB0JywgJ3ZvaWQoMCk7J10uam9pbignOicpCiAgICAgICAgICAgIH0KICAgICAgICAgIF07CiAgICAgICAgfQogICAgICB9LAogICAgICBpbm5fY29faWwgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzUzMgogICAgICAgIGhvc3QgOiBbJ2lubi5jby5pbCddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuYWRkU2NyaXB0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgdmFyIFRSQyA9IHt9OwogICAgICAgICAgICBUUkMuYmxvY2tlciA9IHsKICAgICAgICAgICAgICBzdGF0ZXMgOiB7CiAgICAgICAgICAgICAgICBBQlBfREVURUNUSU9OX0RJU0FCTEVEIDogLTIsCiAgICAgICAgICAgICAgICBBQlBfTk9UX0RFVEVDVEVEIDogMCwKICAgICAgICAgICAgICAgIEFCUF9ERVRFQ1RFRCA6IDEKICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgIGNyZWF0ZUJsb2NrRGV0ZWN0aW9uRGl2IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgcmV0dXJuIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImRpdiIpOwogICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgaXNCbG9ja0RldGVjdGVkT25EaXYgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgIGlzQmxvY2tEZXRlY3RlZE9uQ2xhc3NOYW1lcyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgZ2V0QmxvY2tlZFN0YXRlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBiaGFza2FyX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1iaGFza2FyCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9ZGl2eWFiaGFza2FyLmNvLmluCiAgICAgICAgaG9zdCA6IFsnYmhhc2thci5jb20nLCAnZGl2eWFiaGFza2FyLmNvLmluJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcub3BlblBvcFVwRm9yQnJlYWtQYWdlID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgICBBYWsudXcuY2FuQUJQID0gdHJ1ZTsKICAgICAgICAgIEFhay51dy5jYW5SdW5BZHMgPSB0cnVlOwogICAgICAgICAgQWFrLnV3LmNhbkNoZWNrQWRzID0gdHJ1ZTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHR1cmthbmltZV90diA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNDQ2CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEzOQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dyZWFzeWZvcmsub3JnL3RyL2ZvcnVtL2Rpc2N1c3Npb24vNDI4Mi8KICAgICAgICBob3N0IDogWyd0dXJrYW5pbWUudHYnXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy5hZGJsb2NrYmxvY2sgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICAgIEFhay51dy5CbG9rS29udHJvbCA9IHt9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgd3RmYml0X2NoIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy80MDcKICAgICAgICBob3N0IDogWyd3dGZiaXQuY2gnXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy53cml0ZUhUTUxhc0pTID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgfQogICAgICB9LAogICAgICBhcmFuenVsbGFfaXQgOiB7CiAgICAgICAgLy8gYnk6IFJvYm90ZXgKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1hcmFuenVsbGEuaXQKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20veU1NNllneFcKICAgICAgICBob3N0IDogWydhcmFuenVsbGEuaXQnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24oKSB7CiAgICAgICAgICBBYWsuYWRkU3R5bGUoJyNhYnQxICsgU1RZTEUgKyBkaXZbaWRdW2NsYXNzXSB7ZGlzcGxheTpub25lO30nKTsKICAgICAgICB9LAogICAgICAgIG9uQmVmb3JlU2NyaXB0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgICAgY29udGFpbnMgOiAnbmF2aWdhdG9yLnVzZXJBZ2VudHx8bmF2aWdhdG9yLnZlbmRvcnx8d2luZG93Lm9wZXJhJywKICAgICAgICAgICAgICBleHRlcm5hbCA6IGZhbHNlLAogICAgICAgICAgICAgIHJlbW92ZSA6IHRydWUKICAgICAgICAgICAgfQogICAgICAgICAgXTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIG5kdHZfY29tIDogewogICAgICAgIC8vIG5vdGU6IGNhblJ1bkFkcyBpbnZlcnRlZCB2YWx1ZQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPW5kdHYuY29tCiAgICAgICAgLy8gdGVzdDogaHR0cDovL3Rpbnl1cmwuY29tL2hjZm5jZHYKICAgICAgICBob3N0IDogWyduZHR2LmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0UmVhZE9ubHkoJ19fX3BfX3AnLCAxKTsKICAgICAgICAgIEFhay5zZXRSZWFkT25seSgnZ2V0Tm9Ub3BMYXRlc3ROZXdzJywgZnVuY3Rpb24gKCkge30pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbGVzZWNob3NfZnIgOiB7CiAgICAgICAgLy8gUmVlaywgR2l3YXl1bWUKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1sZXNlY2hvcy5mcgogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS9DTU04V0dMagogICAgICAgIGhvc3QgOiBbJ2xlc2VjaG9zLmZyJywgJ2xlc2VjaG9zLmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbigpIHsKICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh3aW5kb3csICJjaGVja0FkQmxvY2siLCB7CiAgICAgICAgICAgICAgdmFsdWU6IGZ1bmN0aW9uKCkge30sCiAgICAgICAgICAgICAgY29uZmlndXJhYmxlOiBmYWxzZSwKICAgICAgICAgICAgICB3cml0YWJsZTogZmFsc2UKICAgICAgICAgICAgfSk7CiAgICAgICAgICB9KTsKICAgICAgICB9LAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3LmNhbGxfQWQgPSAxOwogICAgICAgICAgQWFrLnV3LnBheXdhbGxfYWRibG9ja19hcnRpY2xlID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgfQogICAgICB9LAogICAgICBiaXR2aXNpdHNfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8yNjYKICAgICAgICBob3N0IDogWydiaXR2aXNpdHMuY29tJ10sCiAgICAgICAgb25BbHdheXMgOiBm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GVydC5hbGVydC1kYW5nZXIubGVhZCB7b3BhY2l0eTowO30nKTsKICAgICAgICAgIAogICAgICAgICAgLy8gcHJldmVudCByZWRpcmVjdCB0byB2ZXJpZnkgcGFnZQogICAgICAgICAgQWFrLnNldFJlYWRPbmx5KCdiZHZibnJfcGlkJywgW10pOwogICAgICAgICAgQWFrLnNldFJlYWRPbmx5KCdQb3BBZHMnLCAxKTsKCiAgICAgICAgICBBYWsuYWRkU2NyaXB0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAvLyBwcmV2ZW50IHBvcHVwCiAgICAgICAgICAgICAgd2luZG93Lm9wZW4gPSBmdW5jdGlvbiAoKSB7fTsKCiAgICAgICAgICAgICAgLy8gcHJldmVudCByZWRpcmVjdCB0byB2ZXJpZnkgcGFnZQogICAgICAgICAgICAgIHZhciBmcmFtZTEgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpZnJhbWUnKTsKICAgICAgICAgICAgICBmcmFtZTEuc3JjID0gJ2h0dHA6Ly9iZGZybS5iaWR2ZXJ0aXNlci5jb20vQmlkVmVydGlzZXIuZGJtP3BpZD0zODM4NjUmYmlkPTE3Mzc0MTgmUkQ9JzsKICAgICAgICAgICAgICBmcmFtZTEuaWQgPSAnYmR2aSc7CiAgICAgICAgICAgICAgZnJhbWUxLnN0eWxlID0gJ2Rpc3BsYXk6bm9uZSc7CiAgICAgICAgICAgICAgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50LmFwcGVuZENoaWxkKGZyYW1lMSk7CiAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHZpcGxlYWd1ZV9kb21haW5zIDogewogICAgICAgIC8vIG5vdGU6IGFsc28ga2lsbGVkIGJ5IEFha0xpc3QKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2Nr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gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9em9vbXR2Lm1lCiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL200ekFYR2N3CiAgICAgICAgaG9zdCA6IFsnem9vbXR2Lm1lJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuaWF4cEVuYWJsZWQgPSB0cnVlOwogICAgICAgIH0KICAgICAgfSwKICAgICAgdmdfbm8gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzI5MgogICAgICAgIC8vICthYnAgcnVsZQogICAgICAgIGhvc3QgOiBbJ3ZnLm5vJywgJ2UyNC5ubyddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3Ll9fQUJfXyA9IGZ1bmN0aW9uICgpIHt9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgcG9ybnZlX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvOTQ3CiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tLzdUUFBrcTEyCiAgICAgICAgaG9zdCA6IFsncG9ybnZlLmNvbSddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3LmFkeGp3dXBkYXRlID0gMTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGxvbF9tb2FfdHcgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzExMTQKICAgICAgICBob3N0IDogWydsb2wubW9hLnR3J10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmFkZFNjcmlwdChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIHZhciBNb2FPYmogPSBNb2FPYmogfHwge307CiAgICAgICAgICAgIE1vYU9iai5hZCA9IE1vYU9iai5hZCB8fCB7fTsJCQkKICAgICAgICAgICAgTW9hT2JqLmFkLmhhc0FkYmxvY2sgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9OwogICAgICAgICAgICBNb2FPYmouYWQuY2hlY2tBQlAgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9OwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBtdWx0aXVwX29yZyA6IHsKICAgICAgICAvLyBieTogV2F0aWxpbgogICAgICAgIC8vIG5vdGU6IGFsdGVybmF0aXZlIHNvbHV0aW9uCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9bXVsdGl1cC5vcmcKICAgICAgICBob3N0IDogWydtdWx0aXVwLm9yZyddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCd2aXNpdCcsIDEpOyAvLyBwcmV2ZW50IHBvcHVwCiAgICAgICAgICBBYWsuc2V0UmVhZE9ubHkoJ2hpJywgZnVuY3Rpb24gKCkge30pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZGFpbHliaXRjb2luc19vcmcgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEwNwogICAgICAgIGhvc3QgOiBbJ2RhaWx5Yml0Y29pbnMub3JnJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJy5hZC1pbWcnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGtvemFjemVrX3plYmVya2EgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzQxNAogICAgICAgIGhvc3QgOiBbJ2tvemFjemVrLnBsJywgJ3plYmVya2EucGwnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldENvb2tpZSgnYWJsYycsIDEpOwogICAgICAgICAgQWFrLnNldENvb2tpZSgnY29va2llX3BvbGljeScsIDEpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgc3Bhbmt3aXJlX3NpdGVzIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy84ODcKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vVEZCMWR0Z2IKICAgICAgICBob3N0IDogWydzcGFua3dpcmUuY29tJywgJ2tlZXptb3ZpZXMuY29tJywgJ2V4dHJlbWV0dWJlLmNvbScsICdtb2Zvc2V4LmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCJhYkNsb3NlZCIsICJ0cnVlIik7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCJoaWRlX2FkX21zZyIsICIxIik7CiAgICAgICAgfQogICAgICB9LAogICAgICB5b3Vwb3JuX25ldHdvcmsgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzg4NwogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS9URkIxZHRnYgogICAgICAgIGhvc3QgOiBbJ3lvdXBvcm4uY29tJywgJ3lvdXBvcm5nYXkuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5zZXRDb29raWUoImFkYmxvY2tfbWVzc2FnZSIsICJjbG9zZWQiKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGNpdGF0aW9ubWFjaGluZV9uZXQgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9Y2l0YXRpb25tYWNoaW5lLm5ldAogICAgICAgIGhvc3QgOiBbJ2NpdGF0aW9ubWFjaGluZS5uZXQnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnNldENvb2tpZSgic2JtX2NtX2NpdGF0aW9ucyIsIDApOwogICAgICAgIH0KICAgICAgfSwgICAgICAKICAgICAgcHNhcmlwc19jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzE1MwogICAgICAgIGhvc3QgOiBbJ3BzYXJpcHMuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRCYWl0RWxlbWVudCgnZGl2I2FkdmVydCcpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZXh0cmF0b3JyZW50X2RvbWFpbnMgOiB7CiAgICAgICAgaG9zdCA6IFsnZXh0cmF0b3JyZW50LmNjJywgJ2V4dHJhdG9ycmVudC5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gcHJldmVudCBwb3B1cAogICAgICAgICAgLy8gc291cmNlIGFyZSBvYmZ1c2NhdGVkIGluIGV4dGVybmFsIGpzCiAgICAgICAgICBBYWsuc2V0Q29va2llKCdwcHVfZGVsYXknLCAxKTsKICAgICAgICAgIEFhay5zZXRDb29raWUoJ3BwdV9tYWluJywgMSk7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCdwcHVfc3ViJywgMSk7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCdwcHVfc2hvd19vbicsIDEpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgdG55X2N6IDogewogICAgICAgIGhvc3QgOiBbJ3RueS5jeicsICdwYXN0ZWQuY28nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gcHJldmVudCBwb3B1cAogICAgICAgICAgQWFrLnNldENvb2tpZSgnX18ucG9wdW5kZXJDYXAnLCAxKTsKICAgICAgICAgIEFhay5zZXRDb29raWUoJ19fLnBvcHVuZGVyJywgMSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBjbHViZWRvaGFyZHdhcmVfY29tX2JyIDogeyAvLyB0d28gYW50aWFkYmxvY2sKICAgICAgICBob3N0IDogWydjbHViZWRvaGFyZHdhcmUuY29tLmJyJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIGlmIChBYWsuY29udGFpbnMobG9jYXRpb24uaG9zdCwgJ2ZvcnVtJykpIHsKICAgICAgICAgICAgLy8gU29sdXRpb24gMQogICAgICAgICAgICBBYWsuYWRkU3R5bGUoIiNiYW5uZXIsIHNjcmlwdCB7IGhlaWdodDogNTFweDsgfSIpOwogICAgICAgICAgICBBYWsuYWRkQmFpdEVsZW1lbnQoJ2RpdiNiYW5uZXInKTsKICAgICAgICAgIH0gZWxzZSB7IC8vIFdlYnNpdGUKICAgICAgICAgICAgLy8gU29sdXRpb24gMQogICAgICAgICAgICBBYWsuYWRkQmFpdEVsZW1lbnQoJ2Rpdi5iYW5uZXJfdG9wbycpOwogICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgaWYgKEFhay5jb250YWlucyhsb2NhdGlvbi5ob3N0LCAnZm9ydW0nKSkgewogICAgICAgICAgICAvLyBTb2x1dGlvbiAyCiAgICAgICAgICAgIEFhay51dy5hZGRCbG9ja2luZy5oaWRlKCk7CiAgICAgICAgICAgIEFhay51dy5hZGRCbG9ja2luZy5raWxsKCk7CiAgICAgICAgICB9IGVsc2UgeyAvLyBXZWJzaXRlCiAgICAgICAgICAgIC8vIFNvbHV0aW9uIDIKICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5pZCA9ICcnOwogICAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudCgnLmFkYmxvY2snKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIGRlYnJhc3RhZ2lfY29tIDogewogICAgICAgIGhvc3QgOiBbJ2RlYnJhc3RhZ2kuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNzdHAtbWFpbicpOwogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNzdHAtYmcnKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGRkbGZyZW5jaF9vcmcgOiB7CiAgICAgICAgaG9zdCA6IFsnZGRsZnJlbmNoLm9yZyddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIEZpeCBidWcgZGlzcGxheSBjb250ZW50CiAgICAgICAgICBBYWsuc2V0RWxlbWVudCgnI2RsZS1jb250ZW50IC5kLWNvbnRlbnQnLCB7CiAgICAgICAgICAgICdjbGFzcycgOiAnJwogICAgICAgICAgfSk7CiAgICAgICAgICBBYWsuc2V0RWxlbWVudCgnI2NvbnRlbnQnLCB7CiAgICAgICAgICAgICdpZCcgOiAnJwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBtZWdhZGVicmlkX2V1IDogewogICAgICAgIGhvc3QgOiBbJ21lZ2EtZGVicmlkLmV1J10sCiAgICAgICAgb25FbmQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyBBY3RpdmF0ZSBidXR0b24gZGVicmlkCiAgICAgICAgICBBYWsuc2V0RWxlbWVudCgnLnJlYWxidXR0b24nLCB7CiAgICAgICAgICAgICdvbmNsaWNrJyA6ICcnLAogICAgICAgICAgICAndHlwZScgOiAnc3VibWl0JwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBzbGlkZXBsYXllcl9kb21haW5zIDogewogICAgICAgIC8vIGJ5OiBBbGV4YW5kZXIyNTUKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMTMzMwogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy81MTUKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMjk2CiAgICAgICAgLy8gZGVtbzogaHR0cDovL3NsaWRlcGxheWVyLmZyL3NsaWRlLzEzMDQwMjYvIwogICAgICAgIGhvc3QgOiBbJ3NsaWRlcGxheWVyLionXSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAvLyBEaXNhYmxlIGFudGktYWRibG9ja2VyCiAgICAgICAgICBBYWsudXcuZm9yY2VfcmVtb3ZlX2FkcyA9IHRydWU7CgogICAgICAgICAgLy8gQ2lyY3VtdmVudCAic2hhcmUgdG8gZG93bmxvYWQiIHJ1bGUKICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgc2x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ZiBpbnN0ZWFkICovCiAgICAgICAgICAgICAgbGlua3NbaV0uaHJlZiA9IHVybDsKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CgogICAgICAgIH0KICAgICAgfSwKICAgICAgYm9rZXBzcG90X2NvbSA6IHsKICAgICAgICBob3N0IDogWydib2tlcHNwb3QuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIEhpZGUgRGlzY2xhaW1lcgogICAgICAgICAgQWFrLnNldENvb2tpZSgnaGlkZURpYWxvZycsICdoaWRlJyk7CiAgICAgICAgfSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyBSZW1vdmUgRGlzYWJsZSBBZEJsb2NrCiAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudCgnI3R1cGlrbGFuJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBwaWNsb2FkX2NvbSA6IHsKICAgICAgICBob3N0IDogWydwaWNsb2FkLm9yZyddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCdwbF9hZGJsb2NrZXInLCBmYWxzZSk7CiAgICAgICAgfSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuYWRzX2xvYWRlZCA9IHRydWU7CiAgICAgICAgICBBYWsudXcuaW1hZ2VBZHMgPSBmYWxzZTsKICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KCdkaXZbb25jb250ZXh0bWVudT0icmV0dXJuIGZhbHNlOyJdJyk7CiAgICAgICAgfQogICAgICB9LAogICAgICBmcmVlemVkb3dubG9hZF9jb20gOiB7CiAgICAgICAgaG9zdCA6IFsnZnJlZXplZG93bmxvYWQuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgaWYgKC9mcmVlemVkb3dubG9hZC5jb21cL2Rvd25sb2FkXC8vLnRlc3QobG9jYXRpb24uaHJlZikpIHsKICAgICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJ2JvZHkgPiBkaXZbaWRdJyk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICBtb25uc3V0b2dhdHlhX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogUE0KICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vMUx3NjBoNmsKICAgICAgICBob3N0IDogWydtb25uc3V0b2dhdHlhLmNvbSddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTdHlsZSgiI3NpdGUtYm94IHtkaXNwbGF5OmJsb2NrO30iKTsKICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KCcjZm9yLWFkLWJsb2NrZXInKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHJhcGlkOF9jb20gOiB7CiAgICAgICAgaG9zdCA6IFsncmFwaWQ4LmNvbSddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KCdkaXYuYmFja2sgKyAjYmxjb2tNemcnKTsKICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KCdkaXYuYmFja2snKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHR1cmtkb3duX2NvbSA6IHsKICAgICAgICBob3N0IDogWyd0dXJrZG93bi5jb20nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyByZW1vdmUgZmFjZWJvb2sgYm94CiAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudCgnI2R1eXVydScpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZmlsbW92aXppamFfZG9tYWlucyA6IHsKICAgICAgICBob3N0IDogWydmaWxtb3ZpemlqYS5tZScsICdmaWxtb3ZpemlqYS5jb20nLCAnZmlsbW92aXppamEuaW4nLCAnZmlsbW92aXppamEubmV0J10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLyoKICAgICAgICAgIHZhciBkID0gbmV3IERhdGUoKTsKICAgICAgICAgIHZhciB3ZWVrZGF5ID0gWyJTdW5kYXkiLCAiTW9uZGF5IiwgIlR1ZXNkYXkiLCAiV2VkbmVzZGF5IiwgIlRodXJzZGF5IiwgIkZyaWRheSIsICJTYXR1cmRheSJdOwogICAgICAgICAgdmFyIG4gPSB3ZWVrZGF5W2QuZ2V0RGF5KCldOwogICAgICAgICAgQWFrLnNldEVsZW1lbnQoJyMnICsgbiwgewogICAgICAgICAgaHRtbCA6ICcnCiAgICAgICAgICB9KTsKICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KCcjJyArIG4pOwogICAgICAgICAgICovCiAgICAgICAgfQogICAgICB9LAogICAgICBoYWNraW50b3NoX3pvbmUgOiB7CiAgICAgICAgLy8gYnk6IEFsZXhhbmRlcjI1NQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPWhhY2tpbnRvc2guem9uZQogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlMi5vcmcvRG5COU9qNGYKICAgICAgICBob3N0IDogWydoYWNraW50b3NoLnpvbmUnXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgdmFyIGhlYWQgPSBkb2N1bWVudC5nZXRFbGVtZW50c0J5VGFnTmFtZSgiaGVhZCIpWzBdOwogICAgICAgICAgLy8gRmFrZSBHb29nbGUgYWQgZnJhbWUgY29udGVudAogICAgICAgICAgdmFyIGFkMSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoImlucyIpOwogICAgICAgICAgYWQxLmNsYXNzTmFtZSA9ICJhZHNieWdvb2dsZSI7CiAgICAgICAgICBhZDEuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUoIkFBSyIpKTsKICAgICAgICAgIGhlYWQuaW5zZXJ0QmVmb3JlKGFkMSwgaGVhZC5jaGlsZE5vZGVzWzBdKTsKCiAgICAgICAgICAvKgogICAgICAgICAgLy8gRmFrZSBDbGVhbk15TWFjIGFkIGZyYW1lIHNpemUKICAgICAgICAgIHZhciBhZDIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCJkaXYiKTsKICAgICAgICAgIGFkMi5pZCAgPSAibnljdWhldmdxaSI7CiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoYWQyLndyYXBwZWRKU09iamVjdCwgJ2NsaWVudEhlaWdodCcsIHt2YWx1ZTogMX0pOwogICAgICAgICAgaGVhZC5pbnNlcnRCZWZvcmUoYWQyLCBoZWFkLmNoaWxkTm9kZXNbMF0pOwogICAgICAgICAgICovCgogICAgICAgICAgdmFyIGVsZW1zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLmFkc2Vuc2VncmV5Jyk7CiAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGVsZW1zLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHZhciBub2RlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiaW1nIik7CiAgICAgICAgICAgIG5vZGUuc3JjID0gQWFrLmltZ0JhaXQ7CiAgICAgICAgICAgIGVsZW1zW2ldLmFwcGVuZENoaWxkKG5vZGUpOwogICAgICAgICAgfQoKICAgICAgICB9LAogICAgICAgIG9uQmVmb3JlU2NyaXB0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgcmV0dXJuIFt7CiAgICAgICAgICAgICAgY29udGFpbnMgOiAnZGlzYWJsZSBBREJsb2NrIGNvbXBsZXRlbHknLAogICAgICAgICAgICAgIGV4dGVybmFsIDogZmFsc2UsCiAgICAgICAgICAgICAgcmVtb3ZlIDogdHJ1ZQogICAgICAgICAgICB9CiAgICAgICAgICBdOwogICAgICAgIH0KICAgICAgfSwKICAgICAgcHJpdmF0ZWluc3RhX2NvbSA6IHsKICAgICAgICBob3N0IDogWydwcml2YXRlaW5zdGEuY29tJ10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gKyBhYnAgcnVsZQogICAgICAgICAgQWFrLnV3LmRvbnRfc2Nyb2xsID0gZmFsc2U7CiAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudCgiI292ZXJsYXlfZGl2Iik7CiAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudCgiI292ZXJsYXlfbWFpbl9kaXYiKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIHJpc2lrb2dlc3VuZGhlaXRfZGUgOiB7CiAgICAgICAgaG9zdCA6IFsncmlzaWtvLWdlc3VuZGhlaXQuZGUnXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgd2luZG93LnN0b3AoKTsKICAgICAgICAgIH0sIDUwMDApOwogICAgICAgIH0KICAgICAgfSwKICAgICAgb25lcGxheWxpc3RfZXVfcG4gOiB7CiAgICAgICAgaG9zdCA6IFsnb25lcGxheWxpc3QuZXUucG4nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyBraWxsIHBvcHVuZGVyCiAgICAgICAgICBBYWsudXcubWFrZVBvcHVuZGVyID0gZmFsc2U7CiAgICAgICAgfQogICAgICB9LAogICAgICBvbm1lZGFfZGUgOiB7CiAgICAgICAgLy8gbm90ZTogc2NyaXB0IG9iZnVzY2F0ZWQgbGluZSAxMTEwCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ3JlYXN5Zm9yay5vcmcvZm9ydW0vZGlzY3Vzc2lvbi84NTc2CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8v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GFwcGVuZCA6ICdib2R5JwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICByb2NrZmlsZV9ldSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMTI1NgogICAgICAgIGhvc3QgOiBbJ3JvY2tmaWxlLmV1J10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmNyZWF0ZUVsZW1lbnQoewogICAgICAgICAgICB0YWcgOiAnaWZyYW1lJywKICAgICAgICAgICAgc3JjIDogJ2Fib3V0OmJsYW5rJywKICAgICAgICAgICAgc3R5bGUgOiAndmlzaWJpbGl0eTpoaWRkZW47JywKICAgICAgICAgICAgYXBwZW5kIDogJ2JvZHknCiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGxpbmtidWNrc19hbnRpYWRibG9jayA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvOTMyCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzQ2OQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8yNzcKICAgICAgICAvLyB2MzogaHR0cDovL3Bhc3RlYmluLmNvbS8wZ2g4TE1HSAogICAgICAgIC8vIG5vdGU6IG5vIHNvbHV0aW9uLCBhbnRpLWFkYmxvY2sgZGlmZmljdWx0IHRvIGJ5cGFzcyAtLT4gaHR0cDovL3Bhc3RlYmluLmNvbS8xTlJxN1d2WgogICAgICAgIGhvc3QgOiBbJ2xpbmtidWNrcy5jb20nLCAnbWluaXVybHMuY28nLCAncGlj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b20nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyBIaWRlICJEaXNhYmxlIEFkQmxvZGsiIG1lc3NhZ2VzCiAgICAgICAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCdib2R5JykuY2xhc3NMaXN0LnJlbW92ZSgianNCbG9ja0RldGVjdCIpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgcHJvX2RvbWFpbnMgOiB7CiAgICAgICAgaG9zdCA6IFsncHJvLXppay53cycsICdwcm8tdGVjdC53cycsICdwcm8tZGRsLndzJywgJ3Byby1zcG9ydC53cyddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsuc2V0Q29va2llKCd2aXNpdGVkZicsIHRydWUpOwogICAgICAgICAgQWFrLnNldENvb2tpZSgndmlzaXRlZGgnLCB0cnVlKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGNvbXB0b2lyaGFyZHdhcmVfY29tIDogewogICAgICAgIGhvc3QgOiBbJ2NvbXB0b2lyLWhhcmR3YXJlLmNvbSddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3LmFkYmxvY2sgPSAnbm9uJzsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGJha2Vyc2ZpZWxkX2NvbSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNjU3CiAgICAgICAgLy8gbm90ZTogYWxzbyBzb2x1dGlvbiB0byBBYWtMaXN0CiAgICAgICAgaG9zdCA6IFsnYmFrZXJzZmllbGQuY29tJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuQURfU0xPVF9SRU5ERVJFRCA9IHRydWU7CiAgICAgICAgfQogICAgICB9LAogICAgICBla3N0c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Gh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzI0NQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8yMTUKICAgICAgICBob3N0IDogWydsYWNoYWluZW1ldGVvLmNvbSddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3LmpzX2xvYWRlZCA9IHRydWU7CiAgICAgICAgfQogICAgICB9LAogICAgICBtYWM0ZXZlcl9jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzk5NwogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS9SUW5DRVlLNgogICAgICAgIGhvc3QgOiBbJ21hYzRldmVyLmNvbSddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3LmNvcXVpbm91ID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgfQogICAgICB9LAogICAgICBfNTI3OGJic19jb20gOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9NTI3OGJicy5jb20KICAgICAgICBob3N0IDogWyc1Mjc4YmJzLmNvbSddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLnV3Lm15YWFicGZ1bjEyID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgfQogICAgICB9LAogICAgICB0aGVzaW1zcmVzb3VyY2VfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPXRoZXNpbXNyZXNvdXJjZS5jb20KICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vREU5cmJqeFkKICAgICAgICBob3N0IDogWyd0aGVzaW1zcmVzb3VyY2UuY29tJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuZ2Fkc2l6ZSA9IHRydWU7CiAgICAgICAgICBBYWsudXcuaUhhdmVMb2FkZWRBZHMgPSB0cnVlOwogICAgICAgIH0KICAgICAgfSwKICAgICAgeWVsbG93YnJpZGdlX2NvbSA6IHsKICAgICAgICBob3N0IDogWyd5ZWxsb3dicmlkZ2UuY29tJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuZmluYWxpemVQYWdlID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICByZXR1cm47CiAgICAgICAgICB9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgZ2FtZV9kZWJhdGVfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xMzY2CiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL1V6c2lYMEZLCiAgICAgICAgaG9zdCA6IFsnZ2FtZS1kZWJhdGUuY29tJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuYWRfYmxvY2tfdGVzdCA9IGZ1bmN0aW9uICgpIHt9OwogICAgICAgIH0KICAgICAgfSwKICAgICAgYWRzY2VuZG1lZGlhIDogewogICAgICAgIGhvc3QgOiBbJ2Fkc2NlbmRtZWRpYS5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gYWRzY2VuZG1lZGlhIC0gaHR0cHM6Ly93d3cuYWRzY2VuZG1lZGlhLmNvbS8KICAgICAgICAgIHZhciByZWYgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdhJykuaHJlZiA9IGRvY3VtZW50LnJlZmVycmVyOwogICAgICAgICAgdmFyIGhvc3QgPSBsb2NhdGlvbi5ob3N0OwogICAgICAgICAgdmFyIHBhdGggPSBsb2NhdGlvbi5wYXRobmFtZTsKICAgICAgICAgIGlmIChBYWsuY29udGFpbnMocGF0aCwgJy93aWRnZXRfYWRibG9jay5waHAnKSAmJiAhQWFrLmNvbnRhaW5zKHJlZi5ob3N0LCBob3N0KSkgewogICAgICAgICAgICAvLyBBdXRvIHJlcG9ydAogICAgICAgICAgICBBYWsuZGV0ZWN0ZWQoJ0Fkc2NlbmRtZWRpYScsIHJlZi5ob3N0LCBob3N0KTsKICAgICAgICAgICAgLy8gTm90aWZpY2F0aW9uCiAgICAgICAgICAgIEFhay5ub3RpZmljYXRpb24oJ1lvdSBtdXN0IHN1YnNjcmliZSB0byA8Yj5BYWtMaXN0IChBbnRpLUFkYmxvY2sgS2lsbGVyICk8L2I+IDxhIGhyZWY9IicgKyBBYWsuc3Vic2NyaWJlVVJMICsgJyIgdGFyZ2V0PSJfYmxhbmsiPlN1YnNjcmliZTwvYT4nKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIGFkd29ya21lZGlhIDogewogICAgICAgIGhvc3QgOiBbJ2Fkd29ya21lZGlhLmNvbScsICdsb3h0ay5jb20nLCAnY29udGVudGxvY2tpbmduZXR3b3Jrcy5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gQWRXb3JrTWVkaWEgLSBodHRwczovL3d3dy5hZHdvcmttZWRpYS5jb20vCiAgICAgICAgICB2YXIgcmVmID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnYScpLmhyZWYgPSBkb2N1bWVudC5yZWZlcnJlcjsKICAgICAgICAgIHZhciBob3N0ID0gb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ICAgICAgICAgIGlmIChBYWsudXcuRG9EZXRlY3QyKSB7CiAgICAgICAgICAgIEFhay51dy5Eb0RldGVjdDIgPSBudWxsOwogICAgICAgICAgICBBYWsudXcuQ2hlY2tBZEltYWdlID0gbnVsbDsKICAgICAgICAgICAgQWFrLmluZm8oJ1NvbHV0aW9uIDInKTsKICAgICAgICAgIH0gLy9Tb2x1dGlvbiAzCiAgICAgICAgICBlbHNlIGlmIChkaXZDb250ZW50VmlkZW8pIHsKCiAgICAgICAgICAgIHZhciBkaXZEb3dubG9hZCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyNkaXZEb3dubG9hZCcpLmNsb25lTm9kZSh0cnVlKTsKCiAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgIGRpdkNvbnRlbnRWaWRlby5pbm5lckhUTUwgPSAnJzsKICAgICAgICAgICAgICBBYWsudXcuRG9IaWRlRmFrZSgpOwogICAgICAgICAgICAgIGRpdkNvbnRlbnRWaWRlby5hcHBlbmRDaGlsZChkaXZEb3dubG9hZCk7CiAgICAgICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJ2lmcmFtZVtpZF49ImFkc0lmcm1lIl0sIC5kaXZDbG9zZUJ1dCcpOwogICAgICAgICAgICAgIEFhay5pbmZvKCdTb2x1dGlvbiAzJyk7CiAgICAgICAgICAgIH0sIDU1MDApOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgS2lzc2NhcnRvb25fbWUgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzQ4OAogICAgICAgIGhvc3QgOiBbJ2tpc3NjYXJ0b29uLm1lJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcueGFabEUgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAg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CAnYWh6YWhnNm9oYi5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gc2tpcCBhbnRpLWFkYmxvY2sKICAgICAgICAgIEFhay51dy5hZHNTaG93UG9wdXAxID0gMTsKICAgICAgICB9LAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIHJlbm92ZSBhZHMgKyBmYWtlIHBsYXkgYnV0dG9uCiAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudCgnI3BsYXllcl9pbWosICNwbGF5ZXJfaW1qICsgZGl2W2lkXScpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZXhhc2hhcmVfY29tIDogewogICAgICAgIC8vIGJ5OiBXYXRpbGluCiAgICAgICAgLy8gcHVsbDogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9wdWxsLzUxOQogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPWV4YXNoYXJlLmNvbQogICAgICAgIC8vIHRlc3Q6ICBodHRwOi8vZXhhc2hhcmUuY29tL2dhbHcyZ2Uya3pzdgogICAgICAgIGhvc3QgOiBbJ2V4YXNoYXJlLmNvbScsICdjaGVmdGkuaW5mbycsICdib2plbTNhLmluZm8nLCAnYWppaGV6by5pbmZvJywgJ3lhaG1haWIzYWkuY29tJywgJ3lhaG1haWIzYWkuY29tJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIHNraXAgYW50aS1hZGJsb2NrCiAgICAgICAgICBBYWsudXcuYWRzU2hvd1BvcHVwMSA9IDE7CiAgICAgICAgfSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyByZW5vdmUgYWRzICsgZmFrZSBwbGF5IGJ1dHRvbgogICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyNwbGF5ZXJfZ2F6LCAjcGxheWVyX2dheiArIGRpdltpZF0nKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGFuMW1lX3NlIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xOTAKICAgICAgICBob3N0IDogWydhbjFtZS5zZSddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICBBYWsudXcuaXNCbG9ja0FkczIgPSBmYWxzZTsKICAgICAgICAgIH0sIDEwMDAwKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGhxcV90diA6IHsgLy8gcHV0bG9ja2VyLmlzCiAgICAgICAgaG9zdCA6IFsnaHFxLnR2J10sCiAgICAgICAgb25JZGxlIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8gKyBhYnAgcnVsZQogICAgICAgICAgLy8gaHR0cDovL2hxcS50di9wbGF5ZXIvZW1iZWRfcGxheWVyLnBocD92aWQ9UjNER0hHM0dLWFg3JmF1dG9wbGF5PW5vCiAgICAgICAgICBpZiAoJy9wbGF5ZXIvZW1iZWRfcGxheWVyLnBocCcgPT0gbG9jYXRpb24ucGF0aG5hbWUpIHsKICAgICAgICAgICAgZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZm9ybVtpZF49ImZvcm0tIl0nKS5zdWJtaXQoKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIC8vIFBvbGFuZAogICAgICB3cF9kb21haW5zIDogewogICAgICAgIC8vIE5vdGU6IGRpc2FibGUgRWFzeVByaXZhY3kKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvOTU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ICAgICAgICBodHRwOi8vZ2V0LndwLnR2Lz9taWQ9MTY2MTA1NgogICAgICAgICAgICAgIGh0dHA6Ly93cC50di9wbGF5ZXIvbWlkLDE2NjEwNTYsZW1iZWQuanNvbgogICAgICAgICAgICAgIGh0dHA6Ly9nZXQud3AudHYvP2Y9Mjg5NjQ2Mi4xNDI2MzI5MDU2OTA0Lmwud2VibSZybmQ9MQogICAgICAgICAgICAgIGh0dHBzOi8vd3AudHYvcGxheWVyL21pZCwxNzQ3MTE3LGVtYmVkLmpzb24KICAgICAgICAgICAgICAgKi8KICAgICAgICAgICAgICBBYWsucmVxdWVzdCh7CiAgICAgICAgICAgICAgICB1cmwgOiAnaHR0cDovL3dwLnR2L3BsYXllci9taWQsJyArIG1pZCArICcsZW1iZWQuanNvbicsCiAgICAgICAgICAgICAgICBvbmxvYWQgOiBmdW5jdGlvbiAocmVzdWx0KSB7CiAgICAgICAgICAgICAgICAgIHZhciByZXMgPSByZXN1bHQucmVzcG9uc2VUZXh0OwogICAgICAgICAgICAgICAgICB2YXIgb2JqID0gSlNPTi5wYXJzZShyZXMpOwogICAgICAgICAgICAgICAgICBBYWsubG9nKG9iaik7CgogICAgICAgICAgICAgICAgICB2YXIgUGxheWVyID0gbmV3IEFhay5wbGF5ZXIoKTsKICAgICAgICAgICAgICAgICAgUGxheWVyLnZpZGVvanMocGxheWVyLCB7CiAgICAgICAgICAgICAgICAgICAgc291cmNlIDogQWFrLmZpeFByb3RvY29sVVJMKG9iai5jbGlwLnVybFsxXS51cmwpLCAvLyBIRAogICAgICAgICAgICAgICAgICAgIHR5cGUgOiAnbXA0JywKICAgICAgICAgICAgICAgICAgICBhdXRvcGxheSA6IGZhbHNlCiAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9OwoKICAgICAgICAgICAgdmFyIHJlcGxhY2VQbGF5ZXJXcnp1dGEgPSBmdW5jdGlvbiAoa2V5LCBjaGFubmVsLCBlbGVtKSB7CiAgICAgICAgICAgICAgQWFrLnJlcXVlc3QoewogICAgICAgICAgICAgICAgLy8gaHR0cDovL3d3dy53cnp1dGEucGwvbnBwL2VtYmVkL3dvbG5hcG9sc2thMi8wSTBIUTJtdXRKYwogICAgICAgICAgICAgICAgdXJsIDogJ2h0dHA6Ly93d3cud3J6dXRhLnBsL25wcC9lbWJlZC8nICsgY2hhbm5lbCArICcvJyArIGtleSwKICAgICAgICAgICAgICAgIG9ubG9hZCA6IGZ1bmN0aW9uIChyZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHJlc3VsdC5yZXNwb25zZVRleHQ7CiAgICAgICAgICAgICAgICAgIHZhciBvYmogPSBKU09OLnBhcnNlKHJlcyk7CiAgICAgICAgICAgICAgICAgIEFhay5sb2cob2JqKTsKCiAgICAgICAgICAgICAgICAgIHZhciBQbGF5ZXIgPSBuZXcgQWFrLnBsYXllcigpOwogICAgICAgICAgICAgICAgICBQbGF5ZXIudmlkZW9qcyhlbGVtLCB7CiAgICAgICAgICAgICAgICAgICAgc291cmNlIDogQWFrLmZpeFByb3RvY29sVVJMKG9iai51cmxbMF0udXJsKSwgLy9IRAogICAgICAgICAgICAgICAgICAgIHR5cGUgOiAnbXA0JywKICAgICAgICAgICAgICAgICAgICBhdXRvcGxheSA6IGZhbHNlCiAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9OwoKICAgICAgICAgICAgLy8gVXNpbmcgYW4gZXh0ZXJuYWwgZmxhc2ggcGxheWVyIGlzIGltcG9zc2libGUgYmVjYXVzZSBwcm90ZWN0ZWQgYnkgY3Jvc3Nkb21haW4ueG1sCiAgICAgICAgICAgIHZhciBwbGF5ZXJzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnLndwLXBsYXllcicpOyAvLyAgI1BsYXllcjAsICNQbGF5ZXIxLCAjbWFpblBsYXllcgogICAgICAgICAgICBpZiAocGxheWVycy5sZW5ndGgpIHsKICAgICAgICAgICAgICAvLyBmaXhidWcgZ21feGhyIGxvb3AgcmVxdWVzdCAtIGh0dHA6Ly90aW55dXJsLmNvbS9wcWE5aHRxCiAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwbGF5ZXJzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICB2YXIgbWlkID0gbnVsbDsKICAgICAgICAgICAgICAgIHZhciBwbGF5ZXIgPSBwbGF5ZXJzW2ldOwogICAgICAgICAgICAgICAgdmFyIHBhcmVudCA9IHBsYXllci5wYXJlbnROb2RlOwogICAgICAgICAgICAgICAgdmFyIHNjcmlwdCA9IHBsYXllci5wcmV2aW91c1NpYmxpbmc7CiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwbGF5ZXIucXVlcnlTZWxlY3RvcignLnRpdGxlQ29udCBhLnRpdGxlJyk7CiAgICAgICAgICAgICAgICB2YXIgZW1iZWR2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCdzY3JpcHRbc3JjKj0iL2VtYmVkX3ZpZGVvLmpzIl0nKTsKICAgICAgICAgICAgICAgIEFhay5sb2cocGxheWVyLCBwYXJlbnQsIHNjcmlwdCwgdGl0bGUpOwoKICAgICAgICAgICAgICAgIGlmIChlbWJlZHZpZGVvcy5sZW5ndGgpIHsKICAgICAgICAgICAgICAgICAgLy8gcHVkZWxlay53cnp1dGEucGw6IGh0dHA6Ly90aW55dXJsLmNvbS9sOGpvNXYyCiAgICAgICAgICAgICAgICAgIC8vIHB1ZGVsZWsudHY6IGh0dHA6Ly90aW55dXJsLmNvbS9rbHl6aDZyLCBodHRwOi8vdGlueXVybC5jb20vejdmcjg5dgogICAgICAgICAgICAgICAgICAvLyBwdWRlbGVrLnR2ICh0cmlwbGUpOiBodHRwOi8vdGlueXVybC5jb20vbjliMjdvMgogICAgICAgICAgICAgICAgICAvLyBmaWxtLndwLnBsOiBodHRwOi8vdGlueXVybC5jb20vcTdrNWJ4cAogICAgICAgICAgICAgICAgICB2YXIgZW1iZWR2aWRlbyA9IGVtYmVkdmlkZW9zW2ldOwogICAgICAgICAgICAgICAgICB2YXIga2V5ID0gL2tleT0oXHcrKS8uZXhlYyhlbWJlZHZpZGVvLnNyYylbMV07CiAgICAgICAgICAgICAgICAgIHZhciBjaGFubmVsID0gL2xvZ2luPShcdyspLy5leGVjKGVtYmVkdmlkZW8uc3JjKVsxXTsKICAgICAgICAgICAgICAgICAgdmFyIGF1dG9zdGFydCA9IC9hdXRvcGxheS8udGVzdChlbWJlZHZpZGVvLnNyYyk7CiAgICAgICAgICAgICAgICAgIHJlcGxhY2VQbGF5ZXJXcnp1dGEoa2V5LCBjaGFubmVsLCBwbGF5ZXIsIGF1dG9zdGFydCk7CiAgICAgICAgICAgICAgICAgIEFhay5sb2coJ2VtYmVkX3ZpZGVvLmpzJyk7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRpdGxlICYmIC9taWQvLnRlc3QodGl0bGUuaHJlZikpIHsKICAgICAgICAgICAgICAgICAgLy8gc3BvcnRvd2VmYWt0eS5wbDogaHR0cDovL3Rpbnl1cmwuY29tL2w2emFiY3gKICAgICAgICAgICAgICAgICAgbWlkID0gdGl0bGUuaHJlZi5tYXRjaCgvbWlkWz0sXShbMC05XSspLyk7CiAgICAgICAgICAgICAgICAgIEFhay5sb2coJ3RpdGxlLmhyZWYnKTsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocGFyZW50LmlkKSB7CiAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQuZGF0YXNldC51cmwpIHsKICAgICAgICAgICAgICAgICAgICAvLyB3cC50djogaHR0cDovL3Rpbnl1cmwuY29tL3B6ZGUyOXQKICAgICAgICAgICAgICAgICAgICBtaWQgPSBwYXJlbnQuZGF0YXNldC51cmwubWF0Y2goL21pZFs9LF0oWzAtOV0rKS8pOwogICAgICAgICAgICAgICAgICAgIEFhay5sb2coJ3BhcmVudC5kYXRhc2V0LnVybCcpOwogICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGlmIChwYXJlbnQucHJldmlvdXNTaWJsaW5nLmlubmVySFRNTCkgewogICAgICAgICAgICAgICAgICAgICAgLy8gd2lhZG9tb3NjaS53cC5wbDogaHR0cDovL3Rpbnl1cmwuY29tL2dxdHQ5Y2EKICAgICAgICAgICAgICAgICAgICAgIG1pZCA9IHBhcmVudC5wcmV2aW91c1NpYmxpbmcuaW5uZXJIVE1MLm1hdGNoKC9taWRbPSxdKFswLTldKykvKTsKICAgICAgICAgICAgICAgICAgICAgIEFhay5sb2coJ3NjcmlwdC5pbmxpbmUuaW5uZXJIVE1MJyk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgIC8vIGthZmV0ZXJpYS50djogaHR0cDovL3Rpbnl1cmwuY29tL25vZnA1OGEKICAgICAgICAgICAgICAgICAgICAgIC8vIGFiY3pkcm93aWUucGw6IGh0dHA6Ly90aW55dXJsLmNvbS9oeDZzNWV0CiAgICAgICAgICAgICAgICAgICAgICBtaWQgPSBwYXJlbnQuaW5uZXJIVE1MLm1hdGNoKC9taWRbPSxdKFswLTldKykvKTsKICAgICAgICAgICAgICAgICAgICAgIEFhay5sb2coJ3BhcmVudC5pbm5lckhUTUwnKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc2NyaXB0ICYmIHNjcmlwdC50YWdOYW1lID09ICdTQ1JJUFQnKSB7CiAgICAgICAgICAgICAgICAgIC8vIGZpbG0ud3AucGw6IGh0dHA6Ly90aW55dXJsLmNvbS9taDlvbmZ3CiAgICAgICAgICAgICAgICAgIC8vIHB1ZGVsZWsudHYgKGRvdWJsZSk6IGh0dHA6Ly90aW55dXJsLmNvbS9sZWZ2d3R4CiAgICAgICAgICAgICAgICAgIG1pZCA9IHNjcmlwdC5pbm5lckhUTUwubWF0Y2goL21pZFs9LF0oWzAtOV0rKS8pOwogICAgICAgICAgICAgICAgICBBYWsubG9nKCdzY3JpcHQuc3JjLmlubmVySFRNTCcpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgaWYgKG1pZCAhPT0gbnVsbCAmJiBtaWQubGVuZ3RoID09IDIpIHsKICAgICAgICAgICAgICAgICAgcmVwbGFjZVBsYXllcldQKG1pZFsxXSwgcGxheWVyKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgbW9qZV9maWxteV9uZXR3b3JrOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEwMTAKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vN0cyUkJucXEKICAgICAgICBob3N0IDogWydtb2plLWZpbG15LnRrJywgJ21vamUtZmlsbXkubGl2ZSddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBzZWFyY2h2YWx1ZSA9IFsndmFyIHBsYXllckluc3RhbmNlJywgJ30pOyddOwogICAgICAgICAgdmFyIHNjcmlwdCA9IEFhay5oYXNTY3JpcHQoc2VhcmNodmFsdWVbMF0pOwoKICAgICAgICAgIGlmIChzY3JpcHQpIHsKICAgICAgICAgICAgdmFyIHNvdXJjZSA9IHNjcmlwdC5pbm5lckhUTUw7CiAgICAgICAgICAgIHZhciBzdHIgPSBzb3VyY2Uuc3Vic3RyaW5nKHNvdXJjZS5sYXN0SW5kZXhPZihzZWFyY2h2YWx1ZVswXSksIHNvdXJjZS5sYXN0SW5kZXhPZihzZWFyY2h2YWx1ZVsxXSkgKyBzZWFyY2h2YWx1ZVsxXS5sZW5ndGgpOwogICAgICAgICAgICBBYWsuYWRkU2NyaXB0KHN0cik7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICB0dm5fcGwgOiB7CiAgICAgICAgLy8gYnk6IFJlZWssIE1hcmVrCiAgICAgICAgLy8gc29sdXRpb246IGh0dHA6Ly90aW55dXJsLmNvbS9vaGJ2ejRyLCBodHRwOi8vdGlueXVybC5jb20vanE4czQ2MgogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPXR2bi5wbAogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPXR2bjI0LnBsCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzP3E9cGxheWVyLnBsCiAgICAgICAgLy8gdGVzdDogaHR0cDovL3Rpbnl1cmwuY29tL282ZDloNjYsIGh0dHA6Ly90aW55dXJsLmNvbS96NzdtNHpoCiAgICAgICAgaG9zdCA6IFsndHZuLnBsJywgJ3R2bjI0LnBsJywgJ3BsYXllci5wbCddLAogICAgICAgIG9uRW5kIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmhhc0VsZW1lbnQoJ2hlYWRlci5kZXRhaWxJbWFnZScsIGZ1bmN0aW9uICh0aGlzRWxlbWVudCkgewogICAgICAgICAgICBpZiAoQWFrLmdldENvb2tpZSgnY291bnRyeV9jb2RlJykgJiYgQWFrLmdldFNlc3Npb24oJ2dlbmVyYXRlVG9rZW4nKSkgewogICAgICAgICAgICAgICAgdmFyIHBhcnRzID0gZG9jdW1lbnQubG9jYXRpb24uaHJlZi5zcGxpdCgvWy4sXS8pOwogICAgICAgICAgICAgICAgdmFyIGlkID0gcGFydHNbcGFydHMubGVuZ3RoIC0gMl07CiAgICAgICAgICAgICAgICB2YXIgcGFyYW1zID0gewogICAgICAgICAgICAgICAgICBwbGF0Zm9ybSA6ICJNb2JpbGUiLAogICAgICAgICAgICAgICAgICB0ZXJtaW5hbCA6ICJBbmRyb2lkIiwKICAgICAgICAgICAgICAgICAgZm9ybWF0IDogImpzb24iLAogICAgICAgICAgICAgICAgICB2IDogIjIuMCIsCiAgICAgICAgICAgICAgICAgIGF1dGhLZXkgOiAiYjRiYzk3MTg0MGRlNjNkMTA1YjMxNjY0MDNhYTFiZWEiLAogICAgICAgICAgICAgICAgICB0eXBlIDogImVwaXNvZGUiLAogICAgICAgICAgICAgICAgICBpZCA6IGlkLAogICAgICAgICAgICAgICAgICBzb3J0IDogIm5ld2VzdCIsCiAgICAgICAgICAgICAgICAgIG0gOiAiZ2V0SXRlbSIsCiAgICAgICAgICAgICAgICAgIGRldmljZVNjcmVlbkhlaWdodCA6IDE2MDAsCiAgICAgICAgICAgICAgICAgIGRldmljZVNjcmVlbldpZHRoIDogMjU2MAogICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIHZhciBhcGkgPSAnaHR0cHM6Ly9hcGkudHZucGxheWVyLnBsL2FwaS8/JyArIEFhay5zZXJpYWxpemUocGFyYW1zKTsKICAgICAgICAgICAgICAgIHZhciBwcm94eSA9ICdodHRwOi8vd3d3LnByb3h5LnhtYy5wbC9pbmRleC5waHA/aGw9M2U1JnE9JzsJCiAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIC8vIEdldCB2aWRlb1VybAogICAgICAgICAgICAgICAgQWFrLnJlcXVlc3QoewogICAgICAgICAgICAgICAgICB1cmwgOiBBYWsuZ2V0Q29va2llKCdjb3VudHJ5X2NvZGUnKSAhPSAnUEwnID8gcHJveHkgKyBBYWsuZW5jb2RlVVJJKGFwaSkgOiBhcGksCiAgICAgICAgICAgICAgICAgIGhlYWRlcnMgOiB7CiAgICAgICAgICAgICAgICAgICAgIlVzZXItQWdlbnQiIDogIk1vemlsbGEvNS4wIChMaW51eDsgVTsgQW5kcm9pZCA0LjI7IGVuLXVzOyBOZXh1cyAxMCBCdWlsZC9KVlAxNUkpIEFwcGxlV2ViS2l0LzUzNC4zMCAoS0hUTUwsIGxpa2UgR2Vja28pIFZlcnNpb24vNC4wIFNhZmFyaS81MzQuMzAiCiAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgIG9ubG9hZCA6IGZ1bmN0aW9uIChyZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0gcmVzdWx0LnJlc3BvbnNlVGV4dDsKICAgICAgICAgICAgICAgICAgICBBYWsubG9nKHJlcyk7CiAgICAgICAgICAgICAgICAgICAgdmFyIG8gPSBKU09OLnBhcnNlKHJlcyk7CiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZGVvVXJsID0gby5pdGVtLnZpZGVvcy5tYWluLnZpZGVvX2NvbnRlbnRbTnVtYmVyKEFhay5vcHRzLnZpZGVvSEQpXS51cmw7CiAgICAgICAgICAgICAgICAgICAgdmFyIGdlbmVyYXRlVG9rZW4gPSBuZXcgRnVuY3Rpb24oJ3ZpZGVvVXJsJywgQWFrLmdldFNlc3Npb24oJ2dlbmVyYXRlVG9rZW4nKSk7CiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZGVvVXJsV2l0aFNlZWQgPSBnZW5lcmF0ZVRva2VuKHZpZGVvVXJsKTsKICAgICAgICAgICAgICAgICAgICB2YXIgUGxheWVyID0gbmV3IEFhay5wbGF5ZXIoKTsKICAgICAgICAgICAgICAgICAgICBQbGF5ZXIudmlkZW9qcyh0aGlzRWxlbWVudCwgewogICAgICAgICAgICAgICAgICAgICAgc291cmNlIDogdmlkZW9VcmxXaXRoU2VlZCwKICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiAnbXA0JywKICAgICAgICAgICAgICAgICAgICAgIGF1dG9wbGF5OiBmYWxzZQogICAgICAgICAgICAgICAgICAgIH0sIHt9LCB7aW5zZXJ0Oidpbm5lcid9KTsKICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgQWFrLnJlcXVlc3QoeyAvLyBnZXQgYW5kIHN0b3JlIGdlbmVyYXRlVG9rZW4gZnVuY3Rpb24KICAgICAgICAgICAgICAgIHVybCA6ICdodHRwOi8vcGFzdGViaW4uY29tL3Jhdy9EOXFNNERSMycsCiAgICAgICAgICAgICAgICBvbmxvYWQgOiBmdW5jdGlvbiAocmVzcG9uc2UpIHsKICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHJlc3BvbnNlLnJlc3BvbnNlVGV4dDsKICAgICAgICAgICAgICAgICAgQWFrLnNldFNlc3Npb24oJ2dlbmVyYXRlVG9rZW4nLCByZXMpOwogICAgICAgICAgICAgICAgICBBYWsucmVxdWVzdCh7IC8vIGdldCB1c2VyIGlwCiAgICAgICAgICAgICAgICAgICAgdXJsIDogJ2h0dHA6Ly9pcC1hcGkuY29tL2pzb24nLAogICAgICAgICAgICAgICAgICAgIG9ubG9hZCA6IGZ1bmN0aW9uIChyZXNwb25zZSkgewogICAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHJlc3BvbnNlLnJlc3BvbnNlVGV4dDsKICAgICAgICAgICAgICAgICAgICAgIHZhciBqc29uID0gSlNPTi5wYXJzZShyZXMpOwogICAgICAgICAgICAgICAgICAgICAgQWFrLnNldENvb2tpZSgnY291bnRyeV9jb2RlJywganNvbi5jb3VudHJ5Q29kZSk7CiAgICAgICAgICAgICAgICAgICAgICBBYWsucmVmcmVzaCgpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgaXBsYV90diA6IHsKICAgICAgICAvLyBieTogTWFyZWsKICAgICAgICAvLy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gICAgICAgICBvbmxvYWQgOiBmdW5jdGlvbiAocmVzdWx0KSB7CiAgICAgICAgICAgICAgICAgIHZhciByZXMgPSByZXN1bHQucmVzcG9uc2VUZXh0OwogICAgICAgICAgICAgICAgICB2YXIgbyA9IEpTT04ucGFyc2UocmVzKTsKICAgICAgICAgICAgICAgICAgQWFrLmxvZyhvKTsKICAgICAgICAgICAgICAgICAgaWYgKG8udm9kLnZpZGVvX2hkKSB7CiAgICAgICAgICAgICAgICAgICAgdmlkZW9VUkwgPSBvLnZvZC52aWRlb19oZDsKICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChvLnZvZC52aWRlbykgewogICAgICAgICAgICAgICAgICAgIHZpZGVvVVJMID0gby52b2QudmlkZW87CiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgdmlkZW9VUkwgPSBvLnZvZC5jb3BpZXNbMF0udXJsOwogICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICB2YXIgUGxheWVyID0gbmV3IEFhay5wbGF5ZXIoKTsKICAgICAgICAgICAgICAgICAgUGxheWVyLnZpZGVvanMob2xkUGxheWVyLCB7CiAgICAgICAgICAgICAgICAgICAgc291cmNlIDogdmlkZW9VUkwsCiAgICAgICAgICAgICAgICAgICAgdHlwZSA6ICdtcDQnLAogICAgICAgICAgICAgICAgICAgIHdpZHRoIDogODIwLAogICAgICAgICAgICAgICAgICAgIGhlaWdodCA6IDQ1MCwKICAgICAgICAgICAgICAgICAgICBhdXRvcGxheSA6IGZhbHNlCiAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGtvc2NpYW5fbmV0IDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy85MTQKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20veUdTUEJScWUKICAgICAgICBob3N0IDogWydrb3NjaWFuLm5ldCddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBlbGVtcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy5iYW4nKTsKICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZWxlbXMubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgZWxlbXNbaV0ucmVtb3ZlKCk7CiAgICAgICAgICAgIC8vZWxlbXNbaV0uaW5uZXJIVE1MID0gJzxicj4nOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgLy8gRnJhbmNlCiAgICAgIHBsYXl0dl9mciA6IHsgLy8gcmVzZWFyY2ggc29sdXRpb24KICAgICAgICBob3N0IDogWydwbGF5LnR2JywgJ3BsYXl0di5mciddLAogICAgICAgIG9uQWx3YXlzIDogZnVuY3Rpb24gKCkge30sCiAgICAgICAgb25FbmQgOiBmdW5jdGlvbiAoKSB7fQogICAgICB9LAogICAgICBybWNzcG9ydGJmbXR2X2NvbSA6IHsgLy8gd2VicmFkaW8KICAgICAgICBob3N0IDogWydybWNzcG9ydC5iZm10di5jb20nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CgogICAgICAgICAgdmFyIGZsYXNodmFycyA9IHsKICAgICAgICAgICAgdXJsUmFkaW8gOiAiaHR0cDovL21wM2xnNC50ZGYtY2RuLmNvbS8xMDE2MC9ybWMubXAzIiwKICAgICAgICAgICAgbm9tIDogImxpdmUiLAogICAgICAgICAgICBjYXRlZ29yaWUgOiAibGl2ZSIsCiAgICAgICAgICAgIHVybFNtYXJ0IDogIiIgLy8gc2V0IGVtcHR5IHRvIHJlbW92ZSBhdWRpbyBhZAogICAgICAgICAgfTsKICAgICAgICAgIHZhciBwYXJhbXMgPSB7CiAgICAgICAgICAgIHdtb2RlIDogInRyYW5zcGFyZW50IgogICAgICAgICAgfTsKCiAgICAgICAgICBBYWsudXcuc3dmb2JqZWN0LmVtYmVkU1dGKCIvc3dmL1JNQ0xJVkUuc3dmIiwgImxpdmVwbGF5ZXIiLCAiNzAiLCAiOTAiLCAiMTAuMC4wIiwgIiIsIGZsYXNodmFycywgcGFyYW1zKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGVjbHlwc2lhX2NvbSA6IHsKICAgICAgICBob3N0IDogWydlY2x5cHNpYS5jb20nXSwKICAgICAgICBvbkFsd2F5cyA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIFNvbHV0aW9uIDEKICAgICAgICAgIC8vIGFicCBydWxlcwoKICAgICAgICAgIC8vIFNvbHV0aW9uIDIKICAgICAgICAgIEFhay51dy5pc0FCQWN0aXZhdGVkID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICB9OyAvLyBLaWxsIGFudGlhZGJsb2NrCiAgICAgICAgICBBYWsudXcucmVmcmVzaF9pZnJhbWUgPSBmdW5jdGlvbiAoKSB7fTsgLy8gU3RvcCBhZHMgdG8gYmUgbG9hZGVkCiAgICAgICAgfSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIFNvbHV0aW9uIDMKICAgICAgICAgIHZhciBlbGVtZW50ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcignZGl2W2lkXj0id2VidHZfaWZyYW1lXyJdJyk7CiAgICAgICAgICBpZiAoZWxlbWVudCAhPT0gbnVsbCkgewogICAgICAgICAgICB2YXIgdmlkZW9JZCA9IGVsZW1lbnQuaWQuc3BsaXQoJ18nKVsyXTsKICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgZWxlbWVudC5pbm5lckhUTUwgPSAnPGlmcmFtZSBmcmFtZWJvcmRlcj0iMCI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b3VyY2UgOiBjb25maWcuc291cmNlc1sxXS5zcmMsCiAgICAgICAgICAgICAgdHlwZSA6ICdtcDQnLAogICAgICAgICAgICAgIGF1dG9wbGF5IDogZmFsc2UKICAgICAgICAgICAgfSk7CgogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgZ2FtaW5ncm9vbV90diA6IHsKICAgICAgICBob3N0IDogWydnYW1pbmdyb29tLnR2J10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuYWRibG9ja19kZXRlY3QgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICAgIEFhay51dy5HUl9hZGJsb2NrX2hpZGVfdmlkZW8gPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICAgIEFhay51dy5hZGJsb2NrX3ZpZGVvX21zZ19zdGFydCA9IGZ1bmN0aW9uICgpIHt9OwogICAgICAgICAgQWFrLnV3LmFkYmxvY2tfdmlkZW9fbXNnX3N0b3AgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICAgIEFhay51dy5kaXNhYmxlX2NoYXQgPSBmdW5jdGlvbiAoKSB7fTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIC8vIEdlcm1hbnkKICAgICAgbm93X2RvbWFpbnMgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzMzNgogICAgICAgIC8vIHRlc3Q6IGh0dHA6Ly90aW55dXJsLmNvbS9wZWVvYm91CiAgICAgICAgLy8gdGVzdDogaHR0cDovL2pzYmluLmNvbS92dWNvYmVqb2ZvCiAgICAgICAgaG9zdCA6IFsndm94bm93LmRlJywgJ3J0bC1ub3cucnRsLmRlJywgJ3J0bDJub3cucnRsMi5kZScsICduLXR2bm93LmRlJywgJ3N1cGVycnRsbm93LmRlJywgJ3J0bG5pdHJvbm93LmRlJywgJ25vd3R2LmRlJ10s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FwKGZ1bmN0aW9uICh2aWRlbykgewogICAgICAgICAgICB2YXIgY2ZnID0gQWFrLmludG9PYmplY3QodmlkZW8uZGF0YXNldC5wbGF5ZXJMYXllckNmZyk7CiAgICAgICAgICAgIHZhciBmaWxlID0gY2ZnLnZpZGVvaW5mby5tcDR1cmw7CiAgICAgICAgICAgIEFhay5sb2codmlkZW8sIGNmZywgZmlsZSk7CgogICAgICAgICAgICAvLyBSZXBsYWNlIHBsYXllcgogICAgICAgICAgICB2YXIgUGxheWVyID0gbmV3IEFhay5wbGF5ZXIoKTsKICAgICAgICAgICAgUGxheWVyLnZpZGVvanModmlkZW8sIHsKICAgICAgICAgICAgICBzb3VyY2UgOiBmaWxlLAogICAgICAgICAgICAgIHR5cGUgOiAnbXA0JywKICAgICAgICAgICAgICBhdXRvcGxheSA6IGZhbHNlCiAgICAgICAgICAgIH0pOwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBteXNwYXNzX2RlIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy83NgogICAgICAgIC8vIHRlc3Q6IGh0dHA6Ly90aW55dXJsLmNvbS9sdG85cHlkCiAgICAgICAgaG9zdCA6IFsnbXlzcGFzcy5kZSddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciB2aWRlb2lkID0gbG9jYXRpb24ucGF0aG5hbWUubWF0Y2goL1wvKFxkKylcLyQvKTsKCiAgICAgICAgICBpZiAodmlkZW9pZCAhPT0gbnVsbCkgewogICAgICAgICAgICBBYWsucmVxdWVzdCh7CiAgICAgICAgICAgICAgdXJsIDogJ2h0dHA6Ly93d3cubXlzcGFzcy5kZS9teXNwYXNzL2luY2x1ZGVzL2FwcHMvdmlkZW8vZ2V0dmlkZW9tZXRhZGF0YXhtbC5waHA/aWQ9JyArIHZpZGVvaWRbMV0sCiAgICAgICAgICAgICAgb25sb2FkIDogZnVuY3Rpb24gKHJlc3VsdCkgewogICAgICAgICAgICAgICAgdmFyIHJlcyA9IHJlc3VsdC5yZXNwb25zZVRleHQ7CiAgICAgICAgICAgICAgICBBYWsubG9nKHJlcyk7CgogICAgICAgICAgICAgICAgLy8gR2V0IHZpZGVvCiAgICAgICAgICAgICAgICB2YXIgcGFyc2VyID0gbmV3IHdpbmRvdy5ET01QYXJzZXIoKTsKICAgICAgICAgICAgICAgIHZhciBkb20gPSBwYXJzZXIucGFyc2VGcm9tU3RyaW5nKHJlcywgImFwcGxpY2F0aW9uL3htbCIpOwogICAgICAgICAgICAgICAgdmFyIGZpbGUgPSBkb20uZ2V0RWxlbWVudHNCeVRhZ05hbWUoInVybF9mbHYiKS5pdGVtKDApLnRleHRDb250ZW50OwoKICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBlbGVtZW50cwogICAgICAgICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJ2Rpdi5sb2FkaW5nR2lmJyk7CgogICAgICAgICAgICAgICAgLy8gUmVwbGFjZSBwbGF5ZXIKICAgICAgICAgICAgICAgIHZhciBQbGF5ZXIgPSBuZXcgQWFrLnBsYXllcigpOwogICAgICAgICAgICAgICAgUGxheWVyLnZpZGVvanMoJyNwbGF5ZXInLCB7CiAgICAgICAgICAgICAgICAgIHNvdXJjZSA6IGZpbGUsCiAgICAgICAgICAgICAgICAgIHR5cGUgOiAnbXA0JywKICAgICAgICAgICAgICAgICAgYXV0b3BsYXkgOiBmYWxzZQogICAgICAgICAgICAgICAgfSk7CgogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICAvLyBOZWRlcmxhbmQKICAgICAgcnRseGxfbmwgOiB7CiAgICAgICAgLy8gdGVzdDogaHR0cDovL3Rpbnl1cmwuY29tL2wyemt2M2QKICAgICAgICBob3N0IDogWydydGx4bC5ubCcsICdydGxuaWV1d3MubmwnXSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBQbGF5ZXIgPSBuZXcgQWFrLnBsYXllcigpOwogICAgICAgICAgUGxheWVyLmVkaXRpbmcoJyNfcnRsb3NtZjAnLCB7CiAgICAgICAgICAgIHNldEZsYXNodmFycyA6IHsKICAgICAgICAgICAgICBhZGJsb2NrIDogZmFsc2UKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICAvLyBOb3J3YXkKICAgICAgdmd0dl9uZXR3b3JrIDogewogICAgICAgIC8vIG5vdGU6IHNraXAgdmlkZW8gYWRzICsgYW50aS1hZGJsb2NrCiAgICAgICAgLy8gandwbGF5ZXI6IGh0dHA6Ly90aW55dXJsLmNvbS96eXY3OWhnCiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzE0MDIKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMzY3CiAgICAgICAgLy8gdGVzdDogaHR0cDovL3Rpbnl1cmwuY29tL253cDg1dCwgaHR0cDovL3Rpbnl1cmwuY29tL253cDg1dAogICAgICAgIGhvc3QgOiBbJ3ZndHYubm8nLCAndmcubm8nXSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIHZhciBvbGRIYXNoID0gbnVsbDsKICAgICAgICAgIHZhciB2aWRlb0lkID0gbnVsbDsKICAgICAgICAgIHZhciB2aWRlb0lkUmVnZXggPSAvI1whXC92aWRlb1wvKFxkKylcLy87CgogICAgICAgICAgLy8gY2hlY2sgaWYgdGhlIGxvY2F0aW9uIGhhc2ggY2hhbmdlcwogICAgICAgICAgc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgICAgICAgICB2YXIgcGxhe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FwdGVyc3xjdWVQb2ludHN8ZXh0ZXJuYWxJZHxiYXJyZWxzfGV4dGVybmFsQ2F0ZWdvcnlJZHxuZXh0QXNzZXQmYXBwTmFtZT12Z3R2LXdlYnNpdGUnLAogICAgICAgICAgICAgICAgb25sb2FkIDogZnVuY3Rpb24gKHJlc3VsdCkgewogICAgICAgICAgICAgICAgICB2YXIgcmVzID0gcmVzdWx0LnJlc3BvbnNlVGV4dDsKICAgICAgICAgICAgICAgICAgdmFyIG9iaiA9IEpTT04ucGFyc2UocmVzKTsKICAgICAgICAgICAgICAgICAgQWFrLmxvZyhvYmopOwoKICAgICAgICAgICAgICAgICAgLy8gcmVwbGFjZSBwbGF5ZXIKICAgICAgICAgICAgICAgICAgdmFyIFBsYXllciA9IG5ldyBBYWsucGxheWVyKCk7CiAgICAgICAgICAgICAgICAgIFBsYXllci52bGMocGxheWVyLCB7CiAgICAgICAgICAgICAgICAgICAgc291cmNlIDogb2JqLnN0cmVhbVVybHMuaGxzLCAvLyBtM3U4CiAgICAgICAgICAgICAgICAgICAgdHlwZSA6ICdobHMnLAogICAgICAgICAgICAgICAgICAgIGF1dG9wbGF5IDogZmFsc2UKICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfSwge30sIHsKICAgICAgICAgICAgICAgIGluc2VydCA6ICdpbm5lcicKICAgICAgICAgICAgICB9KTsKKi8KICAgICAgICAgICAgfQogICAgICAgICAgfSwgMWUzKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIG10Z19yYWRpbyA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMTQ5NQogICAgICAgIGhvc3QgOiBbJ3BsYXkucmFkaW8xLnNlJywgJ3BsYXkuYmFuZGl0LnNlJywgJ3BsYXkubHVnbmFmYXZvcml0ZXIuY29tJywgJ3BsYXkucml4Zm0uc2UnXSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICB3aW5kb3cucGxheWVyX2xvYWRfbGl2ZSh3aW5kb3cuc3RyZWFtX2lkKTsKICAgICAgICAgICAgfSwgMTAwMCk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGRwbGF5X25ldHdvcmsgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzE0NjMKICAgICAgICBob3N0IDogWydkcGxheS5jb20nLCAnZHBsYXkuZGsnLCAnZHBsYXkuc2UnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgdmFyIGRhdGUgPSBuZXcgRGF0ZSgpOwogICAgICAgICAgZGF0ZS5zZXREYXRlKGRhdGUuZ2V0RGF0ZSgpICsgMzY1KTsKICAgICAgICAgIHZhciB0aW1lc3RhbXAgPSBkYXRlLmdldFRpbWUoKS50b1N0cmluZygpOwogICAgICAgICAgdmFyIHZhbHVlID0gSlNPTi5zdHJpbmdpZnkoewogICAgICAgICAgICAgICJub3RpZmljYXRpb25TdWJtaXNzaW9uIiA6ICJzdWJtaXR0ZWQiLAogICAgICAgICAgICAgICJyZXBvcnRpbmdFeHBpcnkiIDogdGltZXN0YW1wLAogICAgICAgICAgICAgICJub3RpZmljYXRpb25FeHBpcnkiIDogdGltZXN0YW1wCiAgICAgICAgICAgIH0pOwogICAgICAgICAgQWFrLnNldENvb2tpZSgnZHNjLWFkYmxvY2snLCB2YWx1ZSk7CiAgICAgICAgfQogICAgICB9LAogICAgICB2aWFzYXRfdHYgOiB7CiAgICAgICAgLy8gbm90ZTogc2tpcCB2aWRlbyBhZHMgKyBhbnRpLWFkYmxvY2sKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT10djNwbGF5CiAgICAgICAgLyogdGVzdDogaHR0cDovL3d3dy50djNwbGF5Lm5vL3Byb2dyYW1tZXIvcmVkbmluZ3Nza295dGEgaGRzL2hscwogICAgICAgICAgICAgICAgICAgaHR0cDovL3d3dy50djNwbGF5LmRrL3Byb2dyYW1tZXIvbGluc2Utb2ctZGlkZGUtZWtzdHJhIGhkcy9obHMKICAgICAgICAgICAgICAgICAgIGh0dHA6Ly93d3cudHYzcGxheS5zZS9wcm9ncmFtL2dsYW1vdXJhbWEgaGRzL2hscwogICAgICAgICAgICAgICAgICAgaHR0cDovL3d3dy50djZwbGF5LnNlL3Byb2dyYW0vOTktc2FrZXItbWFuLW1hc3RlLWdvcmEtaW5uYW4tbWFuLWRvciBoZHMvaGxzCiAgICAgICAgICAgICAgICAgICBodHRwOi8vd3d3LnR2OHBsYXkuc2UvcHJvZ3JhbS9lZnRlcmx5c3QtLTEgaGRzL2hscwogICAgICAgICAgICAgICAgICAgaHR0cDovL3d3dy50djEwcGxheS5zZS9wcm9ncmFtL2dhcnBlbnMtZXVyb3BhIGhkcy9obHMKICAgICAgICAgICAgICAgICAgIGh0dHA6Ly90dnBsYXkuc2thdGllcy5sdi9wYXJyYWlkZXMvdHYzLXppbmFzIGhkcy9obHMKICAgICAgICAgICAgICAgICAgIGh0dHA6Ly9wbGF5LnR2My5sdC9wcm9ncmFtb3MvYmVhdG9zLXZpcnR1dmUgcnRtcC9obHMKICAgICAgICAgICAgICAgICAgIGh0dHA6Ly90djNwbGF5LnR2My5lZS9zaXN1L3B1aGFwYWV2LXNlcG9nYSBydG1wL2hscyAqLwogICAgICAgIGhvc3QgOiBbJ3R2M3BsYXkubm8nLCAndHYzcGxheS5kaycsICd0djNwbGF5LnNlJywgJ3R2NnBsYXkuc2UnLCAndHY4cGxheS5zZScsICd0djEwcGxheS5zZScsICd0dnBsYXkuc2thdGllcy5sdicsICdwbGF5LnR2My5sdCcsICd0djNwbGF5LnR2My5lZSddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5oYXNFbGVtZW50KCcjdmlkZW8tcGxheWVyJywgZnVuY3Rpb24gKHRoaXNFbGVtZW50KSB7CiAgICAgICAgICAgIHRoaXNFbGVtZW50LmlkID0gJyc7CiAgICAgICAgICAgIC8vdmFyIHZpZGVvSWQgPSBsb2NhdGlvbi5wYXRobmFtZS5zcGxpdCgnLycpLnBvcCgpOwogICAgICAgICAgICB2YXIgdmlkZW9JZCA9IHRoaXNFbGVtZW50LmdldEF0dHJpYnV0ZSgnZGF0YS12aWRlby1pZCcpOwogICAgICAgICAgICBBYWsubG9nKHRoaXNFbGVtZW50LCB2aWRlb0lkKTsKCiAgICAgICAgICAgIC8vIGdldCB2aWRlbyBzb3VyY2VzCiAgICAgICAgICAgIEFhay5yZXF1ZXN0KHsKICAgICAgICAgICAgICB1cmwgOiAnaHR0cDovL3BsYXlhcGkubXRneC50di92My92aWRlb3Mvc3RyZWFtLycgKyB2aWRlb0lkLAogICAgICAgICAgICAgIG9ubG9hZCA6IGZ1bmN0aW9uIChyZXN1bHQpIHsKICAgICAgICAgICAgICAgIHZhciByZXMgPSByZXN1bHQucmVzcG9uc2VUZXh0OwogICAgICAgICAgICAgICAgdmFyIG9iaiA9IEpTT04ucGFyc2UocmVzKTsKICAgICAgICAgICAgICAgIEFhay5sb2cob2JqKTsKCiAgICAgICAgICAgICAgICAvKiBJbm5ob2xkZXQgZHUgcHLDuHZlciDDpSBzZSBlciBrdW4gdGlsZ2plbmdlbGlnIGZvciBicnVrZXJlIGkgTm9yZ2UKICAgICAgICAgICAgICAgIFByb2dyYW1tZXQgZXIgYmxva2VyZXQgZm9yIHZpc25pbmcgZnJhIGRlbm5lIGdlb2dyYWZpc2tlIHBvc2l0aW9uLgogICAgICAgICAgICAgICAgUHJvZ3JhbcSFIGdhbGl0ZSBtYXR5dGkgdGlrIGp1bmdkYW1pZXNpIGnFoSBMaWV0dXZvcyBpbnRlcm5ldG8gdGlla8SXasWzIHRpbmtsxbMgKi8KICAgICAgICAgICAgICAgIGlmIChvYmoubXNnKSB7CiAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzRWxlbWVudC5pbm5lckhUTUwgPSBvYmoubXNnOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGlmIChsb2NhdGlvbi5ob3N0ID09PSAndHYzcGxheS50djMuZWUnKSB7CiAgICAgICAgICAgICAgICAgIHZhciBQbGF5ZXIgPSBuZXcgQWFrLnBsYXllcigpOwogICAgICAgICAgICAgICAgICBQbGF5ZXIuZ3JpbmRwbGF5ZXIodGhpc0VsZW1lbnQsIHsKICAgICAgICAgICAgICAgICAgICBzb3VyY2UgOiBvYmouc3RyZWFtcy5tZWRpdW0sCiAgICAgICAgICAgICAgICAgICAgdHlwZSA6ICdydG1wL21wNCcsCiAgICAgICAgICAgICAgICAgICAgYXV0b3BsYXkgOiB0cnVlCiAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgLy8gY3JlYXRlIHZpZGVvIHRhZyBmb3IgbmV3IHBsYXllcgogICAgICAgICAgICAgICAgICBBYWsuY3JlYXRlRWxlbWVudCh7CiAgICAgICAgICAgICAgICAgICAgdGFnIDogJ3ZpZGVvJywKICAgICAgICAgICAgICAgICAgICBpZCA6ICdub0FkUGxheWVyJywKICAgICAgICAgICAgICAgICAgICBjbGFzc2lkIDogJ3ZpZGVvLWpzIHZqcy1kZWZhdWx0LXNraW4nLAogICAgICAgICAgICAgICAgICAgIHdpZHRoIDogdGhpc0VsZW1lbnQuY2xpZW50V2lkdGggfHwgNzMwLAogICAgICAgICAgICAgICAgICAgIGhlaWdodCA6IHRoaXNFbGVtZW50LmNsaWVudEhlaWdodCB8fCA0MTAsCiAgICAgICAgICAgICAgICAgICAgcHJlbG9hZCA6ICdhdXRvJywKICAgICAgICAgICAgICAgICAgICBjb250cm9scyA6IHRydWUsCiAgICAgICAgICAgICAgICAgICAgYXV0b3BsYXkgOiB0cnVlLAogICAgICAgICAgICAgICAgICAgIHJlcGxhY2UgOiB0aGlzRWxlbWVudAogICAgICAgICAgICAgICAgICB9KTsKCiAgICAgICAgICAgICAgICAgIC8vIHBhcnNlIHNvdXJjZXMKICAgICAgICAgICAgICAgICAgdmFyIHNyY0FycmF5ID0gW107CiAgICAgICAgICAgICAgICAgIGlmIChvYmouc3RyZWFtcy5oaWdoICYmIG9iai5zdHJlYW1zLmhpZ2ggIT09ICcnKSB7CiAgICAgICAgICAgICAgICAgICAgc3JjQXJyYXkucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogInZpZGVvL21wNCIsIC8vIG1wNAogICAgICAgICAgICAgICAgICAgICAgc3JjIDogb2JqLnN0cmVhbXMuaGlnaAogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICB9ICBpZiAob2JqLnN0cmVhbXMuaGxzICYmIG9iai5zdHJlYW1zLmhscyAhPT0gJycpIHsKICAgICAgICAgICAgICAgICAgICBzcmNBcnJheS5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgIHR5cGUgOiAiYXBwbGljYXRpb24veC1tcGVnVVJMIiwgLy8gbTN1OAogICAgICAgICAgICAgICAgICAgICAgc3JjIDogb2JqLnN0cmVhbXMuaGxzCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgIH0gIGlmIChvYmouc3RyZWFtcy5tZWRpdW0gJiYgb2JqLnN0cmVhbXMubWVkaXVtICE9PSAnJykgewogICAgICAgICAgICAgICAgICAgIHZhciB0eXBlID0gb2JqLnN0cmVhbXMubWVkaXVtLmluZGV4T2YoJ3J0bXAnKSA9PT0gMCA/ICdydG1wL21wNCcgOiAnYXBwbGljYXRpb24vZjRtK3htbCc7CiAgICAgICAgICAgICAgICAgICAgc3JjQXJyYXkucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICB0eXBlIDogdHlwZSwKICAgICAgICAgICAgICAgICAgICAgIHNyYyA6IG9iai5zdHJlYW1zLm1lZGl1bQogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIEFhay5sb2coc3JjQXJyYXksIEpTT04uc3RyaW5naWZ5KHNyY0FycmF5KSk7CiAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAvLyBpbml0aWFsaXplIG5ldyBwbGF5ZXIKICAgICAgICAgICAgICAgICAgQWFrLmFkZFNjcmlwdChBYWsuaW50b1N0cmluZyhmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgICAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBvblZqc1JlYWR5KCkgewogICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygd2luZG93LnZpZGVvanMgIT09ICdmdW5jdGlvbicpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uVmpzUmVhZHkoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LnZpZGVvanMoIm5vQWRQbGF5ZXIiKS5zcmMoL19TT1VSQ0VTXy8pOwogICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBvblZqc1JlYWR5KCk7CiAgICAgICAgICAgICAgICAgICAgICB9KSgpOwogICAgICAgICAgICAgICAgICAgIH0pLnJlcGxhY2UoIi9fU09VUkNFU18vIiwgSlNPTi5zdHJpbmdpZnkoc3JjQXJyYXkpKSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgIC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RwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8yNzQKICAgICAgICBob3N0IDogWydhbGxteXZpZGVvcy5uZXQnLCAnYW12dHYubmV0J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIC8vIHNraXAgZmFrZSBwbGF5IGJ1dHRvbgogICAgICAgICAgQWFrLnNldENvb2tpZSgnX2ZhdmJ0MzMnLCAxKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGlsaXZlX2RvbWFpbnMgOiB7CiAgICAgICAgaG9zdCA6IFsnaWxpdmUudG8nLCAnc3RyZWFtbGl2ZS50byddLAogICAgICAgIG9uRW5kIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgaWYgKC9eXC9lbWJlZHBsYXllci5waHAvaS50ZXN0KGxvY2F0aW9uLnBhdGhuYW1lKSkgewogICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAvLyBTa2lwIHRpbWVyCiAgICAgICAgICAgICAgQWFrLnV3LnJlbW92ZU92ZXJsYXlIVE1MKCk7CiAgICAgICAgICAgIH0sIDEwMDApOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgbWljYXN0X3R2IDogewogICAgICAgIGhvc3QgOiBbJ21pY2FzdC50diddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvLyBwcmV2ZW50IHBvcHVuZGVyCiAgICAgICAgICBBYWsuc2V0Q29va2llKCd2aWRfbWFpbicsIHRydWUpOwogICAgICAgICAgQWFrLnNldENvb2tpZSgndmlkX3N1YicsIHRydWUpOwogICAgICAgICAgLy8gcmVtb3ZlIG92ZXJsYXkKICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICB3aW5kb3cub25sb2FkID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgIGlmICh3aW5kb3cucmVtb3ZlT3ZlcmxheUhUTUwpCiAgICAgICAgICAgICAgICB3aW5kb3cucmVtb3ZlT3ZlcmxheUhUTUwoKTsKICAgICAgICAgICAgfTsKICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgfSwKICAgICAgcHhzdHJlYW1fdHYgOiB7CiAgICAgICAgaG9zdCA6IFsncHhzdHJlYW0udHYnXSwKICAgICAgICBvbkVuZCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIGlmICgvXlwvZW1iZWRyb3V0ZXIucGhwLy50ZXN0KGxvY2F0aW9uLnBhdGhuYW1lKSkgewogICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAvLyBTa2lwIHRpbWVyIGFuZCBjbG9zZSBhZHMKICAgICAgICAgICAgICBBYWsudXcuY2xvc2VBZCgpOwogICAgICAgICAgICB9LCAxMDAwKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIHNhd2xpdmVfdHYgOiB7CiAgICAgICAgaG9zdCA6IFsnc2F3bGl2ZS50diddLAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIGlmICgvXlwvZW1iZWRcL3dhdGNoXC8vaS50ZXN0KGxvY2F0aW9uLnBhdGhuYW1lKSkgewogICAgICAgICAgICAvLyBTa2lwIHRpbWVyIGFuZCBjbG9zZSBhZHMKICAgICAgICAgICAgQWFrLnV3LmRpc3BsYXkgPSBmYWxzZTsKICAgICAgICAgICAgQWFrLnV3LmNsb3NlTXlBZCgpOwogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSwKICAgICAgZ29vZGNhc3RfY28gOiB7CiAgICAgICAgaG9zdCA6IFsnZ29vZGNhc3QuY28nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBpZiAoL15cL3N0cmVhbS5waHAvLnRlc3QobG9jYXRpb24ucGF0aG5hbWUpKSB7CiAgICAgICAgICAgIC8vIHJlbW92ZSBhZHMgYWxsb3dlZCBieSBlYXN5bGlzdAogICAgICAgICAgICBBYWsudXcuJCgiLmFkdmVydGlzZW1lbnQiKS5oaWRlKCk7CiAgICAgICAgICAgIEFhay51dy4kKCcuYWRza3kgaWZyYW1lJykuYXR0cigic3JjIiwgImFib3V0OmJsYW5rIik7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9LAogICAgICBzaG93c3BvcnRfdHZfY29tIDogewogICAgICAgIGhvc3QgOiBbJ3Nob3dzcG9ydC10di5jb20nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBpZiAoL15cL2NoLnBocC8udGVzdChsb2NhdGlvbi5wYXRobmFtZSkpIHsKICAgICAgICAgICAgLy8gcmVtb3ZlIGFkcyBhbGxvd2VkIGJ5IGVhc3lsaXN0CiAgICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KCcjYWR2ZXJ0aXNlbWVudCwgLmFkdmVydGlzZW1lbnQnKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIHNoYXJlY2FzdF90byA6IHsKICAgICAgICBob3N0IDogWydzaGFyZWNhc3QudG8nXSwKICAgICAgICBvbklkbGUgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBpZiAoL15cL2VtYmVkLnBocC8udGVzdChsb2NhdGlvbi5wYXRobmFtZSkpIHsKCiAgICAgICAgICAgIC8vIERpc2FibGUgcG9wdW5kZXJzCiAgICAgICAgICAgIHZhciBpbnRlcnZhbCA9IHNldEludGVydmFsKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgIEFhay5zZXRDb29raWUoJ3ZpZF9tYWluJywgdHJ1ZSk7CiAgICAgICAgICAgICAgICBBYWsuc2V0Q29va2llKCd2aWRfc3ViJywgMik7CiAgICAgICAgICAgICAgICBBYWsuc2V0Q29va2llKCd2aWRfZGVsYXknLCB0cnVlKTsKICAgICAgICAgICAgICB9LCAxMDApOwoKICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgY2xlYXJJbnRlcnZhbChpbnRlcnZhbCk7CiAgICAgICAgICAgIH0sIDUwMDApOwoKICAgICAgICAgICAgLy8gUmVtb3ZlIHRyYW5zcGFyZW50IG92ZXJsYXkKICAgICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoJyN0YWJsZTEnKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0sCiAgICAgIHZpZGVvbWVnYV90diA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT12aWRlb21lZ2EKICAgICAgICBob3N0IDogWyd2aWRlb21lZ2EudHYnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgaWYgKC9eXC92aWV3LnBocC8udGVzdChsb2NhdGlvbi5wYXRobmFtZSkpIHsKICAgICAgICAgICAgLy8gcHJldmVudCBwb3B1bmRlcgogICAgICAgICAgICBBYWsuc2V0Q29va2llKCd2aWRfbWFpbnB1JywgdHJ1ZSk7CiAgICAgICAgICAgIEFhay5zZXRDb29raWUoJ3ZpZF9zdWJwdScsIHRydWUpOwogICAgICAgICAgICBBYWsuc2V0Q29va2llKCd2aWRfZGVsYXknLCB0cnVlKTsKICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIG9uRW5kIDogZnVuY3Rpb24gKCkgewogICAgICAgICAgLy8ga2lsbCBhYmMKICAgICAgICAgIC8vIGZpeCBidWcgb24gZmlyZWZveDogVGhlIHZpZGVvIGNvdWxkIG5vdCBiZSBsb2FkZWQsIGVpdGhlciBiZWNhdXNlIHRoZSBzZXJ2ZXIgb3IgbmV0d29yayBmYWlsZWQgb3IgYmVjYXVzZSB0aGUgZm9ybWF0IGlzIG5vdCBzdXBwb3J0Z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WIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXM/cT1sYWJlbDpSM1oKICAgICAgICAvLyBzb3VyY2U6IGh0dHA6Ly9wYXN0ZWJpbi5jb20vQzE1OWtldm4KICAgICAgICBob3N0IDogWydjaXR5YW0uY29tJywgJ2NvbXB1dGVyd29ybGR1ay5jb20nLCAndGVjaHdvcmxkLmNvbScsICd2My5jby51ayddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAvKiBkb24ndCB3b3JrIHdpdGggY2hyb21lCiAgICAgICAgICBPYmplY3QuZGVmaW5lUHJvcGVydHkoQWFrLnV3LCAnX3IzeicsIHsKICAgICAgICAgICAgZW51bWVyYWJsZSA6IHRydWUsCiAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgIHZhbHVlIDoge30KICAgICAgICAgIH0pOwogICAgICAgICAgKi8KICAgICAgICB9LAogICAgICAgIG9uSWRsZSA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay51dy4kKCIjcjN6LXdhaXQiKS5yZW1vdmUoKTsKICAgICAgICAgIEFhay51dy4kKCIucjN6LWhpZGUiKS5yZW1vdmVDbGFzcygicjN6LWhpZGUiKTsKICAgICAgICAgIEFhay51dy5fcjN6ID0gbnVsbDsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGdvb2dsZV9qb2JydW5uZXIgOiB7CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ3JlYXN5Zm9yay5vcmcvZW4vZm9ydW0vbWVzc2FnZXMvNDA1CiAgICAgICAgLy8gaXNzdWU6IGh0dHBzOi8vZ2l0aHViLmNvbS9yZWVrL2FudGktYWRibG9jay1raWxsZXIvaXNzdWVzLzEzNDMKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvMTM0MgogICAgICAgIC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mdhc3Byb2plY3QubmV0LmJyJywgJ21hbmdhcy56bHguY29tLmJyJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5mYWtlRnVja0FkQmxvY2soJ21hbmdhc0xlaXRvclNsaWRlcicsIEFhay5nZW5lcmF0ZUlEKCkpOwogICAgICAgIH0KICAgICAgfSwKICAgICAgZmFiX3FuaW1hdGVfY29tIDogewogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy83MzkKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvNzA1CiAgICAgICAgLy8gbm90ZTogZnVja2FkYmxvY2sgY3VzdG9taXplZAogICAgICAgIGhvc3QgOiBbJ3FuaW1hdGUuY29tJ10sCiAgICAgICAgb25BbHdheXMgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuYWRCbG9ja0RldGVjdGVkID0gZnVuY3Rpb24gKCkge307CiAgICAgICAgfQogICAgICB9LAogICAgICBmYWJfZXVyb3RyYW5zcG9ydF9kZSA6IHsKICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvODU4CiAgICAgICAgLy8gbm90ZTogZnVja2FkYmxvY2sgd2l0aCBjdXN0b20gaW5zdGFuY2UgbmFtZQogICAgICAgIGhvc3QgOiBbJ2V1cm90cmFuc3BvcnQuZGUnXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24gKCkgewogICAgICAgICAgQWFrLmZha2VGdWNrQWRCbG9jaygnYW50aUFkQmxvY2snLCBBYWsuZ2VuZXJhdGVJRCgpKTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGZhYl9jYWRldGVjdCA6IHsKICA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l0cmlwcy5jb20nXSwKICAgICAgICBvblN0YXJ0IDogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgIHZhciBfc2V0QXR0cmlidXRlID0gd2luZG93LkVsZW1lbnQucHJvdG90eXBlLnNldEF0dHJpYnV0ZTsKICAgICAgICAgICAgICB3aW5kb3cuRWxlbWVudC5wcm90b3R5cGUuc2V0QXR0cmlidXRlID0gZnVuY3Rpb24gKG5hbWUsIHZhbHVlKSB7CiAgICAgICAgICAgICAgICBpZiAobmFtZSA9PSAnY2xhc3MnICYmIHZhbHVlLmluZGV4T2YoJ3RleHRfYWRzJykgIT0gLTEpIHsKICAgICAgICAgICAgICAgICAgdmFsdWUgPSAnJzsKICAgICAgICAgICAgICAgICAgY29uc29sZS5pbmZvKHRoaXMsICdmYWIgaW50ZXJjZXB0ZWQgOi0pJyk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBfc2V0QXR0cmlidXRlLmNhbGwodGhpcywgbmFtZSwgdmFsdWUpOwogICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGQzeHQzZXJfYW50aWFkYmxvY2sgOiB7CiAgICAgICAgLy8gc2l0ZTogaHR0cDovL2QzeHQzci5jb20vYW50aS1hZGJsb2NrCiAgICAgICAgLy8gY2FzZTogaHR0cDovL3Nwb3J0LXNob3cuZnIvanMvYWR2ZXJ0aXNlbWVudC1BZEJsb2NrLmpzCiAgICAgICAgLy8gY2FzZTogaHR0cDovL3d3dy4yc2l0ZS5tZS9hZHZlcnRpc2VtZW50LUFkQmxvY2suanMKICAgICAgICBob3N0IDogWydzcG9ydC1zaG93LmZyJywgJ3ZpcGZsYXNoLm5ldCcsICcyc2l0ZS5tZSddLAogICAgICAgIG9uU3RhcnQgOiB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ogWydteWJhbmsucGwnLCAncmFwaWRncmFiLnBsJ10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgIHZhciBfYWRkRXZlbnRMaXN0ZW5lciA9IHdpbmRvdy5hZGRFdmVudExpc3RlbmVyOwogICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyID0gZnVuY3Rpb24gKHR5cGUsIGxpc3RlbmVyLCBvcHRpb25zKSB7CiAgICAgICAgICAgICAgICBpZiAobGlzdGVuZXIudG9TdHJpbmcoKS5pbmRleE9mKCcubmV4dEZ1bmN0aW9uKCl9JykgPiAtMSkgewogICAgICAgICAgICAgICAgICBsaXN0ZW5lciA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmluZm8oWydBbnRpQWRiS2lsbGVyJywgbG9jYXRpb24uaG9zdCwgJ0FudGlCbG9ja3tjdXN0b21pemVkfSddKTsKICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIF9hZGRFdmVudExpc3RlbmVyLmNhbGwodGhpcywgdHlwZSwgbGlzdGVuZXIsIG9wdGlvbnMpOwogICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGJsb2NrYWRibG9jayA6IHsKICAgICAgICAvLyBzaXRlOiBibG9ja2FkYmxvY2suY29tCiAgICAgICAgLy8gbm90ZTogcmFuZG9tIGluc3RhbmNlIG5hbWUKICAgICAgICAvLyBzb3VyY2U6IGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL1dhdGlsaW4vYWY3NWUwYTJlODJhMmVmYjM4NGJkZTljN2I0MWRlYzgKICAgICAgICAvLyBpc3N1ZXM6IGh0dHBzOi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mV0J10sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgIEFhay5hZGRTY3JpcHQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAvLyB2YXJpYW50IDEKICAgICAgICAgICAgKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICB2YXIgX3NldFRpbWVvdXQgPSB3aW5kb3cuc2V0VGltZW91dDsKICAgICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dCA9IGZ1bmN0aW9uIChmbiwgZGVsYXkpIHsKICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKGZuLnRvU3RyaW5nKCkpCiAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGZuID09PSAnc3RyaW5nJyAmJiBmbi5pbmRleE9mKCdiYWJfZWxlbWVudGlkJykgPiAtMSkgewogICAgICAgICAgICAgICAgICBmbiA9IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmluZm8oWydBbnRpQWRiS2lsbGVyJywgbG9jYXRpb24uaG9zdCwgJ0Jsb2NrQWRCbG9jayddKTsKICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIF9zZXRUaW1lb3V0LmNhbGwodGhpcywgZm4sIGRlbGF5KTsKICAgICAgICAgICAgICB9OwogICAgICAgICAgICB9KSgpOwogICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICB9LAogICAgICBncHRfc3AgOiB7CiAgICAgICAgLy8gYnk6IFJlZWssIEdpd2F5dW1lCiAgICAgICAgLy8gbm90ZTogd2hlbiBhZGJsb2NrIGRldGVjdGVkIGluamVjdCBuZXcgYWRzLCByZWRpcmVjdCB0byBodHRwOi8vdGlueXVybC5jb20venEyejVvNgogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8xNjM2CiAgICAgICAgLy8gaXNzdWU6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gICAgICAgICAgdmFsdWUgOiBmdW5jdGlvbiAoKSB7fSwKICAgICAgICAgICAgICAgIHdyaXRhYmxlIDogZmFsc2UsCiAgICAgICAgICAgICAgICBjb25maWd1cmFibGUgOiBmYWxzZQogICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgIC8vIFJlZWsKICAgICAgICAgICAgICB2YXIgX2FkZEV2ZW50TGlzdGVuZXIgPSB3aW5kb3cuRXZlbnRUYXJnZXQucHJvdG90eXBlLmFkZEV2ZW50TGlzdGVuZXI7CiAgICAgICAgICAgICAgd2luZG93LkV2ZW50VGFyZ2V0LnByb3RvdHlwZS5hZGRFdmVudExpc3RlbmVyID0gZnVuY3Rpb24gKHR5cGUsIGxpc3RlbmVyLCBvcHRpb25zKSB7CiAgICAgICAgICAgICAgICBpZiAodHlwZSA9PSAnc3AuYmxvY2tpbmcnKSB7CiAgICAgICAgICAgICAgICAgIGxpc3RlbmVyID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIGNvbnNvbGUuaW5mbyhbJ0FudGlBZGJLaWxsZXInLCBsb2NhdGlvbi5ob3N0LCAnR1BUe3NwLWJsb2NraW5nfSddKTsKICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIF9hZGRFdmVudExpc3RlbmVyLmNhbGwodGhpcywgdHlwZSwgbGlzdGVuZXIsIG9wdGlvbnMpOwogICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0pKCk7CiAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGtydXhfYXNsIDogewogICAgICAgIC8vIG5vdGU6IHdoZW4gYWRibG9jayBkZXRlY3RlZCBpbmplY3QgbmV3IGFkcwogICAgICAgIC8vIHNvdXJjZTogaHR0cDovL3Bhc3RlYmluLmNvbS8wSEQ3Tjg0aQogICAgICAgIGhvc3QgOiBbJ2NvbW1lbnRjYW1hcmNoZS5uZXQnLCAnam91cm5hbGRlc2ZlbW1lcy5jb20nLCAnbGludGVybmF1dGUuY29tJ10sCiAgICAgICAgb25CZWZvcmVTY3JpcHQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICByZXR1cm4gW3sKICAgICAgICAgICAgICBkZXRlY3RlZCA6ICdLcnV4e2FzbH0nLAogICAgICAgICAgICAgIGNvbnRhaW5zIDogJ0FzbC5wcm90b3R5cGUuaW5qZWN0JywKICAgICAgICAgICAgICBleHRlcm5hbCA6IGZhbHNlLAogICAgICAgICAgICAgIHJlbW92ZSA6IHRydWUKICAgICAgICAgICAgfQogICAgICAgICAgXTsKICAgICAgICB9CiAgICAgIH0sCiAgICAgIGtydXhfYWRwIDogewogICAgICAgIC8vIG5vdGU6IHdoZW4gYWRibG9jayBkZXRlY3RlZCBpbmplY3QgbmV3IGFkcwogICAgICAgIC8vIHNvdXJjZTogCiAgICAgICAgaG9zdCA6IFsnZm91cmNoZXR0ZS1ldC1iaWtpbmkuZnInLCAnbWV0ZW9jaXR5LmNvbSddLAogICAgICAgIG9uU3RhcnQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICBBYWsudXcuYWRQcm90ZWN0ID0gMTsKICAgICAgICB9CiAgICAgIH0sCSAKICAgICAgcGhvZW5peF9nb3lhdmVsYWIgOiB7CiAgICAgICAgLy8gbm90ZTogd2hlbiBhZGJsb2NrIGRldGVjdGVkIGluamVjdCBuZXcgYWRzCiAgICAgICAgLy8gbm90ZTogc2NyaXB0IGFudGktYWRibG9jayBvYmZ1c2NhdGVkLAogICAgICAgIC8vIGlzc3VlOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcy8KICAgICAgICAvLyBkb2M6IGh0dHA6Ly90aW55dXJsLmNvbS9nbDNnaHEyCiAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL2hzQW1kU3VmCiAgICAgICAgaG9zdCA6IFsnZGVtby1waG9lbml4LmNvbScsICdkcHN0cm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ICdjb211bmlvLmRlJywgJ21lZGlzaXRlLmZyJ10sCiAgICAgICAgb25CZWZvcmVTY3JpcHQgOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICByZXR1cm4gW3sKICAgICAgICAgICAgICBkZXRlY3RlZCA6ICdBZERlZmVuZHt1YWJJbmplY3R9JywKICAgICAgICAgICAgICBjb250YWlucyA6ICd1YWJJbmplY3QnLAogICAgICAgICAgICAgIGV4dGVybmFsIDogZmFsc2UsCiAgICAgICAgICAgICAgcmVtb3ZlIDogdHJ1ZQogICAgICAgICAgICB9CiAgICAgICAgICBdOwogICAgICAgIH0KICAgICAgfSwKICAgICAgLyogc29sdmVkIGJ5IEFha0xJc3QKICAgICAgdGlzb29taV9pbmRpcmVrdCA6IHsKICAgICAgLy8gaW5saW5lOiBodHRwOi8vcGFzdGViaW4uY29tL25wbVhUVUh3CiAgICAgIC8vIGV4dGVybmFsOiBodHRwOi8vcGFzdGViaW4uY29tL2h2V25DdUR3CiAgICAgIGhvc3QgOiBbJ2VuZXJneS5kZScsICdnZXR2aWRzLmRlJywgJ2dld2luZGUtbm9ybWVuLmRlJywgJ3BvZGNhc3QuZGUnLCAnc3BpZWxlc3BpZWxlbjI0LmRlJywgJ2RpYWxvLmRlJ10sCiAgICAgIG9uQmVmb3JlU2NyaXB0IDogZnVuY3Rpb24gKGUpIHsKICAgICAgdmFyIHRhcmdldCA9IGUudGFyZ2V0IHx8IGUuc3JjRWxlbWVudDsKICAgICAgdmFyIHRleHQgPSB0YXJnZXQudGV4dDsKICAgICAgaWYgKEFhay5jb250YWlucyh0ZXh0LCAnbj0iYWJjZGVmZ2hpamtsbSIscj0ibm9wcXJzdHV2d3h5eiIsaT0iMDEyMzQ1Njc4OSI7dmFyIHM9dD09MD9pOnQ9PTE/bicpKSB7CiAgICAgIEFhay5zdG9wU2NyaXB0KGUpOwogICAgICBBYWsubG9nKCdUaXNvb21pIEluZGlyZWt0Jyk7CiAgICAgIH0KICAgICAgfQogICAgICB9LAogICA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92ZWROb2RlKSB7CiAgICAgICAgICBpZiAoQWFrLm9wdHMucmVtb3ZlZCkgewogICAgICAgICAgICBpZiAocmVtb3ZlZE5vZGUuc3JjIHx8CiAgICAgICAgICAgICAgcmVtb3ZlZE5vZGUuaWQgfHwKICAgICAgICAgICAgICByZW1vdmVkTm9kZS5jbGFzc05hbWUgJiYKICAgICAgICAgICAgICAhL15maXJlYnVnLy50ZXN0KHJlbW92ZWROb2RlLmNsYXNzTmFtZSkpIHsKICAgICAgICAgICAgICAvLyBOb2RlIHJlbW92ZWQKICAgICAgICAgICAgICBBYWsubG9nKHJlbW92ZWROb2RlKTsKICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgb25TdGFydCA6IGZ1bmN0aW9uICgpIHsKCiAgICAgICAgICAvLyBGdWNrQWRCbG9jayAmIEJsb2NrQWRCbG9jayB2MyBhbmQgdjQKICAgICAgICAgIC8vIHNpdGU6IGh0dHA6Ly93d3cuc2l0ZXh3LmZyL2Z1Y2thZGJsb2NrLwogICAgICAgICAgLy8gcmVwbzogaHR0cHM6Ly9naXRodWIuY29tL3NpdGV4dy9GdWNrQWRCbG9jawogICAgICAgICAgLy8gcmVwbzogaHR0cHM6Ly9naXRodWIuY29tL3NpdGV4dy9CbG9ja0FkQmxvY2sKICAgICAgICAgIC8vIG5vdGU6IHdoZW4gZnVja2FkYmxvY2suanMgb3IgYmxvY2thZGJsb2NrLmpzIGlzIGJsb2NrZWQKICAgICAgICAgIC8vIGRlbW8gdjM6IGh0dHA6Ly9zaC5zdC92b3ZIRQogICAgICAgICAgLy8gZGVtbyB2NDogaHR0cDovL2FsLmx5L3FCYlhICiAgICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvODg4CiAgICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWt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gICAgIC8vIGRlbW86IGh0dHA6Ly90aW55dXJsLmNvbS9uaHlocHprCiAgICAgICAgICB2YXIgc3R5bGVzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnc3R5bGUnKTsKICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3R5bGVzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIHZhciBzdHlsZSA9IHN0eWxlc1tpXTsKICAgICAgICAgICAgdmFyIGNzc1J1bGVzID0gc3R5bGUuc2hlZXQuY3NzUnVsZXM7CiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgY3NzUnVsZXMubGVuZ3RoOyBqKyspIHsKICAgICAgICAgICAgICB2YXIgY3NzUnVsZSA9IGNzc1J1bGVzW2pdOwogICAgICAgICAgICAgIHZhciBjc3NUZXh0ID0gY3NzUnVsZS5jc3NUZXh0OwogICAgICAgICAgICAgIHZhciBwYXR0ZXJuID0gL14jKFthLXowLTldezQsMTB9KSB+IFwqIFx7IGRpc3BsYXk6IG5vbmU7IFx9LzsKICAgICAgICAgICAgICBpZiAocGF0dGVybi50ZXN0KGNzc1RleHQpKSB7CiAgICAgICAgICAgICAgICB2YXIgaWQgPSBwYXR0ZXJuLmV4ZWMoY3NzVGV4dClbMV07CiAgICAgICAgICAgICAgICBpZiAoQWFrLmhhc1NjcmlwdCgidy5hZGRFdmVudExpc3RlbmVyKCdsb2FkJywiICsgaWQgKyAiLGZhbHNlKSIpKSB7CiAgICAgICAgICAgICAgICAgIEFhay5hYWJzLmFibzIgPSBpZDsKICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CgogICAgICAgICAgdmFyIHdpbiA9IEFhay51dzsKICAgICAgICAgIGZvciAodmFyIHByb3AgaW4gd2luKSB7CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgaWYgKCEvXndlYmtpdC8udGVzdChwcm9wKSAmJiAvXlthLXowLTldezQsMTJ9JC9pLnRlc3QocHJvcCkgJiYgcHJvcCAhPT0gJ2RvY3VtZW50JyAmJiAod2luW3Byb3BdaW5zdGFuY2VvZiBIVE1MRG9jdW1lbnQpID09PSBmYWxzZSAmJiB3aW4uaGFzT3duUHJvcGVydHkocHJvcCkgJiYgdHlwZW9mIHdpbltwcm9wXSA9PT0gJ29iamVjdCcpIHsKICAgICAgICAgICAgICAgIHZhciBtZXRob2QgPSB3aW5bcHJvcF07CgogICAgICAgICAgICAgICAgLy8gQW50aWJsb2NrLm9yZyB2MyAmIEJldHRlclN0b3BBZGJsb2NrCiAgICAgICAgICAgICAgICAvLyBpc3N1ZTogaHR0cHM6Ly9naXRodWIuY29tL3JlZWsvYW50aS1hZGJsb2NrLWtpbGxlci9pc3N1ZXMvODMzCiAgICAgICAgICAgICAgICBpZiAobWV0aG9kLmRlZmVyRXhlY3V0aW9uICYmCiAgICAgICAgICAgICAgICAgIG1ldGhvZC5kaXNwbGF5TWVzc2FnZSAmJgogICAgICAgICAgICAgICAgICBtZXRob2QuZ2V0RWxlbWVudEJ5ICYmCiAgICAgICAgICAgICAgICAgIG1ldGhvZC5nZXRTdHlsZSAmJgogICAgICAgICAgICAgICAgICBtZXRob2QuaW5zZXJ0ICYmCiAgICAgICAgICAgICAgICAgIG1ldGhvZC5uZXh0RnVuY3Rpb24pIHsKICAgICAgICAgICAgICAgICAgaWYgKG1ldGhvZC50b2dnbGUpIHsKICAgICAgICAgICAgICAgICAgICBBYWsuYWFicy5ic2EgPSBwcm9wOwogICAgICAgICAgICAgICAgICAgIEFhay5kZXRlY3RlZCgnQmV0dGVyU3RvcEFkYmxvY2t7ZG9tfScpOwogICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIEFhay5hYWJzLmFibzMgPSBwcm9wOwogICAgICAgICAgICAgICAgICAgIEFhay5kZXRlY3RlZCgnQW50aWJsb2NrM3tkb219Jyk7CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgd2luW3Byb3BdID0gbnVsbDsgLy8ga2lsbCBpbnN0YW5jZQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIC8vIEJsb2NrQWRCbG9jawogICAgICAgICAgICAgICAgLy8gc2l0ZTogYmxvY2thZGJsb2NrLmNvbQogICAgICAgICAgICAgICAgLy8gbm90ZTogcmFuZG9tIGluc3RhbmNlIG5hbWUKICAgICAgICAgICAgICAgIC8vIHNvdXJjZTogaHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vV2F0aWxpbi9hZjc1ZTBhMmU4MmEyZWZiMzg0YmRlOWM3YjQxZGVjOAogICAgICAgICAgICAgICAgLy8gaXNzdWVzOiBodHRwczovL2dpdGh1Yi5jb20vcmVlay9hbnRpLWFkYmxvY2sta2lsbGVyL2lzc3Vlcz9xPWxhYmVsJTNBQmxvY2tBZEJsb2NrCiAgICAgICAgICAgICAgICBpZiAobWV0aG9kLmJhYikgeyAvLyB2YXJpYW50IDEKICAgICAgICAgICAgICAgICAgQWFrLmRldGVjdGVkKCdCbG9ja0FkQmxvY2t7ZG9tOnZhcmlhbnQxfScpOwogICAgICAgICAgICAgICAgICB3aW5bcHJvcF0gPSBudWxsOwogICAgICAgICAgICAgICAgfSBlbHNlIGlmIChPYmplY3Qua2V5cyhtZXRob2QpLmxlbmd0aCA9PT0gMyAmJiBPYmplY3Qua2V5cyhtZXRob2QpLm1hcChmdW5jdGlvbiAodmFsdWUsIGluZGV4KSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZhbHVlOwogICAgICAgICAgICAgICAgICB9KS5qb2luKCkubGVuZ3RoID09PSAzMikgeyAvLyB2YXJpYW50IDIKICAgICAgICAgICAgICAgICAgQWFrLmRldGVjdGVkKCdCbG9ja0FkQmxvY2t7ZG9tOnZhcmlhbnQyfScpOwogICAgICAgICAgICAgICAgICB3aW5bcHJvcF0gPSBudWxsOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgIC8vY29uc29sZS5sb2coJ2Vycm9yJywgcHJvcCkKICAgICAgICAgICAgfQogICAgICAgICAgfQoKICAgICAgICAgIC8vIEFudGktQWRibG9ja2VycwogICAgICAgICAgdmFyIGFhYnMgPSB7CiAgICAgICAgICAgIC8vIFBsdWdpbnMgV29yZFByZXNzCiAgICAgICAgICAgIE5vQWRCbG9jayA6ICcoL3BsdWdpbnMvbm8tYWRibG9jay98L2Jsb2NrQmxvY2svYmxvY2tCbG9jay5qcXVlcnkuanMpJywKICAgICAgICAgICAgQmV0dGVyU3RvcEFkYmxvY2sgOiAnKC9wbHVnaW5zL2JldHRlci1zdG9wLWFkYmxvY2svfGJzYS1zY3JpcHQtZG9jdHlwZS5qc3xic2Etc2NyaXB0LW5vLWRvY3R5cGUuanMpJywKICAgICAgICAgICAgQWRCbG9ja0Jsb2NrZXIgOiAnL3BsdWdpbnMvd29yZHByZXNzLWFkYmxvY2stYmxvY2tlci8nLAogICAgICAgICAgICBBbnRpQmxvY2tCdWtzc2FBeW1hbiA6ICcvcGx1Z2lucy9hbnRpLWJsb2NrLycsCiAgICAgICAgICAgIEJsb2NrQWx5emVyIDogJy9wbHVnaW5zL2Jsb2NrYWx5emVyLWFkYmxvY2stY291bnRlci8nLAogICAgICAgICAgICBBZEJsb2NraW5nRGV0ZWN0b3IgOiAnL3BsdWdpbnMvYWQtYmxvY2tpbmctZGV0ZWN0b3IvJywKICAgICAgICAgICAgLy8gUGx1Z2lucyBXZWJzaXRlCiAgICAgICAgICAgIEFkd29ya21lZGlhIDogJyhhZHdvcmttZWRpYXxsb3h0a3xjb250ZW50bG9ja2luZ25ldHdvcmtzKS5jb20vZ0xvYWRlci5waHAnLAogICAgICAgICAgICBBZHNjZW5kbWVkaWEgOiAnYWRzY2VuZG1lZGlhLmNvbS9nd2pzLnBocCcsCiAgICAgICAgICAgIEZ1Y2tBZEJsb2NrIDogJygvZnVja2FkYmxvY2suanN8L2Jsb2NrYWRibG9jay5qcyknLAogICAgICAgICAgICBqUXVlcnlBZEJsb2NrIDogJy9qcXVlcnkuYWRibG9jay5qcycsCiAgICAgICAgICAgIGpRdWVyeUFkYmxvY2tEZXRlY3RvciA6ICcvanF1ZXJ5LmFkYmxvY2stZGV0ZWN0b3IuanMnLAogICAgICAgICAgICBBZEJsb2NrQWR2ZXJ0aXNlbWVudCA6ICcvYWR2ZXJ0aXNlbWVudC5qcycsCiAgICAgICAgICAgIEFkQmxvY2tBZHZlcnQgOiAnL2FkdmVydC5qcycsCiAgICAgICAgICAgIEFkQmxvY2tBZHZDdXN0b20gOiAnL2FkdmVydGlzZW1lbnQoLispLmpzJywKICAgICAgICAgICAgQWRCbG9ja0FkZnJhbWUgOiAnL2FkZnJhbWUuanMnLAogICAgICAgICAgICBBbnRpQWRCdXN0ZXIgOiAnL2FudGktYWQtYnVzdGVyLmpzJywKICAgICAgICAgICAgUlRLQW50aUFkYmxvY2sgOiAnL2Jsb2NrY2FrZS5qcycsCiAgICAgICAgICAgIEFkYmxvY2tEZXRlY3RvciA6ICcvQWRibG9ja0RldGVjdG9yL2hhbmRsZXIubWluLmpzJywKICAgICAgICAgICAgalF1ZXJ5QW50aUFkc0Jsb2NrIDogJy9qcXVlcnkuYW50aWFkc2Jsb2NrLmpzJywKICAgICAgICAgICAgQWRidWRkeSA6ICcvanMvYWRidWRkeS5taW4uanMnLAogICAgICAgICAgICBBbnRpQURzQmxvY2tlciA6ICcvYWFkYi9zY3JpcHQuanMnCiAgICAgICAgICB9OwoKICAgICAgICAgIHZhciBzY3JpcHRzID0gZG9jdW1lbnQuc2NyaXB0czsKICAgICAgICAgIGZvciAodmFyIHkgPSAwOyB5IDwgc2NyaXB0cy5sZW5ndGg7IHkrKykgewogICAgICAgICAgICB2YXIgc2NyaXB0ID0gc2NyaXB0c1t5XTsKICAgICAgICAgICAgaWYgKHNjcmlwdC5zcmMpIHsKICAgICAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gYWFicykgewogICAgICAgICAgICAgICAgaWYgKG5ldyBSZWdFeHAoYWFic1trZXldLCAnaScpLnRlc3Qoc2NyaXB0LnNyYykpIHsKICAgICAgICAgICAgICAgICAgQWFrLmRldGVjdGVkKFtrZXksIHNjcmlwdC5zcmNdKTsKICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICB9CgogICAgICAgIH0sCiAgICAgICAgb25JbnNlcnQgOiBmdW5jdGlvbiAoaW5zZXJ0ZWROb2RlKSB7CgogICAgICAgICAgLy8gQWxsIE5vZGVzCiAgICAgICAgICBpZiAoQWFrLm9wdHMuaW5zZXJ0ZWQpIHsKICAgICAgICAgICAgaWYgKGluc2VydGVkTm9kZS5zcmMgfHwKICAgICAgICAgICAgICBpbnNlcnRlZE5vZGUuaWQgfHwKICAgICAgICAgICAgICBpbnNlcnRlZE5vZGUuY2xhc3NOYW1lICYmCiAgICAgICAgICAgICAgIS9maXJlYnVnLy50ZXN0KGluc2VydGVkTm9kZS5pbm5lckhUTUwpKSB7CiAgICAgICAgICAgICAgLy8gTm9kZSBpbnNlcnRlZAogICAgICAgICAgICAgIEFhay5sb2coaW5zZXJ0ZWROb2RlKTsKICAgICAgICAgICAgfQogICAgICAgICAgfQoKICAgICAgICAgIC8vIE5vLUFkYmxvY2sgLSBodHRwOi8vd3d3Lm5vLWFkYmxvY2suY29tLwogICAgICAgICAgaWYgKGluc2VydGVkTm9kZS5pZCAmJgogICAgICAgICAgICBpbnNlcnRlZE5vZGUuaWQubGVuZ3RoID09IDQgJiYKICAgICAgICAgICAgL15bYS16MC05XXs0fSQvLnRlc3QoaW5zZXJ0ZWROb2RlLmlkKSAmJgogICAgICAgICAgICBpbnNlcnRlZE5vZGUubm9kZU5hbWUgPT0gJ0RJVicgJiYKICAgICAgICAgICAgaW5zZXJ0ZWROb2RlLmZpcnN0Q2hpbGQgJiYKICAgICAgICAgICAgaW5zZXJ0ZWROb2RlLmZpcnN0Q2hpbGQuaWQgJiYKICAgICAgICAgICAgaW5zZXJ0ZWROb2RlLmZpcnN0Q2hpbGQuaWQgPT0gaW5zZXJ0ZWROb2RlLmlkICYmCiAgICAgICAgICAgIEFhay5jb250YWlucyhpbnNlcnRlZE5vZGUuaW5uZXJIVE1MLCAnbm8tYWRibG9jay5jb20nKSkgewogICAgICAgICAgICAvLyBSZW1vdmUKICAgICAgICAgICAgQWFrLmRldGVjdGVkKCdOby1BZGJsb2NrJywgZmFsc2UsIGxvY2F0aW9uLmhyZWYpOwogICAgICAgICAgICBBYWsucmVtb3ZlRWxlbWVudChpbnNlcnRlZE5vZGUpOwogICAgICAgICAgICAvL0Fhay5sb2coaW5zZXJ0ZWROb2RlKTsKICAgICAgICAgIH0KCiAgICAgICAgICAvLyBTdG9wQWRibG9jayAtIGh0dHA6Ly9zdG9wYWRibG9jay5vcmcvZG93bmxvYWRzLwogICAgICAgICAgaWYgKGluc2VydGVkTm9kZS5pZCAmJgogICAgICAgICAgICBpbnNlcnRlZE5vZGUuaWQubGVuZ3RoID09IDcgJiYKICAgICAgICAgICAgL15hW2EtejAtOV17Nn0kLy50ZXN0KGluc2VydGVkTm9kZS5pZCkgJiYKICAgICAgICAgICAgaW5zZXJ0ZWROb2RlLm5vZGVOYW1lID09ICdESVYnICYmCiAgICAgICAgICAgIGluc2VydGVkTm9kZS5wYXJlbnROb2RlICYmCiAgICAgICAgICAgIGluc2VydGVkTm9kZS5wYXJlbnROb2RlLmlkICYmCiAgICAgICAgICAgIGluc2VydGVkTm9kZS5wYXJlbnROb2RlLmlkID09IGluc2VydGVkTm9kZS5pZCArICcyJyAmJgogICAgICAgICAgICBBYWsuY29udGFpbnMoaW5zZXJ0ZWROb2RlLmlubmVySFRNTCwgJ3N0b3BhZGJsb2NrLm9yZycpKSB7CiAgICAgICAgICAgIC8vIFJlbW92ZQogICAgICAgICAgICBBYW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GJsb2NrUGFja2VyWmR4ZCcsIGZhbHNlLCBsb2NhdGlvbi5ocmVmKTsKICAgICAgICAgICAgfSAvLyBWYXJpYW50IDIKICAgICAgICAgICAgZWxzZSBpZiAoaW5zZXJ0ZWROb2RlLmlkID09ICdnZCcpIHsKICAgICAgICAgICAgICBBYWsuZGV0ZWN0ZWQoJ0FudGlBZGJsb2NrUGFja2VyV2RnZCcsIGZhbHNlLCBsb2NhdGlvbi5ocmVmKTsKICAgICAgICAgICAgfQogICAgICAgICAgICAvLyBSZW1vdmUKICAgICAgICAgICAgLy9BYWsubG9nKGluc2VydGVkTm9kZSk7CiAgICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KGluc2VydGVkTm9kZSk7CiAgICAgICAgICB9CgogICAgICAgICAgLy8gQWR1bmJsb2NrIC0gaHR0cDovL2FkdW5ibG9jay5jb20vCiAgICAgICAgICB2YXIgcmVJZCA9IC9eW2Etel17OH0kLzsKICAgICAgICAgIHZhciByZUNsYXNzID0gL15bYS16XXs4fSBbYS16XXs4fS87CiAgICAgICAgICB2YXIgcmVCZyA9IC9eW2Etel17OH0tYmckLzsKICAgICAgICAgIHZhciByZU1lc3NhZ2UgPSAvSWwgc2VtYmxlcmFpdCBxdWUgdm91cyB1dGlsaXNpZXogdW4gYmxvcXVldXIgZGUgcHVibGljaXTDqSAhLzsKCiAgICAgICAgICAvLyBDb21tdW5zCiAgICAgICAgICBpZiAodHlwZW9mIEFhay51dy52dGZhYiAhPSAndW5kZWZpbmVkJyAmJgogICAgICAgICAgICB0eXBlb2YgQWFrLnV3LmFkYmxvY2tfYW50aWIgIT0gJ3VuZGVmaW5lZCcgJiYKICAgICAgICAgICAgaW5zZXJ0ZWROb2RlLnBhcmVudE5vZGUgJiYKICAgICAgICAgICAgaW5zZXJ0ZWROb2RlLnBhcmVudE5vZGUubm9kZU5hbWUgPT0gJ0JPRFknICYmCiAgICAgICAgICAgIGluc2VydGVkTm9kZS5pZCAmJgogICAgICAgICAgICByZUlk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XJ0ZWROb2RlLm5leHRTaWJsaW5nKTsgLy8gb3ZlcmxheQogICAgICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KGluc2VydGVkTm9kZSk7IC8vIGJveAogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vIFRvcCBiYXIgTWVzc2FnZSAoRnJlZSkKICAgICAgICAgICAgLy8gPGRpdiBpZD0idml4bWdybHkiPgogICAgICAgICAgICAvLyA8ZGl2IGlkPSJtZm5oYWl5eCIgY2xhc3M9Imxrcm52Ynl0Ij4KICAgICAgICAgICAgZWxzZSBpZiAoaW5zZXJ0ZWROb2RlLm5leHRTaWJsaW5nLmlkICYmCiAgICAgICAgICAgICAgcmVJZC50ZXN0KGluc2VydGVkTm9kZS5uZXh0U2libGluZy5pZCkgJiYKICAgICAgICAgICAgICByZU1lc3NhZ2UudGVzdChpbnNlcnRlZE5vZGUuaW5uZXJIVE1MKSkgewoKICAgICAgICAgICAgICAvLyBSZW1vdmUgTWVzc2FnZQogICAgICAgICAgICAgIEFhay5kZXRlY3RlZCgiQWRVbkJsb2NrRnJlZSIpOwogICAgICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KGluc2VydGVkTm9kZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgIH0KCiAgICAgICAgICAvLyBBbnRpYmxvY2sgLSBodHRwOi8vYW50aWJsb2NrLm9yZy8KICAgICAgICAgIHZhciByZU1zZ0lkID0gL15bYS16MC05XXs0LDEwfSQvaTsKICAgICAgICAgIHZhciByZVRhZzEgPSAvXihkaXZ8c3BhbnxifGl8Zm9udHxzdHJvbmd8Y2VudGVyKSQvaTsKICAgICAgICAgIHZhciByZVRhZzIgPSAvXihhfGJ8aXxzfHV8cXxwfHN0cm9uZ3xjZW50ZXIpJC9pOwogICAgICAgICAgdmFyIHJlV29yZHMxID0gL2FkIGJsb2NrZXJ8YWQgYmxvY2t8YWQtYmxvY2t8YWRibG9ja2VyfGFkLWJsb2NrZXJ8YWRibG9ja3xibG9xdWV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NlcnRlZE5vZGUuZmlyc3RDaGlsZC5jbGFzc05hbWUgJiYKICAgICAgICAgICAgcmVNc2dJZC50ZXN0KGluc2VydGVkTm9kZS5pZCkgJiYKICAgICAgICAgICAgcmVUYWcxLnRlc3QoaW5zZXJ0ZWROb2RlLm5vZGVOYW1lKSAmJgogICAgICAgICAgICByZVRhZzIudGVzdChpbnNlcnRlZE5vZGUuZmlyc3RDaGlsZC5ub2RlTmFtZSkpIHsKICAgICAgICAgICAgLy9BYWsubG9nKGluc2VydGVkTm9kZSk7CgogICAgICAgICAgICAvLyBLaWxsIGF1ZGlvIG1lc3NhZ2UKICAgICAgICAgICAgdmFyIGF1ZGlvID0gaW5zZXJ0ZWROb2RlLnF1ZXJ5U2VsZWN0b3IoImF1ZGlvW2xvb3BdIik7CiAgICAgICAgICAgIGlmIChhdWRpbykgewogICAgICAgICAgICAgIGF1ZGlvLnBhdXNlKCk7CiAgICAgICAgICAgICAgQWFrLmRldGVjdGVkKCdBbnRpYmxvY2t7YXVkaW99Jyk7CiAgICAgICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoYXVkaW8pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vIEFudGlibG9jay5vcmcgdjIKICAgICAgICAgICAgLy8gZGVtbzogaHR0cDovL3Rpbnl1cmwuY29tL2gzbXd0YTQKICAgICAgICAgICAgZWxzZSBpZiAoKEFhay5hYWJzLmFibzIgJiYgaW5zZXJ0ZWROb2RlLmlkID09IEFhay5hYWJzLmFibzIpIHx8CiAgICAgICAgICAgICAgKGluc2VydGVkTm9kZS5maXJzdENoaWxkLmhhc0NoaWxkTm9kZXMoKSAmJiByZVdvcmRzMS50ZXN0KGluc2VydGVkTm9kZS5maXJzdENoaWxkLmlubmVySFRNTCkgJiYgcmVXb3JkczIudGVzdChpbnNlcnRlZE5vZGUuZmlyc3RDaGlsZC5pbm5lckhUTUwpKSkgewogICAgICAgICAgICAgIEFhay5kZXRlY3RlZCgnQW50aWJsb2NrMntpbnNlcnR9Jyk7CiAgICAgICAgICAgICAgQWFrLnJlbW92ZUVsZW1lbnQoaW5zZXJ0ZWROb2RlKTsKICAgICAgICAgICAgfQogICAgICAgICAgICAvLyBBbnRpYmxvY2sub3JnIHYzCiAgICAgICAgICAgIC8vIGRlbW86IGh0dHA6Ly90aW55dXJsLmNvbS9xZWNmYTd3CiAgICAgICAgICAgIC8vIGNhc2U6IGh0dHA6Ly90aW55dXJsLmNvbS96YnJscjNhIC8qIGZvcmsgKi8KICAgICAgICAgICAgZWxzZSBpZiAoKEFhay5hYWJzLmFibzMgJiYgaW5zZXJ0ZWROb2RlLmlkID09IEFhay5hYWJzLmFibzMpIHx8CiAgICAgICAgICAgICAgKGluc2VydGVkTm9kZS5maXJzdENoaWxkLmhhc0NoaWxkTm9kZXMoKSAmJiBpbnNlcnRlZE5vZGUuZmlyc3RDaGlsZC5maXJzdENoaWxkLm5vZGVOYW1lID09ICdJTUcnICYmIC9eZGF0YTppbWFnZVwvcG5nO2Jhc2U2NC8udGVzdChpbnNlcnRlZE5vZGUuZmlyc3RDaGlsZC5maXJzdENoaWxkLnNyYykpKSB7CiAgICAgICAgICAgICAgQWFrLnV3W0Fhay5hYWJzLmFibzNdID0gbnVsbDsKICAgICAgICAgICAgICBBYWsuZGV0ZWN0ZWQoJ0FudGlibG9jazN7aW5zZXJ0fScpOwogICAgICAgICAgICAgIEFhay5yZW1vdmVFbGVtZW50KGluc2VydGVkTm9kZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gQmV0dGVyU3RvcEFkYmxvY2sKICAgICAgICAgICAgLy8gZGVtbzogaHR0cDovL3Rpbnl1cmwuY29tL2pzOXphdDQKICAgICAgICAgICAgLy8gc291cmNlOiBodHRwOi8vcGFzdGViaW4uY29tL1lpbWtydEtCCiAgICAgICAgICAgIC8vIGlzc3VlOiBodHRwOi8vdGlueXVybC5jb20vemV0Z2J0eAogICAgICAgICAgICBlbHNlIGlmIChBYWsuYWFicy5ic2EgJiYga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C5wbCIsICJhZ2FyLmlvIiwgInBhbmRvb24uaW5mbyIsICJmc2Yub3JnIiwgImFkYmxvY2twbHVzLm9yZyIsICJwbG5rci5jbyIsICJleGFjdHRhcmdldC5jb20iLCAiZG9sbGRpdmluZS5jb20iLCAicG9wbWVjaC5ydSIsICJjYWxtLmNvbSJdOwogICAgICB2YXIgaG9zdCA9IGxvY2F0aW9uLmhvc3Q7CiAgICAgIHZhciBleGNsdWRlZCA9IGZhbHNlOwogICAgICBleGNsdWRlcy5mb3JFYWNoKGZ1bmN0aW9uIChleGNsdWRlKSB7CiAgICAgICAgaWYgKG5ldyBSZWdFeHAoZXhjbHVkZSkudGVzdChob3N0KSkgewogICAgICAgICAgZXhjbHVkZWQgPSB0cnVlOwogICAgICAgICAgaWYgKEFhay5vcHRzLmxvZ0V4Y2x1ZGVkKSB7CiAgICAgICAgICAgIEFhay53YXJuKCdFeGNsdWRlZCcpOwogICAgICAgICAgfQogICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgIH0KICAgICAgfSk7CgogICAgICAvLyBJbmNsdWRlIGRvbWFpbnMKICAgICAgLy8gSXNFdmVudHVwcG9ydGVkOiBodHRwOi8vdGlueXVybC5jb20vb2VlejhjNwogICAgICBpZiAoIWV4Y2x1ZGVkKSB7CgogICAgICAgIHZhciBoYW5kbGVyRXZlbnRzID0gZnVuY3Rpb24gKCkgewogICAgICAgICAgdmFyIHJ1bGUgPSBBYWsucnVsZXNbbmFtZV07CgogICAgICAgICAgcnVsZS5ob3N0LmZvckVhY2goZnVuY3Rpb24gKGhvc3QpIHsKICAgICAgICAgICAgLy8gQ2hlY2sgaG9zdAogICAgICAgICAgICBpZiAobmV3IFJlZ0V4cChob3N0KS50ZXN0KGxvY2F0aW9uLmhvc3QpKSB7CgogICAgICAgICAgICAgIC8vIE5hdGl2ZSBtb2RlCiAgICAgICAgICAgICAgaWYgKCFBYWsudXNlR00gJiYgQWFrLmlzVG9wZnJhbWUpIHsKICAgICAgICAgICAgICAgIEFhay53YXJuKCdSdW4gbmF0aXZlbHkuJyk7CiAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAvLyBMb2cgcnVsZSB1c2VkCiAgICAgICAgICAgICAgaWYgKHJ1bGUuaG9zdFswXSAhPSAnLio/JykgewogICAgICAgICAgICAgICAgQWFrLmRldGVjdGVkKCdydWxlJywgcnVsZSk7CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIAogICAgICAgICAgICAgIC8vIEJlZm9yZSBET00gbG9hZAogICAgICAgICAgICAgIGlmIChydWxlLm9uU3RhcnQpIHsKICAgICAgICAgICAgICAgIHJ1bGUub25TdGFydCgpOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAvLyBPbiBhbGwgc3RhdGVtZW50cwogICAgICAgICAgICAgIGlmIChydWxlLm9uQWx3YXlzKSB7CiAgICAgICAgICAgICAgICBydWxlLm9uQWx3YXlzKCk7IC8vIHN0YXJ0CiAgICAgICAgICAgICAgICBBYWsub25FdmVudCh3aW5kb3csICdET01Db250ZW50TG9hZGVkJywgcnVsZS5vbkFsd2F5cyk7IC8vIGlkbGUKICAgICAgICAgICAgICAgIEFhay5vbkV2ZW50KHdpbmRvdywgJ2xvYWQnLCBydWxlLm9uQWx3YXlzKTsgLy8gZW5kCiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIC8vIEJlZm9yZSBTY3JpcHQgRXhlY3V0ZWQKICAgICAgICAgICAgICBpZiAocnVsZS5vbkJlZm9yZVNjcmlwdCkgewoKICAgICAgICAgICAgICAgIC8vIG9wdGlvbnM6IGNvbnRhaW5zLCBzZWFyY2gsIHJlcGxhY2UsIG92ZXJyaWRlLCByZW1vdmUsIGV4dGVybmFsCiAgICAgICAgICAgICAgICB2YXIgb3B0aW9uc0JlZm9yZVNjcmlwdCA9IHJ1bGUub25CZWZvcmVTY3JpcHQoKTsKICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygb3B0aW9uc0JlZm9yZVNjcmlwdCA9PSAib2JqZWN0IikgewoKICAgICAgICAgICAgICAgICAgdmFyIGhhbmRsZXJCZWZvcmVTY3JpcHQgPSBmdW5jdGlvbiAoZSwgb3B0aW9ucykgewogICAgICAgICAgICAgICAgICAgIHZhciBpc0V2ZW50ID0gZSBpbnN0YW5jZW9mIHdpbmRvdy5FdmVudDsKICAgICAgICAgICAgICAgICAgICB2YXIgdGhpc1NjcmlwdCA9IChlLnRhcmdldCB8fCBlLnNyY0VsZW1lbnQpIHx8IGU7CgogICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuZm9yRWFjaChmdW5jdGlvbiAobykgeyAvLyBoYXNBdHRyaWJ1dGUKICAgICAgICAgICAgICAgICAgICAgIHZhciBzcmMgPSBvLmV4dGVybmFsID8gJ3NyYycgOiAnaW5uZXJIVE1MJzsKICAgICAgICAgICAgICAgICAgICAgIHZhciBzZWFyY2ggPSBuZXcgUmVnRXhwKG8uY29udGFpbnMsIG8uZmxhZ3MgfHwgJycpOwoKICAgICAgICAgICAgICAgICAgICAgIGlmICh0aGlzU2NyaXB0W3NyY10gJiYgdGhpc1NjcmlwdFtzcmNdLmxlbmd0aCAmJiBzZWFyY2gudGVzdCh0aGlzU2NyaXB0W3NyY10pKSB7CgogICAgICAgICAgICAgICAgICAgICAgICAvLyBTdG9wIHNjcmlwdCBleGVjdXRpb24KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzRXZlbnQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgZS5zdG9wUHJvcGFnYXRpb24oKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIG5ldyBzY3JpcHQKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhcmVudCA9IHRoaXNTY3JpcHQucGFyZW50Tm9kZTsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5ld1NjcmlwdCA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ3NjcmlwdCcpOwoKICAgICAgICAgICAgICAgICAgICAgICAgLy8gUmVwbGFjZSBhIHBhcnQgb2YgdGhlIHNjcmlwdAogICAgICAgICAgICAgICAgICAgICAgICBpZiAoby5yZXBsYWNlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3U2NyaXB0W3NyY10gPSB0aGlzU2NyaXB0W3NyY10ucmVwbGFjZShzZWFyY2gsIG8ucmVwbGFjZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50LnJlcGxhY2VDaGlsZChuZXdTY3JpcHQsIHRoaXNTY3JpcHQpOwogICAgICAgICAgICAgICAgICAgICAgICB9IC8vIE92ZXJyaWRlIHNjcmlwdAogICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChvLm92ZXJyaWRlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3U2NyaXB0W3NyY10gPSBvLm92ZXJyaWRlOwogICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudC5yZXBsYWNlQ2hpbGQobmV3U2NyaXB0LCB0aGlzU2NyaXB0KTsKICAgICAgICAgICAgICAgICAgICAgICAgfSAvLyBSZW1vdmUgc2NyaXB0CiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG8ucmVtb3ZlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50LnJlbW92ZUNoaWxkKHRoaXNTY3JpcHQpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICBpZiAoby5kZXRlY3RlZCkgewogICAgICAgICAgICAgICAgICAgICAgICAgIEFhay5kZXRlY3RlZChvLmRldGVjdGVkKTsKICAgICAgICAgICAgICAgICAgICAgICAgfQkJCQkJCQoKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFhay5vcHRzLmxvZ0ludGVyY2VwdGVkU2NyaXB0cykgewogICAgICAgICAgICAgICAgICAgICAgICAgIEFhay5sb2coc3JjLCBvLCB0aGlzU2NyaXB0LCBuZXdTY3JpcHQpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgIH07CgogICAgICAgICAgICAgICAgICAvLyBCcm93c2VyIHN1cHBvcnRpbmcgZXZlbnQgYmVmb3Jlc2NyaXB0ZXhlY3V0ZQogICAgICAgICAgICAgICAgICBpZiAoJ29uYmVmb3Jlc2NyaXB0ZXhlY3V0ZScgaW4gZG9jdW1lbnQpIHsKICAgICAgICAgICAgICAgICAgICBBYWsub25FdmVudCh3aW5kb3csICdiZWZvcmVzY3JpcHRleGVjdXRlJywgZnVuY3Rpb24gKGUpIHsKICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZXJCZWZvcmVTY3JpcHQoZSwgb3B0aW9uc0JlZm9yZVNjcmlwdCk7CiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8vIEJyb3dzZXIgbm90IHN1cHBvdGluZyBiZWZvcmVzY3JpcHRleGVjdXRlCgogICAgICAgICAgICAgICAgICAgIHZhciBsb2FkRG9jdW1lbnQgPSBmdW5jdGlvbiAob3B0aW9uc0JlZm9yZVNjcmlwdCkgewogICAgICAgICAgICAgICAgICAgICAgLy9pZiAoZG9jdW1lbnQucmVmZXJyZXIgPT09ICcnKQogICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm47CgogICAgICAgICAgICAgICAgICAgICAgQWFrLndhcm4oJ29uYmVmb3Jlc2NyaXB0LWNvbXBhdGlibGUnKTsKCiAgICAgICAgICAgICAgICAgICAgICAvLyBTdG9wIGxvYWRpbmcKICAgICAgICAgICAgICAgICAgICAgIEFhay5hZGRTY3JpcHQoJ3dpbmRvdy5zdG9wKCk7Jyk7IC8vIGNocm9tZS9vcGVyYQogICAgICAgICAgICAgICAgICAgICAgLy9BYWsuYWRkU2NyaXB0KCdkb2N1bWVudC5vcGVuKCk7Jyk7IC8vIGZpcmVmb3gKCiAgICAgICAgICAgICAgICAgICAgICAvLyBHZXQgY29udGVudAogICAgICAgICAgICAgICAgICAgICAgQWFrLnJlcXVlc3QoewogICAgICAgICAgICAgICAgICAgICAgICB1cmwgOiBsb2NhdGlvbi5ocmVmLAogICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzIDogewogICAgICAgICAgICAgICAgICAgICAgICAgICJSZWZlcmVyIiA6IGRvY3VtZW50LnJlZmVycmVyCiAgICAgICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICAgICAgICAgIG9ubG9hZCA6IGZ1bmN0aW9uIChyZXN1bHQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IHJlc3VsdC5yZXNwb25zZVRleHQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBhcnNlciA9IG5ldyB3aW5kb3cuRE9NUGFyc2VyKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGRvYyA9IHBhcnNlci5wYXJzZUZyb21TdHJpbmcoaHRtbCwgInRleHQvaHRtbCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBzY3JpcHRzID0gZG9jLnNjcmlwdHM7CgogICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc2NyaXB0cy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRoaXNTY3JpcHQgPSBzY3JpcHRzW2ldOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFuZGxlckJlZm9yZVNjcmlwdCh0aGlzU2NyaXB0LCBvcHRpb25zQmVmb3JlU2NyaXB0KTsKICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgIC8vIENvbnZlcnQgdG8gc3RyaW5nCiAgICAgICAgICAgICAgICAgICAgICAgICAgaHRtbCA9IGRvYy5kb2N1bWVudEVsZW1lbnQub3V0ZXJIVE1MOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXcml0ZSBuZXcgY29udGVudCB0byBIVE1MIGRvY3VtZW50OgogICAgICAgICAgICAgICAgICAgICAgICAgIEFhay5hZGRTY3JpcHQoJ2RvY3VtZW50Lm9wZW4oKTsgZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoIicgKyB3aW5kb3cuZXNjYXBlKGh0bWwpICsgJyIpKTsgZG9jdW1lbnQuY2xvc2UoKTsnKTsgLy8gY2hyb21lL29wZXJhCiAgICAgICAgICAgICAgICAgICAgICAgICAgLy9BYWsuYWRkU2NyaXB0KCdkb2N1bWVudC53cml0ZSh1bmVzY2FwZSgiJyArIGVzY2FwZShodG1sKSArICciKSk7IGRvY3VtZW50LmNsb3NlKCk7Jyk7IC8vIGZpcmVmb3gKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICBsb2FkRG9jdW1lbnQob3B0aW9uc0JlZm9yZVNjcmlwdCk7CiAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9IC8vIEFmdGVyIFNjcmlwdCBFeGVjdXRlZAogICAgICAgICAgICAgIGlmIChydWxlLm9uQWZ0ZXJTY3JpcHQpIHsKICAgICAgICAgICAgICAgIGlmICgnb25hZnRlcnNjcmlwdGV4ZWN1dGUnIGluIGRvY3VtZW50KSB7IC8vIE1vemlsbGEgRmlyZWZveAogICAgICAgICAgICAgICAgICBBYWsub25FdmVudCh3aW5kb3csICdhZnRlcnNjcmlwdGV4ZWN1dGUnLCBydWxlLm9uQWZ0ZXJTY3JpcHQpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAvLyBXaGVuIERPTSBMb2FkCiAgICAgICAgICAgICAgaWYgKHJ1bGUub25JZGxlKSB7CiAgICAgICAgICAgICAgICBpZiAoIUFhay51c2VHTSkgeyAvLyBOYXRpdmUgbW9kZQogICAgICAgICAgICAgICAgICBydWxlLm9uSWRsZSgpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgLy9BYWsub25FdmVudCh3aW5kb3csICdET01Db250ZW50TG9hZGVkJywgcnVsZS5vbklkbGUpOwogICAgICAgICAgICAgICAgICBBYWsub25FdmVudCh3aW5kb3csICdET01Db250ZW50TG9hZGVkJywgcnVsZS5vbklkbGUpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAvLyBXaGVuIFdpbmRvdyBMb2FkCiAgICAgICAgICAgICAgaWYgKHJ1bGUub25FbmQpIHsKICAgICAgICAgICAgICAgIGlmICghQWFrLnVzZUdNKSB7IC8vIE5hdGl2ZSBtb2RlCiAgICAgICAgICAgICAgICAgIHJ1bGUub25FbmQoKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgIEFhay5vbkV2ZW50KHdpbmRvdywgJ2xvYWQnLCBydWxlLm9uRW5kKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgLy8gV2hlbiBET00gQXR0ck1vZGlmaWVkCiAgICAgICAgICAgICAgaWYgKHJ1bGUub25BdHRyTW9kaWZpZWQpIHsKICAgICAgICAgICAgICAgIEFhay5vbkV2ZW50KHdpbmRvdywgJ0RPTUF0dHJNb2RpZmllZCcsIHJ1bGUub25BdHRyTW9kaWZpZWQsIGZhbHNlKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgLy8gV2hlbiBET00gU3VidHJlZU1vZGlmaWVkCiAgICAgICAgICAgICAgaWYgKHJ1bGUub25TdWJ0cmVlTW9kaWZpZWQpIHsKICAgICAgICAgICAgICAgIEFhay5vbkV2ZW50KHdpbmRvdywgJ0RPTVN1YnRyZWVNb2RpZmllZCcsIHJ1bGUub25TdWJ0cmVlTW9kaWZpZWQsIGZhbHNlKTsKICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgLy8gV2hlbiBET00gRWxlbWVudHMgYXJlIEluc2VydGVkIGluIERvY3VtZW50CiAgICAgICAgICAgICAgaWYgKHJ1bGUub25JbnNlcnQpIHsKCiAgICAgICAgICAgICAgICAvLyBNdXRhdGlvbiBPYnNlcnZlcgogICAgICAgICAgICAgICAgLy8gZG9jOiBodHRwOi8vdGlueXVybC5jb20vbXh4emVlNAogICAgICAgICAgICAgICAgLy8gc3VwcG9ydDogaHR0cDovL3Rpbnl1cmwuY29tL25lcG43dnkKICAgICAgICAgICAgICAgIGlmICh0eXBlb2Ygd2luZG93Lk11dGF0aW9uT2JzZXJ2ZXIgIT0gJ3VuZGVmaW5lZCcgfHwKICAgICAgICAgICAgICAgICAgdHlwZW9mIFdlYktpdE11dGF0aW9uT2JzZXJ2ZXIgIT0gJ3VuZGVmaW5lZCcpIHsKCiAgICAgICAgICAgICAgICAgIC8vIE11dGF0aW9uIE9ic2VydmVyCiAgICAgICAgICAgICAgICAgIHZhciBNdXRhdGlvbk9ic2VydmVyMSA9IHdpbmRvdy5NdXRhdGlvbk9ic2VydmVyIHx8IHdpbmRvdy5XZWJLaXRNdXRhdGlvbk9ic2VydmVyOwoKICAgICAgICAgICAgICAgICAgLy8gQ3JlYXRlIGFuIG9ic2VydmVyIGluc3RhbmNlCiAgICAgICAgICAgICAgICAgIHZhciBvYnMxID0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIxKGZ1bmN0aW9uIChtdXRhdGlvbnMpIHsKICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGNhbiBzYWZlbHkgdXNlIGBmb3JFYWNoYCBiZWNhdXNlIHdlIGFscmVhZHkgdXNlIG11dGF0aW9uCiAgICAgICAgICAgICAgICAgICAgICAvLyBvYnNlcnZlcnMgdGhhdCBhcmUgbW9yZSByZWNlbnQgdGhhbiBgZm9yRWFjaGAuIChzb3VyY2U6IE1ETikKICAgICAgICAgICAgICAgICAgICAgIG11dGF0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uIChtdXRhdGlvbikgewogICAgICAgICAgICAgICAgICAgICAgICAvLyB3ZSB3YW50IG9ubHkgYWRkZWQgbm9kZXMKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG11dGF0aW9uLmFkZGVkTm9kZXMubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXkucHJvdG90eXBlLmZvckVhY2guY2FsbChtdXRhdGlvbi5hZGRlZE5vZGVzLCBmdW5jdGlvbiAoYWRkZWROb2RlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQWFrLm9wdHMubG9nSW5zZXJ0ZWROb2RlcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBYWsubG9nKGFkZGVkTm9kZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlLm9uSW5zZXJ0KGFkZGVkTm9kZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAvLyBPYnNlcnZlcgogICAgICAgICAgICAgICAgICBvYnMxLm9ic2VydmUoZG9jdW1lbnQsIHsKICAgICAgICAgICAgICAgICAgICBjaGlsZExpc3QgOiB0cnVlLAogICAgICAgICAgICAgICAgICAgIHN1YnRyZWUgOiB0cnVlCiAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy8gTXV0YXRpb24gRXZlbnRzIChBbHRlcm5hdGl2ZSBTb2x1dGlvbikKICAgICAgICAgICAgICAgIC8vIGRvYzogaHR0cDovL3Rpbnl1cmwuY29tL29wOTVyZnkKICAgICAgICAgICAgICAgIGVsc2UgewogICAgICAgICAgICAgICAgICBBYWsub25FdmVudCh3aW5kb3csICJET01Ob2RlSW5zZXJ0ZWQiLCBmdW5jdGlvbiAoZSkgewogICAgICAgICAgICAgICAgICAgIGlmIChBYWsub3B0cy5sb2dJbnNlcnRlZE5vZGVzKSB7CiAgICAgICAgICAgICAgICAgICAgICBBYWsubG9nKGUudGFyZ2V0KTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcnVsZS5vbkluc2VydChlLnRhcmdldCk7CiAgICAgICAgICAgICAgICAgIH0sIGZhbHNlKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgLy8gV2hlbiBET00gRWxlbWVudHMgYXJlIFJlbW92ZWQgaW4gRG9jdW1lbnQKICAgICAgICAgICAgICBpZiAocnVsZS5vblJlbW92ZSkgewoKICAgICAgICAgICAgICAgIC8vIE11dGF0aW9uIE9ic2VydmVyCiAgICAgICAgICAgICAgICAvLyBkb2M6IGh0dHA6Ly90aW55dXJsLmNvbS9teHh6ZWU0CiAgICAgICAgICAgICAgICAvLyBzdXBwb3J0OiBodHRwOi8vdGlueXVybC5jb20vbmVwbjd2eQogICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB3aW5kb3cuTXV0YXRpb25PYnNlcnZlciAhPSAndW5kZWZpbmVkJyB8fAogICAgICAgICAgICAgICAgICB0eXBlb2YgV2ViS2l0TXV0YXRpb25PYnNlcnZlciAhPSAndW5kZWZpbmVkJykgewoKICAgICAgICAgICAgICAgICAgLy8gTXV0YXRpb24gT2JzZXJ2ZXIKICAgICAgICAgICAgICAgICAgdmFyIE11dGF0aW9uT2JzZXJ2ZXIyID0gd2luZG93Lk11dGF0aW9uT2JzZXJ2ZXIgfHwgd2luZG93LldlYktpdE11dGF0aW9uT2JzZXJ2ZXI7CgogICAgICAgICAgICAgICAgICAvLyBDcmVhdGUgYW4gb2JzZXJ2ZXIgaW5zdGFuY2UKICAgICAgICAgICAgICAgICAgdmFyIG9iczIgPSBuZXcgTXV0YXRpb25PYnNlcnZlcjIoZnVuY3Rpb24gKG11dGF0aW9ucykgewogICAgICAgICAgICAgICAgICAgICAgLy8gV2UgY2FuIHNhZmVseSB1c2UgYGZvckVhY2hgIGJlY2F1c2Ugd2UgYWxyZWFkeSB1c2UgbXV0YXRpb24KICAgICAgICAgICAgICAgICAgICAgIC8vIG9ic2VydmVycyB0aGF0IGFyZSBtb3JlIHJlY2VudCB0aGFuIGBmb3JFYWNoYC4gKHNvdXJjZTogTUROKQogICAgICAgICAgICAgICAgICAgICAgbXV0YXRpb25zLmZvckVhY2goZnVuY3Rpb24gKG11dGF0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlIHdhbnQgb25seSByZW1vdmVkIG5vZGVzCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtdXRhdGlvbi5yZW1vdmVkTm9kZXMubGVuZ3RoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXkucHJvdG90eXBlLmZvckVhY2guY2FsbChtdXRhdGlvbi5yZW1vdmVkTm9kZXMsIGZ1bmN0aW9uIChyZW1vdmVkTm9kZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFhay5vcHRzLmxvZ1JlbW92ZWROb2RlcykgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBYWsubG9nKHJlbW92ZWROb2RlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGUub25SZW1vdmUocmVtb3ZlZE5vZGUpOwogICAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgLy8gT2JzZXJ2ZXIKICAgICAgICAgICAgICAgICAgb2JzMi5vYnNlcnZlKGRvY3VtZW50LCB7CiAgICAgICAgICAgICAgICAgICAgY2hpbGRMaXN0IDogdHJ1ZSwKICAgICAgICAgICAgICAgICAgICBzdWJ0cmVlIDogdHJ1ZQogICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC8vIE11dGF0aW9uIEV2ZW50cyAoQWx0ZXJuYXRpdmUgU29sdXRpb24pCiAgICAgICAgICAgICAgICAvLyBkb2M6IGh0dHA6Ly90aW55dXJsLmNvbS9vcDk1cmZ5CiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgQWFrLm9uRXZlbnQod2luZG93LCAiRE9NTm9kZVJlbW92ZWQiLCBmdW5jdGlvbiAoZSkgewogICAgICAgICAgICAgICAgICAgIGlmIChBYWsub3B0cy5sb2dSZW1vdmVkTm9kZXMpIHsKICAgICAgICAgICAgICAgICAgICAgIEFhay5sb2coZS50YXJnZXQpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBydWxlLm9uUmVtb3ZlKGUudGFyZ2V0KTsKICAgICAgICAgICAgICAgICAgfSwgZmFsc2UpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAKICAgICAgICAgICAgICAvLyBBYWsgRXZlbnRzCiAgICAgICAgICAgICAgQWFrLm9uRXZlbnQod2luZG93LCAnZGV0ZWN0ZWQnLCBmdW5jdGlvbiAoZSkgewogICAgICAgICAgICAgICAgQWFrLmluZm8oWydBbnRpQWRiS2lsbGVyJywgQWFrLmlzVG9wZnJhbWUgPyAndG9wZnJhbWUnIDogJ3N1YmZyYW1lJywgbG9jYXRpb24uaG9zdCwgZS5kZXRhaWxdKTsKICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfTsKCiAgICAgICAgLy8gQXBwbHkgcnVsZXMKICAgICAgICBmb3IgKHZhciBuYW1lIGluIEFhay5ydWxlcykgewogICAgICAgICAgaWYgKEFhay5ydWxlcy5oYXNPd25Qcm9wZXJ0eShuYW1lKSkgewogICAgICAgICAgICBoYW5kbGVyRXZlbnRzKEFhaywgbmFtZSk7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgfTsKCiAgQWFrLmluaXRpYWxpemUoKTsKCn0pKHdpbmRvdyk7"},{"name":"Fuck FuckAdBlock","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1506941148438,"data":{}},"enabled":true,"position":7,"file_url":"https://github.com/Mechazawa/FuckFuckAdblock/raw/master/FuckFuckAdBlock.user.js","uuid":"e268a8f8-788f-4fcd-9546-dd76fc2df327","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICAgICBGdWNrIEZ1Y2tBZEJsb2NrCi8vIEBhdXRob3IgICAgICAgICAgTWVjaGF6YXdhCi8vIEBuYW1lc3BhY2UgICAgICAgTWVjaGF6YXdhCi8vIEBkZXNjcmlwdGlvbiAgICAgQWN0cyBsaWtlIEZ1Y2tBZEJsb2NrLmpzIGJ1dCBhbHdheXMgc2F5cyB0aGF0IG5vIGFkYmxvY2sgd2FzIGRldGVjdGVkLgovLyBAbGljZW5zZSAgICAgICAgIFdURlBsCi8vIEB2ZXJzaW9uICAgICAgICAgNwovLyBAaW5jbHVkZSAgICAgICAgICoKLy8gQHJ1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YodmFsdWUgIT09IHVuZGVmaW5lZCkgewogICAgICAgICAgICAgICAgdmFyIGtleSA9IG9wdGlvbnM7CiAgICAgICAgICAgICAgICBvcHRpb25zID0ge307CiAgICAgICAgICAgICAgICBvcHRpb25zW2tleV0gPSB2YWx1ZTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgZm9yKHZhciBvcHRpb24gaW4gb3B0aW9ucykKICAgICAgICAgICAgICAgIHRoaXMuX29wdGlvbnNbb3B0aW9uXSA9IG9wdGlvbnNbb3B0aW9uXTsKCiAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgIH0sCgogICAgICAgIF9vcHRpb25zIDogewogICAgICAgICAgICBjaGVja09uTG9hZDogICAgdHJ1ZSwKICAgICAgICAgICAgcmVzZXRPbkVuZDogICAgIHRydWUsCiAgICAgICAgfSwKCiAgICAgICAgX3ZhciA6IHsKICAgICAgICAgICAgdHJpZ2dlcnM6IFtdCiAgICAgICAgfSwKCiAgICAgICAgY2hlY2sgOiBmdW5jdGlvbihpZ25vcmUpIHsKICAgICAgICAgICAgdGhpcy5lbWl0RXZlbnQoZmFsc2UpOwogICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICB9LAoKICAgICAgICBjbGVhckV2ZW50IDogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgIHRoaXMuX3Zhci50cmlnZ2VycyA9IFtdOwogICAgICAgIH0sCgogICAgICAgIGVtaXRFdmVudCA6IGZ1bmN0aW9uKGRldGVjdGVkKSB7CiAgICAgICAgICAgIGlmKGRldGVjdGVkID09PSBmYWxzZSkgewogICAgICAgICAgICAgICAgdmFyIGZucyA9IHRoaXMuX3Zhci50cmlnZ2VyczsKICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgZm5zLmxlbmd0aDsgaSArPSAxKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKGZuc1tpXSBpbnN0YW5jZW9mIEZ1bmN0aW9uKSB7IGZuc1tpXSgpOyB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZih0aGlzLl9vcHRpb25zLnJlc2V0T25FbmQgPT09IHRydWUpCiAgICAgICAgICAgICAgICAgICAgdGhpcy5jbGVhckV2ZW50KCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgfSwKCiAgICAgICAgb24gOiBmdW5jdGlvbihkZXRlY3RlZCwgZm4pIHsKICAgICAgICAgICAgaWYoZGV0ZWN0ZWQgPT09IGZhbHNlKQogICAgICAgICAgICAgICAgdGhpcy5fdmFyLnRyaWdnZXJzLnB1c2goZm4pOwogICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICB9LAoKICAgICAgICBvbkRldGVjdGVkIDogZnVuY3Rpb24oZm4pIHsKICAgICAgICAgICAgcmV0dXJuIHRoaXM7CiAgICAgICAgfSwKCiAgICAgICAgb25Ob3REZXRlY3RlZCA6IGZ1bmN0aW9uKGZuKSB7CiAgICAgICAgICAgIHJldHVybiB0aGlzLm9uKGZhbHNlLCBmbik7CiAgICAgICAgfQogICAgfTsKCiAgICB2YXIgZnVjayA9IG5ldyBGdWNrQWRCbG9jaygpOwogICAgZm9yICh2YXIgZmllbGQgaW4gZnVjaykgewogICAgICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShmdWNrLCBmaWVsZCwge3ZhbHVlOiBmdWNrW2ZpZWxkXSwgY29uZmlndXJhYmxlOiBmYWxzZX0pOwogICAgfQogICAgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMod2luZG93LCB7ZnVja0FkQmxvY2sgOiB7IHZhbHVlOiBmdWNrLCBlbnVtZXJhYmxlOiB0cnVlLCB3cml0YWJsZTogZmFsc2UgfX0pOwogICAgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMod2luZG93LCB7YmxvY2tBZEJsb2NrIDogeyB2YWx1ZTogZnVjaywgZW51bWVyYWJsZTogdHJ1ZSwgd3JpdGFibGU6IGZhbHNlIH19KTsKICAgIE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzKHdpbmRvdywge3NuaWZmQWRCbG9jayA6IHsgdmFsdWU6IGZ1Y2ssIGVudW1lcmFibGU6IHRydWUsIHdyaXRhYmxlOiBmYWxzZSB9fSk7CiAgICBPYmplY3QuZGVmaW5lUHJvcGVydGllcyh3aW5kb3csIHtkdWNrQWRCbG9jayA6IHsgdmFsdWU6IGZ1Y2ssIGVudW1lcmFibGU6IHRydWUsIHdyaXRhYmxlOiBmYWxzZSB9fSk7IAogICAgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMod2luZG93LCB7RnVja0Z1Y2tGdWNrQWRCbG9jayA6IHsgdmFsdWU6IGZ1Y2ssIGVudW1lcmFibGU6IHRydWUsIHdyaXRhYmxlOiBmYWxzZSB9fSk7Cn0pKHdpbmRvdyk7Cg=="},{"name":"Google Hit Hider by Domain (Search Filter / Block Sites)","options":{"check_for_updates":true,"compat_foreach":false,"compat_metadata":false,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":["http*://www.google.com/recaptcha/*","https://www.startpage.com/*/ads?*"],"orig_includes":["http*://www.google.*/*","http*://www.google.co*.*/*","http*://news.google.*/*","http*://encrypted.google.*/*","http*://startpage.com/*","http*://*.startpage.com/*","http*://duckduckgo.com/*","http*://start.duckduckgo.com/*","http*://safe.duckduckgo.com/*","http*://3g2upl4pq6kufc4m.onion/*","http*://www.bing.com/*","http*://*search.yahoo.com/*","http*://search.yahoo.co.jp/*","http*://www.yandex.com/*","http*://yandex.com/*","http*://searx.*/*","http*://www.qwant.com/*","http*://www.qwantjunior.com/*","http*://www.baidu.com/*","https://www.ecosia.org/search*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1638798126723,"data":{"ghhprefs":"s{\"shownotc\":[\"N\",\"Show hit notices(Y|N)\"],\"mngpaneopen\":[\"Y-N\",\"Persistence enabled(Y|N),Pane was open(Y|N),Last tab number(1-4)\"],\"mngbtnstyle\":[\"both-ifrN-R-P-Y-H\",\"Display Manage Hiding button and Block buttons(mng|blk|both),In iframes(ifrN|ifrY),Position(R,T,B),Block button display(P,M),Block button tooltips(Y|N), Block button position(H|C)\"],\"addtolistpos\":[\"sort\",\"Where to add new hits to block lists(end|top|sort)\"],\"aggressiveblock\":[\"none\",\"Which domains to default to shorter form(none|all|www)\"],\"usemutation\":[\"on-Y\",\"Listen for mutation events(on|off),Use DOM4 Mutation Observer(Y|N)\"],\"oneclick\":[\"Y-N\",\"One-click blocking(Y|N),Goes to Perma-ban(Y|N)\"],\"runbeta\":[\"N\",\"Enable incompletely tested features (Y|N)\"],\"reserved2\":[\"X\",\"Y\"]}","hideyhosts":"s|0daymusic.org:t|aminoapps.com:t|animeron.org:t|bqhv.peres-testeurs.fr:t|codepen.io:t|curved.de:t|de-film.com:t|de.toluna.com:t|de.vapormo.com:t|dersnotherinab.ml:t|digit-markt.com:t|dinoflix.de:t|dpqf.francedesign-international.fr:t|enginehour.com:t|example.com:t|formayorchavo.com:t|forum.frag-mutti.de:t|heimporno.com:t|hiphopforum.sk:t|howtodeletemy.com:t|icudelirium.nl:t|iguk.jeremw.fr:t|ilikevideo24.com:t|kaminarisubs.net:t|keekoom.com:t|keepvid.com:t|lensthefipho.ml:t|lifehacker.com:t|me.me:t|movie-blog.mrunlock.space:t|movie-blog.unblockproject.icu:t|movieworld.unblocksite.in:t|oltj.francasaisne.fr:t|one-hit01.wixsite.com:t|paradacreativa.es:t|patisserie-conte31.fr:t|payment-mts.site:t|popart-designs.fr:t|share-online-premium.biz:t|site1go.com:t|smallbusiness.chron.com:t|suesswaren.com:t|tipps.computerbild.de:t|trackallstatus.com:t|wp-kurs.com:t|ww5.soul-anime.us:t|www.0dayvinyls.org:t|www.anime2you.de:t|www.autobild.de:t|www.bierbasis.de:t|www.clip.fail:t|www.down.io:t|www.fansub-info.de:t|www.filediva.com:t|www.ftphd.net:t|www.qobuz.com:t|www.staidws.ga:t|www.startfenster.de:t|www.stlfinder.com:t|www.torrentkitty.tv:t|www.vlc.de:t|xbmp.sp-ressources.fr:t|younglady.live:t|yus4m7q2.dns04.com:t|zeag.locationpralognan.fr:t|zippydownload.co.pl:t|"}},"enabled":true,"position":8,"file_url":"https://greasyfork.org/scripts/1682-google-hit-hider-by-domain-search-filter-block-sites/code/Google%20Hit%20Hider%20by%20Domain%20(Search%20Filter%20%20Block%20Sites).user.js","uuid":"54959cac-d512-4d4f-894c-775dd87fffb7","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIEdvb2dsZSBIaXQgSGlkZXIgYnkgRG9tYWluIChTZWFyY2ggRmlsdGVyIC8gQmxvY2sgU2l0ZXMpCi8vIEBhdXRob3IgICAgICBKZWZmZXJzb24gImpzY2hlcjIwMDAiIFNjaGVyCi8vIEBuYW1lc3BhY2UgICBKZWZmZXJzb25TY2hlcgovLyBAdmVyc2lvbiAgICAgMi4yLjIKLy8gQGNvcHlyaWdodCAgIENvcHlyaWdodCAyMDIyIEplZmZlcnNvbiBTY2hlcgovLyBAbGljZW5zZSAgICAgQlNELTMtQ2xhdXNlCi8vIEBkZXNjcmlwdGlvbiBCbG9jayB1bndhbnRlZCBzaXRlcyBmcm9tIHlvdXIgR29vZ2xlLCBEdWNrRHVja0dvLCBTdGFydHBhZ2UuY29tLCBCaW5nIGFuZCBZYWhvbyBzZWFyY2ggcmVzdWx0cy4gdjIuMi4yIDIwMjItMDEtMjIKLy8gQGluY2x1ZGUgICAgIGh0dHAqOi8vd3d3Lmdvb2dsZS4qLyoKLy8gQGV4Y2x1ZGUgaHR0cCo6Ly93d3cuZ29vZ2xlLmNvbS9yZWNhcHRjaGEvKgovLyBAaW5jbHVkZSAgICAgaHR0cCo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PYnNlcnZlciAoRmlyZWZveCAxNCspIG92ZXIgTXV0YXRpb24gRXZlbnRzCiAgICBNdXRPYiA9ICh3aW5kb3cuTXV0YXRpb25PYnNlcnZlcikgPyB3aW5kb3cuTXV0YXRpb25PYnNlcnZlciA6IHdpbmRvdy5XZWJLaXRNdXRhdGlvbk9ic2VydmVyOwogICAgaWYgKE11dE9iICYmIGJNdXRPYiA9PSAiWSIpewogICAgICAgIGNoZ01vbiA9IG5ldyBNdXRPYihmdW5jdGlvbihtdXRhdGlvblNldCl7CiAgICAgICAgICAgIG11dGF0aW9uU2V0LmZvckVhY2goZnVuY3Rpb24obXV0YXRpb24pewogICAgICAgICAgICAgICAgaWYgKG11dGF0aW9uLnR5cGUgPT0gImNoaWxkTGlzdCIpewogICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGk9MDsgaTxtdXRhdGlvbi5hZGRlZE5vZGVzLmxlbmd0aDsgaSsrKXsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG11dGF0aW9uLmFkZGVkTm9kZXNbaV0ubm9kZVR5cGUgPT0gMSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja05vZGUobXV0YXRpb24uYWRkZWROb2Rlc1tpXSk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyBhdHRyaWJ1dGUgbXV0YXRpb24gb24gR29vZ2xlIEltYWdlcwogICAgICAgICAgICAgICAgICAgIGlmKG11dGF0aW9uLnRhcmdldC5jbGFzc05hbWUgPT0gInJnX2wiKSBjaGVja05vZGUobXV0YXRpb24udGFyZ2V0LnBhcmVudE5vZGUpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KTsKICAgICAgICB9KTsKICAgICAgICAvLyBhdHRhY2ggY2hnTW9uIHRvIGRvY3VtZW50LmJvZHkKICAgICAgICBpZiAoaXNjaCA9PSB0cnVlKSBvcHRzID0ge2NoaWxkT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ikgfHwgbGllbHNbaV0uY2xhc3NMaXN0LmNvbnRhaW5zKCJ3LWdsX19yZXN1bHQiKSB8fAogICAgICAgICAgICAgKGxpZWxzW2ldLnBhcmVudE5vZGUubm9kZU5hbWUgPT0gIkRJViIgJiYgKGxpZWxzW2ldLnBhcmVudE5vZGUuY2xhc3NMaXN0LmNvbnRhaW5zKCJzcmciKSB8fAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpZWxzW2ldLnBhcmVudE5vZGUuY2xhc3NMaXN0LmNvbnRhaW5zKCJfTklkIikgfHwgbGllbHNbaV0ucGFyZW50Tm9kZS5wYXJlbnROb2RlLmNsYXNzTGlzdC5jb250YWlucygiX05JZCIpIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGllbHNbaV0ucGFyZW50Tm9kZS5jbGFzc0xpc3QuY29udGFpbnMoImJrV01nZCIpIHx8IGxpZWxzW2ldLnBhcmVudE5vZGUucGFyZW50Tm9kZS5jbGFzc0xpc3QuY29udGFpbnMoImJrV01nZCIpIHx8CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGllbHNbaV0ubm9kZU5hbWUgPT09ICdHLUlOTkVSLUNBUkQnIHx8IGxpZWxzW2ldLm5vZGVOYW1lID09PSAnRy1DQVJEJykpIHx8CiAgICAgICAgICAgICAobGllbHNbaV0ucGFyZW50Tm9kZS5ub2RlTmFtZSA9PSAiRElWIiAmJiBsaWVsc1tpXS5jbG9zZXN0KCcjcnNvJykgIT09IG51bGwpIHx8CiAgICAgICAgICAgICAoZW5naW5lICE9ICdHb29nbGUnICYmIGxpZWxzW2ldLnBhcmVudE5vZGUubm9kZU5hbWUgPT0gIkRJViIpIHx8CiAgICAgICAgICAgICBsaWVsc1tpXS5jbGFzc0xpc3QuY29udGFpbnMoJ3NlcnAtaXRlbScpKSAmJgogICAgICAgICAgICBsaWVsc1tpXS5jbGFzc05hbWUuaW5kZXhPZigiZ2J0IikhPTAgJiYKICAgICAgICAgICAgbGllbHNbaV0uY2xhc3NMaXN0LmNvbnRhaW5zKCJncGx1c2dyaWQiKSA9PT0gZmFsc2UgJiYKICAgICAgICAgICAgbGllbHNbaV0uY2xhc3NMaXN0LmNvbnRhaW5zKCJtaXRlbSIpID09PSBmYWxzZSAmJgogICAgICAgICAgICBsaWVsc1tpXS5jbGFzc0xpc3QuY29udGFpbnMoImtuby1rcCIpID09PSBmYWxzZSkgewogICAgICAgICAgICBsaWVsc1tpXS5zZXRBdHRyaWJ1dGUoImdoaHJlc3VsdCIsInVuc2V0Iik7CiAgICAgICAgICAgIGhpZGVycyA9IGxpZWxzW2ldLmdldEVsZW1lbnRzQnlDbGFzc05hbWUoImdoaGlkZXIiKTsKICAgICAgICAgICAgbmhpZGVyID0gaGlkZXJzLmxlbmd0aDsKICAgICAgICAgICAgaWYgKG5oaWRlciA9PSAwIHx8IG92cmQgPT0gdHJ1ZSl7IC8vIHNraXAgaWYgYSBidXR0b24gaXMgdGhlcmUKICAgICAgICAgICAgICAgIGhpZCA9IGZhbHNlOwogICAgICAgICAgICAgICAgYWVsID0gbGllbHNbaV0ucXVlcnlTZWxlY3RvcigiZGl2LnIgPiBhLCBoMyBhLCBkaXYucmMgYSIpOyAvLyBmaXJzdCBsaW5rIChub3QgdXNlZnVsIGZvciB2aWRlbyBvciBib29rIGJsb2NrcyksIDxoMz4gcHJlZmVycmVkCiAgICAgICAgICAgICAgICBpZiAoIWFlbCB8fCBhZWwucGFyZW50Tm9kZS5jbGFzc05hbWU9PSdkZWVwbGlua190aXRsZScpIGFlbCA9IGxpZWxzW2ldLnF1ZXJ5U2VsZWN0b3IoImgyIGEsIGg0IGEiKTsKICAgICAgICAgICAgICAgIGlmICghYWVsKSBhZWwgPSBsaWVsc1tpXS5xdWVyeVNlbGVjdG9yKCJhIik7CiAgICAgICAgICAgICAgICBpZiAobGllbH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UnKSArJyI+JyArIGxpZWxzW2ldLmdldEF0dHJpYnV0ZSgnbXUnKSArICc8L2E+PC9zcGFuPicpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBhZWwgPSBsaWVsc1tpXS5xdWVyeVNlbGVjdG9yKCJhLmMtc2hvd3VybCIpOwogICAgICAgICAgICAgICAgICAgIGlmKGFlbCl7aWYoIWFlbC5oYXNBdHRyaWJ1dGUoJ2hyZWYnKSl7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhZWwudGV4dENvbnRlbnQuaW5kZXhPZignaHR0cDovLycpPT09LTEgJiYgYWVsLnRleHRDb250ZW50LmluZGV4T2YoJ2h0dHBzOi8vJyk9PT0tMSkgYWVsLnNldEF0dHJpYnV0ZSgnaHJlZicsICdodHRwOi8vJythZWwudGV4dENvbnRlbnQpOwogICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGFlbC5zZXRBdHRyaWJ1dGUoJ2hyZWYnLCBhZWwudGV4dENvbnRlbnQpOwogICAgICAgICAgICAgICAgICAgIH19CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoZW5naW5lID09ICdTdGFydHBhZ2UnKXsKICAgICAgICAgICAgICAgICAgICBhZWwgPSBsaWVsc1tpXS5xdWVyeVNlbGVjdG9yKCdhLnJlc3VsdC1saW5rJyk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoYWVsKXthaHJlZj1hZWwuZ2V0QXR0cmlidXRlKCJocmVmIik7IGlmKGFocmVmKXtpZiAoYWhyZWYuc2VhcmNoKC9odHRwfGZ0cC9pKT09MCB8fCBhaHJlZi5pbmRleE9mKCIvaW50ZXJzdGl0aWFsIik9PTAgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhaHJlZi5pbmRleE9mKCIvdXJsP3E9Iik9PTAgfHwgYWhyZWYuaW5kZXhPZihjdXJyZW50RysiL3VybD9xPSIpPi0xIHx8IGFocmVmLmluZGV4T2YoIi91cmw/c2E9Iik9PTAgfHwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYWhyZWYuaW5kZXhPZigiL2FjbGs/Iik9PTAgJiYgbGllbHNbaV0uY2xhc3NMaXN0LmNvbnRhaW5zKCJwc2xpIikpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgYWhyZWYuaW5kZXhPZigiLy9yLnNlYXJjaC55YWhvbyIpPT0wIHx8IGFocmVmLmluZGV4T2YoY3VycmVudEcrIi9saW5rP3VybD0iKT4tMSl7CiAgICAgICAgICAgICAgICAgICAgZG9tID0gYWhyZWYuc3Vic3RyKGFocmVmLnNlYXJjaCgvaHR0cHxmdHAvaSkpOwogICAgICAgICAgICAgICAgICAgIGlmIChhZWwuaGFzQXR0cmlidXRlKCJkYXRhLWhyZWYiKSkgZG9tID0gYWVsLmdldEF0dHJpYnV0ZSgiZGF0YS1ocmVmIikuc3Vic3RyKGFlbC5nZXRBdHRyaWJ1dGUoImRhdGEtaHJlZiIpLmluZGV4T2YoImh0dHAiKSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGRvbS5pbmRleE9mKGN1cnJlbnRHKyIvYWNsaz8iKT4tMSkgZG9tID0gYWhyZWYuc3Vic3RyKGFocmVmLmluZGV4T2YoImh0dHAiLCAxMCkpOwogICAgICAgICAgICAgICAgICAgIGlmIChhaHJlZi5pbmRleE9mKCIvdXJsP3NhPSIpPi0xKSBkb20gPSBkZWNvZGVVUklDb21wb25lbnQoYWhyZWYuc3Vic3RyKGFocmVmLmluZGV4T2YoIiZ1cmw9IikrNSkpOwogICAgICAgICAgICAgICAgICAgIGlmIChhaHJlZi5pbmRleE9mKCJyLnNlYXJjaC55YWhvby5jb20vX3lsdD0iKT4tMSkgZG9tID0gZGVjb2RlVVJJQ29tcG9uZW50KGFocmVmLnN1YnN0cihhaHJlZi5pbmRleE9mKCJSVT1odHRwIikrMykpOwogICAgICAgICAgICAgICAgICAgIGlmIChkb20uaW5kZXhPZigic2VhcmNoLnlhaG9vLmNvLmpwL3IvRk9SPSIpPi0xKSBkb20gPSBkZWNvZGVVUklDb21wb25lbnQoYWhyZWYuc3Vic3RyKGFocmVmLmluZGV4T2YoIi8qKmh0dHAiKSszKSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGRvbS5pbmRleE9mKCJodHRwczovL2l4cXVpY2stcHJveHkuY29tL2RvL3NwZy9oaWdobGlnaHQucGwiKT4tMSkgZG9tID0gZGVjb2RlVVJJQ29tcG9uZW50KGFocmVmLnN1YnN0cihhaHJlZi5pbmRleE9mKCImdT1odHRwIikrMykpOwogICAgICAgICAgICAgICAgICAgIGlmIChjdXJyZW50Ry5pbmRleE9mKCJiYWlkdSIpID4gLTEpIGRvbSA9ICcvLycgKyBhZWwudGV4dENvbnRlbnQucmVwbGFjZSgnaHR0cHM6Ly8nLCAnJykucmVwbGFjZSgnaHR0cDovLycsICcnKS5yZXBsYWNlKCcuLi4uJywgJycpOwogICAgICAgICAgICAgICAgICAgIC8vIGlmIChkb20uaW5kZXhPZigiaW1ncmVmdXJsIik+LTEpIGRvbSA9IGRvbS5tYXRjaCgvaW1ncmVmdXJsPShbXiZdKykvKVsxXTsKICAgICAgICAgICAgICAgICAgICBkb20gPSBkb20uc3BsaXQoIi8iKVsyXTsKICAgICAgICAgICAgICAgICAgICBpZiAoZG9tLmluZGV4T2YoIjoiKT4gLTEpIGRvbSA9IGRvbS5zdWJzdHIoMCxkb20uaW5kZXhPZigiOiIpKTsgLy8gU3RyaXAgcG9ydCBudW1iZXIKICAgICAgICAgICAgICAgICAgICBkb21wYXJ0ID0gZG9tOwogICAgICAgICAgICAgICAgICAgIGxpZWxzW2ldLnNldEF0dHJpYnV0ZSgiZ2hoaG9zdCIsZG9tcGFydCk7CiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGRvbXBhcnQuaW5kZXhPZigiLiIpPiAtMSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoaG9zdHMuaW5kZXhPZigifCIrZG9tcGFydCsiOiIpPi0xKSB7IC8vIFRoZXNlIGRvbWFpbnMgc3VjawogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG5oaWRlciA+IDApeyAvLyBSZW1vdmUgb2xkIGJ1dHRvbnMsIG5vdGljZXMsIGV0Yy4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGs9aGlkZXJzLmxlbmd0aC0xOyBrPj0wOyBrLS0pewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWRlcnNba10ucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5oaWRlciA9IGxpZWxzW2ldLmdldEVsZW1lbnRzQnlDbGFzc05hbWUoImdoaGlkZXIiKS5sZW5ndGg7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpZWxzW2ldLmNsYXNzTGlzdC5jb250YWlucygiZ2hoMXRpbWUiKSA9PT0gZmFsc2UpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChob3N0cy5pbmRleE9mKCJ8Iitkb21wYXJ0KyI6cCIpPDApIHsgLy8gUmVndWxhciBibG9jawogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2hvd1lOPT0iWSIpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpZWxzW2ldLmNsYXNzTGlzdC5jb250YWlucygicmVzdWx0c19saW5rc19kZWVwIikpeyAvLyBEREcKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXBsYWNlSGl0KGRvbXBhcnQsYWVsLGxpZWxzW2ldLnF1ZXJ5U2VsZWN0b3IoIi5saW5rc19tYWluIiksIiIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSByZXBsYWNlSGl0KGRvbXBhcnQsYWVsLGxpZWxzW2ldLCIiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHJlcGxhY2VIaXQoZG9tcGFydCxhZWwsbGllbHNbaV0sIm5vbmUiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyBQZXJtYS1iYW4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGllbHNbaV0uc2V0QXR0cmlidXRlKCJibG9ja2hpZGRlbiIsZG9tcGFydCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbmdpbmUgIT0gJ0dvb2dsZScgJiYgbGllbHNbaV0uY2xhc3NMaXN0LmNvbnRhaW5zKCJnaGhkbm9uZSIpID09PSBmYWxzZSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaWVsc1tpXS5jbGFzc0xpc3QuYWRkKCdnaGhkbm9uZScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpZWxzW2ldLmNsYXNzTGlzdC5jb250YWlucygibGlua3NfbWFpbiIpKSBsaWVsc1tpXS5wYXJlbnROb2RlLmNsYXNzTGlzdC5hZGQoJ2doaGRub25lJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVuZ2luZSA9PSAnRERHJyAmJiBsaWVsc1tpXS5jbGFzc0xpc3QuY29udGFpbnMoInJlc3VsdHNfbGlua3NfZGVlcCIpKSBraWRzID0gbGllbHNbaV0ubGFzdEVsZW1lbnRDaGlsZC5jaGlsZHJlbjsgLy9EREcKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGtpZHMgPSBsaWVsc1tpXS5jaGlsZHJlbjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGo9MDsgajxraWRzLmxlbmd0aDsgaisrKXsgLy8gSGlkZSBHb29nbGUgcmVzdWx0CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChraWRzW2pdLmNsYXNzTGlzdC5jb250YWlucygiZ2hoaWRlciIpID09PSBmYWxzZSAmJiBraWRzW2pdLmNsYXNzTGlzdC5jb250YWlucygiZ2hoZG5vbmUiKSA9PT0gZmFsc2UpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2lkc1tqXS5jbGFzc0xpc3QuYWRkKCdnaGhkbm9uZScpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpZWxzW2ldLmNsYXNzTGlzdC5jb250YWlucygicHNsaSIpKSBsaWVsc1tpXS5zdHlsZS5wYWRkaW5nID0gIjAiOyAvLyBTaG9wcGluZyByZXN1bHRzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb21wYXJ0ID0gZG9tcGFydC5zbGljZShkb21wYXJ0LmluZGV4T2YoIi4iKSsxKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb21wYXJ0LmluZGV4T2YoIi4iKSA9PT0gLTEgJiYgZG9tcGFydCAhPSAidGxkIikgZG9tcGFydCArPSAnLnRsZCc7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgaWYgKGhpZCA9PSBmYWxzZSAmJiBuaGlkZXIgPiAxKSB7IC8vIFJlbW92ZSBwcmV2aW91cyBibG9jayAmIHJlc2V0IG5oaWRlcgogICAgICAgICAgICAgICAgICAgICAgICBpZiAobGllbHNbaV0uY2hpbGRyZW5bMF0uY2xhc3NMaXN0LmNvbnRhaW5zKCJnaGhkIikpIGxpZWxzW2ldLmNoaWxkcmVuWzBdLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAvLyBDbGVhbiB1cCB1bmJsb2NrZWQgb25lLXRpbWVzCiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsaWVsc1tpXS5jbGFzc0xpc3QuY29udGFpbnMoImdoaDF0aW1lIikpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgbGllbHNbaV0uY2xhc3NMaXN0LnJlbW92ZSgnZ2hoMXRpbWUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRnb25lID0gbGllbHNbaV0uZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgiZ2hoZCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRnb25lLmxlbmd0aCA+IDApIGRnb25lWzBdLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGdvbmUgPSBsaWVsc1tpXS5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCJnaGhkYnV0dG9ucyIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRnb25lLmxlbmd0aCA+IDApIGRnb25lWzBdLnJlbW92ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIG5oaWRlciA9IGxpZWxzW2ldLmdldEVsZW1lbnRzQnlDbGFzc05hbWUoImdoaGlkZXIiKS5sZW5ndGg7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGlmIChoaWQgPT0gZmFsc2UgJiYgKG5oaWRlciA9PSAwIHx8IGxpZWxzW2ldLmNoaWxkcmVuWzBdLm5vZGVOYW1lLnRvTG93ZXJDYXNlKCkgPT0gJ2ctc2VjdGlvbi13aXRoLWhlYWRlcicpKSB7IC8vIE5vdCBibG9ja2VkLCBpbnNlcnQgYmxvY2sgYnV0dG9uCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZpcnN0LCByZW1vdmUgaGlkaW5nIGZvciB1bmJsb2NrZWQgZG9tYWlucwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5naW5lID09ICdEREcnICYmIGxpZWxzW2ldLmNsYXNzTGlzdC5jb250YWlucygicmVzdWx0c19saW5rc19kZWVwIikpIGtpZHMgPSBsaWVsc1tpXS5sYXN0RWxlbWVudENoaWxkLmNoaWxkcmVuOyAvL0RERwogICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGtpZHMgPSBsaWVsc1tpXS5jaGlsZHJlbjsKICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChqPTA7IGo8a2lkcy5sZW5ndGg7IGorKyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoa2lkc1tqXS5jbGFzc0xpc3QuY29udGFpbnMoImdoaGRub25lIikpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtpZHNbal0uY2xhc3NMaXN0LnJlbW92ZSgnZ2hoZG5vbmUnKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICBpZiAobGllbHNbaV0uaGFzQXR0cmlidXRlKCJibG9ja2hpZGRlbiIpKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpZWxzW2ldLnJlbW92ZUF0dHJpYnV0ZSgiYmxvY2toaWRkZW4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpZWxzW2ldLmNsYXNzTGlzdC5yZW1vdmUoJ2doaGRub25lJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5naW5lID09ICdEREcnICYmIGxpZWxzW2ldLmNsYXNzTGlzdC5jb250YWlucygibGlua3NfbWFpbiIpKSBsaWVsc1tpXS5wYXJlbnROb2RlLmNsYXNzTGlzdC5yZW1vdmUoJ2doaGRub25lJyk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpZWxzW2ldLmhhc0F0dHJpYnV0ZSgiYmxvY2tub3RpY2UiKSkgbGllbHNbaV0ucmVtb3ZlQXR0cmlidXRlKCJibG9ja25vdGljZSIpOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAobGllbHNbaV0ucGFyZW50Tm9kZS5oYXNBdHRyaWJ1dGUoImJsb2Nrbm90aWNlIikpIGxpZWxzW2ldLnBhcmVudE5vZGUucmVtb3ZlQXR0cmlidXRlKCJibG9ja25vdGljZSIpOyAvL0RERwogICAgICAgICAgICAgICAgICAgICAgICAvLyBJbnNlcnQgYmxvY2sgYnV0dG9uCiAgICAgICAgICAgICAgICAgICAgICAgIGFwYXIgPSBhZWw7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbmdpbmUgPT0gJ0dvb2dsZScpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxvY2F0aW9uLnNlYXJjaC5pbmRleE9mKCdhZHRlc3Q9b24nKSA+IC0xKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGFyID0gbGllbHNbaV0ucXVlcnlTZWxlY3RvcigiaDMgYSwgYSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYXBhci5oYXNBdHRyaWJ1dGUoJ2hyZWZvcmlnaW5hbCcpKSBhcGFyLnNldEF0dHJpYnV0ZSgnaHJlZm9yaWdpbmFsJywgYWVsLmdldEF0dHJpYnV0ZSgnaHJlZicpKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhcGFyLmhhc0F0dHJpYnV0ZSgnaHJlZm9yaWdpbmFsJykpIGFwYXIuc2V0QXR0cmlidXRlKCdocmVmb3JpZ2luYWwnLCBhcGFyLmhyZWYpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbmdpbmUgPT0gJ0JhaWR1Jyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGFyID0gbGllbHNbaV0ucXVlcnlTZWxlY3RvcigiaDMgYSwgLmMtcmVzdWx0LWNvbnRlbnQgYSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFhcGFyICYmIGxpZWxzW2ldLnF1ZXJ5U2VsZWN0b3IoInAub3Bfc2l0ZV9kb21haW5fdGl0bGUsIGRpdi5vcF9nZW5lcmFscWFfbWFpbi5jLXJvdyIpICE9IG51bGwpIGFwYXIgPSBsaWVsc1tpXS5xdWVyeVNlbGVjdG9yKCJwLm9wX3NpdGVfZG9tYWluX3RpdGxlLCBkaXYub3BfZ2VuZXJhbHFhX21haW4uYy1yb3ciKS5maXJzdENoaWxkOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcGFyICE9IG51bGwgJiYgIWFwYXIubmV4dEVsZW1lbnRTaWJsaW5nKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcGFyLnBhcmVudE5vZGUubm9kZU5hbWUgIT0gIkxJIiAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwYXIucGFyZW50Tm9kZS5ub2RlTmFtZSAhPSAiVEQiICYmCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBhci5wYXJlbnROb2RlLm5vZGVOYW1lICE9ICJIMiIpIGFwYXIgPSBhcGFyLnBhcmVudE5vZGU7CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFwYXIgIT0gbnVsbCAmJiBhcGFyICE9IHVuZGVmaW5lZCkgeyBpZiAoZG9tLmluZGV4T2YoY3VycmVudEcpPDAgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGllbHNbaV0ucGFyZW50Tm9kZSAhPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjdGFkcyBvbCIpKSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsaWVsc1tpXS5wYXJlbnROb2RlICE9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNib3R0b21hZHMgb2wiKSkgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobGllbHNbaV0ucGFyZW50Tm9kZSAhPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCIjYWRzIGRpdiIpKSAmJgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChsaWVsc1tpXS5wYXJlbnROb2RlICE9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoIiNyaHMgb2wiKSkpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRuID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiYnV0dG9uIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBidG4uYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUodHh0cy5ibG9ja1swXSkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRuLmNsYXNzTmFtZT0iZ2hoaWRlciBnaGhiIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ0bi5zZXRBdHRyaWJ1dGUoIm1ldGEiLGRvbSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlZjFjbGljay5zdWJzdHIoMCwxKSA9PSAiWSIgJiYgbWJzdHlsZS5zcGxpdCgiLSIpWzRdID09ICJZIil7IC8vQlVHOiBmb3IgMS1jbGljayB3aXRoIGFnZ3Jlc3NpdmUgKHN1YmRvbWFpbikgc2V0dGluZ3MsIGRvbSB3aWxsIGJlIGluY29ycmVjdAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbmdpbmUgPT0gJ0dvb2dsZScpIGJ0bi5zZXRBdHRyaWJ1dGUoInRpdGxlIiwiQmxvY2sgIitkb20rIiAvIFNISUZUK2NsaWNrIHRvIGRpc3BsYXkgYmxvY2sgZm9ybSAvIEFMVCtjbGljayB0byBvbWl0Iik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBidG4uc2V0QXR0cmlidXRlKCJ0aXRsZSIsIkJsb2NrICIrZG9tKyIgLyBTSElGVCtjbGljayB0byBkaXNwbGF5IGJsb2NrIGZvcm0iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobWJzdHlsZS5zcGxpdCgiLSIpWzRdID09ICJZIil7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVuZ2luZSA9PSAnR29vZ2xlJykgYnRuLnNldEF0dHJpYnV0ZSgidGl0bGUiLCJCbG9jayAiK2RvbSsiIC8gU2hvdyBibG9jayBmb3JtIC8gQUxUK2NsaWNrIHRvIG9taXQiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGJ0bi5zZXRBdHRyaWJ1dGUoInRpdGxlIiwiQmxvY2sgIitkb20rIiAvIFNob3cgYmxvY2sgZm9ybSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRuLmFkZEV2ZW50TGlzdGVuZXIoImNsaWNrIixzaG93YmZkLHRydWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gUG9zaXRpb24gYnV0dG9uIGluc2lkZSB0aGUgSDIgb3IgSDMgb3IgSDQKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcGFyLm5vZGVOYW1lID09ICJIMyIgfHwgYXBhci5ub2RlTmFtZSA9PSAiSDIiIHx8IGFwYXIubm9kZU5hbWUgPT0gIkg0IiB8fCBlbmdpbmUgPT0gJ1N0YXJ0cGFnZScpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwYXIuc3R5bGUub3ZlcmZsb3cgPSAidmlzaWJsZSI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBhci5hcHBlbmRDaGlsZChidG4pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZ1bGwgbGluayB0ZXh0IHRvb2x0aXAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5naW5lID09ICdZYWhvbycgJiYgYXBhci5xdWVyeVNlbGVjdG9yKCdhJykuY2hpbGROb2Rlc1swXS5ub2RlTmFtZSA9PSAnU1BBTicpIGFwYXIucXVlcnlTZWxlY3RvcignYScpLnNldEF0dHJpYnV0ZSgidGl0bGUiLGFwYXIucXVlcnlTZWxlY3RvcignYScpLmNoaWxkTm9kZXNbMV0udGV4dENvbnRlbnQpOyAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGFwYXIucXVlcnlTZWxlY3RvcignYScpLnNldEF0dHJpYnV0ZSgidGl0bGUiLGFwYXIucXVlcnlTZWxlY3RvcignYScpLnRleHRDb250ZW50KTsgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFwYXIucGFyZW50Tm9kZS5wYXJlbnROb2RlLm5vZGVOYW1lID09ICdHLUNBUkQnKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGFyLnBhcmVudE5vZGUuYXBwZW5kQ2hpbGQoYnRuKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGFyLnBhcmVudE5vZGUucGFyZW50Tm9kZS5zdHlsZS5vdmVyZmxvd1kgPSAndmlzaWJsZSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBhci5wYXJlbnROb2RlLnBhcmVudE5vZGUuc3R5bGUuaGVpZ2h0ID0gJ3Vuc2V0JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcGFyLnBhcmVudE5vZGUucGFyZW50Tm9kZS5zdHlsZS5wb3NpdGlvbiA9ICdyZWxhdGl2ZSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFwYXIucGFyZW50Tm9kZS5jbGFzc05hbWUgPT0gJ2Ric3InKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBhci5wYXJlbnROb2RlLmFwcGVuZENoaWxkKGJ0bik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Y2FyZCA9IGFwYXIuY2xvc2VzdCgnZy1jYXJkJyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmVudGNhcmQpewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnRjYXJkLnN0eWxlLm92ZXJmbG93WSA9ICd2aXNpYmxlJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyZW50Y2FyZC5zdHlsZS5wb3NpdGlvbiA9ICdyZWxhdGl2ZSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXBhci5uZXh0U2libGluZykgYXBhci5wYXJlbnROb2RlLmluc2VydEJlZm9yZShidG4sYXBhci5uZXh0U2libGluZyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBhcGFyLnBhcmVudE5vZGUuYXBwZW5kQ2hpbGQoYnRuKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE1vdmUgYnV0dG9uIHRvIGNpdGVsaW5lIDYvMTAvMjAxMzsgdXBkYXRlZCA4LzE2LzIwMjAgdG8gbG9vayBmb3IgYWN0aW9uLW1lbnUgZmlyc3QKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiYnBvcyA9PSAiQyIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYXhubWVudSA9IGxpZWxzW2ldLnF1ZXJ5U2VsZWN0b3IoIi5hY3Rpb24tbWVudSIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjaXRlbGluZXMgPSBsaWVsc1tpXS5xdWVyeVNlbGVjdG9yQWxsKCJjaXRlIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGF4bm1lbnUpeyAvLyBwYXJlbnROb2RlIGlzIGEgc3BhbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBheG5tZW51LnBhcmVudE5vZGUuaW5zZXJ0QmVmb3JlKGJ0biwgYXhubWVudSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaXRlbGluZXMubGVuZ3RoID4gMCkgYXhubWVudS5wYXJlbnROb2RlLmNsYXNzTmFtZSA9IGNpdGVsaW5lc1swXS5jbGFzc05hbWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgY2l0ZW51bT0wOyBjaXRlbnVtPGNpdGVsaW5lcy5sZW5ndGg7IGNpdGVudW0rKyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2luZG93LmdldENvbXB1dGVkU3R5bGUoY2l0ZWxpbmVzW2NpdGVudW1dKS52aXNpYmlsaXR5ICE9ICJoaWRkZW4iKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXRlbGluZXNbY2l0ZW51bV0ucGFyZW50Tm9kZS5hcHBlbmRDaGlsZChidG4pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ0bi5yZW1vdmVBdHRyaWJ1dGUoInN0eWxlIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVuZ2luZSA9PSAnR29vZ2xlJykgYnRuLnN0eWxlLnZpc2liaWxpdHkgPSAndmlzaWJsZSc7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyAvLyBhZGQgdG8gdmlzaWJpbGl0eTpoaWRkZW4gZWxlbWVudCBmb3Igc3BhY2luZwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpdGVsaW5lc1tjaXRlbnVtXS5wYXJlbnROb2RlLmFwcGVuZENoaWxkKGJ0bi5jbG9uZU5vZGUodHJ1ZSkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbmdpbmUgPT0gJ0dvb2dsZScpIGJ0bi5zdHlsZS52aXNpYmlsaXR5ID0gJ2hpZGRlbic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU3RhcnRwYWdlLmNvbQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXRlbGluZXMgPSBsaWVsc1tpXS5xdWVyeVNlbGVjdG9yQWxsKCcudy1nbF9fcmVzdWx0LXVybC1jb250YWluZXInKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNpdGVsaW5lcy5sZW5ndGggPiAwKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpdGVsaW5lc1swXS5hcHBlbmRDaGlsZChidG4pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRuLnJlbW92ZUF0dHJpYnV0ZSgic3R5bGUiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEltcGxlbWVudCBNb3VzZW92ZXIgT3B0aW9uIDYvMjIvMjAxMgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJic3R5bGUgPT0gIk0iKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnRuLnN0eWxlLnZpc2liaWxpdHkgPSAiaGlkZGVuIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaWVsc1tpXS5hZGRFdmVudExpc3RlbmVyKCJtb3VzZW92ZXIiLHRvZ2dsZWJidG4sZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpZWxzW2ldLmFkZEV2ZW50TGlzdGVuZXIoIm1vdXNlb3V0Iix0b2dnbGViYnRuLGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEF2b2lkIHVuaGlkaW5nIGdhcmJhZ2Ugc3BhbiA1LzI1LzIwMTIKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaj0wOyBqPGxpZWxzW2ldLmNoaWxkcmVuLmxlbmd0aDsgaisrKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobGllbHNbaV0uY2hpbGRyZW5bal0uY2xhc3NMaXN0LmNvbnRhaW5zKCJnaGhpZGVyIikgPT09IGZhbHNlKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxpZWxzW2ldLmNoaWxkcmVuW2pdLnN0eWxlLmRpc3BsYXk9PSJub25lIikgbGllbHNbaV0uY2hpbGRyZW5bal0uc2V0QXR0cmlidXRlKCJ3YXNkaXNwbGF5bm9uZSIsIndhc2Rpc3BsYXlub25lIik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICB9fQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH19fQogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIHsgLy8gQ2hlY2sgZm9yIGFuZCBoYW5kbGUgR29vZ2xlIHN0YW5kYXJkIGltYWdlIHJlc3VsdHMgLSBkb2Vzbid0IHlldCBzdXBwb3J0IEJBU0lDIGltYWdlIHJlc3VsdHMKICAgICAgICAgICAgaWYgKGxpZWxzW2ldLmNsYXNzTGlzdC5jb250YWlucygicmdfZGkiKSB8fCBsaWVsc1tpXS5jbGFzc0xpc3QuY29udGFpbnMoImlzdi1yIikpewogICAgICAgICAgICAgICAgaWYgKCFsaWVsc1tpXS5oYXNBdHRyaWJ1dGUoImltZ2Jsb2NrIikgfHwgb3ZyZCA9PSB0cnVlKXsgLy8gc2tpcCBpZiBwcmV2aW91c2x5IHByb2Nlc3NlZAogICAgICAgICAgICAgICAgICAgIGxpZWxzW2ldLnNldEF0dHJpYnV0ZSgiaW1nYmxvY2siLCAibm9ybWFsIik7CiAgICAgICAgICAgICAgICAgICAgYWVsID0gbGllbHNbaV0ucXVlcnlTZWxlY3RvcignYVtocmVmKj0iLiJdJyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGFlbCAmJiBhZWwuaHJlZi5pbmRleE9mKCcvc2VhcmNoPycpID09IC0xKXsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFlbC5nZXRBdHRyaWJ1dGUoImhyZWYiKS5pbmRleE9mKCJpbWdyZWZ1cmwiKT4tMSl7IC8vIFNpdGUgc2hvd2luZyB0aGUgaW1hZ2UgKCJ2aXNpdCBwYWdlIikKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbSA9IGRlY29kZVVSSUNvbXBvbmVudChhZWwuaHJlZikubWF0Y2goL2ltZ3JlZnVybD0oW14mXSspLylbMV0uc3BsaXQoIi8iKVsyXTsKICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChhZWwuZ2V0QXR0cmlidXRlKCJocmVmIikuaW5kZXhPZigiaW1ndXJsIik+LTEpeyAvLyBTaXRlIGhvc3RpbmcgdGhlIGltYWdlICgidmlldyBpbWFnZSIpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb20gPSBkZWNvZGVVUklDb21wb25lbnQoYWVsLmhyZWYpLm1hdGNoKC9pbWd1cmw9KFteJl0rKS8pWzFdLnNwbGl0KCIvIilbMl07CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7IC8vc29tZXRpbWVzIHlvdSBnZXQgYSBjbGVhbiBVUkwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbSA9IGFlbC5nZXRBdHRyaWJ1dGUoImhyZWYiKS5zcGxpdCgiLyIpWzJdOwogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkb20ubGVuZ3RoID4gMCl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZG9tLmluZGV4T2YoIjoiKT4gLTEpIGRvbSA9IGRvbS5zdWJzdHIoMCxkb20uaW5kZXhPZigiOiIpKTsgLy8gU3RyaXAgcG9ydCBudW1iZXIKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbXBhcnQgPSBkb207CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoZG9tcGFydC5pbmRleE9mKCIuIik+IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhvc3RzLmluZGV4T2YoInwiK2RvbXBhcnQrIjoiKT4tMSkgeyAvLyBUaGVzZSBkb21haW5zIHN1Y2sKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhvc3RzLmluZGV4T2YoInwiK2RvbXBhcnQrIjpwIik8MCkgeyAvLyBSZWd1bGFyIGJsb2NrCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaWVsc1tpXS5zZXRBdHRyaWJ1dGUoImltZ2Jsb2NrIiwgInJlZ3VsYXIiKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsgLy8gUGVybWEtYmFuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaWVsc1tpXS5zZXRBdHRyaWJ1dGUoImltZ2Jsb2NrIiwgInBiYW4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb21wYXJ0ID0gZG9tcGFydC5zbGljZShkb21wYXJ0LmluZGV4T2YoIi4iKSsxKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRvbXBhcnQuaW5kZXhPZigiLiIpID09PSAtMSAmJiBkb21wYXJ0ICE9ICJ0bGQiKSBkb21wYXJ0ICs9ICcudGxkJzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9Ci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IuIikrMSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGRvbXBhcnQuaW5kZXhPZigiLiIpID09PSAtMSAmJiBkb21wYXJ0ICE9ICJ0bGQiKSBkb21wYXJ0ICs9ICcudGxkJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH19fQogICAgfQogICAgZm9yIChpPTA7IGk8dGRzLmxlbmd0aDsgaSsrKXsKICAgICAgICBzd2l0Y2ggKHRkc1tpXS5nZXRBdHRyaWJ1dGUoImdoaGFjdGlvbiIpKXsKICAgICAgICAgICAgY2FzZSAiZGVsZXRlIjoKICAgICAgICAgICAgICAgIC8vIFRPRE8gaW1wbGVtZW50IGRlbGV0aW9uCiAgICAgICAgICAgICAgICB0ZHNbaV0uaW5uZXJIVE1MID0gImRlbGV0ZSBjZWxsIjsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICJub3RpY2UiOgogICAgICAgICAgICAgICAgLy8gVE9ETyBpbXBsZW1lbnQgY2xpY2thYmxlIG5vdGljZXMKICAgICAgICAgICAgICAgIHRkc1tpXS5zdHlsZS50ZXh0RGVjb3JhdGlvbiA9ICJsaW5lLXRocm91Z2giOwogICAgICAgICAgICAgICAgdGRzW2ldLnN0eWxlLm9wYWNpdHkgPSAiMC4zIjsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgLy8gVE9ETyBhZGQgYmxvY2sgYnV0dG9uCiAgICAgICAgfQogICAgfQp9Ci8vID09ID09ID09IE90aGVyIEZ1bmN0aW9ucyA9PSA9PSA9PQpmdW5jdGlvbiByZXNob3coZSl7IC8vIFNob3cgaGl0IHdpdGhvdXQgdW5ibG9ja2luZwogICAgdmFyIGxpZWwsIGFlbCwgZGFicywgazsKICAgIGxpZWwgPSBlLnRhcmdldC5jbG9zZXN0KCdbZ2hocmVzdWx0XScpOwogICAgaWYgKCFsaWVsKSByZXR1cm47CiAgICBsa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YXJlICIraGRzLmxlbmd0aCsiIGJsb2NrZWQgaGl0cyI7CiAgICAgICAgZWxzZSBzID0gImFyZSBubyBibG9ja2VkIGhpdHMiOwogICAgICAgIGlmIChjb25maXJtKCJTaG93IHRpdGxlcyBhbmQgYnV0dG9ucyBmb3Igc3VwcHJlc3NlZCByZXN1bHRzPyAoVGhlcmUgIitzKyIgb24gdGhpcyBwYWdlLikiKSl7CiAgICAgICAgICAgIGdoaFByZWZPLnNob3dub3RjWzBdID0gIlkiOwogICAgICAgICAgICBpZiAoIUdNNCl7CiAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgYXdhaXQgR00uc2V0VmFsdWUoImdoaHByZWZzIiwgSlNPTi5zdHJpbmdpZnkoZ2hoUHJlZk8pKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBzaG93WU4gPSBnaGhQcmVmTy5zaG93bm90Y1swXTsKICAgICAgICAgICAgdG9nSGlkZXJEaXZzKCJ5ZXMiKTsKICAgICAgICB9CiAgICB9CiAgICBmaXhTaG93SGlkZUJ0bigpOwogICAgZS50YXJnZXQuYmx1cigpOwp9CmZ1bmN0aW9uIGZpeFNob3dIaWRlQnRuKCl7CiAgICB2YXIgY2hrTVAgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiY2hrc2hvd25vdGMiKTsKICAgIHZhciBjaGtCRiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjaGtzaG93bm90Y2JmIik7CiAgICBpZiAoc2hvd1lOID09ICJZIil7CiAgICAgICAgY2hrTVAuc2V0QXR0cmlidXRlKCJjaGVja2VkIiwiY2hlY2tlZCIpOwogICAgICAgIGNoa01QLmNoZWNrZWQgPSB0cnVlOwogICAgICAgIGlmIChjaGtCRil7CiAgICAgICAgICAgIGNoa0JGLnNldEF0dHJpYnV0ZSgiY2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gICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hoYmYxIikuY2xpY2soKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hoYmYzIikuY2xpY2soKTsKICAgICAgICB9CiAgICB9IGVsc2UgeyAvLyByZWd1bGFyICsgcG9wdWxhdGluZyAxLWNsaWNrIGNoZWNrYm94CiAgICAgICAgdmFyIGNoa0JGID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNoazFjbGlja2JmIik7CiAgICAgICAgaWYgKHByZWYxY2xpY2suc3Vic3RyKDAsMSkgPT0gIlkiKXsKICAgICAgICAgICAgY2hrQkYuc2V0QXR0cmlidXRlKCJjaGVja2VkIiwiY2hlY2tlZCIpOwogICAgICAgICAgICBjaGtCRi5jaGVja2VkID0gdHJ1ZTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBjaGtCRi5yZW1vdmVBdHRyaWJ1dGUoImNoZWNrZWQiKTsKICAgICAgICAgICAgY2hrQkYuY2hlY2tlZCA9IGZhbHNlOwogICAgICAgIH0KICAgICAgICBjaGtCRiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJjaGtzaG93bm90Y2JmIik7CiAgICAgICAgaWYgKHNob3dZTiA9PSAiWSIpewogICAgICAgICAgICBjaGtCRi5zZXRBdHRyaWJ1dGUoImNoZWNrZWQiLCJjaGVja2VkIik7CiAgICAgICAgICAgIGNoa0JGLmNoZWNrZWQgPSB0cnVlOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGNoa0JGLnJlbW92ZUF0dHJpYnV0ZSgiY2hlY2tlZCIpOwogICAgICAgICAgICBjaGtCRi5jaGVja2VkID0gZmFsc2U7CiAgICAgICAgfQogICAgICAgIGJmZGl2LnN0eWxlLmRpc3BsYXkgPSAiYmxvY2siOwogICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJnaGhiZjEiKS5mb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pc3QoKTsKICAgIH0KfQphc3luYyBmdW5jdGlvbiBnaGhjbG9zZWZvcm0oZSl7CiAgICBpZiAoIWUpIHJldHVybjsKICAgIGlmICh0eXBlb2YoZSkgPT0gIm9iamVjdCIgJiYgZS50YXJnZXQpewogICAgICAgIGlmKGUudGFyZ2V0LmlkLmluZGV4T2YoImdoaGJmIikgPT0gMCl7CiAgICAgICAgICAgIHZhciBtbmcgPSBlLnRhcmdldC5nZXRBdHRyaWJ1dGUoIm1uZyIpOwogICAgICAgICAgICB2YXIgYmZkaXYgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hoYmxvY2tmb3JtIik7CiAgICAgICAgICAgIHZhciB0ZGl2ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImdoaHRlbXAiKTsKICAgICAgICAgICAgYmZkaXYuc3R5bGUuZGlzcGxheSA9ICJub25lIjsKICAgICAgICAgICAgZG9jdW1lbnQuYm9keS5hcHBlbmRDaGlsZChiZmRpdik7CiAgICAgICAgICAgIHRkaXYucmVtb3ZlKCk7CiAgICAgICAgICAgIGlmIChtbmcgPT0gIlkiKSBzaG93TWFuYWdlRm9ybSgibW5nZm9ybSIpOwogICAgICAgIH0KICAgICAgICBpZihlLnRhcmdldC5pZC5pbmRleE9mKCJnaGhtZiIpID09IDApewogICAgICAgICAgICBpZiAobWJzdHlsZS5zcGxpdCgiLSIpWzBdID09ICJtbmciKSB0b2dnbGVCbG9ja0hpZGVycygiSCIpOwogICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hobW5nZm9ybSIpLnN0eWxlLmRpc3BsYXkgPSAibm9uZSI7CiAgICAgICAgICAgIGlmIChtcG9wZW4uc3Vic3RyKDAsMykgPT0gIlktWSIpewogICAgICAgICAgICAgICAgbXBvcGVuID0gIlktTiI7CiAgICAgICAgICAgICAgICBnaGhQcmVmTy5tbmdwYW5lb3BlblswXSA9IG1wb3BlbjsKICAgICAgICAgICAgICAgIGlmICghR000KXsKICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBhd2FpdCBHTS5zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSBlbHNlIHsKICAgICAgICBpZihlID09ICJtbmdmb3JtIil7CiAgICAgICAgICAgIGlmIChtYnN0eWxlLnNwbGl0KCItIilbMF0gPT0gIm1uZyIpIHRvZ2dsZUJsb2NrSGlkZXJzKCJIIik7CiAgICAgICAgICAgIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJnaGhtbmdmb3JtIikuc3R5bGUuZGlzcGxheSA9ICJub25lIjsKICAgICAgICAgICAgaWYgKG1wb3Blbi5zdWJzdHIoMCwzKSA9PSAiWS1ZIil7CiAgICAgICAgICAgICAgICBtcG9wZW4gPSAiWS1OIjsKICAgICAgICAgICAgICAgIGdoaFByZWZPLm1uZ3BhbmVvcGVuWzBdID0gbXBvcGVuOwogICAgICAgICAgICAgICAgaWYgKCFHTTQpewogICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3RyaW5naWZ5KGdoaFByZWZPKSk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGF3YWl0IEdNLnNldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3RyaW5naWZ5KGdoaFByZWZPKSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICBlLnN0b3BQcm9wYWdhdGlvbigpOwp9CmFzeW5jIGZ1bmN0aW9uIGltZ2Jsb2NrZGlhbG9nKGUpewogICAgdmFyIHZpZXdlciA9I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XRWYWx1ZSgiaGlkZXlob3N0cyIpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IGF3YWl0IEdNLmdldFZhbHVlKCJoaWRleWhvc3RzIik7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAoc2xpc3Quc3Vic3RyKDAsMSkgIT0gInwiKSBzbGlzdCA9ICJ8IiArIHNsaXN0OwogICAgICAgICAgICAgICAgc2xpc3QgPSBzbGlzdC5yZXBsYWNlKCJ8Iitkb21wYXJ0KyI6dCIsIiIpLnJlcGxhY2UoInwiK2RvbXBhcnQrIjpwIiwiIik7CiAgICAgICAgICAgICAgICBpZiAoIUdNNCl7CiAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoImhpZGV5aG9zdHMiLCBzbGlzdCk7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGF3YWl0IEdNLnNldFZhbHVlKCJoaWRleWhvc3RzIiwgc2xpc3QpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYmxpc3QgPSBzbGlzdDsKICAgICAgICAgICAgICAgIG5lZWR1cGRhdGUgPSB0cnVlOwogICAgICAgICAgICAgICAgaGlkZWhpdHMobnVsbCx0cnVlKTsKICAgICAgICAgICAgICAgIGlmIChkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hobW5nZm9ybSIpKXsKICAgICAgICAgICAgICAgICAgICBpZihkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hobW5nZm9ybSIpLnN0eWxlLmRpc3BsYXk9PSJibG9jayIpIHJlZnJlc2hTaXRlTGlzdCgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGUuc3RvcFByb3BhZ2F0aW9uKCk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBkb21wYXJ0ID0gZG9tcGFydC5zbGljZ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ImdoaG1mMSIpLnJlbW92ZUF0dHJpYnV0ZSgiZGlzYWJsZWQiKTsKICAgICAgICAgICAgaWYgKGJMVW9wZW4gIT0gIk4iKSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hodXRpbCIpLnN0eWxlLmRpc3BsYXkgPSAiYmxvY2siOwogICAgICAgIH0KICAgICAgICBzZXRDdXJyZW50VGFiKCk7CiAgICAgICAgaWYgKG1ic3R5bGUuc3BsaXQoIi0iKVswXSA9PSAibW5nIikgdG9nZ2xlQmxvY2tIaWRlcnMoIlMiKTsKICAgIH0KICAgIGlmICh0eXBlb2YgZSA9PSAib2JqZWN0IikgZS50YXJnZXQuYmx1cigpOwp9CmZ1bmN0aW9uIHNldEN1cnJlbnRUYWIoKXsKICAgIHZhciBrLCB0YWJudW07CiAgICB2YXIgdGFic2V0ID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgiI21mbGlzdHM+ZGl2Iik7CiAgICBmb3IgKGs9MDsgazx0YWJzZXQubGVuZ3RoOyBrKyspewogICAgICAgIHRhYm51bSA9IHRhYnNldFtrXS5nZXRBdHRyaWJ1dGUoImlkIik7CiAgICAgICAgdGFibnVtID0gdGFibnVtLnN1YnN0cih0YWJudW0ubGVuZ3RoLTEpOwogICAgICAgIGlmICh0YWJzZXRba10uc3R5bGUuZGlzcGxheSAhPSAibm9uZSIpewogICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hodHMiK3RhYm51bSkuY2xhc3NOYW1lID0gImdoaEN1clRhYiI7CiAgICAgICAgICAgIGlmIChtcG9wZW4uc3Vic3RyKDAsMSkgPT0gIlkiKXsKICAgICAgICAgICAgICAgIG1wb3BlbiA9ICJZLVktIit0YWJudW07CiAgICAgICAgICAgICAgICBnaGhQcmVmTy5tbmdwYW5lb3BlblswXSA9IG1wb3BlbjsKICAgICAgICAgICAgICAgIGlmICghR000KXsKICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgi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Nhc2UgImdoaGhvc3QgZ2hocGIiOgogICAgICAgICAgICB0LmNsYXNzTmFtZSA9ICJnaGhob3N0IGdoaGJsayI7IC8vIHRvZ2dsZSB0byBibG9jawogICAgICAgICAgICBpZiAobC5ub2RlTmFtZSA9PSAiTEkiKXsKICAgICAgICAgICAgICAgIGlmIChwaWQgPT0gImdoaHNpdGVsaXN0Iil7CiAgICAgICAgICAgICAgICAgICAgbC5jaGlsZHJlblswXS5zdHlsZS5kaXNwbGF5ID0gIm5vbmUiOwogICAgICAgICAgICAgICAgICAgIGxpc3RjaGdzID0gbGlzdGNoZ3MgLSAxOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBsLmNoaWxkcmVuWzBdLnN0eWxlLmRpc3BsYXkgPSAiaW5saW5lIjsKICAgICAgICAgICAgICAgICAgICBsLmNoaWxkcmVuWzBdLnRleHRDb250ZW50ID0gInRvICIgKyB0eHRzLmJsb2NrWzBdOwogICAgICAgICAgICAgICAgICAgIGwuY2hpbGRyZW5bMF0uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gIiNjY2MiOwogICAgICAgICAgICAgICAgICAgIGxpc3RjaGdzID0gbGlzdGNoZ3MgKyAxOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGNhc2UgImdoaGhvc3QgZ2hoZGVsIjoKICAgICAgICAgICAgdC5jbGFzc05hbWUgPSAiZ2hoaG9zdCBnaGhwYiI7IC8vIHRvZ2dsZSB0byBwZXJtYS1iYW4KICAgICAgICAgICAgaWYgKGwubm9kZU5hbWUgPT0gIkxJIil7CiAgICAgICAgICAgICAgICBpZiAocGlkID09ICJnaGhwYmFubGlzdCIpewogICAgICAgICAgICAgICAgICAgIGwuY2hpbGRyZW5bMF0uc3R5bGUuZGlzcGxheSA9ICJub25lIjsKICAgICAgICAgICAgICAgICAgICBsaXN0Y2hncyA9IGxpc3RjaGdzIC0gMTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgbC5jaGlsZHJlblswXS5zdHlsZS5kaXNwbGF5ID0gImlubGluZSI7CiAgICAgICAgICAgICAgICAgICAgbC5jaGlsZHJlblswXS50ZXh0Q29udGVudCA9ICJ0byAiICsgdHh0cy5wYmFuWzBdOwogICAgICAgICAgICAgICAgICAgIGwuY2hpbGRyZW5bMF0uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gIiNmNjYiOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgIHQuY2xhc3NOYW1lID0gImdoaGhvc3QgZ2hoZGVsIjsgLy8gdG9nZ2xlIHRvIHVuYmxvY2sKICAgICAgICAgICAgaWYgKGwubm9kZU5hbWUgPT0gIkxJIil7CiAgICAgICAgICAgICAgICBsLmNoaWxkcmVuWzBdLnN0eWxlLmRpc3BsYXkgPSAiaW5saW5lIjsKICAgICAgICAgICAgICAgIGwuY2hpbGRyZW5bMF0udGV4dENvbnRlbnQgPSAidG8gIiArIHR4dHMudW5ibG9ja1swXTsKICAgICAgICAgICAgICAgIGwuY2hpbGRyZW5bMF0uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gIiM5ZjYiOwogICAgICAgICAgICAgICAgaWYgKHBpZCA9PSAiZ2hoc2l0ZWxpc3QiKXsKICAgICAgICAgICAgICAgICAgICBsaXN0Y2hncyA9IGxpc3RjaGdzICsgMTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgfQp9CmFzeW5jIGZ1bmN0aW9uIHNhdmVlZGl0cyhlKXsgLy8gU2F2ZSBjaGFuZ2VzIG1hZGUgb24gdGFicyAyIGFuZCAzCiAgICBpZiAoZSl7CiAgICAgICAgaWYgKGxpc3RjaGdzID09IDApewogICAgICAgICAgICBpZiAoIWNvbmZpcm0oIk5vIGNoYW5nZXMgZGV0ZWN0ZWQuIFNhdmUgYW55d2F5PyIpKXsKICAgICAgICAgICAgICAgIGUudGFyZ2V0LmJsdXIoKTsKICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGlmICghY29uZmlybSgiU2F2ZSBjaGFuZ2VzIHRvIGJsb2NrIGxpc3Q/IikpewogICAgICAgICAgICAgICAgZS50YXJnZXQuYmx1cigpOwogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgdmFyIHNsaXN0LCBpLCBzcCwgdHRlbXAsIHB0ZW1wOwogICAgc2xpc3QgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hoc2l0ZWxpc3QiKTsKICAgIHR0ZW1wID0gIiI7CiAgICBwdGVtcCA9ICIiOwogICAgZm9yIChpPTA7aTxzbGlzdC5jaGlsZHJlbi5sZW5ndGg7aSsrKXsKICAgICAgICBpZiAoc2xpc3QuY2hpbGRyZW5baV0ubm9kZU5hbWUgPT0gIkxJIikgewogICAgICAgICAgICBzcCA9IHNsaXN0LmNoaWxkcmVuW2ldLmNoaWxkcmVuWzFdOwogICAgICAgICAgICBzd2l0Y2ggKHNwLmNsYXNzTmFtZSl7CiAgICAgICAgICAgICAgICBjYXNlICJnaGhob3N0IGdoaGJsayI6CiAgICAgICAgICAgICAgICAgICAgdHRlbXAgKz0gc3AudGV4dENvbnRlbnQgKyAiOnR8IjsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgImdoaGhvc3QgZ2hocGIiOgogICAgICAgICAgICAgICAgICAgIHB0ZW1wICs9IHNwLnRleHRDb250ZW50ICsgIjpwfCI7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgIC8vIHRvIGJlIHVuYmxvY2tlZAogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgc2xpc3QgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hocGJhbmxpc3QiKTsKICAgIGZvciAoaT0wO2k8c2xpc3QuY2hpbGRyZW4ubGVuZ3RoO2krKyl7CiAgICAgICAgaWYgKHNsaXN0LmNoaWxkcmVuW2ldLm5vZGVOYW1lID09ICJMSSIpIHsKICAgICAgICAgICAgc3AgPSBzbGlzdC5jaGlsZHJlbltpXS5jaGlsZHJlblsxXTsKICAgICAgICAgICAgc3dpdGNoIChzcC5jbGFzc05hbWUpewogICAgICAgICAgICAgICAgY2FzZSAiZ2hoaG9zdCBnaGhibGsiOgogICAgICAgICAgICAgICAgICAgIHR0ZW1wICs9IHNwLnRleHRDb250ZW50ICsgIjp0fCI7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICJnaGhob3N0IGdoaHBiIjoKICAgICAgICAgICAgICAgICAgICBwdGVtcCArPSBzcC50ZXh0Q29udGVudCArICI6cHwiOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAvLyB0byBiZSB1bmJsb2NrZWQKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIGlmICghR000KXsKICAgICAgICBHTV9zZXRWYWx1ZSgiaGlkZXlob3N0cyIsICJ8IiArIHR0ZW1wICsgcHRlbXApOwogICAgICAgIGJsaXN0ID0gR01fZ2V0VmFsdWUoImhpZGV5aG9zdHMiKTsKICAgIH0gZWxzZSB7CiAgICAgICAgYXdhaXQgR00uc2V0VmFsdWUoImhpZGV5aG9zdHMiLCAifCIgKyB0dGVtcCArIHB0ZW1wKTsKICAgICAgICBibGlzdCA9IGF3YWl0IEdNLmdldFZhbHVlKCJoaWRleWhvc3RzIik7CiAgICB9CiAgICBoaWRlaGl0cyhudWxsLHRydWUpOwogICAgcmVmcmVzaFNpdGVMaXN0KCk7CiAgICBsaXN0Y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kKCJnaGhwYmFubGlzdCIpOwogICAgd2hpbGUgKHVsUC5maXJzdENoaWxkKSB1bFAucmVtb3ZlQ2hpbGQodWxQLmZpcnN0Q2hpbGQpOwogICAgdWxQLmluc2VydEFkamFjZW50SFRNTCgnYmVmb3JlZW5kJywgcGJsaXN0KTsKICAgIG5lZWR1cGRhdGUgPSBmYWxzZTsKfQphc3luYyBmdW5jdGlvbiB1cGR0YWRkcG9zKGUpeyAvLyBJbXBsZW1lbnQgY2hhbmdlIGZvciByYWRpbyBidXR0b25zIHJlIHdoZXJlIHRvIGFkZCB0byBsaXN0CiAgICB2YXIgcmFkcyA9IGUudGFyZ2V0LnBhcmVudE5vZGUucXVlcnlTZWxlY3RvckFsbCgiaW5wdXRbdHlwZT0ncmFkaW8nXSIpOwogICAgZm9yICh2YXIgaT0wOyBpPHJhZHMubGVuZ3RoOyBpKyspewogICAgICAgIGlmIChyYWRzW2ldLmNoZWNrZWQpewogICAgICAgICAgICBpZiAocmFkc1tpXS52YWx1ZSA9PSAic29ydCIpewogICAgICAgICAgICAgICAgaWYoY29uZmlybSgiU29ydCBsaXN0cyBub3c/IFNvcnRpbmcgaXMgaXJyZXZlcnNpYmxlLiIpKXsKICAgICAgICAgICAgICAgICAgICBpZiAobGlzdGNoZ3MgPiAwKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb25maXJtKCJZb3UgaGF2ZSB1bnNhdmVkIGNoYW5nZXMgdG8geW91ciBsaXN0cy4gU2F2ZSBjaGFuZ2VzIGFuZCBzb3J0LCBvciBjYW5jZWwgc29ydGluZz8iKSl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlZWRpdHMobnVsbCk7CiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaXhhZGRwb3MoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBzb3J0bGlzdChudWxsKTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgZml4YWRkcG9zKCk7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIGFkZEF0ID0gcmFkc1tpXS52YWx1ZTsKICAgICAgICAgICAgZ2hoUHJlZk8uYWRkdG9saXN0cG9zWzBdID0gYWRkQXQ7CiAgICAgICAgICAgIGlmICghR000KXsKICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3RyaW5naWZ5KGdoaFByZWZPKSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBhd2FpdCBHTS5zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KICAgIGZpeGFkZHBvcygpOwp9CmZ1bmN0aW9uIGZpeGFkZHBvcygpeyAvLyBDaGVjayBhcHByb3ByaWF0ZSByYWRpbyBidXR0b24gcmUgd2hlcmUgdG8gYWRkIHRvIGxpc3QKICAgIHZhciByYWRzID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImFkZHJhZGlvcyIpLnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W3R5cGU9J3JhZGlvJ10iKTsKICAgIGZvciAodmFyIGk9MDsgaTxyYWRzLmxlbmd0aDsgaSsrKXsKICAgICAgICBpZiAocmFkc1tpXS52YWx1ZSA9PSBhZGRBdCl7CiAgICAgICAgICAgIHJhZHNbaV0uc2V0QXR0cmlidXRlKCJjaGVja2VkIiwiY2hlY2tlZCIpOwogICAgICAgICAgICByYWRzW2ldLmNoZWNrZWQgPSB0cnVlOwogICAgICAgIH0KICAgICAgIC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GRlZmF1bHQgZG9tYWluIHRvIGJsb2NrCiAgICB2YXIgcmFkcyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJhZ2dyZXNzcmFkcyIpLnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W3R5cGU9J3JhZGlvJ10iKTsKICAgIGZvciAodmFyIGk9MDsgaTxyYWRzLmxlbmd0aDsgaSsrKXsKICAgICAgICBpZiAocmFkc1tpXS52YWx1ZSA9PSBiQWdncmVzcyl7CiAgICAgICAgICAgIHJhZHNbaV0uc2V0QXR0cmlidXRlKCJjaGVja2VkIiwiY2hlY2tlZCIpOwogICAgICAgICAgICByYWRzW2ldLmNoZWNrZWQgPSB0cnVlOwogICAgICAgIH0KICAgICAgICBlbHNlewogICAgICAgICAgICBpZiAocmFkc1tpXS5oYXNBdHRyaWJ1dGUoImNoZWNrZWQiKSl7CiAgICAgICAgICAgICAgICByYWRzW2ldLnJlbW92ZUF0dHJpYnV0ZSgiY2hlY2tlZCIpOwogICAgICAgICAgICAgICAgcmFkc1tpXS5jaGVja2VkID0gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9Cn0KYXN5bmMgZnVuY3Rpb24gdXBkdHVpc3R5bGUoZSl7IC8vIFN0b3JlIHNldHRpbmdzIGZvciBidXR0b25zIHRvIGRpc3BsYXkKICAgIHZhciBtYnBhcnRzID0gbWJzdHlsZS5zcGxpdCgiLSIpOwogICAgaWYgKG1icGFydHMubGVuZ3RoID09IDEpIG1icGFydHMucHVzaCgiaWZyTiIpOwogICAgaWYgKG1icGFydHMubGVuZ3RoID09IDIpIG1icGFydHMucHVzaCgiUiIpOwogICAgaWYgKG1icGFydHMubGVuZ3RoID09IDMpIG1icGFydHMucHVzaCgiUCIpOwogICAgaWYgKG1icGFydHMubGVuZ3RoID09IDQpIG1icGFydHMucHVzaCgiWSIpOwogICAgaWYgKG1icGFydHMubGVuZ3RoID09IDUpIG1icGFydHMucHVzaCgiSCIpOwogICAgaWYgKGUudGFyZ2V0LmlkID09ICJtYmlmcmFtZSIpIHsgLy8gSGFuZGxlIGlmcmFtZSBjaGVja2JveAogICAgICAgIHZhciBjaGsgPSBlLnRhcmdldDsKICAgICAgICBpZiAoY2hrLmNoZWNrZWQpewogICAgICAgICAgICBtYnBhcnRzWzFdID0gImlmclkiOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIG1icGFydHNbMV0gPSAiaWZyTiI7CiAgICAgICAgfQogICAgICAgIG1ic3R5bGUgPSBtYnBhcnRzLmpvaW4oIi0iKTsKICAgICAgICBnaGhQcmVmTy5tbmdidG5zdHlsZVswXSA9IG1ic3R5bGU7CiAgICAgICAgaWYgKCFHTTQpewogICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGF3YWl0IEdNLnNldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3RyaW5naWZ5KGdoaFByZWZPKSk7CiAgICAgICAgfQogICAgfSBlbHNlIHsgLy8gSGFuZGxlIHJhZGlvIGJ1dHRvbnMKICAgICAgICBpZiAoZS50YXJnZXQuZ2V0QXR0cmlidXRlKCJuYW1lIikgPT0gInVpc3R5bGUiKXsKICAgICAgICAgICAgdmFyIHJhZHMgPSBlLnRhcmdldC5wYXJlbnROb2RlLnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W25hbWU9J3Vpc3R5bGUnXSIpOwogICAgICAgICAgICBmb3IgKHZhciBpPTA7IGk8cmFkcy5sZW5ndGg7IGkrKyl7CiAgICAgICAgICAgICAgICBpZiAocmFkc1tpXS5jaGVja2VkKXsKICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHJhZHNbaV0udmFsdWUpewogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICJibGsiOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWJwYXJ0c1swXSA9IHJhZHNbaV0udmFsdWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgiZ2hoTW5nQnRuIikucmVtb3ZlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGVydCgiQWZ0ZXIgeW91IGNsb3NlIHRoZSBtYW5hZ2VtZW50IHBhbmUsIGNsaWNrIGFueSBibG9jayBidXR0b24gdG8gb3BlbiBpdCBhZ2Fpbi4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICBjYXNlICJtbmciOgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoY29uZmlybSgiRGlzcGxheSBibG9jayBidXR0b25zIG9ubHkgd2hlbiB0aGlzIGRpYWxvZyBpcyBvcGVuPyIpKSBtYnBhcnRzWzBdID0gIm1uZyI7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGUudGFyZ2V0LmNoZWNrZWQgPSBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICAgICAgICAgbWJwYXJ0c1swXSA9ICJib3RoIjsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImdoaE1uZ0J0biIpKSBhZGRNbmdCdG4oKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgbWJzdHlsZSA9IG1icGFydHMuam9pbigiLSIpOwogICAgICAgICAgICAgICAgICAgIGdoaFByZWZPLm1uZ2J0bnN0eWxlWzBdID0gbWJzdHlsZTsKICAgICAgICAgICAgICAgICAgICBpZiAoIUdNNCl7CiAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3RyaW5naWZ5KGdoaFByZWZPKSk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgR00uc2V0VmFsdWUoImdoaHByZWZzIiwgSlNPTi5zdHJpbmdpZnkoZ2hoUHJlZk8pKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9IGVsc2UgeyAvLyBIYW5kbGUgTWFuYWdlbWVudCBCdXR0b24gcG9zaXRpb24gYW5kIGJsb2NrIGJ1dHRvbiBkaXNwbGF5IHN0eWxlCiAgICAgICAgICAgIHJhZHMgPSBlLnRhcmdldC5wYXJlbnROb2RlLnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W25hbWU9J21uZ2J0bnBvcyddIik7CiAgICAgICAgICAgIGZvciAoaT0wOyBpPHJhZHMubGVuZ3RoOyBpKyspewogICAgICAgICAgICAgICAgaWYgKHJhZHNbaV0uY2hlY2tlZCl7CiAgICAgICAgICAgICAgICAgICAgbWJwYXJ0c1syXSA9IHJhZHNbaV0udmFsdWU7CiAgICAgICAgICAgICAgICAgICAgbWJzdHlsZSA9IG1icGFydHMuam9pbigiLSIpOwogICAgICAgICAgICAgICAgICAgIGdoaFByZWZPLm1uZ2J0bnN0eWxlWzBdID0gbWJzdHlsZTsKICAgICAgICAgICAgICAgICAgICBpZiAoIUdNNCl7CiAgICAgICAgICAgICAgICAgICAgICAgIEdNX3NldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3RyaW5naWZ5KGdoaFByZWZPKSk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgR00uc2V0VmFsdWUoImdoaHByZWZzIiwgSlNPTi5zdHJpbmdpZnkoZ2hoUHJlZk8pKTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmFkcyA9IGUudGFyZ2V0LnBhcmVudE5vZGUucXVlcnlTZWxlY3RvckFsbCgiaW5wdXRbbmFtZT0nYmxvY2tkaXNwJ10iKTsKICAgICAgICAgICAgZm9yIChpPTA7IGk8cmFkcy5sZW5ndGg7IGkrKyl7CiAgICAgICAgICAgICAgICBpZiAocmFkc1tpXS5jaGVja2VkKXsKICAgICAgICAgICAgICAgICAgICBtYnBhcnRzWzNdID0gcmFkc1tpXS52YWx1ZTsKICAgICAgICAgICAgICAgICAgICBtYnN0eWxlID0gbWJwYXJ0cy5qb2luKCItIik7CiAgICAgICAgICAgICAgICAgICAgZ2hoUHJlZk8ubW5nYnRuc3R5bGVbMF0gPSBtYnN0eWxlOwogICAgICAgICAgICAgICAgICAgIGlmICghR000KXsKICAgICAgICAgICAgICAgICAgICAgICAgR01fc2V0VmFsdWUoImdoaHByZWZzIiwgSlNPTi5zdHJpbmdpZnkoZ2hoUHJlZk8pKTsKICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBHTS5zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByYWRzID0gZS50YXJnZXQucGFyZW50Tm9kZS5xdWVyeVNlbGVjdG9yQWxsKCJpbnB1dFtuYW1lPSdibG9ja3R0aXAnXSIpOwogICAgICAgICAgICBmb3IgKGk9MDsgaTxyYWRzLmxlbmd0aDsgaSsrKXsKICAgICAgICAgICAgICAgIGlmIChyYWRzW2ldLmNoZWNrZWQpewogICAgICAgICAgICAgICAgICAgIG1icGFydHNbNF0gPSByYWRzW2ldLnZhbHVlOwogICAgICAgICAgICAgICAgICAgIG1ic3R5bGUgPSBtYnBhcnRzLmpvaW4oIi0iKTsKICAgICAgICAgICAgICAgICAgICBnaGhQcmVmTy5tbmdidG5zdHlsZVswXSA9IG1ic3R5bGU7CiAgICAgICAgICAgICAgICAgICAgaWYgKCFHTTQpewogICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IEdNLnNldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3RyaW5naWZ5KGdoaFByZWZPKSk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJhZHMgPSBlLnRhcmdldC5wYXJlbnROb2RlLnF1ZXJ5U2VsZWN0b3JBbGwoImlucHV0W25hbWU9J2Jsb2NrcG9zaXQnXSIpOwogICAgICAgICAgICBmb3IgKGk9MDsgaTxyYWRzLmxlbmd0aDsgaSsrKXsKICAgICAgICAgICAgICAgIGlmIChyYWRzW2ldLmNoZWNrZWQpewogICAgICAgICAgICAgICAgICAgIG1icGFydHNbNV0gPSByYWRzW2ldLnZhbHVlOwogICAgICAgICAgICAgICAgICAgIG1ic3R5bGUgPSBtYnBhcnRzLmpvaW4oIi0iKTsKICAgICAgICAgICAgICAgICAgICBnaGhQcmVmTy5tbmdidG5zdHlsZVswXSA9IG1ic3R5bGU7CiAgICAgICAgICAgICAgICAgICAgaWYgKCFHTTQpewogICAgICAgICAgICAgICAgICAgICAgICBHTV9zZXRWYWx1ZSgiZ2hocHJlZnMiLCBKU09OLnN0cmluZ2lmeShnaGhQcmVmTykpOwogICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IEdNLnNldFZhbHVlKCJnaGhwcmVmcyIsIEpTT04uc3Rya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CJjaGVja2VkIiwiY2hlY2tlZCIpOwogICAgICAgICAgICByYWRzW2ldLmNoZWNrZWQgPSB0cnVlOwogICAgICAgIH0KICAgICAgICBlbHNlewogICAgICAgICAgICBpZiAocmFkc1tpXS5oYXNBdHRyaWJ1dGUoImNoZWNrZWQiKSl7CiAgICAgICAgICAgICAgICByYWRzW2ldLnJlbW92ZUF0dHJpYnV0ZSgiY2hlY2tlZCIpOwogICAgICAgICAgICAgICAgcmFkc1tpXS5jaGVja2VkID0gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CiAgICB2YXIgY2hrID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoIm1iaWZyYW1lIik7CiAgICBpZiAobWJzdHlsZS5zcGxpdCgiLSIpWzFdID09ICJpZnJZIil7CiAgICAgICAgY2hrLnNldEF0dHJpYnV0ZSgiY2hlY2tlZCIsImNoZWNrZWQiKTsKICAgICAgICBjaGsuY2hlY2tlZCA9IHRydWU7CiAgICB9IGVsc2UgewogICAgICAgIGNoay5yZW1vdmVBdHRyaWJ1dGUoImNoZWNrZWQiKTsKICAgICAgICBjaGsuY2hlY2tlZCA9IGZhbHNlOwogICAgfQogICAgcmFkcyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJidG5yYWRpb3MiKS5xdWVyeVNlbGVjdG9yQWxsKCJpbnB1dFtuYW1lXj0nbW5nYnRucG9zJ10iKTsKICAgIGZvciAoaT0wOyBpPHJhZHMubGVuZ3RoOyBpKyspewogICAgICAgIGlmIChyYWRzW2ldLnZhbHVlID09IG1ic3R5bGUuc3BsaXQoIi0iKVsyXSl7CiAgICAgICAgICAgIHJhZHNbaV0uc2V0QXR0cmlidXRlKCJjaGVja2VkIiwiY2hlY2tlZCIpOwogICAgICAgICAgICByYWRzW2ldLmNoZWNrZWQgPSB0cnVlOwogICAgICAgIH0KICAgICAgICBlbHNlewogICAgICAgICAgICBpZiAocmFkc1tpXS5oYXNBdHRyaWJ1dGUoIm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iKTsKICAgICAgICAgICAgcmFkc1tpXS5jaGVja2VkID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgZWxzZXsKICAgICAgICAgICAgaWYgKHJhZHNbaV0uaGFzQXR0cmlidXRlKCJjaGVja2VkIikpewogICAgICAgICAgICAgICAgcmFkc1tpXS5yZW1vdmVBdHRyaWJ1dGUoImNoZWNrZWQiKTsKICAgICAgICAgICAgICAgIHJhZHNbaV0uY2hlY2tlZCA9IGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgcmFkcyA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCJidG5yYWRpb3MiKS5xdWVyeVNlbGVjdG9yQWxsKCJpbnB1dFtuYW1lXj0nYmxvY2twb3NpdCddIik7CiAgICBmb3IgKGk9MDsgaTxyYWRzLmxlbmd0aDsgaSsrKXsKICAgICAgICBpZiAocmFkc1tpXS52YWx1ZSA9PSBtYnN0eWxlLnNwbGl0KCItIilbNV0pewogICAgICAgICAgICByYWRzW2ldLnNldEF0dHJpYnV0ZSgiY2hlY2tlZCIsImNoZWNrZWQiKTsKICAgICAgICAgICAgcmFkc1tpXS5jaGVja2VkID0gdHJ1ZTsKICAgICAgICB9CiAgICAgICAgZWxzZXsKICAgICAgICAgICAgaWYgKHJhZHNbaV0uaGFzQXR0cmlidXRlKCJjaGVja2VkIikpewogICAgICAgICAgICAgICAgcmFkc1tpXS5yZW1vdmVBdHRyaWJ1dGUoImNoZWNrZWQiKTsKICAgICAgICAgICAgICAgIHJhZHNbaV0uY2hlY2tlZCA9IGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgdG9nZ2xlY2l0ZWxpbmUobWJzdHlsZS5zcGxpdCgiLSIpWzVdKTsKfQphc3luYyBmdW5jdGlvbiB1cGR0QUpBWChlKXsgLy8gU3RvcmUgc2V0dGluZ3MgZm9yIEFKQVggcHJlZmVyZW5jZXMKICAgIHZhciBjaGsgPSBlLnRhcmdldDsKICAgIGlmIChjaGsuaWQgPT0gImNoa2FqYXgiKXsKICAgICAgICBpZiAoY2hrLmNoZWNrZWQpewogICAgICAgICAgICBiQUpBWCA9ICJvbiI7CiAgICAgICAgICAgIGlmIChjaGdNb24pIGNoZ01vbi5kaXNjb25uZWN0KCk7CiAgICAgICAgICAgIGVsc2UgZG9jdW1lbnQuYm9keS5yZW1vdmVFdmVudExpc3RlbmVyKCJET01TdWJ0cmVlTW9kaWZpZWQiLCBjaGVja09saXN0LCBmYWxzZSk7CiAgICAgICAgICAgIHNldE11dGF0aW9uV2F0Y2goKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBiQUpBWCA9ICJvZmYiOwogICAgICAgICAgICBpZiAoY2hnTW9uKSBjaGdNb24uZGlzY29ubmVjdCgpOwogICAgICAgICAgICBlbHNlIGRvY3VtZW50LmJvZHkucmVtb3ZlRXZlbnRMaXN0ZW5lcigiRE9NU3VidHJlZU1vZGlmaWVkIiwgY2hlY2tPbGlzdCwgZmFsc2UpOwogICAgICAgIH0KICAgIH0gZWxzZSB7CiAgICAgICAgaWYgKGNoay5jaGVja2VkKXsKICAgICAgICAgICAgYk11dE9iID0gIlkiOwogICAgICAgICAgICBpZiAoIWNoZ01vbil7CiAgICAgICAgICAgICAgICBpZiAoYkFKQVgpewogICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmJvZHkucmVtb3ZlRXZlbnRMaXN0ZW5lcigiRE9NU3VidHJlZU1vZGlmaWVkIiwgY2hlY2tPbGlzdCwgZmFsc2UpOwogICAgICAgICAgICAgICAgICAgIHNldE11dGF0aW9uV2F0Y2goKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGJNdXRPYiA9ICJOIjsKICAgICAgICAgICAgaWYgKGNoZ01vbikgY2hnTW9uLmRpc2Nvbm5lY3QoKTsKICAgICAgICAgICAgaWYgKGJBSkFYKXsKICAgICAgICAgICAgICAgIGRvY3VtZW50L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kcmVuWzBdLnRleHRDb250ZW50OwogICAgICAgIGlmIChkb20ubGFzdEluZGV4T2YoIi4iKSA8IGRvbS5sZW5ndGgtMiAmJiBkb20uaW5kZXhPZigiLiIpID4gMCl7CiAgICAgICAgICAgIHN3aXRjaCAodHlwZVJ1bGUpewogICAgICAgICAgICAgICAgY2FzZSAiYXNpcyI6CiAgICAgICAgICAgICAgICAgICAgaWYgKHJvd3NbaV0uY2hpbGRyZW5bMV0udGV4dENvbnRlbnQgPT0gIlBlcm1hLWJhbiIpIG5ld0RvbXMgKz0gZG9tICsgIjpwfCI7CiAgICAgICAgICAgICAgICAgICAgZWxzZSBuZXdEb21zICs9IGRvbSArICI6dHwiOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICBuZXdEb21zICs9IGRvbSArICI6IiArIHR5cGVSdWxlICsgInwiOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJvd3NbaV0uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gIiNmZjAiOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJvd3NbaV0uc3R5bGUuYmFja2dyb3VuZENvbG9yID0gIiNmMDAiOwogICAgICAgIH0KICAgIH0KICAgIGlmIChuZXdEb21zICE9ICIiKXsKICAgICAgICAvLyBCYWNrIHVwIGN1cnJlbnQgYmxvY2sgbGlzdAogICAgICAgIGlmICghR000KXsKICAgICAgICAgICAgR01fc2V0VmFsdWUoImhpZGV5YmFjayIsIGJsaXN0KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBhd2FpdCBHTS5zZXRWYWx1ZSgiaGlkZXliYWNrIiwgYmxpc3QpOwogICAgICAgIH0KICAgICAgICBpZiAoZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImNoa2ltcG9yZXBsIikuY2hlY2tlZCA9PSB0cnVlKXsKICAgICAgICAgICAgaWYgKGNvbmZpcm0oIkRlbGV0ZSB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BqKyspewogICAgICAgICAgICBpZiAoYmFycmF5W2kral0uaW5kZXhPZihiYXJyYXlbaV0uc3Vic3RyKDAsYmFycmF5W2ldLmxlbmd0aC0yKSkgIT0gMCkgYnJlYWs7CiAgICAgICAgICAgIHNtYWluID0gYmFycmF5W2ldLnN1YnN0cigwLGJhcnJheVtpXS5sZW5ndGgtMikuc3BsaXQoIi4iKS5yZXZlcnNlKCkuam9pbigiLiIpOwogICAgICAgICAgICBzdGVzdCA9IGJhcnJheVtpK2pdLnN1YnN0cigwLGJhcnJheVtpK2pdLmxlbmd0aC0yKS5zcGxpdCgiLiIpLnJldmVyc2UoKS5qb2luKCIuIik7CiAgICAgICAgICAgIGlmIChzdGVzdC5pbmRleE9mKHNtYWluKSA8IDApIGJyZWFrOwogICAgICAgICAgICBpZiAoYmFycmF5W2ldLnN1YnN0cihiYXJyYXlbaV0ubGVuZ3RoLTEpID09IGJhcnJheVtpK2pdLnN1YnN0cihiYXJyYXlbaStqXS5sZW5ndGgtMSkpewogICAgICAgICAgICAgICAgYmxpc3QgPSBibGlzdC5yZXBsYWNlKHN0ZXN0ICsgIjoiICsgYmFycmF5W2kral0uc3Vic3RyKGJhcnJheVtpK2pdLmxlbmd0aC0xKSArICJ8IiwgIiIpOwogICAgICAgICAgICAgICAgc3JlbWQgKz0gInxSZW1vdmVkOiAiICsgc3Rlc3QgKyAiOyBDb3ZlcmVkIGJ5OiAiICsgc21haW47CiAgICAgICAgICAgICAgICBpYWRkICs9IDE7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBzdGVzdCArPSAoYmFycmF5W2kral0uc3Vic3RyKGJhcnJheVtpK2pdLmxlbmd0aC0xKSA9PSAidCIpID8gIiAocmVndWxhcikiIDogIiAocGVybWFiYW4pIjsKICAgICAgICAgICAgICAgIHNtYWluICs9IChiYXJyYXlbaV0uc3Vic3RyKGJhcnJheVtpXS5sZW5ndGgtMSkgPT0gInQiKSA/ICIgKHJlZ3VsYXIpIiA6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Lmxlbmd0aDtpKyspewogICAgICAgIGJidG5zW2ldLnJlbW92ZUV2ZW50TGlzdGVuZXIoImNsaWNrIixzaG93YmZkLHRydWUpOwogICAgICAgIGJidG5zW2ldLmFkZEV2ZW50TGlzdGVuZXIoImNsaWNrIixzaG93YmZkLHRydWUpOwogICAgfQogICAgYm5vdGMgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgibmF2Y250IikucXVlcnlTZWxlY3RvckFsbCgiLmdoaGQiKTsKICAgIGZvciAoaT0wO2k8Ym5vdGMubGVuZ3RoO2krKyl7CiAgICAgICAgYm5vdGNbaV0ucmVtb3ZlRXZlbnRMaXN0ZW5lcigiY2xpY2siLHJlc2hvdyx0cnVlKTsKICAgICAgICBibm90Y1tpXS5hZGRFdmVudExpc3RlbmVyKCJjbGljayIscmVzaG93LHRydWUpOwogICAgICAgIGJidG5zID0gYm5vdGNbaV0ucXVlcnlTZWxlY3RvckFsbCgiYnV0dG9uLmdoaGlkZXIiKTsKICAgICAgICBmb3IgKGo9MDtqPGJidG5zLmxlbmd0aDtqKyspewogICAgICAgICAgICBpZiAoYmJ0bnNbal0uZ2V0QXR0cmlidXRlKCJ0aXRsZSIpPT0iVW5ibG9jayB0aGlzIHNpdGUiKXsKICAgICAgICAgICAgICAgIGJidG5zW2pdLnJlbW92ZUV2ZW50TGlzdGVuZXIoImNsaWNrIix1bmJsb2NrLHRydWUpOwogICAgICAgICAgICAgICAgYmJ0bnNbal0uYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLHVuYmxvY2ssdHJ1ZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGJidG5zW2pdLmdldEF0dHJpYnV0ZSgidGl0bGUiKT09IlBlcm1hbmVudGx5IGhpZGUgdGhpcyBzaXRlIil7CiAgICAgICAgICAgICAgICBiYnRuc1tqXS5yZW1vdmVFdmVudExpc3RlbmVyKCJjbGljayIscGVybWJhbix0cnVlKTsKICAgICAgICAgICAgICAgIGJidG5zW2pdLmFkZEV2ZW50TGlzdGVuZXIoImNsaWNrIixwZXJtYmFuLHRydWUpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChiYnRuc1tqXS5nZXRBdHRyaWJ1dGUoInRpdGxlIik9PSJSZS1oaWRlIHRoaXMgaGl0Iil7CiAgICAgICAgICAgICAgICBiYnRuc1tqXS5yZW1vdmVFdmVudExpc3RlbmVyKCJjbGljayIscmVoaWRlLHRydWUpOwogICAgICAgICAgICAgICAgYmJ0bnNbal0uYWRkRXZlbnRMaXN0ZW5lcigiY2xpY2siLHJlaGlkZSx0cnVlKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KfQpmdW5jdGlvbiBjb252ZXJ0UHJlZnMoYXJyUHJlZnMsIGFsbG5ldyl7CiAgICBnaGhQcmVmTyA9IGFyclByZWZzOwogICAgaWYgKEdNNCkgcmV0dXJuOyAvLyBMZWdhY3kgb25seQogICAgaWYgKGFsbG5ldyA9PSAidHJ1ZSIpeyAvLyAxLjMuNyB0byAxLjQueAogICAgICAgIHZhciB0bXAgPSBHTV9nZXRWYWx1ZSgic2hvd25vdGMiKTsKICAgICAgICBpZiAodG1wKXsKICAgICAgICAgICAgaWYgKHRtcC5sZW5ndGggPiAwKSBnaGhQcmVmTy5zaG93bm90Y1swXSA9IHRtcDsKICAgICAgICAgICAgR01fZGVsZXRlVmFsdWUoInNob3dub3RjIik7CiAgICAgICAgfQogICAgICAgIHRtcCA9IEdNX2dldFZhbHVlKCJtbmdwYW5lb3BlbiIpOwogICAgICAgIGlmICh0bXApewogICAgICAgICAgICBpZiAodG1wLmxlbmd0aCA+IDApIGdoaFByZWZPLm1uZ3BhbmVvcGVuWzBdID0gdG1wOwogICAgICAgICAgICBHTV9kZWxldGVWYWx1ZSgibW5ncGFuZW9wZW4iKTsKICAgICAgICB9CiAgICAgICAgdG1wID0gR01fZ2V0VmFsdWUoIm1uZ2J0bnN0eWxlIik7CiAgICAgICAgaWYgKHRtcCl7aWYgKHRtcC5sZW5ndGggPiAwKXsKICAgICAgICAgICAgaWYgKHRtcC5pbmRleE9mKCItIik+LTEpIHRtcCA9ICJib3RoIjsgLy8gZGVmYXVsdCBhbmNpZW50IHByZWYKICAgICAgICAgICAgZ2hoUHJlZk8ubW5nYnRuc3R5bGVbMF0gPSB0bXA7CiAgICAgICAgICAgIEdNX2RlbGV0ZVZhbHVlKCJtbmdidG5zdHlsZSIpOwogICAgICAgIH19CiAgICAgICAgdG1wID0gR01fZ2V0VmFsdWUoImFkZHRvbGlzdHBvcyIpOwogICAgICAgIGlmICh0bXApewogICAgICAgICAgICBpZiAodG1wLmxlbmd0aCA+IDApIGdoaFByZWZPLmFkZHRvbGlzdHBvc1swXSA9IHRtcDsKICAgICAgICAgICAgR01fZGVsZXRlVmFsdWUoImFkZHRvbGlzdHBvcyIpOwogICAgICAgIH0KICAgICAgICB0bXAgPSBHTV9nZXRWYWx1ZSgiYWdncmVzc2l2ZWJsb2NrIik7CiAgICAgICAgaWYgKHRtcCl7CiAgICAgICAgICAgIGlmICh0bXAubGVuZ3RoID4gMCkgZ2hoUHJlZk8uYWdncmVzc2l2ZWJsb2NrWzBdID0gdG1wOwogICAgICAgICAgICBHTV9kZWxldGVWYWx1ZSgiYWdncmVzc2l2ZWJsb2NrIik7CiAgICAgICAgfQogICAgICAgIHRtcCA9IEdNX2dldFZhbHVlKCJ1c2VtdXRhdGlvbiIpOwogICAgICAgIGlmICh0bXApewogICAgICAgICAgICBpZiAodG1wLmxlbmd0aCA+IDApIGdoaFByZWZPLnVzZW11dGF0aW9uWzBdID0gdG1wOwogICAgICAgICAgICBHTV9kZWxldGVWYWx1ZSgidXNlbXV0YXRpb24iKTsKICAgICAgICB9CiAgICB9IGVsc2UgewogICAgICAgIGlmIChnaGhQcmVmcy5pbmRleE9mKCJyZXNlcnZlZDEiKT4tMSl7CiAgICAgICAgICAgIHZhciBvbGRQcmVmcyA9IEpTT04ucGFyc2UoZ2hoUHJlZnMpOwogICAgICAgICAgICBnaGhQc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ChzdGFydGNlbGwucGFyZW50Tm9kZS5uZXh0RWxlbWVudFNpYmxpbmcpeyAvLyBsYXN0IGNlbGwgaW4gcm93IGFuZCB0aGVyZSdzIGFub3RoZXIgcm93CiAgICAgICAgICAgICAgICByZXRjZWxsID0gc3RhcnRjZWxsLnBhcmVudE5vZGUubmV4dEVsZW1lbnRTaWJsaW5nLmNlbGxzWzBdOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7IC8vIGVuZCBvZiB0YWJsZQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGlmICghcmV0Y2VsbCl7CiAgICAgICAgICAgIHJldHVybiBudWxsOyAvLyBjb3JydXB0ZWQgdGFibGUgc3RydWN0dXJlCiAgICAgICAgfQogICAgICAgIGlmIChibG5Ob25FbXB0eSl7CiAgICAgICAgICAgIGlmIChyZXRjZWxsLnF1ZXJ5U2VsZWN0b3IoImxpIikpewogICAgICAgICAgICAgICAgcmV0dXJuIHJldGNlbGw7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBzdGFydGNlbGwgPSByZXRjZWxsOwogICAgICAgICAgICB9CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgcmV0dXJuIHJldGNlbGw7CiAgICAgICAgfQogICAgICAgIGkrKzsKICAgIH0KfQovLyAiQWRkIEFsbCIgZmVhdHVyZSAyLjAuOQphc3luYyBmdW5jdGlvbiBhZGRBbGxOb3coZSl7CiAgICB2YXIgdW5iID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnW2doaHJlc3VsdD0idW5zZXQiXVtnaGhob3N0XScpLCBkb20gPSAnJywgcGRvbSA9ICcnLCBkb21saXN0ID0gJyc7CiAgICBmb3IgKHZhciBpPTA7IGk8dW5iLmxlbmd0aDsgaSsrKXsKICAgICAgICAvLyBDb21wdXRlIGRvbWFpbiBiYXNlZCBvbiB1c2VyIHByZWZlcmVuY2UKICAgICAgICBkb20gPSB1bmJbaV0uZ2V0QXR0cmlidXRlKCdnaGhob3N0Jyk7CiAgICAgICAgcGRvbSA9IGRvbS5zdWJzdHIoZG9tLmluZGV4T2YoJy4nKSArIDEpOwogICAgICAgIGlmIChwZG9tLmluZGV4T2YoJy4nKSA+IC0xICYmIHBhdElQdjQudGVzdChkb20pICE9IHRydWUpewogICAgICAgICAgICBzd2l0Y2ggKGJBZ2dyZXNzKXsKICAgICAgICAgICAgICAgIGNhc2UgJ2FsbCc6CiAgICAgICAgICAgICAgICAgICAgZG9tID0gcGRvbTsgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICd3d3cnOgogICAgICAgICAgICAgICAgICAgIGlmIChkb20uc3Vic3RyKDAsMykgPT0gJ3d3dycpIGRvbSA9IHBkb207IGJyZWFrOwogICAgICAgICAgICAgICAgZGVmYXVsdDoKICAgICAgICAgICAgICAgICAgICAvLyBkZWZhdWx0IHRvIGZ1bGwgZG9tYWluCiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgLy8gQWRkIGRvbSB0byBkb21zIGFycnJheSAoYXZvaWRpbmcgZHVwbGljYXRlcykKICAgICAgICBpZiAoZG9tcy5pbmNsdWRlcyhkb20pICE9PSB0cnVlKSBkb21zLnB1c2goZG9tKTsKICAgIH0KICAgIC8vIEFkZCBuZXcgZG9tYWlucyB0byB0aGUgY3VycmVudGx5IGRpc3BsYXllZCBibG9jayBsaXN0CiAgICBpZiAoZG9jdW1lbnQucXVlcnlTZWxlY3RvcignYnV0dG9uLmdoaEN1clRhYicpLmlkID09ICdnaGh0czMnKXsgLy8gcGJhbgogICAgICAgIGRvbWxpc3QgPSBkb21zLmpvaW4oJzpwfCcpICsgJzpwJzsKICAgIH0gZWxzZSB7IC8vIHJlZ3VsYXIKICAgICAgICBkb21saXN0ID0gZG9tcy5qb2luKCc6dHwnKSArICc6dCc7CiAgICB9CiAgICBpZiAoYmxpc3Quc3Vic3RyKDAsMSkgIT0gJ3wnKSBibGlzdCA9ICd8JyArIGJsaXN0OwogICAgaWYgKGFkZEF0ID09ICdlbmQnKSBibGlzdCArPSBkb21saXN0ICsgJ3wnOwogICAgZWxzZSBibGlzdCA9ICd8JyArIGRvbWxpc3QgKyBibGlzdDsKICAgIG5lZWR1cGRhdGUgPSB0cnVlOwogICAgLy8gU3RvcmUgdGhlIGxpc3QKICAgIGlmICghR000KXsKICAgICAgICBHTV9zZXRWYWx1ZSgnaGlkZXlob3N0cycsIGJsaXN0KTsKICAgIH0gZWxzZSB7CiAgICAgICAgYXdhaXQgR00uc2V0VmFsdWUoJ2hpZGV5aG9zdHMnLCBibGlzdCk7CiAgICB9CiAgICAvLyBBcHBseSB0aGUgY2hhbmdlIHRvIHRoZSByZXN1bHRzCiAgICBoaWRlaGl0cyhudWxsLHRydWUpOwogICAgaWYgKGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdHVFInKSkgcmVtb3ZlUEJzKCk7CiAgICAvLyBVcGRhdGUgdGhlIGRpYWxvZwogICAgaWYgKGFkZEF0ID09ICdzb3J0Jykgc29ydGxpc3QobnVsbCk7CiAgICByZWZyZXNoU2l0ZUxpc3QoKTsKfQo=","resources":[{"meta":{"name":"gfrk-GHHbD-ver222.png","url":"https://www.jeffersonscher.com/gm/src/gfrk-GHHbD-ver222.png","ts":1649415624667,"mimetype":"image/png"},"source":"wolQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgDAAAAKC0PUwAAAARnQU1BAADCr8OINwXCisOpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccOJZTwAAAAGUExURcOMAADDv8O/w7/Dg8OzQRIAAAACdFJOU8O/AMOlwrcwSgAAAD9JREFUeMOawozCj8ORCgBABARnw7/Dv8Knwq9EwosHwp0HamInaBVfAAITw5PCgMKsAsOZw5QBI8Kjw7Z3RsK3aMKGw4rDpgBTw61QfMKnZsK5wp97AgwAW1MAwqEHOh5OAAAAAElFTkTCrkJgwoI="}]},{"name":"Direct links out","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["*://google.*","*://www.google.*","*://encrypted.google.*"],"orig_matches":["*://yandex.ru/*","*://yandex.ua/*","*://yandex.by/*","*://yandex.kz/*","*://yandex.com.tr/*","*://yandex.com/*","*://*.yandex.ru/*","*://*.yandex.ua/*","*://*.yandex.by/*","*://*.yandex.kz/*","*://*.yandex.com.tr/*","*://*.yandex.com/*","*://youtube.com/*","*://*.youtube.com/*","*://wikimapia.org/*","*://deviantart.com/*","*://*.deviantart.com/*","*://joyreactor.cc/*","*://*.joyreactor.cc/*","*://reactor.cc/*","*://*.reactor.cc/*","*://joyreactor.com/*","*://*.joyreactor.com/*","*://vk.com/*","*://*.vk.com/*","*://ok.ru/*","*://*.ok.ru/*","*://steamcommunity.com/*","*://*.steamcommunity.com/*","*://facebook.com/*","*://*.facebook.com/*","*://twitter.com/*","*://*.twitter.com/*","*://4pda.ru/*","*://*.4pda.ru/*","*://kat.cr/*","*://kickassto.co/*","*://katproxy.is/*","*://thekat.tv/*","*://*.kat.cr/*","*://*.kickassto.co/*","*://*.katproxy.is/*","*://*.thekat.tv/*","*://addons.mozilla.org/*","*://pixiv.net/*","*://*.pixiv.net/*","*://tumblr.com/*","*://*.tumblr.com/*","*://danieldefo.ru/*","*://*.danieldefo.ru/*","*://yaplakal.com/*","*://*.yaplakal.com/*","*://soundcloud.com/*","*://*.soundcloud.com/*","*://upwork.com/*","*://*.upwork.com/*","*://picarto.tv/*","*://*.picarto.tv/*","*://taker.im/*","*://*.taker.im/*","*://*.forumavia.ru/*","*://*.slack.com/*","*://instagram.com/*","*://*.instagram.com/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1525361734624,"data":{}},"enabled":true,"position":9,"file_url":"https://openuserjs.org/install/nokeya/Direct_links_out.user.js","uuid":"f7dfc06c-8af4-4016-92f9-e21c74771af5","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIERpcmVjdCBsaW5rcyBvdXQKLy8gQG5hbWU6cnUgICAgINCf0YDRj9C80YvQtSDRgdGB0YvQu9C60Lgg0L3QsNGA0YPQttGDCi8vIEBkZXNjcmlwdGlvbiBSZW1vdmVzIGFsbCAiWW91IGFyZSBsZWF2aW5nIG91ciBzaXRlIiBhbmQgcmVkaXJlY3Rpb24gc3R1ZmYgZnJvbSBsaW5rcwovLyBAZGVzY3JpcHRpb246cnUg0KPQsdC40YDQsNC10YIgItCR0LvQsC3QsdC70LAt0LHQu9CwLCDQktGLINC/0L7QutC40LTQsNC10YLQtSDQvdCw0Ygg0YHQsNC50YIiINC4INC/0LXRgNC10LDQtNGA0LXRgdCw0YbQuNC4INC40Lcg0YHRgdGL0LvQvtC6Ci8vIEBuYW1lc3BhY2UgICBodHRwczovL2dpdGh1Yi5jb20vbm9rZXlhCi8vIEBhdXRob3IgICAgICBub2tleWEKLy8gQHVwZGF0ZSAgICAgIGh0dHBzOi8vZ2l0aHViLmNvbS9ub2tleWEvZGlyZWN0LWxpbmtzLW91dC9yYXcvbWFzdGVyL2RpcmVjdC1saW5rcy1vdXQudXNlci5qcwovLyBAaWNvbiAgICAgICAgaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL25va2V5YS9kaXJlY3QtbGlua3Mtb3V0L21hc3Rlci9pY29uLnBuZwovLyBAdmVyc2lvbiAgICAgMi4xOQovLyBAZ3JhbnQgICAgICAgbm9uZQovL2dvb2dsZQovLyBAaW5jbHVkZSAgICAgKjovL2dvb2dsZS4qCi8vIEBpbmNsdWRlICAgICAqOi8vd3d3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aXB0PT0KKGZ1bmN0aW9uKCkgewogICAgLy8gYW5jaG9ycyBhbmQgZnVuY3Rpb25zCiAgICB2YXIgYW5jaG9yOwogICAgdmFyIGFmdGVyOwogICAgdmFyIHJ3TGluayA9IGZ1bmN0aW9uKCl7fTsKICAgIHZhciByd0FsbCA9IGZ1bmN0aW9uKCl7fTsKICAgIHZhciByZXRUcnVlID0gZnVuY3Rpb24oKSB7IHJldHVybiB0cnVlOyB9OyAvL2R1bW15IGZ1bmN0aW9uIHRvIGFsd2F5cyByZXR1cm4gdHJ1ZQoKICAgIC8vIHNpbXBsZSByZXdyaXRlIGxpbmsgLSAgYmFzZWQgb24gYW5jaG9ycwogICAgZnVuY3Rpb24gcndTaW1wbGUobGluayl7CiAgICAgICAgaWYgKGFuY2hvcil7CiAgICAgICAgICAgIHZhciBuZHggPSBsaW5rLmhyZWYuaW5kZXhPZihhbmNob3IpOwogICAgICAgICAgICBpZiAobmR4ICE9IC0xKXsKICAgICAgICAgICAgICAgIHZhciBuZXdsaW5rID0gbGluay5ocmVmLnN1YnN0cmluZyhuZHggKyBhbmNob3IubGVuZ3RoKTsKICAgICAgICAgICAgICAgIGlmIChhZnRlcil7CiAgICAgICAgICAgICAgICAgICAgbmR4ID0gbmV3bGluay5pbmRleE9mKGFmdGVyKTsKICAgICAgICAgICAgICAgICAgICBpZiAobmR4ICE9IC0xKQogICAgICAgICAgICAgICAgICAgICAgICBuZXdsaW5rID0gbmV3bGluay5zdWJzdHJpbmcoMCwgbmR4KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGxpbmsuaHJlZiA9IHVuZXNjYXBlKG5ld2xpbmspOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfQogICAgZnVuY3Rpb24gcndhU2ltcGxlKCl7CiAgICAgICAgdmFyIGxpbmtzID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2EnKTsKICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpbmtzLmxlbmd0aDsgKytpKQogICAgICAgICAgICByd0xpbmsobGlua3NbaV0pOwogICAgfQogICAgLy8gdmsKICAgIGZ1bmN0aW9uIHJ3VksobGluayl7CiAgICAgICAgaWYgKGxpbmsuY2xhc3NOYW1lID09PSAncGFnZV9tZWRpYV9saW5rX3RodW1iJykKICAgICAgICB7CiAgICAgICAgICAgIHZhciBwYXJlbnQgPSBsaW5rLnBhcmVudE5vZGU7CiAgICAgICAgICAgIGxpbmsuaHJlZiA9IHBhcmVudC5nZXRBdHRyaWJ1dGUoImhyZWYiKTsKICAgICAgICAgICAgcGFyZW50LnJlbW92ZUF0dHJpYnV0ZSgnaHJlZicpOwogICAgICAgICAgICBwYXJlbnQucmVtb3ZlQXR0cmlidXRlKCdvbmNsaWNrJyk7CiAgICAgICAgICAgIGxpbmsucmVtb3ZlQXR0cmlidXRlKCdvbmNsaWNrJyk7CiAgICAgICAgfQoKICAgICAgICB2YXIgbmR4ID0gbGluay5ocmVmLmluZGV4T2YoYW5jaG9yKTsKICAgICAgICBpZiAobmR4ICE9IC0xKXsKICAgICAgICAgICAgdmFyIG5ld2xpbmsgPSBsaW5rLmhyZWYuc3Vic3RyaW5nKG5keCArIGFuY2hvci5sZW5ndGgpOwogICAgICAgICAgICB2YXIgYWZ0ZXJBcnIgPSBbJyZwb3N0PScsICcmZWw9c25pcHBldCcsICcmY2Nfa2V5PSddOwogICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGFmdGVyQXJyLmxlbmd0aDsgKytpKXsKICAgICAgICAgICAgICAgIG5keCA9IG5ld2xpbmsuaW5kZXhPZihhZnRlckFycltpXSk7CiAgICAgICAgICAgICAgICBpZiAobmR4ICE9IC0xKQogICAgICAgICAgICAgICAgICAgIG5ld2xpbmsgPSBuZXdsaW5rLnN1YnN0cmluZygwLCBuZHgpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGxpbmsuaHJlZiA9IHVuZXNjYXBlKG5ld2xpbmspOwogICAgICAgIH0K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xhY2UoLyhtb3VzZWRvd246aXJjLnJsfGtleWRvd246aXJjLnJsaykvZywnJykpOwogICAgICAgIH0KICAgIH0KCiAgICAvLyB5YW5kZXgKICAgIGZ1bmN0aW9uIHJ3WWFuZGV4KGxpbmspewogICAgICAgIC8vIG1haW4gc2VhcmNoCiAgICAgICAgaWYgKGxpbmsuaGFzQXR0cmlidXRlKCdvbm1vdXNlZG93bicpKQogICAgICAgICAgICBsaW5rLnJlbW92ZUF0dHJpYnV0ZSgnb25tb3VzZWRvd24nKTsKICAgICAgICAvLyBpbWFnZXMKICAgICAgICBhbmNob3IgPSAnJmltZ191cmw9JzsKICAgICAgICBhZnRlciA9ICcmcG9zPSc7CiAgICAgICAgcndTaW1wbGUobGluayk7CiAgICB9CiAgICAvL21vemlsbGEgYWRkb25zIHN0b3JlCiAgICBmdW5jdGlvbiByd0FNTyhsaW5rKXsKICAgICAgICBpZiAoL291dGdvaW5nLnByb2QubW96YXdzLm5ldC9pLnRlc3QobGluay5ocmVmKSl7CiAgICAgICAgICAgIHZhciB0bXAgPSBsaW5rLmhyZWY7CiAgICAgICAgICAgIGxpbmsuaHJlZiA9ICIjIjsKICAgICAgICAgICAgLy8gd2UgaGF2ZSB0byBmaWdodCBtb3ppbGxhJ3MgcmVwbGFjaW5nIG9mIGRpcmVjdCByZWRpcmVjdCBzdHJpbmcgd2l0aCBqcXVlcnkgZXZlbnRzCiAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXsgbGluay5ocmVmID0gdW5lc2NhcGUodG1wLnJlcGxhY2UoLyhodHRwfGh0dHBzKTpcL1wvb3V0Z29pbmcucHJvZC5tb3phd3MubmV0XC92MVwvWzAtOWEtekEtWl0rXC8vaSwnJykpOyB9LCAxMDApOwogICAgICAgIH0KICAgIH0KCiAgICAvLyBkYW5pdWVsZGVmbwogICAgZnVuY3Rpb24gcndEYW5pZWxEZWZvKGxpbmspewogICAgICAgIGlmIChsaW5rLmhhc0F0dHJpYnV0ZSgnZGF0YS1wcm94eS1ocmVmJykpCiAgICAgICAgICAgIGxpbmsucmVtb3ZlQXR0cmlidXRlKCdkYXRhLXByb3h5LWhyZWYnKTsKICAgIH0KCiAgICAvLyBzbGFjawogICAgZnVuY3Rpb24gcndTbGFjayhsaW5rKXsKICAgICAgICBsaW5rLnJlbW92ZUF0dHJpYnV0ZSgnb25jbGljaycpOwogICAgICAgIGxpbmsucmVtb3ZlQXR0cmlidXRlKCdvbm1vdXNlb3ZlcicpOwogICAgfQoKICAgIC8vIGRldGVybWluZSBhbmNob3JzLCBmdW5jdGlvbnMgYW5kIGxpc3RlbmVycwogICAgKGZ1bmN0aW9uICgpCiAgICB7CiAgICAgICAgcndMaW5rID0gcndTaW1wbGU7CiAgICAgICAgcndBbGwgPSByd2FTaW1wbGU7CgogICAgICAgIHZhciBsb2MgPSB3aW5kb3cubG9jYXRpb24uaG9zdG5hbWU7CiAgICAgICAgaWYgKC9nb29nbGUvaS50ZXN0KGxvYykpCiAgICAgICAgICAgIHJ3TGluayA9IHJ3R29vZ2xlOwogICAgICAgIGVsc2UgaWYgKC95b3V0dWJlL2kudGVzdChsb2MpKXsKICAgICAgICAgICAgYW5jaG9yID0gJ3JlZGlyZWN0P3E9JzsKICAgICAgICAgICAgYWZ0ZXIgPSAnJnJlZGlyX3Rva2VuPSc7CiAgICAgICAgICAgIHJ3TGluayA9IHJ3WW91dHViZTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoL2ZhY2Vib29rL2kudGVzdChsb2MpKXsKICAgICAgICAgICAgYW5jaG9yID0gJ3U9JzsKICAgICAgICAgICAgYWZ0ZXIgPSAnJmg9JzsKICAgICAgICAgICAgcndMaW5rID0gcndGYWNlYm9vazsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoL2luc3RhZ3JhbS9pLnRlc3QobG9jKSl7CiAgICAgICAgICAgIGFuY2hvciA9ICd1PSc7CiAgICAgICAgICAgIGFmdGVyID0gJyZlPSc7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKC90d2l0dGVyL2kudGVzdChsb2MpKXsKICAgICAgICAgICAgcndMaW5rID0gcndUd2l0dGVyOwogICAgICAgICAgICByd0FsbCA9IHJ3YVR3aXR0ZXI7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYgKC95YW5kZXgvaS50ZXN0KGxvYykpCiAgICAgICAgICAgIHJ3TGluayA9IHJ3WWFuZGV4OwogICAgICAgIGVsc2UgaWYgKC92ay9pLnRlc3QobG9jKSl7CiAgICAgICAgICAgIGFuY2hvciA9ICd0bz0nOwogICAgICAgICAgICByd0xpbmsgPSByd1ZLOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmICgvb2svaS50ZXN0KGxvYykpewogICAgICAgICAgICBhbmNob3IgPSAnc3QubGluaz0nOwogICAgICAgICAgICBhZnRlciA9ICcmc3QubmFtZT0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmICgvcGl4aXYvaS50ZXN0KGxvYykpCiAgICAgICAgICAgIGFuY2hvciA9ICdqdW1wLnBocD8nOwogICAgICAgIGVsc2UgaWYgKC90dW1ibHIvaS50ZXN0KGxvYykpewogICAgICAgICAgICBhbmNob3IgPSAicmVkaXJlY3Q/ej0iOwogICAgICAgICAgICBhZnRlciA9ICImdD0iOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmICgvZGV2aWFudGFydC9pLnRlc3QobG9jKSkKICAgICAgICAgICAgYW5jaG9yID0gJ291dGdvaW5nPyc7CiAgICAgICAgZWxzZSBpZiAoLyhzdGVhbXxyZWFjdG9yKS9pLnRlc3QobG9jKSkKICAgICAgICAgICAgYW5jaG9yID0gJ3VybD0nOwogICAgICAgIGVsc2UgaWYgKC8oa2F0fGtpY2thc3MpL2kudGVzdChsb2MpKXsKICAgICAgICAgICAgYW5jaG9yID0gJ2NvbmZpcm0vdXJsLyc7CiAgICAgICAgICAgIHJ3TGluayA9IHJ3S2lja2FzczsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoL3NvdW5kY2xvdWQvaS50ZXN0KGxvYykpCiAgICAgICAgICAgIGFuY2hvciA9ICJleGl0LnNjLz91cmw9IjsKICAgICAgICBlbHNlIGlmICgvdXB3b3JrL2kudGVzdChsb2MpKQogICAgICAgICAgICBhbmNob3IgPSAnbGVhdmluZy1vZGVzaz9yZWY9JzsKICAgICAgICBlbHNlIGlmICgvNHBkYS9pLnRlc3QobG9jKSl7CiAgICAgICAgICAgIGFuY2hvciA9ICdnby8/dT0nOwogICAgICAgICAgICBhZnRlciA9ICcmZT0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmICgvbW96aWxsYS9pLnRlc3QobG9jKSkKICAgICAgICAgICAgcndMaW5rID0gcndBTU87CiAgICAgICAgZWxzZSBpZiAoL2RhbmllbGRlZm8vaS50ZXN0KGxvYykpCiAgICAgICAgICAgIHJ3TGluayA9IHJ3RGFuaWVsRGVmbzsKICAgICAgICBlbHNlIGlmICgveWFwbGFrYWwvaS50ZXN0KGxvYykpCiAgICAgICAgICAgIGFuY2hvciA9ICJnby8/IjsKICAgICAgICBlbHNlIGlmICgvd2lraW1hcGlhLm9yZy9pLnRlc3QobG9jKSkKICAgICAgICAgICAgYW5jaG9yID0gJ2V4dGVybmFsX2xpbms/dXJsPSc7CiAgICAgICAgZWxzZSBpZiAoL2ZvcnVtYXZpYS5ydS9pLnRlc3QobG9jKSkKICAgICAgICAgICAgYW5jaG9yID0gJy9lLz9sPSc7CiAgICAgICAgZWxzZSBpZiAoL3BpY2FydG8vaS50ZXN0KGxvYykpewogICAgICAgICAgICBhbmNob3IgPSAicmVmZXJyZXI/Z289IjsKICAgICAgICAgICAgYWZ0ZXIgPSAiJnJlZj0iOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmICgvdGFrZXIvaS50ZXN0KGxvYykpCiAgICAgICAgICAgIGFuY2hvciA9ICJwaHBCQjIvZ290by8iOwogICAgICAgIGVsc2UgaWYgKC9zbGFjay9pLnRlc3QobG9jKSkKICAgICAgICAgICAgcndMaW5rID0gcndTbGFjazsKCiAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignRE9NTm9kZUluc2VydGVkJywgZnVuY3Rpb24oZXZlbnQpewogICAgICAgICAgICBpZiAoIWV2ZW50IHx8ICFldmVudC50YXJnZXQgfHwgIShldmVudC50YXJnZXQgaW5zdGFuY2VvZiBIVE1MRWxlbWVudCkpCiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIHZhciBub2RlID0gZXZlbnQudGFyZ2V0OwogICAgICAgICAgICBpZiAobm9kZSBpbnN0YW5jZW9mIEhUTUxBbmNob3JFbGVtZW50KQogICAgICAgICAgICAgICAgcndMaW5rKG5vZGUpOwogICAgICAgICAgICB2YXIgbGlua3MgPSBub2RlLmdldEVsZW1lbnRzQnlUYWdOYW1lKCdhJyk7CiAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlua3MubGVuZ3RoOyArK2kpCiAgICAgICAgICAgICAgICByd0xpbmsobGlua3NbaV0pOwogICAgICAgIH0sIGZhbHNlKTsKICAgIH0pKCk7CiAgICByd0FsbCgpOwp9KSgpOwo="},{"name":"AdsBypasser","options":{"check_for_updates":true,"compat_foreach":false,"compat_metadata":false,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":["*"],"orig_excludes":[],"orig_includes":["http://*","https://*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":["binbox.io"],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1650052370947,"data":{"align_center":"btrue","change_background":"btrue","external_server_support":"bfalse","log_level":"n1","redirect_image":"btrue","scale_image":"btrue","version":"n4"}},"enabled":true,"position":10,"file_url":"https://adsbypasser.github.io/releases/adsbypasser.full.es7.user.js","uuid":"07631f02-8bd1-41d7-b717-38c702eff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ICAgICAgICAgICAgaGVscDogJ1doZW4gaW1hZ2UgbG9hZGVkLCBzY2FsZSBpdCB0byBmaXQgd2luZG93IGlmIHBvc3NpYmxlLiAoZGVmYXVsdDogZW5hYmxlZCknLAogICAgICAgICAgfSwKICAgICAgICAgIGxvZ19sZXZlbDogewogICAgICAgICAgICB0eXBlOiAnc2VsZWN0JywKICAgICAgICAgICAgdmFsdWU6IGF3YWl0IHV0aWxfcGxhdGZvcm1fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzJfX1siR01BUEkiXS5nZXRWYWx1ZSgnbG9nX2xldmVsJyksCiAgICAgICAgICAgIG1lbnU6IFsKICAgICAgICAgICAgICBbMCwgJzAgKHF1aWV0KSddLAogICAgICAgICAgICAgIFsxLCAnMSAoZGVmYXVsdCknXSwKICAgICAgICAgICAgICBbMiwgJzIgKHZlcmJvc2UpJ10sCiAgICAgICAgICAgIF0sCiAgICAgICAgICAgIGxhYmVsOiAnTG9nIExldmVsJywKICAgICAgICAgICAgaGVscDogWwogICAgICAgICAgICAgICdMb2cgbGV2ZWwgaW4gZGV2ZWxvcGVyIGNvbnNvbGUuIChkZWZhdWx0OiAxKScsCiAgICAgICAgICAgICAgJzAgd2lsbCBub3QgcHJpbnQgYW55dGhpbmcgaW4gY29uc29sZS4nLAogICAgICAgICAgICAgICcxIHdpbGwgb25seSBwcmludCBsb2dzIG9uIGFmZmVjdGVkIHNpdGVzLicsCiAgICAgICAgICAgICAgJzIgd2lsbCBwcmludCBvbiBhbnkgc2l0ZXMuJywKICAgICAgICAgICAgXS5qb2luKCc8YnIvPlxuJyksCiAgICAgICAgICB9LAogICAgICAgIH0sCiAgICAgIH0pOwogICAgfSwKICB9KTsKfQpmdW5jdGlvbiB3YWl0Rm9yUGFnZSAoKSB7CiAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7CiAgICBjb25zdCBpID0gc2V0SW50ZXJ2YWwoKCkgPT4gewogICAgICBpZiAodXRpbF9wbGF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F0dHJpYnV0ZXM6IHRydWUsCiAgICAgICAgICB9LCAobXV0YXRpb24pID0+IHsKICAgICAgICAgICAgaWYgKCFtdXRhdGlvbi50YXJnZXQudmFsdWUgfHwgbXV0YXRpb24uYXR0cmlidXRlTmFtZSAhPT0gJ3ZhbHVlJykgewogICAgICAgICAgICAgIHJldHVybiBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyJfIl0ubm9uZTsKICAgICAgICAgICAgfQogICAgICAgICAgICBpSW4udmFsdWUgPSAnVHJhY2tpbmcgdG9vIG11Y2ggaHVydHMgdXNlcnNcJyBwcml2YWN5JzsKICAgICAgICAgICAgaWYgKCFjYW5GYXN0UmVkaXJlY3QoKSkgewogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siXyJdLndhaXQoNjAwKTsKICAgICAgICAgIH0pOwogICAgICAgICAgaWYgKHApIHsKICAgICAgICAgICAgYXdhaXQgcDsKICAgICAgICAgICAgZi5zdWJtaXQoKTsKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuOwogICAgICB9CiAgICAgIGNvbnN0IGwgPSBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyIkIl0uJCQoJyNzbGlua3MgPiBhJyk7CiAgICAgIGlmIChsLmxlbmd0aCA9PT0gMSkgewogICAgICAgIGF3YWl0IF9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIiQiXS5vcGVuTGluayhsWzBdLmhyZWYpOwogICAgICB9CiAgICB9LAogIH0pOwogIGZ1bmN0aW9uIGNhbkZhc3RSZWRpcmVjdCAoKSB7CiAgICByZXR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GVzLmZvckVhY2goKG5vZGUpID0+IHsKICAgICAgICAgICAgaWYgKG5vZGUubG9jYWxOYW1lID09PSAnc2NyaXB0JykgewogICAgICAgICAgICAgIGNvbnN0IG0gPSBub2RlLnRleHRDb250ZW50Lm1hdGNoKFBBVFRFUk4pOwogICAgICAgICAgICAgIGlmIChtKSB7CiAgICAgICAgICAgICAgICBvYnNlcnZlci5kaXNjb25uZWN0KCk7CiAgICAgICAgICAgICAgICByZXNvbHZlKG0pOwogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSk7CiAgICAgIH0pOwogICAgICBvYnNlcnZlci5vYnNlcnZlKGRvY3VtZW50LmJvZHksIHsKICAgICAgICBjaGlsZExpc3Q6IHRydWUsCiAgICAgIH0pOwogICAgfSkudGhlbigobSkgPT4gewogICAgICByZXR1cm4gX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siXyJdLmV2aWwoYCgke21bMF19KWApOwogICAgfSk7CiAgfQogIGZ1bmN0aW9uIHRyeUxpbmsgKGFyZ3MpIHsKICAgIGNvbnN0IHVybCA9IHdpbmRvdy5sb2NhdGlvbi5wYXRobmFtZSArICcvc2tpcF90aW1lcic7CiAgICBjb25zdCBpID0gc2V0SW50ZXJ2YWwoKCkgPT4gewogICAgICBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyIkIl0ucG9zdCh1cmwsIGFyZ3MpLnRoZW4oKHRleHQpID0+IHsKICAgICAgICBjb25zdCBqaiA9IEpTT04ucGFyc2UodGV4dCk7CiAgICAgICAgaWYgKCFqai5lcnJvcnMgJiYgamoubWVzc2FnZXMpIHsKICAgICAgICAgIGNsZWFySW50ZXJ2YWwoaSk7CiAgICAgICAgICBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RV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IF4gYVtqXTsKICAgICAgICAgICAgaWYgKGIgPCAxMCkgewogICAgICAgICAgICAgIGFbaV0gPSBiOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGkgPSBqOwogICAgICAgICAgICBqID0gYS5sZW5ndGg7CiAgICAgICAgICB9CiAgICAgICAgfQogICAgICB9CiAgICB9CiAgICB0b2tlbiA9IGEuam9pbignJyk7CiAgICB0b2tlbiA9IGF0b2IodG9rZW4pOwogICAgdG9rZW4gPSB0b2tlbi5zdWJzdHJpbmcoMTYpOwogICAgdG9rZW4gPSB0b2tlbi5zdWJzdHJpbmcoMCwgdG9rZW4ubGVuZ3RoIC0gMTYpOwogICAgaWYgKGxvY2F0aW9uLmhhc2gpIHsKICAgICAgdG9rZW4gKz0gbG9jYXRpb24uaGFzaDsKICAgIH0KICAgIHJldHVybiB0b2tlbjsKICB9Cn0pKCk7Cl9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIl8iXS5yZWdpc3Rlcih7CiAgcnVsZTogJ2h0dHA6Ly9hZGZvYy51cy8qJywKICBhc3luYyByZWFkeSAoKSB7CiAgICBjb25zdCBwcm9taXNlID0gbmV3IFByb21pc2UoKHJlc29sdmUpID0+IHsKICAgICAgY29uc3Qgcm9vdCA9IGRvY3VtZW50LmJvZHk7CiAgICAgIGNvbnN0IG9ic2VydmVyID0gbmV3IE11dGF0aW9uT2JzZXJ2ZXIoKCkgPT4gewogICAgICAgIGxldCBvID0gX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siJCJdLiQoJyNzaG93U2tpcCcpOwogICAgICAgIGlmIChvKSB7CiAgICAgICAgICBvYnNlcnZlci5kaXNjb25uZWN0KCk7CiAgICAgICAgICBvID0gby5xdWVyeVNlbGVjdG9yKCdhJyk7CiAgICAgICAgICByZXNvbHZlKG8uaHJlZik7CiAgICAgICAgfQogICAgICB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pbWV9YDsKICAgICAgYXdhaXQgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siXyJdLndhaXQoNTAwMCk7CiAgICAgIGxldCBydiA9IGF3YWl0IF9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIiQiXS5wb3N0KHVybCwgewogICAgICAgIHhkZjogewogICAgICAgICAgYWZnOiAzMDAsCiAgICAgICAgICBiZmc6IDY0MCwKICAgICAgICAgIGNmZzogNDgwLAogICAgICAgICAgamtpOiB0b2tlbi5qa2ksCiAgICAgICAgICBkZmc6IDY0MCwKICAgICAgICAgIGVmZzogNDgwLAogICAgICAgICAgcnQ6IHRva2VuLnJ0LAogICAgICAgIH0sCiAgICAgICAgb2prOiB0b2tlbi5vamssCiAgICAgIH0pOwogICAgICBydiA9IEpTT04ucGFyc2UocnYpOwogICAgICBpZiAocnYuZXJyb3IpIHsKICAgICAgICB0aHJvdyBuZXcgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siXyJdLkFkc0J5cGFzc2VyRXJyb3IoJ2F1dGggZXJyb3InKTsKICAgICAgfQogICAgICBhd2FpdCBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyIkIl0ub3BlbkxpbmsocnYubWVzc2FnZS51cmwpOwogICAgfSwKICB9KTsKICBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyJfIl0ucmVnaXN0ZXIoewogICAgcnVsZTogewogICAgICBob3N0OiBbCiAgICAgICAgL15teWxpbmtcLnVzJC8sCiAgICAgICAgL154YWZveFwuY29tJC8sCiAgICAgICAgL156cG96XC5uZXQkLywKICAgICAgICAvXnd3d1wuYWRqZXRcLmV1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X19bIiQiXS5vcGVuTGluayhkWzFdKTsKICAgIH0sCiAgfSk7CiAgZnVuY3Rpb24gaG9zdE1hcHBlciAoaG9zdCkgewogICAgc3dpdGNoIChob3N0KSB7CiAgICBjYXNlICdkaXNpbmdrYXQuaW4nOgogICAgICByZXR1cm4gKCkgPT4gewogICAgICAgIGNvbnN0IGEgPSBPYmplY3QoX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siJCJdKSgnYS5idG4tYmxvY2sucmVkaXJlY3QnKTsKICAgICAgICByZXR1cm4gYS5ocmVmOwogICAgICB9OwogICAgY2FzZSAnY29lZy5pbic6CiAgICBjYXNlICd3d3cudGVsb25kYXNtdS5jb20nOgogICAgY2FzZSAnd3d3LnNpb3RvbmcuY29tJzoKICAgIGNhc2UgJ3d3dy5zaWhlcnAuY29tJzoKICAgIGNhc2UgJ3d3dy5ncmVnZXQuc3BhY2UnOgogICAgICByZXR1cm4gKCkgPT4gewogICAgICAgIGNvbnN0IGEgPSBPYmplY3QoX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siJCJdKSgnLmRvd25sb2FkLWxpbmsgYScpOwogICAgICAgIHJldHVybiBhLmhyZWY7CiAgICAgIH07CiAgICBkZWZhdWx0OgogICAgICByZXR1cm4gbnVsbDsKICAgIH0KICB9Cn0pKCk7Cl9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIl8iXS5yZWdpc3Rlcih7CiAgcnVsZTogewogICAgaG9zdDogWwogICAgICAvXig/OihcdyspXC4pP2NvaW51cmxcLmNvbSQvLAogICAgICAvXig/OihcdyspXC4pP2N1clwubHYkLywKICAgIF0sCiAgICBwYXRoOiAvXlwvKFstXHddKykkLywKICB9LAogIGFzeW5jIHJlYWR5IChtKSB7CiAgICBfQURTQllQQVNTRVJ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mx9IilgOwogICAgdW5zYWZlID0gKDAsIGV2YWwpKHVuc2FmZSk7CiAgICByZXR1cm4gdW5zYWZlOwogIH0KICBmdW5jdGlvbiBDb252ZXJ0RnJvbUhleCAoc3RyKSB7CiAgICBjb25zdCByZXN1bHQgPSBbXTsKICAgIHdoaWxlIChzdHIubGVuZ3RoID49IDIpIHsKICAgICAgcmVzdWx0LnB1c2goU3RyaW5nLmZyb21DaGFyQ29kZShwYXJzZUludChzdHIuc3Vic3RyaW5nKDAsIDIpLCAxNikpKTsKICAgICAgc3RyID0gc3RyLnN1YnN0cmluZygyLCBzdHIubGVuZ3RoKTsKICAgIH0KICAgIHJldHVybiByZXN1bHQuam9pbignJyk7CiAgfQogIGNvbnN0IEVuY29kZSA9IGZ1bmN0aW9uIChzdHIpIHsKICAgIHZhciBzID0gW10sIGogPSAwLCB4LCByZXMgPSAnJywgayA9IGFyZ3VtZW50cy5jYWxsZWUudG9TdHJpbmcoKS5yZXBsYWNlKC9ccysvZywgJycpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7IGkrKykgewogICAgICBzW2ldID0gaTsKICAgIH0KICAgIGZvciAoaSA9IDA7IGkgPCAyNTY7IGkrKykgewogICAgICBqID0gKGogKyBzW2ldICsgay5jaGFyQ29kZUF0KGkgJSBrLmxlbmd0aCkpICUgMjU2OwogICAgICB4ID0gc1tpXTsKICAgICAgc1tpXSA9IHNbal07CiAgICAgIHNbal0gPSB4OwogICAgfQogICAgaSA9IDA7CiAgICBqID0gMDsKICAgIGZvciAodmFyIHkgPSAwOyB5IDwgc3RyLmxlbmd0aDsgeSsrKSB7CiAgICAgIGkgPSAoaSArIDEpICUgMjU2OwogICAgICBqID0gKGogKyBzW2ldKSAlIDI1NjsKICAgICAgeCA9IHNbaV07CiAgICAgIHNbaV0gPSBzW2pdOwogICAgICBzW2pdID0geDsKICAgICAgcmVzICs9IFN0cmluZy5mcm9tQ2hhckNvZGUoc3RyLmNoYXJDb2RlQXQoeSkgXi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JC8sCiAgICAgICAgL14oYWR6dXJsfGxpbmsybGluaylcLmNmJC8sCiAgICAgICAgL14obWxpbmt8Y2wyNTB8eHBpY2tsZXxpbmZvc2VoYXRrdSlcLmNsdWIkLywKICAgICAgICAvXigzYnN0fGNvaW5saW5rfGl0aXVybHxjb3NoaW5rfGxpbms1c3xjdXJzfG1ha2V1cmx8bW9vZGRpc29yZGVyfGN1dGxzKVwuY28kLywKICAgICAgICAvXmJlc3RzY2hvbGFlc2hpcGRlZ3JlZVwuZGF0ZSQvLAogICAgICAgIC9eY2xpY2syc2VlXC5kZXNpJC8sCiAgICAgICAgL14odG55fHRpbnkpXC5lYyQvLAogICAgICAgIC9eOG9cLmVlJC8sCiAgICAgICAgL15wYTRsXC5lc3lcLmVzJC8sCiAgICAgICAgL14oc2hvcnRlYXJufGVucnQpXC5ldSQvLAogICAgICAgIC9eKHNjaWVuY2VsaWZlfGNwbTRhbGwpXC5nYSQvLAogICAgICAgIC9eemFcLmdsJC8sCiAgICAgICAgL156aVwuaHQkLywKICAgICAgICAvXnNob3J0ZWRcLmlkJC8sCiAgICAgICAgL14oaWdyYW18Z3JhbXxwaW5naXQpXC5pbSQvLAogICAgICAgIC9ebWVnYXVybFwuKGlufGxpbmspJC8sCiAgICAgICAgL14oYnVzaW5lc3Npc3MyfHRlY2hhbmRyZXZpZXd8eWVzbW92aWVzYXBwfGtwc2N0aHVsYXNpbG9naW4pXC5pbmZvJC8sCiAgICAgICAgL15zdGZseVwuKGlvfHByZXNzKSQvLAogICAgICAgIC9ebHlvblwua2ltJC8sCiAgICAgICAgL15mY1wubGMkLywKICAgICAgICAvXihwZXR0eXxza2lwc3x0cnxmbGF6KVwubGluayQvLAogICAgICAgIC9ecGF5c2tpcFwuKG1lfG9yZykkLywKICAgICAgICAvXmJ0Y1wubXMkLywKICAgICAgICAvXnNwbGFzaG5ld3NcLm9vbyQvLAogICAgICAgIC9eZXhwcmVzcy1jdXRcLm92aCQvLAogICAgICAgIC9ec2hvcnRcLnBlJC8sCiAgICAgICAgL14oY2xrfGNsbClcLihwcmVzc3xpbmt8c2h8aWN1KSQvLAogICAgICAgIC9eKGxvcHRlfG1lZ2FsaW5rKVwucHJvJC8sCiAgICAgICAgL14xMjNsaW5rXC4ocHd8dmlwKSQvLAogICAgICAgIC9ecm95YWxvd25cLnJldmlldyQvLAogICAgICAgIC9eZWFyblwudGhlcGx1c2l0XC5ybyQvLAogICAgICAgIC9ec2staXBcLihydXx0ZWNoKSQvLAogICAgICAgIC9edGlueWxpbmtcLnJ1biQvLAogICAgICAgIC9eKG9rb3xhaWl8c2hvcnRlbilcLnNoJC8sCiAgICAgICAgL14oZHV0Y2h5Y29ycHxhYm91dHRlY2gpXC5zcGFjZSQvLAogICAgICAgIC9eYnV5aXRvbmxpbmVcLnN0b3JlJC8sCiAgICAgICAgL15lYXRpbmdzXC5zdHJlYW0kLywKICAgICAgICAvXnRsXC50YyQvLAogICAgICAgIC9eKDE5MjE2ODEyNTR8Z2VraXx3ZWduZXJ8Z3BzaG9ydClcLnRlY2gkLywKICAgICAgICAvXihsaW5rdmlwfDRzaG9ydClcLnRrJC8sCiAgICAgICAgL14od3d3XC4pP3BuZFwudGwkLywKICAgICAgICAvXmdldFwudWp2XC5hbCQvLAogICAgICAgIC9eKHVybGNsb3VkfGltYWdlb3B0aW1pemVyKVwudXMkLywKICAgICAgICAvXihrb3lsaW5rc3xidXktaW4tNTk5cnMpXC53aW4kLywKICAgICAgICAvXmV4ZVwuKGlvfGFwcCkkLywKICAgICAgICAvXnNsaW5rXC5iaWQkLywKICAgICAgXSwKICAgIH0sCiAgICBhc3luYyByZWFkeSAoKSB7CiAgICAgIGNvbnN0IGhhbmRsZXIgPSBuZXcgUmVjYXB0Y2hhSGFuZGxlcigpOwogICAgICBhd2FpdCBoYW5kbGVyLmNhbGwoKTsKICAgIH0sCiAgfSk7CiAgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siXyJdLnJlZ2lzdGVyKHsKICAgIHJ1bGU6IHsKICAgICAgaG9zdDogWwogICAgICAgIC9eKGFyYWJ0dmxpbmt8c2FmZWt1fGR6NGxpbmspXC5jb20kLywKICAgICAgICAvXmxpbmtzb2ZsaWZlXC5jbyQvLAogICAgICAgIC9ed2lcLmNyJC8sCiAgICAgICAgL14oYml0Y29pbmx5fGNhc2h1cmwpXC5pbiQvLAogICAgICAgIC9ebGlua3NvZlwubGlmZSQvLAogICAgICAgIC9ed2ljclwubWUkLywKICAgICAgICAvXnNocnRpdFwudGVjaCQvLAogICAgICAgIC9eZmlyZXNob3J0c1wudGskLywKICAgICAgICAvXm1pdGx5XC51cyQvLAogICAgICBdLAogICAgfSwKICAgIGFzeW5jIHJlYWR5ICgpIHsKICAgICAgY29uc3QgaGFuZGxlciA9IG5ldyBJbnZpc2libGVSZWNhcHRjaGFIYW5kbGVyKCk7CiAgICAgIGF3YWl0IGhhbmRsZXIuY2FsbCgpOwogICAgfSwKICB9KTsKICBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyJfIl0ucmVnaXN0ZXIoewogICAgcnVsZTogewogICAgICBob3N0OiBbCiAgICAgICAgL14xMjNzaG9ydFwuYml6JC8sCiAgICAgICAgL14oY3V0cGFpZHx0bWVhcm58aWN1dGxpbmspXC5jb20kLywKICAgICAgICAvXihjdHVpfGN1dGkpXC5pbiQvLAogICAgICAgIC9eenV0cm94XC5saW5rJC8sCiAgICAgICAgL14odGVjaGNyYXplfGhlYWx0aGluc2lkZXIpXC5vbmxpbmUkLywKICAgICAgICAvXmN1dHdpblwuKHVzfGNvbSkkLywKICAgICAgICAvXih3d3dcLik/c2hyaW5rXC52aXAkLywKICAgICAgXSwKICAgIH0sCiAgICBhc3luYyByZWFkeSAoKSB7CiAgICAgIGNvbnN0IGhhbmRsZXIgPSBuZXcgTm9uRGlzYWJsZWRSZWNhcHRjaGFIYW5kbGV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zdGVyKHsKICAgIHJ1bGU6IHsKICAgICAgaG9zdDogWwogICAgICAgIC9eKGN1dC11cmxzfGxpbmNsaWt8cHJlbWl1bXplbnxieTZka3xtaWt5bW9vbnN8bWFuMnBybylcLmNvbSQvLAogICAgICAgIC9eKGxpbms0d2lufGxvYWR1cmx8Y3V0NGxpbmt8cmFvbGlua3xhZHNob3J0ZSlcLmNvbSQvLAogICAgICAgIC9ec2hvcnRcLnBhc3Rld21hXC5jb20kLywKICAgICAgICAvXmxpbmtmbHlcLmdhb3NtZWRpYVwuY29tJC8sCiAgICAgICAgL14od3d3XC4pP3ZpcmFsdWtrXC5jb20kLywKICAgICAgICAvXih3d3dcLik/bmlhZ29zaG9ydFwuY29tJC8sCiAgICAgICAgL153d3dcLndvcmxkaGFja1wubmV0JC8sCiAgICAgICAgL14oZWtsaW5rKVwubmV0JC8sCiAgICAgICAgL15yb3l1cmxzXC5iaWQkLywKICAgICAgICAvXnNob3J0aXRcLmNhJC8sCiAgICAgICAgL14odXJsZXxhZHNob3J0KVwuY28kLywKICAgICAgICAvXigxKT9pZHNseVwuKGNvbXxiaWR8bmV0fG9yZykkLywKICAgICAgICAvXnNob3J0YWRcLmNmJC8sCiAgICAgICAgL14oYWRiaWx0eXx0YWl2ZSlcLmluJC8sCiAgICAgICAgL14oY3Vyc3xjcnVzfDRjdXR8dTJzfGwycylcLmlvJC8sCiAgICAgICAgL14xMjNsaW5rXC4oaW98Y298cHJlc3N8cHJvKSQvLAogICAgICAgIC9ecGV0dHlcLmxpbmskLywKICAgICAgICAvXih3ZWVmeXxhZGJ1bGx8emVpenxsaW5rNHxhZGNvaW4pXC5tZSQvLAogICAgICAgIC9eZHp1cmxcLm1sJC8sCiAgICAgICAgL15zcGFtbGlua1wub3JnJC8sCiAgICAgICAgL14odHdpa3xhZHNsaW5rKVwucHckLywKICAgICAgICAvXmdpdFwudGMkLywKICAgICAgICAvXihhZGZ1fGxpbmt1KVwudXMkLywKICAgICAgXSwKICAgIH0sCiAgICBhc3luYyByZWFkeSAoKSB7CiAgICAgIGNvbnN0IGhhbmRsZXIgPSBuZXcgU3RhZ2VkSGFuZGxlcigpOwogICAgICBhd2FpdCBoYW5kbGVyLmNhbGwoKTsKICAgIH0sCiAgfSk7CiAgY2xhc3MgQWJzdHJhY3RIYW5kbGVyIHsKICAgIGNvbnN0cnVjdG9yICgpIHsKICAgICAgdGhpcy5fb3ZlcmxheVNlbGVjdG9yID0gWwogICAgICAgICdbY2xhc3MkPSJPdmVybGF5Il0nLAogICAgICAgICcjX19yYW5kb21fY2xhc3NfbmFtZV9fJywKICAgICAgICAnI2hlYWRsaW5lYXRhcycsCiAgICAgICAgJyNteU1vZGFsJywKICAgICAgICAnLm9wYWNpdHlfd3JhcHBlcicsCiAgICAgICAgJyNvdmVybGF5JywKICAgICAgXS5qb2luKCcsICcpOwogICAgICB0aGlzLl9mb3JtU2VsZWN0b3IgPSBbCiAgICAgICAgJyNnby1saW5rJywKICAgICAgICAnLmdvLWxpbmsnLAogICAgICAgICcjb3JpZ2luYWxMaW5rLmdldC1saW5rJywKICAgICAgICAnZm9ybVthY3Rpb249Ii9saW5rcy9nbyJdJywKICAgICAgICAnZm9ybVthY3Rpb249Ii9saW5rcy9saW5rZHJvcGdvIl0nLAogICAgICBdLmpvaW4oJywgJyk7CiAgICB9CiAgICByZW1vdmVPdmVybGF5ICgpIHsKICAgICAgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siJCJdLnJlbW92ZSh0aGlzLl9vdmVybGF5U2VsZWN0b3IpOwogICAgICBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyIkIl0uYmxvY2sodGhpcy5fb3ZlcmxheVNlbGVjdG9yLCBkb2N1bWVudC5ib2R5KTsKICAgICAgc2V0SW50ZXJ2YWwoKCkgPT4gewogICAgICAgIGRvY3VtZW50LmJvZHkuc3R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TEZyb21KUXVlcnlGb3JtIChqRm9ybSkgewogICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHsKICAgICAgaWYgKGpGb3JtLmlzKCdhJykgJiYgakZvcm0uYXR0cignaHJlZicpKSB7CiAgICAgICAgcmVzb2x2ZShqRm9ybS5hdHRyKCdocmVmJykpOwogICAgICB9CiAgICAgIGNvbnN0IGpRdWVyeSA9IF9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIiQiXS53aW5kb3cuJDsKICAgICAgalF1ZXJ5LmFqYXgoewogICAgICAgIGRhdGFUeXBlOiAnanNvbicsCiAgICAgICAgdHlwZTogJ1BPU1QnLAogICAgICAgIHVybDogakZvcm0uYXR0cignYWN0aW9uJyksCiAgICAgICAgZGF0YTogakZvcm0uc2VyaWFsaXplKCksCiAgICAgICAgc3VjY2VzczogKHJlc3VsdCkgPT4gewogICAgICAgICAgaWYgKHJlc3VsdC51cmwpIHsKICAgICAgICAgICAgcmVzb2x2ZShyZXN1bHQudXJsKTsKICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHJlamVjdChuZXcgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siXyJdLkFkc0J5cGFzc2VyRXJyb3IocmVzdWx0Lm1lc3NhZ2UpKTsKICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIGVycm9yOiAoeGhyLCBzdGF0dXMsIGVycm9yKSA9PiB7CiAgICAgICAgICBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyJfIl0ud2Fybih4aHIsIHN0YXR1cywgZXJyb3IpOwogICAgICAgICAgcmVqZWN0KG5ldyBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfM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yZXNvbHZlKSA9PiB7CiAgICAgICAgY29uc3QgbyA9IG5ldyBNdXRhdGlvbk9ic2VydmVyKChtdXRhdGlvbnMpID0+IHsKICAgICAgICAgIG11dGF0aW9ucy5mb3JFYWNoKChtdXRhdGlvbikgPT4gewogICAgICAgICAgICBpZiAobXV0YXRpb24udGFyZ2V0LmdldEF0dHJpYnV0ZSgnY2xhc3MnKS5tYXRjaCgvYWN0aXZlLykpIHsKICAgICAgICAgICAgICBvLmRpc2Nvbm5lY3QoKTsKICAgICAgICAgICAgICByZXNvbHZlKG11dGF0aW9uLnRhcmdldC5ocmVmKTsKICAgICAgICAgICAgfQogICAgICAgICAgfSk7CiAgICAgICAgfSk7CiAgICAgICAgby5vYnNlcnZlKE9iamVjdChfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyIkIl0pKCcjc2tpcF9idXR0b24nKSwgewogICAgICAgICAgYXR0cmlidXRlczogdHJ1ZSwKICAgICAgICAgIGF0dHJpYnV0ZUZpbHRlcjogWydjbGFzcyddLAogICAgICAgIH0pOwogICAgICB9KTsKICAgICAgY29uc3QgdXJsID0gYXdhaXQgcHJvbWlzZTsKICAgICAgYXdhaXQgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siJCJdLm9wZW5MaW5rKHVybCk7CiAgICB9LAogIH0pOwogIF9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIl8iXS5yZWdpc3Rlcih7CiAgICBydWxlOiB7CiAgICAgIGhvc3Q6IGhvc3RSdWxlcywKICAgICAgcGF0aDogL2h0dHBzPzpcL1wvLywKICAgIH0sCiAgICBhc3luYyBzdGFydCAoKSB7CiAgICAgIGxldCB1cmwgPSB3aW5kb3cubG9jYXRpb24ucGF0aG5hbWUgKyB3aW5kb3cubG9jYXRpb24uc2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JC8sCiAgICAgICAgL153dzJcLmF3c3Vic1wuY28kLywKICAgICAgICAvXnBsYW50YWhlaW1cLih3ZWJcLmlkfGNvbSkkLywKICAgICAgICAvXmlyaXN2ZXJhXC5jb20kLywKICAgICAgXSwKICAgICAgcXVlcnk6IC9eXD9kPShbYS16QS1aMC05Lz1dKykkLywKICAgIH0sCiAgICB7CiAgICAgIGhvc3Q6IFsKICAgICAgICAvXmlcLmd0YWluZFwuY29tJC8sCiAgICAgICAgL15wZWJpc25pcy1tdWRhXC5jb20kLywKICAgICAgICAvXmhpa2FyaW5vYWthcmlvc3RcLmluZm8kLywKICAgICAgXSwKICAgICAgcXVlcnk6IC9eXD8oW2EtekEtWjAtOS89XSspJC8sCiAgICB9LAogICAgewogICAgICBob3N0OiBbCiAgICAgICAgL1wuYmxvZ3Nwb3RcLmNvbT8vLAogICAgICAgIC9eKHd3d1wuKT9kZXNpZ25teWhvbWVlXC5jb20kLywKICAgICAgICAvXih3d3dcLik/bG9zc3RvclwuY29tJC8sCiAgICAgICAgL14oKGt1cm9zYWZlfGt1cm9zYWZldHkpXC4pP21lbmFudGlzZW5qYVwuY29tJC8sCiAgICAgICAgL15kcml2ZVwuamVwaXRrZXJ0YXNcLmNvbSQvLAogICAgICAgIC9ebGV3YXRcLndpYnVpbmRvXC5jb20kLywKICAgICAgICAvXihvbWdtdXNpa3xvbWdseXJpY3N8azJuYmxvZylcLmNvbSQvLAogICAgICAgIC9eKHNpbWFob2xpbmF8YXV0ZWNoKVwueHl6JC8sCiAgICAgICAgL14od3d3XC4pP2lkLXNlY3VyZWxpbmtcLnh5eiQvLAogICAgICAgIC9eKHd3d1wuKT9jb252ZXJ0aGlua3NcLnh5eiQvLAogICAgICAgIC9eKHd3d1wuKT9tYXJpdmVsa2VjZVwueHl6JC8sCiAgICAgICAgL14od3d3XC4pP3lhbWV0ZXNlbnBhaVwueHl6JC8sCiAgICAgICAgL14od3d3XC4pP3RvanJvc1wudGskLywKICAgICAgICAvXih3d3dcLik/YW5qYXlcLmluZm8kLywKICAgICAgICAvXih3d3dcLik/a2Fra29paXNhZmVcLnVzJC8sCiAgICAgICAgL14od3d3XC4pP2t1cm9zYWZlXC4od2Vic2l0ZXxvbmxpbmUpJC8sCiAgICAgICAgL14od3d3XC4pP2RyYWtvcnNhZmVcLnRlY2gkLywKICAgICAgICAvXihmbWxhd2tlcnN8aW5kZXhtb3ZpZSlcLmNsdWIkLywKICAgICAgICAvXm1pY2luXC5vbmxpbmUkLywKICAgICAgICAvXnVuZHVoXC5pbi8sCiAgICAgICAgL15hZDRtc2FuXC53aW4kLywKICAgICAgICAvXm5vb3l1bFwuY28kLywKICAgICAgICAvXnBhZnBhZlwuaW5mbyQvLAogICAgICAgIC9eaGlnaHRlY2hcLndlYlwuaWQkLywKICAgICAgXSwKICAgICAgcXVlcnk6IFsKICAgICAgICAvXlw/dXJsPShbYS16QS1aMC05Lz1dKykkLywKICAgICAgICAvXlw/aWQ9KFthLXpBLVowLTkvPV0rKSQvLAogICAgICAgIC9eXD9zaXRlPShbYS16QS1aMC05Lz1dKykkLywKICAgICAgXSwKICAgIH0sCiAgICB7CiAgICAgIGhvc3Q6IFsKICAgICAgICAvXihzZWhhdGxlZ2F8ZGF2aW5zdXJhbmNlfGhlYWx0aHRvZHxpcmlzdmVyYXxha2Fub3NvcmF8c3ViZXRlbmV3cylcLmNvbSQvLAogICAgICAgIC9eKHd3d1wuKT9tZW5hbnRpc2VuamFcLmNvbSQvLAogICAgICAgIC9eKGJ1c2luZXNzZm9yeW91YW5kfHRyYXZlbHdpdGh0cmlja3N8c2l0dXNiYXJ1KVwubWUkLywKICAgICAgICAvXnBsYW50YWhlaW1cLih3ZWJcLmlkfGNvbSkkLywKICAgICAgICAvXih3d3dcLik/c3RhcnpvbmVcLmNjJC8sCiAgICAgICAgL14od3d3XC4pP2tha2tvaWlzYWZlXC51cyQvLAogICAgICAgIC9eKHd3d1wuKT9wb2xyZWNcLnNpdGUkLywKICAgICAgICAvXnl1bWVjaGFuXC5jbHViJC8sCiAgICAgICAgL15jZWtsaW5rdVwueHl6JC8sCiAgICAgICAgL15saW5kdW5nXC4oaW58bWUpJC8sCiAgICAgICAgL14od3d3XC4pP2JvbGFva2VcLmNsdWIkLywKICAgICAgXSwKICAgICAgcXVlcnk6IC9eXD9yPShbYS16QS1aMC05Lz1dKykkLywKICAgIH0sCiAgICB7CiAgICAgIGhvc3Q6IC9ed3d3XC5jb21wYXJ0aWVuZG9mdWxsXC5uZXQkLywKICAgICAgcGF0aDogL15cL2dvMi8sCiAgICAgIHF1ZXJ5OiAvXlw/cD0oW2EtekEtWjAtOS89XSspJC8sCiAgICB9LAogICAgewogICAgICBob3N0OiAvXmFuaW1lZm9yY2VcLnN0cmVhbSQvLAogICAgICBxdWVyeTogL15cP2w9KFthLXpBLVowLTkvPV0rKSQvLAogICAgfSwKICAgIHsKICAgICAgaG9zdDogL14od3d3XC4pP2R1a3VuLWNpdFwuY29tJC8sCiAgICAgIHF1ZXJ5OiAvXlw/cz0oW2EtekEtWjAtOS89XSspJC8sCiAgICB9LAogICAgewogICAgICBob3N0OiAvXnVsdGltYXRlXC50dXJrZG93blwuY29tJC8sCiAgICAgIHF1ZXJ5OiAvXlw/c3RlcG9uZT0oW2EtekEtWjAtOS89XSspJC8sCiAgICB9LAogICAgewogICAgICBob3N0OiAvXmxlZWNocHJlbWl1bVwubGluayQvLAogICAgICBwYXRoOiAvXlwvY2hlYXRcLy8sCiAgICAgIHF1ZXJ5OiAvXlw/bGluaz0oW2EtekEtWjAtOS89XSspJC8sCiAgICB9LAogICAgewogICAgICBob3N0OiAvXmNsb3NldG9waWNcLnNpdGUkLywKICAgICAgcXVlcnk6IC9eXD9nbz0oW2EtekEtWjAtOS89XSspJC8sCiAgICB9LAogICAgewogICAgICBob3N0OiAvXmluZm9zaWFcLnh5eiQvLAogICAgICBxdWVyeTogL15cP2tlc2VoYXRhbj0oW2EtekEtWjAtOS89JV0rKSQvLAogICAgfSwKICAgIHsKICAgICAgaG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bmN0aW9uICgpIHsKICBfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyJfIl0ucmVnaXN0ZXIoewogICAgcnVsZTogWwogICAgICB7CiAgICAgICAgaG9zdDogWwogICAgICAgICAgL153d3dcLihmcmVlYnVua2VyfGltZ2NhcnJ5fGltZ3Nob3RzKVwuY29tJC8sCiAgICAgICAgICAvXnd3d1wuaW1hZ2VzbmFrZVwuKGNvbXxvcmcpJC8sCiAgICAgICAgXSwKICAgICAgICBwYXRoOiAvXlwvc2hvd1wucGhwJC8sCiAgICAgICAgcXVlcnk6IC9eXD8vLAogICAgICB9LAogICAgICB7CiAgICAgICAgaG9zdDogL153d3dcLihmcmVlYnVua2VyfGltZ3Nob3RzKVwuY29tJC8sCiAgICAgICAgcGF0aDogL15cL3Nob3dcLy8sCiAgICAgIH0sCiAgICAgIHsKICAgICAgICBob3N0OiAvXmltYWdlYmFuXC4ocnV8bmV0KSQvLAogICAgICAgIHBhdGg6IC9eXC9zaG93XC9cZHs0fVwvXGR7Mn1cL1xkezJ9XC8uKy8sCiAgICAgIH0sCiAgICAgICdodHRwOi8vZm90b28ucGwvc2hvdy5waHA/aW1nPSouaHRtbCcsCiAgICAgIHsKICAgICAgICBob3N0OiAvXnd3d1wuaW1hZ2VzdGltZVwuY29tJC8sCiAgICAgICAgcGF0aDogL15cL3Nob3dcLnBocFwvLipcLmh0bWwkLywKICAgICAgfSwKICAgIF0sCiAgICByZWFkeTogcnVuLAogIH0pOwogIF9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIl8iXS5yZWdpc3Rlcih7CiAgICBydWxlOiB7CiAgICAgIGhvc3Q6IFsKICAgICAgICAvXnd3d1wuKGltZ2NhcnJ5fGltYWdlZnJ1aXQpXC5jb20kLywKICAgICAgICAvXnd3d1wucG9ybmJ1c1wub3JnJC8sCiAgICAgICAgL153d3dcLmltYWdlc25ha2VcLihjb218b3JnKSQvLAogICAgICBdLAogICAgICBwYXRoOiAvXlwvKGltZ3xzaG93KVwvLywKICAgIH0sCiAgICByZWFkeTogcnVuMiwKICB9KTsKICBhc3luYyBmdW5jdGlvbiBydW4gKCkgewogICAgY29uc3QgaSA9IE9iamVjdChfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyIkIl0pKCcjaW1nX29iaicpOwogICAgYXdhaXQgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siJCJdLm9wZW5JbWFnZShpLnNyYywgewogICAgICByZWZlcmVyOiB0cnVlLAogICAgfSk7CiAgfQogIGFzeW5jIGZ1bmN0aW9uIHJ1bjIgKCkgewogICAgY29uc3QgaSA9IE9iamVjdChfQURTQllQQVNTRVJfTkFNRVNQQUNFX19fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyIkIl0pKCcjaW1nX29iaicpOwogICAgYXdhaXQgX0FEU0JZUEFTU0VSX05BTUVTUEFDRV9fX1dFQlBBQ0tfSU1QT1JURURfTU9EVUxFXzBfX1siJCJdLm9wZW5JbWFnZShpLnNyYywgewogICAgICByZXBsYWNlOiB0cnVlLAogICAgfSk7CiAgfQp9KSgpOwooZnVuY3Rpb24gKCkgewogIF9BRFNCWVBBU1NFUl9OQU1FU1BBQ0VfX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bIl8iXS5yZWdpc3Rlcih7CiAgICBydWxlOiBbCiAgICAgIHsKICAgICAgICBob3N0OiAvXmltYWdlbnBpY1wuY29tJC8sCiAgICAgICAgcGF0aDogL15cLy4qXC8uK1wuaHRtbD8kLywKICAgICAgfSwKICAgICAgewogICAgICAgIGhvc3Q6IFsKICAgICAgICAgIC9eaW1hZ2V0d2lzdFwuY29tJC8sCiAgICAgICAgICAvXnZpcHJcLmltJC8sCiA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ZXxnYWxsZXJ5Y2xvdWR8eHhpbWd8aW1nLXZpZXcpXC5uZXQkLywKICAgICAgICAgIC9eKHh4eHdlYmRseHh4fHRlZW5zaG90fGltYWdlb258aW1hZ2V0ZWFtfHZveWV1cmltYWdlfHRlZW5pbWFnZXxtZWdhaW1hZ2UpXC5vcmckLywKICAgICAgICAgIC9eKGltZ3N0dWRpb3xpbWdzcG90KVwub3JnJC8sCiAgICAgICAgICAvXihwaWN6fHVucG9ybilcLnNpdGUkLywKICAgICAgICAgIC9ecGljXC5ob3RpbWdcLnNpdGUkLywKICAgICAgICAgIC9eKGRhbGV6b2J1eHxlY29pbWFnZXN8dXZvbmFoYXplKVwueHl6JC8sCiAgICAgICAgICAvXnh4eFwuKHNleGV4fHBvcm5zY3JlZW4pXC54eXokLywKICAgICAgICAgIC9eYWNpZGltZ1wuY2MkLywKICAgICAgICAgIC9edW5kZXJwaWNcLmNsdWIkLywKICAgICAgICAgIC9eaW1nY2xvdWRcLmNvJC8sCiAgICAgICAgICAvXmRhcnBpeFwuZ2EkLywKICAgICAgICAgIC9eKHBvcC1pbWd8YWRzLWltZylcLmluZm8kLywKICAgICAgICAgIC9eY3Vib25hd1wubWwkLywKICAgICAgICAgIC9eKGRvbWFpbmt8cG9ybm8tcGlyYXQpXC5ydSQvLAogICAgICAgICAgL15pcGljdHVyZVwuc3UkLywKICAgICAgICAgIC9eaW1hZ2VzcHVibGljXC50ayQvLAogICAgICAgICAgL15zXC5pbWdob3N0XC50b3AkLywKICAgICAgICAgIC9ed3d3XC5ob3RpbWFnZVwudWskLywKICAgICAgICAgIC9ecGl4dXBcLnVzJC8sCiAgICAgICAgXSwKICAgICAgICBwYXRoOiAvXC9pbWctLipcLmh0bWwvLAogICAgICB9LAogICAgICB7CiAgICAgICAgaG9zdDogL14oaGVudGFpLXBvcHxzdGFyLWhlbnRhaSlcLmNvbSQvLAogICAgICAgIHBhdGg6IC9eXC9bdGldXC9pbWctLipcLmh0bWwvLAogICAgICB9LAogICA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V0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyJub25lIl07CiAgICB9CiAgfSk7CiAgaWYgKGMgPT09IHV0aWxfY29yZV9fV0VCUEFDS19JTVBPUlRFRF9NT0RVTEVfMF9fWyJub25lIl0pIHsKICAgIHJldHVybiBudWxsOwogIH0KICBjID0gYy5yZXBsYWNlKC9eXHMqW2EtekEtWjAtOS1fXSs9KFteO10rKS4/JC8sICckMScpOwogIGlmICghYykgewogICAgcmV0dXJuIG51bGw7CiAgfQogIHJldHVybiBjOwp9CmZ1bmN0aW9uIHJlc2V0Q29va2llcyAoKSB7CiAgY29uc3QgYSA9IGRvY3VtZW50LmRvbWFpbjsKICBjb25zdCBiID0gZG9jdW1lbnQuZG9tYWluLnJlcGxhY2UoL153d3dcLi8sICcnKTsKICBjb25zdCBjID0gZG9jdW1lbnQuZG9tYWluLnJlcGxhY2UoL14oXHcrXC4pKz8oXHcrXC5cdyspJC8sICckMicpOwogIGNvbnN0IGQgPSAobmV3IERhdGUoMWUzKSkudG9VVENTdHJpbmcoKTsKICBPYmplY3QodXRpbF9jb3JlX19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8wX19bImZvckVhY2giXSkoZG9jdW1lbnQuY29va2llLnNwbGl0KCc7JyksICh2KSA9PiB7CiAgICBjb25zdCBrID0gdi5yZXBsYWNlKC9eXHMqKFx3Kyk9LiskLywgJyQxJyk7CiAgICBkb2N1bWVudC5jb29raWUgPSBgJHtrfT07ZXhwaXJlcz0ke2R9O2A7CiAgICBkb2N1bWVudC5jb29raWUgPSBgJHtrfT07cGF0aD0vO2V4cGlyZXM9JHtkfTtgOwogICAgY29uc3QgZSA9IChhLCBiLCBjKSA9PiBgJHthfT07cGF0aD0vO2RvbWFpbj0ke2J9O2V4cGlyZXM9JHtjfTtgOwogICAgZG9jdW1lbnQuY29va2llID0gZShrLCBhLCBkKTsKICAgIGRvY3VtZW50LmNvb2tpZSA9IGUoaywgYiwgZCk7CiAgICBkb2N1bWVudC5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V0dXJuIE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIDI1Nik7CiAgfSkuam9pbignLicpOwp9CmZ1bmN0aW9uIGV2aWwgKHNjcmlwdCkgewogIHJldHVybiAoKAogICAgR00sCiAgICBHTV9kZWxldGVWYWx1ZSwKICAgIEdNX2dldFJlc291cmNlVVJMLAogICAgR01fZ2V0VmFsdWUsCiAgICBHTV9vcGVuSW5UYWIsCiAgICBHTV9yZWdpc3Rlck1lbnVDb21tYW5kLAogICAgR01fc2V0VmFsdWUsCiAgICBHTV94bWxodHRwUmVxdWVzdCwKICAgIHVuc2FmZVdpbmRvdywKICAgIHdpbmRvdywKICApID0+IHsKICAgIHJldHVybiBldmFsKHNjcmlwdCk7CiAgfSkoKTsKfQogfSkKIF0pOw==","resources":[{"meta":{"name":"align_center.css","url":"https://raw.githubusercontent.com/adsbypasser/adsbypasser/v7.19.0/resources/css/align_center.css","ts":1649334290508,"mimetype":"text/css"},"source":"aHRtbCB7CiAgaGVpZ2h0OiAxMDAlOwp9Cgpib2R5IHsKICBoZWlnaHQ6IDEwMCU7CiAgbWFyZ2luOiAwOwp9CgojYWRzYnlwYXNzZXItd3JhcHBlciB7CiAgd2lkdGg6IDEwMCU7CiAgaGVpZ2h0OiAxMDAlOwogIHBvc2l0aW9uOiByZWxhdGl2ZTsKICB0ZXh0LWFsaWduOiBjZW50ZXI7CiAgbGluZS1oZWlnaHQ6IDA7Cn0KCiNhZHNieXBhc3Nlci1pbWFnZSB7CiAgbWFyZ2luOiBhdXRvOwogIHRvcDogMDsKICBib3R0b206IDA7CiAgbGVmdDogMDsKICByaWdodDogMDsKfQo="},{"meta":{"name":"scale_image.css","url":"https://raw.githubusercontent.com/adsbypasser/adsbypasser/v7.19.0/resources/css/scale_image.css","ts":1649334290510,"mimetype":"text/css"},"source":"I2Fkc2J5cGFzc2VyLWltYWdlLmFkc2J5cGFzc2VyLXJlc2l6YWJsZSB7CiAgY3Vyc29yOiAtd2Via2l0LXpvb20tb3V0OwogIGN1cnNvcjogLW1vei16b29tLW91dDsKICBjdXJzb3I6IHpvb20tb3V0Owp9CgojYWRzYnlwYXNzZXItaW1hZ2UuYWRzYnlwYXNzZXItcmVzaXphYmxlLmFkc2J5cGFzc2VyLXNocmlua2VkIHsKICBtYXgtd2lkdGg6IDEwMCU7CiAgbWF4LWhlaWdodDogMTAwJTsKICBjdXJzb3I6IC13ZWJraXQtem9vbS1pbjsKICBjdXJzb3I6IC1tb3otem9vbS1pbjsKICBjdXJzb3I6IHpvb20taW47Cn0K"},{"meta":{"name":"imagedoc-darknoise.png","url":"https://raw.githubusercontent.com/adsbypasser/adsbypasser/v7.19.0/resources/img/imagedoc-darknoise.png","ts":1649334290512,"mimetype":"image/png"},"source":"wolQTkcNChoKAAAADUlIRFIAAABYAAAAWAQDAAAAwoPCuy0HAAAAG1BMVEXDvsO+w74BAQHDv8O/w78KCgoDAwN/f3/DtcO1w7XCgMKAwoDDvMO8w7zDoQ8Ew7YAAAAJdFJOUwUFBQUFBQUFBcKHDsOTw70AAAvDgklEQVR4Xg3DijljwrJaEADDkBnDtnIue3lxL0HCjUkJwpp8wrEEw6NWwoJLTAkaE0swbj/Du8K9w64UB37DhS1uKsOzwqLDsMOCWHzDqMKfw4BICSlZwqjDvirCtsObw59Rw7MfQsKjc2tIwpfCtMKADcKlwpvCpcKQTxPCl13Cs8Kow4k3I13CjAzCilrCp2vCoMKIwrFZFAhjwqE/wpDDpjvChMKHIi/Dtl/CrAPCt1zDv8O0w6gLwpQnecKSd8O8w73DpMOgfcK8wobCpcOQM8OlacKVwoc/wrREw6gyF8KOYsKqKkvChsKvw6xNZylOwp49RkpVCsK+fFkME8KIw403w4x7R8OJwoDCnsOcw7xiCDnDlS4rFjIEVQ7DjsO2OgAuQF8fEcO6wo5Ow6EtI8OTCsKBND3DhMKswoYmw71xw4VtCMOtH1MXD8KXVG7CnX04V2PCkDlywrPDocOSw4LCsGAdG8OLw7cFTcO+wpjCvFYjwojDgcOLw78PUcKRW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ChgvDk8KfwqnDsHhVf8Kww4LDqMKfwrfDq2HCs2TCrMOeLsKnwpDDoT4kXMKDw7sCwoUvw6XCjF/CqcOww4A7w5rDkS1/O8ODJcKeJ1rDq8OTw6HDt8Knw64Ww7DCqETDi8OXwpwnw6wsw7PDpgvDuEDDpRnDjDROHwzCrSlUw6Q4BHLDmhLCvMOvw78Aw73DtABmwozDlmTDkAAAAABJRU5Ewq5CYMKC"}]},{"name":"AntiAdware","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["http*://*180upload.com/*","http*://*4upfiles.com/*","http*://*get*.adobe.com/*flashplayer/*","http*://*get*.adobe.com/*reader/*","http*://*afterdawn.com/software/*","http*://*akafile.com/akago.php","http*://*chip.de/downloads/*","http*://*clicknupload.com/*","http*://*cloudyvideos.com/*","http*://*coolrom.com/*/*","http*://*clipconverter.cc/download/*","http*://*dailyuploads.net/*","http*://*datafilehost.com/d/*","http*://*davvas.com/*","http*://*d-h.st/*","http*://*download.cnet.com/*","http*://*telecharger.cnet.com/*","http*://*descargar.cnet.com/*","http*://*de.download.cnet.com/*","http*://*filefactory.com/file/*","http*://*filescdn.com/*","http*://*filehippo.com/*download*","http*://*freewarefiles.com/downloads_counter.php*","http*://*google.*/earth/download/ge/agree.html","http*://*hugefiles.net/*","http*://*hulkload.com/*","http*://*kingfiles.net/*","http*://*letitbit.net/download/*","http*://*loveroms.com/*","http*://*up.media1fire.com/*","http*://*mightyupload.com/*","http*://*mp3fil.*/get/*","http*://*mp3juices.to/*","http*://*mp3olimp.net/*","http*://*mp3olimpz.com/*","http*://*opensubtitles.org/*/subtitles/*","http*://*revclouds.com/*","http*://*romhustler.net/download/*","http*://*romhustler.net/rom/*","http*://*secureupload.eu/*","http*://*sendspace.com/file/*","http*://*sharebeast.com/*","http*://*shared.com/*","http*://*softm8.com*","http*://*.softonic.*","http*://*sourceforge.net/*","http*://*tusfiles.net/*","http*://*unlimitzone.com/*","http*://*uploading.com/*","http*://*uploadocean.com/*","http*://*uplod.ws/*","http*://*uploads.to/*","http*://*uptobox.com/*","http*://*userscdn.com/*","http*://*ziddu.com/downloadfile/*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1525361829807,"data":{}},"enabled":true,"position":11,"file_url":"https://raw.githubusercontent.com/HandyUserscripts/AntiAdware/master/AntiAdware.user.js","uuid":"9fedc355-cfb6-413e-8632-e448d97efc1d","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgQW50aUFkd2FyZQovLyBAbmFtZTpmciBBbnRpQWR3YXJlCi8vIEBuYW1lOmRlIEFudGlBZHdhcmUKLy8gQG5hbWU6emgtVFcgQW50aUFkd2FyZQovLyBAbmFtZTp6aC1DTiBBbnRpQWR3YXJlCi8vIEBhdXRob3Igbm9uYW1lMTIwCi8vIEBuYW1lc3BhY2UgSGFuZHlVc2Vyc2NyaXB0cwovLyBAaWNvbiBodHRwczovL2kuaW1ndXIuY29tL3RxN1BKcjAucG5nCi8vIEBkZXNjcmlwdGlvbiBSZW1vdmUgZm9yY2VkIGRvd25sb2FkIGFjY2VsZXJhdG9ycywgbWFuYWdlcnMsIGFuZCBhZHdhcmUgb24gc3VwcG9ydGVkIHdlYnNpdGVzCi8vIEBkZXNjcmlwdGlvbjpmciDDiXZpdGV6IGxlcyBhcHBsaWNhdGlvbnMgaW5kw6lzaXJhYmxlcyBsb3JzIGRlcyB0w6lsw6ljaGFyZ2VtZW50cyBzdXIgZGUgbm9tYnJldXggc2l0ZXMgYXZlYyBBbnRpQWR3YXJlICEK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bnRlbnRDb2x1bW4uQ29udGVudENvbHVtbi0yJ10KICAgICAgICB9LAogICAgICAgIEFmdGVyZGF3bjogewogICAgICAgICAgICBob3N0OiBbJ2FmdGVyZGF3bi5jb20nXSwKICAgICAgICAgICAgZXhlYzogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAvLyBEb3dubG9hZCBwYWdlIGRpcmVjdGx5IGFjY2Vzc2VkIGZyb20gYW5vdGhlciB3ZWJzaXRlCiAgICAgICAgICAgICAgICBpZiAoZG9jdW1lbnQubG9jYXRpb24uaHJlZi5jb250YWlucygnaW5zdGFsbGVyPTEnKSkgewogICAgICAgICAgICAgICAgICAgIC8vIFJlZGlyZWN0IHRvIHRoZSBwYWdlIHdpdGhvdXQgdGhlIGRvd25sb2FkIG1hbmFnZXIKICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5sb2NhdGlvbi5yZXBsYWNlKGRvY3VtZW50LmxvY2F0aW9uLmhyZWYucmVwbGFjZSgnaW5zdGFsbGVyPTEnLCAnaW5zdGFsbGVyPTAnKSkKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICAvLyBTb2Z0d2FyZSBwYWdlCiAgICAgICAgICAgICAgICAkKCdpbnB1dFtuYW1lPWluc3RhbGxlcl0nKS5wcm9wKCd2YWx1ZScsICcwJykKICAgICAgICAgICAgICAgIHZhciBkb3dubG9hZEJ1dHRvbiA9ICQoJyNkb3dubG9hZC1tYWluLWJ1dHRvbicpCiAgICAgICAgICAgICAgICB2YXIgYWR3YXJlTGluayA9IGRvd25sb2FkQnV0dG9uLnByb3AoJ2hyZWYnKQogICAgICAgICAgICAgICAgYWR3YXJlTGluayA9IGFkd2FyZUxpbmsucmVwbGFjZSgnaW5zdGFsbGVyPTEnLCAnaW5zdGFsbGVyPTAnKQogICAgICAgICAgICAgICAgZG93bmxvYWRCdXR0b24ucHJvcCgnaHJlZicsIGFkd2FyZUxpbmspCiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIEFrYWZpbGU6IHsKICAgICAgICAgICAgaG9zdDogWydha2FmaWxlLmNvbSddLAogICAgICAgICAgICAvLyBGaW5kIHRoZSByZWFsIGRvd25sb2FkIGxpbmsgaW4gdGhlIGNvbW1lbnRzIHNlY3Rpb24gYW5kIHJlcGxhY2UgdGhlIGZha2Ugb25lIHdpdGggdGhpcyAoaWYgdGhlIGZha2UgaXMgbm90IGEgdmFsaWQgbGluaykKICAgICAgICAgICAgZXhlYzogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgLy8gSWYgdGhlIGxpbmsgaXMgYWxyZWFkeSBhIHZhbGlkIG9uZSB3ZSBkb24ndCByZXBsYWNlIGl0CiAgICAgICAgICAgICAgICB2YXIgdGVzdEhvc3QgPSBuZXcgUmVnRXhwKCJhaWsud29sZnVwLm5ldCIsICdpJykKICAgICAgICAgICAgICAgIGlmICh0ZXN0SG9zdC50ZXN0KCQoIiNkb3dubG9hZDEiKS5hdHRyKCJocmVmIikpKSByZXR1cm4KICAgICAgICAgICAgICAgIC8vIEdldCBjb21tZW50IHNlY3Rpb24gYW5kIGVudW1lcmF0ZSBlYWNoIGVsZW1lbnQgaGF2aW5nIHRoZSByaWdodCBpZCwgY2hlY2sgaWYgaXQncyBhIHByb3BlciBkb3dubG9hZCBsaW5rCiAgICAgICAgICAgICAgICB2YXIgY29tbWVudHMgPSAkKCcjY29udGludWUnKS5jb21tZW50cygpLmNoaWxkcmVuKCcjZG93bmxvYWQxJykuZWFjaChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgaWYgKHRlc3RIb3N0LnRlc3QoJCh0aGlzKS5hdHRyKCJocmVmIikpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICQoIiNkb3dubG9hZDEiKS5hdHRyKCJocmVmIiwgJCh0aGlzKS5hdHRyKCJocmVmIikpCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybgogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICAvL0NoaXA6IHsKICAgICAgICAgICAgLy9ob3N0OiBbJ2NoaXAuZGUnXSwKICAgICAgICAgICAgLy9oaWRlOiBbJy5kb3dubG9hZF9idXR0b24nXSwKICAgICAgICAgICAgLy9leGVjOiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIC8vdmFyIGRsID0gJCgnLk1hbnVhbEluc3RhbGxMaW5rJykucHJvcCgnaHJlZicpCiAgICAgICAgICAgICAgICAvL3ZhciBidG4gPSAkKCcuZGwtYnRuLWRlZmF1bHQgLkRvd25sb2FkLUJ1dHRvbicpCgogICAgICAgICAgICAgICAgLy9idG4ucHJvcCgnaHJlZicsIGRsKQogICAgICAgICAgICAvL30KICAgICAgICAvL30sCiAgICAgICAgQ2xpY2tudXBsb2FkOiB7CiAgICAgICAgICAgIGhvc3Q6IFsnY2xpY2tudXBsb2FkLmNvbSddLAogICAgICAgICAgICB1bmNoZWNrOiBbJyNkX2FjY19jaGVja2JveCddLAogICAgICAgICAgICBoaWRlOiBbJyN3X2Rvd25sb2FkJywgJyNkX2FjYyddCiAgICAgICAgfSwKICAgICAgICBDbGlwQ29udmVydGVyOiB7CiAgICAgICAgCWhvc3Q6IFsnY2xpcGNvbnZlcnRlci5jYyddLAogICAgICAgIAl1bmNoZWNrOiBbJyNkbGNwJ10sCiAgICAgICAgCWhpZGU6IFsnZGl2W3N0eWxlPSJ3aWR0aDogMzQwcHg7bWFyZ2luLWxlZnQ6IDI1cHg7bWFyZ2luLXRvcDogN3B4OyJdJ10KICAgICAgICB9LAogICAgICAgIENsb3VkeVZpZGVvczogewogICAgICAgICAgICBob3N0OiBbJ2Nsb3VkeXZpZGVvcy5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjdXNlLW1hbmFnZXInXSwKICAgICAgICAgICAgaGlkZTogWycjZG93bmxvYWQtYm94ID4gbGFiZWwnXQogICAgICAgIH0sCiAgICAgICAgQ29vbHJvbTogewogICAgICAgICAgICBob3N0OiBbJ2Nvb2xyb20uY29tJ10sCiAgICAgICAgICAgIGhpZGU6IFsndGFibGVbYWxpZ249ImNlbnRlciJdW3dpZHRoPSIzMDAiXSddLAogICAgICAgICAgICBleGVjOiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJsb2FkIiwgZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICB2YXIgZG93bmxvYWRCdXR0b24gPSAkKCdpbWdbc3JjKj0iZG93bmxvYWRfbGFyZ2UucG5nIl0nKS5wYXJlbnQoJ2EnKQogICAgICAgICAgICAgICAgICB2YXIgZG93bmxvYWRJZCA9IGRvY3VtZW50LmxvY2F0aW9uLnBhdGhuYW1lLnNwbGl0KCcvJylbM10KCiAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZG93bmxvYWRCdXR0b24gIT0gJ3VuZGVmaW5lZCcgJiYgZG93bmxvYWRJZC5tYXRjaCgvXlxkKyQvKSkgewogICAgICAgICAgICAgICAgICAgICAgLy8gR2V0IHJpZCBvZiBhbGwgZXZlbnRzIG9uIHRoZSBidXR0b24KICAgICAgICAgICAgICAgICAgICAgIHZhciBuZXdCdXR0b24gPSBkb3dubG9hZEJ1dHRvbi5jbG9uZSgpCiAgICAgICAgICAgICAgICAgICAgICBuZXdCdXR0b24ucHJvcCgnaHJlZicsICcvZGxwb3AucGhwP2lkPScgKyBkb3dubG9hZElkKQogICAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRCdXR0b24ucmVwbGFjZVdpdGgobmV3QnV0dG9uKQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgRGFpbHlVcGxvYWRzOiB7CiAgICAgICAgICAgIGhvc3Q6IFsnZGFpbHl1cGxvYWRzLm5ldCddLAogICAgICAgICAgICBoaWRlOiBbJ2xhYmVsW3N0eWxlPSJmb250LXNpemU6eC1zbWFsbCJdJ10sCiAgICAgICAgICAgIHVuY2hlY2s6IFsnI2Noa0lzQWRkJ10KICAgICAgICB9LAogICAgICAgIERhdGFmaWxlaG9zdDogewogICAgICAgICAgICBob3N0OiBbJ2RhdGFmaWxlaG9zdC5jb20nXSwKICAgICAgICAgICAgaGlkZTogWydmb3JtW25hbWU9Y2JmXSddLAogICAgICAgICAgICBleGVjOiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHZhciBpZCA9IGRvY3VtZW50LmxvY2F0aW9uLnBhdGhuYW1lLm1hdGNoKC9eXC9kXC8oXHcrKSQvKVsxXQogICAgICAgICAgICAgICAgLy8gRGF0YUZpbGVIb3N0IGRvZXNuJ3QgYWxsb3cgdG8gZG93bmxvYWQgdXNpbmcgSFRUUFMKICAgICAgICAgICAgICAgIHZhciBhZHdhcmVsZXNzTGluayA9ICdodHRwOicgKyAnLy8nICsgZG9jdW1lbnQubG9jYXRpb24uaG9zdG5hbWUgKyAnL2dldC5waHA/ZmlsZT0nICsgaWQKCiAgICAgICAgICAgICAgICB2YXIgbiA9ICQoJyNkbCA+IGEnKS5jbG9uZSgpCgogICAgICAgICAgICAgICAgLy8gUmVwbGFjZSB0aGUgYWR3YXJlIGxpbmsKICAgICAgICAgICAgICAgIG4ucHJvcCgnaHJlZicsIGFkd2FyZWxlc3NMaW5rKQoKICAgICAgICAgICAgICAgIC8vIEF2b2lkIHJlZGlyZWN0aW9uIHRvIGFkd2FyZQogICAgICAgICAgICAgICAgJCgnI2RsJykucmVwbGFjZVdpdGgobik7CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIERhdnZhczogewogICAgICAgICAgICBob3N0OiBbJ2RhdnZhcy5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjY2hsaW5rJ10sCiAgICAgICAgICAgIGhpZGU6IFsnbGFiZWxbZm9yPWNobGlua10nLCAnI2NobGluayddLAogICAgICAgICAgICBleGVjOiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIHZhciBidG4gPSAkKCcjYnRuX2Rvd25sb2FkJykKICAgICAgICAgICAgICAgIGlmICghZXhpc3RzKGJ0bikpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGJ0bi5yZW1vdmVBdHRyKCdvbmNsaWNrJykKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgRGV2SG9zdDogewogICAgICAgICAgICBob3N0OiBbJ2QtaC5zdCddLAogICAgICAgICAgICB1bmNoZWNrOiBbJyNkbS1jaGVjayddLAogICAgICAgICAgICBoaWRlOiBbJyNkb3dubG9hZG1hbmFnZXInLCdhOmhhcyg+aW1nW3NyYyo9Ii9hc3NldHMvaW1nL2Rvd25sb2FkMS5wbmciXSknLCAnI2Rvd25sb2FkZmlsZTInXSwKICAgICAgICB9LAogICAgICAgIERvd25sb2FkOiB7CiAgICAgICAgICAgIGhvc3Q6IFsnZG93bmxvYWQuY25ldC5jb20nLCd0ZWxlY2hhcmdlci5jbmV0LmNvbScsJ2Rlc2Nhcmdhci5jbmV0LmNvbSddLAogICAgICAgICAgICBoaWRlOiBbJy5kbG4tc3ViLW1lc3NhZ2UnLCcjdGl0bGUtZGV0YWlsLWRvd25sb2FkLW5vdy1idXR0b24tZGxtLW5vdGljZS1pY29uJywnLmRvd25sb2FkLW5vdy5kaXJlY3QtZG93bmxvYWQtYnV0dG9uLWRsbiddLAogICAgICAgICAgICBleGVjOiBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIC8vIC0tPiBUaGlzIGlzIGZvciBwcm9ncmFtIHBhZ2VzCiAgICAgICAgICAgICAgICAvLyBGaW5kIHRoZSByZWFsIGRvd25sb2FkIGxpbmsKICAgICAgICAgICAgICAgIHZhciBhZHdhcmVsZXNzTGluayA9ICQoJy5kb3dubG9hZC1ub3cnKS5hdHRyKCdkYXRhLW5vZGxtLXVybCcpCiAgICAgICAgICAgICAgICAvLyBJZiB3ZSBzdWNjZXNzZnVsbHkgZm91bmQgaXQKICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgYWR3YXJlbGVzc0xpbmsgIT0gJ3VuZGVmaW5lZCcpIHsKICAgICAgICAgICAgICAgICAgICAvLyBXZSByZXBsYWNlIHRoZSBhZHdhcmUtZW5hYmxlZCBsaW5rIHdpdGggdGhlIGFkd2FyZWxlc3MgbGluawogICAgICAgICAgICAgICAgICAgIHZhciBidG4gPSAkKCJhLmRsbi1hOmhhcygnLmRsbi1jdGEnKSIpCiAgICAgICAgICAgICAgICAgICAgYnRuLnByb3AoJ2hyZWYnLCBhZHdhcmVsZXNzTGluaykKICAgICAgICAgICAgICAgICAgICBidG4uYXR0cignZGF0YS1ocmVmJywgYWR3YXJlbGVzc0xpbmspCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgLy8gLS0+IFRoaXMgaXMgZm9yIHNlYXJjaCBsaXN0cwogICAgICAgICAgICAgICAgLy8gQ2hlY2sgZWFjaCBkb3dubG9hZCBidXR0b24gZnJvbSB0aGUgbGlzdAogICAgICAgICAgICAgICAgJCgnLmRvd25sb2FkLW5vdy5saXN0aW5nLWJ1dHRvbi1kbG4nKS5lYWNoKAogICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uKGN1cnJJbmRleCwgY3VyckRPTUVsZW1lbnQpIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJFbGVtZW50ID0gJChjdXJyRE9NRWxlbWVudCkKCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIEdldCB0aGUgZGlyZWN0IGRvd25sb2FkIGxpbmsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN1cnJEaXJlY3REbExpbmsgPSBjdXJyRWxlbWVudC5hdHRyKCdkYXRhLW5vZGxtLXVybCcpCgogICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB3ZSBjb3VsZG4ndCBmaW5kIHRoZSBkaXJlY3QgZG93bmxvYWQgbGluaywgd2UgYWJhbmRvbgogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGN1cnJEaXJlY3REbExpbmsgPT0gJ3VuZGVmaW5lZCcpIHtyZXR1cm59CgogICAgICAgICAgICAgICAgICAgICAgICAvLyBSZXBsYWNlIHRoZSBkb3dubG9hZCBsaW5rIHdpdGggdGhlIGRpcmVjdCwgZG93bmxvYWQgbWFuYWdlci1sZXNzIGxpbmsKICAgICAgICAgICAgICAgICAgICAgICAgY3VyckVsZW1lbnQuY2hpbGRyZW4oJy5kbG4tYScpLnByb3AoJ2hyZWYnLCBjdXJyRGlyZWN0RGxMaW5rKQoKICAgICAgICAgICAgICAgICAgICAgICAgLy8gU29tZWhvdyB0aGlzIGNsYXNzIHByZXZlbnRzIHRoZSBkb3dubG9hZCBmcm9tIGxhdW5jaGluZyBwcm9wZXJseSAoYXQgbGVhc3Qgb24gRmlyZWZveCkKICAgICAgICAgICAgICAgICAgICAgICAgY3VyckVsZW1lbnQucmVtb3ZlQ2xhc3MoJ2Rvd25sb2FkLW5vdycpCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgRmlsZWZhY3Rvcnk6IHsKICAgICAgICAgICAgaG9zdDogWydmaWxlZmFjdG9yeS5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjZG93bmxvYWRfbWFuYWdlciA+IGlucHV0OmNoZWNrYm94J10sCiAgICAgICAgICAgIGhpZGU6IFsnI2Rvd25sb2FkX21hbmFnZXInXQogICAgICAgIH0sCiAgICAgICAgRmlsZXNDRE46IHsKICAgICAgICAgICAgaG9zdDogWydmaWxlc2Nkbi5jb20nXSwKICAgICAgICAgICAgZXhlYzogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAkKCcjYnRuX2Rvd25sb2FkJykucHJvcCgnb25jbGljaycsIG51bGwpCiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIEZyZWV3YXJlZmlsZXM6IHsKICAgICAgICAgICAgaG9zdDogWydmcmVld2FyZWZpbGVzLmNvbSddLAogICAgICAgICAgICBoaWRlOiBbJ3NwYW4uc21hbGxsaW5rczpjb250YWlucygiZG93bmxvYWQgbWFuYWdlciIpJ10sCiAgICAgICAgICAgIGV4ZWM6IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgdmFyIGRpcmVjdExpbmsgPSAkKCdhLmR3bmxvY2F0aW9ucycpLnByb3AoJ2hyZWYnKQogICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkaXJlY3RMaW5rID09ICd1bmRlZmluZWQnKSB7cmV0dXJufQoKICAgICAgICAgICAgICAgICQoJ3RkW3dpZHRoPTMzMF1bYWxpZ249bGVmdF0gPiBhJykucHJvcCgnaHJlZicsIGRpcmVjdExpbmspCiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIEdvb2dsZUVhcnRoOiB7CiAgICAgICAgCWhvc3Q6IFsnZ29vZ2xlLiddLAogICAgICAgIAl1bmNoZWNrOiBbJyNkbC1hZ3JlZS1jaHJvbWUnLCcjZGwtYWdyZWUtY2hyb21lLWRlZmF1bHQnXSwKICAgICAgICAJaGlkZTogWycjZGwtY2hyb21lLXByb21vJ10KICAgICAgICB9LAogICAgICAgIEh1Z2VmaWxlczogewogICAgICAgICAgICBob3N0OiBbJ2h1Z2VmaWxlcy5uZXQnXSwKICAgICAgICAgICAgdW5jaGVjazogWycjZGFwJywnI3VzZV9kb3dubG9hZGVyJ10sCiAgICAgICAgICAgIGhpZGU6IFsic3Bhbjpjb250YWlucygndXNpbmcgZG93bmxvYWQgYWNjZWxlcmF0b3InKSIsICcjZGFwJywgJyN1c2VfZG93bmxvYWRlcicsICdpbWdbc3JjPSJodHRwOi8vaHVnZWZpbGVzLm5ldC9idXR0b24ucG5nIl0nXQogICAgICAgIH0sCiAgICAgICAgSHVsa2xvYWQ6IHsKICAgICAgICAgICAgaG9zdDogWydodWxrbG9hZC5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjc3Buc3JkbGQnLCAnI3VzZS1tYW5hZ2VyJ10sCiAgICAgICAgICAgIGhpZGU6IFsKICAgICAgICAgICAgCSJmb3JtOmNvbnRhaW5zKCdkb3dubG9hZCBUaGUgRlJFRSBkb3dubG9hZCBhY2NlbGVyYXRvcicpIiwnI3NwbnNyZGxkJywnI2Rvd25sb2FkLXRpY2snLAogICAgICAgICAgICAJJ2ltZ1tzcmNePSJodHRwOi8vaHVsa2xvYWQuY29tL2ltYWdlcy9kbGQiXScsIC8vIEZha2UgZG93bmxvYWQgYnV0dG9uCiAgICAgICAgICAgIAknZGl2LmFsZXJ0W29uY2xpY2s9ImdvdG8oKSJdJywgLy8gRmFrZSBzcG9uc29yZWQgbGlua3MKICAgICAgICAgICAgCSdkaXZbc3R5bGUqPSJoZWlnaHQ6IDkwcHg7IGJvcmRlcjogM3B4IHNvbGlkIHJnYigyMDUsIDI0MCwgMjQ2KSJdJyAvLyBGYWtlIGRvd25sb2FkIGJhbm5lciAobGl2ZXJzZWx5KQogICAgICAgICAgICBdCiAgICAgICAgfSwKICAgICAgICBLaW5nZmlsZXM6IHsKICAgICAgICAgICAgaG9zdDogWydraW5nZmlsZXMubmV0J10sCiAgICAgICAgICAgIHVuY2hlY2s6IFsnI2NtbGlfZG93bmxvYWRlciddLAogICAgICAgICAgICBoaWRlOiBbJyN0ZXN0MSddLAogICAgICAgICAgICAvLyBBdm9pZHMgYSBwb3B1cCB3aGVuIHVuY2hlY2tpbmcgdGhlIGNoZWNrYm94CiAgICAgICAgICAgIGV4ZWM6IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgJCgnI2NtbGlfZG93bmxvYWRlcicpLnByb3AoJ29uY2xpY2snLCBudWxsKQogICAgICAgICAgICB9CiAgICAgICAgfSwKICAgICAgICBMZXRpdGJpdDogewogICAgICAgICAgICBob3N0OiBbJ2xldGl0Yml0Lm5ldCddLAogICAgICAgICAgICB1bmNoZWNrOiBbJyNza3ltb25rX2NoZWNrYm94J10sCiAgICAgICAgICAgIGhpZGU6IFsnI3NreW1vbmtfY2hlY2tib3gnLCAnbGFiZWxbZm9yPXNreW1vbmtfY2hlY2tib3hdJ10KICAgICAgICB9LAogICAgICAgIExvdmVSb21zOiB7CiAgICAgICAgICAgIGhvc3Q6IFsnbG92ZXJvbXMuY29tJ10sCiAgICAgICAgICAgIHVuY2hlY2s6IFsnI2Rvd25sb2FkV2l0aE1hbmFnZXInXSwKICAgICAgICAgICAgaGlkZTogWycuZG93bmxvYWQtbGFiZWwnXQogICAgICAgIH0sCiAgICAgICAgVXBNZWRpYTFmaXJlOiB7CiAgICAgICAgICAgIGhvc3Q6IFsndXAubWVkaWExZmlyZS5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjdXNlLW1hbmFnZXInXSwKICAgICAgICAgICAgaGlkZTogWycjZG93bmxvYWQtYm94JywgJyNzcG9uc29yMicsICdkaXYuY29udGVudG9yID4gY2VudGVyJywgJy5hbGVydDInLCAnaW1nW3NyY149Imh0dHA6Ly91cC5tZWRpYTFmaXJlLmNvbS9uYi9SZWNfYiJdJ10KICAgICAgICB9LAogICAgICAgIE1pZ2h0eXVwbG9hZDogewogICAgICAgICAgICBob3N0OiBbJ21pZ2h0eXVwbG9hZC5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjdXNlX2luc3RhbGxlciddLAogICAgICAgICAgICBoaWRlOiBbJyN1c2VfaW5zdGFsbGVyJywgJ2xhYmVsW2Zvcj11c2VfaW5zdGFsbGVyXScsJyNsbmtfZG93bmxvYWQgfiBiciddCiAgICAgICAgfSwKICAgICAgICBNcDNmaWw6IHsKICAgICAgICAgICAgaG9zdDogWydtcDNmaWxcLiddLAogICAgICAgICAgICB1bmNoZWNrOiBbJyNjaGVjayA+IGlucHV0OmNoZWNrYm94W25hbWU9Y2hlY2tdJ10sCiAgICAgICAgICAgIGhpZGU6IFsnI2NoZWNrJ10KICAgICAgICB9LAogICAgICAgIE1wM2p1aWNlczogewogICAgICAgICAgICBob3N0OiBbJ21wM2p1aWNlcy50byddLAogICAgICAgICAgICB1bmNoZWNrOiBbJ2lucHV0OmNoZWNrYm94W25hbWU9ZGxfbWFuYWdlcl0nXSwKICAgICAgICAgICAgaGlkZTogWycuZGxfbWFuYWdlciwuY1tzdHlsZT0iaGVpZ2h0OjgwcHgiXSddCiAgICAgICAgfSwKICAgICAgICBNcDNvbGltcDogewogICAgICAgIAlob3N0OiBbJ21wM29saW1wLm5ldHxtcDNvbGltcHouY29tJ10sCiAgICAgICAgCXVuY2hlY2s6IFsnI2Rvd25sb2FkLW1hbmFnZXItY2hlY2tib3gnXSwKICAgICAgICAJaGlkZTogWycjZG93bmxvYWQtbWFuYWdlciddCiAgICAgICAgfSwKICAgICAgICBPcGVuc3VidGl0bGVzOiB7CiAgICAgICAgICAgIGhvc3Q6IFsnb3BlbnN1YnRpdGxlcy5vcmcnXSwKICAgICAgICAgICAgdW5jaGVjazogWycjY2JEb3dubG9hZGVyJ10sCiAgICAgICAgICAgIG9wdHVuY2hlY2s6IHsKICAgICAgICAgICAgICAgIC8vIE5ldmVyIHN0b3AgdG8gdHJ5IHVuY2hlY2tpbmcgdGhlIGNoZWNrYm94CiAgICAgICAgICAgICAgICBjb25zdGFudGNoZWNrOiB0cnVlCiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGhpZGU6IFsnI2NiRG93bmxvYWRlcicsJyNsYi1kd2wnXSwKICAgICAgICAgICAgb3B0aGlkZTogewogICAgICAgICAgICAgICAgLy8gTmV2ZXIgc3RvcCB0byB0cnkgaGlkaW5nIHRoZSBvYmplY3QKICAgICAgICAgICAgICAgIGNvbnN0YW50Y2hlY2s6IHRydWUKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgRmlsZWhpcHBvOiB7CiAgICAgICAgICAgIGhvc3Q6IFsnZmlsZWhpcHBvLmNvbSddLAogICAgICAgICAgICAvLyBXaWxsIGRvIG5vdGhpbmcgb24gcGFnZXMgd2l0aG91dCBhIGRvd25sb2FkIG1hbmFnZXIKICAgICAgICAgICAgaGlkZTogWycjcHJvZ3JhbS1oZWFkZXItZG93bmxvYWQtbGluay1kbS10ZXh0JywgJyNkaXJlY3QtZG93bmxvYWQtbGluay1jb250YWluZXInXSwKICAgICAgICAgICAgZXhlYzogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB2YXIgYWR3T2JqID0gJCgnLnByb2dyYW0taGVhZGVyLWRvd25sb2FkLWxpbmsuZG93bmxvYWQtbWFuYWdlci1lbmFibGVkJykKICAgICAgICAgICAgICAgIC8vIEFwcGVuZCA/ZGlyZWN0IGF0IHRoZSBlbmQgb2YgdGhlIFVSTCBzbyB0aGF0IGl0IGRvZXNuJ3QgcHJvdmlkZSB0aGUgZG93bmxvYWQgbWFuYWdlcgogICAgICAgICAgICAgICAgdmFyIGRpcmVjdFVybCA9IGFkd09iai5hdHRyKCdocmVmJykgKyAnP2RpcmVjdCcKCiAgICAgICAgICAgICAgICBhZHdPYmouYXR0cignaHJlZicsIGRpcmVjdFVybCkKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgUmV2Q2xvdWRzOiB7CiAgICAgICAgICAgIGhvc3Q6IFsncmV2Y2xvdWRzLmNvbSddLAogICAgICAgICAgICB1bmNoZWNrOiBbJyN0aWNrLWR3biddLAogICAgICAgICAgICBoaWRlOiBbJy50aWNrLWJveCddCiAgICAgICAgfSwKICAgICAgICBSb21odXN0bGVyOiB7CiAgICAgICAgICAgIGhvc3Q6IFsncm9taHVzdGxlci5uZXQnXSwKICAgICAgICAgICAgdW5jaGVjazogWycjdXNlX2FjY2VsZXJhdG9yJ10sCiAgICAgICAgICAgIGhpZGU6IFsnLmFjY2VsZXJhdG9yJ10KICAgICAgICB9LAogICAgICAgIFNlY3VyZXVwbG9hZDogewogICAgICAgIAlob3N0OiBbJ3NlY3VyZXVwbG9hZC5ldSddLAogICAgICAgIAl1bmNoZWNrOiBbJ2Zvcm1bbmFtZT1kbG1hbmFnZXJdID4gaW5wdXQ6Y2hlY2tib3gnXSwKICAgICAgICAJb3B0dW5jaGVjazogewogICAgICAgICAgICAgICAgLy8gTmV2ZXIgc3RvcCB0byB0cnkgdW5jaGVja2luZyB0aGUgY2hlY2tib3gKICAgICAgICAgICAgICAgIGNvbnN0YW50Y2hlY2s6IHRydWUKICAgICAgICAgICAgfSwKICAgICAgICAJaGlkZTogWydmb3JtW25hbWU9ZGxtYW5hZ2VyXScsICdpbWdbc3JjPSJodHRwczovL3d3dy5zZWN1cmV1cGxvYWQuZXUvZ2Z4L2RsYnRuLnBuZyJdJywgJ2ltZ1tzcmM9Imh0dHBzOi8vd3d3LnNlY3VyZXVwbG9hZC5ldS9nZngvZnJlZWRsLnBuZyJdJ10sCiAgICAgICAgCW9wdGhpZGU6IHsKICAgICAgICAgICAgICAgIC8vIE5ldmVyIHN0b3AgdG8gdHJ5IGhpZGluZyB0aGUgb2JqZWN0CiAgICAgICAgICAgICAgICBjb25zdGFudGNoZWNrOiB0cnVlCiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIFNlbmRzcGFjZTogewogICAgICAgICAgICBob3N0OiBbJ3NlbmRzcGFjZS5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjcXVpY2tjaGsnXSwKICAgICAgICAgICAgaGlkZTogWyJmb3JtID4gZGl2OmNvbnRhaW5zKCd3aXRoIHNlbmRzcGFjZSBhY2NlbGVyYXRvcicpIiwnI3F1aWNrY2hrJ10KICAgICAgICB9LAogICAgICAgIFNoYXJlYmVhc3Q6IHsKICAgICAgICAgICAgaG9zdDogWydzaGFyZWJlYXN0LmNvbSddLAogICAgICAgICAgICB1bmNoZWNrOiBbJyNzaGFyZWJlYXN0X2Rvd25sb2FkZXInXSwKICAgICAgICAgICAgaGlkZTogWycjc2hhcmViZWFzdF9kb3dubG9hZGVyX2NvbnRhaW5lciddCiAgICAgICAgfSwKICAgICAgICBTaGFyZWQ6IHsKICAgICAgICAgICAgaG9zdDogWydzaGFyZWQuY29tJ10sCiAgICAgICAgICAgIHVuY2hlY2s6IFsnI3VzZS1tYW5hZ2VyJ10sCiAgICAgICAgICAgIGhpZGU6IFsnI3dlYnBpY2stb3B0aW9uJ10KICAgICAgICB9LAogICAgICAgIFNvZnRNODogewogICAgICAgICAgICBob3N0OiBbJy5zb2Z0bTguY29tJ10sCiAgICAgICAgICAgIGhpZGU6IFsnI2RpbmZvMltzdHlsZT0iY2xlYXI6Ym90aDsiXSddLCAvLyBCbGFoIGJsYWggYWJvdXQgQWR3YXJlCiAgICAgICAgICAgIGV4ZWM6IGZ1bmN0aW9uKCkgewogICAgICAgICAgICAgICAgdmFyIGJ1dE1hdGNoID0gJy5idXR0b25Eb3dubG9hZC5kYnRuZGwnCiAgICAgICAgICAgICAgICB2YXIgZGxCdXQgPSAkKGJ1dE1hdGNoKQoKICAgICAgICAgICAgICAgIC8vIFRha2UgdGhlIGxhc3QgcGFydCBvZiB0aGUgcGF0aCBvZiB0aGUgVVJMCiAgICAgICAgICAgICAgICB2YXIgZXhlTmFtZSA9IGRsQnV0LnByb3AoJ2hyZWYnKS5zcGxpdCgnLycpLnBvcCgpCgogICAgICAgICAgICAgICAgLy8gRm91bmQgaW4gdGhlIGFkd2FyZSBpbnN0YWxsYXRpb24gZXhlY3V0YWJsZQogICAgICAgICAgICAgICAgdmFyIG5vQWRMbmsgPSAnaHR0cDovL2guc29mdG04LmNvbS8nICsgZXhlTmFtZQoKICAgICAgICAgICAgICAgIC8vIENhbiBiZSBtdWx0aXBsZSBidXR0b25zCiAgICAgICAgICAgICAgICBkbEJ1dC5wcm9wKCdocmVmJywgbm9BZExuaykKICAgICAgICAgICAgICAgIHVuc2FmZVdpbmRvdy4kKGJ1dE1hdGNoKS5vZmYoJ2NsaWNrJykgLy8gUHJldmVudHMgdGhlIGRvd25sb2FkIGZyb20gbGF1bmNoaW5nIHByb3Blcmx5CiAgICAgICAgICAgIH0KICAgICAgICB9LAogICAgICAgIFNvZnRvbmljOiB7CiAgICAgICAgICAgIGhvc3Q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ICAgIGlmIChvbGRIcmVmLnN1YnN0cmluZyhvbGRIcmVmLmxlbmd0aC03KSA9PSAnJm5vd3JhcCcpIHtyZXR1cm59CgogICAgICAgICAgICAgICAgICAgICAgICAvLyBPdGhlcndpc2UgYXBwZW5kIGl0CiAgICAgICAgICAgICAgICAgICAgICAgICQodGhpcykucHJvcCgnaHJlZicsICQodGhpcykucHJvcCgnaHJlZicpICsgJyZub3dyYXAnKQogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICB9LCA1MCkKICAgICAgICAgICAgfQogICAgICAgIH0sCiAgICAgICAgVHVzZmlsZXM6IHsKICAgICAgICAgICAgaG9zdDogWyd0dXNmaWxlcy5uZXQnXSwKICAgICAgICAgICAgdW5jaGVjazogWydpbnB1dDpjaGVja2JveFtuYW1lPXF1aWNrXSddLAogICAgICAgICAgICBoaWRlOiBbJ2lucHV0OmNoZWNrYm94W25hbWU9cXVpY2tdIH4gbGFiZWwnLCAnaW5wdXQ6Y2hlY2tib3hbbmFtZT1xdWlja10nLCdhW3RhcmdldD1fYmxhbmtdW2hyZWYqPSJodHRwOi8vc2hhcmVzdXBlci5pbmZvLyJdLGltZ1tzcmM9Imh0dHBzOi8vei50dXNmaWxlcy5uZXQvaS9kbGwucG5nIl0nXQogICAgICAgIH0sCiAgICAgICAgVXBsb2FkaW5nOiB7CiAgICAgICAgICAgIGhvc3Q6IFsndXBsb2FkaW5nLmNvbSddLAogICAgICAgICAgICB1bmNoZWNrOiBbJyNmb3JjZV9leGUnXSwKICAgICAgICAgICAgaGlkZTogWycudXNlX2Rvd25sb2FkX21hbmFnZXInXQogICAgICAgIH0sCiAgICAgICAgVXBsb2FkT2NlYW46IHsKICAgICAgICAgICAgaG9zdDogWyd1cGxvYWRvY2Vhbi5jb20nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjdGljay1kd24nXSwKICAgICAgICAgICAgaGlkZTogWycudGljay1ib3gnXQogICAgICAgIH0sCiAgICAgICAgVXBsb2R3czp7CiAgICAgICAgICAgIGhvc3Q6IFsndXBsb2Qud3MnXSwKICAgICAgICAgICAgdW5jaGVjazogWycjY2hrSXNBZGQnXSwKICAgICAgICAgICAgaGlkZTogWydsYWJlbDpjb250YWlucygib2ZmZXIiKScsJ2ltZ1tzcmM9Imh0dHA6Ly9nb28uZ2wvQ0dIVlZvIl0nXQogICAgICAgIH0sCiAgICAgICAgVXBsb2FkczogewogICAgICAgICAgICBob3N0OiBbJ3VwbG9hZHMudG8nXSwKICAgICAgICAgICAgdW5jaGVjazogWycjY2hrSXNBZGQnXSwKICAgICAgICAgICAgaGlkZTogWydhOmNvbnRhaW5zKCJNQU5BR0VSIiknLCdjZW50ZXI6Y29udGFpbnMoIk9mZmVyIiknXSwKICAgICAgICB9LAogICAgICAgIFVwdG9ib3g6IHsKICAgICAgICAgICAgaG9zdDogWyd1cHRvYm94LmNvbSddLAogICAgICAgICAgICBoaWRlOiBbJ2Rpdi5yZXNlbGxlciA+IHRhYmxlW2FsaWduPWNlbnRlcl0nXSwKICAgICAgICAgICAgZXhlYzogZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICB2YXIgYnV0dG9uID0gJCgnZGl2LnJlc2VsbGVyID4gdGFibGVbYWxpZ249Y2VudGVyXSBkaXZbYWxpZ249Y2VudGVyXSA+IGEnKQogICAgICAgICAgICAgICAgdmFyIGFkd2FyZSA9IGJ1dHRvbi5wcm9wKCdocmVmJykKCiAgICAgICAgICAgICAgICAvLyBSZXRyaWV2ZSB0aGUgcmVhbCBkb3dubG9hZCBsaW5rIGFuZCBjaGFuZ2UgdGhlIGJ1dHRvbiB3aXRoIHRoaXMgbGluawogICAgICAgICAgICAgICAgdmFyIGRvd25sb2FkID0gYWR3YXJlLm1hdGNoKC8mcHJvZHVjdF9kb3dubG9hZF91cmw9KFteJCZdKykkLylbMV0KICAgICAgICAgICAgICAgIGJ1dHRvbi5wcm9wKCdocmVmJywgZG93bmxvYWQpCgogICAgICAgICAgICAgICAgLy8gUHV0IH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wZSA9PT0gOCkgewoKICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZm91bmQgYSBjb21tZW50IG5vZGUuIEFkZCBpdCB0bwogICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGUgbm9kZXMgY29sbGVjdGlvbiB3cmFwcGVkIGluIGEKICAgICAgICAgICAgICAgICAgICAgICAgLy8gRElWIChhcyB3ZSBtYXkgaGF2ZSBIVE1MKS4KICAgICAgICAgICAgICAgICAgICAgICAgakNvbW1lbnRzID0gakNvbW1lbnRzLmFkZCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8ZGl2IHJlbD0nIiArIHN0clBhcmVudElEICsgIic+IiArCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvYmpDaGlsZE5vZGUubm9kZVZhbHVlICsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICI8L2Rpdj4iCiAgICAgICAgICAgICAgICAgICAgICAgICk7CgogICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoCiAgICAgICAgICAgICAgICAgICAgICAgIGJsbkRlZXAgJiYKICAgICAgICAgICAgICAgICAgICAgICAgKG9iakNoaWxkTm9kZS5ub2RlVHlwZSA9PT0gMSkKICAgICAgICAgICAgICAgICAgICApIHsKCiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRyYXZlcnNlIHRoaXMgbm9kZSBkZWVwbHkuCiAgICAgICAgICAgICAgICAgICAgICAgIGpDb21tZW50cyA9IGpDb21tZW50cy5hZGQoCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkKG9iakNoaWxkTm9kZSkuY29tbWVudHModHJ1ZSkKICAgICAgICAgICAgICAgICAgICAgICAgKTsKCiAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAvLyBNb3ZlIHRvIHRoZSBuZXh0IHNpYmxpbmcuCiAgICAgICAgICAgICAgICAgICAgb2JqQ2hpbGROb2RlID0gb2JqQ2hpbGROb2RlLm5leHRTaWJsaW5nOwoKICAgICAg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yUnVsZS5leGVjICE9IHVuZGVmaW5lZCkgY3VyclJ1bGUuZXhlYygpOwogICAgICAgIGxvZygiSXRlcmF0aW5nIHRocm91Z2ggdW5jaGVja3MiKQoKICAgICAgICAvLyBJZiB0aGVyZSBpcyBzb21ldGhpbmcgdG8gdW5jaGVjawogICAgICAgIGlmIChjdXJyUnVsZS51bmNoZWNrICE9IHVuZGVmaW5lZCkgewogICAgICAgICAgICAvLyBJdGVyYXRlIGVhY2ggY2hlY2tib3ggdG8gdW5jaGVjayBpdAogICAgICAgICAgICAkLmVhY2goY3VyclJ1bGUudW5jaGVjaywgZnVuY3Rpb24gKGtleSwgY3VyclVuY2hlY2spIHsKICAgICAgICAgICAgICAgIGxvZygiVHJ5aW5nIHRvIHVuY2hlY2sgWyIgKyBrZXkgKyAnXScgKyBjdXJyVW5jaGVjaykKICAgICAgICAgICAgICAgIC8vIENvbnN0YW50bHkgdHJ5aW5nIHRvIHVuY2hlY2sgdGhlIGNoZWNrYm94CiAgICAgICAgICAgICAgICBpZiAoY3VyclJ1bGUub3B0dW5jaGVjayAhPSB1bmRlZmluZWQgJiYgY3VyclJ1bGUub3B0dW5jaGVjay5jb25zdGFudGNoZWNrID09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICB1bmNoZWNrKCQoY3VyclVuY2hlY2spKQogICAgICAgICAgICAgICAgICAgIHZhciBwZXJpb2RpY0hpZGUgPSBzZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIFVuY2hlY2sgaXQKICAgICAgICAgICAgICAgICAgICAgICAgdW5jaGVjaygkKGN1cnJVbmNoZWNrKSkKICAgICAgICAgICAgICAgICAgICB9LCAxMDApCiAgICAgICAgICAgICAgICAgICAgLy8gT25seSB1bmNoZWNraW5nIGl0IG9uY2UKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIGNoZWNrYm94IHdhcyBzdWNjZXNzZnVsbHkgdW5jaGVja2VkCiAgICAgICAgICAgICAgICAgICAgaWYgKHVuY2hlY2soJChjdXJyVW5jaGVjaykpKSByZXR1cm4KICAgICAgICAgICAgICAgICAgICBsb2coIkNvdWxkbid0IHVuY2hlY2sgdGhlIGNoZWNrYm94IikKICAgICAgICAgICAgICAgICAgICAvLyBUcnkgdG8gdW5jaGVjayBpdCBsYXRlcgogICAgICAgICAgICAgICAgICAgIHZhciBwZXJpb2RpY1VuY2hlY2sgPSBzZXRJbnRlcnZhbChmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSB1bmNoZWNrIHN1Y2NlZWRlZCB0aGlzIHRpbWUsIHdlIHN0b3AgdGhlIHVuY2hlY2tpbmcKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVuY2hlY2soJChjdXJyVW5jaGVjaykpKSBjbGVhckludGVydmFsKHBlcmlvZGljVW5jaGVjaykKICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCB3ZSBjb250aW51ZSB0byBjaGVjawogICAgICAgICAgICAgICAgICAgIH0sIDEwMCkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSkKICAgICAgICB9CgogICAgICAgIC8vIElmIHRoZXJlIGlzIHNvbWV0aGluZyB0byBoaWRlCiAgICAgICAgaWYgKGN1cnJSdWxlLmhpZGUgIT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgIC8vIEl0ZXJhdGUgZWFjaCBoaWRlIHRvIGhpZGUgaXQKICAgICAgICAgICAgJC5lYWNoKGN1cnJSdWxlLmhpZGUsIGZ1bmN0aW9uIChrZXksIGN1cnJIaWRlKSB7CiAgICAgICAgICAgICAgICBsb2coIlRyeWluZyB0byBoaWRlICIgKyBjdXJySGlkZSkKICAgICAgICAgICAgICAgIC8vIElmIHdlIHRyeSB0byBjb250aW51ZSBoaWRpbmcgaXQgZXZlbiBpZiB0aGUgaGlkaW5nIHdhcyBhbHJlYWR5IHN1Y2Nlc3NmdWwKICAgICAgICAgICAgICAgIGlmIChjdXJyUnVsZS5vcHRoaWRlICE9IHVuZGVmaW5lZCAmJiBjdXJyUnVsZS5vcHRoaWRlLmNvbnN0YW50Y2hlY2sgPT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgIGhpZGUoJChjdXJySGlkZSkpCiAgICAgICAgICAgICAgICAgICAgdmFyIHBlcmlvZGljSGlkZSA9IHNldEludGVydmFsKGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgLy8gSGlkZSBpdAogICAgICAgICAgICAgICAgICAgICAgICBoaWRlKCQoY3VyckhpZGUpKQogICAgICAgICAgICAgICAgICAgIH0sIDEwMCkKICAgICAgICAgICAgICAgICAgICAvLyBIaWRlIGl0IG9uY2UsIHRoZW4gc3RvcCB0cnlpbmcgdG8gaGlkZSBpdCAodXN1YWwgY2FzZSwgaXQgc3RheXMgaGlkZGVuKQogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgb2JqZWN0IHRvIGhpZGUgd2FzIGhpZGRlbgogICAgICAgICAgICAgICAgICAgIGlmIChoaWRlKCQoY3VyckhpZGUpKSkgcmV0dXJuCiAgICAgICAgICAgICAgICAgICAgLy8gVHJ5IHRvIGhpZGUgaXQgbGF0ZXIKICAgICAgICAgICAgICAgICAgICB2YXIgcGVyaW9kaWNIaWRlID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgaGlkZSBzdWNjZWVkZWQgdGhpcyB0aW1lLCB3ZSBzdG9wIHRvIHRyeSBoaWRpbmcgaXQKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhpZGUoJChjdXJySGlkZSkpKSBjbGVhckludGVydmFsKHBlcmlvZGljSGlkZSkKICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCB3ZSBjb250aW51ZSB0byB0cnkgaGlkaW5nIGl0CiAgICAgICAgICAgICAgICAgICAgfSwgMTAwKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9KQogICAgICAgIH0KCiAgICAgICAgLy8gSWYgdGhlcmUgaXMgc29tZXRoaW5nIHRvIHNob3cKICAgICAgICBpZiAoY3VyclJ1bGUuc2hvdyAhPSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgLy8gSXRlcmF0ZSBlYWNoIHNob3cgdG8gc2hvdyBpdAogICAgICAgICAgICAkLmVhY2goY3VyclJ1bGUuc2hvdywgZnVuY3Rpb24gKGtleSwgY3VyclNob3cpIHsKICAgICAgICAgICAgICAgIGxvZygiVHJ5aW5nIHRvIHNob3cgIiArIGN1cnJTaG93KQoKICAgICAgICAgICAgICAgIC8vIElmIHRoZSBvYmplY3QgdG8gc2hvdyB3YXMgc3VjY2Vzc2Z1bGx5IHNob3duCiAgICAgICAgICAgICAgICBpZiAoc2hvdygkKGN1cnJTaG93KSkpIHJldHVybgoKICAgICAgICAgICAgICAgIC8vIFRyeSB0byBzaG93IGl0IGxhdGVyCiAgICAgICAgICAgICAgICB2YXIgcGVyaW9kaWNTaG93ID0gc2V0SW50ZXJ2YWwoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHNob3coJChjdXJyU2hvdykpCiAgICAgICAgICAgICAgICAgICAgLy8gSWYgdGhlIHNob3cgc3VjY2VlZGVkIHRoaXMgdGltZSwgd2Ugc3RvcCB0byB0cnkgc2hvd2luZyBpdAogICAgICAgICAgICAgICAgICAgIGlmIChzaG93KCQoY3VyclNob3cpKSkgY2xlYXJJbnRlcnZhbChwZXJpb2RpY1Nob3cpCiAgICAgICAgICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCB3ZSBjb250aW51ZSB0byB0cnkgc2hvd2luZyBpdAogICAgICAgICAgICAgICAgfSwgMTAwKQogICAgICAgICAgICB9KQogICAgICAgIH0KICAgIH0KCiAgICAvLyBHb29nbGUgQ2hyb21lIHRyaWNrOiBzb21ldGltZXMgdGhlIHNjcmlwdCBpcyBleGVjdXRlZCBhZnRlciB0aGF0IERPTUNvbnRlbnRMb2FkZWQgd2FzIHRyaWdnZXJlZCwgaW4gdGhpcyBjYXNlIHdlIGRpcmVjdGx5IHJ1biBvdXIgY29kZQogICAgaWYgKGRvY3VtZW50LnJlYWR5U3RhdGUgPT0gImNvbXBsZXRlIikgewogICAgICAgIGFwcGx5UnVsZXMoKQogICAgICAgIGxvZygiRGlyZWN0bHkgYXBwbHlpbmcgcnVsZXMiKQogICAgfSBlbHNlIHsKICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIGFwcGx5UnVsZXMpCiAgICAgICAgbG9nKCJXYWl0aW5nIGZvciBET01Db250ZW50TG9hZGVkIHRvIGFwcGx5IHJ1bGVzIikKICAgIH0KfSgpCg==","requires":[{"meta":{"name":"jquery-2.0.3.min.js","url":"http://code.jquery.com/jquery-2.0.3.min.js","ts":1649414356838,"mimetype":"text/javascript"},"source":"LyohIGpRdWVyeSB2Mi4wLjMgfCAoYykgMjAwNSwgMjAxMyBqUXVlcnkgRm91bmRhdGlvbiwgSW5jLiB8IGpxdWVyeS5vcmcvbGljZW5zZQovL0Agc291cmNlTWFwcGluZ1VSTD1qcXVlcnktMi4wLjMubWluLm1hcAoqLwooZnVuY3Rpb24oZSx1bmRlZmluZWQpe3ZhciB0LG4scj10eXBlb2YgdW5kZWZpbmVkLGk9ZS5sb2NhdGlvbixvPWUuZG9jdW1lbnQscz1vLmRvY3VtZW50RWxlbWVudCxhPWUualF1ZXJ5LHU9ZS4kLGw9e30sYz1bXSxwPSIyLjAuMyIsZj1jLmNvbmNhdCxoPWMucHVzaCxkPWMuc2xpY2UsZz1jLmluZGV4T2YsbT1sLnRvU3RyaW5nLHk9bC5oYXNPd25Qcm9wZXJ0eSx2PXAudHJpbSx4PWZ1bmN0aW9uKGUsbil7cmV0dXJuIG5ldyB4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ZSh0LG4scixzKX0sdCxvP3I6dW5kZWZpbmVkLG8sbnVsbCl9fSl9KSx4LmZuLnNpemU9ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5sZW5ndGh9LHguZm4uYW5kU2VsZj14LmZuLmFkZEJhY2ssIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUmJm1vZHVsZSYmIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUuZXhwb3J0cz9tb2R1bGUuZXhwb3J0cz14OiJmdW5jdGlvbiI9PXR5cGVvZiBkZWZpbmUmJmRlZmluZS5hbWQmJmRlZmluZSgianF1ZXJ5IixbXSxmdW5jdGlvbigpe3JldHVybiB4fSksIm9iamVjdCI9PXR5cGVvZiBlJiYib2JqZWN0Ij09dHlwZW9mIGUuZG9jdW1lbnQmJihlLmpRdWVyeT1lLiQ9eCl9KSh3aW5kb3cpOwo="}]},{"name":"Filecrypt cleaner","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["filecrypt.cc/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1526307676798,"data":{}},"enabled":false,"position":12,"file_url":"https://code.ponywave.de/workspace/test/fuck/filecryptcleaner.user.js","uuid":"aa255f04-b20c-4244-b349-aa0d060fb834","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBGaWxlY3J5cHQgY2xlYW5lcgovLyBAbmFtZXNwYWNlICAgIGh0dHA6Ly90YW1wZXJtb25rZXkubmV0LwovLyBAdmVyc2lvbiAgICAgIDAuM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Ly9maWxlY3J5cHQuY2MvaW1hZ2VzL2Y0YTEwYTE3LmpwZycsICcnKTsKICB0YWdzW2ldLnNyYyA9IHRhZ3NbaV0uc3JjLnJlcGxhY2UoJ2h0dHBzOi8vd3d3LmZpbGVjcnlwdC5jYy9pbWFnZXMvZjRhMTBhMTcuanBnJywgJycpOwogIHRhZ3NbaV0uc3JjID0gdGFnc1tpXS5zcmMucmVwbGFjZSgnaHR0cDovL3d3dy5maWxlY3J5cHQuY2MvaW1hZ2VzL2Y0YTEwYTE3LmpwZycsICcnKTsKICB0YWdzW2ldLnNyYyA9IHRhZ3NbaV0uc3JjLnJlcGxhY2UoJ2h0dHBzOi8vZmlsZWNyeXB0LmNjL2Jsb2IvNXZwZGVub2QucG5nJywgJycpOwogIHRhZ3NbaV0uc3JjID0gdGFnc1tpXS5zcmMucmVwbGFjZSgnaHR0cDovL2ZpbGVjcnlwdC5jYy9ibG9iLzV2cGRlbm9kLnBuZycsICcnKTsKICB0YWdzW2ldLnNyYyA9IHRhZ3NbaV0uc3JjLnJlcGxhY2UoJ2h0dHA6Ly90aGV2cG5kZWFsLmRvd25sb2FkL2IvNWFkODdlNDQxOWQ1NDI4YjE5MTMyYjM4LzkyNDkwODA1MCcsICcnKTsKICB0YWdzW2ldLnNyYyA9IHRhZ3NbaV0uc3JjLnJlcGxhY2UoJ2h0dHBzOi8vdGhldnBuZGVhbC5kb3dubG9hZC9iLzVhZDg3ZTQ0MTlkNTQyOGIxOTEzMmIzOC85MjQ5MDgwNTAnLCAnJyk7Cn0="},{"name":"Twitter background restorer","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["https://twitter.com/"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1527247725611,"data":{"backgroundURL":"shttps://img.ponywave.de/di/H0XJ/Noire_(Profilhintergrund)_Hyperdimension_Neptunia_Re;Birth1.jpg"}},"enabled":false,"position":13,"file_url":"https://openuserjs.org/install/agubelu/Twitter_background_restorer.user.js","uuid":"dc85c590-3b26-4c53-91bb-4975dedcb51e","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIFR3aXR0ZXIgYmFja2dyb3VuZCByZXN0b3JlcgovLyBAbmFtZXNwYWNlICAgYWd1YmVsdQovLyBAaW5jbHVkZSAgICAgaHR0cHM6Ly90d2l0dGVyLmNvbS8KLy8gQGdyYW50ICAgICAgIEdNX2dldFZhbHVlCi8vIEBncmFudCAgICAgICBHTV9zZXRWYWx1ZQovLyBAdmVyc2lvbiAgICAgMQovLyA9PS9Vc2VyU2NyaXB0PT0KCiAgdmFyIGJnX3VybCA9IEdNX2dldFZhbHVlKCJiYWNrZ3JvdW5kVVJMIiwgZmFsc2UpOwoKICBpZighYmdfdXJsKSB7CiAgIGJnX3VybCA9IHByb21wdCgiUGxlYXNlIGlucHV0IHlvdXIgYmFja2dyb3VuZCBpbWFnZSBVUkw6IiwgIiIpOwogICBHTV9zZXRWYWx1ZSgiYmFja2dyb3VuZFVSTCIsIGJnX3VybCk7CiAgfQoKICBkb2N1bWVudC5ib2R5LnN0eWxlLmJhY2tncm91bmRJbWFnZSA9ICJ1cmwoJyIgKyBiZ191cmwgKyAiJykiOwogIGRvY3VtZW50LmJvZHkuc3R5bGUuYmFja2dyb3VuZFJlcGVhdCA9ICJuby1yZXBlYXQiOwogIGRvY3VtZW50LmJvZHkuc3R5bGUuYmFja2dyb3VuZEF0dGFjaG1lbnQgPSAiZml4ZWQiOw=="},{"name":"Romsmania.cc - Swap download link","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://romsmania.cc/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1538310704784,"data":{}},"enabled":true,"position":14,"file_url":"https://gist.github.com/Brawl345/96103746f8ef5cce17b0bc38f3e104f1/raw/romsmania-link-swapper.user.js","uuid":"a298c7e0-6776-4c9f-aeab-70a9659bc1d1","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBSb21zbWFuaWEuY2MgLSBTd2FwIGRvd25sb2FkIGxpbmsKLy8gQHZlcnNpb24gICAgICAxLjEuMgovLyBAZGVzY3JpcHRpb24gIFN3YXBzIHRoZSBkb3dubG9hZCBidXR0b24gbGluayBhbmQgZm9yY2VzIGRvd25sb2FkIHdpdGhvdXQgdGltZW91dAovLyBAYXV0aG9yICAgICAgIEJyYXdsCi8vIEBtYXRjaCAgICAgICAgaHR0cHM6Ly9yb21zbWFuaWEuY2MvKgovLyBAaWNvbiAgICAgICAgIGh0dHBzOi8vcm9tc21hbmlhLmNjL2Zhdmljb24uaWNvCi8vIEBkb3dubG9hZFVSTCAgaHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vQnJhd2wzNDUvOTYxMDM3NDZmOGVmNWNjZTE3YjBiYzM4ZjNlMTA0ZjEvcmF3L3JvbXNtYW5pYS1saW5rLXN3YXBwZXIudXNlci5qcwovLyBAdXBkYXRlVVJMICAgIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyYXdsMzQ1Lzk2MTAzNzQ2ZjhlZjV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lsZS5kaXNwbGF5ID0gJ25vbmUnOwogICAgICAgIAogICAgICAgIC8vIEFwcGVuZCBpbmZvCiAgICAgICAgdmFyIGFib3V0ID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgicCIpOwogICAgICAgIGFib3V0LmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKCJMaW5rIHN3YXBwZWQgd2l0aCBMaW5rIFN3YXBwZXIgVXNlcnNjcmlwdCIpKTsKICAgICAgICBkbExpbmtFbC5wYXJlbnROb2RlLmluc2VydEJlZm9yZShhYm91dCwgZGxMaW5rRWwubmV4dFNpYmxpbmcpOwogICAgfQoKfSkoKTsK"},{"name":"EmuParadise Download Workaround","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://www.emuparadise.me/*/*/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1538315498494,"data":{}},"enabled":true,"position":15,"file_url":"https://gist.github.com/Brawl345/96103746f8ef5cce17b0bc38f3e104f1/raw/emuparadise-download-workaround.user.js","uuid":"86973ddc-e3ce-44bb-9b12-f678538e835e","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBFbXVQYXJhZGlzZSBEb3dubG9hZCBXb3JrYXJvdW5kCi8vIEB2ZXJzaW9uICAgICAgMS4xLjIuMQovLyBAZGVzY3JpcHRpb24gIFJlcGxhY2VzIHRoZSBkb3dubG9hZCBidXR0b24gbGluayB3aXRoIGEgd29ya2luZyBvbmUuIE5vdyB3aX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b3JrYXJvdW5kIHNjcmlwdCAobWlkZGxlIGNsaWNrIGluIEZpcmVmb3gpJykpOwogICAgbGlua0VsLmhyZWYgPSAnL3JvbXMvZ2V0LWRvd25sb2FkLnBocD9naWQ9JyArIGlkICsgJyZ0ZXN0PXRydWUnCiAgICBsaW5rRWwudGFyZ2V0ID0gJ19ibGFuaycKCiAgICBkbExpbmtFbC5pbnNlcnRCZWZvcmUobGlua0VsLCBkbExpbmtFbC5maXJzdENoaWxkKTsKICAgIGxpbmtFbC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdicicpKTsKICAgIGxpbmtFbC5hcHBlbmRDaGlsZChkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdicicpKTsKCn0pKCk7Cg=="},{"name":"Fuck You Discord","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://old.reddit.com/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1545167415570,"data":{}},"enabled":false,"position":16,"file_url":"https://gist.github.com/Brawl345/96103746f8ef5cce17b0bc38f3e104f1/raw/fuck-you-discord.user.js","uuid":"ea7d525b-a3bb-4644-bbca-2de685782a18","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBGdWNrIFlvdSBEaXNjb3JkCi8vIEB2ZXJzaW9uICAgICAgMS4wLjEuMQovLyBAZGVzY3JpcHRpb24gIFN3YXBzIERpc2NvcmRhcHAgSW1hZ2UgTGlua3MKLy8gQGF1dGhvciAgICAgICBC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ICAgICB9CiAgICB9CiAgICAKICAgIHZhciBhbGxfaW1hZ2VzID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2ltZycpOwogICAgZm9yKHZhciBpPTA7IGkgPCBhbGxfaW1hZ2VzLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgdmFyIGltYWdlID0gYWxsX2ltYWdlc1tpXTsKICAgICAgICBpZihwYXR0ZXJuLnRlc3QoaW1hZ2UpKSB7CiAgICAgICAgICAgIGltYWdlLnNyYyA9ICJodHRwczovL2FuZGk3LnViZXIuc3BhY2UvaW1nLnBocD91cmw9IiArIGltYWdlLnNyYzsKICAgICAgICB9CiAgICB9Cgp9KSgpOwo="},{"name":"YouTube (Old Design) - No Translation","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://www.youtube.com/watch?v=*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1548697487946,"data":{}},"enabled":false,"position":17,"file_url":"https://gist.github.com/Brawl345/96103746f8ef5cce17b0bc38f3e104f1/raw/youtube-no-translation.user.js","uuid":"7afb5e7b-eaca-4afc-9a35-d47f2e95d5e6","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBZb3VUdWJlIChPbGQgRGVzaWduKSAtIE5vIFRyYW5zbGF0aW9uCi8vIEB2ZXJzaW9uICAgICAgMS4wLjAKLy8gQGRlc2NyaXB0aW9uICBVc2VzIHRoZSBvcmlnaW5hbCB0aXRsZSBmb3IgdmlkZW8gcGFnZXMKLy8gQGF1dGhvciAgICAgICBCcmF3bAovLyBAbWF0Y2ggICAgICAgIGh0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9KgovLyBAaWNvbiAgICAgICAgIGh0dHBzOi8vcy55dGltZy5jb20veXRzL2ltZy9mYXZpY29uLXZmbDhxU1YyRi5pY28KLy8gQGRvd25sb2FkVVJMICBodHRwczovL2dpc3QuZ2l0aHViLmNvbS9CcmF3bDM0NS85NjEwMzc0NmY4ZWY1Y2NlMTdiMGJjMzhmM2UxMDRmMS9yYXcveW91dHViZS1uby10cmFuc2xhdGlvbi51c2VyLmpzCi8vIEB1cGRhdGVVUkwgICAgaHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vQnJhd2wzNDUvOTYxMDM3NDZmOGVmNWNjZTE3YjBiYzM4ZjNlMTA0ZjEvcmF3L3lvdXR1YmUtbm8tdHJhbnNsYXRpb24udXNlci5qcwovLyBAc3VwcG9ydFVSTCAgIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyYXdsMzQ1Lzk2MTAzNzQ2ZjhlZjVjY2UxN2IwYmMzOGYzZTEwNGYxI2NvbW1lbnRzCi8vIEBncmFudCAgICAgICAgbm9uZQovLyA9PS9Vc2VyU2NyaXB0PT0KCihmdW5jdGlvbigpIHsKICAgICd1c2Ugc3RyaWN0JzsKICAgIAogICAgZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImVvdy10aXRsZSIpLmlubmVyVGV4dCA9IGRvY3VtZW50LnRpdGxlLnN1YnN0cmluZygwLCBkb2N1bWVudC50aXRsZS5sZW5ndGggLSAxMCk7Cgp9KSgpOwo="},{"name":"Zeit.de - Kein ZEIT PLUS","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://www.zeit.de/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1548697543065,"data":{}},"enabled":true,"position":18,"file_url":"https://gist.github.com/Brawl345/96103746f8ef5cce17b0bc38f3e104f1/raw/kein-zeit-plus.user.js","uuid":"08c51ebb-c99d-4e7d-a99e-873e08dc1756","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBaZWl0LmRlIC0gS2VpbiBaRUlUIFBMVVMKLy8gQHZlcnNpb24gICAgICAxLjAuMAovLyBAZGVzY3JpcHRpb24gIEVudGZlcm50IFpFSVQgUExVUyBBcnRpa2VsCi8vIEBhdXRob3IgICAgICAgQnJhd2wKLy8gQG1hdGNoICAgICAgICBodHRwczovL3d3dy56ZWl0LmRlLyoKLy8gQGljb24gICAgICAgICBodHRwczovL3d3dy56ZWl0LmRlL2Zhdmljb24uaWNvCi8vIEBkb3dubG9hZFVSTCAgaHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vQnJhd2wzNDUvOTYxMDM3NDZmOGVmNWNjZTE3YjBiYzM4ZjNlMTA0ZjEvcmF3L2tlaW4temVpdC1wbHVzLnVzZXIuanMKLy8gQHVwZGF0ZVVSTCAgICBodHRwczovL2dpc3QuZ2l0aHViLmNvbS9CcmF3bDM0NS85NjEwMzc0NmY4ZWY1Y2NlMTdiMGJjMzhmM2UxMDRmMS9yYXcva2Vpbi16ZWl0LXBsdXMudXNlci5qcwovLyBAc3VwcG9ydFVSTCAgIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyYXdsMzQ1Lzk2MTAzNzQ2ZjhlZjVjY2UxN2IwYmMzOGYzZTEwNGYxI2NvbW1lbnRzCi8vIEBncmFudCAgICAgICAgbm9uZQovLyA9PS9Vc2VyU2NyaXB0PT0KCihmdW5jdGlvbigpIHsKICAgICd1c2Ugc3RyaWN0JzsKICAgIAogICAgdmFyIGFydGljbGVzID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ2FydGljbGUnKTsKICAgIHZhciB6cGx1c2FydGljbGUgPSBudWxsOwogICAgZm9yKHZhciBpID0gMDsgaSA8IGFydGljbGVzLmxlbmd0aDsgKytpKSB7CiAgICAgICBpZih0eXBlb2YgYXJ0aWNsZXNbaV0uZGF0YXNldFsienBsdXMiXSAhPT0gInVuZGVmaW5lZCIpIHsKICAgICAgICAgIHpwbHVzYXJ0aWNsZSA9IGFydGljbGVzW2ldOwogICAgICAgICAgenBsdXNhcnRpY2xlLnN0eWxlLmRpc3BsYXkgPSAibm9uZSI7CiAgICAgICB9CiAgICB9Cgp9KSgpOwo="},{"name":"Google.de - \"Es fehlt\" gar nichts","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://www.google.com/search*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1551373828622,"data":{}},"enabled":true,"position":19,"file_url":"https://gist.github.com/Brawl345/96103746f8ef5cce17b0bc38f3e104f1/raw/google-es-fehlt-gar-nichts.user.js","uuid":"91a44956-59ac-48f0-8bce-d212ad13ce81","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBHb29nbGUuZGUgLSAiRXMgZmVobHQiIGdhciBuaWNodHMKLy8gQHZlcnNpb24gICAgICAxLjAuMS4xCi8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C5wYXJlbnRFbGVtZW50OwogICAgICAgIG1pc3NpbmdQYXJlbnQuc3R5bGUub3BhY2l0eSA9IDAuMzsKICAgIH0KCn0pKCk7Cg=="},{"name":"blockblockadblock","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_prototypes":true,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1565462276679,"data":{}},"enabled":true,"position":20,"file_url":"https://github.com/Mechazawa/BlockBlockAdBlock/raw/master/blockblockadblock.user.js","uuid":"200d4fa2-fd29-434a-80b8-0d5142335612","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIGJsb2NrYmxvY2thZGJsb2NrCi8vIEBkZXNjcmlwdGlvbiBCbG9ja3MgQmxvY2tBZEJsb2NrLmpzIGZyb20gcnVubmluZwovLyBAbmFtZXNwYWNlICAgTWVjaGF6YXdhCi8vIEBhdXRob3IgICAgICBNZWNoYXphd2EKLy8gQGluY2x1ZGUgICAgICoKLy8gQHZlcnNpb24gICAgIDQKLy8gQGxpY2Vuc2UgICAgIFVubGljZW5zZQovLyBAdXBkYXRlVVJMICAgaHR0cHM6Ly9naXRodWIuY29tL01lY2hhemF3YS9CbG9ja0Jsb2NrQWRCbG9jay9yYXcvbWFzdGVyL0Jsb2NrQmxvY2tBZEJsb2NrLnVzZXIuanMKLy8gQHJ1bi1hdCAgICAgIGRvY3VtZW50LXN0YXJ0Ci8vIEBncmFudCAgICAgICBub25lCi8vID09L1VzZXJTY3JpcHQ9PQoKCgovL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AodmFyIGlpIGluIHN1c3BlY3RLZXlzKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNvdXJjZSA9IHN1c3BlY3Rbc3VzcGVjdEtleXNbaWldXS50b1NvdXJjZSgpOwogICAgICAgICAgICAgICAgICAgIGZvdW5kID0gc291cmNlLmluZGV4T2YocGl2b3QpICE9PSAtMTsKCiAgICAgICAgICAgICAgICAgICAgaWYgKGZvdW5kKSBicmVhazsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIGZvdW5kID0gL1xEXGRcRC8uZXhlYyhzdXNwZWN0TmFtZSkgIT09IG51bGw7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGlmKGZvdW5kKSB7CiAgICAgICAgICAgICAgICBjb25zb2xlLmxvZygnRm91bmQgQmxvY2tBZEJsb2NrIHdpdGggbmFtZSAnICsgc3VzcGVjdE5hbWUpOwogICAgICAgICAgICAgICAgZGVsZXRlIHdpbmRvd1tzdXNwZWN0TmFtZV07CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9KTsKfSkod2luZG93KTsK"},{"name":"shrtz.me Ad Patch","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["http://*/*","https://*/*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1565462292927,"data":{}},"enabled":false,"position":21,"file_url":"https://greasyfork.org/scripts/386992-shrtz-me-ad-patch/code/shrtzme%20Ad%20Patch.user.js","uuid":"eee13c42-e3dd-4776-a1da-e723f3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Vmb3JlU2VuZDogZnVuY3Rpb24odCkgewogICAgICAgICAgICAgICAgJ2Jhbm5lcicgPT09IGFkX3R5cGUgJiYgKG4uYXR0cignZGlzYWJsZWQnLCAnZGlzYWJsZWQnKSwgJCgnYS5nZXQtbGluaycpLnRleHQoYXRvYignVEdWaGRtbHVaeUJ6YUdsMGRIa2dZV1FnYzJsMFpTNHVMaUIzWVdsMElHOXVaU0J0YjIxbGJuUWdZbkp2JykpLCAkKCcjdGltZXInKS50ZXh0KCcwJykpLCAnaW50ZXJzdGl0aWFsJyA9PT0gYWRfdHlwZSAmJiBuLmF0dHIoJ2Rpc2FibGVkJywgJ2Rpc2FibGVkJykKICAgICAgICAgICAgfSwKICAgICAgICAgICAgc3VjY2VzczogZnVuY3Rpb24odCwgZSwgbikgewogICAgICAgICAgICAgICAgaWYgKHQudXJsLmxlbmd0aCAhPSAwKSB7CiAgICAgICAgICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLnJlcGxhY2UodC51cmwpOwogICAgICAgICAgICAgICAgICAgICQoJyNjb3VudGRvd24nKS5wYXJlbnQoKS5maW5kKCdoNCcpLnRleHQoYXRvYignV1c5MWNpQnNhVzVySUdseklISmxZV1I1TGlCU1pXUnBjbVZqZEdsdVp5QjBieUI1YjNWeUlHeHBibXNnYm05M0lRJykpOwogICAgICAgICAgICAgICAgICAgICQoJyNjb3VudGRvd24nKS5yZW1vdmUoKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgZXJyb3I6IGZ1bmN0aW9uKHQsIGUsIG4pIHsKICAgICAgICAgICAgICAgICQoJyN0aW1lcicpLnRleHQoJ1JFRUUnKTsKICAgICAgICAgICAgfSwKICAgICAgICAgICAgY29tcGxldGU6IGZ1bmN0aW9uKHQsIGUpIHt9CiAgICAgICAgfSkKICAgIH0KICAgIHZhciBhdXRvU3VibWl0ID0gd2luZG93LnNldEludGVydmFsKGZ1bmN0aW9uKCkgewogICAgICAgIHZhciBzdWJC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k5hdiwuYmFubmVyLWlubmVyLGZvb3RlcicpLnJlbW92ZSgpOwogICAgICAgICQoJy5ib3gtbWFpbicpLmNzcyh7CiAgICAgICAgICAgICdib3JkZXInOiAnbm9uZScKICAgICAgICB9KTsKICAgICAgICAkKCcjaW52aXNpYmxlQ2FwdGNoYVNob3J0bGluaycpLmh0bWwoJ1N1Ym1pdCcpOwogICAgfQp9CgokKGRvY3VtZW50KS5yZWFkeShmdW5jdGlvbigpIHsKICAgIGlmICgkKCJodG1sOmNvbnRhaW5zKGF0b2IoVFdGa1pTQjNhWFJvSU9LWnBTQnBiaUJKYm1ScFlRPT0pKSIpKSB7CiAgICAgICAgd2luZG93LnNldEludGVydmFsKCdhdXRvRml4UGFnZSgpOyBhdXRvUHJvY2VlZCgpOycsIHRpbWVWYWwpOwogICAgfQp9KTsKd2luZG93LnNldEludGVydmFsKCdjaGVja0FkYmxvY2tVc2VyID0gY2hlY2tBZHNieXBhc3NlclVzZXIgPSBjaGVja1ByaXZhdGVNb2RlID0gbnVsbDsnLCB0aW1lVmFsKTs=","requires":[{"meta":{"name":"jquery-3.3.1.min.js","url":"http://code.jquery.com/jquery-3.3.1.min.js","ts":1566068227859,"mimetype":"text/javascript"},"source":"LyohIGpRdWVyeSB2My4zLjEgfCAoYykgSlMgRm91bmRhdGlvbiBhbmQgb3RoZXIgY29udHJpYnV0b3JzIHwganF1ZXJ5Lm9yZy9saWNlbnNlICovCiFmdW5jdGlvbihlLHQpeyJ1c2Ugc3RyaWN0Ijsib2JqZWN0Ij09dHlwZW9mIG1vZHVsZSYmIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUuZXhwb3J0cz9tb2R1bGUuZXhwb3J0cz1lLmRvY3VtZW50P3QoZSwhMCk6ZnVuY3Rpb24oZSl7aWYoIWUuZG9jdW1lbnQpdGhyb3cgbmV3IEVycm9yKCJqUXVlcnkgcmVxdWlyZXMgYSB3aW5kb3cgd2l0aCBhIGRvY3VtZW50Iik7cmV0dXJuIHQoZSl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8fHRoaXMsci5jb25jYXQoby5jYWxsKGFyZ3VtZW50cykpKX0saS5ndWlkPWUuZ3VpZD1lLmd1aWR8fHcuZ3VpZCsrLGl9LHcuaG9sZFJlYWR5PWZ1bmN0aW9uKGUpe2U/dy5yZWFkeVdhaXQrKzp3LnJlYWR5KCEwKX0sdy5pc0FycmF5PUFycmF5LmlzQXJyYXksdy5wYXJzZUpTT049SlNPTi5wYXJzZSx3Lm5vZGVOYW1lPU4sdy5pc0Z1bmN0aW9uPWcsdy5pc1dpbmRvdz15LHcuY2FtZWxDYXNlPUcsdy50eXBlPXgsdy5ub3c9RGF0ZS5ub3csdy5pc051bWVyaWM9ZnVuY3Rpb24oZSl7dmFyIHQ9dy50eXBlKGUpO3JldHVybigibnVtYmVyIj09PXR8fCJzdHJpbmciPT09dCkmJiFpc05hTihlLXBhcnNlRmxvYXQoZSkpfSwiZnVuY3Rpb24iPT10eXBlb2YgZGVmaW5lJiZkZWZpbmUuYW1kJiZkZWZpbmUoImpxdWVyeSIsW10sZnVuY3Rpb24oKXtyZXR1cm4gd30pO3ZhciBKdD1lLmpRdWVyeSxLdD1lLiQ7cmV0dXJuIHcubm9Db25mbGljdD1mdW5jdGlvbih0KXtyZXR1cm4gZS4kPT09dyYmKGUuJD1LdCksdCYmZS5qUXVlcnk9PT13JiYoZS5qUXVlcnk9SnQpLHd9LHR8fChlLmpRdWVyeT1lLiQ9dyksd30pOwo="}]},{"name":"Wanikani Open Framework","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["/^https://(www|preview).wanikani.com//"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1569496792154,"data":{}},"enabled":false,"position":22,"file_url":"https://greasyfork.org/scripts/38582-wanikani-open-framework/code/Wanikani%20Open%20Framework.user.js","uuid":"7f924af5-f9b9-42ef-bb24-3855f9e901fb","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIFdhbmlrYW5pIE9wZW4gRnJhbWV3b3JrCi8vIEBuYW1lc3BhY2UgICByZmluZGxleQovLyBAZGVzY3JpcHRpb24gRnJhbWV3b3JrIGZvciB3cml0aW5nIHNjcmlwdHMgZm9yIFdhbmlrYW5pCi8vIEB2ZXJzaW9uICAgICAxLjAuNTAKLy8gQGluY2x1ZGUgICAgIC9eaHR0cHM6Ly8od3d3fHByZXZpZXcpLndhbmlrYW5pLmNvbS8vCi8vIEBjb3B5cmlnaHQgICAyMDE4KywgUm9iaW4gRmluZGxleQovLyBAbGljZW5zZSAgICAgTUlUOyBodHRwOi8vb3BlbnNvdXJjZS5vcmcvbGljZW5zZXMvTUlUCi8vIEBydW4tYXQgICAgICBkb2N1bWVudC1zdGFydAovLyBAZ3JhbnQgICAgICAgbm9uZQovLyA9PS9Vc2VyU2NyaXB0PT0KCihmdW5jdGlvbihnbG9iYWwpIHsKCSd1c2Ugc3RyaWN0JzsKCgkvKiBlc2xpbnQgbm8tbXVsdGktc3BhY2VzOiBvZmYgKi8KCS8qIGdsb2JhbHMgd2tvZiAqLwoKCXZhciB2ZXJzaW9uID0gJzEuMC41MCc7Cgl2YXIgaWdub3JlX21pc3NpbmdfaW5kZXhlZGRiID0gZmFsc2U7CgoJLy8jIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKCS8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgkvLyBTdXBwb3J0ZWQgTW9kdWxl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JywnKSk7CgkJfQoJfQoKCWZ1bmN0aW9uIGRvY19yZWFkeSgpIHsKCQl3a29mLnNldF9zdGF0ZSgnd2tvZi5kb2N1bWVudCcsICdyZWFkeScpOwoJfQoKCS8vIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjCgkvLyBCb290bG9hZGVyIFN0YXJ0dXAKCS8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCglmdW5jdGlvbiBzdGFydHVwKCkgewoJCWdsb2JhbC53a29mID0gcHVibGlzaGVkX2ludGVyZmFjZTsKCgkJLy8gTWFyayBkb2N1bWVudCBzdGF0ZSBhcyAncmVhZHknLgoJCWlmIChkb2N1bWVudC5yZWFkeVN0YXRlID09PSAnY29tcGxldGUnKSB7CgkJCWRvY19yZWFkeSgpOwoJCX0gZWxzZSB7CgkJCXdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCJsb2FkIiwgZG9jX3JlYWR5LCBmYWxzZSk7ICAvLyBOb3RpZnkgbGlzdGVuZXJzIHRoYXQgd2UgYXJlIHJlYWR5LgoJCX0KCgkJLy8gT3BlbiBjYWNoZSwgc28gd2tvZi5maWxlX2NhY2hlLmRpciBpcyBhdmFpbGFibGUgdG8gY29uc29sZSBpbW1lZGlhdGVseS4KCQlmaWxlX2NhY2hlX29wZW4oKTsKCQl3a29mLnNldF9zdGF0ZSgnd2tvZi53a29mJywgJ3JlYWR5Jyk7Cgl9CglzdGFydHVwKCk7Cgp9KSh3aW5kb3cpOw=="},{"name":"Wanikani Ultimate Timeline","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["/^https://(www|preview).wanikani.com/(dashboard)?$/"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-end","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1569496814431,"data":{}},"enabled":false,"position":23,"file_url":"https://greasyfork.org/scripts/13475-wanikani-ultimate-timeline/code/Wanikani%20Ultimate%20Timeline.user.js","uuid":"7f921d4d-9651-4d39-9aad-f16c23a1e0de","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIFdhbmlrYW5pIFVsdGltYXRlIFRpbWVsaW5lCi8vIEBuYW1lc3BhY2UgICByZmluZGxleQovLyBAZGVzY3JpcHRpb24gUmV2aWV3IHNjaGVkdWxlIGV4cGxvcmVyIGZvciBXYW5pS2FuaQovLyBAdmVyc2lvbiAgICAgNy4wLjI0Ci8vIEBpbmNsdWRlICAgICAvXmh0dHBzOi8vKHd3d3xwcmV2aWV3KS53YW5pa2FuaS5jb20vKGRhc2hib2FyZCk/JC8KLy8gQGNvcHlyaWdodCAgIDIwMTgrLCBSb2JpbiBGaW5kbGV5Ci8vIEBsaWNlbnNlICAgICBNSVQ7IGh0dHA6Ly9vcGVuc291cmNlLm9yZy9saWNlbnNlcy9NSVQKLy8gQHJ1bi1hdCAgICAgIGRvY3VtZW50LWVuZAovLyBAZ3JhbnQgICAgICAgbm9uZQovLyA9PS9Vc2VyU2NyaXB0PT0KCndpbmRvdy50aW1lbGluZSA9IHt9OwoKKGZ1bmN0aW9uKGdvYmopIHsKCiAgICAvKiBnbG9iYWwgJCwgd2tvZiAqLwogICAgLyogZXNsaW50IG5vLW11bHRpLXNwYWNlczogIm9mZiIgKi8KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEluaXRpYWxpemF0aW9uI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cxMmgnLCAnMWQnXSwgLy8gTWlub3IgdGljcyAobm8gbGFiZWwpCiAgICAgICAgYnVuZGxlX2Nob2ljZXMgICA6IFsgIDEgLCAgMSAsICAxICwgICAzICwgICA2ICwgIDEyICwgIDI0IF0sIC8vIEhvdyBtYW55IGhvdXJzIGFyZSBidW5kbGVkIHRvZ2V0aGVyLgogICAgICAgIGlkeDogMAogICAgfTsKCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEludGVyYWwgZ2xvYmFsIG9iamVjdCBmb3IgY2VudHJhbGl6aW5nIGRhdGEgYW5kIGNvbmZpZ3VyYXRpb24uCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIHZhciBncmFwaCA9IHsKICAgICAgICBlbGVtOiBudWxsLAogICAgICAgIG1hcmdpbjogewogICAgICAgICAgICB0b3A6IDE2LAogICAgICAgICAgICBsZWZ0OiAyOCwKICAgICAgICAgICAgYm90dG9tOiAxNiwKICAgICAgICB9LAogICAgICAgIHhfYXhpczogewogICAgICAgICAgICB3aWR0aDogMCwKICAgICAgICAgICAgbWF4X2hvdXJzOiAwLAogICAgICAgICAgICBwaXhlbHNfcGVyX3RpYzogMCwKICAgICAgICB9LAogICAgICAgIHlfYXhpczogewogICAgICAgICAgICBoZWlnaHQ6IDEwMCwKICAgICAgICAgICAgbWluX2hlaWdodDogODAsCiAgICAgICAgICAgIG1heF9oZWlnaHQ6IDMwMCwKICAgICAgICAgICAgbWF4X3Jldmlld3M6IDAsCiAgICAgICAgfSwKICAgICAgICByYWRpY2FsX2NhY2hlOiB7fSwKICAgIH07CiAgICBnb2JqLmdyYXBoID0gZ3JhcGg7CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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ICAgICAgICAgbWluaW1pemVkOiBmYWxzZSwKICAgICAgICAgICAgcGxhY2VtZW50OiAnYmVmb3JlX25leHRyZXZpZXcnLAogICAgICAgICAgICB0aW1lX2Zvcm1hdDogJzEyaG91cicsCiAgICAgICAgICAgIGdyYXBoX2hlaWdodDogMTAwLAogICAgICAgICAgICBtYXhfZGF5czogMTQsCiAgICAgICAgICAgIGRheXM6IDMuNSwKICAgICAgICAgICAgbWF4X2Jhcl93aWR0aDogNDAsCiAgICAgICAgICAgIG1heF9iYXJfaGVpZ2h0OiAwLAogICAgICAgICAgICBmaXhlZF9iYXJfaGVpZ2h0OiBmYWxzZSwKICAgICAgICAgICAgYmFyX3N0eWxlOiAnaXRlbV90eXBlJywKICAgICAgICAgICAgc3JzX2N1cnJfbmV4dDogJ2N1cnInLAogICAgICAgICAgICBjdXJyZW50X2xldmVsX21hcmtlcnM6ICdya3YnLAogICAgICAgICAgICBidXJuX21hcmtlcnM6ICdzaG93JywKICAgICAgICAgICAgc2hvd19yZXZpZXdfZGV0YWlsczogJ2Z1bGwnLAogICAgICAgICAgICByZXZpZXdfZGV0YWlsc19zdW1tYXJ5OiAnaXRlbV90eXBlJywKICAgICAgICAgICAgcmV2aWV3X2RldGFpbHNfYnV0dG9uczogdHJ1ZSwKICAgICAgICAgICAgc2hvd19iYXJfc3R5bGVfZHJvcGRvd246IHRydWUsCiAgICAgICAgfTsKICAgICAgICByZXR1cm4gd2tvZi5TZXR0aW5ncy5sb2FkKCd0aW1lbGluZScsIGRlZmF1bHRzKS50aGVuKGZ1bmN0aW9uKGRhdGEpewogICAgICAgICAgICBzZXR0aW5ncyA9IHdrb2Yuc2V0dGluZ3MudGltZWxpbmU7CiAgICAgICAgICAgIHN3aXRjaCAoc2V0dGluZ3Muc2hvd19tYXJrZXJzKSB7CiAgICAgICAgICAgICAgICBjYXNlICdub25lJzoKICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5jdXJyZW50X2xldmVsX21hcmtlcnMgPSAnbm9uZSc7CiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MuYnVybl9tYXJrZXJzID0gJ2hpZGUnOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnY3Vycic6CiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MuY3VycmVudF9sZXZlbF9tYXJrZXJzID0gJ3Jrdic7CiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MuYnVybl9tYXJrZXJzID0gJ2hpZGUnOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnYnVybic6CiAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MuY3VycmVudF9sZXZlbF9tYXJrZXJzID0gJ25vbmUnOwogICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmJ1cm5fbWFya2VycyA9ICdzaG93JzsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJ2JvdGgnOgogICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmN1cnJlbnRfbGV2ZWxfbWFya2VycyA9ICdya3YnOwogICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmJ1cm5fbWFya2VycyA9ICdzaG93JzsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgfQogICAgICAgICAgICBkZWxldGUgc2V0dGluZ3Muc2hvd19tYXJrZXJzOwogICAgICAgIH0pOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBTdGFydHVwCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIHN0YXJ0dXAoKSB7CiAgICAgICAgaW5zdGFsbF9jc3MoKTsKICAgICAgICBpbnN0YWxsX21lbnVfbGluaygpOwogICAgICAgIHBsYWNlX3RpbWVsaW5lKHRydWUgLyogZmlyc3RfdGltZSAqLyk7CiAgICAgICAgZmV0Y2hfYW5kX3VwZGF0ZSgpOwogICAgICAgIHN0YXJ0X3JlZnJlc2hfdGltZXIoKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEluc3RhbGwgYSBsaW5rIHRvIHRoZSBzZXR0aW5ncyBpbiB0aGUgbWVudS4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gaW5zdGFsbF9tZW51X2xpbmsoKQogICAgewogICAgICAgIHdrb2YuTWVudS5pbnNlcnRfc2NyaXB0X2xpbmsoewogICAgICAgICAgICBuYW1lOiAndGltZWxpbmUnLAogICAgICAgICAgICBzdWJtZW51OiAnU2V0dGluZ3MnLAogICAgICAgICAgICB0aXRsZTogJ1VsdGltYXRlIFRpbWVsaW5lJywKICAgICAgICAgICAgb25fY2xpY2s6IG9wZW5fc2V0dGluZ3MKICAgICAgICB9KTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIFRvcC1sZXZlbCBIVE1MIGZvciB0aGUgc2NyaXB0LgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICB2YXIgdGltZWxpbmVfaHRtbCA9CiAgICAgICAgJzxzZWN0aW9uIGlkPSJ0aW1lbGluZSI+JysKICAgICAgICAnICA8aDQgY2xhc3M9Im5vX21pbiI+UmV2aWV3cyBUaW1l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ICAnI3RpbWVsaW5lIHN2ZyAuY291bnQge2ZpbGw6Izc3OGFkODt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmx2bGdycDAge2ZpbGw6IzVlYjZlODt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmx2bGdycDEge2ZpbGw6I2UyNWViYzt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmx2bGdycDIge2ZpbGw6I2FmNzljMzt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmx2bGdycDMge2ZpbGw6Izc2OGNlNzt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmx2bGdycDQge2ZpbGw6IzVlNWU2NDt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmx2bGdycDUge2ZpbGw6I2Y1YzY2Nzt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmJhcnMgLmN1ciB7ZmlsbDojZmZmZmZmO29wYWNpdHk6MC42O30nKwogICAgICAgICAgICAnI3RpbWVsaW5lIHN2ZyAuYmFycyAuYnVyIHtmaWxsOiMwMDAwMDA7b3BhY2l0eTowLjQ7fScrCiAgICAgICAgICAgICcjdGltZWxpbmUgc3ZnIC5tYXJrZXJzIHtzdHJva2U6IzAwMDAwMDtzdHJva2Utd2lkdGg6MC41O30nKwogICAgICAgICAgICAnI3RpbWVsaW5lIHN2ZyAubWFya2VycyAuYnVyIHtmaWxsOiMwMDAwMDA7fScrCiAgICAgICAgICAgICcjdGltZWxpbmUgc3ZnIC5tYXJrZXJzIC5jdXIge2ZpbGw6I2ZmZmZmZjt9JysKICAgICAgICAgICAgJyN0aW1lbGluZSBzdmcgLmhpZ2hsaWdodCAuYm91bmRhcnkge2N1cnNvcjpwb2ludGVyO30nKwogICAgICAgICAgICAnI3RpbWVsaW5lW2RhdGEtZGV0YWlsPSJub25lIl0gLmhpZ2hsaWdodCAuYm91bmRhcnkge2N1cnNvcjphdXRvO30nKwogICA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ICAgICAgZ3JhcGgueF9heGlzLndpZHRoID0gZ3JhcGguZWxlbS53aWR0aCgpIC0gZ3JhcGgubWFyZ2luLmxlZnQ7CiAgICAgICAgICAgIGdyYXBoLnlfYXhpcy5oZWlnaHQgPSBzZXR0aW5ncy5ncmFwaF9oZWlnaHQgLSAoZ3JhcGgubWFyZ2luLnRvcCArIGdyYXBoLm1hcmdpbi5ib3R0b20pOwogICAgICAgICAgICB1cGRhdGVfbWluaW1pemUoKTsKICAgICAgICAgICAgaW5pdF91aSgpOwoKICAgICAgICAgICAgLy8gSW5zdGFsbCBldmVudCBoYW5kbGVycwogICAgICAgICAgICB0aW1lbGluZS5maW5kKCcubGluay5vcGVuLCAubGluay5taW5pbWl6ZScpLm9uKCdjbGljaycsIHRvZ2dsZV9taW5pbWl6ZSk7CiAgICAgICAgICAgIHRpbWVsaW5lLmZpbmQoJy5saW5rLnJlZnJlc2gnKS5vbignY2xpY2snLCBmZXRjaF9hbmRfdXBkYXRlKTsKICAgICAgICAgICAgdGltZWxpbmUuZmluZCgnLmxpbmsuc2V0dGluZ3MnKS5vbignY2xpY2snLCBvcGVuX3NldHRpbmdzKTsKICAgICAgICAgICAgdGltZWxpbmUuZmluZCgnLmJhcl9zdHlsZSBzZWxlY3QnKS5vbignY2hhbmdlJywgYmFyX3N0eWxlX2NoYW5nZWQpOwogICAgICAgICAgICB0aW1lbGluZS5maW5kKCcucmFuZ2VfaW5wdXQnKS5vbignaW5wdXQgY2hhbmdlJywgZGF5c19jaGFuZ2VkKTsKICAgICAgICAgICAgdGltZWxpbmUuZmluZCgnLnJldmlld19pbmZvPi5pbm5lcicpLm9uKCdtb3VzZWVudGVyJywgJy5pdGVtX2xpc3QgPiBsaScsIGl0ZW1faG92ZXIpOwogICAgICAgICAgICB0aW1lbGluZS5maW5kKCcucmV2aWV3X2luZm8+LmlubmVyJykub24oJ21vdXNlbGVhdmUnLCAnLml0ZW1fbGlzdCcsIGl0ZW1faG92ZXIpOwogICAgICAgICAgICB0aW1lbGluZS5maW5kKCcucmV2aWV3X2luZm8+LmlubmVyJykub24oJ2NsaWNrJywgJy5kZXRhaWxfYnV0dG9ucyBidXR0b24nLCBkZXRhaWxfYnV0dG9uX2NsaWNrZWQpOwogICAgICAgICAgICB0aW1lbGluZS5maW5kKCcucmV2aWV3X2luZm8+LmlubmVyJykub24oJ2NsaWNrJywgZnVuY3Rpb24oKXtyZXR1cm4gZmFsc2U7fSk7CiAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdyZXNpemUnLCB3aW5kb3dfcmVzaXplZCk7CiAgICAgICAgfQogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBUb2dnbGUgd2hldGhlciB0aGUgdGltZWxpbmUgaXMgbWluaW1pemVkLgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiB0b2dnbGVfbWluaW1pemUoKSB7CiAgICAgICAgc2V0dGluZ3MubWluaW1pemVkID0gIXNldHRpbmdzLm1pbmltaXplZDsKICAgICAgICB1cGRhdGVfbWluaW1pemUoKTsKICAgICAgICBzYXZlX3NldHRpbmdzKCk7CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEhpZGUgb3IgdW5oaWRlIHRoZSB0aW1lbGluZSB3aGVuIHRoZSB1c2VyIG1pbmltaXplcy9yZXN0b3Jlcy4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gdXBkYXRlX21pbmltaXplKCkgewogICAgICAgIHZhciB0aW1lbGluZSA9ICQoJyN0aW1lbGluZScpOwogICAgICAgIHZhciBpc19taW4gPSB0aW1lbGluZS5oYXNDbGFzcygnbWluJyk7CiAgICAgICAgaWYgKHNldHRpbmdzLm1pbmltaXplZCAmJiAhaXNfbWluKSB7CiAgICAgICAgICAgIHRpbWVsaW5lLmFkZENsYXNzKCdtaW4nKTsKICAgICAgICB9IGVsc2UgaWYgKCFzZXR0aW5ncy5taW5pbWl6ZWQgJiYgaXNfbWluKSB7CiAgICAgICAgICAgIHRpbWVsaW5lLnJlbW92ZUNsYXNzKCdtaW4nKTsKICAgICAgICB9CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIFVwZGF0ZSB0aGUgdGltZWxpbmUgYWZ0ZXIgdGhlIHVzZXIgY2hhbmdlcyB0aGUgbnVtYmVyIG9mIGRheXMgdG8gZGlzcGxheS4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gZGF5c19jaGFuZ2VkKCkgewogICAgICAgIHZhciBkYXlzID0gTnVtYmVyKCQoJyN0aW1lbGluZSAucmFuZ2VfaW5wdXQnKS52YWwoKSk7CiAgICAgICAgaWYgKGRheXMgPT09IHNldHRpbmdzLmRheXMpIHJldHVybjsKICAgICAgICBzZXR0aW5ncy5kYXlzID0gZGF5czsKICAgICAgICB1cGRhdGVfc2xpZGVyX2RheXMoKTsKICAgICAgICBidW5kbGVfYnlfdGltZXNsb3QoKTsKICAgICAgICB1cGRhdGVfc2xpZGVyX3Jldmlld3MoKTsKICAgICAgICBkcmF3X3RpbWVsaW5lKCk7CiAgICAgICAgc2F2ZV9zZXR0aW5ncygpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBIYW5kbGVyIGZvciB3aGVuIHVzZXIgY2hhbmdlcyB0aGUgQmFyIFN0eWxlLgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiBiYXJfc3R5bGVfY2hhbmdlZCgpIHsKICAgICAgICBzZXR0aW5ncy5iYXJfc3R5bGUgPSAkKCcjdGltZWxpbmUgLmJhcl9zdHlsZSBzZWxlY3QgOnNlbGVjdGVkJykuYXR0cignbmFtZScpOwogICAgICAgIGRyYXdfdGltZWxpbmUoKTsKICAgICAgICBzYXZlX3NldHRpbmdzKCk7CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEhhbmRsZXIgZm9yIHdoZW4gdXNlciBjbGlja3MgJ1NhdmUnIGluIHRoZSBzZXR0aW5ncyB3aW5kb3cuCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIHNldHRpbmdzX3NhdmVkKCkgewogICAgICAgIHNldHRpbmdzID0gd2tvZi5zZXR0aW5ncy50aW1lbGluZTsKICAgICAgICBwbGFjZV90aW1lbGluZShmYWxzZSAvKiBmaXJzdF90aW1lICovKTsKICAgICAgICBpbml0X3VpKCk7CiAgICAgICAgYnVuZGxlX2J5X3RpbWVzbG90KCk7CiAgICAgICAgZHJhd190aW1lbGluZSgpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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AgICAgICB2YXIgcmFuZ2UgPSAkKCcjdGltZWxpbmUgLnJhbmdlX2lucHV0Jyk7CiAgICAgICAgaWYgKHNldHRpbmdzLmRheXMgPiBzZXR0aW5ncy5tYXhfZGF5cykgewogICAgICAgICAgICBzZXR0aW5ncy5kYXlzID0gc2V0dGluZ3MubWF4X2RheXM7CiAgICAgICAgICAgIHNhdmVfc2V0dGluZ3MoKTsKICAgICAgICB9CiAgICAgICAgcmFuZ2UuYXR0cignbWF4Jywgc2V0dGluZ3MubWF4X2RheXMpOwogICAgICAgIHJhbmdlLmF0dHIoJ3ZhbHVlJywgc2V0dGluZ3MuZGF5cyk7CiAgICAgICAgdXBkYXRlX3NsaWRlcl9kYXlzKCk7CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIFVwZGF0ZSB0aGUgJ3Jldmlld3MnIHRleHQgb2YgdGhlIHNjYWxlIHNsaWRlci4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gdXBkYXRlX3NsaWRlcl9yZXZpZXdzKCkgewogICAgICAgIHZhciByZXZpZXdfY291bnQgPSAkKCcjdGltZWxpbmUgLnJhbmdlX3Jldmlld3MnKTsKICAgICAgICByZXZpZXdfY291bnQudGV4dChncmFwaC50b3RhbF9yZXZpZXdzKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gVXBkYXRlIHRoZSAnZGF5cycgdGV4dCBvZiB0aGUgc2NhbGUgc2xpZGVyLgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiB1cGRhdGVfc2xpZGVyX2RheXMoKSB7CiAgICAgICAgdmFyIGRheXMgPSBzZXR0aW5ncy5kYXlzOwogICAgICAgIHZhciBwZXJpb2QgPSAkKCcjdGltZWxpbmUgLnJhbmdlX2RheXMnKTsKICAgICAgICBpZiAoZGF5cyA8PSAxKSB7CiAgICAgICAgICAgIHBlcmlvZC50ZXh0KChkYXlzKjI0KSsnIGhvdXJzJyk7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgcGVyaW9kLnRleHQoZGF5cy50b0ZpeGVkKDIpKycgZGF5cycpOwogICAgICAgIH0KICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gU2F2ZSB0aGUgc2NyaXB0IHNldHRpbmdzIChhZnRlciBhIDUwMG1zIGRlbGF5KS4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgdmFyIHNhdmVfZGVsYXlfdGltZXI7CiAgICBmdW5jdGlvbiBzYXZlX3NldHRpbmdzKCkgewogICAgICAgIGlmIChzYXZlX2RlbGF5X3RpbWVyICE9PSB1bmRlZmluZWQpIGNsZWFyVGltZW91dChzYXZlX2RlbGF5X3RpbWVyKTsKICAgICAgICBzYXZlX2RlbGF5X3RpbWVyID0gc2V0VGltZW91dChmdW5jdGlvbigpewogICAgICAgICAgICB3a29mLlNldHRpbmdzLnNhdmUoJ3RpbWVsaW5lJyk7CiAgICAgICAgfSwgNTAwKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gSGFuZGxlciBmb3IgcmVzaXppbmcgdGh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AgIGNhc2UgJ21vdXNlbW92ZSc6CiAgICAgICAgICAgICAgICBpZiAoaGlnaGxpZ2h0LmhpZ2hsaWdodGVkKSByZXR1cm47CiAgICAgICAgICAgICAgICB4ID0gYnVuZGxlX3RvX3goYnVuZGxlX2lkeCk7CiAgICAgICAgICAgICAgICAkKCcjdGltZWxpbmUgLmhpZ2hsaWdodCAubWFya2VyLnN0YXJ0JykuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnK3grJywwKScpOwogICAgICAgICAgICAgICAgYnJlYWs7CgogICAgICAgICAgICBjYXNlICdtb3VzZWxlYXZlJzoKICAgICAgICAgICAgICAgIGlmIChoaWdobGlnaHQuZHJhZ2dpbmcgfHwgaGlnaGxpZ2h0LmhpZ2hsaWdodGVkKSByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgIGhpZGVfaGlnaGxpZ2h0KCk7CiAgICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgIGNhc2UgJ3RvdWNoc3RhcnQnOgogICAgICAgICAgICBjYXNlICdtb3VzZWRvd24nOgogICAgICAgICAgICAgICAgaWYgKGUuYnV0dG9uICE9PSAwKSByZXR1cm47CiAgICAgICAgICAgICAgICBoaWdobGlnaHQuaGlnaGxpZ2h0ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgaGlnaGxpZ2h0LmRyYWdnaW5nID0gdHJ1ZTsKICAgICAgICAgICAgICAgIGhpZ2hsaWdodC5zdGFydCA9IGJ1bmRsZV9pZHg7CiAgICAgICAgICAgICAgICB4ID0gYnVuZGxlX3RvX3goYnVuZGxlX2lkeCk7CiAgICAgICAgICAgICAgICAkKCcjdGltZWxpbmUgLmhpZ2hsaWdodCAubWFya2VyLnN0YXJ0JykuYXR0cigndHJhbnNmb3JtJywgJ3RyYW5zbGF0ZSgnK3grJywwKScpOwogICAgICAgICAgICAgICAgJCgnI3RpbWVsaW5lIC5oaWdobGlnaHQgLm1hcmtlci5lbmQnKS5hdHRyKCd0cm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aW1lc2xvdHNbTWF0aC5taW4oZ3JhcGgueF9heGlzLm1heF9ob3Vycy0xLCBNYXRoLmZsb29yKHRpYykpXTsKICAgICAgICB2YXIgYnVuZGxlID0gZ3JhcGguYnVuZGxlc1tidW5kbGVfaWR4XTsKICAgICAgICB2YXIgc3RhcnQgPSBidW5kbGUuc3RhcnRfdGltZTsKICAgICAgICB2YXIgZW5kID0gYnVuZGxlLmVuZF90aW1lOwogICAgICAgIHJldHVybiAodGljIDw9ICgoc3RhcnQrZW5kKS8yKSA/IGJ1bmRsZV9pZHggOiBidW5kbGVfaWR4KzEpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBDb252ZXJ0IGEgYnVuZGxlX2lkeCB0byBhIGdyYXBoIGhvdXIgb2Zmc2V0LgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIGJ1bmRsZV90b190aWMoYnVuZGxlX2lkeCkgewogICAgICAgIGlmIChidW5kbGVfaWR4ID49IGdyYXBoLmJ1bmRsZXMubGVuZ3RoKSByZXR1cm4gZ3JhcGgueF9heGlzLm1heF9ob3VyczsKICAgICAgICByZXR1cm4gZ3JhcGguYnVuZGxlc1tidW5kbGVfaWR4XS5zdGFydF90aW1lOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBDb252ZXJ0IGEgYnVuZGxlX2lkeCB0byBhIGdyYXBoIFggb2Zmc2V0LgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIGJ1bmRsZV90b194KGJ1bmRsZV9pZHgpIHsKICAgICAgICByZXR1cm4gTWF0aC5yb3VuZChidW5kbGVfdG9fdGljKGJ1bmRsZV9pZHgpICogZ3JhcGgudGljX3NwYWNpbmcpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBPcGVuIHRoZSBzZXR0aW5ncyBkaWFsb2cKICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gb3Blbl9zZXR0aW5ncygpIHsKICAgICAgICB2YXIgY29uZmlnID0gewogICAgICAgICAgICBzY3JpcHRfaWQ6ICd0aW1lbGluZScsCiAgICAgICAgICAgIHRpdGxlOiAnVWx0aW1hdGUgVGltZWxpbmUnLAogICAgICAgICAgICBvbl9zYXZlOiBzZXR0aW5nc19zYXZlZCwKICAgICAgICAgICAgY29udGVudDogewogICAgICAgICAgICAgICAgdGFiczoge3R5cGU6J3RhYnNldCcsIGNvbnRlbnQ6IHsKICAgICAgICAgICAgICAgICAgICBwZ0dyYXBoOiB7dHlwZToncGFnZScsIGxhYmVsOidHcmFwaCcsIGhvdmVyX3RpcDonR3JhcGggU2V0dGluZ3MnLCBjb250ZW50OiB7CiAgICAgICAgICAgICAgICAgICAgICAgIGdycFBsYWNlbWVudDoge3R5cGU6J2dyb3VwJywgbGFiZWw6J1BsYWNlbWVudCcsIGNvbnRlbnQ6ewogICAgICAgICAgICAgICAgICAgICAgICAgICAgcGxhY2VtZW50OiB7dHlwZTonZHJvcGRvd24nLCBsYWJlbDonUGxhY2VtZW50IG9uIERhc2hib2FyZCcsIGRlZmF1bHQ6J2JlZm9yZV9uZXh0cmV2aWV3JywgY29udGVudDp7YmVmb3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V3cyA9IHNldHRpbmdzLm1heF9iYXJfaGVpZ2h0OwogICAgICAgIH0KICAgICAgICB3aGlsZSAoTWF0aC5jZWlsKG1heF9yZXZpZXdzIC8gaW5jX3MpID4gNSkgewogICAgICAgICAgICBzd2l0Y2ggKGluY19zLnRvU3RyaW5nKClbMF0pIHsKICAgICAgICAgICAgICAgIGNhc2UgJzEnOiBpbmNfcyAqPSAyOyBpbmNfbCAqPSAyOyBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJzInOiBpbmNfcyA9IE1hdGgucm91bmQoMi41ICogaW5jX3MpOyBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJzUnOiBpbmNfcyAqPSAyOyBpbmNfbCAqPSA1OyBicmVhazsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgLy8gRHJhdyB2ZXJ0aWNhbCBncmFwaCB0aWNzICgjIG9mIFJldmlld3MpLgogICAgICAgIHZhciB0aWNfY2xhc3MsIHk7CiAgICAgICAgZ3JhcGgueV9heGlzLm1heF9yZXZpZXdzID0gTWF0aC5tYXgoMywgTWF0aC5jZWlsKG1heF9yZXZpZXdzIC8gaW5jX3MpICogaW5jX3MpOwogICAgICAgIGZvciAodmFyIHRpYyA9IDA7IHRpYyA8PSBncmFwaC55X2F4aXMubWF4X3Jldmlld3M7IHRpYyArPSBpbmNfcykgewogICAgICAgICAgICB0aWNfY2xhc3MgPSAoKHRpYyAlIGluY19sKSA9PT0gMCA/ICdtYWpvcicgOiAnbWlub3InKTsKICAgICAgICAgICAgeSA9IChncmFwaC5tYXJnaW4udG9wICsgZ3JhcGhfaGVpZ2h0KSAtIE1hdGgucm91bmQoZ3JhcGhfaGVpZ2h0ICogKHRpYyAvIGdyYXBoLnlfYXhpcy5tYXhfcmV2aWV3cykpOwogICAgICAgICAgICBpZiAodGljID4gMCkgewogICAgICAgICAgICAgICAgZ3JpZCArPSAnPHBhdGggY2xhc3M9IicrdGljX2NsYXNzKyciIGQ9Ik0nK2dyYXBo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gKyBNYXRoLnJvdW5kKCh0aWNfaWR4IC0gdGltZV9zaGlmdC82MCkgKiBncmFwaC50aWNfc3BhY2luZyk7CiAgICAgICAgICAgIHZhciBsYWJlbDsKICAgICAgICAgICAgaWYgKHJlZF9sYWJlbCkgewogICAgICAgICAgICAgICAgaWYgKHRpY19pZHggPiAwKSBncmlkICs9ICc8cGF0aCBjbGFzcz0icmVkdGljIiBkPSJNJyt4KycsMHYnKyhncmFwaC5tYXJnaW4udG9wK2dyYXBoX2hlaWdodC0xKSsnIiAvPic7CiAgICAgICAgICAgICAgICBpZiAoIW1hal91c2Vfc2hvcnQgJiYgdGljX2lkeCAtIHByZXZfbGFiZWwgPCBncmFwaC5taW5faG91cnNfcGVyX2xhYmVsKjAuNTgpIGxhYmVsX3gucG9wKCk7CiAgICAgICAgICAgICAgICBsYWJlbF94LnB1c2goJzx0ZXh0IGNsYXNzPSJyZWR0aWMiIHg9IicrKHgrNCkrJyIgeT0iJysoZ3JhcGgubWFyZ2luLnRvcC04KSsnIj4nK3JlZF9sYWJlbCsnPC90ZXh0PicpOwogICAgICAgICAgICAgICAgcHJldl9sYWJlbCA9IHRpY19pZHg7CiAgICAgICAgICAgIH0gZWxzZSBpZiAobWFqX2xhYmVsKSB7CiAgICAgICAgICAgICAgICBpZiAodGljX2lkeCA+IDApIGdyaWQgKz0gJzxwYXRoIGNsYXNzPSJtYWpvciIgZD0iTScreCsnLDB2JysoZ3JhcGgubWFyZ2luLnRvcCtncmFwaF9oZWlnaHQtMSkrJyIgLz4nOwogICAgICAgICAgICAgICAgaWYgKG1hal91c2Vfc2hvcnQgfHwgdGljX2lkeCAtIHByZXZfbGFiZWwgPiBncmFwaC5taW5faG91cnNfcGVyX2xhYmVsKjAuNTgpIHsKICAgICAgICAgICAgICAgICAgICBsYWJlbF94LnB1c2goJzx0ZXh0IGNsYXNzPSJtYWpvciIgeD0iJysoeCs0KSsnIiB5PSInKyhncmFwaC5tYXJnaW4udG9wLTgpKyciPicrbWFqX2xhYmVsKyc8L3RleHQ+Jyk7CiAgICAgICAgICAgICAgICAgICAgcHJldl9sYWJlbCA9IHRpY19pZHg7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gZWxzZSBpZiAobWluX2xhYmVsKSB7CiAgICAgICAgICAgICAgICBpZiAodGljX2lkeCA+IDApIGdyaWQgKz0gJzxwYXRoIGNsYXNzPSJtaW5vciIgZD0iTScreCsnLCcrKGdyYXBoLm1hcmdpbi50b3AtNikrJ3YnKyhncmFwaF9oZWlnaHQrNikrJyIgLz4nOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgICAgIC8vIERyYXcgYmFycwoKICAgICAgICB2YXIgbWluX2Jhcl9oZWlnaHQgPSBNYXRoLmNlaWwoZ3JhcGgueV9heGlzLm1heF9yZXZpZXdzIC8gZ3JhcGgueV9heGlzLmhlaWdodCk7CiAgICAgICAgZm9yICh2YXIgYnVuZGxlX2lkeCBpbiBncmFwaC5idW5kbGVzKSB7CiAgICAgICAgICAgIHZhciBidW5kbGUgPSBncmFwaC5idW5kbGVzW2J1bmRsZV9pZHhdOwogICAgICAgICAgICB2YXIgYmFyX3BhcnRzID0gW107CiAgICAgICAgICAgIHZhciBzdGF0cyA9IGJ1bmRsZS5zdGF0czsKCiAgICAgICAgICAgIHZhciB4MSA9IE1hdGgucm91bmQoYnVuZGxlLnN0YXJ0X3RpbWUgKiBncmFwaC50aWNfc3BhY2luZyk7CiAgICAgICAgICAgIHZhciB4MiA9IE1hdGgucm91bmQoYnVuZGxlLmVuZF90aW1lICogZ3JhcGgudGljX3NwYWNpbmcpOwogICAgICAgICAgICBpZiAoc2V0dGluZ3MubWF4X2Jhcl93aWR0aCA+IDApIHgyID0gTWF0aC5taW4oeDEgKyBzZXR0aW5ncy5tYXhfYmFyX3dpZHRoLCB4Mik7CgogICAgICAgICAgICBzd2l0Y2ggKHNldHRpbmdzLmJhcl9zdHlsZSkgewogICAgICAgICAgICAgICAgY2FzZSAnY291bnQnOgogICAgICAgICAgICAgICAgICAgIGlmIChzdGF0cy5jb3VudCkgYmFyX3BhcnRzLnB1c2goe2NsYXNzOidjb3VudCcsIGhlaWdodDpzdGF0cy5jb3VudH0pOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwoKICAgICAgICAgICAgICAgIGNhc2UgJ2l0ZW1fdHlwZSc6CiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRzLnJhZCkgYmFyX3BhcnRzLnB1c2goe2NsYXNzOidyYWQnLCBoZWlnaHQ6c3RhdHMucmFkfSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRzLmthbikgYmFyX3BhcnRzLnB1c2goe2NsYXNzOidrYW4nLCBoZWlnaHQ6c3RhdHMua2FufSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRzLnZvYykgYmFyX3BhcnRzLnB1c2goe2NsYXNzOid2b2MnLCBoZWlnaHQ6c3RhdHMudm9jfSk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CgogICAgICAgICAgICAgICAgY2FzZSAnc3JzX3N0YWdlJzoKICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHMuYXBwcikgYmFyX3BhcnRzLnB1c2goe2NsYXNzOidhcHByJywgaGVpZ2h0OnN0YXRzLmFwcHJ9KTsKICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHMuZ3VydSkgYmFyX3BhcnRzLnB1c2goe2NsYXNzOidndXJ1JywgaGVpZ2h0OnN0YXRzLmd1cnV9KTsKICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHMubWFzdCkgYmFyX3BhcnRzLnB1c2goe2NsYXNzOidtYXN0JywgaGVpZ2h0OnN0YXRzLm1hc3R9KTsKICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHMuZW5saSkgYmFyX3BhcnRzLnB1c2goe2NsYXNzOidlbmxpJywgaGVpZ2h0OnN0YXRzLmVubGl9KTsKICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHMuYnVybikgYmFyX3BhcnRzLnB1c2goe2NsYXNzOididXJuJywgaGVpZ2h0OnN0YXRzLmJ1cm59KTsKICAgICAgICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgICAgICBjYXNlICdsZXZlbCc6CiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgZ3JwX2lkeCA9IDA7IGdycF9pZHggPD0gNTsgZ3JwX2lkeCsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBncnBfbmFtZSA9ICdsdmxncnAnK2dycF9pZHg7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0c1tncnBfbmFtZV0pIGJhcl9wYXJ0cy5wdXNoKHtjbGFzczonbHZsZ3JwJytncnBfaWR4LCBoZWlnaHQ6c3RhdHNbZ3JwX25hbWVdfSk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHZhciBiYXJfb2Zmc2V0ID0gMDsKICAgICAgICAgICAgZm9yICh2YXIgcGFydF9pZHggaW4gYmFyX3BhcnRzKSB7CiAgICAgICAgICAgICAgICB2YXIgcGFydCA9IGJhcl9wYXJ0c1twYXJ0X2lkeF07CiAgICAgICAgICAgICAgICBpZiAoKHBhcnRfaWR4ID09IGJhcl9wYXJ0cy5sZW5ndGgtMSkgJiYgKGJhcl9vZmZzZXQgKyBwYXJ0LmhlaWdodCA8IG1pbl9iYXJfaGVpZ2h0KSkgewogICAgICAgICAgICAgICAgICAgIHBhcnQuaGVpZ2h0ID0gbWluX2Jhcl9oZWlnaHQgLSBiYXJfb2Zmc2V0OwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgYmFycyArPSAnPHJlY3QgY2xhc3M9ImJhciAnK3BhcnQuY2xhc3MrJyIgeD0iJysoeDErMSkrJyIgeT0iJytiYXJfb2Zmc2V0KyciIHdpZHRoPSInKyh4Mi14MS0zKSsnIiBoZWlnaHQ9IicrcGFydC5oZWlnaHQrJyIgLz4nOwogICAgICAgICAgICAgICAgYmFyX29mZnNldCArPSBwYXJ0LmhlaWdodDsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoYmFyX3BhcnRzLmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgICAgIGJhcl9vdmVybGF5cyArPSAnPHJlY3QgY2xhc3M9ImJhciBvdmVybGF5IiB4PSInK3gxKyciIHk9IjAiIHdpZHRoPSInKyh4Mi14MSkrJyIgaGVpZ2h0PSInK2dyYXBoLnlfYXhpcy5tYXhfcmV2aWV3cysnIiBkYXRhLWJ1bmRsZT0iJytidW5kbGVfaWR4KyciIC8+JzsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgdmFyIG1hcmtlcl94OwogICAgICAgICAgICBtYXJrZXJfeCA9IGdyYXBoLm1hcmdpbi5sZWZ0ICsgTWF0aC5mbG9vcigoeDEreDIpLzIpOwogICAgICAgICAgICBpZiAoYnVuZGxlLnN0YXRzLmhhc19jdXJyX21hcmtlciAmJiBzZXR0aW5ncy5jdXJyZW50X2xldmVsX21hcmtlcnMgIT09ICdub25lJykgewogICAgICAgICAgICAgICAgbWFya2VycyArPSAnPHBhdGggY2xhc3M9ImN1ciIgZD0iTScrbWFya2VyX3grJywnKyhncmFwaC5tYXJnaW4udG9wK2dyYXBoX2hlaWdodCsxKSsnbC0zLDZoNnoiIC8+JzsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoIGJ1bmRsZS5zdGF0cy5idXJuX2NvdW50ID4gMCAmJiBzZXR0aW5ncy5idXJuX21hcmtlcnMgPT09ICdzaG93JykgewogICAgICAgICAgICAgICAgbWFya2VycyArPSAnPHBhdGggY2xhc3M9ImJ1ciIgZD0iTScrbWFya2VyX3grJywnKyhncmFwaC5tYXJnaW4udG9wK2dyYXBoX2hlaWdodCs4KSsnbC0zLDZoNnoiIC8+JzsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAg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lzLndpZHRoKzEpKyciIC8+JysKICAgICAgICAgICAgJyAgPC9nPicrCiAgICAgICAgICAgICcgIDxnIGNsYXNzPSJsYWJlbC14Ij4nKwogICAgICAgICAgICBsYWJlbF94LmpvaW4oJycpKwogICAgICAgICAgICAnICA8L2c+JysKICAgICAgICAgICAgJyAgPGcgY2xhc3M9ImxhYmVsLXkiPicrCiAgICAgICAgICAgIGxhYmVsX3krCiAgICAgICAgICAgICcgIDwvZz4nKwogICAgICAgICAgICAnICA8ZyBjbGFzcz0ibWFya2VycyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMC41LDAuNSkiPicrCiAgICAgICAgICAgIG1hcmtlcnMrCiAgICAgICAgICAgICcgIDwvZz4nKwogICAgICAgICAgICAnICA8ZyBjbGFzcz0iYmFycyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoJytncmFwaC5tYXJnaW4ubGVmdCsnLCcrKGdyYXBoLm1hcmdpbi50b3ArZ3JhcGhfaGVpZ2h0KSsnKSBzY2FsZSgxLCcrKC0xICogZ3JhcGhfaGVpZ2h0IC8gZ3JhcGgueV9heGlzLm1heF9yZXZpZXdzKSsnKSI+JysKICAgICAgICAgICAgYmFycysKICAgICAgICAgICAgYmFyX292ZXJsYXlzKwogICAgICAgICAgICAnICA8L2c+JysKICAgICAgICAgICAgJyAgPGcgY2xhc3M9InJlc2l6ZV9ncmlwIj4nKwogICAgICAgICAgICAnICAgIDxwYXRoIGNsYXNzPSJzaGFkb3ciIGQ9Ik0nKyhwYW5lbF93aWR0aC0yKSsnLCcrcGFuZWxfaGVpZ2h0KydsMiwtMm0wLC00bC02LDZtLTQsMGwxMCwtMTAiIC8+JysKICAgICAgICAgICAgJyAgICA8cGF0aCBjbGFzcz0ibGlnaHQiIGQ9Ik0nKyhwYW5lbF93aWR0aC0zKSsnLCcrcGFuZWxfaGVpZ2h0KydsMywtM20wLC00bC03LDdtLTQsMGwxMSwtMTEiIC8+JysKICAgICAgICAgICAgJyAgICA8cmVjd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kYXRhLWJ1bmRsZSddLnZhbHVlKTsKICAgICAgICBoaWdobGlnaHQuc3RhcnQgPSBidW5kbGVfaWR4OwogICAgICAgIGhpZ2hsaWdodC5lbmQgPSBidW5kbGVfaWR4ICsgMTsKICAgICAgICBoaWdobGlnaHQuaGlnaGxpZ2h0ZWQgPSB0cnVlOwogICAgICAgIGdyYXBoLmVsZW0ub2ZmKCcuYmFyX2hvdmVyX21vdmUnKTsKICAgICAgICBzaG93X3Jldmlld19pbmZvKHRydWUgLyogc3RpY2t5ICovLCBlKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gRXZlbnQgaGFuZGxlciBmb3IgaG92ZXJpbmcgb3ZlciB0aW1lbGluZSBiYXJzLgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiBiYXJfaG92ZXIoZSkgewogICAgICAgIGlmIChzZXR0aW5ncy5zaG93X3Jldmlld19kZXRhaWxzID09PSAnbm9uZScpIHJldHVybjsKICAgICAgICBpZiAoaGlnaGxpZ2h0LmhpZ2hsaWdodGVkKSByZXR1cm47CiAgICAgICAgc3dpdGNoIChlLnR5cGUpIHsKICAgICAgICAgICAgY2FzZSAnbW91c2VlbnRlcic6CiAgICAgICAgICAgICAgICB2YXIgYnVuZGxlX2lkeCA9IE51bWJlcihlLnRhcmdldC5hdHRyaWJ1dGVzWydkYXRhLWJ1bmRsZSddLnZhbHVlKTsKICAgICAgICAgICAgICAgIGhpZ2hsaWdodC5zdGFydCA9IGJ1bmRsZV9pZHg7CiAgICAgICAgICAgICAgICBoaWdobGlnaHQuZW5kID0gYnVuZGxlX2lkeCArIDE7CiAgICAgICAgICAgICAgICBzaG93X3Jldmlld19pbmZvKGZhbHNlIC8qIHN0aWNreSAqLywgZSk7CiAgICAgICAgICAgICAgICBncmFwaC5lbGVtLm9uKCdtb3VzZW1vdmUuYmFyX2hvdmVyX21vdmUnLCBmdW5jdGlvbihlKXsKICAgICAgICAgICAgICAgICAgICBncmFwaC5yZXZpZXdfaW5mby5jc3MoJ3RvcCcsIGUuY2xpZW50WSAtIGUudGFyZ2V0LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpLnRvcCAtIDMwKTsKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgYnJlYWs7CgogICAgICAgICAgICBjYXNlICdtb3VzZWxlYXZlJzoKICAgICAgICAgICAgICAgIGdyYXBoLmVsZW0ub2ZmKCcuYmFyX2hvdmVyX21vdmUnKTsKICAgICAgICAgICAgICAgIGhpZGVfcmV2aWV3X2luZm8oKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gQnVpbGQgYW5kIGRpc3BsYXkgdGhlIFJldmlldyBJbmZvIHBvcC11cC4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gc2hvd19yZXZpZXdfaW5mbyhzdGlja3ksIGUpIHsKICAgICAgICB2YXIgaW5mbyA9ICQoJyN0aW1lbGluZSAucmV2aWV3X2luZm8nKTsKICAgICAgICBpZiAoc3RpY2t5KSB7CiAgICAgICAgICAgICQoJ2JvZHknKS5vZmYoJy50aW1lbGluZV9oaWRlaW5mbycpOwogICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCl7CiAgICAgICAgICAgICAgICAkKCdib2R5Jykub24oJ2NsaWNrLnRpbWVsaW5lX2hpZGVpbmZvJywgZnVuY3Rpb24oZS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oaHRtbCk7CiAgICAgICAgZ3JhcGgucmV2aWV3X2luZm8gPSBpbmZvOwoKICAgICAgICB2YXIgbnVtX3dpZHRoID0gYnVuZGxlLnN0YXRzLmNvdW50LnRvU3RyaW5nKCk7CiAgICAgICAgaW5mby5maW5kKCcuc3VtbWFyeSAuZml4ZWQnKS5jc3MoJ3dpZHRoJywgKG51bV93aWR0aC50b1N0cmluZygpLmxlbmd0aCAqIDkgKyA4KSArICdweCcpOwoKICAgICAgICB2YXIgdG9wLCBsZWZ0LCByaWdodCwgd2lkdGg7CiAgICAgICAgdmFyIGhhbGZfd2lkdGggPSBncmFwaC54X2F4aXMud2lkdGgvMjsKICAgICAgICB2YXIgeCA9IGJ1bmRsZV90b194KHN0YXJ0KTsKICAgICAgICBpbmZvLmNzcygnbWF4LXdpZHRoJywgaGFsZl93aWR0aCk7CiAgICAgICAgaWYgKGhpZ2hsaWdodC5kcmFnZ2luZykgewogICAgICAgICAgICB0b3AgPSBncmFwaC5tYXJnaW4udG9wICsgZ3JhcGgueV9heGlzLmhlaWdodCArIGdyYXBoLm1hcmdpbi5ib3R0b207CiAgICAgICAgICAgIGlmICh4IDwgaGFsZl93aWR0aCkgewogICAgICAgICAgICAgICAgbGVmdCA9IGdyYXBoLm1hcmdpbi5sZWZ0ICsgeDsKICAgICAgICAgICAgICAgIGluZm8uY3NzKHtsZWZ0OmxlZnQsIHJpZ2h0OidhdXRvJywgdG9wOnRvcH0pOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgcmlnaHQgPSAwOwogICAgICAgICAgICAgICAgaW5mby5jc3Moe2xlZnQ6J2F1dG8nLCByaWdodDpyaWdodCwgdG9wOnRvcH0pOwogICAgICAgICAgICAgICAgaWYgKHggPCBncmFwaC54X2F4aXMud2lkdGggLSBpbmZvLm91dGVyV2lkdGgoKSkgewogICAgICAgICAgICAgICAgICAgIGxlZnQgPSBncmFwaC5tYXJnaW4ubGVmdCArIHg7CiAgICAgICAgICAgICAgICAgIC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RvX2NsYXNzID0gewogICAgICAgICAgICBjdXJyOiBbJ2FwcHInLCdhcHByJywnYXBwcicsJ2FwcHInLCdhcHByJywnZ3VydScsJ2d1cnUnLCdtYXN0JywnZW5saSddLAogICAgICAgICAgICBuZXh0OiBbJ2FwcHInLCdhcHByJywnYXBwcicsJ2FwcHInLCdndXJ1JywnZ3VydScsJ21hc3QnLCdlbmxpJywnYnVybiddCiAgICAgICAgfTsKICAgICAgICBodG1sICs9ICc8ZGl2IGNsYXNzPSJpdGVtX2luZm8gaGlkZGVuIj48L2Rpdj48dWwgY2xhc3M9Iml0ZW1fbGlzdCI+JzsKICAgICAgICBmb3IgKHZhciBpdGVtX2lkeCBpbiBidW5kbGUuaXRlbXMpIHsKICAgICAgICAgICAgdmFyIGl0ZW0gPSBidW5kbGUuaXRlbXNbaXRlbV9pZHhdOwogICAgICAgICAgICB2YXIgY2xhc3NlcyA9IFsKICAgICAgICAgICAgICAgIGl0ZW0ub2JqZWN0LnNsaWNlKDAsMyksCiAgICAgICAgICAgICAgICBzcnNfdG9fY2xhc3Nbc2V0dGluZ3Muc3JzX2N1cnJfbmV4dF1baXRlbS5hc3NpZ25tZW50cy5zcnNfc3RhZ2VdLAogICAgICAgICAgICAgICAgJ2x2bGdycCcrTWF0aC5mbG9vcigoaXRlbS5kYXRhLmxldmVsLTEpLzEwKQogICAgICAgICAgICBdOwogICAgICAgICAgICB2YXIgaXRlbV9uYW1lOwogICAgICAgICAgICBpZiAoaXRlbS5vYmplY3QgPT09ICdyYWRpY2FsJykgewogICAgICAgICAgICAgICAgaWYgKGl0ZW0uZGF0YS5jaGFyYWN0ZXJzKSB7CiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSAnPGxpIGNsYXNzPSInK2NsYXNzZXMuam9pbignICcpKyciPicraXRlbS5kYXRhLmNoYXJhY3RlcnMrJzwvbGk+JzsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgaHRtbCArPSAnPGxpIGNsYXNzPSInK2NsYXNzZXMuam9pbignICcpKyciIGRhdGEtcmFkbmFtZT0iJytpdGVtLmRhdGEuc2x1ZysnIj4uLi48L2xpPic7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNlbGVjdG9yID0gJyN0aW1lbGluZSAucmV2aWV3X2luZm8gLml0ZW1fbGlzdCA+IGxpW2RhdGEtcmFkbmFtZT0iJytpdGVtLmRhdGEuc2x1ZysnIl0nOwogICAgICAgICAgICAgICAgICAgIGxvYWRfcmFkaWNhbF9zdmcoaXRlbSkudGhlbihwb3B1bGF0ZV9yYWRpY2FsX3N2Zy5iaW5kKG51bGwsIHNlbGVjdG9yKSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBodG1sICs9ICc8bGkgY2xhc3M9IicrY2xhc3Nlcy5qb2luKCcgJykrJyI+JytpdGVtLmRhdGEuc2x1ZysnPC9saT4nOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGh0bWwgKz0gJzwvdWw+JzsKICAgICAgICByZXR1cm4gaHRtbDsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gSW5zZXJ0IGFuIHN2ZyBpbnRvIGEgc3BlY2lmaWVkIERPTSBlbGVtZW50LgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiBwb3B1bGF0ZV9yYWRpY2FsX3N2ZyhzZWxlY3Rvciwgc3ZnKSB7CiAgICAgICAgJChzZWxlY3RvcikuaHRtbChzdmcpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBFd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9IGdyYXBoLmN1cnJlbnRfYnVuZGxlLml0ZW1zW3RhcmdldC5pbmRleCgpXTsKICAgICAgICAgICAgICAgIHZhciBwb3MgPSB0YXJnZXQucG9zaXRpb24oKTsKICAgICAgICAgICAgICAgIGluZm8uY3NzKHt0b3A6cG9zLnRvcCt0YXJnZXQub3V0ZXJIZWlnaHQoKSszfSk7CiAgICAgICAgICAgICAgICBwb3B1bGF0ZV9pdGVtX2luZm8oaW5mbywgaXRlbSk7CiAgICAgICAgICAgICAgICBpbmZvLnJlbW92ZUNsYXNzKCdoaWRkZW4nKTsKICAgICAgICAgICAgICAgIGJyZWFrOwoKICAgICAgICAgICAgY2FzZSAnbW91c2VsZWF2ZSc6CiAgICAgICAgICAgICAgICBpbmZvLmFkZENsYXNzKCdoaWRkZW4nKTsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgIH0KICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gSGFuZGxlciBmb3IgcmVzaXppbmcgdGhlIHRpbWVsaW5lIHdoZW4gdGhlIHdpbmRvdyBzaXplIGNoYW5nZXMuCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIHdpbmRvd19yZXNpemVkKCkgewogICAgICAgIHZhciBuZXdfd2lkdGggPSBncmFwaC5lbGVtLndpZHRoKCk7CiAgICAgICAgaWYgKG5ld193aWR0aCAhPSBncmFwaC54X2F4aXMud2lkdGggKyBncmFwaC5tYXJnaW4ubGVmdCkgewogICAgICAgICAgICBidW5kbGVfYnlfdGltZXNsb3QoKTsKICAgICAgICAgICAgZHJhd190aW1lbGluZSgpOwogICAgICAgIH0KICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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gICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgIGNhc2UgJ2thbmppJzoKICAgICAgICAgICAgICAgIGh0bWwgPSAnPHNwYW4gY2xhc3M9Iml0ZW0iPkthbmppOiA8c3BhbiBjbGFzcz0ic2x1ZyIgbGFuZz0iamEiPicraXRlbS5kYXRhLnNsdWcrJzwvc3Bhbj48L3NwYW4+PGJyPic7CiAgICAgICAgICAgICAgICBodG1sICs9IGdldF9pbXBvcnRhbnRfcmVhZGluZyhpdGVtKSsnPGJyPic7CiAgICAgICAgICAgICAgICBicmVhazsKCiAgICAgICAgICAgIGNhc2UgJ3ZvY2FidWxhcnknOgogICAgICAgICAgICAgICAgaHRtbCA9ICc8c3BhbiBjbGFzcz0iaXRlbSI+Vm9jYWI6IDxzcGFuIGNsYXNzPSJzbHVnIiBsYW5nPSJqYSI+JytpdGVtLmRhdGEuc2x1ZysnPC9zcGFuPjwvc3Bhbj48YnI+JzsKICAgICAgICAgICAgICAgIGh0bWwgKz0gJ1JlYWRpbmc6ICcrZ2V0X3JlYWRpbmcoaXRlbSkrJzxicj4nOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgICAgIGh0bWwgKz0gJ01lYW5pbmc6ICcrZ2V0X21lYW5pbmdzKGl0ZW0pKyc8YnI+JzsKICAgICAgICBodG1sICs9ICdMZXZlbDogJytpdGVtLmRhdGEubGV2ZWwrJzxicj4nOwogICAgICAgIGh0bWwgKz0gJ1NSUyBMZXZlbDogJytpdGVtLmFzc2lnbm1lbnRzLnNyc19zdGFnZV9uYW1lOwogICAgICAgIGluZm8uaHRtbChodG1sKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gTG9hZCBhIHJhZGljYWwncyBzdmcgZmlsZS4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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eV9tYXRlcmlhbHMgJiYgaXRlbS5zdHVkeV9tYXRlcmlhbHMubWVhbmluZ19zeW5vbnltcykgewogICAgICAgICAgICBtZWFuaW5ncyA9IGl0ZW0uc3R1ZHlfbWF0ZXJpYWxzLm1lYW5pbmdfc3lub255bXM7CiAgICAgICAgfQogICAgICAgIG1lYW5pbmdzID0gbWVhbmluZ3MuY29uY2F0KGl0ZW0uZGF0YS5tZWFuaW5ncy5tYXAobWVhbmluZyA9PiBtZWFuaW5nLm1lYW5pbmcpKTsKICAgICAgICByZXR1cm4gdG9fdGl0bGVfY2FzZShtZWFuaW5ncy5qb2luKCcsICcpKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gRXh0cmFjdCB0aGUgJ2ltcG9ydGFudCcgcmVhZGluZ3MgZnJvbSBhIGthbmppLgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiBnZXRfaW1wb3J0YW50X3JlYWRpbmcoaXRlbSkgewogICAgICAgIHZhciByZWFkaW5ncyA9IGl0ZW0uZGF0YS5yZWFkaW5ncy5maWx0ZXIocmVhZGluZyA9PiByZWFkaW5nLnByaW1hcnkpOwogICAgICAgIHJldHVybiB0b190aXRsZV9jYXNlKHJlYWRpbmdzWzBdLnR5cGUpKyc6ICcrcmVhZGluZ3MubWFwKHJlYWRpbmcgPT4gcmVhZGluZy5yZWFkaW5nKS5qb2luKCcsICcpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBFeHRyYWN0IHRoZSBsaXN0IG9mIHJlYWRpbmdzIGZyb20gYW4gaXRlbS4KICAgIC8vL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0gKG5ldyBEYXRlKCkpLmdldERhdGUoKSkgewogICAgICAgICAgICBzdHIgPSAnVG9kYXknOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHN0ciA9ICdTdW5Nb25UdWVXZWRUaHVGcmlTYXQnLnN1YnN0cih0aW1lLmdldERheSgpKjMsIDMpOwogICAgICAgIH0KICAgICAgICBpZiAoc2V0dGluZ3MudGltZV9mb3JtYXQgPT09ICcyNGhvdXInKSB7CiAgICAgICAgICAgIHN0ciArPSAnICcgKyAoJzAnICsgdGltZS5nZXRIb3VycygpKS5zbGljZSgtMikgKyAnOicgKyAoJzAnK3RpbWVfc2hpZnQpLnNsaWNlKC0yKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzdHIgKz0gJyAnICsgKCcwJyArICgoKHRpbWUuZ2V0SG91cnMoKSsxMSklMTIpKzEpKS5zbGljZSgtMikgKyAnOicrKCcwJyt0aW1lX3NoaWZ0KS5zbGljZSgtMikgKyAnYXAnW01hdGguZmxvb3IodGltZS5nZXRIb3VycygpLzEyKV0gKyAnbSc7CiAgICAgICAgfQogICAgICAgIHJldHVybiBzdHI7CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEZldGNoIGl0ZW0gaW5mbywgYW5kIHJlZHJhdyB0aGUgdGltZWxpbmUuCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIGZldGNoX2FuZF91cGRhdGUoKSB7CiAgICAgICAgcmV0dXJuIHdrb2YuSXRlbURhdGEuZ2V0X2l0ZW1zKCdzdWJqZWN0cywgYXNzaWdubWVudHMsIHN0dWR5X21hdGVyaWFscycpCiAgICAgICAgLnRoZW4ocHJvY2Vzc19pdGVtcykKICAgICAgICA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wogICAgICAgIHVwZGF0ZV9zbGlkZXJfcmV2aWV3cygpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBCdW5kbGUgdGhlIGl0ZW1zIGludG8gdGltZXNsb3RzLgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiBidW5kbGVfYnlfdGltZXNsb3QoKSB7CiAgICAgICAgdmFyIGJ1bmRsZV9zaXplID0gZ3JhcGguYnVuZGxlX3NpemUgPSBnZXRfaG91cnNfcGVyX2JhcigpOwogICAgICAgIHZhciBidW5kbGVzID0gZ3JhcGguYnVuZGxlcyA9IFtdOwogICAgICAgIHZhciB0aW1lc2xvdHMgPSBncmFwaC50aW1lc2xvdHMgPSBbXTsKCiAgICAgICAgLy8gUmV3aW5kIHRoZSBjbG9jayB0byB0aGUgc3RhcnQgb2YgYSBidW5kbGUgcGVyaW9kLgogICAgICAgIHZhciBzdGFydF90aW1lID0gdG9TdGFydE9mVVRDSG91cihuZXcgRGF0ZSgpKTsKICAgICAgICB3aGlsZSAoc3RhcnRfdGltZS5nZXRIb3VycygpICUgYnVuZGxlX3NpemUgIT09IDApIHN0YXJ0X3RpbWUgPSBuZXcgRGF0ZShzdGFydF90aW1lLmdldFRpbWUoKSAtIDM2MDAwMDApOwogICAgICAgIGdyYXBoLnN0YXJ0X3RpbWUgPSBzdGFydF90aW1lOwoKICAgICAgICAvLyBGaW5kIHRoZSB0aWMgb2YgdGhlIGxhc3QgYnVuZGxlIChyb3VuZCBkb3duIGlmIG9ubHkgYSBwYXJ0aWFsKS4KICAgICAgICBncmFwaC50b3RhbF9yZXZpZXdzID0gMDsKICAgICAgICBncmFwaC5tYXhfcmV2aWV3cyA9IDA7CiAgICAgICAgdmFyIGhvdXIgPSAwLCBpdGVtX2lkeCA9IDAsIGl0ZW1fY291bnQgPSAwOwogICAgICAgIHZhciBidW5kbGUgPSB7c3RhcnRfdGltZTpob3VyLCBpdGVtczpbXX07CiAgICAgICAgd2hpbGUgKHRydWUpIHsKICAgICAgICAgICAgdGltZXNsb3RzLnB1c2goYnVuZGxlcy5sZW5ndGgpOwogICAgICAgICAgICBob3VyKys7CiAgICAgICAgICAgIC8vIENoZWNrIGlmIHdlJ3JlIHBhc3QgZW5kIG9mIHRoZSB0aW1lbGluZSAoaW5jbHVkaW5nIHJvdW5kaW5nIHVwIHRvIHRoZSBuZWFyZXN0IGJ1bmRsZSkKICAgICAgICAgICAgLy8gTmVlZCB0byB1c2UgZGF0ZSBmdW5jdGlvbiB0byBhY2NvdW50IGZvciB0aW1lIHNoaWZ0cyAoZS5nLiBEYXlsaWdodCBTYXZpbmdzIFRpbWUpCiAgICAgICAgICAgIHZhciB0aW1lID0gbmV3IERhdGUoc3RhcnRfdGltZS5nZXRUaW1lKCkgKyBob3VyICogMzYwMDAwMCk7CiAgICAgICAgICAgIGlmICgodGltZS5nZXRIb3VycygpICUgYnVuZGxlX3NpemUpICE9PSAwKSBjb250aW51ZTsKCiAgICAgICAgICAgIHZhciBzdGFydF9pZHggPSBpdGVtX2lkeDsKICAgICAgICAgICAgd2hpbGUgKChpdGVtX2lkeCA8IGdyYXBoLml0ZW1zLmxlbmd0aCkgJiYKICAgICAgICAgICAgICAgICAgIChuZXcgRGF0ZShncmFwaC5pdGVtc1tpdGVtX2lkeF0uYXNzaWdubWVudHMuYXZhaWxhYmxlX2F0KSA8IHRpbWUpKSB7CiAgICAgICAgICAgICAgICBpdGVtX2lkeCsrOwogICAgICAgICAgICB9CgogICAgICAgICAgICBidW5kbGUuaXRlbXMgPSBncmFwaC5pdGVtcy5zbGljZShzdGFydF9pZHgsIGl0ZW1faWR4KTsKICAgICAgICAgICAgYnVuZGxlLmVuZF90aW1lID0gaG91cjsKICAgICAgICAgICAgY2FsY19idW5kbGVfc3RhdHMoYnVuZGxlKTsKICAgICAgICAgICAgZ3JhcGguYnVuZGxlcy5wdXNoKGJ1bmRsZSk7CgogICAgICAgICAgICBncmFwaC50b3RhbF9yZXZpZXdzICs9IGJ1bmRsZS5pdGVtcy5sZW5ndGg7CiAgICAgICAgICAgIGlmIChidW5kbGUuaXRlbXMubGVuZ3RoID4gZ3JhcGgubWF4X3Jldmlld3MpIGdyYXBoLm1heF9yZXZpZXdzID0gYnVuZGxlLml0ZW1zLmxlbmd0aDsKICAgICAgICAgICAgaWYgKGhvdXIgPj0gZ3JhcGgueF9heGlzLm1heF9ob3VycykgYnJlYWs7CgogICAgICAgICAgICBidW5kbGUgPSB7c3RhcnRfdGltZTpob3VyLCBpdGVtczpbXX07CiAgICAgICAgfQogICAgICAgIGdyYXBoLnhfYXhpcy5tYXhfaG91cnMgPSBob3VyOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBDYWxjdWxhdGUgc3RhdHMgZm9yIGEgYnVuZGxlCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIGNhbGNfYnVuZGxlX3N0YXRzKGJ1bmRsZSkgewogICAgICAgIHZhciBpdHlwZV90b19pbnQgPSB7cmFkaWNhbDowLCBrYW5qaToxLCB2b2NhYnVsYXJ5OjJ9OwogICAgICAgIHZhciBpdHlwZV90b19jbGFzcyA9IHtyYWRpY2FsOidyYWQnLCBrYW5qaTona2FuJywgdm9jYWJ1bGFyeTondm9jJ307CiAgICAgICAgdmFyIHNyc190b19jbGFzcyA9IHsKICAgICAgICAgICAgY3VycjogWydhcHByJywnYXBwcicsJ2FwcHInLCdhcHByJywnYXBwcicsJ2d1cnUnLCdndXJ1JywnbWFzdCcsJ2VubGknXSwKICAgICAgICAgICAgbmV4dDogWydhcHByJywnYXBwcicsJ2FwcHInLCdhcHByJywnZ3VydScsJ2d1cnUnLCdtYXN0JywnZW5saScsJ2J1cm4nXQogICAgICAgIH07CiAgICAgICAgYnVuZGxlLml0ZW1zLnNvcnQoZnVuY3Rpb24oYSwgYil7CiAgICAgICAgICAgIHZhciBhX2l0eXBlID0gaXR5cGVfdG9faW50W2Eub2JqZWN0XTsKICAgICAgICAgICAgdmFyIGJfaXR5cGUgPSBpdHlwZV90b19pbnRbYi5vYmplY3RdOwogICAgICAgICAgICBpZiAoYV9pdHlwZSAhPT0gYl9pdHlwZSkgcmV0dXJuIGFfaXR5cGUgLSBiX2l0eXBlOwogICAgICAgICAgICBpZiAoYS5kYXRhLmxldmVsICE9PSBiLmRhdGEubGV2ZWwpIHJldHVybiBhLmRhdGEubGV2ZWwgLSBiLmRhdGEubGV2ZWw7CiAgICAgICAgICAgIHJldHVybiBhLmRhdGEuc2x1Zy5sb2NhbGVDb21wYXJlKGIuZGF0YS5zbHVnKTsKICAgICAgICB9KTsKICAgICAgICBidW5kbGUuc3RhdHMgPSB7CiAgICAgICAgICAgIGNvdW50OjAsCiAgICAgICAgICAgIHJhZDowLCBrYW46MCwgdm9jOjAsCiAgICAgICAgICAgIGFwcHI6MCwgZ3VydTowLCBtYXN0OjAsIGVubGk6MCwgYnVybjowLAogICAgICAgICAgICBsdmxncnAwOjAsIGx2bGdycDE6MCwgbHZsZ3JwMjowLCBsdmxncnAzOjAsIGx2bGdycDQ6MCwgbHZsZ3JwNTowLAogICAgICAgICAgICBjdXJyX2NvdW50OiAwLAogICAgICAgICAgICBoYXNfY3Vycl9tYXJrZXI6IGZhbHNlLAogICAgICAgICAgICBidXJuX2NvdW50OiAwCiAgICAgICAgfTsKICAgICAgICB2YXIgc3RhdHMgPSBidW5kbGUuc3RhdHM7CiAgICAgICAgZm9yICh2YXIgaXRlbV9pZHggaW4gYnVuZGxlLml0ZW1zKSB7CiAgICAgICAgICAgIHZhciBpdGVtID0gYnVuZGxlLml0ZW1zW2l0ZW1faWR4XTsKICAgICAgICAgICAgc3RhdHMuY291bnQrKzsKICAgICAgICAgICAgc3RhdHNbaXR5cGVfdG9fY2xhc3NbaXRlbS5vYmplY3RdXSsrOwogICAgICAgICAgICBzdGF0c1tzcnNfdG9fY2xhc3Nbc2V0dGluZ3Muc3JzX2N1cnJfbmV4dF1baXRlbS5hc3NpZ25tZW50cy5zcnNfc3RhZ2VdXSsrOwogICAgICAgICAgICBzdGF0c1snbHZsZ3JwJytNYXRoLmZsb29yKChpdGVtLmRhdGEubGV2ZWwtMSkvMTApXSsrOwogICAgICAgICAgICBpZiAoaXRlbS5kYXRhLmxldmVsID09PSB3a29mLnVzZXIubGV2ZWwpIHsKICAgICAgICAgICAgICAgIHN0YXRzLmN1cnJfY291bnQrKzsKICAgICAgICAgICAgICAgIGlmIChzZXR0aW5ncy5jdXJyZW50X2xldmVsX21hcmtlcnMuaW5kZXhPZihpdGVtLm9iamVjdFswXSkgPj0gMCkgewogICAgICAgICAgICAgICAgICAgIHN0YXRzLmhhc19jdXJyX21hcmtlciA9IHRydWU7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgYnVuZGxlLnN0YXRzLmJ1cm5fY291bnQgPSBidW5kbGUuc3RhdHNbc3JzX3RvX2NsYXNzW3NldHRpbmdzLnNyc19jdXJyX25leHRdWzhdXTsKICAgICAgICBncmFwaC5jdXJyZW50X2J1bmRsZSA9IGJ1bmRsZTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gUmV0dXJuIHRoZSB0aW1lc3RhbXAgb2YgdGhlIGJlZ2lubmluZyBvZiB0aGUgY3VycmVudCBVVEMgaG91ci4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gdG9TdGFydE9mVVRDSG91cihkYXRlKSB7CiAgICAgICAgdmFyIGQgPSAoZGF0ZSBpbnN0YW5jZW9mIERhdGUgPyBkYXRlLmdldFRpbWUoKSA6IGRhdGUpOwogICAgICAgIGQgPSBNYXRoLmZsb29yKGQvMzYwMDAwMCkqMzYwMDAwMDsKICAgICAgICByZXR1cm4gKGRhdGUgaW5zdGFuY2VvZiBEYXRlID8gbmV3IERhdGUoZCkgOiBkKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gU3RhcnQgYSB0aW1lciB0byByZWZyZXNoIHRoZSB0aW1lbGluZSAod2l0aG91dCBmZXRjaCkgYXQgdGhlIHRvcCBvZiB0aGUgaG91ci4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gc3RhcnRfcmVmcmVzaF90aW1lcigpIHsKICAgICAgICB2YXIgbm93ID0gRGF0ZS5ub3coKTsKICAgICAgICB2YXIgbmV4dF9ob3VyID0gdG9TdGFydE9mVVRDSG91cihub3cpICsgMzYwMTAwMDsgLy8gMSBzZWNvbmQgcGFzdCB0aGUgbmV4dCBVVEMgaG91ci4KICAgICAgICB2YXIgd2FpdF90aW1lID0gKG5leHRfaG91ciAtIG5vdyk7CiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpewogICAgICAgICAgICBidW5kbGVfYnlfdGltZXNsb3QoKTsKICAgICAgICAgICAgdXBkYXRlX3NsaWRlcl9yZXZpZXdzKCk7CiAgICAgICAgICAgIGRyYXdfdGltZWxpbmUoKTsKICAgICAgICAgICAgc3RhcnRfcmVmcmVzaF90aW1lcigpOwogICAgICAgIH0sIHdhaXRfdGltZSk7CiAgICB9Cgp9KSh3aW5kb3cudGltZWxpbmUpOwo="},{"name":"Wanikani Dashboard Progress Plus","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["/^https://(www|preview).wanikani.com/(dashboard)?$/"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-end","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1569496825154,"data":{}},"enabled":false,"position":24,"file_url":"https://greasyfork.org/scripts/9552-wanikani-dashboard-progress-plus/code/Wanikani%20Dashboard%20Progress%20Plus.user.js","uuid":"8e94d762-0bc9-4a42-8145-e177a790cfb5","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIFdhbmlrYW5pIERhc2hib2FyZCBQcm9ncmVzcyBQbHVzCi8vIEBuYW1lc3BhY2UgICByZmluZGxleQovLyBAZGVzY3JpcHRpb24gRGlzcGxheSBkZXRhaWxlZCBsZXZlbCBwcm9ncmVzcy4KLy8gQHZlcnNpb24gICAgIDMuMC4yCi8vIEBpbmNsdWRlICAgICAvXmh0dHBzOi8vKHd3d3xwcmV2aWV3KS53YW5pa2FuaS5jb20vKGRhc2hib2FyZCk/JC8KLy8gQGNvcHlyaWdodCAgIDIwMTgrLCBSb2JpbiBGaW5kbGV5Ci8vIEBsaWNlbnNlICAgICBNSVQ7IGh0dHA6Ly9vcGVuc291cmNlLm9yZy9saWNlbnNlcy9NSVQKLy8gQHJ1bi1hdCAgICAgIGRvY3VtZW50LWVuZAovLyBAZ3JhbnQgICAg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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBHbG9iYWwgdmFyaWFibGVzCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIHZhciBzZXR0aW5ncywgc2V0dGluZ3NfZGlhbG9nOwoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBMb2FkIHRoZSBzY3JpcHQgc2V0dGluZ3MuCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIGxvYWRfc2V0dGluZ3MoKSB7CiAgICAgICAgdmFyIGRlZmF1bHRzID0gewogICAgICAgICAgICB2aXNpYmxlX2l0ZW1zOiAnYWxsJywKICAgICAgICAgICAgbG9ja2VkX3Bvc2l0aW9uOiAnZmlyc3QnLAogICAgICAgICAgICBzaG93XzkwcGVyY2VudDogdHJ1ZSwKICAgICAgICAgICAgc2hvd19jaGFyOiB0cnVlLAogICAgICAgICAgICBlbmFibGVfcG9wdXA6IHRydWUsCiAgICAgICAgICAgIHNob3dfbWVhbmluZzogdHJ1ZSwKICAgICAgICAgICAgc2hvd19yZWFkaW5nOiB0cnVlLAogICAgICAgICAgICBzaG93X3NyczogdHJ1ZSwKICAgICAgICAgICAgc2hvd19uZXh0X3JldmlldzogdHJ1ZSwKICAgICAgICAgICAgc2hvd19wYXNzZWQ6IHRydWUsCiAgICAgICAgICAgIHRpbWVfZm9ybWF0OiAnMTJob3VyJywKICAgICAgICB9OwogICAgICAgIHJldHVybiB3a29mLlNldHRpbmdzLmxvYWQoJ2RwcCcsIGRlZmF1bHRzKS50aGVuKGZ1bmN0aW9uKGRhdGEpewogICAgICAgICAgICBzZXR0aW5ncyA9IHdrb2Yuc2V0dGluZ3MuZHBwOwogICAgICAgIH0pOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBPcGVuIHRoZSBzZXR0aW5ncyBkaWFsb2cKICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gb3Blbl9zZXR0aW5ncygpIHsKICAgICAgICB2YXIgY29uZmlnID0gewogICAgICAgICAgICBzY3JpcHRfaWQ6ICdkcHAnLAogICAgICAgICAgICB0aXRsZTogJ0Rhc2hib2FyZCBQcm9ncmVzcyBQbHVzJywKICAgICAgICAgICAgb25fc2F2ZTogc2V0dGluZ3Nfc2F2ZWQsCiAgICAgICAgICAgIG9uX3JlZnJlc2g6IHJlZnJlc2hfc2V0dGluZ3MsCiAgICAgICAgICAgIGNvbnRlbnQ6IHsKICAgICAgICAgICAgICAgIHRhYnM6IHt0eXBlOid0YWJzZXQnLCBjb250ZW50OiB7CiAgICAgICAgICAgICAgICAgICAgcGdMYXlvdXQ6IHt0eXBlOidwYWdlJywgbGFiZWw6J01haW4gVmlldycsIGhvdmVyX3RpcDonU2V0dGluZ3MgZm9yIHRoZSBtYWluIHZpZXcuJywgY29udGVudDogewogICAgICAgICAgICAgICAgICAgICAgICB2aXNpYmxlX2l0ZW1zOiB7dHlwZTonZHJvcGRvd24nLCBsYWJlbDonVmlzaWJsZSBJdGVtcycsIGRlZmF1bHQ6J2FsbCcsIGNvbnRlbnQ6e2FsbDonQWxsIEl0ZW1zJyxhcHByX29ubHk6J0FwcHJlbnRpY2UgT25seScsZ3VydV9vbmx5OidHdXJ1KyBPbmx5J30sIGhvdmVyX3RpcDonQ2hvb3NlIHdoaWNoIGl0ZW1zIHRv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ob3cgdGhlIGl0ZW1cJ3MgbmV4dCByZXZpZXcgZGF0ZSBpbiB0aGUgcG9wLXVwIGluZm8uJ30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93X3Bhc3NlZDoge3R5cGU6J2NoZWNrYm94JywgbGFiZWw6J1Nob3cgUGFzc2VkIERhdGUnLCBkZWZhdWx0OnRydWUsIGhvdmVyX3RpcDonQ2hvb3NlIHdoZXRoZXIgdG8gc2hvdyB0aGUgZGF0ZSB0aGF0IHRoZSBpdGVtIHBhc3NlZCBpbiB0aGUgcG9wLXVwIGluZm8uJ30sCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lX2Zvcm1hdDoge3R5cGU6J2Ryb3Bkb3duJywgbGFiZWw6J1RpbWUgRm9ybWF0JywgZGVmYXVsdDonMTJob3VyJywgY29udGVudDp7JzEyaG91cic6JzEyLWhvdXInLCcyNGhvdXInOicyNC1ob3VyJ30sIGhvdmVyX3RpcDonRGlzcGxheSB0aW1lIGluIDEyIG9yIDI0LWhvdXIgZm9ybWF0Lid9LAogICAgICAgICAgICAgICAgICAgICAgICB9fQogICAgICAgICAgICAgICAgICAgIH19CiAgICAgICAgICAgICAgICB9fQogICAgICAgICAgICB9CiAgICAgICAgfTsKICAgICAgICB2YXIgc2V0dGluZ3NfZGlhbG9nID0gbmV3IHdrb2YuU2V0dGluZ3MoY29uZmlnKTsKICAgICAgICBzZXR0aW5nc19kaWFsb2cub3BlbigpOwogICAgfQoKICAgIC8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CiAgICAvLyBSZWZyZXNoIHNldHRpbmdzIGRpYWxvZwogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIHJlZnJlc2hfc2V0dGluZ3Mo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N0YXRpc3RpY3M6dHJ1ZQogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIGZpbHRlcnM6ewogICAgICAgICAgICAgICAgICAgIGxldmVsOicrMCcsCiAgICAgICAgICAgICAgICAgICAgaXRlbV90eXBlOidyYWRpY2FsLGthbmppJywKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0pCiAgICAgICAgLnRoZW4ocHJvY2Vzc19pdGVtcyk7CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIENTUyBTdHlsaW5nCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIHZhciBwcm9ncmVzc19jc3MgPQogICAgICAgICcjd2tvZnNfZHBwIC5yb3cuZGlzYWJsZWQgbGFiZWwge29wYWNpdHk6MC41O30nKwoKICAgICAgICAnZGl2LnByb2dyZXNzLWVudHJpZXMge2dyaWQtZ2FwOjEycHggMHB4O30nKwogICAgICAgICdkaXYucHJvZ3Jlc3MtZW50cnkge3BhZGRpbmc6NHB4O30nKwogICAgICAgICcucHJvZ3Jlc3MtZW50cnkucGN0OTAge2JhY2tncm91bmQ6I2ZmZjsgYm9yZGVyLXJhZGl1czowOyBib3JkZXItY29sb3I6Izc3NzsgYm9yZGVyLXN0eWxlOnNvbGlkOyBib3JkZXItd2lkdGg6MXB4IDA7IHBhZGRpbmctdG9wOjNweDsgcGFkZGluZy1ib3R0b206M3B4O30nKwogICAgICAgICcucHJvZ3Jlc3MtZW50cnkucGN0OTAucGN0OTBfbGVmdCB7Ym9yZGVyLWxlZnQtd2lkdGg6MXB4OyBib3JkZXItdG9wLWxlZnQtcmFkaXVzOjdweDsgYm9yZGVyLWJvdHRvbS1sZWZ0LXJhZGl1czo3cHg7IHB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bl9jbGljazpvcGVuX3NldHRpbmdzfSk7CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEluaXRpYWxpemUgdGhlIHVzZXIgaW50ZXJmYWNlLgogICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgICBmdW5jdGlvbiBpbml0X3VpKCkgewogICAgICAgICQoJy5wcm9ncmVzc2lvbicpLmF0dHIoJ2RhdGEtaGlkZS1jaGFyJywgIXNldHRpbmdzLnNob3dfY2hhcik7CiAgICAgICAgaWYgKHNldHRpbmdzLmVuYWJsZV9wb3B1cCkgewogICAgICAgICAgICAkKCcucHJvZ3Jlc3MtZW50cmllcycpLnBvcG92ZXIoewogICAgICAgICAgICAgICAgc2VsZWN0b3I6Jy5wcm9ncmVzcy1lbnRyeScsCiAgICAgICAgICAgICAgICB0cmlnZ2VyOidob3ZlcicsCiAgICAgICAgICAgICAgICBhbmltYXRpb246IGZhbHNlLAogICAgICAgICAgICAgICAgaHRtbDp0cnVlLAogICAgICAgICAgICAgICAgY29udGVudDpnZW5lcmF0ZV9pdGVtX2luZm8sCiAgICAgICAgICAgICAgICBwbGFjZW1lbnQ6cGxhY2VfaXRlbV9pbmZvLAogICAgICAgICAgICB9KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAkKCcucHJvZ3Jlc3MtZW50cmllcycpLnBvcG92ZXIoJ2Rlc3Ryb3knKTsKICAgICAgICB9CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIEhhbmRsZXIgZm9yIHdoZW4gdXNlciBjbGlja3MgJ1NhdmUnIGluIHRoZSBzZXR0aW5ncyB3aW5kb3cuCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIHNldHRpbmdzX3NhdmVkKG5ld19zZXR0aW5ncykgewogICAgICAgIGluaXRfdWkoKTsKICAgICAgICBwb3B1bGF0ZV9pdGVtX2luZm8oJ3JhZGljYWwnKTsKICAgICAgICBwb3B1bGF0ZV9pdGVtX2luZm8oJ2thbmppJyk7CiAgICB9CgogICAgLy89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KICAgIC8vIFBvcHVsYXRlIGxldmVsIGluZm8gZnJvbSBBUEkuCiAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICAgIGZ1bmN0aW9uIHByb2Nlc3NfaXRlbXMoZGF0YSkgewogICAgICAgIGdvYmouaXRlbXMgPSB3a29mLkl0ZW1EYXRhLmdldF9pbmRleChkYXRhLCAnaXRlbV90eXBlJyk7CgogICAgICAgIHBvcHVsYXRlX2l0ZW1faW5mbygncmFkaWNhbCcpOwogICAgICAgIHBvcHVsYXRlX2l0ZW1faW5mbygna2FuamknKTsKICAgIH0KCiAgICAvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQogICAgLy8gR2VuZXJhdGUgY29udGVudCBmb3IgcG9wb3Zlci4KICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQogICAgZnVuY3Rpb24gZ2VuZXJhdGVfaXRlbV9pbmZvKCkgewogICAgICAgIC8vIFBvcHVsYXRlIHRoZSBuZ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gICAgICAgIHZhciByZWFkaW5nID0gaXRlbS5kYXRhLnJlYWRpbmdzLmZpbHRlcihwcmltYXJ5KS5zb3J0KGFjY2VwdGVkX2ZpcnN0KS5tYXAodG9fcmVhZGluZykuam9pbignLCAnKTsKICAgICAgICAgICAgaHRtbC5wdXNoKCc8c3BhbiBjbGFzcz0icmVhZGluZyIgbGFuZz0iamEiPicrcmVhZGluZysnPC9zcGFuPicpOwogICAgICAgIH0KCiAgICAgICAgLy8gU1JTIFN0YWdlCiAgICAgICAgaWYgKHNldHRpbmdzLnNob3dfc3JzICYmIGl0ZW0uYXNzaWdubWVudHMgJiYgaXRlbS5hc3NpZ25tZW50cy5zcnNfc3RhZ2VfbmFtZSkgewogICAgICAgICAgICBodG1sLnB1c2goJzxzcGFuIGNsYXNzPSJzcnMiPlNSUzogJytpdGVtLmFzc2lnbm1lbnRzLnNyc19zdGFnZV9uYW1lKyc8L3NwYW4+Jyk7CiAgICAgICAgfQoKICAgICAgICAvLyBQYXNzIERhdGUgYW5kIE5leHQgUmV2aWV3CiAgICAgICAgdmFyIG5leHQgPSBbXTsKICAgICAgICB2YXIgZGF0ZTsKICAgICAgICBpZiAoaXRlbS5hc3NpZ25tZW50cyAmJiBpdGVtLmFzc2lnbm1lbnRzLmF2YWlsYWJsZV9hdCkgewogICAgICAgICAgICBpZiAoaXRlbS5hc3NpZ25tZW50cy5wYXNzZWQpIHsKICAgICAgICAgICAgICAgIGlmIChzZXR0aW5ncy5zaG93X3Bhc3NlZCkgewogICAgICAgICAgICAgICAgICAgIGlmIChpdGVtLmFzc2lnbm1lbnRzLnBhc3NlZF9hdCkgewogICAgICAgICAgICAgICAgICAgICAgICBkYXRlID0gZm9ybWF0RGF0ZShuZXcgRGF0ZShpdGVtLmFzc2lnbm1lbnRzLnBhc3NlZF9hdCksIGZhbHNlIC8qIGlzX25leHRfZGF0ZSAqLyk7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgZGF0ZSA9ICdBIGxvbmcgdGltZSBhZ28uLi4nOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBuZXh0LnB1c2goJ1Bhc3NlZDogJytkYXRlKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoaXRlbS5hc3NpZ25tZW50cy5zcnNfc3RhZ2UgPT0gOSkgewogICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLnNob3dfcGFzc2VkKSB7CiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGZvcm1hdERhdGUobmV3IERhdGUoaXRlbS5hc3NpZ25tZW50cy5idXJuZWRfYXQpLCBmYWxzZSAvKiBpc19uZXh0X2RhdGUgKi8pOwogICAgICAgICAgICAgICAgICAgIG5leHQucHVzaCgnQnVybmVkOiAnK2RhdGUpOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBuZXh0LnB1c2goJ0J1cm5lZCEnKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBlbHNlIGlmIChzZXR0aW5ncy5zaG93X25leHRfcmV2aWV3KSB7CiAgICAgICAgICAgICAgICBkYXRlID0gZm9ybWF0RGF0ZShuZXcgRGF0ZShpdGVtLmFzc2lnbm1lbnRzLmF2YWlsYWJsZV9hdCksIHRydWUgLyogaXNfbmV4dF9kYXRlICovKTsKICAgICAgICAgICAgICAgIG5leHQucHVzaCgnTmV4dDogJytkYXRlKTsKICAgICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIG5leHQucHVzaCgnTG9ja2VkIScpOwogICAgICAgIH0KCiAgICAgICAgLy8gUG9wdWxhdGUgcmVtYWluaW5nIGRhdGEgZm9yIHBvcHVwIHdpbmRvdy4KICAgICAgICBpZiAobmV4dC5sZW5ndGggIT09IDApIHsKICAgICAgICAgICAgaHRtbC5wdXNoKCc8c3BhbiBjbGFzcz0ibmV4dCI+JytuZXh0Lmp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iAgICAgICAgICAgIGdyb3VwID0gJCgnLnByb2dyZXNzLWVudHJpZXMnKS5lcSgwKTsKICAgICAgICAgICAgZ3JvdXAuYXR0cignZGF0YS10eXBlJywncmFkaWNhbCcpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGdyb3VwID0gJCgnLnByb2dyZXNzLWVudHJpZXMnKS5lcSgxKTsKICAgICAgICAgICAgZ3JvdXAuYXR0cignZGF0YS10eXBlJywna2FuamknKTsKICAgICAgICB9CiAgICAgICAgZWxlbXMgPSBncm91cC5maW5kKCcucHJvZ3Jlc3MtZW50cnknKTsKICAgICAgICB2YXIgaXRlbXMgPSB3a29mLkl0ZW1EYXRhLmdldF9pbmRleChnb2JqLml0ZW1zW2l0eXBlXSwgJ3NsdWcnKTsKCiAgICAgICAgLy8gUG9wdWxhdGUgaXRlbSBkYXRhLgogICAgICAgIGVsZW1zLmVhY2goZnVuY3Rpb24oaWR4LCBlbGVtKXsKICAgICAgICAgICAgZWxlbSA9ICQoZWxlbSk7CiAgICAgICAgICAgIGVsZW0ucmVtb3ZlQXR0cigndGl0bGUnKTsKICAgICAgICAgICAgdmFyIGEgPSBlbGVtLmZpbmQoJ2EnKTsKICAgICAgICAgICAgdmFyIHNsdWc7CiAgICAgICAgICAgIGlmIChpdHlwZSA9PT0gJ3JhZGljYWwnKSB7CiAgICAgICAgICAgICAgICBzbHVnID0gYS5hdHRyKCdocmVmJykuc3BsaXQoJy8nKVsyXTsKICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgIHNsdWcgPSBhLnRleHQoKTsKICAgICAgICAgICAgfQogICAgICAgICAgICB2YXIgaXRlbSA9IGl0ZW1zW3NsdWddOwogICAgICAgICAgICBlbGVtLmRhdGEoJ2l0ZW0nLCBpdGVtKTsKCiAgICAgICAgICAgIGVsZW0uYWRkQ2xhc3MoJ2RwcC1wcm9ncmVzcycpOwoKICAgICAgICAgICAgLy8gUG9wdWxhdGUgJ2RhdGEtc3JzLWx2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KCk7CiAgICAgICAgdmFyIFlZID0gZC5nZXRGdWxsWWVhcigpLAogICAgICAgICAgICBNTSA9IGQuZ2V0TW9udGgoKSwKICAgICAgICAgICAgREQgPSBkLmdldERhdGUoKSwKICAgICAgICAgICAgaGggPSBkLmdldEhvdXJzKCksCiAgICAgICAgICAgIG1tID0gZC5nZXRNaW51dGVzKCksCiAgICAgICAgICAgIG9uZV9kYXkgPSAyNCo2MCo2MCoxMDAwOwoKICAgICAgICBpZiAoaXNfbmV4dF9kYXRlICYmIGQgPCBub3cpIHJldHVybiAiQXZhaWxhYmxlIE5vdyI7CiAgICAgICAgdmFyIHNhbWVfZGF5ID0gKChZWSA9PSBub3cuZ2V0RnVsbFllYXIoKSkgJiYgKE1NID09IG5vdy5nZXRNb250aCgpKSAmJiAoREQgPT0gbm93LmdldERhdGUoKSkgPyAxIDogMCk7CgogICAgICAgIC8vICAgIElmIHRvZGF5OiAgIlRvZGF5IDg6MTVwbSIKICAgICAgICAvLyAgICBvdGhlcndpc2U6ICJXZWQsIEFwciAxNSwgODoxNXBtIgogICAgICAgIGlmIChzYW1lX2RheSkgewogICAgICAgICAgICBzICs9ICdUb2RheSAnOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIHMgKz0gWydTdW4nLCdNb24nLCdUdWUnLCdXZWQnLCdUaHUnLCdGcmknLCdTYXQnXVtkLmdldERheSgpXSsnLCAnKwogICAgICAgICAgICAgICAgWydKYW4nLCdGZWInLCdNYXInLCdBcHInLCdNYXknLCdKdW4nLCdKdWwnLCdBdWcnLCdTZXAnLCdPY3QnLCdOb3YnLCdEZWMnXVtNTV0rJyAnK0REKycsICc7CiAgICAgICAgfQogICAgICAgIGlmIChzZXR0aW5ncy50aW1lX2Zvcm1hdCA9PT0gJzI0aG91cicpIHsKICAgICAgICAgICAgcyArPSAoJzAnK2hoKS5zbGljZSgtMikrJzonKygnMCcrbW0pLnNsaWNlKC0yKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzICs9ICgoKGhoKzExKSUxMikrMSkrJzonKygnMCcrbW0pLnNsaWNlKC0yKStbJ2FtJywncG0nXVtNYXRoLmZsb29yKGQuZ2V0SG91cnMoKS8xMildOwogICAgICAgIH0KCiAgICAgICAgLy8gQXBwZW5kICIoWCBkYXlzKSIuCiAgICAgICAgaWYgKGlzX25leHRfZGF0ZSAmJiAhc2FtZV9kYXkpIHsKICAgICAgICAgICAgdmFyIGRheXMgPSAoTWF0aC5mbG9vcigoZC5nZXRUaW1lKCktZC5nZXRUaW1lem9uZU9mZnNldCgpKjYwKjEwMDApL29uZV9kYXkpLU1hdGguZmxvb3IoKG5vdy5nZXRUaW1lKCktZC5nZXRUaW1lem9uZU9mZnNldCgpKjYwKjEwMDApL29uZV9kYXkpKTsKICAgICAgICAgICAgaWYgKGRheXMpIHMgKz0gJyAoJytkYXlzKycgZGF5JysoZGF5cz4xPydzJzonJykrJyknOwogICAgICAgIH0KCiAgICAgICAgcmV0dXJuIHM7CiAgICB9Cgp9KSh3aW5kb3cuZHBwKTsK"},{"name":"Replace Text","options":{"check_for_updates":false,"comment":null,"compat_foreach":false,"compat_metadata":false,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1570721213155,"data":{}},"enabled":false,"position":25,"uuid":"ada1e30c-e7af-4950-af97-01317d5b1849","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBSZXBsYWNlIFRleHQKLy8gQG5hbWVzcGFjZSAgICBodHRwczovL2FrYW1hcnUuZGUvCi8vIEB2ZXJzaW9uICAgICAgMC4xCi8vIEBkZXNjcmlwdGl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gICAgICAgICAgICBuZXcgUmVnRXhwKHVzZXJSZWdleHBbMV0sICdnJykKICAgICAgICAgICAgICAgICk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByZWdleHMucHVzaCgKICAgICAgICAgICAgICAgICAgICBuZXcgUmVnRXhwKHByZXBhcmVSZWdleCh3b3JkKS5yZXBsYWNlKC9cXD9cKi9nLCBmdW5jdGlvbiAoZnVsbE1hdGNoKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmdWxsTWF0Y2ggPT09ICdcXConID8gJyonIDogJ1teIF0qJzsKICAgICAgICAgICAgICAgICAgICB9KSwgJ2cnKQogICAgICAgICAgICAgICAgKTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLy8gYWRkIHRoZSByZXBsYWNlbWVudAogICAgICAgICAgICByZXBsYWNlbWVudHMucHVzaCggd29yZHNbd29yZF0gKTsKICAgICAgICB9CiAgICB9CgogICAgLy8gZG8gdGhlIHJlcGxhY2VtZW50CiAgICB0ZXh0cyA9IGRvY3VtZW50LmV2YWx1YXRlKCcvL2JvZHkvL3RleHQoKVsgbm9ybWFsaXplLXNwYWNlKC4pICE9ICIiIF0nLCBkb2N1bWVudCwgbnVsbCwgNiwgbnVsbCk7CiAgICBmb3IgKGkgPSAwOyB0ZXh0ID0gdGV4dHMuc25hcHNob3RJdGVtKGkpOyBpICs9IDEpIHsKICAgICAgICBpZiAoIGlzVGFnT2sodGV4dC5wYXJlbnROb2RlLnRhZ05hbWUpICkgewogICAgICAgICAgICByZWdleHMuZm9yRWFjaChmdW5jdGlvbiAodmFsdWUsIGluZGV4KSB7CiAgICAgICAgICAgICAgICB0ZXh0LmRhdGEgPSB0ZXh0LmRhdGEucmVwbGFjZSggdmFsdWUsIHJlcGxhY2VtZW50c1tpbmRleF0gKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfQoKfSgpKTs="},{"name":"Youtube Peek Preview","options":{"check_for_updates":true,"comment":null,"compat_foreach":false,"compat_metadata":false,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":["https://twitter.com/*"],"orig_includes":[],"orig_matches":["*://*/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1571246066949,"data":{"userSettings":"s{\"regions\":[\"DE\"],\"noTooltip\":true,\"allowOnYoutube\":false}"}},"enabled":true,"position":26,"file_url":"https://greasyfork.org/scripts/370755-youtube-peek-preview/code/Youtube%20Peek%20Preview.user.js","uuid":"08dff494-f978-49b2-a69c-1ceff99b0120","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBZb3V0dWJlIFBlZWsgUHJldmlldwovLyBAbmFtZXNwYWNlICAgIGh0dHA6Ly90YW1wZXJtb25rZXkubmV0LwovLyBAdmVyc2lvbiAgICAgIDAuMi4zCi8vIEBkZXNjcmlwdGlvbiAgU2VlIHZpZGVvIHRodW1ibmFpbHMsIHJhdGluZ3MgYW5kIG90aGVyIGRldGFpbHMgd2hlbiB5b3UgbW91c2Ugb3ZlciBhIFlvdXR1YmUgbGluayBmcm9tIGFsbW9zdCBhbnkgd2Vic2l0ZQovLyBAYXV0aG9yICAgICAgIHNjcmlwdHBvc3QKLy8gQG1hdGNoICAgICAgICAqOi8vKi8qCi8vIEBleGNsdWRlICAgICAgaHR0cHM6Ly90d2l0dGVyLmNvbS8qCi8vIEBncmFudCAgICAgICAgR01fc2V0VmFsdWUKLy8gQGdyYW50ICAgICAgICBHTV9nZXRWYWx1ZQovLyBAZ3JhbnQgICAgICAgIEdNX2RlbGV0ZVZhbHVlCi8vIEBncmFudCAgICAgICAgR01fcmVnaXN0ZXJNZW51Q29tbWFuZAovLyA9PS9Vc2VyU2N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NhdGlvbkhUTUw7CiAgICAgICAgfQogICAgICAgIC8vIFVUSUxJVFkgRlVOQ1RJT05TCiAgICAgICAgLyoqCiAgICAgICAgICogUmV0dXJuIHRoZSBjdXJyZW50IHN0eWxlIGZvciBhbiBlbGVtZW50LgogICAgICAgICAqIEBwYXJhbSB7SFRNTEVsZW1lbnR9IGVsZW0gVGhlIGVsZW1lbnQgdG8gY29tcHV0ZS4KICAgICAgICAgKiBAcGFyYW0ge3N0cmluZ30gcHJvcCBUaGUgc3R5bGUgcHJvcGVydHkuCiAgICAgICAgICogQHJldHVybnMge251bWJlcn0KICAgICAgICAgKi8KICAgICAgICBmdW5jdGlvbiBjb21wdXRlU3R5bGUoZWxlbSwgcHJvcCkgewogICAgICAgICAgICBpZiAoIXdpbi5nZXRDb21wdXRlZFN0eWxlKSB7CiAgICAgICAgICAgICAgICB3aW4uZ2V0Q29tcHV0ZWRTdHlsZSA9IGZ1bmN0aW9uIChlbCwgcHNldWRvKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5lbCA9IGVsOwogICAgICAgICAgICAgICAgICAgIHRoaXMuZ2V0UHJvcGVydHlWYWx1ZSA9IGZ1bmN0aW9uIChwcm9wKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZSA9IC8oXC0oW2Etel0pezF9KS9nOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJvcCA9PSAnZmxvYXQnKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcCA9ICdzdHlsZUZsb2F0JzsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlLnRlc3QocHJvcCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3AgPSBwcm9wLnJlcGxhY2UocmUsIGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJndW1lbnRzWzJdLnRvVXBwZXJDYXNlKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZWwuY3VycmVudFN0eWxlICYmIGVsLmN1cnJlbnRTdHlsZVtwcm9wXSA/IGVsLmN1cnJlbnRTdHlsZVtwcm9wXSA6IG51bGw7CiAgICAgICAgICAgICAgICAgICAgfTsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpczsKICAgICAgICAgICAgICAgIH07CiAgICAgICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIHdpbi5nZXRDb21wdXRlZFN0eWxlKGVsZW0sIG51bGwpLmdldFByb3BlcnR5VmFsdWUocHJvcCk7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIFJldHVybnMgdGhlIG1heGltdW0gbnVtYmVyIG9mIGxpbmVzIG9mIHRleHQgdGhhdCBzaG91bGQgYmUgcmVuZGVyZWQgYmFzZWQKICAgICAgICAgKiBvbiB0aGUgY3VycmVudCBoZWlnaHQgb2YgdGhlIGVsZW1lbnQgYW5kIHRoZSBsaW5lLWhlaWdodCBvZiB0aGUgdGV4dC4KICAgICAgICAgKi8KICAgICAgICBmdW5jdGlvbiBnZXRNYXhMaW5lcyhoZWlnaHQpIHsKICAgICAgICAgICAgdmFyIGF2YWlsSGVpZ2h0ID0gaGVpZ2h0IHx8IGVsZW1lbnQuY2xpZW50SGVpZ2h0LCBsaW5lSGVpZ2h0ID0gZ2V0TGluZUhlaWdodChlbGVtZW50KTsKICAgICAgICAgICAgcmV0dXJuIE1hdGgubWF4KE1hdGguZmxvb3IoYXZhaWxIZWlnaHQgLyBsaW5lSGVpZ2h0KSwgMCk7CiAgICAgICAgfQogICAgICAgIC8qKgogICAgICAgICAqIFJldHVybnMgdGhlIG1heGltdW0gaGVpZ2h0IGEgZ2l2ZW4gZWxlbWVudCBzaG91bGQgaGF2ZSBiYXNlZCBvbiB0aGUgbGluZS0KICAgICAgICAgKiBoZWlnaHQgb2YgdGhlIHRleHQgYW5kIHRoZSBn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AgICB9CiAgICAgICAgICAgIC8vVGhpcyBpcyB0aGUgbGFzdCBjaGlsZCB3ZSB3YW50LCByZXR1cm4gaXQKICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gZWxlbS5sYXN0Q2hpbGQ7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgLyoqCiAgICAgICAgICogUmVtb3ZlcyBvbmUgY2hhcmFjdGVyIGF0IGEgdGltZSBmcm9tIHRoZSB0ZXh0IHVudGlsIGl0cyB3aWR0aCBvcgogICAgICAgICAqIGhlaWdodCBpcyBiZW5lYXRoIHRoZSBwYXNzZWQtaW4gbWF4IHBhcmFtLgogICAgICAgICAqLwogICAgICAgIGZ1bmN0aW9uIHRydW5jYXRlKHRhcmdldCwgbWF4SGVpZ2h0KSB7CiAgICAgICAgICAgIGlmICghbWF4SGVpZ2h0KSB7CiAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAqIFJlc2V0cyBnbG9iYWwgdmFyaWFibGVzLgogICAgICAgICAgICAgKi8KICAgICAgICAgICAgZnVuY3Rpb24gcmVzZXQoKSB7CiAgICAgICAgICAgICAgICBzcGxpdE9uQ2hhcnMgPSBvcHQuc3BsaXRPbkNoYXJzLnNsaWNlKDApOwogICAgICAgICAgICAgICAgc3BsaXRDaGFyID0gc3BsaXRPbkNoYXJzWzBdOwogICAgICAgICAgICAgICAgY2h1bmtzID0gbnVsbDsKICAgICAgICAgICAgICAgIGxhc3RDaHVuayA9IG51bGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIG5vZGVWYWx1ZSA9IHRhcmdldC5ub2RlVmFsdWUucmVwbGFjZShvcHQudHJ1bmNhdGlvbkNoYXIsICcnKTsKICAgICAgICAgICAgLy9HcmFiIHRoZSBuZXh0IGNodW5rcwogICAgICAgICAgICBpZiAoIWNodW5rcykgewogICAgICAgICAgICAgICAgLy9JZiB0aGVyZSBhcmUgbW9yZSBjaGFyYWN0ZXJzIHRvIHRyeSwgZ3JhYiB0aGUgbmV4dCBvbmUKICAgICAgICAgICAgICAgIGlmIChzcGxpdE9uQ2hhcnMubGVuZ3RoID4gMCkgewogICAgICAgICAgICAgICAgICAgIHNwbGl0Q2hhciA9IHNwbGl0T25DaGFycy5zaGlmdCgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy9ObyBjaGFyYWN0ZXJzIHRvIGNodW5rIGJ5LiBHbyBjaGFyYWN0ZXItYnktY2hhcmFjdGVyCiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBzcGxpdENoYXIgPSAnJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNodW5rcyA9IG5vZGVWYWx1ZS5zcGxpdChzcGxpdENoYXIpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vSWYgdGhlcmUgYXJlIGNodW5rcyBsZWZ0IHRvIHJlbW92ZSwgcmVtb3ZlIHRoZSBsYXN0IG9uZSBhbmQgc2VlIGlmCiAgICAgICAgICAgIC8vIHRoZSBub2RlVmFsdWUgZml0cy4KICAgICAgICAgICAgaWYgKGNodW5rcy5sZW5ndGggPiAxKSB7CiAgICAgICAgICAgICAgICAvLyBjb25zb2xlLmxvZygnY2h1bmtzJywgY2h1bmtzKTsKICAgICAgICAgICAgICAgIGxhc3RDaHVuayA9IGNodW5rcy5wb3AoKTsKICAgICAgICAgICAgICAgIC8vIGNvbnNvbGUubG9nKCdsYXN0Q2h1bmsnLCBsYXN0Q2h1bmspOwogICAgICAgICAgICAgICAgYXBwbHlFbGxpcHNpcyh0YXJnZXQsIGNodW5rcy5qb2luKHNwbGl0Q2hhcikpOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vTm8gbW9yZSBjaHVua3MgY2FuIGJlIHJlbW92ZWQgdXNpbmcgdGhpcyBjaGFyYWN0ZXIKICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICBjaHVua3MgPSBudWxsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vSW5zZXJ0IHRoZSBjdXN0b20gSFRNTCBiZWZvcmUgdGhlIHRydW5jYXRpb24gY2hhcmFjdGVyCiAgICAgICAgICAgIGlmICh0cnVuY2F0aW9uSFRNTENvbnRhaW5lcikgewogICAgICAgICAgICAgICAgdGFyZ2V0Lm5vZGVWYWx1ZSA9IHRhcmdldC5ub2RlVmFsdWUucmVwbGFjZShvcHQudHJ1bmNhdGlvbkNoYXIsICcnKTsKICAgICAgICAgICAgICAgIGVsZW1lbnQuaW5uZXJIVE1MID0gdGFyZ2V0Lm5vZGVWYWx1ZSArICcgJyArIHRydW5jYXRpb25IVE1MQ29udGFpbmVyLmlubmVySFRNTCArIG9wdC50cnVuY2F0aW9uQ2hhcjsKICAgICAgICAgICAgfQogICAgICAgICAgICAvL1NlYXJjaCBwcm9kdWNlZCB2YWxpZCBjaHVua3MKICAgICAgICAgICAgaWYgKGNodW5rcykgewogICAgICAgICAgICAgICAgLy9JdCBmaXRzCiAgICAgICAgICAgICAgICBpZiAoZWxlbWVudC5jbGllbnRIZWlnaHQgPD0gbWF4SGVpZ2h0KSB7CiAgICAgICAgICAgICAgICAgICAgLy9UaGVyZSdzIHN0aWxsIG1vcmUgY2hhcmFjdGVycyB0byB0cnkgc3BsaXR0aW5nIG9uLCBub3QgcXVpdGUgZG9uZSB5ZXQKICAgICAgICAgICAgICAgICAgICBpZiAoc3BsaXRPbkNoYXJzLmxlbmd0aCA+PSAwICYmIHNwbGl0Q2hhciAhPSAnJykgewogICAgICAgICAgICAgICAgICAgICAgICBhcHBseUVsbGlwc2lzKHRhcmdldCwgY2h1bmtzLmpvaW4oc3BsaXRDaGFyKSArIHNwbGl0Q2hhciArIGxhc3RDaHVuayk7CiAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rcyA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIC8vRmluaXNoZWQhCiAgICAgICAgICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBlbGVtZW50LmlubmVySFRNTDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy9ObyB2YWxpZCBjaHVua3MgcHJvZHVjZWQKICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICAvL05vIHZhbGlkIGNodW5rcyBldmVuIHdoZW4gc3BsaXR0aW5nIGJ5IGxldHRlciwgdGltZSB0byBtb3ZlCiAgICAgICAgICAgICAgICAvL29uIHRvIHRoZSBuZXh0IG5vZGUKICAgICAgICAgICAgICAgIGlmIChzcGxpdENoYXIgPT0gJycpIHsKICAgICAgICAgICAgICAgICAgICBhcHBseUVsbGlwc2lzKHRhcmdldCwgJycpOwogICAgICAgICAgICAgICAgICAgIHRhcmdldCA9IGdldExhc3RDaGlsZChlbGVtZW50KTsKICAgICAgICAgICAgICAgICAgICByZXNldCgpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIC8vSWYgeW91IGdldCBoZXJlIGl0IG1lYW5zIHN0aWxsIHRvbyBiaWcsIGxldCdzIGtlZXAgdHJ1bmNhdGluZwogICAgICAgICAgICBpZiAob3B0LmFuaW1hdGUpIHsKICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHRydW5jYXRlKHRhcmdldCwgbWF4SGVpZ2h0KTsKICAgICAgICAgICAgICAgIH0sIG9wdC5hbmltYXRlID09PSB0cnVlID8gMTAgOiBvcHQuYW5pbWF0ZSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1bmNhdGUodGFyZ2V0LCBtYXhIZWlnaHQpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGZ1bmN0aW9uIGFwcGx5RWxsaXBzaXMoZWxlbSwgc3RyKSB7CiAgICAgICAgICAgIGVsZW0ubm9kZVZhbHVlID0gc3RyICsgb3B0LnRydW5jYXRpb25DaGFyOwogICAgICAgIH0KICAgICAgICAvLyBDT05TVFJVQ1RPUgogICAgICAgIGlmIChjbGFtcFZhbHVlID09ICdhdXRvJykgewogICAgICAgICAgICBjbGFtcFZhbHVlID0gZ2V0TWF4TGluZXMoKTsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZiAoaXNDU1NWYWx1ZSkgewogICAgICAgICAgICBjbGFtcFZhbHVlID0gZ2V0TWF4TGluZXMocGFyc2VJbnQoY2xhbXBWYWx1ZSkpOwogICAgICAgIH0KICAgICAgICB2YXIgY2xhbXBlZFRleHQ7CiAgICAgICAgaWYgKHN1cHBvcnRzTmF0aXZlQ2xhbXAgJiYgb3B0LnVzZU5hdGl2ZUNsYW1wKSB7CiAgICAgICAgICAgIHN0eS5vdmVyZmxvdyA9ICdoaWRkZW4nOwogICAgICAgICAgICBzdHkudGV4dE92ZXJmbG93ID0gJ2VsbGlwc2lzJzsKICAgICAgICAgICAgc3R5LndlYmtpdEJveE9yaWVudCA9ICd2ZXJ0aWNhbCc7CiAgICAgICAgICAgIHN0eS5kaXNwbGF5ID0gJy13ZWJraXQtYm94JzsKICAgICAgICAgICAgc3R5LndlYmtpdExpbmVDbGFtcCA9IGNsYW1wVmFsdWU7CiAgICAgICAgICAgIGlmIChpc0NTU1ZhbHVlKSB7CiAgICAgICAgICAgICAgICBzdHkuaGVpZ2h0ID0gb3B0LmNsYW1wICsgJ3B4JzsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgdmFyIGhlaWdodCA9IGdldE1heEhlaWdodChjbGFtcFZhbHVlKTsKICAgICAgICAgICAgaWYgKGhlaWdodCA8PSBlbGVtZW50LmNsaWVudEhlaWdodCkgewogICAgICAgICAgICAgICAgY2xhbXBlZFRleHQgPSB0c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9zdCk7CiAgICB9CiAgICBmdW5jdGlvbiBoYW5kbGVNb3VzZU92ZXIoZXYpIHsKICAgICAgICBsZXQgdGFyZ2V0ID0gZXYudGFyZ2V0OwogICAgICAgIHRhcmdldCA9IHRhcmdldC5jbG9zZXN0KCdhJyk7CiAgICAgICAgaWYgKCF0YXJnZXQpCiAgICAgICAgICAgIHJldHVybjsKICAgICAgICBsZXQgaHJlZiA9IHRhcmdldC5ocmVmOwogICAgICAgIGlmICghaHJlZikKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIC8vIFNvbWUgc2l0ZXMgcHV0IHRoZSBVUkwgaW4gYSBkYXRhc2V0LiAobm90ZTogdHdpdHRlciBibG9ja3MgZ29vZyBBUEkpCiAgICAgICAgaWYgKHNpdGUoJ3R3aXR0ZXIuY29tJykpIHsKICAgICAgICAgICAgY29uc3QgZGF0YVVybCA9IHRhcmdldC5kYXRhc2V0LmV4cGFuZGVkVXJsOwogICAgICAgICAgICBpZiAoZGF0YVVybCkKICAgICAgICAgICAgICAgIGhyZWYgPSBkYXRhVXJsOwogICAgICAgIH0KICAgICAgICAvLyBDaGVjayBpZiB0aGUgVVJMIGdvZXMgdG8gYSB5b3V0dWJlIHZpZGVvLgogICAgICAgIGlmICghcmUuaXNWaWRlb0xpbmsudGVzdChocmVmKSkKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgIC8vIE5lZWQgdG8ga25vdyBpZiBpdCdzIGFuIGF0dHJpYnV0aW9uIGxpbmsgc28gd2UgY2FuIHJlYWQgdGhlIGVuY29kZWQgcGFyYW1zLgogICAgICAgIGlmICgvYXR0cmlidXRpb25fbGlua1w/L2kudGVzdChocmVmKSkgewogICAgICAgICAgICBjb25zdCBVUklDb21wb25lbnQgPSBocmVmLnN1YnN0cihocmVmLmluZGV4T2YoJyUyRndhdGNoJTNGdiUzRCcpKTsKICAgICAgICAgICAgaWYgKGNvbnRhaW5zRW5jb2RlZENvbXBvbmVudHMoVVJJQ29tcG9uZW50KSkgewogICAgICAgICAgICAgICAgaHJlZiA9ICdodHRwczovL3d3dy55b3V0dWJlLmNvbScgKyBkZWNvZGVVUklDb21wb25lbnQoVVJJQ29tcG9uZW50KTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAvLyBGaW5hbGx5IGdldCB0aGUgdmlkZW8gSUQ7CiAgICAgICAgY29uc3QgaWQgPSByZS5nZXRWaWRlb0lkLmV4ZWMoaHJlZilbMV07CiAgICAgICAgaWYgKCFpZCkKICAgICAgICAgICAgcmV0dXJuIGNvbnNvbGUuZXJyb3IoJ0ludmFsaWQgdmlkZW8gSUQnKTsKICAgICAgICB3aW5kb3cuY2xlYXJUaW1lb3V0KHRtb19vcGVuKTsKICAgICAgICB3aW5kb3cuY2xlYXJUaW1lb3V0KHRtb19jbG9zZSk7CiAgICAgICAgY29uc3Qgbm9Ub29sdGlwID0gSlNPTi5wYXJzZShHTV9nZXRWYWx1ZSgndXNlclNldHRpbmdzJywgSlNPTi5zdHJpbmdpZnkoREVGQVVMVF9PUFRJT05TKSkpLm5vVG9vbHRpcDsKICAgICAgICBpZiAobm9Ub29sdGlwKSB7CiAgICAgICAgICAgIHRhcmdldC5yZW1vdmVBdHRyaWJ1dGUoJ3RpdGxlJyk7CiAgICAgICAgfQogICAgICAgIHRtb19vcGVuID0gd2luZG93LnNldFRpbWVvdXQoKCkgPT4gewogICAgICAgICAgICBpZiAoIWNhY2hlLmhhc093blByb3BlcnR5KGlkKSkgewogICAgICAgICAgICAgICAgY29uc3QgcGFydHMgPSAnc25pcHBldCxjb250ZW50RGV0YWlscyxzdGF0aXN0aWNzJzsKICAgICAgICAgICAgICAgIHJlcXVlc3RWaWRlb0RhdGEoZXYsIGlkLCBwYXJ0cyk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICBoYW5kbGVTdWNjZXNzKGV2LCBpZCwgY2FjaGVbaWRdKTsKICAgICAgICAgICAgfQogICAgICAgIH0sIGRlbGF5X29wZ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W5jdGlvbiB0b0RpZ2l0YWxUaW1lKHN0cikgewogICAgICAgIGlmICghc3RyKQogICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkOwogICAgICAgIGZ1bmN0aW9uIHBhZChzKSB7CiAgICAgICAgICAgIHJldHVybiBzLmxlbmd0aCA8IDIgPyBgMCR7c31gIDogczsKICAgICAgICB9CiAgICAgICAgY29uc3QgaG91cnMgPSAvKFxkKylILy5leGVjKHN0cik7CiAgICAgICAgY29uc3QgbWlucyA9IC8oXGQrKU0vLmV4ZWMoc3RyKTsKICAgICAgICBjb25zdCBzZWNzID0gLyhcZCspUy8uZXhlYyhzdHIpOwogICAgICAgIGNvbnN0IG91dHB1dCA9IFtdOwogICAgICAgIGlmIChob3VycykKICAgICAgICAgICAgb3V0cHV0LnB1c2gocGFkKGhvdXJzWzFdKSk7CiAgICAgICAgb3V0cHV0LnB1c2gobWlucyA/IHBhZChtaW5zWzFdKSA6ICcwMCcpOwogICAgICAgIG91dHB1dC5wdXNoKHNlY3MgPyBwYWQoc2Vjc1sxXSkgOiAnMDAnKTsKICAgICAgICByZXR1cm4gb3V0cHV0LmpvaW4oJzonKTsKICAgIH0KICAgIGZ1bmN0aW9uIGluc2VydFBlZWtCb3goZXYsIGQpIHsKICAgICAgICBjb25zdCBhID0gZXYudGFyZ2V0OwogICAgICAgIGNvbnN0IHNldHRpbmdzID0gSlNPTi5wYXJzZShHTV9nZXRWYWx1ZSgndXNlclNldHRpbmdzJywgSlNPTi5zdHJpbmdpZnkoREVGQVVMVF9PUFRJT05TKSkpOwogICAgICAgIC8vIFRva2VuczoKICAgICAgICBjb25zdCB0aXRsZSA9IGQuc25pcHBldC5sb2NhbGl6ZWQudGl0bGU7CiAgICAgICAgY29uc3QgZGVzYyA9IGQuc25pcHBldC5sb2NhbGl6ZWQuZGVzY3JpcHRpb247CiAgICAgICAgY29uc3QgZGF0ZSA9IGRhdGVBc0FnZShkLnNuaXBwZXQucHVibGlzaGVkQXQpOwogICAgICAgIGNvbnN0IGNoYW4gPSBkLnNuaXBwZXQuY2hhbm5lbFRpdGxlOwogICAgICAgIGNvbnN0IHRodW1icyA9IGQuc25pcHBldC50aHVtYm5haWxzOwogICAgICAgIGNvbnN0IGltYWdlUGF0aCA9IHRodW1icy5oYXNPd25Qcm9wZXJ0eSgnbWVkaXVtJykgPyB0aHVtYnMubWVkaXVtLnVybCA6IHVuZGVmaW5lZDsKICAgICAgICBsZXQgYmxvY2tNYXRjaGVkID0gW107CiAgICAgICAgbGV0IGJsb2NrT3RoZXIgPSBbXTsKICAgICAgICBpZiAoc2V0dGluZ3MucmVnaW9ucy5sZW5ndGggJiYgZC5jb250ZW50RGV0YWlscy5oYXNPd25Qcm9wZXJ0eSgncmVnaW9uUmVzdHJpY3Rpb24nKSkgewogICAgICAgICAgICBjb25zdCBibG9ja2VkID0gZC5jb250ZW50RGV0YWlscy5yZWdpb25SZXN0cmljdGlvbi5ibG9ja2VkOwogICAgICAgICAgICBpZiAoYmxvY2tlZCkgewogICAgICAgICAgICAgICAgYmxvY2tNYXRjaGVkID0gYmxvY2tlZC5maWx0ZXIodiA9PiBzZXR0aW5ncy5yZWdpb25zLmluY2x1ZGVzKHYpKS5tYXAodiA9PiBgPGVtPiR7dn08L2VtPmApOwogICAgICAgICAgICAgICAgYmxvY2tPdGhlciA9IGJsb2NrZWQuZmlsdGVyKHYgPT4gIXNldHRpbmdzLnJlZ2lvbnMuaW5jbHVkZXModikpOwogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGNvbnN0IHZpZXdDb3VudCA9ICtkLnN0YXRpc3RpY3Mudmlld0NvdW50OwogICAgICAgIGNvbnN0IHZpZXdzID0gdmlld0NvdW50ID8gdmlld0NvdW50LnRvTG9jYWxlU3RyaW5nKCkgOiB1bmRlZmluZWQ7CiAgICAgICAgY29uc3Qgc2NvcmUgPSBnZXRTY29yZVBlcmNlbnQoK2Quc3RhdGlzdGljcy5saWtlQ291bnQsICtkLnN0YXRpc3RpY3MuZGlzbGlrZUNvdW50KTsKICAgICAgICBjb25zdCBsZW5ndGggPSB0b0RpZ2l0YWxUaW1lKGQuY29udGVudERldGFpbHMuZHVyYXRpb24pOwogICAgICAgIGxvYWRJbWFnZShpbWFnZVBhdGgpLnRoZW4oaW1nID0+IHsKICAgICAgICAgICAgZmluaXNoZWRMb2FkaW5nKCk7CiAgICAgICAgICAgIGlmICghaW1nKQogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICBpbWcuc2V0QXR0cmlidXRlKCdhbHQnLCB0aXRsZSk7CiAgICAgICAgICAgIGNvbnRhaW5lci5xdWVyeVNlbGVjdG9yKCcueXQtcGVlay10aHVtYicpLmFwcGVuZENoaWxkKGltZyk7CiAgICAgICAgICAgIHdpbmRvdy5zZXRUaW1lb3V0KCgpID0+IHsKICAgICAgICAgICAgICAgIGltZy5jbGFzc0xpc3QuYWRkKCd5dC1wZWVrLXJlYWR5Jyk7CiAgICAgICAgICAgIH0sIDcwKTsKICAgICAgICB9KTsKICAgICAgICAvLyBDcmVhdGUgSFRNTDoKICAgICAgICBjb25zdCBjb250YWluZXIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdkaXYnKTsKICAgICAgICBjb250YWluZXIuaW5uZXJIVE1MID0gYAogICAgPGRpdiBjbGFzcz0ieXQtcGVlay1jb2xzIj4KICAgICAgPGRpdiBjbGFzcz0ieXQtcGVlay1pbmZvIj4KICAgICAgICA8ZGl2IGNsYXNzPSJ5dC1wZWVrLXJvdyI+CiAgICAgICAgICA8ZGl2IGNsYXNzPSJ5dC1wZWVrLXZpZXdzIj4ke3ZpZXdzID8gdmlld3MgKyAnIHZpZXdzJyA6ICcnfTwvZGl2PgogICAgICAgICAgPGRpdiBjbGFzcz0ieXQtcGVlay1kYXRlIj4ke2RhdGUgPyBkYXRlIDogJyd9PC9kaXY+CiAgICAgICAgPC9kaXY+CiAgICAgICAgPGRpdiBjbGFzcz0ieXQtcGVlay10aXRsZSI+JHt0aXRsZSA/IHRp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0IGVsZW1lbnRzID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSgneXQtcGVlay1sb2FkaW5nJyk7CiAgICAgICAgZm9yIChjb25zdCBlbGVtZW50IG9mIGVsZW1lbnRzKSB7CiAgICAgICAgICAgIGVsZW1lbnQuY2xhc3NMaXN0LnJlbW92ZSgneXQtcGVlay1yZWFkeScpOwogICAgICAgICAgICB3aW5kb3cuc2V0VGltZW91dCgoKSA9PiB7CiAgICAgICAgICAgICAgICBlbGVtZW50LnJlbW92ZSgpOwogICAgICAgICAgICB9LCAyNTApOwogICAgICAgIH0KICAgIH0KICAgIGZ1bmN0aW9uIGhhbmRsZVN1Y2Nlc3MoZXYsIGlkLCBkKSB7CiAgICAgICAgcmVtb3ZlUGVla0JveGVzKCk7CiAgICAgICAgaWYgKCFkKSB7CiAgICAgICAgICAgIGQgPSB7fTsKICAgICAgICAgICAgZC5pZCA9IGlkOwogICAgICAgICAgICBkLmNvbnRlbnREZXRhaWxzID0gewogICAgICAgICAgICAgICAgZHVyYXRpb246IHVuZGVmaW5lZAogICAgICAgICAgICB9OwogICAgICAgICAgICBkLnNuaXBwZXQgPSB7CiAgICAgICAgICAgICAgICBjaGFubmVsVGl0bGU6ICcnLAogICAgICAgICAgICAgICAgdGh1bWJuYWlsczogeyBtZWRpdW06IHsgdXJsOiB1bmRlZmluZWQgfSB9LAogICAgICAgICAgICAgICAgbG9jYWxpemVkOiB7CiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHVuZGVmaW5lZCwKICAgICAgICAgICAgICAgICAgICBkZXNjcmlwdGlvbjogYFRoZSB2aWRlbyBtaWdodCBiZSByZW1vdmVkLmAKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBwdWJsaXNoZWRBdDogdW5kZWZpbmVkCiAgICAgICAgICAgIH07CiAgICAgICAgICAgIGQuc3RhdGlzdGljcyA9IHt9OwogICAgICAgIH0KICAgICAgICBpbnNlcnRQZWVrQm94KGV2LCBkKTsKICAgICAgICBpZiAoIWNhY2hlLmhhc093blByb3BlcnR5KGlkKSkKICAgICAgICAgICAgY2FjaGVbaWRdID0gZDsKICAgIH0KICAgIGZ1bmN0aW9uIHJlcXVlc3RWaWRlb0RhdGEoZXYsIGlkLCBwYXJ0cykgewogICAgICAgIHN0YXJ0ZWRMb2FkaW5nKGV2KTsKICAgICAgICBjb25zdCB4aHIgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTsKICAgICAgICB4aHIub3BlbignR0VUJywgYGh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL3lvdXR1YmUvdjMvdmlkZW9zP2lkPSR7aWR9JnBhcnQ9JHtwYXJ0c30ma2V5PSR7YXBpS2V5fWApOwogICAgICAgIHhoci5vbnJlYWR5c3RhdGVjaGFuZ2UgPSBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgIGlmICh4aHIucmVhZHlTdGF0ZSA9PT0gNCkgewogICAgICAgICAgICAgICAgZmluaXNoZWRMb2FkaW5nKCk7CiAgICAgICAgICAgICAgICBpZiAoIXRtb19vcGVuKQogICAgICAgICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgICAgIGlmICgheGhyLnJlc3BvbnNlVGV4dC5sZW5ndGgpCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgY29uc3QgcmVzcG9uc2UgPSBKU09OLnBhcnNlKHhoci5yZXNwb25zZVRleHQpOwogICAgICAgICAgICAgICAgaWYgKHhoci5zdGF0dXMgPT09IDIwMCkgewogICAgICAgICAgICAgICAgICAgIGhhbmRsZVN1Y2Nlc3MoZXYsIGlkLCByZXNwb25zZS5pdGVtc1swXSk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAvLyBoYW5kbGVFcnJvcigpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgICAgICBmaW5pc2hlZExvYWRpbmcoKTsKICAgICAgICAgICAgfQogICAgICAgIH07CiAgICAgICAgeGhyLnNlbmQoKTsKICAgIH0KICAgIGZ1bmN0aW9uIGRhdGVBc0FnZShpbnB1dFZhbHVlKSB7CiAgICAgICAgaWYgKCFpbnB1dFZhbHVlKQogICAgICAgICAgICByZXR1cm4gdW5kZWZpbmVkOwogICAgICAgIGxldCBkYXRlID0gbmV3IERhdGUoaW5wdXRWYWx1ZSk7CiAgICAgICAgY29uc3QgZGlmZmVyZW5jZSA9IG5ldyBEYXRlKG5ldyBEYXRlKCkudmFsdWVPZigpIC0gZGF0ZS52YWx1ZU9mKCkpOwogICAgICAgIGxldCB5ID0gcGFyc2VJbnQoZGlmZmVyZW5jZS50b0lTT1N0cmluZygpLnNsaWNlKDAsIDQpLCAxMCkgLSAxOTcwOwogICAgICAgIGxldCBtID0gK2RpZmZlcmVuY2UuZ2V0TW9udGgoKTsKICAgICAgICBsZXQgZCA9IGRpZmZlcmVuY2UuZ2V0RGF0ZSgpIC0gMTsKICAgICAgICBsZXQgcmVzdWx0OwogICAgICAgIGlmICh5ID4gMCkKICAgICAgICAgICAgcmVzdWx0ID0gKHkgPT09IDEpID8geSArICcgeWVhciBhZ28nIDogeSArICcgeWVhcnMgYWdvJzsKICAgICAgICBlbHNlIGlmIChtID4gMCkKICAgICAgICAgICAgcmVzdWx0ID0gKG0gPT09IDEpID8gbSArICcgbW9udGggYWdvJyA6IG0gKyAnIG1vbnRocyBhZ28nOwogICAgICAgIGVsc2UgaWYgKGQgPiAwKSB7CiAgICAgICAgICAgIHJlc3VsdCA9IChkID09PSAxKSA/IGQgKyAnIGRheSBhZ28nIDogZCArICcgZGF5cyBhZ28nOwogICAgICAgIH0KICAgICAgICBlbHNlIHsKICAgICAgICAgICAgcmVzdWx0ID0gJ1RvZGF5JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIHJlc3VsdDsKICAgIH0KICAgIC8qKgogICAgICoKICAgICAqIE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ICAgY29uc3QgYWxsb3dPbllvdXR1YmUgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgneXQtcGVlay1jZmcteW91dHViZScpOwogICAgICAgIC8vIEZvcm1hdCB2YWx1ZXM6CiAgICAgICAgbGV0IHJlZ2lvbnMgPSByZWdpb25zSW5wdXQudmFsdWUudHJpbSgpLnJlcGxhY2UoL1xzXHMrL2csICcgJykudG9VcHBlckNhc2UoKTsKICAgICAgICAvLyBQcmVwYXJlIGRhdGEgb2JqZWN0IGZvciBzdG9yYWdlOgogICAgICAgIGNvbnN0IGRiX2VudHJ5ID0gewogICAgICAgICAgICByZWdpb25zOiByZWdpb25zLnNwbGl0KC9ccy8pLAogICAgICAgICAgICBub1Rvb2x0aXA6IG5vVG9vbHRpcElucHV0LmNoZWNrZWQsCiAgICAgICAgICAgIGFsbG93T25Zb3V0dWJlOiBhbGxvd09uWW91dHViZS5jaGVja2VkCiAgICAgICAgfTsKICAgICAgICBHTV9zZXRWYWx1ZSgndXNlclNldHRpbmdzJywgSlNPTi5zdHJpbmdpZnkoZGJfZW50cnkpKTsKICAgICAgICBjbG9zZVNldHRpbmdzRGlhbG9nKCk7CiAgICB9CiAgICBmdW5jdGlvbiBoYW5kbGVTZXR0aW5nc0NsaWNrKGV2KSB7CiAgICAgICAgaWYgKGV2LnRhcmdldC5pZCA9PT0gJ3l0LXBlZWstY2ZnLWNhbmNlbCcpIHsKICAgICAgICAgICAgY2xvc2VTZXR0aW5nc0RpYWxvZygpOwogICAgICAgIH0KICAgICAgICBpZiAoZXYudGFyZ2V0LmlkID09PSAneXQtcGVlay1jZmctc2F2ZScpIHsKICAgICAgICAgICAgaGFuZGxlU2F2ZVNldHRpbmdzKCk7CiAgICAgICAgfQogICAgfQogICAgZnVuY3Rpb24gY2xvc2VTZXR0aW5nc0RpYWxvZygpIHsKICAgICAgICBjb25zdCBkaWFsb2cgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcueXQtcGVlay1jZmcnKTsKICAgICAgICBpZiAoZGlhbG9nKQogICAgICAgICAgICBkaWFsb2cucmVtb3ZlKCk7CiAgICB9CiAgICBmdW5jdGlvbiBoYW5kbGVNZW51Q29tbWFuZCgpIHsKICAgICAgICBpbnNlcnRTZXR0aW5nc0RpYWxvZygpOwogICAgfQogICAgR01fcmVnaXN0ZXJNZW51Q29tbWFuZCgnWW91dHViZSBQZWVrIFNldHRpbmdzJywgaGFuZGxlTWVudUNvbW1hbmQpOwogICAgaWYgKHNpdGUoJ3lvdXR1YmUuY29tJykgJiYgIU9QVElPTlMuYWxsb3dPbllvdXR1YmUpCiAgICAgICAgcmV0dXJuOwogICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignbW91c2VvdmVyJywgaGFuZGxlTW91c2VPdmVyKTsKfSkoKTsK"},{"name":"Affiliate killer","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["http*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1573407921893,"data":{"hideOriginLink":"sone"}},"enabled":false,"position":27,"file_url":"https://userscripts-mirror.org/scripts/source/411363.user.js","uuid":"3b1d9fd3-b030-4d0d-9916-34e2cf7608ee","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQGlkICAgICAgICAgICAgIEFmZmlsaWF0ZV9raWxsZXIKLy8gQG5hbWUgICAgICAgICAgIEFmZmlsaWF0ZSBraWxsZXIKLy8gQHZlcnNpb24gICAgICAgIDMuOAovLyBAbmFtZXNwYWNlICAgICAgaHR0cHM6Ly9ncmVhc3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BqeOBrueUqOmAlOOBp+OBruaUueWkieOBr+W9k+eEtk5H44Gn44GZ44CCCgrms6jmhI/ngrnjga/jg5XjgqHjgqTjg6vkv53lrZjjga7pmpvjgIHmloflrZfjgqjjg7PjgrPjg7zjg4njga9VVEYtOOOBp+S/neWtmOOBl+OBpuOBj+OBoOOBleOBhOOAgijmloflrZfljJbjgZHlm57pgb8pCgoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCuWJjeaPkOadoeS7tgoK4peL5b+F6aCICuODu+OCr+ODg+OCreODvChjb29raWUp44Gu5YmK6Zmk44CB44GK44KI44Gz5a6a5pyf55qE44Gq5YmK6ZmkCgrjg7vjg53jgqTjg7Pjg4jjgrXjgqTjg4jjgarjganlvZPjgrnjgq/jg6rjg5fjg4jjgpLli5XkvZzjgZXjgZvjgZ/jgY/jgarjgYTjgrXjgqTjg4jjgpLoqK3lrprjgZnjgosK5L6L77yJ44Ki44OJ44Kq44Oz44GuU2NyaXB0aXNo44GnVOODneOCpOODs+ODiOOCteOCpOODiOOBrumZpOWkluOCkuioreWumuOBmeOCi+WgtOWQiAog44K544Kv44Oq44OX44OI566h55CG55S76Z2i44GL44KJQWZmaWxpYXRlX0tpbGxlcuOBruioreWumuOCkuOCr+ODquODg+OCr+OBlwogZXhjbHVkZeOBq+mZpOWkluOBl+OBn+OBhOOCteOCpOODiOOBrlVSTOOCkuaMh+WumuOBmeOCiyjmraPopo/ooajnj77jgYzkvb/jgYjjgarjgYTvvJ8pCmh0dHA6Ly90bWFsbC50c2l0ZS5qcC8qCmh0dHBzOi8vdG1hbGwudHNpdGUuanAvKgpodHRwOi8vdHNpdGUuanAvKgpodHRwczovL3RzaXRlLmpwLyoK44Gq44GpKOacgOW+jOOBruOCouOCueOCv+ODquOCueOCrygqKeOCkuW/mOOCjOOBmuOBqykKCgril4vku6XkuIvjga/lv4XpoIjjgafjga/jgarjgYTjgZHjganjgoTjgaPjgZ/mlrnjgYzjgYTjgYQKCgox44CB5Z+65pys55qE44GrYWRibG9ja+ezu+OCouODieOCquODs+OBqOS9teeUqOaOqOWlqCjlrprnlaopCuWkp+S9k+OBruOCouODleOCo+ODquOCqOOCpOODiOOBr+OBk+OCjOOBp+aKueauuuOBleOCjOOBvuOBmeOAggrml6XmnKzoqp7jga7jg5XjgqPjg6vjgr/jg7zjgpLpganlvZPjgavos7zoqq3jgZfjgb7jgZfjgofjgYbjgIIK6Kqk54iGKOmWouS/guOBquOBhOOCguOBruOBvuOBp+mdnuihqOekuinjgoLjgYLjgovjga7jgafms6jmhI8KCjLjgIFQZWVyQmxvY2vjgarjganjga7pgJrkv6Hjg5XjgqPjg6vjgr/jg6rjg7PjgrDjgr3jg5Xjg4go5Yid5b+D6ICF5ZCR44GNKQppcOOCkumBruaWreOBmeOCi+OBn+OCgeihqOekuuOBleOCjOOBquOBj+OBquOCiuOCueODg+OCreODqijjgZ/jgaDjgZfjgZ/jgb7jgavplqLkv4LjgarjgYTjga7jgoLpga7mlq3jgZnjgovjga7jgafms6jmhI8pCuW/jeiAhWFkTWF444Gu44KI44GG44Gq5bqD5ZGK44GM6KGo56S644GV44KM44KL44Gg44GR44Gn5aCx6YWs44GM55m655Sf44GZ44KL5LuV57WE44G/44GM44GC44KL44Gu44Gn5bCO5YWl5o6o5aWoCgrlsI7lhaXmlrnms5XjgarjganvvJrohLFHb29nbGXvvKB3aWtp44GuUGVlckJsb2Nr6Kej6Kqs44Oa44O844K4Cmh0dHA6Ly93d3c0LmF0d2lraS5qcC9ub2dvb2dsZS9wYWdlcy8xOS5odG1sCgoz44CB5Y+v6IO944Gq44KJ44Ki44OJ44Kq44OzTm9SZWRpcmVjdOOBqOS9teeUqOaOqOWlqCjjgoTjgoTkuIrntJrogIXlkJHjgZEpCuODquODgOOCpOODrOOCr+ODiOOCkuODluODreODg+OCr+OBl+OBpui7oumAgeWFiFVSTOOCkuihqOekuuOBl+OBpuOBj+OCjOOCi+OBruOBp+OCouODleOCo+ODquOCqOOCpOODiOODquODs+OCr+OCkuS/ruato+OBl+OBvuOBmeOAggrkvZXmlYXjgZPjga7jgqLjg4njgqrjg7PjgYvjgajjgYTjgYbjgajku5bjga7jg6rjg4DjgqTjg6zjgq/jg4jjg5bjg63jg4Pjgq/ns7vjgqLjg4njgqrjg7Pjgafjga/jgrnjg6vjg7zjgZfjgabjgZfjgb7jgYbjgojjgYbjgaoKbWV0YeOCv+OCsOOChGh0dHDjg6rjgq/jgqjjgrnjg4jjgarjganjga7jg6rjg4DjgqTjg6zjgq/jg4jjgoLjg5bjg63jg4Pjgq/lj6/og73jgaDjgYvjgonjgafjgZnjgIIK6KaB6Kit5a6a44CCKOKGk+OBruaWueOBp+ewoeaYk+ino+iqrOOBguOCiuOBvuOBmSkKCuKAu+aWh+Wtl+WMluOBkeWVj+mhjOOBjOeZuueUn+OBmeOCi+ODmuODvOOCuOOBguOCiig0MDPjgqjjg6njg7zjgarjgakpCuOBk+OCjOOBr+a1t+WkluOBruOCouODieOCquODs+OBruOBn+OCgeaXpeacrOiqnuOBruOCqOODs+OCs+ODvOODieODu+ODh+OCs+ODvOODieOBq+WkseaVl+OBl+OBpuOBhOOCi+OBm+OBhOOAggrllY/poYzjgajjgarjgaPjgabjgYTjgotVUkzjgbjjga7jg6rjg4DjgqTjg6zjgq/jg4jjgpLoqLHlj6/jgZnjgovjgajmraPjgZfjgYRVUkzjgbjpo5vjgbPjgb7jgZnjgYzjgIEK44Ki44OV44Kj44Oq44Ko44Kk44OI44Oq44Oz44Kv44G444Gu6Kix5Y+v44Gr44Gq44KJ44Gq44GE44KI44GG6ICD44GI44Gm6Kix5Y+v44GX44G+44GX44KH44GGCgo044CB5Y+v6IO944Gq44KJUmVmZXJyZXIgQ29udHJvbOezu+OCouODieOCquODs+OBqOS9teeUqOaOqOWlqCjjgoTjgoTkuIrntJrogIXlkJHjgZEpCuODhOOCpOODg+OCv+ODvOOChOODluODreOCsFVSTOOBquOBqeOCkueZu+mMsuOBl+OAgeODquODleOCoeODqeOBquOBqeOCkuWFg+OBq+WgsemFrOOCkuaJleOBhuOCouODleOCo+ODquOCqOOCpOODiOOBjOOBguOCi+aooeanmO+8nwrnp4Hjga/jgIxSZWZDb250cm9s44CN44Go44GE44GG44Ki44OJ44Kq44Oz44KS5L2/44Gj44Gm44GE44G+44GZ44GM44CBRmlyZWZveDI544Gn44Ki44OJ44Kq44Oz44OQ44O844GM5YmK6Zmk44GV44KM44Gf44Gu44GnCuePvuWcqOOBruODquODleOCoeODqVVSTOOBjOeiuuiqjeOBp+OBjeOBquOBj+OBquOCiuOBvuOBl+OBn+OAgijjgqLjg4njgqrjg7Pjg5Djg7zlvqnmtLvjgZnjgovjgqLjg4njgqrjg7PjgpLlhaXjgozjgozjgbDlhajmqZ/og73kvb/jgYjjgb7jgZkpCuKAu+OBk+OBoeOCieOCguaWh+Wtl+WMluOBkeWVj+mhjOOBguOCiuOAggoK4oC744GX44Gj44GL44KK6Kit5a6a44GX44Gq44GE44Go55S75YOP44GM6KGo56S644GV44KM44Gq44GE44CB44OV44Kh44Kk44Or44GM44OA44Km44Oz44Ot44O844OJ44Gn44GN44Gq44GE44Gq44Gp44Gu5ZWP6aGM44GM55m655Sf44GX44G+44GZ44CCCuS4gOW/nOS4i+OBruaWueOBp+OBiuWLp+OCgeioreWumuOCkui8ieOBm+OBvuOBmeOAggoKNeOAgVJTU+ezu+OBr+OAjFJTU+W6g+WRiuWJiumZpOekvuOAjeOBquOBqeOBruW6g+WRiuWJiumZpOOCkuWIqeeUqOOBl+OBpuOBj+OBoOOBleOBhOOAggrlvZPjgrnjgq/jg6rjg5fjg4jjgafjga/ln7rmnKznmoTjgatSU1Pjga7jgqLjg5XjgqPjg6rjg7Pjgq/jgavlr77lv5zjgZfjgb7jgZvjgpPjgIIKKOWvvuW/nOOBp+OBjeOBquOBhOWgtOWQiOOBjOOBu+OBqOOCk+OBqeOBruOBn+OCgSkKCgril4vjgZPjgaDjgo/jgorjgZ/jgYTmlrnnlKgK5LiL6KiY44K144Kk44OI44Gn6Imy44CF44Go44Gp44GG44GeCgrohLFHb29nbGXvvKB3aWtpCmh0dHA6Ly93d3c0LmF0d2lraS5qcC9ub2dvb2dsZS8KCgoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCuOCouODieOCquODs+OBrk5vUmVkaXJlY3TjgYzoia/jgY/jgo/jgYvjgonjgarjgYTvvIHmraPopo/ooajnj77jgaPjgabkvZXvvJ/jgaPjgabkurrnlKgo44Go44Gv44GE44GI6Ieq5YiG44KC5YuJ5by35LitKQoK44G+44Ga5Yid5pyf44Gr55m76Yyy44GV44KM44Gm44GE44KL44KC44Gu44KS5YWo6YOo5YmK6ZmkCgox44CB5Lul5LiL44KS6L+95Yqg44GZ44KL44Go5YWo44Gm44GuVVJM44Gn44Oq44OA44Kk44Os44Kv44OI44KS44OW44Ot44OD44Kv44GX44Gm44GP44KM44KL44KI44GG44Gr44Gq44KL44CCCgpeaHR0cAoo4oaR6Lui6YCB5YWD44Gr44Gg44GR44OB44Kn44OD44Kv44KS5YWl44KM44KL44CC44GT44GT44GM5LiA55Wq5YWI6aCt44Gn44GC44KL44Go44GE44GG5oSP5ZGz44Gu44Kt44Oj44Os44OD44OIKF4p44KS5b+Y44KM44Ga44GrKQrigLvihpHjgZPjgozjgYzntbblr77jgavkuIDnlarkuIvjgavjgarjgovjgojjgYbjgavjgZnjgovjgIIKCjLjgIHoqLHlj6/jgZfjgZ/jgYTjg6rjg4DjgqTjg6zjgq/jg4hVUkzjga/ku6XkuIvjga7jgojjgYbjgavov73liqDjgZnjgovjgIIKICAg44Ob44Ov44Kk44OI44Oq44K544OI44Gu44KI44GG44Gq44KC44Gu44CCCiAgIOKAu+S4iuiomOino+iqrDHjga7jgIxeaHR0cOOAjeOCiOOCiuOCguS4iuOBq+i/veWKoOOBmeOCi+OBk+OBqAoKICAg5L6L77yaaHR0cDovL2hvZ2Vob2dlLmNvLmpw44G+44Gf44GvaHR0cHM6Ly9ob2dlaG9nZS5jby5qcOOCkuioseWPr+OBmeOCi+WgtOWQiAoKXmh0dHBzPzovL2hvZ2Vob2dlLmNvLmpwCijihpHou6LpgIHlhYPjgajoqLHlj6/jgavjg4Hjgqfjg4Pjgq/jgpLlhaXjgozjgovjgILjgq3jg6Pjg6zjg4Pjg4goXinjgpLlv5jjgozjgZrjgaspCgogICAg44GT44Gu5aC05ZCI5oyH5a6a44GX44GfVVJM44Gu5b6M44Gr5L2V44GM5p2l44Gm44KC44GE44GE44Gu44GnCiAgICBodHRwOi8vaG9nZWhvZ2UuY28uanAvaG9tZXBhZ2UvaW5kZXguaHRtbOOBquOBqeOCguioseWPr+OBleOCjOOCiwoKCjPjgIHjgIzou6LpgIHlhYPjgI3jgavjg4Hjgqfjg4Pjgq/lhaXjgozjgovjgajku4rooajnpLrjgZXjgozjgabjgYTjgotVUkwo6Lui6YCB5YWDKeOBi+OCieOBruODquODgOOCpOODrOOCr+ODiOOBruioreWumgogICAg44OB44Kn44OD44Kv44KS5aSW44GZ44Go4oCd6Lui6YCB5YWI4oCd44GuVVJM44Gr5a++44GZ44KL6Kit5a6aCiAgICDigLvihpHjgZPjgZPjga/jgYvjgarjgorph43opoEKCjTjgIHjgIzoqLHlj6/jgI3jgavjg4Hjgqfjg4Pjgq/lhaXjgozjgovjgajjg6rjg4DjgqTjg6zjgq/jg4jjgpLmraLjgoHjgZrjgavou6LpgIEo44OR44K544K544Or44O8KQogICAg44OB44Kn44OD44Kv44KS5aSW44GZ44Go44Oq44OA44Kk44Os44Kv44OI44KS44OW44Ot44OD44Kv44GX44Gm6Lui6YCB5YWIVVJM44KS6KGo56S6CiAgICDjg5vjg6/jgqTjg4jjg6rjgrnjg4jjga7jgojjgYbjgavkvb/jgYbjga7jgafov73liqDjgZnjgovloLTlkIjjga/ln7rmnKznmoTjgavoqLHlj6/jgavjg4Hjgqfjg4Pjgq/jgpLlhaXjgozjgosKCiAgICDkvovjgYjjgbAKICAgIF5odHRwOi8vaG9nZS5jb20vc2hvcC8g44OW44Ot44OD44KvCiAgICBeaHR0cDovL2hvZ2UuY29tLyDoqLHlj68KICAgIF5odHRwIOODluODreODg+OCrwogICAg44Gu44KI44GG44Gr5LiK44GL44KJ6Kit5a6a44GX44Gf5aC05ZCI44GvaHR0cDovL2hvZ2UuY29tL3Nob3Av44Gu44OW44Ot44OD44Kv44GM5pyA5YSq5YWI44GnCiAgICDjgZ3jgozku6XlpJbjga5odHRwOi8vaG9nZS5jb20v44Gv6Kix5Y+vKOS+i+OBiOOBsGh0dHA6Ly9ob2dlLmNvbS9zdG9yZS9pbmRleC5odG1s44Gq44Gp44Gv6Kix5Y+vKeOBqOOBquOCiuOAgQogICAg5pyA5b6M44GraHR0cDovL2hvZ2UuY29tL+S7peWkluOBrlVSTOOBr+WFqOmDqOODluODreODg+OCr+OBqOOBquOCi+OAggoKNeOAgeOAjEROU+OAjeOBq+mWouOBl+OBpuOBr+WfuuacrOeahOOBq+ODgeOCp+ODg+OCr+OBl+OBquOBj+OBpk9LCgrigLvms6jmhI/ngrkK6Lui6YCB5YWD44Gr44OB44Kn44OD44Kv44KS5YWl44KM44KL44GL44Gp44GG44GL44Gv44Gh44KD44KT44Go6ICD44GI44Gq44GE44GoCuODluODreODg+OCr+OBmeOBueOBjeOBqOOBk+OCjeOCkuOCueODq+ODvOOBl+OBpuaEj+WRs+OBquOBhOOBk+OBqOOBq+OAggrlj6/og73jgarjgonjgbDjg4njg6HjgqTjg7PjgaDjgZHjgafjgarjgY/ntLDjgYvjgY/mjIflrprjgZnjgovmlrnjgYzkuIflhajjgIIKCgrmnIDkvY7pmZDopprjgYjjgabjgYrjgY/jgajkvr/liKnjgarmraPopo/ooajnj77opo/liYctLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQoK5YmN5o+Q44Go44GX44Gm5b2T54S25Y2K6KeS6Iux5pWw5a2X44Gn44GZ44CCCuiqpOino+immuaCn+OBp+iqrOaYjuOBmeOCi+OBqOOAgeaWh+Wtl+OCkuaknOe0ouOBmeOCi+OBn+OCgeOBruihqOePvuOBp+OBmeOAggoKXmh0dHAKKOKGkeWFiOmgreOBjGh0dHDjgajjgYTjgYbmhI/lkbPjgILjgq3jg6Pjg6zjg4Pjg4goXinjga/jgZPjgZPjgYzkuIDnlarlhYjpoK3jgafjgYLjgovjgajjgYTjgYbmhI/lkbPjgIIpCgpodHRwcz8KKOKGkWh0dHDjgb7jgZ/jga9odHRwc+OBruOBqeOBo+OBoeOBp+OCguOBhOOBhOOCiOOBqOOBhOOBhuaEj+WRs+OAguOCr+OCqOOCueODgeODp+ODs+ODnuODvOOCryg/KeOBruWJjTHmloflrZfjga7mnInnhKHjga4y44OR44K/44O844OzKQoKKGNvLmpwfGNvbXxuZS5qcCkKKOKGkWNvLmpw44G+44Gf44GvY29t44G+44Gf44GvbmUuanDjgajjgYTjgYbmhI/lkbPjgILjg5HjgqTjg5fjg6njgqTjg7MofCnjgafljLrliIfjgovjgajkvZXjg5Hjgr/jg7zjg7PjgavjgoLlr77lv5zlj6/og73jgILmi6zlvKfjgaflm7LjgoDjga7jgpLlv5jjgozjgZrjgaspCgoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpSZWZDb250cm9s44Gu44GK44GZ44GZ44KB6Kit5a6aCgrjgJDmpoLopoHjgJEK44Oq44OV44Kh44Op44Go44Gv5LuK6KaL44Gm44GE44KL44K144Kk44OI44Gu5YmN44Gr6KaL44Gm44GE44Gf44K144Kk44OIVVJM44Gq44Gp44Gu5bGl5q205oOF5aCx44Gn44CBCuOBneOBruaDheWgseOBq+OBr+aknOe0ouOBl+OBn+WNmOiqnuOBquOBqeOCguWQq+OBvuOCjOOCi+WgtOWQiOOBjOOBguOCiuOBvuOBmeOAggrjgqLjg4njgqrjg7Pjgavjgojjgormm7jjgY3mj5vjgYjjgZ/jgormtojjgZfjgabjgZfjgb7jgYrjgYbjgajjgYTjgYbjgo/jgZHjgafjgZnjgIIKCuOAkOioreWumuOAkQoKMeOAgeacgOWIneOBq+OAjOS4gOimp+OBq+OBquOBhOOCteOCpOODiOOBq+mWouOBmeOCi+imj+WumuWApOOAjeOCkuOAjOWBveijheOAjSjmjqjlpagp44GC44KL44GE44Gv44CM6Zi75q2i44CN44GX44KI44GG44CCCgrjg7vlgb3oo4Xjg7vjg7vjg7vjgZPjgaHjgonjgpLmjqjlpajjgILjgZ3jga7jgrXjgqTjg4jjga7jg4njg6HjgqTjg7NVUkzjgpLjg6rjg5XjgqHjg6nmg4XloLHjgavjgZnjgosK44O76Zi75q2i44O744O744O744Oq44OV44Kh44Op5oOF5aCx44KS5raI5Y6744GX44CB44G+44Gj44GV44KJ44Gq54q25oWL44Gr44GZ44KLKOS4gOmDqOOCteOCpOODiOOBp+ODquODleOCoeODqeOBjOOBvuOBo+OBn+OBj+eEoeOBhOOBqOihqOekuuOBp+OBjeOBquOBj+OBquOCiykK44O76YCa5bi444O744O744O75pys5p2l44Gu44Oq44OV44Kh44Op44Gn44GZ44CC5ZWP6aGM44GM5Ye644Gm56K66KqN44GZ44KL44Go44GN5Lul5aSW44Gv6YG444Gw44Gq44GE5pa544GM44GE44GE44Gn44GZ44CCCuODu+OCq+OCueOCv+ODoOODu+ODu+ODu+iHqueUseOBq+ODquODleOCoeODqeOBrlVSTOOCkuabuOOBjeaPm+OBiOOCi+OBk+OBqOOBjOOBp+OBjeOBvuOBmeOBjOOAgeaZrumAmuOBruS6uuOBr+S4jeimgeOBp+OBl+OCh+OBhuOAggoKMuOAgeWAi+WIpeeZu+mMsuOBp+OCqOODqeODvOWbnumBvwoK6KGo56S644GV44KM44Gq44GE44O744OA44Km44Oz44Ot44O844OJ44GV44KM44Gq44GE44O75aSJ44Gq44Ko44Op44O844GM5Ye644KL44Gq44Gp5ZWP6aGM44GM55m655Sf44GX44Gf44KJ44CBCuOCueODhuODg+ODlzHjgafoqK3lrprjgZfjgZ/lhajkvZPjga7jg6rjg5XjgqHjg6njgIzlgb3oo4XjgI3jgpLjgIzpgJrluLjjgI3jgavoqK3lrprjgZfjgabllY/poYzjgYzop6PmtojjgZXjgozjgovjgYvnorroqo0K44KC44GX44Gd44KM44Gn5ZWP6aGM44GM6Kej5raI44GX44Gf44KJ5Lul5LiL44Gu44KI44GG44Gr5YCL5Yil6L+95Yqg44GX44KI44GGCgrllY/poYzjga7jgrXjgqTjg4jjgafog4zmma/jgpLlj7Pjgq/jg6rjg4Pjgq/jgZfjgablj7Pjgq/jg6rjg4Pjgq/jg6Hjg4vjg6Xjg7zjgpLlh7rjgZkK44CM44GT44Gu44K144Kk44OI44Gr6Zai44GZ44KLIFJlZkNvbnRyb2wg44Kq44OX44K344On44Oz44CN44KS44Kv44Oq44OD44KvCgrjgZnjgovjgajjgZ3jga7jgrXjgqTjg4jjga7jg6rjg5XjgqHjg6nli5XkvZzjgpLmjIflrprjgafjgY3jgovjga7jgafjgZ3jga7jgb7jgb5PS+OCkuaKvOOBmeOAggrigLvjg4fjg5Xjgqnjg6vjg4jjgafjgIzpgJrluLjjgI3jgYzpgbjmip7jgZXjgozjgabjgYTjgovjga/jgZrjgafjgZkKCue1guOCj+OBo+OBn+OCieW/mOOCjOOBmuOBq+WFqOS9k+OBruODquODleOCoeODqeOCkuOAjOWBveijheOAjeOBq+aIu+OBneOBhuOAggoKCjPjgIHjgYrjgZnjgZnjgoHoqK3lrpoKCuS7peS4i+OBrlVSTOOCkuODquODleOCoeODqeOAjOmAmuW4uOOAjeOBp+i/veWKoOOBmeOCi+OAggoK4oC744Gg44Gf44GX6L+95Yqg44Gv5ZCE6Ieq44Gu6Ieq5bex6LKs5Lu744Gn44GK6aGY44GE44GX44G+44GZ44CCCijlrp/pmpvjgavoh6rliIbjgafnorroqo3jgZfjgabjgYvjgonov73liqDjgpLjgYrli6fjgoHjgZfjgb7jgZkpCgrjg7tnb29nbGXjgqLjgqvjgqbjg7Pjg4go56K644GLeW91dHViZeOBi+OCouODs+ODieODreOCpOODieODnuODvOOCseODg+ODiCkKYWNjb3VudHMuZ29vZ2xlLmNvbQoK44O744OL44Kz44OL44Kz5YuV55S757O7CmNvbS5uaWNvdmlkZW8uanAKbmljb2Jsb21hZ2EuanAKCuODu3BpeGl2Cnd3dy5waXhpdi5uZXQKCuODu3ZlY3RvcuOBruODleODquODvOOCveODleODiOODgOOCpuODs+ODreODvOODieOBquOBqQpmdHAudmVjdG9yLmNvLmpwCm15LnZlY3Rvci5jby5qcAoK44O744K944OV44Oe44OD44OXCnBvaW50LnNvZm1hcC5jb20KCuODu+OCveODleODiOODkOODs+OCr+ezuyjlpJrliIbjg5fjg63jg5DjgqTjg4DjgoTpm7voqbHmlpnph5Hns7spCndlYi1tZWlzYWkuc29mdGJhbmt0ZWxlY29tLmNvLmpwCndlYm1laXNhaS5qcAoK44O744Km44Kn44OW6a2a5ouTCm1lZ2Fsb2Rvbi5qcAoK44O744Gh44Ga5Li4Cm1hcC5jaGl6dW1hcnUuY29tCgrjg7vjgoLjgorjgZ/jgb0KZmluZC5tb3JpdGFwby5qcAoKCuKAu+S4iuiomOS7peWkluOBp+OCguihqOekuuOBleOCjOOBquOBhOODu+ODgOOCpuODs+ODreODvOODieOBleOCjOOBquOBhOODu+WkieOBquOCqOODqeODvOOBjOWHuuOCi+OBquOBqQrllY/poYzjgYznmbrnlJ/jgZnjgovjgrXjgqTjg4jjga/jgaHjgonjgbvjgonjgajjgYLjgorjgb7jgZnjgIIK44Gd44Gu5aC05ZCI44Gv5YaN5bqm44K544OG44OD44OXMuOBq+aIu+OCjeOBhgoKKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KCi8qKuabtOaWsOWxpeattCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCgowNi8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ki44Or44OV44Kh44OZ44OD44OI6aCG44Gr5pW055CGCjA0LzE2LzIwMTQgLSB2Mi40ICBmaXg644Oa44O844K45YaF44K544Kv44Ot44O844Or55So44Oc44K/44Oz44Gv6Zmk5aSWCjA0LzAyLzIwMTQgLSB2Mi4zICBmaXg65paH5a2X5YyW44GR5Zue6YG/44GrZWNsLmpz44KScmVxdWlyZeOBmeOCi+OCiOOBhuOBq+WkieabtOOAguS7luiJsuOAheS/ruatowowMy8yNS8yMDE0IC0gdjIuMiAgZGVsOuaaq+WumueahOOBq+OCueOCr+ODquODl+ODiOWun+ihjOODh+OCo+ODrOOCpOOCkuWJiumZpAowMy8yNS8yMDE0IC0gdjIuMSAgYWRkOkFtYXpvbuOBruODquODgOOCpOODrOOCr+ODiOmZpOWOuwowMy8yMy8yMDE0IC0gdjIuMCAgYWRkOkFtYXpvbuOBruOCueODnuODvOODiOODleOCqeODs1VSTOOBq+WvvuW/nAowMy8yMi8yMDE0IC0gdjEuOSAgZml4Okdvb2dsZUltYWdl5qSc57Si44Gv6Zmk5aSW44CCb25jbGlja+mZpOWOu+OCkuS/ruato+OBl+OBn+ODquODs+OCr+OBruOBv+mBqeW/nOOBmeOCi+OCiOOBhuOBq+WkieabtOOAggowMy8yMi8yMDE0IC0gdjEuOCAgZml4OuiqrOaYjuaWh+WQueOBo+mjm+OCk+OBoOOBruOBp+abuOOBjeebtOOBl+OAgkFtYXpvbuOBruS/ruatowowMy8xNC8yMDE0IC0gdjEuMCAgcmVsZWFzZQoKKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCuWCmeW/mOmMsgrjg7tHb29nbGVJbWFnZeaknOe0ouOBp+OBhuOBvuOBj+WLleOBi+OBquOBhOOBruOBp0BleGNsdWRl44Gr6L+95Yqg44CCKnRibT1pc2NoKuOB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KGkmZhY2Vib29r44Gu5qW95aSp5bqD5ZGK44Gu6Kqt44G/6L6844G/44GM6YGF44GPODAw44Gr5aSJ5pu0KOOBk+OCjOOBp+OCguiqreOBv+i+vOOBv+OBjOmBheOBhOOBqOS/ruato+OBp+OBjeOBquOBhOOBkeOBqeOBk+OCjOS7peS4iuOBr+OCueODiOODrOOCueOBruOBn+OCgeWmpeWNlCkK4oaSbXkgeWFob2/jga7jg5rjg7zjgrjjgYzoqq3jgb/ovrzjgb/jgYzpgYXjgY8zMDAw44KC5b+F6KaB44Gq44Gf44KB44OH44Kj44Os44Kk44KS5buD5q2i44GX44Gm44Oh44Kk44Oz6Zai5pWw44Gu6LW35YuV44KS44K/44Kk44Oe44O844Kr44Km44Oz44OI44Gr44GX44GfCuKGkmFkZEV2ZW50TGlzdGVuZXLjgavlpInmm7QKCuODu2FtYXpvbuOBruWfi+OCgei+vOOBv+Wei2ZsYXNo44Gu5aC05ZCI44CB44Oq44OA44Kk44Os44Kv44OI55m655Sf44GZ44KL44Gu44GnTm9SZWRpcmVjdOOBp+ODluODreODg+OCr+W+jOS/ruatowoK44O75rW35aSW6KO944Ki44OJ44Kq44Oz44Gu44Gf44KB44GLbm9yZWRpcmVjdOOBjOODluODreODg+OCr+OBmeOCi+OBqOaXpeacrOiqnuOBjOaWh+Wtl+WMluOBkeOCkui1t+OBk+OBmeaooeanmCjmpb3lpKnjgarjganjgafnorroqo0pCuKGkuOCouODleOCo+ODquOCqOOCpOODiOODquODs+OCr+OBmOOCg+OBquOBhOWgtOWQiOOBr+ODquODgOOCpOODrOOCr+ODiOOCkuioseWPr+OBmeOCi+OBqOWVj+mhjOOBr+ino+a2iOOBmeOCiwrihpLmpb3lpKnjgpLoqLHlj6/jgZfjgaHjgoPjgYbjgajjgqLjg5XjgqPjg6rjgqjjgqTjg4jjg6rjg7Pjgq/jgpLouI/jgpPjgafjgZfjgb7jgYbjga7jgafkuovliY3jgavkv67mraPlj6/og73jgarjgoLjga7jga/kv67mraPj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ga7jgafmm7TmlrDlj6/og73jgarmqKHmp5gpCgoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCgoKCgovLz09PT09PT09PT09PT3jg5fjg63jgrDjg6njg6Dplovlp4s9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQooZnVuY3Rpb24oKSB7CgkvL+ODiOODqeODg+OCreODs+OCsOmZpOWOuwoJcmVtVHJhY2soZG9jdW1lbnQpOwoKCS8v44Om44O844K244O86Kit5a6aKGtpbGxlcuihqOekuuioreWumikKCXZhciBoaWRlT3JpZ2luTGluayA9ICJvbmUiOwoJaGlkZU9yaWdpbkxpbmsgPSB1c2VyQ2ZnKCJoaWRlT3JpZ2luTGluayIpOwoKCS8v5paH5a2X44Ko44Oz44Kz44O844OJ55So44Gu6Zai5pWw6Kqt44G/6L6844G/CgllY2woKTsKCgkvL+ODoeOCpOODs+WHpueQhuWun+ihjAoJd2luZG93LnNldFRpbWVvdXQoIGZ1bmN0aW9uKCkge21haW4oZG9jdW1lbnQpfSwgMTIwMCApOwkJLy/lh6bnkIbjga4y6YeN5YyW44Gr44Gq44KL44GR44Gp44K144Kk44OI44GU44Go44Gr5YiG44GR44KL44KI44KK44Oe44K344GL44Gq77yfCgoJLy9kb23oqq3jgb/ovrzjgb/lvowoTm9zY3JpcHTjgafmraLjgoHjgabjgovloLTlkIjjga9kb23oqq3jgb/ovrzjgpPjgafjgarjgYTjgaPjgb3jgYTjgILjgYvjgajjgYTjgaPjgabjgZPjga7otbfli5XjgpLmtojjgZnjgajoqq3jgb/ovrzjgb/pgYXlu7bjga7jgYLjgovjgrXjgqTjg4jjgZTjgajjgavliIbjgZHjgovlv4XopoHjgYzjgYLjgospCglkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKCJET01Db250ZW50TG9hZGVkIiwgZnVuY3Rpb24oZXZ0KXsKCQl2YXIgbm9kZSA9IGV2dC50YXJnZX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0cCUzQSUyRiUyRm5paG9uZ28uaXN0b2NrcGhvdG8uY29tCgkJCS8vaXN0b2NrcGhvdG89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQkJfWVsc2UgaWYoaHJlZi5pbmRleE9mKCIuaXN0b2NrcGhvdG8uIikgPiAtMSAmJiBocmVmLm1hdGNoKC8oXD98XCYpdXJsPWh0dHAvKSl7CgkJCQlzdHJVcmwgPSBnZXRSZWRpcmVjdFVybChocmVmLCJ1cmwiKTsKCQkJCXNldExpbmsoKTsKCi8vaHR0cDovL2xzLmotYS1uZXQuanAvP2E9MzY4ODImZD00OTQ3MTQmdXJsPWh0dHAlM0ElMkYlMkZ3d3clMkUxMGtlaXlhJTJFY29tJTJGaXRlbSUyRjUwODMlMkVodG1sCgkJCS8vSmFuZXTvvIhjb25lY2/jgafnorroqo3vvIk9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQkJfWVsc2UgaWYoaHJlZi5pbmRleE9mKCIuai1hLW5ldC5qcCIpID4gLTEgJiYgaHJlZi5tYXRjaCgiJnVybD1odHRwIikpewoJCQkJc3RyVXJsID0gZ2V0UmVkaXJlY3RVcmwoaHJlZiwidXJsIik7CgkJCQlzZXRMaW5rKCk7CgovL2h0dHA6Ly93d3cubGlua3NoYXJlLm5lLmpwL3NjbGFuZC9tZ20vP2lkPWd6ZlNYOSpESTVrCgkJCS8vbGlua3NoYXJlPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgkJCX1lbHNlIGlmKGhyZWYuaW5kZXhPZigiLmxpbmtzaGFyZS4iKSA+IC0xICYmIGhyZWYuaW5kZXhPZigiaWQ9IikgPiAtMSl7CgkJCQl2YXIgcGFyYW1zICA9ICBjcmVhdGVQYXJhbUFycmF5KGhyZWYpOwkvL+ODkeODqeODoeODvOOCv+agvOe0jQoJCQkJc3RyVXJsID0gaHJlZi5yZXBsYWNlKHBhcmFtc1siaWQiXSwiIikucmVwbGFjZSgiaWQ9IiwiIik7CgoJCQkJc2V0TGluaygpOwoKCQkJLy9saW5rc3luZXJneSBsaW5rc2hhcmXjgonjgZfjgYTvvIhjb25lY2/jgarjganjgafnorroqo3vvIk9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQkJfWVsc2UgaWYoaHJlZi5pbmRleE9mKCIubGlua3N5bmVyZ3kuIikgPiAtMSAmJiBocmVmLmluZGV4T2YoIlJEX1BBUk0xPSIpID4gLTEpewoJCQkJc3RyVXJsID0gZ2V0UmVkaXJlY3RVcmwoaHJlZiwiUkRfUEFSTTEiKTsKCgkJCQlzZXRMaW5rKCk7CgovL2h0dHBzOi8vd3d3Mi5saXZlYWRzLmpwL3dpZGdldHNfc3JjL2NjLnBocD9jPXZzJTNEMjQzOTg3MSUyNmFtcCUzQnZwJTNEODc2NDg5OTU0JTI2YW1wJTNCdmNwdG4lM0RmZWI5MmVjMV8yXzEwNjAwMSUyNmFtcCUzQnZjX3VybCUzRGh0dHAlMjUzQSUyNTJGJTI1MkYKCQkJLy9saXZlYWRzLmpwPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBpZihocmVmLmluZGV4T2YoInd3dzIubGl2ZWFkcy5qcCIpID4gLTEgJiYgaHJlZi5pbmRleE9mKCJ2Y191cmwiKSA+IC0xKXsKCQkJCXN0clVybCA9IGhyZWYucmVwbGFjZSgvJmFtcDsvZywgIiYiKTsKCQkJCXN0clVybCA9IGdldFJlZGlyZWN0VXJsKHN0clVybCwid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Y28uanAvZHAvQjAwME1HQlBOSQoJCQkvL+OCguOBl+OCguOCouODleOCo+ODquOCqOOCpOODiD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBpZihocmVmLm1hdGNoKCJjLmFmLm1vc2hpbW8uY29tIikgJiYgaHJlZi5tYXRjaCgidXJsPSIpKXsKCQkJCXN0clVybCA9IGdldFJlZGlyZWN0VXJsKGhyZWYsInVybCIpOwoJCQkJc2V0TGluaygpOwoKLy9odHRwOi8vaW50ci5zaGlub2JpLmpwL0xhbmRpbmdIYW5kbGVyP25tPTQ2MDk1JmNvbW1lcmNpYWxfaWQ9MgoJCQkvL+W/jeiAhWFkbWF4PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQkJfWVsc2UgaWYoaHJlZi5tYXRjaCgic2hpbm9iaS5qcC9MYW5kaW5nSGFuZGxlciIpKXsKCQkJCXN0clVybCA9IGhyZWYucmVwbGFjZSgvXD8uKiQvLCIiKTsKCQkJCXNldExpbmsoKTsKCgkJCS8vdHJhZmZpY2dhdGU9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQkJfWVsc2UgaWYoc3RyVXJsLmluZGV4T2YoInRyYWZmaWNnYXRlLm5ldCIpID4gLTEpewoKLy9odHRwOi8vYWQyLnRyYWZmaWNnYXRlLm5ldC90L3IvMTgvNzAyLzQ0NjYyLzAvLS9odHRwczovL3Nob3AuZWxlY29tLmNvLmpwL1N0b3JlL1Byb2R1Y3QuYXNweD9KYW5DZD00OTUzMTAzMDYyODQ5CgkJCQlpZihocmVmLm1hdGNoKCIvLS9odHRwIikpewoJCQkJCXN0clVybCA9IGhyZWYucmVwbGFjZSgvLipcLy1c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KC8uaHRtbD8uKiQvLCIuaHRtbCIpOwoJCQkJc2V0TGluaygpOwoKLy9odHRwOi8vd3d3LmRvbWlub3MuanAvYWZmaWxpYXRlL2xzZGxwLnBocD9zaXRlSUQ9Mnh6N1U5UmczVVUtRVFhN0tmSXlmcjFqTUVvVjA3bk5mdwoJCQkvL2RvbWlub3M9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQkJfWVsc2UgaWYoaHJlZi5pbmRleE9mKCJkb21pbm9zLmpwIikgPiAtMSAmJiBocmVmLmluZGV4T2YoInNpdGVJRD0iKSA+IC0xKXsKCQkJCXZhciBwYXJhbXMgID0gIGNyZWF0ZVBhcmFtQXJyYXkoaHJlZik7CS8v44OR44Op44Oh44O844K/5qC857SNCgkJCQlzdHJVcmwgPSBocmVmLnJlcGxhY2UocGFyYW1zWyJzaXRlSUQiXSwiIik7CgkJCQlzZXRMaW5rKCk7CgoKLy9odHRwOi8vd3d3LmRvc3BhcmEuY28uanAvNXNob3BwaW5nL2RldGFpbF9wYXJ0cy5waHA/Ymc9MiZicj05OCZzYnI9NTI5JmljPTM1NjcxNC8KCQkJLy9kb3NwYXJh44Gu5LiN6KaB44Gn5LiN5piO44Gq44OR44Op44Oh44O844K/5YmK6ZmkPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgkJCX1lbHNlIGlmKGhyZWYuaW5kZXhPZigiZG9zcGFyYS5jby5qcCIpID4gLTEgJiYgaHJlZi5pbmRleE9mKCJpYz0iKSA+IC0xKXsKCQkJCXZhciBwYXJhbXMgID0gIGNyZWF0ZVBhcmFtQXJyYXkoaHJlZik7CS8v44OR44Op44Oh44O844K/5qC857SNCgkJCQlzdHJVcmwgPSBocmVmLnJlcGxhY2UoLy5waHAuKiQvLCIucGhwP2ljPSIpICsgcGFyYW1zWyJp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YXIvNjQwMC82NDAwXzEyODYxLmFzcD9ib29rPTY0MDAmY2F0PW90aGVyMDAzLwoJCQkvL+ODi+ODg+OCu+ODs+OBruS4jeimgeOBp+S4jeaYjuOBquODkeODqeODoeODvOOCv+WJiumZpD09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBpZihocmVmLmluZGV4T2YoIm5pc3Nlbi5jby5qcCIpID4gLTEgJiYgaHJlZi5pbmRleE9mKCIuYXNwIikgPiAtMSl7CgkJCQlzdHJVcmwgPSBocmVmLnJlcGxhY2UoLy5hc3AuKiQvLCIuYXNwIik7CgkJCQlzZXRMaW5rKCk7CgoKLy9odHRwOi8vd3d3LmUtbmxzLmNvbS9hY2Nlc3NfcHJvZC5waHA/YWdlbmN5X2lkPWFmNzM5NTQ2LW8wOCZwY29kZT03NzEzCgkJCS8vbmxzPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBpZihocmVmLm1hdGNoKCJlLW5scy5jb20iKSAmJiBocmVmLm1hdGNoKCJhZ2VuY3lfaWQ9IikgKXsKCQkJCXZhciBwYXJhbXMgID0gIGNyZWF0ZVBhcmFtQXJyYXkoaHJlZik7CS8v44OR44Op44Oh44O844K/5qC857SNCgkJCQlzdHJVcmwgPSBocmVmLnJlcGxhY2UocGFyYW1zWyJhZ2VuY3lfaWQiXSwiIikucmVwbGFjZSgvYWdlbmN5X2lkPS8sIiIpOwoKCQkJCXNldExpbmsoKTsKCi8vaHR0cDovL2NvbWljLnBpeGl2Lm5ldC93b3Jrcy81OT9hZHM9dHgtdzU5CgkJCS8vcGl4aXY9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBp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1vbi5jb20iKSAmJiBocmVmLm1hdGNoKCJWSUVXX1VSTD1odHRwIikpewoJCQkJc3RyVXJsID0gZ2V0UmVkaXJlY3RVcmwoaHJlZiwiVklFV19VUkwiKTsKCQkJCXNldExpbmsoKTsKCgoJCQkvL+mnv+ays+Wxiz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBpZihocmVmLm1hdGNoKCJzdXJ1Z2EteWEuanAiKSl7CgovL2h0dHA6Ly9hZmZpbGlhdGUuc3VydWdhLXlhLmpwL21vZHVsZXMvYWYvYWZfanVtcC5waHA/dXNlcl9pZD0yMjcmZ29vZHNfdXJsPWh0dHAlM0ElMkYlMkZ3d3cuc3VydWdhLXlhLmpwJTJGZ2FtZS5odG1sCgkJCQlpZihocmVmLm1hdGNoKCJnb29kc191cmw9IikpewoJCQkJCWlmKGdldFJlZGlyZWN0VXJsKGhyZWYsImdvb2RzX3VybCIpICE9ICIiKXsKCQkJCQkJc3RyVXJsID0gZ2V0UmVkaXJlY3RVcmwoaHJlZiwiZ29vZHNfdXJsIik7CgkJCQkJCXNldExpbmsoKTsKCQkJCQl9CgkJCQl9CgoKCQkJLy/jg4Tjgq/jg6Ljga7jg4jjg6njg4Pjgqvjg7w9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQkJfWVsc2UgaWYoaHJlZi5pbmRleE9mKCJ0c3VrdW1vLmNvLmpwIikgPiAtMSAmJiBocmVmLmluZGV4T2YoIj9jaWQ9IikgPiAtMSl7CgkJCQlzdHJVcmwgPSBocmVmLnJlcGxhY2UoL1w/Y2lkPS4qJC8sIiIpOwoJCQkJc2V0TGluaygpOwoKCgkJCS8veWFob289PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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vbS9pbmRleC9fZGF0YS9BRklEPWRsZG91amluLwovL2h0dHA6Ly93d3cuZGlnaWtldC5jb20vd29yay9zaG93L19kYXRhL0lEPUlUTTAwOTk0NjUvQUZJRD1kbGRvdWppbi8KCQkJCWlmKGhyZWYuaW5kZXhPZigiQUZJRD0iKSA+IC0xKXsKCQkJCQlzdHJVcmwgPSBocmVmLnJlcGxhY2UoL0FGSUQ9LipcLy8sIiIpOwoJCQkJCXNldExpbmsoKTsKCQkJCX0KCi8vaHR0cDovL3d3dy5kLWRyb3BzLmNvbS8/YWZfY2Q9QUYxMjY5NgoJCQkvL2QtZHJvcCjplonpjpbihpLlho3plovvvJ8pPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgkJCX1lbHNlIGlmKGhyZWYubWF0Y2goImQtZHJvcHMuY29tIikpewoJCQkJaWYoaHJlZi5tYXRjaCgiYWZfY2Q9IikpewoJCQkJCXN0clVybCA9IGhyZWYucmVwbGFjZSgvKFw/fFwmKWFmX2NkPS4qJC8sIiIpOwoJCQkJCXNldExpbmsoKTsKCQkJCX0KCi8vaHR0cDovL3d3dy5kZC1zdHlsZS5jb20vaW5kZXgucGhwP2FkPTIwNDEKCQkJLy9kZC1TdHlsZT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBpZihocmVmLm1hdGNoKCJkZC1zdHlsZS5jb20iKSl7CgkJCQlpZihocmVmLm1hdGNoKCJhZD0iKSl7CgkJCQkJc3RyVXJsID0gaHJlZi5yZXBsYWNlKC8oXD98XCYpYWQ9LiokLywiIik7CgkJCQkJc2V0TGluaygpOwoJCQkJfQoKCQkJLy/jg4fjgrjjgrHjg4Pjg4g9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCQk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b3JlbmljaGUuY29tL2hpdC5waHA/dz0yNDUzNjImcz0yNTYKCQkJLy9Nb3JlTmljaGUo5rW35aSW57O7KT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoJCQl9ZWxzZSBpZihocmVmLm1hdGNoKCJ0cmFjay5tb3JlbmljaGUuY29tIikpewoJCQkJaWYoaHJlZi5tYXRjaCgvKFw/fFwmKXc9LykpewoJCQkJCXZhciBwYXJhbXMgID0gIGNyZWF0ZVBhcmFtQXJyYXkoaHJlZik7CS8v44OR44Op44Oh44O844K/5qC857SNCgkJCQkJc3RyVXJsID0gaHJlZi5yZXBsYWNlKHBhcmFtc1sidyJdLCIiKS5yZXBsYWNlKC8oXD98XCYpdz0vLCIiKTsKCQkJCQlzZXRMaW5rKCk7CgkJCQl9CgovL2h0dHA6Ly90cmFjay5vbWd1ay5jb20vP0FJRD01NzM4NzQmTUlEPTUxOTUxMiZQSUQ9MTEyODUmQ0lEPTQxNDgyMjMmQ1JJRD02MjM1NSZXSUQ9NTAyMTAKCQkJLy9PbmxpbmUgTWVkaWEgR3JvdXAo5rW35aSWKT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgkJCS8vQUlE44GM44Ki44OV44KjUElE44GM44Oa44O844K444Gn44Gp44Gh44KJ44KC5raI44Gb44Gq44GE44CC6aOb44KT44Gg44GC44Go44Gu44Oa44O844K444KS5L+u5q2j44GX44Gm5a++5b+cKOawl+S8keOCgSkKCQkJLy9DUklE44Gv55S75YOPVVJM44Gj44G944GECgkJCX1lbHNlIGlmKGhyZWYubWF0Y2goL3RyYWNrLm9tZyh1a3wyfC4qKS5jb20vKSAmJiBocmVmLm1hdGNoKCJXSUQ9IikpewoJCQkJdmFyIHBhcmFtcyAgPSAgY3JlYXRlUGFyYW1BcnJheShocmVmKTsJLy/jg5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7mrovjgorvvJ8KCQkJaWYoaHJlZi5tYXRjaCgvTFNJRD0uKj9cfC4qP1x8LykpewoJCQkJc3RyVXJsID0gaHJlZi5yZXBsYWNlKC9MU0lEPS4qP1x8Lio/XHwvLCIiKTsKCQkJCXNldExpbmsoKTsKCQkJfQoKCgkJCS8v5pyA57WC5L+u5q2j44GT44GT44G+44GnPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgoKCQl9Ly9tYWluIGZvcuaWh+OBk+OBk+OBvuOBpz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KfWNhdGNoKGUpewovLwl0aHJvdyhlKTsKCUdNX2xvZyhlKTsKfQoKCi8q5a++5b+c5LiN5Y+v6IO944Gg44Gj44Gf44KC44Gu5LiA6KanKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgoKCi8vaHR0cDovL3N0b3JlLnNob3BwaW5nLnlhaG9vLmNvLmpwLyjljYrop5Loi7HmlbDlrZfjga7jg57jgqTjgrfjg6fjg4Pjg5dJRCkvKOWNiuinkuiLseaVsOWtl+OBruWVhuWTgUlEKS5odG1sCgkvL3lhaG9v44Gu44Oe44Kk44K344On44OD44OXVVJMPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoKLy9odHRwOi8vcmQuYW5lLnlhaG9vLmNvLmpwL3JkP2VwPVJXLnUyZnUxanRyc1Bna0FvUzNvcFV2Vmh3ZURFSU5iaktXSnpiTEVlcTB4MUxweHRvU1UxLlBjUzBjOXhkc0VocmEzMVhUMUR3dl91elZBQkV3V2l2N193b19oYXRMRl9Na2kxb1BRaTNwNi51NHV1YmVIUWVYQ1pCV3M5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goLvvJ8oc28gbWFueSB3aGl0ZWxpc3QuYmxhY2tsaXN0IGlzIC4uLj8gSSBoYXZlIG5vIGlkZWEuKQoJCS8v5qW95aSp44OR44Op44Oh44O844K/CgkJZnVuY3Rpb24gcmFrdXRlblBhcmFtKCl7CgkJCQl2YXIgc3RyU2l0ZW0gPSAiIjsJLy/mpJzntKIKCQkJCXZhciBzdHJOaXRlbSA9ICIiOwkvL+aknOe0oumZpOWklgoJCQkJdmFyIHN0clBhZ2UgPSAiIjsJLy/jg5rjg7zjgrjmlbAKCQkJCXZhciBzdHJUeXBlID0gIiI7CS8v44K144O844OQ77yfCgkJCQl2YXIgc3RyU2lkID0gIiI7CS8v44K344On44OD44OXSUQo44K344On44OD44OX5YaF5qSc57Si55So77yfKQoJCQkJdmFyIHN0ckdlbnJlID0gIiI7CS8v44K444Oj44Oz44OrCgkJCQl2YXIgc3RyVmlldyA9ICIiOwkvL+ihqOekuuaWueazlQoJCQkJdmFyIHN0ckZyb21EID0gIiI7CS8v55m65aOy5pel56+E5Zuy5aeL54K5CgkJCQl2YXIgc3RyVG9EID0gIiI7CS8v55m65aOy5pel56+E5Zuy57WC54K5CgkJCQl2YXIgc3RyTWlucCA9ICIiOwkvL+acgOS9juS+oeagvAoJCQkJdmFyIHN0ck1heHAgPSAiIjsJLy/mnIDlpKfkvqHmoLwKCgkJfQoqLwoKCi8vCQl0aHJvdyBuZXcgRXJyb3IoKTsKCX0vL21haW7ntYLkuoYKCgoKCgovLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSDov73liqDplqLmlbAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCgovL0dvb2dsZeODiOODqeODg+OCq+ODvOmZpOWOuz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoKZnVuY3Rpb24gcmVtVHJhY2sobm9kZSl7CgoJdmFyIHJlc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N0cmluZy5mcm9tQ2hhckNvZGUsdD11KDEyNTM5KTt3aGlsZSgrK2M8MTI3KUNbdShjKV09Y14zOSYmY145Mj9pKys6MDtpPTA7d2hpbGUoMDw9KGM9Q1thLmNoYXJBdChpKyspXSkpaWYoMTY9PWMpaWYoKGM9Q1thLmNoYXJBdChpKyspXSk8ODcpe2lmKDg2PT1jKWM9MTg3OTt3aGlsZShjLS0pcy5wdXNoKHUoKytwKSl9ZWxzZSBzLnB1c2gocy5qb2luKCIiKS5zdWJzdHIoODI3MiwzNjApKTtlbHNlIGlmKGM8ODYpcy5wdXNoKHUocCs9Yzw1MT9jLTE2OihjLTU1KSo5MitDW2EuY2hhckF0KGkrKyldKSk7ZWxzZSBpZigoYz0oKGMtODYpKjkyK0NbYS5jaGFyQXQoaSsrKV0pKjkyK0NbYS5jaGFyQXQoaSsrKV0pPDQ5MTUyKXMucHVzaCh1KHA9Yzw0MDk2MD9jOmN8NTczNDQpKTtlbHNle2MmPTUxMTt3aGlsZShjLS0pcy5wdXNoKHQpO3A9MTI1Mzl9cmV0dXJuIHMuam9pbigiIiknKSgpOwoKCUpDVDg4MzY9SkNUMTEyODAuc3Vic3RyaW5nKDAsODgzNik7CgovLz09PT09PT09PT09PT09PT09PT09PT09PT09PT3lvJXnlKjjgZPjgZPjgb7jgac9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQoKfWNhdGNoKGUpewoJR01fbG9nKGUpOwp9CgoKfS8vLS0tLS0tLS0tLS0tLWVjbCgp44GT44GT44G+44GnLS0tLS0tLS0tLS0tLS0tLS0tLS0KCgoKfSkoKTsK"},{"name":"MyDealz Link Swapper","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://www.mydealz.de/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1584468190294,"data":{}},"enabled":false,"position":28,"file_url":"https://gist.github.com/Brawl345/96103746f8ef5cce17b0bc38f3e104f1/raw/mydealz-link-swapper.user.js","uuid":"70d09790-1f3f-493f-8b8e-26ec5dbd4322","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBNeURlYWx6IExpbmsgU3dhcHBlcgovLyBAdmVyc2lvbiAgICAgIDEuMC4wCi8vIEBkZXNjcmlwdGlvbiAgWmVpZ3QgcmljaHRpZ2UgTGlua3MgYXVmIE15RGVhbHoKLy8gQGF1dGhvciAgICAgICBCcmF3bDM0NQovLyBAbWF0Y2ggICAgICAgIGh0dHBzOi8vd3d3Lm15ZGVhbHouZGUvKgovLyBAaWNvbiAgICAgICAgIGh0dHBzOi8vd3d3Lm15ZGVhbHouZGUvZmF2aWNvbi5pY28KLy8gQGRvd25sb2FkVVJMICBodHRwczovL2dpc3QuZ2l0aHViLmNvbS9CcmF3bDM0NS85NjEwMzc0NmY4ZWY1Y2NlMTdiMGJjMzhmM2UxMDRmMS9yYXcvbXlkZWFsei1saW5rLXN3YXBwZXIudXNlci5qcwovLyBAdXBkYXRlVVJMICAgIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyYXdsMzQ1Lzk2MTAzNzQ2ZjhlZjVjY2UxN2IwYmMzOGYzZTEwNGYxL3Jhdy9teWRlYWx6LWxpbmstc3dhcHBlci51c2VyLmpzCi8vIEBzdXBwb3J0VVJMICAgaHR0cHM6Ly9naXN0LmdpdGh1Yi5jb20vQnJhd2wzNDUvOTYxMDM3NDZmOGVmNWNjZTE3YjBiYzM4ZjNlMTA0ZjEjY29tbWVudHMKLy8gQGdyYW50ICAgICAgICBub25lCi8vID09L1VzZXJTY3JpcHQ9PQoKKGZ1bmN0aW9uKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIGNvbnN0IGxpbmtzID0gZG9jdW1lbnQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoImEiKTsKICAgIGNvbnN0IGxlbiA9IGxpbmtzLmxlbmd0aAogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBsZW47IGkrKykgewogICAgICAgIGNvbnN0IGxpbmsgPSBsaW5rc1tpXTsKICAgICAgICBpZiAobGluay50aXRsZSAhPT0gdW5kZWZpbmVkICYmIGxpbmsudGl0bGUuc3RhcnRzV2l0aCgiaHR0cCIpKSB7CiAgICAgICAgICAgIGxpbmsuaHJlZiA9IGxpbmsudGl0bGU7CiAgICAgICAgfQogICAgfQoKfSkoKTsK"},{"name":"Activate all Itch.io Bundle downloads","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["https://itch.io/bundle/download/*","https://*.itch.io/*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1596215832718,"data":{}},"enabled":false,"position":29,"uuid":"7a5e8de5-6e81-450f-a830-fdcce784ab39","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgIEFjdGl2YXRlIGFsbCBJdGNoLmlvIEJ1bmRsZSBkb3dubG9hZHMKLy8gQHZlcnNpb24gIDEKLy8gQGluY2x1ZGUgICAgICAgIGh0dHBzOi8vaXRjaC5pby9idW5kbGUvZG93bmxvYWQvKgovLyBAaW5jbHVkZSAgICAgICA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Y2soKTsKICB9Cn0KLDIwMDApOwp9KTsK","requires":[{"meta":{"name":"jquery.min.js","url":"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js","ts":1597161911107,"mimetype":"text/javascript"},"source":"LyohIGpRdWVyeSB2My40LjEgfCAoYykgSlMgRm91bmRhdGlvbiBhbmQgb3RoZXIgY29udHJpYnV0b3JzIHwganF1ZXJ5Lm9yZy9saWNlbnNlICovCiFmdW5jdGlvbihlLHQpeyJ1c2Ugc3RyaWN0Ijsib2JqZWN0Ij09dHlwZW9mIG1vZHVsZSYmIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUuZXhwb3J0cz9tb2R1bGUuZXhwb3J0cz1lLmRvY3VtZW50P3QoZSwhMCk6ZnVuY3Rpb24oZSl7aWYoIWUuZG9jdW1lbnQpdGhyb3cgbmV3IEVycm9yKCJqUXVlcnkgcmVxdWlyZXMgYSB3aW5kb3cgd2l0aCBhIGRvY3VtZW50Iik7cmV0dXJuIHQoZSl9OnQoZSl9KCJ1bmRlZmluZWQiIT10eXBlb2Ygd2luZG93P3dpbmRvdzp0aGlzLGZ1bmN0aW9uKEMsZSl7InVzZSBzdHJpY3QiO3ZhciB0PVtdLEU9Qy5kb2N1bWVudCxyPU9iamVjdC5nZXRQcm90b3R5cGVPZixzPXQuc2xpY2UsZz10LmNvbmNhdCx1PXQucHVzaCxpPXQuaW5kZXhPZixuPXt9LG89bi50b1N0cmluZyx2PW4uaGFzT3duUHJvcGVydHksYT12LnRvU3RyaW5nLGw9YS5jYWxsKE9iamVjdCkseT17fSxtPWZ1bmN0aW9uKGUpe3JldHVybiJmdW5jdGlvbiI9PXR5cGVvZiBlJiYibnVtYmVyIiE9dHlwZW9mIGUubm9kZVR5cGV9LHg9ZnVuY3Rpb24oZSl7cmV0dXJuIG51bGwhPWUmJmU9PT1lLndpbmRvd30sYz17dHlwZTohMCxzcmM6ITAsbm9uY2U6ITAsbm9Nb2R1bGU6ITB9O2Z1bmN0aW9uIGIoZ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keVdhaXQrKzprLnJlYWR5KCEwKX0say5pc0FycmF5PUFycmF5LmlzQXJyYXksay5wYXJzZUpTT049SlNPTi5wYXJzZSxrLm5vZGVOYW1lPUEsay5pc0Z1bmN0aW9uPW0say5pc1dpbmRvdz14LGsuY2FtZWxDYXNlPVYsay50eXBlPXcsay5ub3c9RGF0ZS5ub3csay5pc051bWVyaWM9ZnVuY3Rpb24oZSl7dmFyIHQ9ay50eXBlKGUpO3JldHVybigibnVtYmVyIj09PXR8fCJzdHJpbmciPT09dCkmJiFpc05hTihlLXBhcnNlRmxvYXQoZSkpfSwiZnVuY3Rpb24iPT10eXBlb2YgZGVmaW5lJiZkZWZpbmUuYW1kJiZkZWZpbmUoImpxdWVyeSIsW10sZnVuY3Rpb24oKXtyZXR1cm4ga30pO3ZhciBRdD1DLmpRdWVyeSxKdD1DLiQ7cmV0dXJuIGsubm9Db25mbGljdD1mdW5jdGlvbihlKXtyZXR1cm4gQy4kPT09ayYmKEMuJD1KdCksZSYmQy5qUXVlcnk9PT1rJiYoQy5qUXVlcnk9UXQpLGt9LGV8fChDLmpRdWVyeT1DLiQ9ayksa30pOwo="}]},{"name":"Tweak New Twitter","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://twitter.com/*","https://mobile.twitter.com/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1606763936073,"data":{}},"enabled":false,"position":30,"file_url":"https://greasyfork.org/scripts/387773-tweak-new-twitter/code/Tweak%20New%20Twitter.user.js","uuid":"aa309ae0-8106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uZGVmaW5lZCcpIHsKICBjaHJvbWUuc3RvcmFnZS5sb2NhbC5nZXQoKHN0b3JlZENvbmZpZykgPT4gewogICAgT2JqZWN0LmFzc2lnbihjb25maWcsIHN0b3JlZENvbmZpZykKICAgIG1haW4oKQogIH0pCn0KZWxzZSB7CiAgbWFpbigpCn0KLy8jZW5kcmVnaW9uCg=="},{"name":"SankakuAddon","options":{"check_for_updates":true,"compat_foreach":false,"compat_metadata":false,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://chan.sankakucomplex.com/*","https://idol.sankakucomplex.com/*","https://legacy.sankakucomplex.com/*"],"orig_noframes":true,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1607794040343,"data":{}},"enabled":true,"position":31,"file_url":"https://sleazyfork.org/scripts/23597-sankakuaddon/code/SankakuAddon.user.js","uuid":"0fa3b467-e989-4145-b0b0-4dded142818f","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgIFNhbmtha3VBZGRvbgovLyBAbmFtZXNwYWNlICAgU2Fua2FrdUFkZG9uCi8vIEBkZXNjcmlwdGlvbiBBZGRzIGEgZmV3IHF1YWxpdHkgb2YgbGlmZSBpbXByb3ZlbWVudHMgb24gU2Fua2FrdSBDaGFubmVsOiBBdXRvbWF0aWMgaW1hZ2Ugc2NhbGluZywgc2Nyb2xsaW5nIHRvIGltYWdlLCB0aHVtYm5haWwgaWNvbnMgZm9yIGxvdWQvYW5pbWF0ZWQgcG9zdHMsIG11dGluZy9wYXVzaW5nIHZpZGVvcywgKyAtIHRhZyBzZWFyY2ggYnV0dG9ucywgYSB0YWcgbWVudSB3aGljaCBhbGxvd3MgZm9yIHRhZ2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AgICBpZiAodHlwZW9mIHZhbHVlID09PSAnb2JqZWN0JykgewogICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBTZXQpICByZXR1cm4geyB0OiAnU2V0JywgdjogWy4uLnZhbHVlXSB9OwogICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBNYXApICByZXR1cm4geyB0OiAnTWFwJywgdjogWy4uLnZhbHVlXSB9OwogICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBIb3RrZXkpIHsKICAgICAgICByZXR1cm4geyB0OiAnSG90a2V5JywgdjogewogICAgICAgICAgICBtb2RpZmllcnM6IHZhbHVlLm1vZGlmaWVycywKICAgICAgICAgICAgYWN0aW9uOiB2YWx1ZS5hY3Rpb25fbmFtZSwKICAgICAgICAgIH0gfTsKICAgICAgfQogICAgfQoKICAgIHJldHVybiB2YWx1ZTsKICB9CgogIC8vIGVuYWJsZXMgSlNPTiB0byBwYXJzZSBTZXRzIGFuZCBIb3RrZXlzCiAgZnVuY3Rpb24ganNvbl9yZXZpdmVyKGtleSwgdmFsdWUpIHsKICAgIGlmICh0eXBlb2YgdmFsdWUgPT09ICdvYmplY3QnKSB7CiAgICAgIHN3aXRjaCAodmFsdWUudCkgewogICAgICAgIGNhc2UgJ1NldCc6CiAgICAgICAgICByZXR1cm4gbmV3IFNldCh2YWx1ZS52KTsKICAgICAgICBjYXNlICdNYXAnOgogICAgICAgICAgcmV0dXJuIG5ldyBNYXAodmFsdWUudik7CiAgICAgICAgY2FzZSAnSG90a2V5JzoKICAgICAgICAgIHJldHVybiBuZXcgSG90a2V5KHZhbHVlLnYuYWN0aW9uLCB2YWx1ZS52Lm1vZGlmaWVycyk7CiAgICAgIH0KICAgIH0KCiAgICByZXR1cm4gdmFsdWU7CiAgfQoKICBsZXQgYXBwbGllZF9jc3MgPSBmYWxzZTsKICBmdW5jdGlvbiBhZGp1c3RfY3NzKCkgewogICAgaWYgKGFwcGxpZWRfY3NzKSByZXR1cm47CiAgICBhcHBsaWVkX2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ciB1bCNuYXZiYXIgbGk6aG92ZXIgPiB1bCB7CiAgICAgICAgbWFyZ2luLXRvcDogM3B4OwogICAgICB9CiAgICBgKTsKCiAgICAvKiBSZW1vdmUgYmFyZWx5IHZpc2libGUgd2hpdGUgYm9yZGVyIGZyb20gc3VibmF2IGVsZW1lbnRzIGluIGxpZ2h0bW9kZSAqLwogICAgYWRkX3N0eWxlKGAKICAgICAgZGl2I2hlYWRlciB1bCNuYXZiYXIgbGkgewogICAgICAgIGJvcmRlci1jb2xvcjogdHJhbnNwYXJlbnQ7CiAgICAgIH0KICAgIGApOwoKICAgIC8qIHNpdGVmaXggZm9yIGJyb2tlbiBkZWxldGlvbiBwYWdlIGxheW91dCAqLwogICAgYWRkX3N0eWxlKGAKICAgICAgLyogY29tcGFyaXNvbiBib3ggKi8KICAgICAgI2NvbnRlbnQgPiAuZGVsZXRpbmctcG9zdCB7CiAgICAgICAgICBjbGVhcjogbGVmdDsgICAgLyogY2xlYXJmaXg6IGVuc3VyZSBib3ggc3RhcnRzIGJlbG93IGZpcnN0IHRodW1ibmFpbCAqLwogICAgICAgICAgb3ZlcmZsb3c6IGF1dG87IC8qIGZpdCBpdHMgY29udGVudCAqLwogICAgICB9CgogICAgICAvKiBiYWxhbmNlIG1hcmdpbnMgKi8KICAgICAgI2NvbnRlbnQgPiAuZGVsZXRpbmctcG9zdCB7CiAgICAgICAgICBwYWRkaW5nLXRvcDogMWVtOwogICAgICAgICAgcGFkZGluZy1ib3R0b206IDFlbTsKICAgICAgfQogICAgICAjY29udGVudCA+IC5kZWxldGluZy1wb3N0ID4gZGl2IHsKICAgICAgICAgIG1hcmdpbi10b3A6IHVuc2V0ICFpbXBvcnRhbnQ7IC8qIGltcG9ydGFudCBkdWUgdG8gaW5saW5lIHN0eWxlICovCiAgICAgICAgICBtYXJnaW4tYm90dG9tOiB1bnNldCAhaW1wb3J0YW50OwogICAgICB9CiAgICAgICNjb250ZW50ID4gLmRlbGV0aW5nLXBvc3QgPiB1bCB7CiAgICAgICAgICBtYXJnaW4tYm90dG9tOiB1bnNldDsKICAgICAgfQoKICAgICAgLyogYWxpZ24gZmlyc3QgdGh1bWJuYWlsIHdpdGggY29tcGFyaXNvbiBib3ggKi8KICAgICAgI2NvbnRlbnQgPiAudGh1bWIgewogICAgICAgICAgbWFyZ2luLWxlZnQ6IGNhbGMoNGVtICsgNHB4KTsKICAgICAgfQoKICAgICAgLyogY2VudGVyIHdhcm4gdGFncyAvIGVkaXQgZ2VhciBiZWxvdyB0aHVtYm5haWxzICovCiAgICAgICNjb250ZW50IC5kZWxldGluZy1wb3N0IC50aHVtYiA+ICogewogICAgICAgICAgbWFyZ2luOiBhdXRvOwogICAgICB9CiAgICBgKTsKCiAgICAvKiByZXBsYWNlIHRodW1ibmFpbCBjZW50ZXJpbmcgbG9naWMgKG1vcmUgcm9idXN0LCBuZWVkZWQgZm9yIHRodW1ibmFpbCBpY29ucykgKi8KICAgIGFkZF9zdHlsZShgCiAgICAgIHNwYW4udGh1bWIgewogICAgICAgICAgZGlzcGxheTogZ3JpZDsKICAgICAgICAgIHBsYWNlLWNvbnRlbnQ6IGNlbnRlcjsKICAgICAgfQoKICAgICAgaW1nLnByZXZpZXcgewogICAgICAgICAgcG9zaXRpb246IHN0YXRpYzsKICAgICAgfQoKICAgICAgLyogbmVlZGVkIGZvciB0aHVtYm5haWwgaWNvbnMgKi8KICAgICAgLnRodW1iIGEgewogICAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTsKICAgICAgfQogICAgYCk7CgogICAgLyogY3VzdG9tIHN0eWxlIGZvciB0YWcgbWVudSAqLwogICAgYWRkX3N0eWxlKGAKICAgICAgI3RhZ19tZW51IC50YWdfYnV0dG9uIHsKICAgICAgICBwYWRkaW5nLWxlZnQ6IDVweDsKICAgICAgICBwYWRkaW5nLXJpZ2h0OiA1cHg7CiAgICAgICAgYm9yZGVyLXN0eWxlOiBzb2xpZDsKICAgICAgICBib3JkZXItd2lkdGg6IDFweDsKICAgICAgfQoKICAgICAgI3RhZ19tZW51IC50YWdfbGlzdCB7CiAgICAgICAgZGlzcGxheTogZmxleDsKICAgICAgICBmbGV4LXdyYXA6IHdyYXA7CiAgICAgICAgYWxpZ24tY29udGVudDogZmxleC1zdGFydDsKICAgICAgICBhbGlnbi1pdGVtczogZmxleC1zdGFydDsKICAgICAgICBtYXJnaW46IDA7CiAgICAgICAgcGFkZGluZzogMDsKICAgICAgfQoKICAgICAgI3RhZ19tZW51IC50YWdfbm9uZXhpc3RlbnQgewogICAgICAgIGNvbG9yOiAjRTAwOwogICAgICB9CiAgICBgKTsKICB9CgoKICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwogIC8qIGNvbmZpZ3VyYXRpb24gZnVuY3Rpb25zICovCiAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKi8KCiAgY29uc3QgSVNfSURPTCA9ICh3aW5kb3cubG9jYXRpb24uaG9zdG5hbWUgPT09ICdpZG9sLnNhbmtha3Vjb21wbGV4LmNvbScgPyAxIDogMCk7CiAgY29uc3QgSElTVE9SWV9LRVkgPSAoSVNfSURPTCA/ICd2aWV3X2hpc3RvcnlfaWRvbCcgOiAndmlld19oaXN0b3J5Jyk7CiAgY29uc3QgQ09NTU9OX1RBR1NfS0VZUyA9IFsnY29tbW9uX3RhZ3NfanNvbicsICdjb21tb25fdGFnc19qc29uX2lkb2wnXTsKICBjb25zdCBDT01NT05fVEFHU19LRVkgPSBDT01NT05fVEFHU19LRVlTW0lTX0lET0xdOwogIGNvbnN0IE9USEVSX0NPTU1PTl9UQUdTX0tFWSA9IENPTU1PTl9UQUdTX0tFWVNbMSAtIElTX0lET0xdOwoKICBjb25zdCBIT1RLRVlfQUNUSU9OUyA9IHsgLy8gYWN0aW9ucyBuZWVkIHVuaXF1ZSBuYW1lcyAoZm9yIHNlcmlhbGl6YXRpb24pCiAgICBwb3N0cGFnZTogewogICAgICByZXNldF9zaXplOiAoKSA9PiB7CiAgICAgICAgc2NhbGVfaW1hZ2UoU0NBTE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llczogWydwb3N0JywgJ2dlbmVyYWwnXSwKICAgIH0sCiAgICBlZGl0aW5nOiB7CiAgICAgIG5hbWU6ICdFZGl0aW5nJywKICAgICAgY2F0ZWdvcmllczogWydlZGl0aW5nJ10sCiAgICB9LAogICAgaG90a2V5czogewogICAgICBuYW1lOiAnSG90a2V5cycsCiAgICAgIGNhdGVnb3JpZXM6IFsncG9zdHBhZ2VfaG90a2V5cycsICdpbmRleHBhZ2VfaG90a2V5cyddLAogICAgfSwKICB9OwoKICBjb25zdCBDT05GSUdfQ0FURUdPUllfVEVNUExBVEUgPSB7CiAgICBwb3N0OiB7CiAgICAgIG5hbWU6ICdJbWFnZS9WaWRlbycsCiAgICAgIGVudHJpZXM6IFsKICAgICAgICAnc2Nyb2xsX3RvX2ltYWdlJywKICAgICAgICAnc2Nyb2xsX3RvX2ltYWdlX2NlbnRlcicsCiAgICAgICAgJ3NjYWxlX2ltYWdlJywKICAgICAgICAnc2NhbGVfb25seV9kb3duc2NhbGUnLAogICAgICAgICdzY2FsZV9mbGFzaCcsCiAgICAgICAgJ3NjYWxlX29uX3Jlc2l6ZScsCiAgICAgICAgJ3NjYWxlX21vZGUnLAogICAgICAgICdsb2FkX2hpZ2hyZXMnLAogICAgICAgICd2aWRlb19wYXVzZScsCiAgICAgICAgJ3ZpZGVvX211dGUnLAogICAgICAgICdzZXRfdmlkZW9fdm9sdW1lJywKICAgICAgICAndmlkZW9fY29udHJvbHMnLAogICAgICBdLAogICAgfSwKICAgIGdlbmVyYWw6IHsKICAgICAgbmFtZTogJ0dlbmVyYWwnLAogICAgICBlbnRyaWVzOiBbCiAgICAgICAgJ3RhZ19zZWFyY2hfYnV0dG9ucycsCiAgICAgICAgJ29yX3RhZ19zZWFyY2hfYnV0dG9uJywKICAgICAgICAndGFnX2NhdGVnb3J5X2NvbGxhcHNlcicsCiAgICAgICAgJ3RhZ19jYXRlZ29yeV9jb2xsYXBzZXJfc3R5bGUnLAogICAgICAgICdzaG93X3NwZWFrZXJfaWNvbicsCiAgICAgICAgJ3Nob3dfYW5pbWF0ZWRfaWNvbicsCiAgICAgICAgJ3Nob3dfcmF0aW5nc19pY29uJywKICAgICAgICAndmlld19oaXN0b3J5X2VuYWJsZWQnLAogICAgICAgICdwb3N0X2JvcmRlcl9zdHlsZScsCiAgICAgICAgJ2hpZGVfaGVhZGVybG9nbycsCiAgICAgICAgJ3Nhbmtha3VfY2hhbm5lbF9kYXJrX2NvbXBhdGliaWxpdHknLAogICAgICBdLAogICAgfSwKICAgIGVkaXRpbmc6IHsKICAgICAgbmFtZTogJ0VkaXRpbmcnLAogICAgICBlbnRyaWVzOiBbCiAgICAgICAgJ2FkZF9maWxldHlwZV9zdGF0JywKICAgICAgICAnbW92ZV9zdGF0c190b19lZGl0X2Zvcm0nLAogICAgICAgICdzZXRwYXJlbnRfZGVsZXRlcG90ZW50aWFsZHVwbGljYXRlJywKICAgICAgICAnZWRpdGZvcm1fZGVsZXRldXNlbGVzc3RhZ3MnLAogICAgICAgICd0YWdfbWVudScsCiAgICAgICAgQ09NTU9OX1RBR1NfS0VZLAogICAgICAgICd0YWdfbWVudV9sYXlvdXQnLAogICAgICAgICd3aWtpX3RlbXBsYXRlJywKICAgICAgICAncmVjb3JkX3RlbXBsYXRlJywKICAgICAgICAndGFnc2NyaXB0X3ByZXNldHMnLAogICAgICBdLAogICAgfSwKICAgIHBvc3RwYWdlX2hvdGtleXM6IHsKICAgICAgbmFtZTogJ1Bvc3QgUGFnZSBIb3RrZXlzJywKICAgICAgZW50cmllczogW10sCiAgICB9LAogICAgaW5kZXhwYWdlX2hvdGtleXM6IHsKICAgICAgbmFtZTogJ0luZGV4IFBhZ2UgSG90a2V5cycsCiAgICAgIGVudHJpZXM6IFtdLAogICAgfSwKICB9OwoKICAvLyBleHBhbmQgaG90a2V5cwogIGZvciAoY29uc3QgW3BhZ2UsIGFjdGlvbnNdIG9mIE9iamVjdC5lbnRyaWVzKEhPVEtFWV9BQ1RJT05TKSkgewogICAgZm9yIChj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aW5nLCBzbyBpdCBkb2VzblwndCB3b3JrIHdlbGwgd2hlbiB1c2luZyB0aGUgbWFudWFsIHNjYWxpbmcgYWN0aW9ucy4nfSwKICAgIHNjYWxlX21vZGU6ICAgICAgICAgICAgICAgICAgICAgICAgIHt0eXBlOiAnc2VsZWN0JywgICBkZXNjOiAnU2NhbGUgaW1hZ2UvdmlkZW8gbW9kZTogJywgb3B0aW9uczogezA6ICdGaXQgdG8gd2luZG93JywgMTogJ0ZpdCBob3Jpem9udGFsbHknLCAyOiAnRml0IHZlcnRpY2FsbHknfX0sCiAgICBsb2FkX2hpZ2hyZXM6ICAgICAgICAgICAgICAgICAgICAgICB7dHlwZTogJ2NoZWNrYm94JywgZGVzYzogJ0xvYWQgb3JpZ2luYWwgaW1hZ2UgaWYgc21hbGxlciB0aGFuICcsIHRpdGxlOiAnU2V0IHRvIDAgYnl0ZXMgdG8gYWx3YXlzIGxvYWQnfSwKICAgIHZpZGVvX3BhdXNlOiAgICAgICAgICAgICAgICAgICAgICAgIHt0eXBlOiAnY2hlY2tib3gnLCBkZXNjOiAnUGF1c2UgKG5vbi1mbGFzaCkgdmlkZW9zKid9LAogICAgdmlkZW9fbXV0ZTogICAgICAgICAgICAgICAgICAgICAgICAge3R5cGU6ICdjaGVja2JveCcsIGRlc2M6ICdNdXRlIChub24tZmxhc2gpIHZpZGVvcyonfSwKICAgIHNldF92aWRlb192b2x1bWU6ICAgICAgICAgICAgICAgICAgIHt0eXBlOiAnY2hlY2tib3gnLCBkZXNjOiAnU2V0IChub24tZmxhc2gpIHZpZGVvIHZvbHVtZSB0bzogJ30sCiAgICB2aWRlb19jb250cm9sczogICAgICAgICAgICAgICAgICAgICB7dHlwZTogJ2NoZWNrYm94JywgZGVzYzogJ1Nob3cgdmlkZW8gY29udHJvbHMqJ30sCiAgICB0YWdfc2VhcmNoX2J1dHRvbnM6ICAgICAgICAgICAgICAgICB7dHlwZTogJ2NoZWNrYm94JywgZGVzYzogJ0VuYWJsZSArIC0g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AgIHRoaXMudGFncyA9IG5ldyBTZXQodGFnX3N0ci50cmltKCkuc3BsaXQoL1xzKy8pLmZpbHRlcih0ID0+IHQubGVuZ3RoICE9PSAwKSk7CiAgICB9CgogICAgc3RhdGljIGludmVydCh0YWcpIHsKICAgICAgY29uc3QgbWludXMgPSB0YWcuc3RhcnRzV2l0aCgnLScpOwogICAgICByZXR1cm4gbWludXMgPyB0YWcuc3Vic3RyaW5nKDEpIDogYC0ke3RhZ31gOwogICAgfQoKICAgIGhhcyh0YWcpIHsKICAgICAgcmV0dXJuIHRoaXMudGFncy5oYXModGFnKTsKICAgIH0KCiAgICBhZGQodGFnKSB7CiAgICAgIHRoaXMudGFncy5hZGQodGFnKTsKICAgICAgdGhpcy50YWdzLmRlbGV0ZShUYWdzLmludmVydCh0YWcpKTsKICAgIH0KCiAgICByZW1vdmUodGFnKSB7CiAgICAgIHRoaXMudGFncy5kZWxldGUodGFnKTsKICAgIH0KCiAgICB0b2dnbGUodGFnKSB7CiAgICAgIGlmICh0aGlzLmhhcyh0YWcpKSB7CiAgICAgICAgdGhpcy5yZW1vdmUodGFnKTsKICAgICAgfSBlbHNlIHsKICAgICAgICB0aGlzLmFkZCh0YWcpOwogICAgICB9CiAgICB9CgogICAgZmlsdGVyKHByZWQpIHsKICAgICAgdGhpcy50YWdzID0gbmV3IFNldChbLi4udGhpcy50YWdzXS5maWx0ZXIocHJlZCkpOwogICAgICByZXR1cm4gdGhpczsKICAgIH0KCiAgICBbU3ltYm9sLml0ZXJhdG9yXSgpIHsKICAgICAgcmV0dXJuIHRoaXMudGFncy52YWx1ZXMoKTsKICAgIH0KCiAgICB0b0FycmF5KCkgewogICAgICByZXR1cm4gWy4uLnRoaXMudGFnc107CiAgICB9CgogICAgdG9TdHJpbmcoKSB7CiAgICAgIHJldHVybiBbLi4udGhpcy50YWdzXS5qb2luKCcgJyk7CiAgICB9CiAgfQoKICBmdW5jdGlvbiBzZXRfY29va2llKG5hbWUsIHZhbHVlLCB2YWxpZ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7cGFnZX1faG90a2V5cy4ke25hbWV9X2tleWApLnZhbHVlOwogICAgICBpZiAoa2V5Lmxlbmd0aCAhPT0gMCkgewogICAgICAgIGhvdGtleXNba2V5XSA9IG5ldyBIb3RrZXkobmFtZSwgbW9kaWZpZXJzKTsKICAgICAgfQogICAgfQoKICAgIHJldHVybiBob3RrZXlzOwogIH0KCiAgZnVuY3Rpb24gdXBkYXRlX2hvdGtleXMocGFnZSkgewogICAgLy8gcmVzZXQgYWxsIGhvdGtleSBjb25maWcgZWxlbWVudHMKICAgIGZvciAoY29uc3QgbmFtZSBvZiBPYmplY3Qua2V5cyhIT1RLRVlfQUNUSU9OU1twYWdlXSkpIHsKICAgICAgZm9yIChjb25zdCBtb2Qgb2YgWydjdHJsJywgJ2FsdCcsICdzaGlmdCddKSB7CiAgICAgICAgY29uc3QgZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChgJHtLRVlfUFJFRklYfSR7cGFnZX1faG90a2V5cy4ke25hbWV9XyR7bW9kfWApOwogICAgICAgIGlmIChlbCAhPT0gbnVsbCkKICAgICAgICAgIGVsLmNoZWNrZWQgPSBmYWxzZTsKICAgICAgfQogICAgICBjb25zdCBlbCA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKGAke0tFWV9QUkVGSVh9JHtwYWdlfV9ob3RrZXlzLiR7bmFtZX1fa2V5YCk7CiAgICAgIGlmIChlbCAhPT0gbnVsbCkKICAgICAgICBlbC52YWx1ZSA9ICcnOwogICAgfQoKICAgIC8vIHVwZGF0ZSBob3RrZXkgY29uZmlnIGVsZW1lbnRzCiAgICBmb3IgKGNvbnN0IFtrLCB2XSBvZiBPYmplY3QuZW50cmllcyhjb25maWdbYCR7cGFnZX1faG90a2V5c2BdKSkgewogICAgICBjb25zdCBrZXlfZWwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChgJHtLRVlfUFJFRklYfSR7cGFnZX1faG90a2V5cy4ke3YuYWN0aW9uX25hbWV9X2tleWApOwogIC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HJpbmdzIChzcGFjZSBzZXBhcmF0ZWQgdGFncyksIGFycmF5cyBjb250YWluaW5nIG9uZSBzdHJpbmcgKHJlcHJlc2VudGluZyBhIGdyb3VwKQogICAgLy8gb3IgYXJyYXlzIG9mIGFycmF5IGNvbnRhaW5pbmcgb25lIHN0cmluZyAocmVwcmVzZW50aW5nIGEgdGFibGUpCiAgICAvLyBleC4gWyB7ICJuYW1lIjoiY29tbW9uIHRhZ3MiLCAidGFncyI6WyAidGFnMSB0YWcyIiwgWyJncm91cGVkX3RhZzEgZ3JvdXBlZF90YWcyIl0gLCAidGFnMyB0YWc0Il0gfSwgeyAibmFtZSI6InVuY29tbW9uIHRhZ3MiLCAidGFncyI6WyAidDEgdDIgdDMiIF19IF0KICAgIGxldCB0YWdfZGF0YTsKICAgIHRyeSB7CiAgICAgIHRhZ19kYXRhID0gSlNPTi5wYXJzZShjb25maWdbQ09NTU9OX1RBR1NfS0VZXSk7CiAgICB9IGNhdGNoIChlcnJvcikgewogICAgICBzaG93X25vdGljZShjb25zb2xlLmVycm9yLCAnW2FkZG9uIGVycm9yXSAiY29tbW9uIHRhZ3MiIEpTT04gc3ludGF4IGVycm9yJywgZXJyb3IpOwogICAgICByZXR1cm47CiAgICB9CgogICAgaWYgKCFBcnJheS5pc0FycmF5KHRhZ19kYXRhKSkgewogICAgICBzaG93X25vdGljZShjb25zb2xlLmVycm9yLCAnW2FkZG9uIGVycm9yXSAiY29tbW9uIHRhZ3MiIG5lZWRzIHRvIGJlIGFuIGFycmF5IG9mIG9iamVjdHMnKTsKICAgICAgcmV0dXJuOwogICAgfQoKICAgIHdoaWxlIChjb21tb25fdGFnc19lbGVtLmhhc0NoaWxkTm9kZXMoKSkKICAgICAgY29tbW9uX3RhZ3NfZWxlbS5yZW1vdmVDaGlsZChjb21tb25fdGFnc19lbGVtLmxhc3RDaGlsZCk7CgogICAgZm9yIChsZXQgayA9IDA7IGsgPCB0YWdfZGF0YS5sZW5ndGg7IGsrKykgewogICAgICBj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k7CiAgICAgICAgfSBlbHNlIHsKICAgICAgICAgIGVsLnN0eWxlLmJvcmRlciA9ICcxcHggc29saWQgJyArIHJnYl9hcnJheV90b19yZ2IocmdiX2FycmF5X3NoaWZ0KHJnYiwgLTY0KSk7CiAgICAgICAgICBlbC5zdHlsZS5iYWNrZ3JvdW5kQ29sb3IgPSByZ2JfYXJyYXlfdG9fcmdiKHJnYl9hcnJheV9zaGlmdChyZ2IsIC0zMikpOwogICAgICAgIH0KICAgICAgfTsKCiAgICAgIGZvciAoY29uc3QgbGlzdF90YWcgb2YgbGlzdF90YWdzKSB7CiAgICAgICAgY29uc3QgaXNfYXJyYXkgPSBBcnJheS5pc0FycmF5KGxpc3RfdGFnKTsKCiAgICAgICAgLy8gZmluZCB0YWdzX3R5cGUKICAgICAgICBsZXQgdGFnc190eXBlOwogICAgICAgIGlmIChpc19hcnJheSkgewogICAgICAgICAgaWYgKGxpc3RfdGFnLmxlbmd0aCA9PT0gMCkgewogICAgICAgICAgICBzaG93X25vdGljZShjb25zb2xlLmVycm9yLCAnW2FkZG9uIGVycm9yXSAiY29tbW9uIHRhZ3MiICJ0YWdzIiBhcnJheSBjb250YWlucyBhbiBlbXB0eSBhcnJheScpOwogICAgICAgICAgICByZXR1cm47CiAgICAgICAgICB9CgogICAgICAgICAgLy8gY2hlY2sgd2hhdCB0aGUgYXJyYXkgY29uc2lzdHMgb2YKICAgICAgICAgIGxldCBhbGxfYXJyYXlzID0gdHJ1ZTsKICAgICAgICAgIGxldCBub19hcnJheXMgPSB0cnVlOwogICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaXN0X3RhZy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBpZiAoIUFycmF5LmlzQXJyYXkobGlzdF90YWdbaV0pKSB7CiAgICAgICAgICAgICAgYWxsX2FycmF5cyA9IGZhbHNlOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgIG5vX2FycmF5cyA9IGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICB9CgogICAgICAgICAgaWYgKGFsbF9hcnJheXMpIHsKICAgICAgICAgICAgdGFnc190eXBlID0gVEFHU19UWVBFUy5UQUJMRTsKICAgICAgICAgIH0gZWxzZSBpZiAobm9fYXJyYXlzKSB7CiAgICAgICAgICAgIHRhZ3NfdHlwZSA9IFRBR1NfVFlQRVMuR1JPVVA7CiAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBzaG93X25vdGljZShjb25zb2xlLmVycm9yLCAnW2FkZG9uIGVycm9yXSAiY29tbW9uIHRhZ3MiICJ0YWdzIiBhcnJheSBjb250YWlucyBhbiBhcnJheSB3aGljaCBpcyBuZWl0aGVyIGEgZ3JvdXAgbm9yIGEgdGFibGUnKTsKICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgfQogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICB0YWdzX3R5cGUgPSBUQUdTX1RZUEVTLkxJU1Q7CiAgICAgICAgfQoKICAgICAgICBpZiAodGFnc190eXBlID09PSBUQUdTX1RZUEVTLlRBQkxFKSB7CiAgICAgICAgICBjb25zdCB0YWdzX3RhYmxlID0gW107CiAgICAgICAgICBmb3IgKGxldCBqID0gMDsgaiA8IGxpc3RfdGFnLmxlbmd0aDsgaisrKSB7CiAgICAgICAgICAgIGlmIChsaXN0X3RhZ1tqXS5sZW5ndGggIT09IDEpIHsKICAgICAgICAgICAgICBzaG93X25vdGljZShjb25zb2xlLmVycm9yLCAnW2FkZG9uIGVycm9yXSAiY29tbW9uIHRhZ3MiICJ0YWdzIiBhcnJheSBjb250YWlucyBhIHRhYmxlIGVudHJ5IHdpdGggbm90IGV4YWN0bHkgMSB0YWdzIHN0cmluZycpOwogICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgdGFnc190YWJsZS5wdXNoKG5ldyBUYWdzKGxpc3RfdGFnW2pdWzBdKS50b0FycmF5KCkpOwogICAgICAgICAgfQoKICAgICAgICAgIGNvbnN0I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3NfdGFibGVbcm93XVtjb2xdLCB0cnVlKSwgJzFweCcpKTsKICAgICAgICAgICAgICB0ci5hcHBlbmRDaGlsZCh0ZCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdGFibGUuYXBwZW5kQ2hpbGQodHIpOwogICAgICAgICAgfQoKICAgICAgICAgIGNvbnN0IGRpdiA9IGNyZWF0ZV90b3BfbGV2ZWxfZGl2KCcwIDNweCAwIDNweCcpOwogICAgICAgICAgZGl2LmFwcGVuZENoaWxkKHRhYmxlKTsKICAgICAgICAgIGxpc3RfZmxleC5hcHBlbmRDaGlsZChkaXYpOwogICAgICAgIH0gZWxzZSBpZiAodGFnc190eXBlID09PSBUQUdTX1RZUEVTLkdST1VQKSB7CiAgICAgICAgICBpZiAobGlzdF90YWcubGVuZ3RoICE9PSAxKSB7CiAgICAgICAgICAgIHNob3dfbm90aWNlKGNvbnNvbGUuZXJyb3IsICdbYWRkb24gZXJyb3JdICJjb21tb24gdGFncyIgInRhZ3MiIGFycmF5IGNvbnRhaW5zIGEgZ3JvdXAgd2l0aCBub3QgZXhhY3RseSAxIHRhZ3Mgc3RyaW5nJyk7CiAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgIH0KCiAgICAgICAgICBjb25zdCB0YWdzID0gbGlzdF90YWdbMF0udHJpbSgpLnNwbGl0KC9ccysvKTsKCiAgICAgICAgICAvLyA8ZGl2IChmbGV4Ym94KT48ZGl2PjxkaXYgKGJ1dHRvbik+CiAgICAgICAgICBjb25zdCBncm91cF9kaXYgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdESVYnKTsKICAgICAgICAgIGdyb3VwX2Rpdi5zdHlsZS5kaXNwbGF5ID0gJ2lubGluZS1ibG9jayc7CiAgICAgICAgICBncm91cF9zdHlsZShncm91cF9kaXYpOwoKICAgICAgICAgIGZvciAoY29uc3QgdGFnIG9mIHRhZ3MpCiAgICAgICAgICAgIGdyb3VwX2Rpdi5hcHBlbmRDaGlsZCh3cmFwX2luX2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5hY2Nlc3NLZXkgPSBjb2RlOwogICAgICAgIGJ0bi50aXRsZSA9CiAgICAgICAgICBjb2RlID09PSAnYicgPyAnYm9sZCcgOgogICAgICAgICAgICBjb2RlID09PSAnaScgPyAnaXRhbGljJyA6CiAgICAgICAgICAgICAgY29kZSA9PT0gJ3MnID8gJ3N0cmlrZXRocm91Z2gnIDoKICAgICAgICAgICAgICAgIGNvZGUgPT09ICd1JyA/ICd1bmRlcmxpbmUnIDogJyc7CiAgICAgIH0gZWxzZSB7CiAgICAgICAgYnRuLmFjY2Vzc0tleSA9CiAgICAgICAgICBjb2RlID09PSAnY29kZScgICAgPyAnYycgOgogICAgICAgICAgICBjb2RlID09PSAncXVvdGUnICAgPyAncScgOgogICAgICAgICAgICAgIGNvZGUgPT09ICdzcG9pbGVyJyA/ICdvJyA6CiAgICAgICAgICAgICAgICBjb2RlID09PSAnW1suLi5dXScgPyAndycgOgogICAgICAgICAgICAgICAgICBjb2RlID09PSAne3suLi59fScgPyAncCcgOgogICAgICAgICAgICAgICAgICAgIGNvZGUgPT09ICdVUkwnICAgICA/ICdsJyA6ICcnOwoKICAgICAgICBpZiAoY29kZSA9PT0gJ1tbLi4uXV0nKSBidG4udGl0bGUgPSAnYWNjZXNza2V5OiB3JzsKICAgICAgICBpZiAoY29kZSA9PT0gJ3t7Li4ufX0nKSBidG4udGl0bGUgPSAnYWNjZXNza2V5OiBwJzsKICAgICAgfQoKICAgICAgY29uc3QgdSA9IC8vIGNoYXJhY3RlciB0byB1bmRlcmxpbmUKICAgICAgICBjb2RlID09PSAnY29kZScgICAgPyAwIDoKICAgICAgICAgIGNvZGUgPT09ICdxdW90ZScgICA/IDAgOgogICAgICAgICAgICBjb2RlID09PSAnc3BvaWxlcicgPyAyIDoKICAgICAgICAgICAgICBjb2RlID09PSAnVVJMJyAgICAgPyAyIDoKICAgICAgICAgICAgICAgIGNvZGUubGVuZ3RoID09PSAxICA/IDAgOiAtMTsKCiAgICAgIGlmICh1ICE9PSAtMS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gogICAgICAgIGRlbGV0aW9uX3Nhbml0eV9jaGVja3MoKTsKCiAgICAgICAgYnJlYWs7CgogICAgICBjYXNlIFBhZ2UuTW9kZXJhdGU6CiAgICAgICAgYWRkX21vZGVyYXRpb25fc2VhcmNoX3RlbXBsYXRlKCk7CgogICAgICAgIGJyZWFrOwogICAgfQogIH0KCiAgaWYgKGRvY3VtZW50LnJlYWR5U3RhdGUgPT09ICdjb21wbGV0ZScgfHwgZG9jdW1lbnQucmVhZHlTdGF0ZSA9PT0gJ2xvYWRlZCcgfHwgZG9jdW1lbnQucmVhZHlTdGF0ZSA9PT0gJ2ludGVyYWN0aXZlJykgewogICAgaW5pdCgpLmNhdGNoKChyZWFzb24pID0+IHsKICAgICAgc2hvd19ub3RpY2UoY29uc29sZS5lcnJvciwgJ1thZGRvbiBlcnJvcl0gaW5pdCgpIGZhaWxlZCwgY2hlY2sgY29uc29sZScsIHJlYXNvbik7CiAgICB9KTsKICB9IGVsc2UgewogICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcignRE9NQ29udGVudExvYWRlZCcsIGluaXQsIGZhbHNlKTsKICB9Cn0pKHR5cGVvZiB1bnNhZmVXaW5kb3cgIT09ICd1bmRlZmluZWQnID8gdW5zYWZlV2luZG93IDogd2luZG93KTsK"},{"name":"Instagram - Allow right click on images","options":{"awareOfChrome":false,"check_for_updates":true,"comment":null,"compat_arrayleft":false,"compat_foreach":false,"compat_forvarin":false,"compat_metadata":false,"compat_uW_gmonkey":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":["http://instagram.com/*","https://instagram.com/*","http://*.instagram.com/*","https://*.instagram.com/*"],"orig_matches":[],"orig_noframes":null,"orig_run_at":"document-start","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1616865637883,"data":{}},"enabled":true,"position":32,"file_url":"https://greasyfork.org/scripts/424063-instagram-allow-right-click-on-images/code/Instagram%20-%20Allow%20right%20click%20on%20images.user.js","uuid":"d5b50f42-2f3d-43d4-8f05-a8fb1dfceb48","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgSW5zdGFncmFtIC0gQWxsb3cgcmlnaHQgY2xpY2sgb24gaW1hZ2VzCi8vIEBuYW1lc3BhY2UgZ2l0aHViLmNvbS9CcmF3bDM0NQovLyBAdmVyc2lvbiAxLjAuMAovLyBAZGVzY3JpcHRpb24gQWxsb3cgcmlnaHQtY2xpY2tpbmcgb24gaW1hZ2VzIG9uIEluc3RhZ3JhbQovLyBAYXV0aG9yIEJyYXdsIChodHRwczovL2dpdGh1Yi5jb20vQnJhd2wzNDUpCi8vIEBsaWNlbnNlIFVubGljZW5zZQovLyBAZ3JhbnQgR01fYWRkU3R5bGUKLy8gQHJ1bi1hdCBkb2N1bWVudC1zdGFydAovLyBAaW5jbHVkZSBodHRwOi8vaW5zdGFncmFtLmNvbS8qCi8vIEBpbmNsdWRlIGh0dHBzOi8vaW5zdGFncmFtLmNvbS8qCi8vIEBpbmNsdWRlIGh0dHA6Ly8qLmluc3RhZ3JhbS5jb20vKgovLyBAaW5jbHVkZSBodHRwczovLyouaW5zdGFncmFtLmNvbS8qCi8vID09L1VzZXJTY3JpcHQ9PQoKKGZ1bmN0aW9uKCkgewpsZXQgY3NzID0gYAouX292ZzNnLCAuX3NpN2R5LCAuXzlBaEgwIHsKICAgIGRpc3BsYXk6IG5vbmU7CiAgfQpgOwppZiAodHlwZW9mIEdNX2FkZFN0eWxlICE9PSAidW5kZWZpbmVkIikgewogIEdNX2FkZFN0eWxlKGNzcyk7Cn0gZWxzZSB7CiAgbGV0IHN0eWxlTm9kZSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoInN0eWxlIik7CiAgc3R5bGVOb2RlLmFwcGVuZENoaWxkKGRvY3VtZW50LmNyZWF0ZVRleHROb2RlKGNzcykpOwogIChkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCJoZWFkIikgfHwgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50KS5hcHBlbmRDaGlsZChzdHlsZU5vZGUpOwp9Cn0pKCk7Cg=="},{"name":"Sankaku Complex - Kill lazy load","options":{"check_for_updates":true,"comment":null,"compat_foreach":false,"compat_metadata":false,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["https://www.sankakucomplex.com/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1623616164987,"data":{}},"enabled":true,"position":33,"uuid":"c2d0c99d-4342-400f-8696-f1907d7bcafc","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgU2Fua2FrdSBDb21wbGV4IC0gS2lsbCBsYXp5IGxvYWQKLy8gQG5hbWVzcGFjZSBnaXRodWIuY29tL0JyYXdsMzQ1Ci8vIEBtYXRjaCBodHRwczovL3d3dy5zYW5rYWt1Y29tcGxleC5jb20vKgovLyBAZ3JhbnQgbm9uZQovLyA9PS9Vc2VyU2NyaXB0PT0KCmNvbnN0IHJ1biA9ICgpID0+IHsKICAgIGNvbnN0IGltYWdlcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJ2ltZ1tkYXRhLWxhenktc3JjXScpOwoKICAgIC8vIExvYWQgYWxsOiBTTE9XISEhCiAgICAvLyBpbWFnZXMuZm9yRWFjaChpbWFnZSA9PiBpbWFnZS5zcmMgPSBpbWFnZS5kYXRhc2V0LmxhenlTcmMpOwoKICAgIGltYWdlcy5mb3JFYWNoKGltYWdlID0+IHsKICAgICAgICBjb25zdCBzcmNzZXQgPSBpbWFnZS5kYXRhc2V0LmxhenlTcmNzZXQuc3BsaXQoJywnKTsKICAgICAgICBpbWFnZS5zcmMgPSBzcmNzZXRbc3Jjc2V0Lmxlbmd0aCAtIDFdLnNwbGl0KCcgJylbMV07CiAgICB9KQoKfQoKcnVuKCk7"},{"name":"Substitute","options":{"check_for_updates":true,"comment":null,"compat_foreach":false,"compat_metadata":false,"compat_prototypes":false,"compat_wrappedjsobject":false,"compatopts_for_requires":true,"noframes":null,"override":{"merge_connects":true,"merge_excludes":true,"merge_includes":true,"merge_matches":true,"orig_connects":[],"orig_excludes":[],"orig_includes":[],"orig_matches":["*://*/*"],"orig_noframes":null,"orig_run_at":"document-idle","use_blockers":[],"use_connects":[],"use_excludes":[],"use_includes":[],"use_matches":[]},"run_at":null,"tab_types":null,"compat_powerful_this":null},"storage":{"ts":1638478905313,"data":{"substitute_dict":"s[{\"key\":\"S*x\",\"value\":\"Sex\",\"img\":false},{\"key\":\"Under*ear\",\"value\":\"Underwear\",\"img\":false},{\"key\":\"s*x\",\"value\":\"sex\",\"img\":false},{\"key\":\"S** \",\"value\":\"Sex \",\"img\":false},{\"key\":\"\",\"value\":\"-\",\"img\":false}]"}},"enabled":false,"position":34,"file_url":"https://github.com/LenAnderson/Substitute/raw/master/substitute.user.js","uuid":"417e63ef-c6ba-417f-83f4-abfca3335a8b","source":"Ly8gPT1Vc2VyU2NyaXB0PT0KLy8gQG5hbWUgICAgICAgICBTdWJzdGl0dXRlCi8vIEBuYW1lc3BhY2UgICAgaHR0cHM6Ly9naXRodWIuY29tL0xlbkFuZGVyc29uLwovLyBAZG93bmxvYWRVUkwgIGh0dHBzOi8vZ2l0aHViLmNvbS9MZW5BbmRlcnNvbi9TdWJzdGl0dXRlL3Jhdy9tYXN0ZXIvc3Vic3RpdHV0ZS51c2VyLmpzCi8vIEB2ZXJzaW9uICAgICAgMC40Ci8vIEBkZXNjcmlwdGlvbiAgUmVwbGFjZSB0ZXh0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aChmdW5jdGlvbihyZXApIHsKICAgICAgICB2YXIgbm9kZXMgPSBkb2N1bWVudC5ldmFsdWF0ZSgnLy90ZXh0KClbY29udGFpbnMoLiwgIicrcmVwLmtleS5yZXBsYWNlKC8iL2csJ1wiJykrJyIpXScsIGRvY3VtZW50LCBudWxsLCBYUGF0aFJlc3VsdC5PUkRFUkVEX05PREVfU05BUFNIT1RfVFlQRSwgbnVsbCk7CiAgICAgICAgZm9yKHZhciBpPTA7aTxub2Rlcy5zbmFwc2hvdExlbmd0aDtpKyspIHsKICAgICAgICAgICAgdmFyIG5vZGUgPSBub2Rlcy5zbmFwc2hvdEl0ZW0oaSk7CiAgICAgICAgICAgIGlmIChub2RlLmlzU3Vic3RpdHV0ZSkgY29udGludWU7CiAgICAgICAgICAgIHZhciBwYXJ0cyA9IG5vZGUuZGF0YS5zcGxpdChyZXAua2V5KTsKICAgICAgICAgICAgbm9kZS5kYXRhID0gcGFydHMucG9wKCk7CiAgICAgICAgICAgIHBhcnRzLmZvckVhY2goZnVuY3Rpb24ocGFydCkgewogICAgICAgICAgICAgICAgdmFyIHN1YjsKICAgICAgICAgICAgICAgIGlmIChyZXAuaW1nKSB7CiAgICAgICAgICAgICAgICAgICAgc3ViID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW1nJyk7CiAgICAgICAgICAgICAgICAgICAgc3ViLnNyYyA9IHJlcC52YWx1ZTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgc3ViID0gZG9jdW1lbnQuY3JlYXRlVGV4dE5vZGUocmVwLnZhbHVlKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHN1Yi5pc1N1YnN0aXR1dGUgPSB0cnVlOwogICAgICAgICAgICAgICAgbm9kZS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShzdWIsIG5vZGUpOwogICAgICAgICAgICAgICAgbm9kZS5wYXJlbnROb2RlLmluc2VydEJlZm9yZShkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShwYXJ0KSwgc3ViKTsKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgfSk7Cn0KCgp2YXIgbW8gPSBuZXcgTXV0YXRpb25PYnNlcnZlcihmdW5jdGlvbihtdXRzKSB7CiAgICBzdWJzdGl0dXRlKCk7Cn0pOwptby5vYnNlcnZlKGRvY3VtZW50LmJvZHksIHtjaGlsZExpc3Q6dHJ1ZSwgc3VidHJlZTp0cnVlfSk7Cg=="}]}