xiaomianao666

插件名:rt-douban

Apr 12th, 2024
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:网页插件¥js_url¥rt-douban@base64://bGV0IHZlcnNpb24gPSAyMDIxMTczMDE2MzUKLyoqCiAqIOS4gOS6m+WFqOWxgOmFjee9ru+8jOivt+enu+atpemihOWkhOeQhuS4rei/m+ihjOmFjee9rgogKi8KbGV0IHNldHRpbmdzID0gewogICAgLyoqCiAgICAgKiDmmK/lkKblvIDlkK/op4bnlYzmkJzvvIzlvIDlkK/lkI7ngrnlh7vnrKzkuIDpobnljbPlj6/kvb/nlKgKICAgICAqCiAgICAgKiDoi6XkuI3lvIDlkK/liJnngrnlh7vkuLrmn6XnnIvljp/mlocKICAgICAqCiAgICAgKiDlvIDlkK8vMSDkuI3lvIDlkK8vMAogICAgICovCiAgICBvcGVuSGlrZXJTZWFyY2g6IDEsCiAgICAvLyBkZXNjIOaPj+i/sOeahOS4ieihjOS4reavj+ihjOeahOacgOWkp+mVv+W6pgogICAgZGVzY0xpbmVNYXhMZW46IDI1LAogICAgLy8g6K+E6K6655So5oi36aKc6ImyCiAgICB1c2VyQ29sb3I6ICIjMjk3OUZGIiwKICAgIC8vIOaooeWdl+eahOmXtOi3nQogICAgbGluZV9tb2RlbDogMSwKICAgIC8vIOaooeWdl+mXtOi3neexu+Wei++8iOmAgumFjeS7peWQjuWPr+iDveS8muacieeahOaXoOi+uei3nee6v++8iQogICAgbGluZV90eXBlX21vZGVsOiAnbGluZV9ibGFuaycsCiAgICAvLyDor4TliIbmmL7npLrnsbvlnovvvIwwIOS4uuaYn+aYn+KYheKYhu+8jDEg5Li65paH5a2XCiAgICAvLyDmmK/lkKbmmL7npLonW+afpeeci+WOn+aWh10nLCAwIOS4uuS4jeaYvuekuu+8jDEg5Li65pi+56S6CiAgICBzaG93U291cmNlOiAxLAogICAgLy8g5piv5ZCm5pi+56S6J1vmn6XnnIvlhajmloddJywgMCDkuLrkuI3mmL7npLrvvIwxIOS4uuaYvuekugogICAgc2hvd0FsbENvbnRlbnQ6IDEsCgogICAgcmF0aW5nVHlwZTogMCwKICAgIC8vIOivhOWIhuWvueW6lOaWh+Wtl+OAgeaYn+aYn+OAgeminOiJsiBbIOS6lOaYn+WKm+iNkO+8jOWbm+aYn+aOqOiNkO+8jOS4ieaYn+i/mOihjO+8jOS6jOaYn+i+g+W3ru+8jOS4gOaYn+W+iOW3rl0KICAgIHJhdGluZ1RleHRzOiBbCiAgICAgICAgIuWKm+iNkCIsCiAgICAgICAgIuaOqOiNkCIsCiAgICAgICAgIui/mOihjCIsCiAgICAgICAgIui+g+W3riIsCiAgICAgICAgIuW+iOW3riIsCiAgICBdLAogICAgcmF0aW5nU3RhcnM6IFsKICAgICAgICAi4piF4piF4piF4piF4piFIiwKICAgICAgICAi4piF4piF4piF4piF4piGIiwKICAgICAgICAi4piF4piF4piF4piG4piGIiwKICAgICAgICAi4piF4piF4piG4piG4piGIiwKICAgICAgICAi4piF4piG4piG4piG4piGIiwKICAgIF0sCiAgICByYXRpbmdDb2xvcnM6IFsKICAgICAgICAiIzAwZDQzNyIsCiAgICAgICAgIiM5Y2RjMDAiLAogICAgICAgICIjZGRjZjAwIiwKICAgICAgICAiI2ZmYTQwMCIsCiAgICAgICAgIiNmZjc4MDAiLAogICAgXSwKICAgIC8vIOixhueTo+ivhOWIhuaWh+acrOaYvuekuuaooeW8j++8jDAv57qv5paH5pysIDEv6L+b5bqm5p2hCiAgICByYXRpbmdUZXh0TW9kZTogMSwKCiAgICAvKioKICAgICAqIOaQnOe0ouaooeW8jwogICAgICoKICAgICAqIDA6ICJoaWtlcjovL3NlYXJjaD9zPea1i+ivle+8jOWwhuS8muaJk+W8gOaQnOe0ouW8ueeql++8jOiHquWKqOWhq+WFheaQnOe0oueahOWFs+mUruivjeKAnOa1i+ivleKAne+8jOeUseeUqOaIt+iHquW3semAieaLqeWIhue7hOWSjOinhOWImeWQjuaQnOe0oiIsCiAgICAgKiA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YmFuLmNvbS8nKSk7fX0oKSk7YDsKICAgICAgICAgICAgIWZpbGVFeGlzdCgnaGlrZXI6Ly9maWxlcy9jYWNoZS9nbG9iYWxfZ2V0RG91YmFuQ29va2llLmpzJykgPyAod3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL2NhY2hlL2dsb2JhbF9nZXREb3ViYW5Db29raWUuanMnLCBnZXREb3ViYW5Db29raWUpKSA6IDA7CiAgICAgICAgICAgIHZhciBkID0gW107CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xvbmdfdGV4dCcKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+aCqOW3suiiq+WwgeemgUlQ5Zyw5Z2A5oiW6Kem5Y+R5LqG5Lq65py66aqM6K+B77yM6K+35oyJ54Wn5Lul5LiL5q2l6aqk5aSE55CGKOWmguS4jeWkhOeQhuaCqOWwhuWcqOS4gOauteaXtumXtOWGheaXoOazleato+W4uOS9v+eUqOatpOWwj+eoi+W6jyknLAogICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6ICcxLueCueWHu+atpOWkhOWvvOWFpeiHquWKqOiOt+WPlkNvb2tpZeaPkuS7ticsCiAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5QGxhenlSdWxlPS5qczonICsgYCdydWxlOi8vJytiYXNlNjRFbmNvZGUoJ+a1t+mYlOinhueVjO+8jOe9kemhteaPkuS7tu+/pWpzX3VybO+/pWdsb2JhbF9nZXREb3ViYW5Db29raWVAaGlrZXI6Ly9maWxlcy9jYWNoZS9nbG9iYWxfZ2V0RG91YmFuQ29va2llLmpzJyk7YCwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJzIu54K55Ye75q2k5aSE6L+b5YWl572R6aG16L+b6KGM55m75b2V5oiW5Lq65py66aqM6K+B77yM5a6M5oiQ5ZCO6L+U5Zue5q2k6aG16Z2iJywKICAgICAgICAgICAgICAgIHVybDogbVVybCwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJzMu5a6M5oiQ55m75b2V5oiW5Lq65py66aqM6K+B5ZCO5LiL5ouJ5Yi35paw5q2k6aG16Z2iJywKICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBzZXRSZXN1bHQoZCk7CiAgICAgICAgICAgIHJldHVybiB0cnVlOwogICAgICAgIH0KICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9LAogICAgLyoqCiAgICAgKiDosYbnk6PkuoznuqcKICAgICAqLwogICAgZGV0YWlsVmlldzogZnVuY3Rpb24gKGlkLCB0eXBlLCB0aXRsZSkgewogICAgICAgIHB1dFZhcjIoJ2RiX3Jldmlld19zb3J0JywgJ2hvdGVzdCcpOwogICAgICAgIHB1dFZhcjIoJ2RiX3Jldmlld19zb3J0X3JhdGluZycsICcnKTsKICAgICAgICBwdXRWYXIyKCdkYl9jb21tZW50X3NvcnQnLCAnbmV3X3Njb3JlJyk7CiAgICAgICAgcHV0VmFyMignZGJfY29tbWVudF9zb3J0X3BlcmNlbnRfdHlwZScsICcnKTsKICAgICAgICBpZiAoc2V0dGluZ3Mub3BlblNpbXBsZURldGFpbFZpZXcpIHsKICAgICAgICAgICAgdGhpcy5zaW1wbGVEZXRhaWxWaWV3KCkKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB2YXIgcmVzID0ge307CiAgICAgICAgICAgIHZhciBkID0gW107CiAgICAgICAgICAgIHZhciBjb2xUeXBlID0gJ3JpY2hfdGV4dCc7CiAgICAgICAgICAgIHZhciBodG1sID0gJyc7CiAgICAgICAgICAgIHZhciB1cmxTcGxpdHMgPSBbXTsKICAgICAgICAgICAgdmFyIG1VcmwgPSAnJzsKICAgICAgICAgICAgbGV0IGRiX3RpdGxlID0gJyc7CiAgICAgICAgICAgIGxldCBjb29raWVDYWNoZSA9ICdoaWtlcjovL2ZpbGVzL2NhY2hlL2RvdWJhbmNvb2tpZS50eHQnCiAgICAgICAgICAgIGlmIChpZCkgewogICAgICAgICAgICAgICAgbVVybCA9ICdodHRwczovL21vdmllLmRvdWJhbi5jb20vc3ViamVjdC8nICsgaWQgKyAnLycKICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzID0gewogICAgICAgICAgICAgICAgICAgICJVc2VyLUFnZW50IjogUENfVUEsCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZihmaWxlRXhpc3QoY29va2llQ2FjaGUpKSB7CiAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1siQ29va2llIl0gPSBmZXRjaChjb29raWVDYWNoZSkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIC8vIGxvZyhoZWFkZXJzKQogICAgICAgICAgICAgICAgaHRtbCA9IHJlcXVlc3QobVVybCwgewogICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWRlcnMKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBodG1sID0gZ2V0UmVzQ29kZSgpOwogICAgICAgICAgICAgICAgdXJsU3BsaXRzID0gTVlfVVJMLnNwbGl0KCcjJyk7CiAgICAgICAgICAgICAgICBtVXJsID0gdXJsU3BsaXRzWzBdOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmICh0aXRsZSkgewogICAgICAgICAgICAgICAgZGJfdGl0bGUgPSB0aXRsZQogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChkb3ViYW4udmVyaWZ5UGFnZShodG1sLCBtVXJsKSkgewogICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICB9CgogICAgICAgICAgICBsZXQgc3ViX3VybCA9ICcnOwogICAgICAgICAgICBsZXQgc2VhcmNoX3VybCA9ICcnOwogICAgICAgICAgICAvKioKICAgICAgICAgICAgICog6I635Y+WIOW9seeJhy/kuabnsY0g5L+h5oGvCiAgICAgICAgICAgICAqIEB0eXBlIHtzdHJpbmd9CiAgICAgICAgICAgICAqLwogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgbGV0IHN1Yl9pbmZvX2h0bWwgPSBwYXJzZURvbUZvckh0bWwoaHRtbCwgIiN3cmFwcGVyJiZIdG1sIikKICAgICAgICAgICAgICAgICAgICAucmVwbGFjZSgvXG4vZywgJycpOwogICAgICAgICAgICAgICAgbGV0IHN1Yl9vcmlnaW5hbF90aXRsZSA9IHBhcnNlRG9tRm9ySHRtbChzdWJfaW5mb19odG1sLCAnaDEmJlRleHQnKTsKICAgICAgICAgICAgICAgIGxldCBzdWJfY292ZXIgPSBwYXJzZURvbUZvckh0bWwoc3ViX2luZm9faHRtbCwgJyNtYWlucGljJiZhJiZpbWcmJnNyYycpOwogICAgICAgICAgICAgICAgLy8gbGV0IHN1Yl90aXRsZSA9IHBhcnNlRG9tRm9ySHRtbChzdWJfaW5mbywgJy5zdWItZGV0YWlsJiYuc3ViLXRpdGxlJiZUZXh0Jyk7CiAgICAgICAgICAgICAgICBsZXQgc3ViX21ldGFfaHRtbCA9IHBhcnNlRG9tRm9ySHRtbChzdWJfaW5mb19odG1sLCAnI2luZm8mJkh0bWwnKTsKICAgICAgICAgICAgICAgIGxldCBhY3RvciA9ICcnOwogICAgICAgICAgICAgICAgbGV0IHR5cGUgPSAnJzsKICAgICAgICAgICAgICAgIGxldCBzaG93RGF0ZSA9ICcnOwogICAgICAgICAgICAgICAgaWYgKG1VcmwuaW5kZXhPZignYm9vaycpID4gLTEpIHsKICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoLyg8c3Bhbj5bXHNcU10qPzxzcGFuIGNsYXNzPSJwbCI+IOS9nOiAhTxcL3NwYW4+W1xzXFNdKj8oPz08YnI+KSkvLnRlc3Qoc3ViX21ldGFfaHRtbCkgPT09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjdG9yID0gJzxkaXYgY2xhc3M9ImFjdG9yIj4nICsgUmVnRXhwLiQxICsgJzwvZGl2Pic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3RvciA9IHBhcnNlRG9tRm9ySHRtbChhY3RvciwgJy5hY3RvciYmVGV4dCcpCiAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvKDxzcGFuIGNsYXNzPSJwbCI+5Ye654mI56S+OjxcL3NwYW4+W1xzXFNdKj8oPz08YnI+KSkvLnRlc3Qoc3ViX21ldGFfaHRtbCkgPT09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgPSAnPGRpdiBjbGFzcz0idHlwZSI+JyArIFJlZ0V4cC4kMSArICc8L2Rpdj4nOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IHBhcnNlRG9tRm9ySHRtbCh0eXBlLCAnLnR5cGUmJlRleHQnKQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAoLyg8c3BhbiBjbGFzcz0icGwiPuWHuueJiOW5tDo8XC9zcGFuPltcc1xTXSo/KD89PGJyPikpLy50ZXN0KHN1Yl9tZXRhX2h0bWwpID09PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93RGF0ZSA9ICc8ZGl2IGNsYXNzPSJkYXRlIj4nICsgUmVnRXhwLiQxICsgJzwvZGl2Pic7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93RGF0ZSA9IHBhcnNlRG9tRm9ySHRtbChzaG93RGF0ZSwgJy5kYXRlJiZUZXh0JykKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGFjdG9yID0gcGFyc2VEb21Gb3JIdG1sKHN1Yl9tZXRhX2h0bWwsICcuYWN0b3ImJlRleHQnKTsKICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0eXBlUmVnID0gLyg8c3BhbiBjbGFzcz0icGwiPuexu+Weizo8XC9zcGFuPltcc1xTXSo/KD89PGJyPikpLzsKICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVSZWcudGVzdChzdWJfbWV0YV9odG1sKSA9PT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IFJlZ0V4cC4kMSA9PT0gJycgPyBzdWJfbWV0YV9odG1sLm1hdGNoKHR5cGVSZWcpWzBdIDogUmVnRXhwLiQxOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9ICc8ZGl2IGNsYXNzPSJ0eXBlIj4nICsgdHlwZSArICc8L2Rpdj4nOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSA9IHBhcnNlRG9tRm9ySHRtbCh0eXBlLCAnLnR5cGUmJlRleHQnKQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0ZVJlZyA9IC8oPHNwYW4gY2xhc3M9InBsIj4o5LiK5pig5pel5pyffOmmluaSrSk6PFwvc3Bhbj5bXHNcU10qPyg/PTxicj4pKS87CiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkYXRlUmVnLnRlc3Qoc3ViX21ldGFfaHRtbCkgPT09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dEYXRlID0gUmVnRXhwLiQxID09PSAnJyA/IHN1Yl9tZXRhX2h0bWwubWF0Y2goZGF0ZVJlZylbMF0gOiBSZWdFeHAuJDE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaG93RGF0ZSA9ICc8ZGl2IGNsYXNzPSJkYXRlIj4nICsgc2hvd0RhdGUgKyAnPC9kaXY+JzsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3dEYXRlID0gcGFyc2VEb21Gb3JIdG1sKHNob3dEYXRlLCAnLmRhdGUmJlRleHQnKQogICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGxldCBzdWJfbWV0YSA9IGdldEFiYnJldlRleHQoYWN0b3IpCiAgICAgICAgICAgICAgICAgICAgKyAoYWN0b3IgPT09ICcnIHx8IHR5cGUgPT09ICcnID8gJycgOiAnXG4nKQogICAgICAgICAgICAgICAgICAgICsgKHR5cGUgPT09ICcnID8gJycgOiBnZXRBYmJyZXZUZXh0KHR5cGUpKQogICAgICAgICAgICAgICAgICAgICsgKHNob3dEYXRlID09PSAnJyB8fCB0eXBlID09PSAnJyA/ICcnIDogJ1xuJykKICAgICAgICAgICAgICAgICAgICArIChzaG93RGF0ZSA9PT0gJycgPyAnJyA6IGdldEFiYnJldlRleHQoc2hvd0RhdGUpKTsKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgZGJfdGl0bGUgPSBkYl90aXRsZXx8dXJsU3BsaXRzWzFdOwogICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgLy8g5pCc57Si5Y+C5pWwCiAgICAgICAgICAgICAgICBsZXQgc2VhcmNoVmFsdWUgPSBzZXR0aW5ncy5zZWFyY2hWYWx1ZTsKICAgICAgICAgICAgICAgIHNlYXJjaF91cmwgPSAnaGlrZXI6Ly9zZWFyY2g/cz0nCiAgICAgICAgICAgICAgICAgICAgKyAoZGJfdGl0bGUgPT09ICcnIHx8IGRiX3RpdGxlID09PSB1bmRlZmluZWQKICAgICAgICAgICAgICAgICAgICAgICAgPyBzdWJfb3JpZ2luYWxfdGl0bGUKICAgICAgICAgICAgICAgICAgICAgICAgOiBkYl90aXRsZSkKICAgICAgICAgICAgICAgICAgICArIHNlYXJjaFZhbHVlOwogICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLm9wZW5IaWtlclNlYXJjaCA9PT0gMSkgewogICAgICAgICAgICAgICAgICAgIHN1Yl91cmwgPSBzZWFyY2hfdXJsOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBzdWJfdXJsID0gbVVybCArIGRvdWJhbi5nZXRIZWFkZXJzKCkgKyAnQHJ1bGU9anM6JwogICAgICAgICAgICAgICAgICAgICAgICArIGB2YXIgcmVzID0ge307dmFyIGQgPSBbXTt2YXIgY29sVHlwZSA9ICdyaWNoX3RleHQnO3ZhciBodG1sID0gZ2V0UmVzQ29kZSgpO2xldCBpbmZvX2h0bWwgPSAnPGJpZz48c3Ryb25nPuW9seeJh+S/oeaBrzxcL3N0cm9uZz48XC9iaWc+PGJyPicgKyBwYXJzZURvbUZvckh0bWwoaHRtbCwgIiNpbmZvJiZIdG1sIikucmVwbGFjZSgvPGEgaHJlZj0iXFwvW1xcc1xcU10qPz58PFxcL2E+L2csICcnKS5yZXBsYWNlKC9zcGFuL2csICdmb250JykucmVwbGFjZSgvPGZvbnQgY2xhc3M9InBsIj4vZywgJzxmb250IGNsYXNzPSJwbCIgY29sb3I9ImdyZXkiPicpLnJlcGxhY2UoLzogL2csICc8Zm9udCBjb2xvcj0iZ3JleSI+OiA8XFwvZm9udD4nKTtkLnB1c2goe3RpdGxlOiBpbmZvX2h0bWwsY29sX3R5cGU6IGNvbFR5cGV9KTtyZXMuZGF0YSA9IGQ7c2V0SG9tZVJlc3VsdChyZXMpO2A7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIHRpdGxlOiBzdWJfb3JpZ2luYWxfdGl0bGUsCiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogc3ViX2NvdmVyICsgdGhpcy5waWNSZWZlcmVyLAogICAgICAgICAgICAgICAgICAgIHVybDogc3ViX3VybCwKICAgICAgICAgICAgICAgICAgICBkZXNjOiBzdWJfbWV0YSwKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaWQgJiYgdGl0bGUgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWNfYmx1cicgOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLAogICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICJncmFkaWVudCI6dHJ1ZSwKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB9CgogICAgICAgICAgICBsZXQgYWRkVHJhaWxlclBob3RvTW9kdWxlID0gJzAnOwogICAgICAgICAgICBsZXQgYWRkQ29tbWVudHNNb2R1bGUgPSAnMCc7CiAgICAgICAgICAgIGxldCBhZGRSZXZpZXdzTW9kdWxlID0gJzAnOwogICAgICAgICAgICBpZiAoc2V0dGluZ3MuYWRkVHJhaWxlclBob3RvTW9kdWxlICE9PSAwKSB7CiAgICAgICAgICAgICAgICBhZGRUcmFpbGVyUGhvdG9Nb2R1bGUgPSAnMSc7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKHNldHRpbmdzLmFkZENvbW1lbnRzTW9kdWxlICE9PSAwKSB7CiAgICAgICAgICAgICAgICBhZGRDb21tZW50c01vZHVsZSA9ICcxJzsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZiAoc2V0dGluZ3MuYWRkUmV2aWV3c01vZHVsZSAhPT0gMCkgewogICAgICAgICAgICAgICAgYWRkUmV2aWV3c01vZHVsZSA9ICcxJzsKICAgICAgICAgICAgfQogICAgICAgICAgICAvKioKICAgICAgICAgICAgICogMDAwICjpooTlkYor5Ymn54WnKSvnn63or4Qr5Ymn6K+EOmljb25fc21hbGxfNAogICAgICAgICAgICAgKiAwMDEgKOmihOWRiivliafnhacpK+efreivhCvmkJzntKI6aWNvbl9zbWFsbF80CiAgICAgICAgICAgICAqIDAxNyAo6aKE5ZGKK+WJp+eFpykr5Ymn6K+EK+aQnOe0ojppY29uX3NtYWxsXzQKICAgICAgICAgICAgICogMDExICjpooTlkYor5Ymn54WnKSvmkJzntKI6aWNvbl9zbWFsbF8zCiAgICAgICAgICAgICAqIDE3MCDnn63or4Qr5Ymn6K+EK+aQnOe0ojppY29uX3NtYWxsXzMKICAgICAgICAgICAgICogMTcxIOefreivhCvmkJzntKI6aWNvbl8yCiAgICAgICAgICAgICAqIDExNyDliafor4Qr5pCc57SiOmljb25fMgogICAgICAgICAgICAgKiAxMTEgbnVsbAogICAgICAgICAgICAgKi8KICAgICAgICAgICAgbGV0IG1vZHVsZVN0YXR1cyA9IGFkZFRyYWlsZXJQaG90b01vZHVsZSArIGFkZENvbW1lbnRzTW9kdWxlICsgYWRkUmV2aWV3c01vZHVsZTsKICAgICAgICAgICAgbGV0IHZpZGVvX2lkID0gdGhpcy5pZChtVXJsKTsKICAgICAgICAgICAgbGV0IG1vZHVsZVN0YXR1c0l0ZW1zID0gewogICAgICAgICAgICAgICAgZ2V0VHJhaWxlcnM6IGZ1bmN0aW9uIChjb2xUeXBlKSB7CiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfpooTlkYonLAogICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiAnaHR0cHM6Ly9zMS5heDF4LmNvbS8yMDIwLzExLzA5L0JUNjJWTy5wbmcnLAogICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICdodHRwczovL21vdmllLmRvdWJhbi5jb20vc3ViamVjdC8nICsgdmlkZW9faWQgKyAnL3RyYWlsZXInICsgZG91YmFuLmdldEhlYWRlcnMoKSArICdAcnVsZT1qczogJyArIGBldmFsKGZldGNoKCdgICsgc2V0dGluZ3MuanNGaWxlICsgYCcsIHt9KSk7ZG91YmFuLnRyYWlsZXJMaXN0VmlldygpO2AsCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgZ2V0UGhvdG9zOiBmdW5jdGlvbiAoY29sVHlwZSkgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Ymn54WnJywKICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogJ2h0dHBzOi8vczEuYXgxeC5jb20vMjAyMC8xMS8wOS9CVDZjcUsucG5nJywKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9tb3ZpZS5kb3ViYW4uY29tL3N1YmplY3QvJyArIHZpZGVvX2lkICsgJy9waG90b3M/dHlwZT1TJnN0YXJ0PWZ5cGFnZUAtMUAqMzBAJnNvcnRieT1saWtlJnNpemU9YSZzdWJ0eXBlPWEnICsgZG91YmFuLmdldEhlYWRlcnMoKSArICdAcnVsZT1qczogJyArIGBldmFsKGZldGNoKCdgICsgc2V0dGluZ3MuanNGaWxlICsgYCcsIHt9KSk7ZG91YmFuLnBob3RvTGlzdFZpZXcoKTtgLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZQogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSwKICAgICAgICAgICAgICAgIGdldENvbW1lbnRzOiBmdW5jdGlvbiAoY29sVHlwZSkgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn55+t6K+EJywKICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogJ2h0dHBzOi8vczEuYXgxeC5jb20vMjAyMC8xMS8wOS9CVDZXSWUucG5nJywKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSMnICsgJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyB2aWRlb19pZCArICcvY29tbWVudHM/c3RhcnQ9ZnlwYWdlQC0xQCoyMEAmbGltaXQ9MjAmc3RhdHVzPVAnICsgZG91YmFuLmdldEhlYWRlcnMoKSArICdAcnVsZT1qczogJyArIGBldmFsKGZldGNoKCdgICsgc2V0dGluZ3MuanNGaWxlICsgYCcsIHt9KSk7ZG91YmFuLmNvbW1lbnRMaXN0VmlldygpO2AsCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgZ2V0UmV2aWV3czogZnVuY3Rpb24gKGNvbFR5cGUpIHsKICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+WJp+ivhCcsCiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6ICdodHRwczovL3MxLmF4MXguY29tLzIwMjAvMTEvMDkvQlQ2UmFELnBuZycsCiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHkjJyArICdodHRwczovL21vdmllLmRvdWJhbi5jb20vc3ViamVjdC8nICsgdmlkZW9faWQgKyAnL3Jldmlld3M/c3RhcnQ9ZnlwYWdlQC0xQCoyMEAmbGltaXQ9MjAnICsgZG91YmFuLmdldEhlYWRlcnMoKSArICdAcnVsZT1qczogJyArIGBldmFsKGZldGNoKCdgICsgc2V0dGluZ3MuanNGaWxlICsgYCcsIHt9KSk7ZG91YmFuLnJldmlld0xpc3RWaWV3KCk7YCwKICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGNvbFR5cGUKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICBnZXRTZWFyY2g6IGZ1bmN0aW9uIChjb2xUeXBlKSB7CiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfmkJzntKInLAogICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiAnaHR0cHM6Ly9zMy5heDF4LmNvbS8yMDIwLzExLzIzL0RHVzBkZS5wbmcnLAogICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHNlYXJjaF91cmwsCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb2xUeXBlCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgZ2V0V29ya2VyczogZnVuY3Rpb24gKGNvbFR5cGUpIHsKICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+a8lOiBjOWRmCcsCiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6ICdodHRwczovL3MzLmF4MXguY29tLzIwMjAvMTEvMjMvREd4RkNxLnBuZycsCiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyB2aWRlb19pZCArICcvY2VsZWJyaXRpZXMnICsgZG91YmFuLmdldEhlYWRlcnMoKSArICdAcnVsZT1qczogJyArIGBldmFsKGZldGNoKCdgICsgc2V0dGluZ3MuanNGaWxlICsgYCcsIHt9KSk7ZG91YmFuLndvcmtlclZpZXcoKTtgLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZQogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9OwogICAgICAgICAgICBsZXQgc3RhdHVzQ29sVHlwZSA9ICcnOwogICAgICAgICAgICBzd2l0Y2ggKG1vZHVsZVN0YXR1cykgewogICAgICAgICAgICAgICAgY2FzZSAnMDAwJzoKICAgICAgICAgICAgICAgICAgICAvLyAo6aKE5ZGKK+WJp+eFpykr55+t6K+EK+WJp+ivhDppY29uX3NtYWxsXzQKICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2xUeXBlID0gJ2ljb25fc21hbGxfNCc7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0VHJhaWxlcnMoc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0UGhvdG9zKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIG1vZHVsZVN0YXR1c0l0ZW1zLmdldENvbW1lbnRzKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIG1vZHVsZVN0YXR1c0l0ZW1zLmdldFJldmlld3Moc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICcwMDEnOgogICAgICAgICAgICAgICAgICAgIC8vICjpooTlkYor5Ymn54WnKSvnn63or4Qr5pCc57SiOmljb25fc21hbGxfNAogICAgICAgICAgICAgICAgICAgIHN0YXR1c0NvbFR5cGUgPSAnaWNvbl9zbWFsbF80JzsKICAgICAgICAgICAgICAgICAgICBtb2R1bGVTdGF0dXNJdGVtcy5nZXRUcmFpbGVycyhzdGF0dXNDb2xUeXBlKTsKICAgICAgICAgICAgICAgICAgICBtb2R1bGVTdGF0dXNJdGVtcy5nZXRQaG90b3Moc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0Q29tbWVudHMoc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0U2VhcmNoKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnMDE3JzoKICAgICAgICAgICAgICAgICAgICAvLyAo6aKE5ZGKK+WJp+eFpykr5Ymn6K+EK+aQnOe0ojppY29uX3NtYWxsXzQKICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2xUeXBlID0gJ2ljb25fc21hbGxfNCc7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0VHJhaWxlcnMoc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0UGhvdG9zKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIG1vZHVsZVN0YXR1c0l0ZW1zLmdldFJldmlld3Moc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0U2VhcmNoKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnMDExJzoKICAgICAgICAgICAgICAgICAgICAvLyDogYzlkZjooagrKOmihOWRiivliafnhacpK+aQnOe0ojppY29uX3NtYWxsXzQKICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2xUeXBlID0gJ2ljb25fc21hbGxfNCc7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0V29ya2VycyhzdGF0dXNDb2xUeXBlKTsKICAgICAgICAgICAgICAgICAgICBtb2R1bGVTdGF0dXNJdGVtcy5nZXRUcmFpbGVycyhzdGF0dXNDb2xUeXBlKTsKICAgICAgICAgICAgICAgICAgICBtb2R1bGVTdGF0dXNJdGVtcy5nZXRQaG90b3Moc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0U2VhcmNoKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgY2FzZSAnMTcwJzoKICAgICAgICAgICAgICAgICAgICAvLyDogYzlkZjooagr55+t6K+EK+WJp+ivhCvmkJzntKI6aWNvbl9zbWFsbF80CiAgICAgICAgICAgICAgICAgICAgc3RhdHVzQ29sVHlwZSA9ICdpY29uX3NtYWxsXzQnOwogICAgICAgICAgICAgICAgICAgIG1vZHVsZVN0YXR1c0l0ZW1zLmdldFdvcmtlcnMoc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0Q29tbWVudHMoc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0UmV2aWV3cyhzdGF0dXNDb2xUeXBlKTsKICAgICAgICAgICAgICAgICAgICBtb2R1bGVTdGF0dXNJdGVtcy5nZXRTZWFyY2goc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICBjYXNlICcxNzEnOgogICAgICAgICAgICAgICAgICAgIC8vIOiBjOWRmOihqCvnn63or4Qr5pCc57SiOmljb25fc21hbGxfMwogICAgICAgICAgICAgICAgICAgIHN0YXR1c0NvbFR5cGUgPSAnaWNvbl9zbWFsbF8zJzsKICAgICAgICAgICAgICAgICAgICBtb2R1bGVTdGF0dXNJdGVtcy5nZXRXb3JrZXJzKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIG1vZHVsZVN0YXR1c0l0ZW1zLmdldENvbW1lbnRzKHN0YXR1c0NvbFR5cGUpOwogICAgICAgICAgICAgICAgICAgIG1vZHVsZVN0YXR1c0l0ZW1zLmdldFNlYXJjaChzdGF0dXNDb2xUeXBlKTsKICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgIGNhc2UgJzExNyc6CiAgICAgICAgICAgICAgICAgICAgLy8g6IGM5ZGY6KGoK+WJp+ivhCvmkJzntKI6aWNvbl9zbWFsbF8zCiAgICAgICAgICAgICAgICAgICAgc3RhdHVzQ29sVHlwZSA9ICdpY29uX3NtYWxsXzMnOwogICAgICAgICAgICAgICAgICAgIG1vZHVsZVN0YXR1c0l0ZW1zLmdldFdvcmtlcnMoc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgbW9kdWxlU3RhdHVzSXRlbXMuZ2V0UmV2aWV3cyhzdGF0dXNDb2xUeXBlKTsKICAgICAgICAgICAgICAgICAgICBtb2R1bGVTdGF0dXNJdGVtcy5nZXRTZWFyY2goc3RhdHVzQ29sVHlwZSk7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc2V0dGluZ3MubGluZV9tb2RlbDsgaSsrKSB7CiAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzZXR0aW5ncy5saW5lX3R5cGVfbW9kZWwKICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgKiDosYbnk6Por4TliIYKICAgICAgICAgICAgICovCiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBpZiAoc2V0dGluZ3MuYWRkUmF0aW5nTW9kdWxlICE9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5hZGRSYXRpbmdNb2R1bGUoaHRtbCwgbVVybCwgMSwgZCk7CiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzZXR0aW5ncy5saW5lX21vZGVsOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzZXR0aW5ncy5saW5lX3R5cGVfbW9kZWwKICAgICAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAqIOinhumikea6kAogICAgICAgICAgICAgKi8KICAgICAgICAgICAgaWYgKGlkICYmIHR5cGUpIHsKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5hZGRTb3VyY2VNb2R1bGUoaHRtbCwgbVVybCwgMSwgZCwgeyB0eXBlOiB0eXBlLCBpZDogaWR8fHRoaXMuaWQobVVybCl9KTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQoKICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAqIOWJp+aDheeugOS7iy/kuabnsY3lhoXlrrnku4vnu40KICAgICAgICAgICAgICovCiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBpZiAoc2V0dGluZ3MuYWRkSW50cm9Nb2R1bGUgIT09IDApIHsKICAgICAgICAgICAgICAgICAgICB0aGlzLmFkZEludHJvTW9kdWxlKGh0bWwsIDEsIGQpOwogICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc2V0dGluZ3MubGluZV9tb2RlbDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogc2V0dGluZ3MubGluZV90eXBlX21vZGVsCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgKiDpooTlkYrniYflkozliafnhacKICAgICAgICAgICAgICovCiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBpZiAoc2V0dGluZ3MuYWRkVHJhaWxlclBob3RvTW9kdWxlICE9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5hZGRUcmFpbGVyUGhvdG9Nb2R1bGUoaHRtbCwgMSwgZCkKICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHNldHRpbmdzLmxpbmVfbW9kZWw7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IHNldHRpbmdzLmxpbmVfdHlwZV9tb2RlbAogICAgICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB9CgogICAgICAgICAgICAvKioKICAgICAgICAgICAgICog55+t6K+ECiAgICAgICAgICAgICAqLwogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLmFkZENvbW1lbnRzTW9kdWxlICE9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgdGhpcy5hZGRDb21tZW50c01vZHVsZShodG1sLCAxLCBkKQogICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc2V0dGluZ3MubGluZV9tb2RlbDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogc2V0dGluZ3MubGluZV90eXBlX21vZGVsCiAgICAgICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgKiDlvbHor4Qv5Lmm6K+ECiAgICAgICAgICAgICAqLwogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgaWYgKHNldHRpbmdzLmFkZFJldmlld3NNb2R1bGUgIT09IDApIHsKICAgICAgICAgICAgICAgICAgICB0aGlzLmFkZFJldmlld3NNb2R1bGUoaHRtbCwgbVVybCwgMSwgZCk7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgcmVzLmRhdGEgPSBkLmNvbmNhdCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLAogICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c21hbGw+PGZvbnQgY29sb3I9Izg3MWY3OD7ku6XkuIrmlbDmja7mnaXmupDkuo7osYbnk6PvvIzlpoLmgqjllpzmrKLvvIzor7fkuIvovb3lrpjmlrlhcHA8L2ZvbnQ+PC9zbWFsbD4nLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxzbWFsbD48Zm9udCBjb2xvcj0jZjIwYzAwPuatpOinhOWImeS7hemZkOWtpuS5oOS6pOa1geS9v+eUqO+8jOivt+S6juWvvOWFpeWQjjI05bCP5pe25YaF5Yig6Zmk77yM5Lu75L2V57uE57uH5oiW5Liq5Lq65LiN5b6X5Lul5Lu75L2V5pa55byP5pa55rOV5Lyg5pKt5q2k6KeE5YiZ55qE5pW05L2T5oiW6YOo5YiG77yBPC9mb250Pjwvc21hbGw+JywKICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyBpZCArICcvJywKICAgICAgICAgICAgICAgIGV4dHJhOiB7CiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7CiAgICAgICAgfQogICAgfSwKICAgIC8qKgogICAgICog5b2x6K+E5YiX6KGo5Y2V6aG5IGl0ZW0g55qE5YaF5a65CiAgICAgKiBAcGFyYW0gbGlzdCDopoHliqDlhaXnmoTliJfooagKICAgICAqIEBwYXJhbSByZXZpZXdIdG1sSXRlbSDnvZHpobXmupDlvbHor4TliJfooajljZXpobkgaXRlbSDnmoQgSHRtbAogICAgICogQHJldHVybnMge3N0cmluZ30KICAgICAqLwogICAgYWRkUmV2aWV3SXRlbTogZnVuY3Rpb24gKGxpc3QsIHJldmlld0h0bWxJdGVtKSB7CiAgICAgICAgbGV0IHJldmlld0NvbFR5cGUgPSAncmljaF90ZXh0JzsKICAgICAgICBsZXQgcmV2aWV3UnVsZSA9ICdAcnVsZT1qczogJyArIGBldmFsKGZldGNoKCdgICsgc2V0dGluZ3MuanNGaWxlICsgYCcsIHt9KSk7ZG91YmFuLnJldmlld0RldGFpbFZpZXcoKTtgOwogICAgICAgIGxldCByZXZpZXdBdXRob3JBdmF0YXIgPSBwYXJzZURvbUZvckh0bWwocmV2aWV3SHRtbEl0ZW0sICcubWFpbi1oZCYmLmF2YXRvciYmaW1nJiZzcmMnKTsKICAgICAgICBsZXQgcmV2aWV3QXV0aG9yID0gcGFyc2VEb21Gb3JIdG1sKHJldmlld0h0bWxJdGVtLCAnLm1haW4taGQmJi5uYW1lJiZUZXh0Jyk7CiAgICAgICAgbGV0IHJldmlld0F1dGhvclVybCA9IHBhcnNlRG9tRm9ySHRtbChyZXZpZXdIdG1sSXRlbSwgJy5tYWluLWhkJiZhJiZocmVmJyk7CiAgICAgICAgbGlzdC5wdXNoKHsKICAgICAgICAgICAgdGl0bGU6IHJldmlld0F1dGhvciwKICAgICAgICAgICAgcGljX3VybDogcmV2aWV3QXV0aG9yQXZhdGFyLAogICAgICAgICAgICB1cmw6IHJldmlld0F1dGhvclVybCwKICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInCiAgICAgICAgfSkKICAgICAgICBsZXQgY29udGVudEh0bWwgPSBwYXJzZURvbUZvckh0bWwocmV2aWV3SHRtbEl0ZW0sICcubWFpbi1iZCYmSHRtbCcpOwogICAgICAgIGxldCByZXZpZXdUaXRsZSA9IHBhcnNlRG9tRm9ySHRtbChjb250ZW50SHRtbCwgJ2gyJiZIdG1sJyk7CiAgICAgICAgbGV0IHJldmlld1VybCA9IHBhcnNlRG9tRm9ySHRtbChyZXZpZXdUaXRsZSwgJ2EmJmhyZWYnKTsKICAgICAgICBsZXQgcmV2aWV3UnVsZVVybCA9ICdiYXNlNjQ6Ly8nICsgYmFzZTY0RW5jb2RlKHJldmlld1VybCArICcjZnlwYWdlI25vSGlzdG9yeSMnCiAgICAgICAgICAgICsgZG91YmFuLmdldEhlYWRlcnMoKQogICAgICAgICAgICArIHJldmlld1J1bGUpOwogICAgICAgIHJldmlld1RpdGxlID0gcmV2aWV3VGl0bGUucmVwbGFjZShyZXZpZXdVcmwsIHJldmlld1J1bGVVcmwpOwogICAgICAgIGxldCBjb250ZW50ID0gZ2V0VGl0bGVUZXh0KHJldmlld1RpdGxlKQogICAgICAgICAgICArICc8YnI+JwogICAgICAgICAgICArIHBhcnNlRG9tRm9ySHRtbChjb250ZW50SHRtbCwgJy5yZXZpZXctc2hvcnQmJi5zaG9ydC1jb250ZW50JiZIdG1sJykKICAgICAgICAgICAgKyAoc2V0dGluZ3Muc2hvd0FsbENvbnRlbnQgPT09IDEgPyAoJyAnICsgZ2V0U21hbGxUZXh0KGdldEFkZHJlc3NUYWcocmV2aWV3UnVsZVVybCwgJ1vmn6XnnIvlhajmloddJykpKSA6ICcnKQogICAgICAgIDsKICAgICAgICBsZXQgcmF0aW5nVGV4dCA9ICcnOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIHJhdGluZ1RleHQgPSBnZXRSYXRpbmcocGFyc2VEb21Gb3JIdG1sKHJldmlld0h0bWxJdGVtLCAnLm1haW4taGQmJi5tYWluLXRpdGxlLXJhdGluZyYmdGl0bGUnKSkKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgfQogICAgICAgIGxldCBtZXRhID0gcmF0aW5nVGV4dAogICAgICAgICAgICArIGdldEdyZXlUZXh0KCcg4ouFICcgKyBwYXJzZURvbUZvckh0bWwocmV2aWV3SHRtbEl0ZW0sICcubWFpbi1oZCYmLm1haW4tbWV0YSYmVGV4dCcpKTsKICAgICAgICBsZXQgZmVlZGJhY2sgPSAnJzsKICAgICAgICB0cnkgewogICAgICAgICAgICBmZWVkYmFjayA9ICfwn5GN8J+PuycgKyBwYXJzZURvbUZvckh0bWwocmV2aWV3SHRtbEl0ZW0sICcuYWN0aW9uJiYuYWN0aW9uLWJ0bi51cCYmVGV4dCcpCiAgICAgICAgICAgICAgICArICcg4ouFICcKICAgICAgICAgICAgICAgICsgJ/CfkY7wn4+7JyArIHBhcnNlRG9tRm9ySHRtbChyZXZpZXdIdG1sSXRlbSwgJy5hY3Rpb24mJi5hY3Rpb24tYnRuLmRvd24mJlRleHQnKQogICAgICAgICAgICAgICAgKyAnIOKLhSAnCiAgICAgICAgICAgICAgICArIHBhcnNlRG9tRm9ySHRtbChyZXZpZXdIdG1sSXRlbSwgJy5hY3Rpb24mJmFbY2xhc3NePXJlcGx5XSYmVGV4dCcpOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICB9CiAgICAgICAgY29udGVudCA9IGNvbnRlbnQKICAgICAgICAgICAgKyAnPGJyPicKICAgICAgICAgICAgKyAoZmVlZGJhY2sgPT09ICcnID8KICAgICAgICAgICAgICAgICAgICAnJwogICAgICAgICAgICAgICAgICAgIDogKGdldEdyZXlUZXh0KGdldENvbW1lbnRNZXRhKGZlZWRiYWNrKSArICcg4ouFICcpKQogICAgICAgICAgICApCiAgICAgICAgICAgICsgZ2V0Q29tbWVudE1ldGEobWV0YSk7CiAgICAgICAgY29udGVudCA9IGNvbnRlbnQKICAgICAgICAgICAgLnJlcGxhY2UoLzxhIGNsYXNzPSJzb3VyY2UtaWNvbiJbXHNcU10qPzxcL2E+L2csICcnKQogICAgICAgICAgICAucmVwbGFjZSgvXChbXHNcU11bXHJcbl08YSBocmVmPSJqYXZhc2NyaXB0OjsiW1xzXFNdKj90aXRsZT0i5bGV5byAIj7lsZXlvIA8XC9hPlwpL2csICcnKQogICAgICAgICAgICAucmVwbGFjZVdpdGhDYWxsYmFjaygvKDxwIGNsYXNzPSJzcG9pbGVyLXRpcCI+KC4qPyk8XC9wPikvZywKICAgICAgICAgICAgICAgIC8qZ2V0U21hbGxUZXh0KCc8YmxvY2txdW90ZSBjbGFzcz0ic3BvaWxlci10aXAiPnvmnInliafpgI99PC9ibG9ja3F1b3RlPicpKi8KICAgICAgICAgICAgICAgIGdldFNtYWxsVGV4dChnZXRHcmV5VGV4dCgn77yB5o+Q56S677yae+acieWJp+mAj308YnI+JykpLAogICAgICAgICAgICAgICAgZnVuY3Rpb24gKHNvdXJjZSwgc2VhcmNoVmFsdWUsIHJlcGxhY2VWYWx1ZSkgewogICAgICAgICAgICAgICAgICAgIGxldCByZXR1cm5WYWx1ZSA9IHNvdXJjZTsKICAgICAgICAgICAgICAgICAgICBpZiAoc2VhcmNoVmFsdWUudGVzdChzb3VyY2UpID09PSB0cnVlKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXBsYWNlVGV4dCA9IFJlZ0V4cC4kMjsKICAgICAgICAgICAgICAgICAgICAgICAgcmVwbGFjZVRleHQgPSByZXBsYWNlVGV4dCA9PT0gJycgPyBSZWdFeHAuJDEgOiByZXBsYWNlVmFsdWUucmVwbGFjZSgne+acieWJp+mAj30nLCByZXBsYWNlVGV4dCk7CiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVyblZhbHVlID0gc291cmNlLnJlcGxhY2UoUmVnRXhwLiQxLCByZXBsYWNlVGV4dCkKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJldHVyblZhbHVlOwogICAgICAgICAgICAgICAgfSk7CgogICAgICAgIGxpc3QucHVzaCh7CiAgICAgICAgICAgIHRpdGxlOiBjb250ZW50LAogICAgICAgICAgICBjb2xfdHlwZTogcmV2aWV3Q29sVHlwZQogICAgICAgIH0pOwogICAgfSwKICAgIC8qKgogICAgICog55+t6K+E5YiX6KGo5Y2V6aG5IGl0ZW0g55qE5YaF5a65CiAgICAgKiBAcGFyYW0gbGlzdCDopoHliqDlhaXnmoTliJ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0aXRsZScpOwogICAgICAgICAgICBsZXQgYXZhdGFyVXJsID0gcGFyc2VEb21Gb3JIdG1sKGF2YXRhckh0bWwsICdhJiZocmVmJyk7CiAgICAgICAgICAgIGxpc3QucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogYXZhdGFyVGl0bGUgKyAnIOKLhSAnICsgd2F0Y2hTdGF0dXMsCiAgICAgICAgICAgICAgICBwaWNfdXJsOiBhdmF0YXJJbWcsCiAgICAgICAgICAgICAgICB1cmw6IGF2YXRhclVybCwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJwogICAgICAgICAgICB9KQogICAgICAgICAgICBoYXNBdmF0YXIgPSAxOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgaGFzQXZhdGFyID0gMDsKICAgICAgICB9CiAgICAgICAgbGV0IGNvbnRlbnQgPSBwYXJzZURvbUZvckh0bWwoY29tbWVudEh0bWxJdGVtLCAncCYmSHRtbCcpOwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmICgvPFwvc3Bhbj5bXHNcU10qPyg8c3BhbiBjbGFzcz0iW1xzXFNdKj9mdWxsIj5bXHNcU10qPzxcL3NwYW4+KS8udGVzdChjb250ZW50KSA9PT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgY29udGVudCA9IFJlZ0V4cC4kMTsKICAgICAgICAgICAgfQogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgY29udGVudCA9IHBhcnNlRG9tRm9ySHRtbChjb21tZW50SHRtbEl0ZW0sICdwJiZIdG1sJyk7CiAgICAgICAgfQogICAgICAgIGxldCByYXRpbmdUZXh0ID0gJyc7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgcmF0aW5nVGV4dCA9ICcgJyArIGdldFJhdGluZyhwYXJzZURvbUZvckh0bWwoY29tbWVudEh0bWxJdGVtLCAnLmNvbW1lbnQtaW5mbyYmLnJhdGluZyYmdGl0bGUnKSkKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgfQogICAgICAgIGxldCBmZWVkYmFjayA9ICfwn5GN8J+PuycgKyBwYXJzZURvbUZvckh0bWwoY29tbWVudEh0bWxJdGVtLCAnLmNvbW1lbnQtdm90ZSYmLnZvdGVzLnZvdGUtY291bnQmJlRleHQnKTsKICAgICAgICBsZXQgbWV0YSA9IChoYXNBdmF0YXIgPT09IDAgPyAoYXV0aG9yICsgJyAnICsgd2F0Y2hTdGF0dXMgKyAnICcpIDogKGdldEdyZXlUZXh0KGZlZWRiYWNrICsgJyDii4UgJykpKQogICAgICAgICAgICArIHJhdGluZ1RleHQKICAgICAgICAgICAgKyBnZXRHcmV5VGV4dCgoaGFzQXZhdGFyID09PSAwID8gJyAnIDogJyDii4UgJykgKyBwYXJzZURvbUZvckh0bWwoY29tbWVudEh0bWxJdGVtLCAnLmNvbW1lbnQtaW5mbyYmc3BhbltjbGFzc149Y29tbWVudC10aW1lXSYmVGV4dCcpKTsKICAgICAgICBjb250ZW50ID0gY29udGVudCArICc8YnI+JyArIGdldENvbW1lbnRNZXRhKG1ldGEpOwogICAgICAgIGNvbnRlbnQgPSBjb250ZW50CiAgICAgICAgICAgIC5yZXBsYWNlKC88YSBjbGFzcz0ic291cmNlLWljb24iW1xzXFNdKj88XC9hPi9nLCAnJykKICAgICAgICAgICAgLnJlcGxhY2UoL1woPGEgaHJlZj0iamF2YXNjcmlwdDo7Iltcc1xTXSo/PuWxleW8gDxcL2E+XCkvZywgJycpOwogICAgICAgIGxpc3QucHVzaCh7CiAgICAgICAgICAgIHRpdGxlOiBjb250ZW50LAogICAgICAgICAgICBjb2xfdHlwZTogY29tbWVudENvbFR5cGUKICAgICAgICB9KTsKICAgIH0sCiAgICAvKioKICAgICAqIOixhueTo+ivhOWIhuaooeWdl++8iOinhumikS/or7vkuabvvIkKICAgICAqLwogICAgYWRkUmF0aW5nTW9kdWxlOiAoaHRtbCwgdXJsLCB3aXRoVGl0bGUsIGxpc3QpID0+IHsKICAgICAgICBsZXQgcmF0aW5nQ29sVHlwZSA9ICdyaWNoX3RleHQnOwogICAgICAgIGxldCByYXRpbmcgPSBwYXJzZURvbUZvckh0bWwoaHRtbCwgJyNpbnRlcmVzdF9zZWN0bCYmSHRtbCcpOwogICAgICAgIGxldCByYXRpbmdfdGl0bGUgPSAnJzsKICAgICAgICBsZXQgcmF0aW5nX2NvbnRlbnQgPSAnJzsKICAgICAgICBsZXQgcmF0aW5nX3Nob3cgPSBwYXJzZURvbUZvckh0bWwocmF0aW5nLCAnLnJhdGluZ19zZWxmJiZkaXZbY2xhc3NePXJhdGluZ19yaWdodF0mJlRleHQnKTsKICAgICAgICBpZiAocmF0aW5nX3Nob3cgPT09ICflsJrmnKrmkq3lh7onIHx8IHJhdGluZ19zaG93ID09PSAn5bCa5pyq5LiK5pigJykgewogICAgICAgICAgICByYXRpbmdfY29udGVudCArPSAod2l0aFRpdGxlID09PSAxID8gKGdldEJpZ1RleHQoJ+ixhueTo+ivhOWIhicpICsgJyAnICsgZ2V0U21hbGxUZXh0KGdldEdyZXlUZXh0KHJhdGluZ19zaG93KSkpIDogJycpOwogICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgIGxldCByYXRpbmdUZXh0ID0gcGFyc2VEb21Gb3JIdG1sKHJhdGluZywgJy5yYXRpbmdfc2VsZiYmc3Ryb25nJiZUZXh0Jyk7CiAgICAgICAgICAgIHJhdGluZ19jb250ZW50ICs9ICh3aXRoVGl0bGUgPT09IDEgPyBnZXRCaWdUZXh0KCfosYbnk6Por4TliIYgJwogICAgICAgICAgICAgICAgKyAocmF0aW5nVGV4dCA9PT0gJycKICAgICAgICAgICAgICAgICAgICA/IGdldFNtYWxsVGV4dChnZXRHcmV5VGV4dCgn5pqC5peg6K+E5YiGJykpCiAgICAgICAgICAgICAgICAgICAgOiAoZ2V0VGl0bGVUZXh0KHJhdGluZ1RleHQpICsgJyDliIYnKSkKICAgICAgICAgICAgICAgICsgJzxicj4nKSA6ICcnKTsKICAgICAgICAgICAgbGV0IHJhdGluZ19hcnJheSA9IFtdOwogICAgICAgICAgICBpZiAodXJsLmluZGV4T2YoJ2Jvb2snKSA+IC0xKSB7CiAgICAgICAgICAgICAgICByYXRpbmdfYXJyYXkgPSByYXRpbmcubWF0Y2goLzxzcGFuIGNsYXNzPSJzdGFyc1tcc1xTXSo/KD89PGJyPikvZyk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICByYXRpbmdfYXJyYXkgPSBwYXJzZURvbUZvckFycmF5KHJhdGluZywgJy5yYXRpbmdzLW9uLXdlaWdodCYmLml0ZW0nKTsKICAgICAgICAgICAgfQogICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJhdGluZ19hcnJheS5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgbGV0IHJhdGluZ0l0ZW0gPSByYXRpbmdfYXJyYXlbaV07CiAgICAgICAgICAgICAgICBpZiAoc2V0dGluZ3MucmF0aW5nVGV4dE1vZGUgPT09IDApIHsKICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMCkgcmF0aW5nX2NvbnRlbnQgKz0gJ/CfjJ8gJzsKICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMikgcmF0aW5nX2NvbnRlbnQgKz0gJzxicj7irZAgJzsKICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PT0gMykgcmF0aW5nX2NvbnRlbnQgKz0gJzxicj7imITvuI8gJzsKICAgICAgICAgICAgICAgICAgICByYXRpbmdfY29udGVudCArPSBnZXRDb2xvclRleHQocGFyc2VEb21Gb3JIdG1sKHJhdGluZ0l0ZW0sICdUZXh0JyksIHNldHRpbmdzLnJhdGluZ0NvbG9yc1tpXSkgKyAnXHRcdCc7CiAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgIGxldCBzdGFyX3RleHQgPSBwYXJzZURvbUZvckh0bWwocmF0aW5nSXRlbSwgJ3NwYW5bY2xhc3NePXN0YXJzXSYmVGV4dCcpOwogICAgICAgICAgICAgICAgICAgIGxldCByYXRpbmdfcGVyX3RleHQgPSBwYXJzZURvbUZvckh0bWwocmF0aW5nSXRlbSwgJy5yYXRpbmdfcGVyJiZUZXh0Jyk7CiAgICAgICAgICAgICAgICAgICAgbGV0IHJhdGluZ19wZXIgPSBwYXJzZUZsb2F0KHJhdGluZ19wZXJfdGV4dC5yZXBsYWNlKCclJywgJycpKTsKICAgICAgICAgICAgICAgICAgICBsZXQgcHJvZ3Jlc3NUZXh0ID0gZ2V0UHJvZ3Jlc3NUZXh0KHJhdGluZ19wZXIsIGkpOwogICAgICAgICAgICAgICAgICAgIHJhdGluZ19jb250ZW50ICs9IChnZXRHcmV5VGV4dChzdGFyX3RleHQgKyAnICcpICsgcHJvZ3Jlc3NUZXh0ICsgJyAnICsgZ2V0R3JleVRleHQocmF0aW5nX3Blcl90ZXh0KSk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCByYXRpbmdfYXJyYXkubGVuZ3RoIC0gMSkgcmF0aW5nX2NvbnRlbnQgKz0gJzxicj4nOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIGxldCBkQ29udGVudCA9IHJhdGluZ190aXRsZSArIChyYXRpbmdfdGl0bGUgPT09ICcnID8gJycgOiAnPGJyPicpICsgcmF0aW5nX2NvbnRlbnQ7CiAgICAgICAgbGlzdC5wdXNoKHsKICAgICAgICAgICAgdGl0bGU6IGRDb250ZW50LAogICAgICAgICAgICBjb2xfdHlwZTogcmF0aW5nQ29sVHlwZQogICAgICAgIH0pOwogICAgfSwKICAgIC8qKgogICAgICog6KeG6aKR5rqQ5qih5Z2XCiAgICAgKi8KICAgIGFkZFNvdXJjZU1vZHVsZTogKGh0bWwsIHVybCwgd2l0aFRpdGxlLCBsaXN0LCBwYXJhbXMpID0+IHsKICAgICAgICBsZXQgdGl0bGVDb2xUeXBlID0gJ3JpY2hfdGV4dCc7CiAgICAgICAgbGV0IHNvdXJjZUh0bWwgPSAnPGJvZHk+JyArIHBhcnNlRG9tRm9ySHRtbChodG1sLCAnLmdyYXlfYWQmJkh0bWwnKSArICc8L2JvZHk+JzsKICAgICAgICBpZiAod2l0aFRpdGxlKSB7CiAgICAgICAgICAgIGxldCBzb3VyY2VfdGl0bGUgPSBwYXJzZURvbUZvckh0bWwoc291cmNlSHRtbCwgJ2gyJiZUZXh0JykKICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oLio/55qEKXwowrcgwrcgwrcgwrcgwrcgwrcpfCgmbmJzcDvCtyZuYnNwO8K3Jm5ic3A7wrcmbmJzcDvCtyZuYnNwO8K3Jm5ic3A7wrcpfCjCt8KgwrfCoMK3wqDCt8KgwrfCoMK3KS9nLCAnJyk7CiAgICAgICAgICAgIGlmICghc291cmNlX3RpdGxlKSByZXR1cm47CiAgICAgICAgICAgIHNvdXJjZV90aXRsZSA9IGdldEdyZXlUZXh0KHNvdXJjZV90aXRsZSk7CiAgICAgICAgICAgIGxpc3QucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogc291cmNlX3RpdGxlLAogICAgICAgICAgICAgICAgY29sX3R5cGU6IHRpdGxlQ29sVHlwZQogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgbGV0IGZpbGUgPSAiaGlrZXI6Ly9maWxlcy9ydWxlcy9qb2tlci9xZGIuanMiOwogICAgICAgIHB1dFZhcih7CiAgICAgICAgICAgIGtleTogInFkYl9maWxlIiwKICAgICAgICAgICAgdmFsdWU6IGZpbGUKICAgICAgICB9KTsKICAgICAgICBldmFsKGZldGNoKGdldFZhcigncWRiX2ZpbGUnKSkpOwogICAgICAgIHByZSgpCiAgICAgICAgbGV0IGNvbmZpZyA9IEpTT04ucGFyc2UoZmV0Y2goZ2V0VmFyKCdxZGJfY29uZmlnJykpKTsKICAgICAgICBsZXQgYW5hbHlzaXNDb25maWdzID0gZ2V0Q29uZmlnKCdhbmFseXNpc0NvbmZpZ3MnLCBjb25maWcpOwogICAgICAgIGxldCBleHRyYUNvbmZpZyA9IGFuYWx5c2lzQ29uZmlnc1thbmFseXNpc0NvbmZpZ3MudXNlXS5leHRyYSB8fCAne30nOwogICAgICAgIGxldCBleHRyYSA9IHt9OwogICAgICAgIHRyeSB7CiAgICAgICAgICAgIGlmIChleHRyYUNvbmZpZy5zdGFydHNXaXRoKCd7JykpIGV2YWwoJ2V4dHJhPScgKyBleHRyYUNvbmZpZyk7CiAgICAgICAgfSBjYXRjaCAoZSkge30KICAgICAgICB2aWRlb1VybHNNb2R1bGUobGlzdCwgcGFyYW1zLnR5cGUsIHBhcmFtcy5pZCwgWydpY29uXzInLCAnaWNvbl9zbWFsbF80J10sIHBhcnNlVmlkZW9VcmxMYXp5LCBudWxsLCBleHRyYSkKICAgICAgICBsaXN0LnB1c2goewogICAgICAgICAgICB0aXRsZTogJ+ino+aekOiuvue9ricsCiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vejMuYXgxeC5jb20vMjAyMS8wNi8wNC8yOERvSWUucG5nJywKICAgICAgICAgICAgY29sX3R5cGU6IHBhcmFtcy50eXBlID09PSAibW92aWUiID8gJ2ljb25fc21hbGxfNCcgOiAiaWNvbl8yIiwKICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vSGlzdG9yeSMnKQogICAgICAgICAgICAgICAgLnJ1bGUoKCkgPT4gewogICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn6auY57qn5Yqf6IO9Jyk7CiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTsKICAgICAgICAgICAgICAgICAgICBldmFsKHJlcXVlc3QoZ2V0VmFyKCdxZGJfZmlsZScpKSk7CiAgICAgICAgICAgICAgICAgICAgYW5hbHlzaXNWZXJpZnlNb2R1bGUoZCk7CiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpOwogICAgICAgICAgICAgICAgfSkKICAgICAgICB9KTsKICAgICAgICBmb3IgKGxldCBpID0gMDs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IgKGxldCBpID0gMDsgaSA8IHRyYWlsZXJfcGhvdG9fbGlzdC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsZXQgdHJhaWxlcl9waG90b19pdGVtID0gdHJhaWxlcl9waG90b19saXN0W2ldOwogICAgICAgICAgICBpZiAodHJhaWxlcl9waG90b19pdGVtLmluZGV4T2YoJ2xhYmVsLXRyYWlsZXInKSAhPT0gLTEgfHwgdHJhaWxlcl9waG90b19pdGVtLmluZGV4T2YoJ2xhYmVsLXNob3J0LXZpZGVvJykgIT09IC0xKSB7CiAgICAgICAgICAgICAgICBsZXQgdHJhaWxlclRpdGxlID0gcGFyc2VEb21Gb3JIdG1sKHRyYWlsZXJfcGhvdG9faXRlbSwgJ2EmJnRpdGxlJyk7CiAgICAgICAgICAgICAgICBsZXQgdHJhaWxlckxpbmsgPSBwYXJzZURvbUZvckh0bWwodHJhaWxlcl9waG90b19pdGVtLCAnYSYmaHJlZicpOwogICAgICAgICAgICAgICAgbGV0IHRyYWlsZXJQaWMgPSBwYXJzZURvbUZvckh0bWwodHJhaWxlcl9waG90b19pdGVtLCAnYSYmc3R5bGUnKTsKICAgICAgICAgICAgICAgIC8vIC9iYWNrZ3JvdW5kLWltYWdlOnVybFwoKC4qPylcKS8udGVzdCh0cmFpbGVyUGljKTsKICAgICAgICAgICAgICAgIC8vIHRyYWlsZXJQaWMgPSBSZWdFeHAuJDE7CiAgICAgICAgICAgICAgICBsaXN0LnB1c2goewogICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0cmFpbGVyVGl0bGUsCiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogdHJhaWxlclBpYyArIGRvdWJhbi5waWNSZWZlcmVyLAogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMicsCiAgICAgICAgICAgICAgICAgICAgdXJsOiB0cmFpbGVyTGluayArIGRvdWJhbi5nZXRIZWFkZXJzKCkgKyBkb3ViYW4udHJhaWxlckxhenlSdWxlCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgbGV0IHBpY1VybCA9IHBhcnNlRG9tRm9ySHRtbCh0cmFpbGVyX3Bob3RvX2l0ZW0sICdpbWcmJnNyYycpLnJlcGxhY2UoL1wvKHNxeHN8bSlcLy9nLCAnL2wvJyk7CiAgICAgICAgICAgICAgICBsaXN0LnB1c2goewogICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBpY1VybCArIGRvdWJhbi5waWNSZWZlcmVyLAogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzInLAogICAgICAgICAgICAgICAgICAgIHVybDogcGljVXJsCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSwKICAgIC8qKgogICAgICog55+t6K+E5qih5Z2XCiAgICAgKi8KICAgIGFkZENvbW1lbnRzTW9kdWxlOiAoaHRtbCwgd2l0aFRpdGxlLCBsaXN0KSA9PiB7CiAgICAgICAgbGV0IGNvbW1lbnRzQ29sVHlwZSA9ICdyaWNoX3RleHQnOwogICAgICAgIGxldCBjb21tZW50c19odG1sID0gcGFyc2VEb21Gb3JIdG1sKGh0bWwsICcjY29tbWVudHMtc2VjdGlvbiYmSHRtbCcpOwogICAgICAgIGxldCBjb21tZW50c190aXRsZSA9IGdldEJpZ1RleHQoZ2V0R3JleVRleHQocGFyc2VEb21Gb3JIdG1sKGNvbW1lbnRzX2h0bWwsICdoMiYmSHRtbCcpCiAgICAgICAgICAgIC5yZXBsYWNlKC8oLio/55qEKXwowrcgwrcgwrcgwrcgwrcgwrcpfCgmbmJzcDvCtyZuYnNwO8K3Jm5ic3A7wrcmbmJzcDvCtyZuYnNwO8K3Jm5ic3A7wrcpL2csICcnKSkpCiAgICAgICAgICAgIC5yZXBsYWNlKC88aVtcc1xTXSo/Pnw8XC9pPi9nLCAnJyk7CiAgICAgICAgLy8gLnJlcGxhY2UoL21vdmllLmRvdWJhbi5jb20vZywgJ20uZG91YmFuLmNvbS9tb3ZpZScpOwogICAgICAgIGxldCBjb21tZW50c1J1bGUgPSAnQHJ1bGU9anM6ICcgKyBgZXZhbChmZXRjaCgnYCArIHNldHRpbmdzLmpzRmlsZSArIGAnLCB7fSkpO2RvdWJhbi5jb21tZW50TGlzdFZpZXcoKTtgOwogICAgICAgIGxldCBjb21tZW50c1VybCA9IHBhcnNlRG9tRm9ySHRtbChjb21tZW50c190aXRsZSwgJ2EmJmhyZWYnKTsKICAgICAgICBsZXQgY29tbWVudHNSdWxlVXJsID0gJ2Jhc2U2NDovLycgKyBiYXNlNjRFbmNvZGUoJ2hpa2VyOi8vZW1wdHkjJyArIGNvbW1lbnRzVXJsICsgJyZzdGFydD1meXBhZ2VALTFAKjIwQCZsaW1pdD0yMCcgKyAnI25vSGlzdG9yeSMnICsgZG91YmFuLmdldEhlYWRlcnMoKSArIGNvbW1lbnRzUnVsZSk7CiAgICAgICAgY29tbWVudHNfdGl0bGUgPSBjb21tZW50c190aXRsZS5yZXBsYWNlKGNvbW1lbnRzVXJsLCBjb21tZW50c1J1bGVVcmwpOwogICAgICAgIGlmICh3aXRoVGl0bGUpIHsKICAgICAgICAgICAgbGlzdC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiBjb21tZW50c190aXRsZSwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiBjb21tZW50c0NvbFR5cGUKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIGxldCBjb21tZW50c19jb250ZW50X2h0bWwgPSBwYXJzZURvbUZvckh0bWwoY29tbWVudHNfaHRtbCwgJy50YWItYmR8fCNjb21tZW50LWxpc3Qtd3JhcHBlciYmSHRtbCcpOwogICAgICAgIGxldCBjb21tZW50c19jb250ZW50X2h0bWxfYXJyYXkgPSBwYXJzZURvbUZvckFycmF5KGNvbW1lbnRzX2NvbnRlbnRfaHRtbCwgJyNob3QtY29tbWVudHN8fCNuZXdfc2NvcmUmJi5jb21tZW50LWl0ZW0nKTsKICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGNvbW1lbnRzX2NvbnRlbnRfaHRtbF9hcnJheS5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBsZXQgY29tbWVudEh0bWxJdGVtID0gY29tbWVudHNfY29udGVudF9odG1sX2FycmF5W2ldOwogICAgICAgICAgICBkb3ViYW4uYWRkQ29tbWVudEl0ZW0obGlzdCwgY29tbWVudEh0bWxJdGVtKTsKICAgICAgICAgICAgaWYgKGkgPCBjb21tZW50c19jb250ZW50X2h0bWxfYXJyYXkubGVuZ3RoIC0gMSkgewogICAgICAgICAgICAgICAgbGlzdC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgfSwKICAgIC8qKgogICAgICog5Ymn6K+EL+S5puivhOaooeWdlwogICAgICovCiAgICBhZGRSZXZpZXdzTW9kdWxlOiAoaHRtbCwgdXJsLCB3aXRoVGl0bGUsIGxpc3QpID0+IHsKICAgICAgICBsZXQgcmV2aWV3c0NvbFR5cGUgPSAncmljaF90ZXh0JzsKICAgICAgICBsZXQgcmV2aWV3c19odG1sID0gcGFyc2VEb21Gb3JIdG1sKGh0bWwsICcjcmV2aWV3cy13cmFwcGVyJiZIdG1sJyk7CiAgICAgICAgbGV0IHJldmlld3NfdGl0bGUgPSBnZXRCaWdUZXh0KGdldEdyZXlUZXh0KAogICAgICAgICAgICBwYXJzZURvbUZvckh0bWwocmV2aWV3c19odG1sLCAnaDImJkh0bWwnKQogICAgICAgICAgICAgICAgLnJlcGxhY2UoJ2hyZWY9InJldmlld3MiJywgJ2hyZWY9IicgKyB1cmwgKyAncmV2aWV3cyInKQogICAgICAgICAgICAgICAgLnJlcGxhY2UoLyguKj/nmoQpfCjCtyDCtyDCtyDCtyDCtyDCtykvZywgJycpCiAgICAgICAgICAgICAgICAucmVwbGFjZSgvbS5kb3ViYW4uY29tXC9tb3ZpZS9nLC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ZXdzX2NvbnRlbnRfaHRtbCwgJ2RpdiYmZGl2W15kYXRhLWNpZF0nKTsKICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHJldmlld3NfY29udGVudF9odG1sX2FycmF5Lmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgIC8qZm9yKGxldCBqID0gMDsgaiA8IDE3OyBqKyspIHsKICAgICAgICAgICAgICAgIGlmIChpID4gMCkgewogICAgICAgICAgICAgICAgICAgIGxpc3QucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSovCgogICAgICAgICAgICBsZXQgcmV2aWV3SHRtbEl0ZW0gPSByZXZpZXdzX2NvbnRlbnRfaHRtbF9hcnJheVtpXTsKICAgICAgICAgICAgZG91YmFuLmFkZFJldmlld0l0ZW0obGlzdCwgcmV2aWV3SHRtbEl0ZW0pOwogICAgICAgICAgICBpZiAoaSA8IHJldmlld3NfY29udGVudF9odG1sX2FycmF5Lmxlbmd0aCAtIDEpIHsKICAgICAgICAgICAgICAgIGxpc3QucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJwogICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0sCiAgICAvKioKICAgICAqIOeugOa0gS/mvJTogYzlkZjmqKHlnZcKICAgICAqLwogICAgd29ya2VyVmlldzogZnVuY3Rpb24gKCkgewogICAgICAgIHZhciByZXMgPSB7fTsKICAgICAgICB2YXIgZCA9IFtdOwogICAgICAgIHZhciB3b3JrZXIgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJiNjZWxlYnJpdGllcyYmSHRtbCcpICsgJzwvYm9keT4nOwogICAgICAgIHZhciB3b3JrZXJfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkod29ya2VyLCAnYm9keSYmLmxpc3Qtd3JhcHBlcicpOwogICAgICAgIGZvciAodmFyIHcgaW4gd29ya2VyX2xpc3QpIHsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwod29ya2VyX2xpc3Rbd10sICdoMiYmVGV4dCcpLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsb25nX3RleHQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB2YXIgbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkod29ya2VyX2xpc3Rbd10sICd1bCYmbGknKTsKICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIGZvciAodmFyIGwgaW4gbGlzdCkgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobGlzdFtsXSwgJ2EubmFtZSYmVGV4dCcpICsgJ1xuJyArIHBhcnNlRG9tRm9ySHRtbChsaXN0W2xdLCAnLnJvbGUmJnRpdGxlJyksCiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IHBhcnNlRG9tRm9ySHRtbChsaXN0W2xdLCAnLndvcmtzJiZUZXh0JyksCiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChsaXN0W2xdLCAnLmF2YXRhciYmc3R5bGUnKSwKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwYXJzZURvbUZvckh0bWwobGlzdFtsXSwgJ2EubmFtZSYmaHJlZicpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICArICcjbm9IaXN0b3J5IycKICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgZG91YmFuLmdldEhlYWRlcnMoKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAnQHJ1bGU9anM6JyArIGBsZXQganNGaWxlID0gZ2V0VmFyKCJkYl9qc19maWxlIik7anNGaWxlID0ganNGaWxlID09PSAnJyA/ICJoaWtlcjovL2ZpbGVzL3J1bGVzL2pzL3J0LWRvdWJhbi5qcyIgOiBqc0ZpbGU7ZXZhbChmZXRjaChqc0ZpbGUse30pKTtkb3ViYW4ubW92aWVyZGVzY1ZpZXcoKTtgLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmVzLmRhdGEgPSBkOwogICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTsKICAgIH0sCiAgICAvKioKICAgICAqIOeugOa0gS/lvbHkurrnroDku4vmqKHlnZcKICAgICAqLwogICAgbW92aWVyZGVzY1ZpZXc6IGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgcmVzID0ge307CiAgICAgICAgdmFyIGQgPSBbXTsKICAgICAgICB2YXIgcGVvcGxlX3BpYyA9IHBhcnNlRG9tRm9ySHRtbChnZXRSZXNDb2RlKCksICdib2R5JiYubmJnW3RpdGxlXSYmaW1nJiZzcmMnKTsKICAgICAgICB2YXIgcGVvcGxlX3RpdGxlID0gcGFyc2VEb21Gb3JIdG1sKGdldFJlc0NvZGUoKSwgJ2JvZHkmJi5uYmdbdGl0bGVdJiZ0aXRsZScpLnJlcGxhY2UoZ2V0VXJsKCkgKyAiLyIsICIiKTsKICAgICAgICB2YXIgcGVvcGxlX2Rlc2MgPSBwYXJzZURvbUZvckh0bWwoZ2V0UmVzQ29kZSgpLCAnYm9keSYmdWxbY2xhc3M9IiJdJiZUZXh0JykucmVwbGFjZShnZXRVcmwoKSArICIvIiwgIiIpOwogICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgIHRpdGxlOiBwZW9wbGVfdGl0bGUsCiAgICAgICAgICAgIGRlc2M6IHBlb3BsZV9kZXNjLAogICAgICAgICAgICBwaWNfdXJsOiBwZW9wbGVfcGljLAogICAgICAgICAgICB1cmw6IGdldFVybCgpLAogICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJwogICAgICAgIH0pOwogICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICB9KTsKICAgICAgICB0cnkgewogICAgICAgICAgICB2YXIgZGVzYyA9IHBhcnNlRG9tRm9ySHRtbChnZXRSZXNDb2RlKCksICdib2R5JiYjaW50cm8mJi5hbGwmJlRleHQnKS5yZXBsYWNlKGdldFVybCgpICsgIi8iLCAiIik7CgogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6ICflvbHkurrnroDku4snLAogICAgICAgICAgICAgICAgdXJsOiAndG9hc3Q6Ly/ov5nph4zmmK/moIfpopgnLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJwogICAgICAgICAgICB9KTsKCiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogZGVzYywKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0JwogICAgICAgICAgICB9KTsKICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+ivpeW9seS6uuaaguaXoOeugOS7iycsCiAgICAgICAgICAgICAgICB1cmw6ICd0b2FzdDovL+i/memHjOecn+eahOWPquaYr+agh+mimCcsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICBkLnB1c2goewogICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnCiAgICAgICAgfSk7CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgdmFyIHJlY2VudF9tb3ZpZXMgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJiNyZWNlbnRfbW92aWVzJiZIdG1sJykgKyAnPC9ib2R5Pic7CiAgICAgICAgICAgIHZhciByZWNlbnRfbW92aWVzX2xpc3QgPSBwYXJzZURvbUZvckFycmF5KHJlY2VudF9tb3ZpZXMsICdib2R5JiZsaVtjbGFzc10nKTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiAn5pyA6L+R5LiK5pig55qE5L2c5ZOBJywKICAgICAgICAgICAgICAgIHVybDogJ3RvYXN0Oi8vSGVyZSBpcyB0aGUgdGl0bGUhISEnLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZm9yICh2YXIgciBpbiByZWNlbnRfbW92aWVzX2xpc3QpIHsKICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChyZWNlbnRfbW92aWVzX2xpc3Rbcl0sICcuaW5mbyYmVGV4dCcpLAogICAgICAgICAgICAgICAgICAgIGRlc2M6IHBhcnNlRG9tRm9ySHRtbChyZWNlbnRfbW92aWVzX2xpc3Rbcl0sICdoMyYmVGV4dCcpLAogICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChyZWNlbnRfbW92aWVzX2xpc3Rbcl0sICdpbWdbY2xhc3NdJiZzcmMnKSwKICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tRm9ySHRtbChyZWNlbnRfbW92aWVzX2xpc3Rbcl0sICdhJiZocmVmJykgKyBkb3ViYW4uZ2V0SGVhZGVycygpICsgJ0BydWxlPWpzOicgKyBgbGV0IGpzRmlsZSA9IGdldFZhcigiZGJfanNfZmlsZSIpO2pzRmlsZSA9IGpzRmlsZSA9PT0gJycgPyAiaGlrZXI6Ly9maWxlcy9ydWxlcy9qcy9ydC1kb3ViYW4uanMiIDoganNGaWxlO2V2YWwoZmV0Y2goanNGaWxlLHt9KSk7ZG91YmFuLmRldGFpbFZpZXcoKTtgLAogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMycKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnCiAgICAgICAgICAgIH0pOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICB9CiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgdmFyIGJlc3RfbW92aWVzID0gJzxib2R5PicgKyBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiYjYmVzdF9tb3ZpZXMmJkh0bWwnKSArICc8L2JvZHk+JzsKICAgICAgICAgICAgdmFyIGJlc3RfbW92aWVzX2xpc3QgPSBwYXJzZURvbUZvckFycmF5KGJlc3RfbW92aWVzLCAnYm9keSYmbGlbY2xhc3NdJyk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+acgOWPl+asoui/jueahOS9nOWTgScsCiAgICAgICAgICAgICAgICB1cmw6ICd0b2FzdDovL0hlcmUgaXMgdGhlIHRpdGxlISEhJywKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGZvciAodmFyIHIgaW4gYmVzdF9tb3ZpZXNfbGlzdCkgewogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGJlc3RfbW92aWVzX2xpc3Rbcl0sICcuaW5mbyYmVGV4dCcpLnNwbGl0KHBhcnNlRG9tRm9ySHRtbChiZXN0X21vdmllc19saXN0W3JdLCAnLnBsJiZUZXh0JykpWzBdLAogICAgICAgICAgICAgICAgICAgIGRlc2M6IHBhcnNlRG9tRm9ySHRtbChiZXN0X21vdmllc19saXN0W3JdLCAnLnBsJiZUZXh0JyksCiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogcGFyc2VEb21Gb3JIdG1sKGJlc3RfbW92aWVzX2xpc3Rbcl0sICdpbWdbY2xhc3NdJiZzcmMnKSwKICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tRm9ySHRtbChiZXN0X21vdmllc19saXN0W3JdLCAnYSYmaHJlZicpICsgZG91YmFuLmdldEhlYWRlcnMoKSArICdAcnVsZT1qczpldmFsKGZldGNoKGdldFZhcigiZGJfanNfZmlsZSIpLHt9KSk7ZG91YmFuLmRldGFpbFZpZXcoKTsnLAogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMycKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnCiAgICAgICAgICAgIH0pOwogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICB9CiAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgdGl0bGU6ICfmn6XnnIvlhajpg6jkvZzlk4EnLAogICAgICAgICAgICB1cmw6IGdldFVybCgpICsgJ21vdmllcz9zdGFydD1meXBhZ2VALTFAKjE3QCZmb3JtYXQ9cGljJnNvcnRieT12b3RlJicgKyBkb3ViYW4uZ2V0SGVhZGVycygpICsgJ0BydWxlPWpzOicgKyBgbGV0IGpzRmlsZSA9IGdldFZhcigiZGJfanNfZmlsZSIpO2pzRmlsZSA9IGpzRmlsZSA9PT0gJycgPyAiaGlrZXI6Ly9maWxlcy9ydWxlcy9qcy9ydC1kb3ViYW4uanMiIDoganNGaWxlO2V2YWwoZmV0Y2goanNGaWxlLHt9KSk7ZG91YmFuLmFsbG1vdmllVmlldygpO2AsCiAgICAgICAgIC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LGNvbF90eXBlOidwaWNfMid9KTt9cmVzLmRhdGEgPSBkO3NldEhvbWVSZXN1bHQocmVzKTtgLAogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZm9yICh2YXIgdCA9IDA7IHQgPCAzOyB0KyspIHsKICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBwYXJzZURvbUZvckh0bWwocGhvdG9zX2xpc3RbdF0sICdpbWcmJnNyYycpLAogICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tRm9ySHRtbChwaG90b3NfbGlzdFt0XSwgJ2ltZyYmc3JjJykucmVwbGFjZSgvXC8oc3F4c3xtKVwvL2csICcvbC8nKSwKICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdwaWNfMycKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICB9CiAgICAgICAgcmVzLmRhdGEgPSBkOwogICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTsKICAgIH0sCgogICAgLyoqCiAgICAgKiDnroDmtIEv5YWo6YOo5b2x54mH5qih5Z2XCiAgICAgKi8KICAgIGFsbG1vdmllVmlldzogZnVuY3Rpb24gKCkgewogICAgICAgIHZhciByZXMgPSB7fTsKICAgICAgICB2YXIgZCA9IFtdOwogICAgICAgIHZhciBtb3ZpZXMgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJiNjb250ZW50JiZ1bFtjbGFzcz0iIl0mJkh0bWwnKSArICc8L2JvZHk+JzsKICAgICAgICB2YXIgbW92aWVzX2xpc3QgPSBwYXJzZURvbUZvckFycmF5KG1vdmllcywgJ2JvZHkmJmxpW2NsYXNzPSIiXScpOwogICAgICAgIGZvciAodmFyIG0gaW4gbW92aWVzX2xpc3QpIHsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwobW92aWVzX2xpc3RbbV0sICdpbWcmJmFsdCcpLAogICAgICAgICAgICAgICAgZGVzYzogcGFyc2VEb21Gb3JIdG1sKG1vdmllc19saXN0W21dLCAnLnN0YXImJlRleHQnKSwKICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChtb3ZpZXNfbGlzdFttXSwgJ2ltZyYmc3JjJyksCiAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tRm9ySHRtbChtb3ZpZXNfbGlzdFttXSwgJy5uYmcmJmhyZWYnKSArIGRvdWJhbi5nZXRIZWFkZXJzKCkgKyAnQHJ1bGU9anM6JyArIGBsZXQganNGaWxlID0gZ2V0VmFyKCJkYl9qc19maWxlIik7anNGaWxlID0ganNGaWxlID09PSAnJyA/ICJoaWtlcjovL2ZpbGVzL3J1bGVzL2pzL3J0LWRvdWJhbi5qcyIgOiBqc0ZpbGU7ZXZhbChmZXRjaChqc0ZpbGUse30pKTtkb3ViYW4uZGV0YWlsVmlldygpO2AsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzMnCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICByZXMuZGF0YSA9IGQ7CiAgICAgICAgc2V0SG9tZVJlc3VsdChyZXMpOwogICAgfSwKICAgIC8qKgogICAgICog566A5rSBL+mVv+ivhOaooeWdlwogICAgICovCiAgICBsb25nVmlldzogZnVuY3Rpb24gKCkgewogICAgICAgIHZhciByZXMgPSB7fTsKICAgICAgICB2YXIgZCA9IFtdOwogICAgICAgIHZhciBjb21tZW50cyA9ICc8Ym9keT4nICsgcGFyc2VEb20oZ2V0UmVzQ29kZSgpLCAnYm9keSYmLnJldmlldy1saXN0JiZIdG1sJykgKyAnPC9ib2R5Pic7CiAgICAgICAgdmFyIGxpc3QgPSBwYXJzZURvbUZvckFycmF5KGNvbW1lbnRzLCAnYm9keSYmZGl2W2RhdGEtY2lkXScpOwogICAgICAgIGZvciAodmFyIGkgaW4gbGlzdCkgewogICAgICAgICAgICBpZiAobGlzdFtpXS5pbmRleE9mKCJhbGxzdGFyNTAiKSAhPSAtMSkgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYheKYheKYheKYheKYhSc7CiAgICAgICAgICAgICAgICB2YXIgY29tbWVudF90aXRsZSA9ICcgIOWKm+iNkCc7CiAgICAgICAgICAgIH0gZWxzZSBpZiAobGlzdFtpXS5pbmRleE9mKCJhbGxzdGFyNDAiKSAhPSAtMSkgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYheKYheKYheKYheKYhic7CiAgICAgICAgICAgICAgICB2YXIgY29tbWVudF90aXRsZSA9ICcgIOaOqOiNkCc7CiAgICAgICAgICAgIH0gZWxzZSBpZiAobGlzdFtpXS5pbmRleE9mKCJhbGxzdGFyMzAiKSAhPSAtMSkgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYheKYheKYheKYhuKYhic7CiAgICAgICAgICAgICAgICB2YXIgY29tbWVudF90aXRsZSA9ICcgIOi/mOihjCc7CiAgICAgICAgICAgIH0gZWxzZSBpZiAobGlzdFtpXS5pbmRleE9mKCJhbGxzdGFyMjAiKSAhPSAtMSkgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYheKYheKYhuKYhuKYhic7CiAgICAgICAgICAgICAgICB2YXIgY29tbWVudF90aXRsZSA9ICcgIOi+g+W3ric7CiAgICAgICAgICAgIH0gZWxzZSBpZiAobGlzdFtpXS5pbmRleE9mKCJhbGxzdGFyMTciKSAhPSAtMSkgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYheKYhuKYhuKYhuKYhic7CiAgICAgICAgICAgICAgICB2YXIgY29tbWVudF90aXRsZSA9ICcgIOW+iOW3ric7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICB2YXIgYXZhdGFyX3RpdGxlID0gJyAg4piG4piG4piG4piG4piGJzsKICAgICAgICAgICAgICAgIHZhciBjb21tZW50X3RpdGxlID0gJyAgJzsKICAgICAgICAgICAgfQogICAgICAgICAgICB2YXIgdGltZSA9IHBhcnNlRG9tRm9ySHRtbChsaXN0W2ldLCAnc3Bhbltjb250ZW50XSYmVGV4dCcpOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChsaXN0W2ldLCAnLm5hbWUmJlRleHQnKSArIGF2YXRhcl90aXRsZSArIGNvbW1lbnRfdGl0bGUgKyAnICAnICsgdGltZSwKICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChsaXN0W2ldLCAnLmF2YXRvciYmaW1nJiZzcmMnKSwKICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb21Gb3JIdG1sKGxpc3RbaV0sICcuYXZhdG9yJiZocmVmJyksCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGxpc3RbaV0sICdoMiYmVGV4dCcpLAogICAgICAgICAgICAgICAgdXJsOiAndG9hc3Q6Ly/ov5nph4zmmK/moIfpopgnLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsb25nX3RleHQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB2YXIgbWFpbiA9IHBhcnNlRG9tRm9ySHRtbChsaXN0W2ldLCAnLnNob3J0LWNvbnRlbnQmJlRleHQnKTsKICAgICAgICAgICAgaWYgKG1haW4uaW5kZXhPZigiXCgg5bGV5byAXCkiKSAhPSAtMSkgewogICAgICAgICAgICAgICAgdmFyIG1haW4gPSBtYWluLnNwbGl0KCJcKCDlsZXlvIBcKSIpWzBdOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogbWFpbiwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0JwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiAn54K55Ye75q2k5aSE5p+l55yL5YWo5paHPj4nLAogICAgICAgICAgICAgICAgcGljX3VybDogJ2h0dHBzOi8vczEuYXgxeC5jb20vMjAyMC8xMS8wNS9CZ3hVZUkucG5nJywKICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb21Gb3JIdG1sKGxpc3RbaV0sICdoMiYmYSYmaHJlZicpICsgJyNmeXBhZ2Ujbm9IaXN0b3J5IycgKyAnQHJ1bGU9anM6JyArIGBsZXQganNGaWxlID0gZ2V0VmFyKCJkYl9qc19maWxlIik7anNGaWxlID0ganNGaWxlID09PSAnJyA/ICJoaWtlcjovL2ZpbGVzL3J1bGVzL2pzL3J0LWRvdWJhbi5qcyIgOiBqc0ZpbGU7ZXZhbChmZXRjaChqc0ZpbGUse30pKTtkb3ViYW4ucmV2aWV3RGV0YWlsVmlldygpO2AsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICByZXMuZGF0YSA9IGQ7CiAgICAgICAgc2V0SG9tZVJlc3VsdChyZXMpOwogICAgfSwKICAgIC8qKgogICAgICog566A5rSBL+efreivhOaooeWdlwogICAgICovCiAgICBzaG9ydFZpZXc6IGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgcmVzID0ge307CiAgICAgICAgdmFyIGQgPSBbXTsKICAgICAgICB2YXIgY29tbWVudHMgPSBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiYjY29tbWVudHMmJkh0bWwnKTsKICAgICAgICB2YXIgYXZhdGFyX2xpc3QgPSBjb21tZW50cy5tYXRjaCgvPGRpdiBjbGFzcz1cImF2YXRhcltcc1xTXSo/PFwvZGl2Pi9nKTsKICAgICAgICB2YXIgY29tbWVudF9saXN0ID0gY29tbWVudHMubWF0Y2goLzxkaXYgY2xhc3M9XCJjb21tZW50XCJbXHNcU10qPzxcL2Rpdj4vZyk7CiAgICAgICAgZm9yICh2YXIgaSBpbiBhdmF0YXJfbGlzdCkgewogICAgICAgICAgICBpZiAoY29tbWVudF9saXN0W2ldLmluZGV4T2YoImFsbHN0YXI1MCIpICE9IC0xKSB7CiAgICAgICAgICAgICAgICB2YXIgYXZhdGFyX3RpdGxlID0gJyAg4piF4piF4piF4piF4piFJzsKICAgICAgICAgICAgICAgIHZhciBjb21tZW50X3RpdGxlID0gJyAg5Yqb6I2QJzsKICAgICAgICAgICAgfSBlbHNlIGlmIChjb21tZW50X2xpc3RbaV0uaW5kZXhPZigiYWxsc3RhcjQwIikgIT0gLTEpIHsKICAgICAgICAgICAgICAgIHZhciBhdmF0YXJfdGl0bGUgPSAnICDimIXimIXimIXimIXimIYnOwogICAgICAgICAgICAgICAgdmFyIGNvbW1lbnRfdGl0bGUgPSAnICDmjqjojZAnOwogICAgICAgICAgICB9IGVsc2UgaWYgKGNvbW1lbnRfbGlzdFtpXS5pbmRleE9mKCJhbGxzdGFyMzAiKSAhPSAtMSkgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYheKYheKYheKYhuKYhic7CiAgICAgICAgICAgICAgICB2YXIgY29tbWVudF90aXRsZSA9ICcgIOi/mOihjCc7CiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29tbWVudF9saXN0W2ldLmluZGV4T2YoImFsbHN0YXIyMCIpICE9IC0xKSB7CiAgICAgICAgICAgICAgICB2YXIgYXZhdGFyX3RpdGxlID0gJyAg4piF4piF4piG4piG4piGJzsKICAgICAgICAgICAgICAgIHZhciBjb21tZW50X3RpdGxlID0gJyAg6L6D5beuJzsKICAgICAgICAgICAgfSBlbHNlIGlmIChjb21tZW50X2xpc3RbaV0uaW5kZXhPZigiYWxsc3RhcjE3IikgIT0gLTEpIHsKICAgICAgICAgICAgICAgIHZhciBhdmF0YXJfdGl0bGUgPSAnICDimIXimIbimIbimIbimIYnOwogICAgICAgICAgICAgICAgdmFyIGNvbW1lbnRfdGl0bGUgPSAnICDlvojlt64nOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYhuKYhuKYhuKYhuKYhic7CiAgICAgICAgICAgICAgICB2YXIgY29tbWVudF90aXRsZSA9ICcgICc7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwoYXZhdGFyX2xpc3RbaV0sICdhJiZ0aXRsZScpICsgJyDCtyAnICsgcGFyc2VEb21Gb3JIdG1sKGNvbW1lbnRfbGlzdFtpXSwgJy5jb21tZW50LWluZm8mJlRleHQnKS5zcGxpdCgiICIpWzFdLAogICAgICAgICAgICAgICAgcGljX3VybDogcGFyc2VEb21Gb3JIdG1sKGF2YXRhcl9saXN0W2ldLCAnaW1nJiZzcmMnKSwKICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb21Gb3JIdG1sKGF2YXRhcl9saXN0W2ldLCAnYSYmaHJlZicpLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChjb21tZW50X2xpc3RbaV0sICcuc2hvcnQmJlRleHQnKSwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0JwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGRlc2M6IGF2YXRhcl90aXRsZSArIGNvbW1lbnRfdGl0bGUsCiAgICAgICAgICAgICAgICBwaWNfdXJsOiAnaHR0cHM6Ly9zMS5heDF4LmNvbS8yMDIwLzExLzA1L0IyT2NrVC5wbmcnLAogICAgICAgICAgICAgICAgdXJsOiAndG9hc3Q6Ly/ov5nph4zku4DkuYjpg73msqHmnIknLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJwogICAgICAgICAgICB9KTsKICAgICAgICB9CiAgICAgICAgcmVzLmRhdGEgPSBkOwogICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTsKICAgIH0sCiAgICAvKioKICAgICAqIOeugOa0gS/lhbvogIHmqKHlvI8KICAgICAqLwogICAgc2ltcGxlRGV0YWlsVmlldzogZnVuY3Rpb24gKCkgewogICAgICAgIHZhciByZXMgPSB7fTsKICAgICAgICB2YXIgZCA9IFtdOwogICAgICAgIGlmIChnZXRVcmwoKS5pbmRleE9mKCJib29rLmRvdWJhbi5jb20iKSAhPSAtMSkgewogICAgICAgICAgICB2YXIgYm9va19waG90byA9IHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJmltZ1tyZWw9InY6cGhvdG8iXSYmc3JjJyk7CiAgICAgICAgICAgIHZhciBib29rX25hbWUgPSBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiZpbWdbcmVsPSJ2OnBob3RvIl0mJmFsdCcpLnJlcGxhY2UoZ2V0VXJsKCkgKyAiLyIsICIiKTsKICAgICAgICAgICAgdmFyIGJvb2tfcHJvZHVjZXIgPSBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiYjaW5mbyYmVGV4dCcpLnJlcGxhY2UoZ2V0VXJsKCkgKyAiLyIsICIiKS5yZXBsYWNlKCLlh7rniYjnpL4iLCAiXG7lh7rniYjnpL4iKS5yZXBsYWNlKCLlia/moIfpopgiLCAiXG7lia/moIfpopgiKTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiBib29rX25hbWUsCiAgICAgICAgICAgICAgICBkZXNjOiBib29rX3Byb2R1Y2VyLAogICAgICAgICAgICAgICAgcGljX3VybDogYm9va19waG90bywKICAgICAgICAgICAgICAgIHVybDogZ2V0VXJsKCksCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgdmFyIGJvb2tfaWQgPSBnZXRVcmwoKS5zcGxpdCgic3ViamVjdFwvIilbMV0uc3BsaXQoIlwvIilbMF07CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+afpeeci+efreivhCcsCiAgICAgICAgICAgICAgICBwaWNfdXJsOiAnaHR0cHM6Ly9zMS5heDF4LmNvbS8yMDIwLzExLzA0L0JjRERFRC5wbmcnLAogICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9ib29rLmRvdWJhbi5jb20vc3ViamVjdC8nICsgYm9va19pZCArICcvY29tbWVudHM/c3RhcnQ9ZnlwYWdlQC0xQCoyMEAmbGltaXQ9MjAmc29ydD1uZXdfc2NvcmUmc3RhdHVzPVAmcGVyY2VudF90eXBlPScgKyAnQHJ1bGU9anM6JyArIGBsZXQganNGaWxlID0gZ2V0VmFyKCJkYl9qc19maWxlIik7anNGaWxlID0ganNGaWxlID09PSAnJyA/ICJoaWtlcjovL2ZpbGVzL3J1bGVzL2pzL3J0LWRvdWJhbi5qcyIgOiBqc0ZpbGU7ZXZhbChmZXRjaChqc0ZpbGUse30pKTtkb3ViYW4uc2hvcnRWaWV3KCk7YCwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF80JwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiAn5p+l55yL5Lmm6K+EJywKICAgICAgICAgICAgICAgIHBpY191cmw6ICdodHRwczovL3MxLmF4MXguY29tLzIwMjAvMTEvMDQvQmNEclVlLnBuZycsCiAgICAgICAgICAgICAgICB1cmw6ICdodHRwczovL2Jvb2suZG91YmFuLmNvbS9zdWJqZWN0LycgKyBib29rX2lkICsgJy9yZXZpZXdzP3N0YXJ0PWZ5cGFnZUAtMUAqMjBAJmxpbWl0PTIwJyArICdAcnVsZT1qczonICsgYGxldCBqc0ZpbGUgPSBnZXRWYXIoImRiX2pzX2ZpbGUiKTtqc0ZpbGUgPSBqc0ZpbGUgPT09ICcnID8gImhpa2VyOi8vZmlsZXMvcnVsZXMvanMvcnQtZG91YmFuLmpzIiA6IGpzRmlsZTtldmFsKGZldGNoKGpzRmlsZSx7fSkpO2RvdWJhbi5sb25nVmlldygpO2AsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfNCcKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+WOn+aWh+aRmOW9lScsCiAgICAgICAgICAgICAgICBwaWNfdXJsOiAnaHR0cHM6Ly9zMS5heDF4LmNvbS8yMDIwLzExLzA2L0JXZ0hNRC5wbmcnLAogICAgICAgICAgICAgICAgdXJsOiAnaHR0cHM6Ly9ib29rLmRvdWJhbi5jb20vc3ViamVjdC8nICsgYm9va19pZCArICcvYmxvY2txdW90ZXM/c29ydD1zY29yZSZzdGFydD1meXBhZ2VALTFAKjIwQD8nICsgJ0BydWxlPWpzOicgKyBgbGV0IGpzRmlsZSA9IGdldFZhcigiZGJfanNfZmlsZSIpO2pzRmlsZSA9IGpzRmlsZSA9PT0gJycgPyAiaG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F4piF4piFICDkupTmmJ8gIikucmVwbGFjZSgiNOaYnyIsICLimIXimIXimIXimIXimIYgIOWbm+aYnyAiKS5yZXBsYWNlKCIz5pifIiwgIuKYheKYheKYheKYhuKYhiAg5LiJ5pifICIpLnJlcGxhY2UoIjLmmJ8iLCAi4piF4piF4piG4piG4piGICDkuozmmJ8gIikucmVwbGFjZSgiMeaYnyIsICLimIXimIbimIbimIbimIYgIOS4gOaYnyAiKTsKICAgICAgICAgICAgdmFyIHZpZGVvX3Njb3JlX251bSA9IHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJnN0cm9uZ1twcm9wZXJ0eT0idjphdmVyYWdlIl0mJlRleHQnKS5yZXBsYWNlKGdldFVybCgpICsgIi8iLCAiIikuc3BsaXQoIi8iKTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogdmlkZW9fc2NvcmUuc3BsaXQoIuivhOS7tyIpWzBdLnJlcGxhY2UoIiAiLCAiOiIpICsgJ+ivhOS7tycsCiAgICAgICAgICAgICAgICB1cmw6ICd0b2FzdDovL+i/memHjOaYr+agh+mimCcsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6ICfimIXimIXimIXimIXimIUnICsgdmlkZW9fc2NvcmUuc3BsaXQoIuKYheKYheKYheKYheKYhSIpWzFdLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsb25nX3RleHQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB2YXIgYm9va19icmllZiA9IHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJkh0bWwnKS5tYXRjaCgvPGRpdiBjbGFzcz1cImludHJvW1xzXFNdKj88XC9kaXY+L2cpOwogICAgICAgICAgICB2YXIgYm9va19icmllZl9saXN0ID0gW107CiAgICAgICAgICAgIHZhciB2ID0gMDsKICAgICAgICAgICAgZm9yICh2YXIgaSBpbiBib29rX2JyaWVmKSB7CiAgICAgICAgICAgICAgICBpZiAoYm9va19icmllZltpXS5pbmRleE9mKCJcKOWxleW8gOWFqOmDqFwpIikgPT0gLTEpIHsKICAgICAgICAgICAgICAgICAgICBib29rX2JyaWVmX2xpc3QucHVzaChib29rX2JyaWVmW2ldKTsKICAgICAgICAgICAgICAgICAgICB2ID0gdiArIDE7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+WGheWuueeugOS7iycsCiAgICAgICAgICAgICAgICB1cmw6ICd0b2FzdDovL+i/memHjOaYr+agh+mimCcsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IGJvb2tfYnJpZWZfbGlzdFswXSwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0JwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+S9nOiAheeugOS7iycsCiAgICAgICAgICAgICAgICB1cmw6ICd0b2FzdDovL+i/memHjOaYr+agh+mimCcsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IGJvb2tfYnJpZWZfbGlzdFsxXSwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0JwogICAgICAgICAgICB9KTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICB2YXIgdmlkZW9faWQgPSBwYXJzZURvbShnZXRSZXNDb2RlKCksICdoZWFkJiZtZXRhW25hbWU9Im1vYmlsZS1hZ2VudCJdJiZjb250ZW50Jykuc3BsaXQoInN1YmplY3RcLyIpWzFdLnNwbGl0KCJcLyIpWzBdOwogICAgICAgICAgICB2YXIgdmlkZW9fbmFtZSA9IGdldFVybCgpLnNwbGl0KCcjJylbMV07CiAgICAgICAgICAgIHZhciB2aWRlb19vcmlnaW5hbF9uYW1lID0gcGFyc2VEb20oZ2V0UmVzQ29kZSgpLCAnYm9keSYmc3Bhbltwcm9wZXJ0eT0idjppdGVtcmV2aWV3ZWQiXSYmVGV4dCcpLnJlcGxhY2UoZ2V0VXJsKCkgKyAiLyIsICIiKTsKICAgICAgICAgICAgaWYgKHZpZGVvX25hbWUgPT0gJycgfHwgdmlkZW9fbmFtZSA9PSB1bmRlZmluZWQpIHsKICAgICAgICAgICAgICAgIHZhciB2aWRlb19uYW1lID0gdmlkZW9fb3JpZ2luYWxfbmFtZTsKICAgICAgICAgICAgfQogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdmFyIHZpZGVvX3RpbWUgPSBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiZzcGFuW3Byb3BlcnR5PSJ2OmluaXRpYWxSZWxlYXNlRGF0ZSJdJiZjb250ZW50JykucmVwbGFjZShnZXRVcmwoKSArICIvIiwgIiIpOwogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKHZpZGVvX3RpbWUgPT0gdW5kZWZpbmVkKSB7CiAgICAgICAgICAgICAgICB2YXIgdmlkZW9fdGltZSA9ICfmmoLml6AnOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICB2YXIgdmlkZW9fbnVtID0gJ+mbhuaVsDonICsgcGFyc2VEb21Gb3JIdG1sKGdldFJlc0NvZGUoKSwgJyNpbmZvJiZUZXh0Jykuc3BsaXQoJ+mbhuaVsDogJylbMV0uc3BsaXQoJyAnKVswXSArICdcdFx0JzsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB9CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICB2YXIgdmlkZW9fZHVyID0gJ+eJh+mVvzonICsgcGFyc2VEb21Gb3JIdG1sKGdldFJlc0NvZGUoKSwgJyNpbmZvJiZUZXh0Jykuc3BsaXQoJ+eJh+mVvzogJylbMV0uc3BsaXQoJ+WIhumSnycpWzBdLnNwbGl0KCcgJylbMF0gKyAn5YiG6ZKfJzsKICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICB9CiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICB2YXIgdmlkZW9fYnJpZWYgPSBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiYjbGluay1yZXBvcnQmJlRleHQnKS5yZXBsYWNlKGdldFVybCgpICsgIi8iLCAiIikucmVwbGFjZSgvwqnosYbnk6MvZywgIiIpOwogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgdmFyIHZpZGVvX3Byb2R1Y2VyID0gcGFyc2VEb20oZ2V0UmVzQ29kZSgpLCAnYm9keSYmI2luZm8mJlRleHQnKS5yZXBsYWNlKGdldFVybCgpICsgIi8iLCAiIikucmVwbGFjZSgi57yW5YmnIiwgIlxu57yW5YmnIikucmVwbGFjZSgi5Li75ryUIiwgIlxu5Li75ryUIik7CiAgICAgICAgICAgIHZhciB2aWRlb19zY29yZV9udW0gPSBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiYubG5rLXNoYXJpbmcmJmRhdGEtZGVzYycpLnJlcGxhY2UoZ2V0VXJsKCkgKyAiLyIsICIiKS5zcGxpdCgiLyIpOwogICAgICAgICAgICB2YXIgdmlkZW9fcGljID0gcGFyc2VEb20oZ2V0UmVzQ29kZSgpLCAnYm9keSYmaW1nW3JlbD0idjppbWFnZSJdJiZzcmMnKTsKICAgICAgICAgICAgdmFyIHBpY3MgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJi5yZWxhdGVkLXBpYy1iZCYmSHRtbCcpICsgJzwvYm9keT4nOwogICAgICAgICAgICB2YXIgcGljc19saXN0ID0gcGFyc2VEb21Gb3JBcnJheShwaWNzLCAnYm9keSYmbGknKTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiAodmlkZW9fbmFtZSArICJcbiIgKyB2aWRlb19udW0gKyB2aWRlb19kdXIpLnJlcGxhY2UoL3VuZGVmaW5lZC9nLCAnJyksCiAgICAgICAgICAgICAgICBkZXNjOiB2aWRlb19wcm9kdWNlciwKICAgICAgICAgICAgICAgIHBpY191cmw6IHZpZGVvX3BpYywKICAgICAgICAgICAgICAgIHVybDogZ2V0VXJsKCksCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgdmFyIHZpZGVvX25hbWUgPSB2aWRlb19uYW1lLnJlcGxhY2UoL1sgXeesrFtcc1xTXSo/5a2jL2csICcnKTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiAn5b2x54mH55+t6K+EJywKICAgICAgICAgICAgICAgIHBpY191cmw6ICdodHRwczovL3MxLmF4MXguY29tLzIwMjAvMTEvMDkvQlQ2V0llLnBuZycsCiAgICAgICAgICAgICAgICB1cmw6ICdodHRwczovL21vdmllLmRvdWJhbi5j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PSBkO3NldEhvbWVSZXN1bHQocmVzKTtgLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6ICfmvJTogYzlkZjor6bmg4UnLAogICAgICAgICAgICAgICAgcGljX3VybDogJ2h0dHBzOi8vczMuYXgxeC5jb20vMjAyMC8xMS8yMy9ER3hGQ3EucG5nJywKICAgICAgICAgICAgICAgIHVybDogJ2h0dHBzOi8vbW92aWUuZG91YmFuLmNvbS9zdWJqZWN0LycgKyB2aWRlb19pZCArICcvY2VsZWJyaXRpZXMnICsgJ0BydWxlPWpzOicgKyBgbGV0IGpzRmlsZSA9IGdldFZhcigiZGJfanNfZmlsZSIpO2pzRmlsZSA9IGpzRmlsZSA9PT0gJycgPyAiaGlrZXI6Ly9maWxlcy9ydWxlcy9qcy9ydC1kb3ViYW4uanMiIDoganNGaWxlO2V2YWwoZmV0Y2goanNGaWxlLHt9KSk7ZG91YmFuLndvcmtlclZpZXcoKTtgLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBsZXQgc2ltcGxlVXN1YWxTZWFyY2hSdWxlID0gc2V0dGluZ3Muc2ltcGxlVXN1YWxTZWFyY2hSdWxlOwogICAgICAgICAgICBzaW1wbGVVc3VhbFNlYXJjaFJ1bGUgPSBzaW1wbGVVc3VhbFNlYXJjaFJ1bGUgPT09IHVuZGVmaW5lZCA/CiAgICAgICAgICAgICAgICAn6auY5riF572RQEBodHRwczovL3MzLmF4MXguY29tLzIwMjAvMTEvMjMvREd4ZElBLnBuZ0BA6auY5riF572RJwogICAgICAgICAgICAgICAgOiBzaW1wbGVVc3VhbFNlYXJjaFJ1bGU7CiAgICAgICAgICAgIGxldCBzaW1wbGVVc3VhbFNlYXJjaFJ1bGVTcGxpdCA9IHNpbXBsZVVzdW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UGljVXJsID0gJ2h0dHBzOi8vczMuYXgxeC5jb20vMjAyMC8xMS8yMy9ER3hkSUEucG5nJzsKICAgICAgICAgICAgfQogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IHNpbXBsZVVzdWFsU2VhcmNoUnVsZVRpdGxlLAogICAgICAgICAgICAgICAgcGljX3VybDogc2ltcGxlVXN1YWxTZWFyY2hSdWxlUGljVXJsLAogICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9zZWFyY2g/cz0nICsgdmlkZW9fbmFtZSArICcmcnVsZT0nICsgc2ltcGxlVXN1YWxTZWFyY2hSdWxlTmFtZSwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9zbWFsbF80JwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiAn6LWE5rqQ572RJywKICAgICAgICAgICAgICAgIHBpY191cmw6ICdodHRwczovL3MzLmF4MXguY29tLzIwMjAvMTEvMjMvREdqcTZVLnBuZycsCiAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL3NlYXJjaD9zPScgKyB2aWRlb19uYW1lICsgJyZydWxlPei1hOa6kOe9kemHh+mbhi54eXEnLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uX3NtYWxsXzQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICAvLyDmkJzntKLlj4LmlbAKICAgICAgICAgICAgbGV0IHNlYXJjaFZhbHVlID0gc2V0dGluZ3Muc2VhcmNoVmFsdWU7CiAgICAgICAgICAgIGxldCBzZWFyY2hVcmwgPSBzZXR0aW5ncy5vcGVuSGlrZXJTZWFyY2ggPT09IDEKICAgICAgICAgICAgICAgID8gKCdoaWtlcjovL3NlYXJjaD9zPScKICAgICAgICAgICAgICAgICAgICArICh2aWRlb19uYW1lID09PSAnJyB8fCB2aWRlb19uYW1lID09PSB1bmRlZmluZWQKICAgICAgICAgICAgICAgICAgICAgICAgPyB2aWRlb19vcmlnaW5hbF9uYW1lCiAgICAgICAgICAgICAgICAgICAgICAgIDogdmlkZW9fbmFtZSkKICAgICAgICAgICAgICAgICAgICArIHNlYXJjaFZhbHVlCiAgICAgICAgICAgICAgICApCiAgICAgICAgICAgICAgICA6ICgnaGlrZXI6Ly9zZWFyY2g/cz0nICsgdmlkZW9fbmFtZSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+WJjeW+gOaQnOe0oicsCiAgICAgICAgICAgICAgICBwaWNfdXJsOiAnaHR0cHM6Ly9zMy5heDF4LmNvbS8yMDIwLzExLzIzL0RHVzBkZS5wbmcnLAogICAgICAgICAgICAgICAgdXJsOiBzZWFyY2hVcmwsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fc21hbGxfNCcKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgdmFyIHVybHMgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJi5icyYmSHRtbCcpICsgJzwvYm9keT4nOwogICAgICAgICAgICAgICAgdmFyIHVybHNfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkodXJscywgJ2JvZHkmJmxpJyk7CiAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIHRpdGxlOiAi5LiK5pig5pe26Ze0OiIgKyB2aWRlb190aW1lLAogICAgICAgICAgICAgICAgICAgIHVybDogJ3RvYXN0Oi8v6L+Z6YeM5piv5qCH6aKYJywKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIGZvciAodmFyIHYgaW4gdX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KVswXS5yZXBsYWNlKC89LywiIikpK2xhenksY29sX3R5cGU6eXVhbi5sZW5ndGggPjE/J3RleHRfMyc6J3RleHRfY2VudGVyXzEnfSl9fX07aWYgKHppcD09JzEnKXtmb3IodmFyIGo9eXVhbi5sZW5ndGgtMTtqPi0xO2otLSl7aWYgKHl1YW5bMF0ucGxheV9saW5rLmluZGV4T2YoJ2l4aWd1YScpIT0tMSl7aXRlbXMucHVzaCh7dGl0bGU6eXVhbi5sZW5ndGggPjE/J+esrCcreXVhbltqXS5lcCsn6ZuGJzon54K55Ye75pKt5pS+Jyx1cmw6ZGVjb2RlVVJJQ29tcG9uZW50KHl1YW5bal0ucGxheV9saW5rLnNwbGl0KCd1cmwnKVsxXS5zcGxpdCgnJTNGJylbMF0ucmVwbGFjZSgvPS8sIiIpKStsYXp5LGNvbF90eXBlOnl1YW4ubGVuZ3RoID4xPyd0ZXh0XzMnOid0ZXh0X2NlbnRlcl8xJ30pfX19fX07c2V0SG9tZVJlc3VsdCh7IGRhdGE6IGl0ZW1zIH0pO2A7CiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybF9pY29uID0gJ2h0dHBzOi8vczEuYXgxeC5jb20vMjAyMC8xMS8wNS9CV2VORlMucG5nJzsKICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybF9zZWFyY2ggPSBwYXJzZURvbUZvckh0bWwodXJsc19saXN0W3ZdLCAnYSYmaHJlZicpOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdXJsc19uYW1lLAogICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiB1cmxfaWNvbiwKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmxfc2VhcmNoLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ljb25fNCcKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICLkuIrmmKDml7bpl7Q6IiArIHZpZGVvX3RpbWUsCiAgICAgICAgICAgICAgICAgICAgdXJsOiAndG9hc3Q6Ly/ov5nph4zmmK/moIfpopgnLAogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+aaguaXoOeJh+a6kO+8jOivt+S9v+eUqOaQnOe0ouWKn+iDveKApicsCiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+ixhueTo+ivhOWIhjonICsgdmlkZW9fc2NvcmVfbnVtWyh2aWRlb19zY29yZV9udW0ubGVuZ3RoIC0gMSldLnNwbGl0KCJcKCIpWzBdLAogICAgICAgICAgICAgICAgdXJsOiAndG9hc3Q6Ly/ov5nph4znnJ/nmoTlj6rmmK/moIfpopgnLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgdmFyIHNjb3JlID0gJzxib2R5PicgKyBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiYucmF0aW5ncy1vbi13ZWlnaHQmJkh0bWwnKSArICc8L2JvZHk+JzsKICAgICAgICAgICAgdmFyIHNjb3JlX2xpc3QgPSBwYXJzZURvbUZvckFycmF5KHNjb3JlLCAnYm9keSYmLml0ZW0nKTsKICAgICAgICAgICAgdmFyIHNjb3JlX2h0bWwgPSAnJzsKICAgICAgICAgICAgZm9yICh2YXIgcyBpbiBzY29yZV9saXN0KSB7CiAgICAgICAgICAgICAgICBpZiAocyA9PSAwKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb3JlX3N0YXIgPSAn4piF4piF4piF4piF4piFJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocyA9PSAxKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb3JlX3N0YXIgPSAn4piF4piF4piF4piF4piGJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocyA9PSAyKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb3JlX3N0YXIgPSAn4piF4piF4piF4piG4piGJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocyA9PSAzKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb3JlX3N0YXIgPSAn4piF4piF4piG4piG4piGJzsKICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocyA9PSA0KSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb3JlX3N0YXIgPSAn4piF4piG4piG4piG4piGJzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHZhciBzY29yZV9udW0gPSBwYXJzZURvbUZvckh0bWwoc2NvcmVfbGlzdFtzXSwgJy5yYXRpbmdfcGVyJiZUZXh0Jykuc3BsaXQoJyUnKVswXTsKICAgICAgICAgICAgICAgIHZhciBzY29yZV90ZXh0XzEgPSAnJzsKICAgICAgICAgICAgICAgIHZhciBzY29yZV90ZXh0XzIgPSAnJzsKICAgICAgICAgICAgICAgIGZvciAodmFyIG4gPSAwOyBuIDwgTWF0aC5jZWlsKHNjb3JlX251bSAvIDE3KTsgbisrKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb3JlX3RleHRfMSA9IHNjb3JlX3RleHRfMSArICfilocnOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgZm9yICh2YXIgbiA9IDA7IG4gPCAxNyAtIChNYXRoLmNlaWwoc2NvcmVfbnVtIC8gMTcpKTsgbisrKSB7CiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb3JlX3RleHRfMiA9IHNjb3JlX3RleHRfMiArICfilocnOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgdmFyIHNjb3JlX2h0bWwgPSBzY29yZV9odG1sICsgJzxmb250IGNvbG9yPSIjN2M3YTdiIj4nICsgc2NvcmVfc3RhciArICc8L2ZvbnQ+Jm5ic3A7PGZvbnQgY29sb3I9IiNmZmFjMmQiPicgKyBzY29yZV90ZXh0XzEgKyAnPC9mb250Pjxmb250IGNvbG9yPSIjZTVlMWU0Ij4nICsgc2NvcmVfdGV4dF8yICsgJzwvZm9udD4mbmJzcDs8Zm9udCBjb2xvcj0iZ3JleSI+Jm5ic3A7JyArIHNjb3JlX251bSArICclPC9mb250Pjxici8+JzsKICAgICAgICAgICAgfQogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IHNjb3JlX2h0bWwuc2xpY2UoMCwgKHNjb3JlX2h0bWwubGVuZ3RoIC0gNSkpLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiAn5Ymn5oOF566A5LuLJywKICAgICAgICAgICAgICAgIHVybDogJ3RvYXN0Oi8vSGVyZSBpcyB0aGUgdGl0bGUhISEnLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiB2aWRlb19icmllZiwKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0JwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogJ+W9seeJh+mihOiniCcsCiAgICAgICAgICAgICAgICB1cmw6ICd0b2FzdDovL+WlveWutuS8me+8jOi/mOaIs+agh+mimCggIO+9peG3hOG9ou+9peG3hSAgKeWXr++8nycsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBmb3IgKHZhciBpIGluIHBpY3NfbGlzdCkgewogICAgICAgICAgICAgICAgaWYgKHBpY3NfbGlzdFtpXS5pbmRleE9mKCJsYWJlbC10cmFpbGVyIikgIT09IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfpooTlkYrniYcnLAogICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBwYXJzZURvbUZvckh0bWwocGljc19saXN0W2ldLCAnYSYmc3R5bGUnKSwKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwYXJzZURvbUZvckh0bWwocGljc19saXN0W2ldLCAnYSYmaHJlZicpICsgYEBsYXp5UnVsZT1ib2R5JiZzb3VyY2UmJnNyY2AsCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzInCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHBpY3NfbGlzdFtpXS5pbmRleE9mKCJsYWJlbC1zaG9ydC12aWRlbyIpICE9PSAtMSkgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn6KeG6aKR6K+E6K66JywKICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogcGFyc2VEb21Gb3JIdG1sKHBpY3NfbGlzdFtpXSwgJ2EmJnN0eWxlJyksCiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb21Gb3JIdG1sKHBpY3NfbGlzdFtpXSwgJ2EmJmhyZWYnKSArIGBAbGF6eVJ1bGU9Ym9keSYmc291cmNlJiZzcmNgLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18yJwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+WJp+eFpycsCiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChwaWNzX2xpc3RbaV0sICdpbWcmJnNyYycpLnJlcGxhY2UoInNxeHMiLCAibCIpLnJlcGxhY2UoImltZzEiLCAiaW1nOSIpLAogICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHBhcnNlRG9tRm9ySHRtbChwaWNzX2xpc3RbaV0sICdpbWcmJnNyYycpLnJlcGxhY2UoInNxeHMiLCAibCIpLnJlcGxhY2UoImltZzEiLCAiaW1nOSIpLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18yJwogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfQogICAgICAgIHJlcy5kYXRhID0gZDsKICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7CiAgICB9LAoKICAgIC8qKgogICAgICog6LGG55Oj6YCJ5Lmm5Y6f5paH5pGY5b2V5qih5Z2XCiAgICAgKi8KICAgIGV4Y2VycHRWaWV3OiBmdW5jdGlvbiAoKSB7CiAgICAgICAgdmFyIHJlcyA9IHt9OwogICAgICAgIHZhciBkID0gW107CiAgICAgICAgdmFyIGNvbnRlbnQgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJi5ibG9ja3F1b3RlLWxpc3QmJkh0bWwnKSArICc8L2JvZHk+JzsKICAgICAgICB2YXIgY29udGVudF9saXN0ID0gcGFyc2VEb21Gb3JBcnJheShjb250ZW50LCAnYm9keSYmbGknKTsKICAgICAgICBmb3IgKHZhciBpIGluIGNvbnRlbnRfbGlzdCkgewogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChjb250ZW50X2xpc3RbaV0sICcuYXV0aG9yLW5hbWUmJlRleHQnKSArICcgICAnICsgcGFyc2VEb21Gb3JIdG1sKGNvbnRlbnRfbGlzdFtpXSwgJ2RhdGV0aW1lJiZUZXh0JyksCiAgICAgICAgICAgICAgICBwaWNfdXJsOiBwYXJzZURvbUZvckh0bWwoY29udGVudF9saXN0W2ldLCAnaW1nJiZzcmMnKSwKICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb21Gb3JIdG1sKGNvbnRlbnRfbGlzdFtpXSwgJy5hdXRob3ItYXZhdGFyJiZocmVmJyksCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGNvbnRlbnRfbGlzdFtpXSwgJ2ZpZ3VyZSYmVGV4dCcpLnNwbGl0KCJcKCDmn6XnnIvljp/mlodcKSIpWzBdLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsb25nX3RleHQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbChjb250ZW50X2xpc3RbaV0sICdmaWdjYXB0aW9uJiZ0aXRsZScpICsgJyAgICcgKyBwYXJzZURvbUZvckh0bWwoY29udGVudF9saXN0W2ldLCAnc3BhbiYmVGV4dCcpLAogICAgICAgICAgICAgICAgcGljX3VybDogJ2h0dHBzOi8vczEuYXgxeC5jb20vMjAyMC8xMS8wNi9CV2dJRzYucG5nJywKICAgICAgICAgICAgICAgIHVybDogJ3RvYXN0Oi8v6L+Z6YeM5LuA5LmI6YO95rKh5pyJJywKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJwogICAgICAgICAgICB9KTsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIHJlcy5kYXRhID0gZDsKICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7CiAgICB9LAogICAgLyoqCiAgICAgKiDosYbnk6PpgInkuabor7vkuabnrJTorrDmqKHlnZcKICAgICAqLwogICAgbm90ZVZpZXc6IGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgcmVzID0ge307CiAgICAgICAgdmFyIGQgPSBbXTsKICAgICAgICB2YXIgY29tbWVudHMgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJi5jb21tZW50cyYmSHRtbCcpICsgJzwvYm9keT4nOwogICAgICAgIHZhciBjb21tZW50c19saXN0ID0gcGFyc2VEb21Gb3JBcnJheShjb21tZW50cywgJ2JvZHkmJmxpJyk7CiAgICAgICAgZm9yICh2YXIgaSBpbiBjb21tZW50c19saXN0KSB7CiAgICAgICAgICAgIGlmIChjb21tZW50c19saXN0W2ldLmluZGV4T2YoImFsbHN0YXI1MCIpICE9IC0xKSB7CiAgICAgICAgICAgICAgICB2YXIgYXZhdGFyX3RpdGxlID0gJyAg4piF4piF4piF4piF4piFJzsKICAgICAgICAgICAgfSBlbHNlIGlmIChjb21tZW50c19saXN0W2ldLmluZGV4T2YoImFsbHN0YXI0MCIpICE9IC0xKSB7CiAgICAgICAgICAgICAgICB2YXIgYXZhdGFyX3RpdGxlID0gJyAg4piF4piF4piF4piF4piGJwogICAgICAgICAgICB9IGVsc2UgaWYgKGNvbW1lbnRzX2xpc3RbaV0uaW5kZXhPZigiYWxsc3RhcjMwIikgIT0gLTEpIHsKICAgICAgICAgICAgICAgIHZhciBhdmF0YXJfdGl0bGUgPSAnICDimIXimIXimIXimIbimIYnOwogICAgICAgICAgICB9IGVsc2UgaWYgKGNvbW1lbnRzX2xpc3RbaV0uaW5kZXhPZigiYWxsc3RhcjIwIikgIT0gLTEpIHsKICAgICAgICAgICAgICAgIHZhciBhdmF0YXJfdGl0bGUgPSAnICDimIXimIXimIbimIbimIYnOwogICAgICAgICAgICB9IGVsc2UgaWYgKGNvbW1lbnRzX2xpc3RbaV0uaW5kZXhPZigiYWxsc3RhcjE3IikgIT0gLTEpIHsKICAgICAgICAgICAgICAgIHZhciBhdmF0YXJfdGl0bGUgPSAnICDimIXimIbimIbimIbimIYnOwogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgdmFyIGF2YXRhcl90aXRsZSA9ICcgIOKYhuKYhuKYhuKYhuKYhic7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHRpdGxlOiBwYXJzZURvbUZvckh0bWwoY29tbWVudHNfbGlzdFtpXSwgJ2ltZyYmYWx0JykgKyBhdmF0YXJfdGl0bGUgKyAnICAgIOWFseaciScgKyBwYXJzZURvbUZvckh0bWwoY29tbWVudHNfbGlzdFtpXSwgJy5jb2wtdGltZSYmVGV4dCcpLAogICAgICAgICAgICAgICAgcGljX3VybDogcGFyc2VEb21Gb3JIdG1sKGNvbW1lbnRzX2xpc3RbaV0sICdpbWcmJnNyYycpLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB2YXIgY29udGVudCA9IHBhcnNlRG9tRm9ySHRtbChjb21tZW50c19saXN0W2ldLCAnLmFsbCYmSHRtbCcpLnJlcGxhY2UoLzxkaXYgY2xhc3M9XCJjb2wtcmVjLWNvbltcc1xTXSo/Wy0wMTIzNDU2Nzg5IDpdezE3fS9nLCAiICIpOwogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IGNvbnRlbnQsCiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcKICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnCiAgICAgICAgICAgIH0pOwogICAgICAgIH0KICAgICAgICByZXMuZGF0YSA9IGQ7CiAgICAgICAgc2V0SG9tZVJlc3VsdChyZXMpOwogICAgfSwKICAgIC8qKgogICAgICog5b2x6K+E6K+m5oOF6KeE5YiZCiAgICAgKi8KICAgIHJldmlld0RldGFpbFZpZXc6IGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgcmVzID0ge307CiAgICAgICAgdmFyIGQgPSBbXTsKICAgICAgICB2YXIgY29sVHlwZSA9ICdyaWNoX3RleHQnOwogICAgICAgIHZhciBodG1sID0gZ2V0UmVzQ29kZSgpOwogICAgICAgIHZhciByZXZpZXdJZCA9ICcnOwogICAgICAgIC9yZXZpZXdcLyhcZCspXC8vLnRlc3QoTVlfVVJMKTsKICAgICAgICByZXZpZXdJZCA9IFJlZ0V4cC4kMTsKICAgICAgICBsZXQgcGFnZSA9IE1ZX1VSTC5zcGxpdCgnIycpWzFdOwoKICAgICAgICBpZiAocGFnZSA9PT0gJzEnKSB7CiAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgKiBoZWFkZXLvvIjlpLTpg6jvvIkKICAgICAgICAgICAgICovCiAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICBsZXQgdmlld1NvdXJjZSA9IGdldFNtYWxsVGV4dChnZXRHcmV5VGV4dChnZXRBZGRyZXNzVGFnKE1ZX1VSTCwgJ1vmn6XnnIvljp/mloddJykpKTsKICAgICAgICAgICAgICAgIGxldCBoZWFkZXJIdG1sID0gcGFyc2VEb21Gb3JIdG1sKGh0bWwsICcjY29udGVudCYmLmFydGljbGUmJkh0bWwnKTsKICAgICAgICAgICAgICAgIGxldCBoZWFkZXJUaXRsZSA9IGdldEJpZ1RleHQoZ2V0VGl0bGVUZXh0KHBhcnNlRG9tRm9ySHRtbChoZWFkZXJIdG1sLCAnaDEmJlRleHQnKSkpOwogICAgICAgICAgICAgICAgaGVhZGVySHRtbCA9IHBhcnNlRG9tRm9ySHRtbChoZWFkZXJIdG1sLCAnLm1haW4taGQmJkh0bWwnKTsKICAgICAgICAgICAgICAgIGxldCBtZXRhID0gJyc7CiAgICAgICAgICAgICAgICBsZXQgYXV0aG9yID0gJyc7CiAgICAgICAgICAgICAgICBpZiAoLyg8YSBocmVmPSJodHRwczpcL1wvd3d3LmRvdWJhbi5jb21bXHNcU10qPzxcL2E+KS8udGVzdChoZWFkZXJIdG1sKSA9PT0gdHJ1ZSkgewogICAgICAgICAgICAgICAgICAgIGF1dGhvciA9IGdldEF1dGhvclRleHQocGFyc2VEb21Gb3JIdG1sKFJlZ0V4cC4kMSwgJ1RleHQnKSkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGxldCBtb3ZpZU5hbWUgPSAnJzsKICAgICAgICAgICAgICAgIGlmICgvKDxhIGhyZWY9Imh0dHBzOlwvXC9tb3ZpZS5kb3ViYW4uY29tW1xzXFNdKj88XC9hPikvLnRlc3QoaGVhZGVySHRtbCkgPT09IHRydWUpIHsKICAgICAgICAgICAgICAgICAgICBtb3ZpZU5hbWUgPSBnZXRDb2xvclRleHQocGFyc2VEb21Gb3JIdG1sKFJlZ0V4cC4kMSwgJ1RleHQnKSwgJyM4OTY1YjQnKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbWV0YSA9IChhdXRob3IgIT09ICcnICYmIG1vdmllTmFtZSAhPT0gJycpID8gKGF1dGhvciArICcgJyArIGdldEdyZXlUZXh0KCfor4TorronKSArICcgJyArIG1vdmllTmFtZSkgOiAnJzsKICAgICAgICAgICAgICAgIGxldCByYXRpbmcgPSAnJzsKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgcmF0aW5nID0gZ2V0UmF0aW5nKHBhcnNlRG9tRm9ySHRtbChoZWFkZXJIdG1sLCAnLm1haW4tdGl0bGUtcmF0aW5nJiZ0aXRsZScpKSArICcgJwogICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbGV0IHRpbWUgPSBnZXRHcmV5VGV4dChwYXJzZURvbUZvckh0bWwoaGVhZGVySHRtbCwgJy5tYWluLW1ldGEmJlRleHQnKSk7CiAgICAgICAgICAgICAgICBtZXRhICs9ICcgJyArIHJhdGluZyArIHRpbWU7CiAgICAgICAgICAgICAgICBtZXRhID0gZ2V0U21hbGxUZXh0KG1ldGEpOwogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICB0aXRsZTogaGVhZGVyVGl0bGUgKyAoc2V0dGluZ3Muc2hvd1NvdXJjZSA9PT0gMSA/ICgnICcgKyB2aWV3U291cmNlKSA6ICcnKSArICc8YnI+JyArIG1ldGEsCiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGNvbFR5cGUKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9IGNhdGNoIChlKSB7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLyoqCiAgICAgICAgICAgICAqIOato+aWhwogICAgICAgICAgICAgKi8KICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgIGxldCBtYWluQ29udGVudERvbVJ1bGUgPSAnI3Jldmlldy0nICsgcmV2aWV3SWQgKyAnLWNvbnRlbnQmJkh0bWwnOwogICAgICAgICAgICAgICAgbGV0IG1haW5Db250ZW50SHRtbCA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCBtYWluQ29udGVudERvbVJ1bGUpOwogICAgICAgICAgICAgICAgbGV0IHRpdGxlVGlwcyA9ICcnOwogICAgICAgICAgICAgICAgdHJ5IHsKICAgICAgICAgICAgICAgICAgICB0aXRsZVRpcHMgPSAnPGJsb2NrcXVvdGU+JyArIHBhcnNlRG9tRm9ySHRtbChtYWluQ29udGVudEh0bWwsICcubWFpbi10aXRsZS10aXAmJkh0bWwnKSArICc8L2Jsb2NrcXVvdGU+JwogICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgewogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgbGV0IG1haW5Db250ZW50ID0gcGFyc2VEb21Gb3JIdG1sKG1haW5Db250ZW50SHRtbCwgJy5yZXZpZXctY29udGVudCYmSHRtbCcpCiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2VXaXRoQ2FsbGJhY2soLzxzcGFuIHN0eWxlPSIuKj8iPihbXHNcU10qPyk8XC9zcGFuPi9nLCAnJywgc3R5bGVTcGFuVG9TdHlsZUZvbnRSZXBsYWNlbWVudCkKICAgICAgICAgICAgICAgICAgICAucmVwbGFjZVdpdGhDYWxsYmFjaygvKDxpbWcgKHNyY3xkYXRhLXNyYyk9IiguKj8pIihbXHNcU10qPyk+KS9nLCAiPGltZyBkYXRhLXY+IiwgaW1nVGFnUmVwbGFjZW1lbnQyKTsKICAgICAgICAgICAgICAgIGxldCBjb3B5cmlnaHQgPSAnJzsKICAgICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgICAgY29weXJpZ2h0ID0gZ2V0U21hbGxUZXh0KGdldEdyZXlUZXh0KHBhcnNlRG9tRm9ySHRtbChtYWluQ29udGVudEh0bWwsICcuY29weXJpZ2h0JiZIdG1sJykpKTsKICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGxldCB1c2VmdWxIdG1sID0gcGFyc2VEb21Gb3JIdG1sKG1haW5Db250ZW50SHRtbCwgJy5tYWluLXBhbmVsLXVzZWZ1bCYmSHRtbCcpOwogICAgICAgICAgICAgICAgbGV0IHVzZWZ1bCA9ICc8YnI+JyArIGdldFNtYWxsVGV4dChnZXRDb2xvclRleHQocGFyc2VEb21Gb3JIdG1sKHVzZWZ1bEh0bWwsICcudXNlZnVsX2NvdW50JiZUZXh0JyksIHNldHRpbmdzLnJhdGluZ0NvbG9yc1swXSkpOwogICAgICAgICAgICAgICAgbGV0IHVzZWxlc3MgPSBnZXRTbWFsbFRleHQoZ2V0R3JleVRleHQoJyDii4UgJykgKyBnZXRDb2xvclRleHQocGFyc2VEb21Gb3JIdG1sKHVzZWZ1bEh0bWwsICcudXNlbGVzc19jb3VudCYmVGV4dCcpLCBzZXR0aW5ncy5yYXRpbmdDb2xvcnNbNF0pKTsKICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlVGlwcyArIG1haW5Db250ZW50ICsgY29weXJpZ2h0ICsgdXNlZnVsICsgdXNlbGVzcywKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZQogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgLyoqCiAgICAgICAgICog5Ymn6K+E6K+E6K66CiAgICAgICAgICovCiAgICAgICAgdHJ5IHsKICAgICAgICAgICAgLyg8ZGl2IGlkPSJjb21tZW50cyIgY2xhc3M9ImNvbW1lbnQtbGlzdCI+W1xzXFNdKj88XC9zY3JpcHQ+KS8udGVzdChodG1sKTsKICAgICAgICAgICAgbGV0IGNvbW1lbnRTY3JpcHRIdG1sID0gcGFyc2VEb21Gb3JIdG1sKFJlZ0V4cC4kMSwgJ3NjcmlwdCYmSHRtbCcpOwogICAgICAgICAgICBldmFsKGNvbW1lbnRTY3JpcHRIdG1sKTsKICAgICAgICAgICAgbGV0IHJldmlld0NvbW1lbnRMaXN0ID0gX0NPTU1FTlRTX0NPTkZJRy5jb21tZW50czsKICAgICAgICAgICAgaWYgKHJldmlld0NvbW1lbnRMaXN0Lmxlbmd0aCA+IDApIHsKICAgICAgICAgICAgICAgIGlmIChwYWdlID09PSAnMScpIHsKICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogc2V0dGluZ3MubGluZV90eXBlX21vZGVsCiAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgLy8gZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAvLyAgICAgdGl0bGU6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCfCtyDCtyDCtyDmn6XnnIvor4TorrogwrcgwrcgwrcnLCAnI2FkOGIyNScpLAogICAgICAgICAgICAgICAgICAgIC8vICAgICB1cmw6IE1ZX1VSTCArICcjY29tbWVudC1saXN0JywKICAgICAgICAgICAgICAgICAgICAvLyAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJwogICAgICAgICAgICAgICAgICAgIC8vIH0pOwogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRCaWdUZXh0KGdldFN0cm9uZ1RleHQoJ+ivhOiuuicpKSArICcgJyArIGdldFNtYWxsVGV4dChnZXRHcmV5VGV4dCgn5LiK5ouJ5Yqg6L296K+E6K66JykpLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZQogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBpZiAocGFnZSA9PT0gJzInKSB7CiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCByZXZpZXdDb21tZW50TGlzdC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmV2aWV3Q29tbWVudEl0ZW0gPSByZXZpZXdDb21tZW50TGlzdFtpXTsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGF2YXRhckltZyA9IHJldmlld0NvbW1lbnRJdGVtLmF1dGhvci5hdmF0YXI7CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhdmF0YXJUaXRsZSA9IHJldmlld0NvbW1lbnRJdGVtLmF1dGhvci5uYW1lOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgYXZhdGFyVXJsID0gcmV2aWV3Q29tbWVudEl0ZW0uYXV0aG9yLnVybDsKICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBhdmF0YXJUaXRsZSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGF2YXRhckltZywKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogYXZhdGFyVXJsLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInCiAgICAgICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29tbWVudENvbnRlbnQgPSByZXZpZXdDb21tZW50SXRlbS50ZXh0OwogICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPIOivhOiuuuWbnuWkjemhtemdogogICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVwbGllc1J1bGUgPSAnQHJ1bGU9anM6ICcgKyBgZXZhbChmZXRjaChnZXRWYXIoJ2hpa2VyLXV0aWxzJykse30pKTtoaWtlclV0aWwubG9hZCgnaG9tZScpO2hpa2VyVXRpbC5kb3ViYW4uZHJhbWFSZXZpZXdSZXBseVZpZXcoYCArIHJldmlld0NvbW1lbnRJdGVtLmlkICsgYCk7YDsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcGxpZXNSdWxlVXJsID0gJ2Jhc2U2NDovLycgKyBiYXNlNjRFbmNvZGUoJ2hpa2VyOi8vZW1wdHknICsgJyNub0hpc3RvcnkjJyArIHJlcGxpZXNSdWxlKTsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlcGxpZXNIdG1sID0gZ2V0U21hbGxUZXh0KGdldEFkZHJlc3NUYWcocmVwbGllc1J1bGVVcmwsICdb5p+l55yL5Zue5aSNXScpKTsKICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBjb21tZW50Q29udGVudCArIChyZXZpZXdDb21tZW50SXRlbS5yZXBsaWVzLmxlbmd0aCA9PT0gMCA/ICcnIDogKCcgJyArIHJlcGxpZXNIdG1sKSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZQogICAgICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZScKICAgICAgICAgICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgaWYgKHBhZ2UgPT09ICcxJykgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzZXR0aW5ncy5saW5lX3R5cGVfbW9kZWwKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgICAgICAvLyBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIC8vICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ8K3IMK3IMK3IOafpeeci+ivhOiuuiDCtyDCtyDCtycsICcjYWQ4YjI1JyksCiAgICAgICAgICAgICAgICAgICAgLy8gICAgIHVybDogTVlfVVJMICsgJyNjb21tZW50LWxpc3QnLAogICAgICAgICAgICAgICAgICAgIC8vICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnCiAgICAgICAgICAgICAgICAgICAgLy8gfSk7CiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldEJpZ1RleHQoZ2V0U3Ryb25nVGV4dCgn6K+E6K66JykpLAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZQogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldEdyZXlUZXh0KCfmmoLml6Dor4TorronKSwKICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGNvbFR5cGUKICAgICAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICB9CgogICAgICAgIHJlcy5kYXRhID0gZDsKICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7CiAgICB9LAogICAgLyoqCiAgICAgKiDnn63or4TliJfooajop4TliJkKICAgICAqLwogICAgY29tbWVudExpc3RWaWV3OiBmdW5jdGlvbiAoKSB7CiAgICAgICAgdmFyIHJlcyA9IHt9OwogICAgICAgIHZhciBkID0gW107CiAgICAgICAgdmFyIGNvbFR5cGUgPSAncmljaF90ZXh0JzsKICAgICAgICBsZXQgbGlzdFNvcnQgPSBnZXRWYXIoJ2RiX2NvbW1lbnRfc29ydCcsICduZXdfc2NvcmUnKTsKICAgICAgICBsZXQgbGlzdFNvcnRQZXJjZW50VHlwZSA9IGdldFZhcignZGJfY29tbWVudF9zb3J0X3BlcmNlbnRfdHlwZScpOwogICAgICAgIHZhciBtVXJsID0gTVlfVVJMLnNwbGl0KCcjJylbMV0gKyAnJnNvcnQ9JyArIGxpc3RTb3J0ICsgJyZwZXJjZW50X3R5cGU9JyArIGxpc3RTb3J0UGVyY2VudFR5cGU7CiAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChtVXJsLCB7CiAgICAgICAgICAgIGhlYWRlcnM6IHsKICAgICAgICAgICAgICAgICdVc2VyLUFnZW50JzogUENfVUEKICAgICAgICAgICAgfQogICAgICAgIH0pOwogICAgICAgIC9zdGFydD0oXGQrKS8udGVzdChNWV9VUkwpOwogICAgICAgIHZhciBwYWdlID0gUmVnRXhwLiQxOwoKICAgICAgICB0cnkgewogICAgICAgICAgICBpZiAocGFnZSA9PT0gJzAnKSB7CiAgICAgICAgICAgICAgICBsZXQgaGVhZGVyVGV4dCA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCAnI2NvbnRlbnQmJmgxJiZUZXh0Jyk7CiAgICAgICAgICAgICAgICBsZXQgY29tbWVudHNDb3VudEFycmF5ID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCAnLkNvbW1lbnRUYWJzJiZsaScpOwogICAgICAgICAgICAgICAgbGV0IGNvbW1lbnRzQ291bnQgPSAnJzsKICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29tbWVudHNDb3VudEFycmF5Lmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgbGV0IGNvdW50VGV4dCA9IHBhcnNlRG9tRm9ySHRtbChjb21tZW50c0NvdW50QXJyYXlbaV0sICdUZXh0Jyk7CiAgICAgICAgICAgICAgICAgICAgaWYgKGkgPCBjb21tZW50c0NvdW50QXJyYXkubGVuZ3RoIC0gMSkgewogICAgICAgICAgICAgICAgICAgICAgICBjb3VudFRleHQgPSBjb3VudFRleHQgKyAnIOKLhSAnOwogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICBjb21tZW50c0NvdW50ICs9IGNvdW50VGV4dDsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGxldCBoZWFkZXJIdG1sID0gZ2V0QmlnVGV4dChnZXRTdHJvbmdUZXh0KGhlYWRlclRleHQpKQogICAgICAgICAgICAgICAgICAgICsgJzxicj4nCiAgICAgICAgICAgICAgICAgICAgKyBnZXRTbWFsbFRleHQoZ2V0R3JleVRleHQoY29tbWVudHNDb3VudCkpOwoKICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGhlYWRlckh0bWwsCiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGNvbFR5cGUKICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAgIGxldCBzb3J0TWFwID0gW3sga2V5OiAn54Ot6ZeoJywgdmFsdWU6ICduZXdfc2NvcmUnIH0sIHsga2V5OiAn5pyA5pawJywgdmFsdWU6ICd0aW1lJyB9XQogICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzb3J0TWFwLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldFZhcignZGJfY29tbWVudF9zb3J0X3RpdGxlJykgPT09IHNvcnRNYXBbaV0ua2V5ID8gIuKAmOKAmCIgKyBzb3J0TWFwW2ldLmtleSArICLigJnigJkiIDogc29ydE1hcFtpXS5rZXksCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLAogICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICAkKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5sYXp5UnVsZShzb3J0ID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2RiX2NvbW1lbnRfc29ydCcsIHNvcnQudmFsdWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignZGJfY29tbWVudF9zb3J0X3RpdGxlJywgc29ydC5rZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5YiH5o2i5YiwJyArIHNvcnQua2V5CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzb3J0TWFwW2ldKSwKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaycKICAgICAgICAgICAgICAgIH0pOwoKICAgICAgICAgICAgICAgIGxldCBmaWx0ZXIgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICcuY29tbWVudC1maWx0ZXImJmxhYmVsJyk7CiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGZpbHRlci5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGxldCBpbnB1dFZhbHVlID0gcGFyc2VEb21Gb3JIdG1sKGZpbHRlcltpXSwgJ2lucHV0JiZ2YWx1ZScpOwogICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0ID0gcGFyc2VEb21Gb3JIdG1sKGZpbHRlcltpXSwgJ3NwYW4mJlRleHQnKTsKICAgICAgICAgICAgICAgICAgICBsZXQgYWxsVGV4dCA9IHBhcnNlRG9tRm9ySHRtbChmaWx0ZXJbaV0sICdUZXh0Jyk7CiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGxpc3RTb3J0UGVyY2VudFR5cGUgPT09IGlucHV0VmFsdWUgPyAgIuKAmOKAmCIgKyBhbGxUZXh0ICsgIuKAmeKAmSIgOiBhbGxUZXh0LAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJywKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAgJCgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGF6eVJ1bGUoKGlucHV0VmFsdWUsIHRleHQpID0+IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2RiX2NvbW1lbnRfc29ydF9wZXJjZW50X3R5cGUnLCBpbnB1dFZhbHVlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WIh+aNouWIsCcgKyB0ZXh0CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dFZhbHVlLCB0ZXh0KSwKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJwogICAgICAgICAgICAgICAgfSk7CiAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZScKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CgogICAgICAgICAgICBsZXQgY29tbWVudHNIdG1sID0gcGFyc2VEb20oaHRtbCwgJ2JvZHkmJiNjb21tZW50cyYmSHRtbCcpOwogICAgICAgICAgICBjb21tZW50c0h0bWwgPSAnPGRpdj4nICsgY29tbWVudHNIdG1sICsgJzwvZGl2PicKICAgICAgICAgICAgbGV0IGNvbW1lbnRJdGVtTGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoY29tbWVudHNIdG1sLCAnZGl2JiZkaXZbY2xhc3NePWNvbW1lbnQtaXRlbV0nKTsKICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb21tZW50SXRlbUxpc3QubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgIC8qZm9yKGxldCBqID0gMDsgaiA8IDc7IGorKykgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIH0qLwogICAgICAgICAgICAgICAgbGV0IGNvbW1lbnRIdG1sSXRlbSA9IGNvbW1lbnRJdGVtTGlzdFtpXTsKICAgICAgICAgICAgICAgIHRoaXMuYWRkQ29tbWVudEl0ZW0oZCwgY29tbWVudEh0bWxJdGVtKTsKICAgICAgICAgICAgICAgIGlmIChpIDwgY29tbWVudEl0ZW1MaXN0Lmxlbmd0aCAtIDEpIHsKICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0gY2F0Y2ggKGUpIHsKICAgICAgICB9CgogICAgICAgIHJlcy5kYXRhID0gZDsKICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7CiAgICB9LAogICAgLyoqCiAgICAgKiDliafor4TliJfooajop4TliJkKICAgICAqLwogICAgcmV2aWV3TGlzdFZpZXc6IGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgcmVzID0ge307CiAgICAgICAgdmFyIGQgPSBbXTsKICAgICAgICB2YXIgY29sVHlwZSA9ICdyaWNoX3RleHQnOwogICAgICAgIGxldCBsaXN0U29ydCA9IGdldFZhcignZGJfcmV2aWV3X3NvcnQnLCAnaG90ZXN0Jyk7CiAgICAgICAgbGV0IGxpc3RTb3J0UmF0aW5nID0gZ2V0VmFyKCdkYl9yZXZpZXdfc29ydF9yYXRpbmcnKTsKICAgICAgICB2YXIgbVVybCA9IE1ZX1VSTC5zcGxpdCgnIycpWzFdICsgJyZzb3J0PScgKyBsaXN0U29ydCArICcmcmF0aW5nPScgKyBsaXN0U29ydFJhdGluZzsKICAgICAgICB2YXIgaHRtbCA9IGZldGNoKG1VcmwsIHsKICAgICAgICAgICAgaGVhZGVyczogewogICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiBQQ19VQQogICAgICAgICAgICB9CiAgICAgICAgfSk7CiAgICAgICAgL3N0YXJ0PShcZCspLy50ZXN0KG1VcmwpOwogICAgICAgIHZhciBwYWdlID0gUmVnRXhwLiQxOwoKICAgICAgICB0cnkgewogICAgICAgICAgICBpZiAocGFnZSA9PT0gJzAnKSB7CiAgICAgICAgICAgICAgICBsZXQgaGVhZGVyVGV4dCA9IHBhcnNlRG9tRm9ySHRtbChodG1sLCAnI2NvbnRlbnQmJmgxJiZUZXh0Jyk7CiAgICAgICAgICAgICAgICBsZXQgaGVhZGVySHRtbCA9IGdldEJpZ1RleHQoZ2V0U3Ryb25nVGV4dChoZWFkZXJUZXh0KSk7CgogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICB0aXRsZTogaGVhZGVySHRtbCwKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogY29sVHlwZQogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICBsZXQgc29ydE1hcCA9IFt7IGtleTogJ+acgOWPl+asoui/jueahCcsIHZhbHVlOiAnaG90ZXN0JyB9LCB7IGtleTogJ+acgOaWsOWPkeW4g+eahCcsIHZhbHVlOiAndGltZScgfV0KICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgc29ydE1hcC5sZW5ndGg7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRWYXIoJ2RiX3Jldmlld19zb3J0X3RpdGxlJywgc29ydE1hcFswXS5rZXkpID09PSBzb3J0TWFwW2ldLmtleSA/ICLigJjigJgiICsgc29ydE1hcFtpXS5rZXkgKyAi4oCZ4oCZIiA6IHNvcnRNYXBbaV0ua2V5LAogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJywKICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAgJCgpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAubGF6eVJ1bGUoc29ydCA9PiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdkYl9yZXZpZXdfc29ydCcsIHNvcnQudmFsdWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignZGJfcmV2aWV3X3NvcnRfdGl0bGUnLCBzb3J0LmtleSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLliLAnICsgc29ydC5rZXkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNvcnRNYXBbaV0pLAogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJwogICAgICAgICAgICAgICAgfSkKCiAgICAgICAgICAgICAgICBsZXQgcmF0aW5nTWFwID0gW3sga2V5OiAn5LqU5pifJywgdmFsdWU6ICc1JyB9LCB7IGtleTogJ+Wbm+aYnycsIHZhbHVlOiAnNCcgfSwgeyBrZXk6ICfkuInmmJ8nLCB2YWx1ZTogJzMnIH0sIHsga2V5OiAn5LqM5pifJywgdmFsdWU6ICcyJyB9LCB7IGtleTogJ+S4gOaYnycsIHZhbHVlOiAnMScgfV0KICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmF0aW5nTWFwLmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldFZhcignZGJfcmV2aWV3X3NvcnRfcmF0aW5nX3RpdGxlJykgPT09IHJhdGluZ01hcFtpXS5rZXkgPyAi4oCY4oCYIiArIHJhdGluZ01hcFtpXS5rZXkgKyAi4oCZ4oCZIiA6IHJhdGluZ01hcFtpXS5rZXksCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nLAogICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICAkKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5sYXp5UnVsZShyYXRpbmcgPT4gewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignZGJfcmV2aWV3X3NvcnRfcmF0aW5nJywgcmF0aW5nLnZhbHVlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2RiX3Jldmlld19zb3J0X3JhdGluZ190aXRsZScsIHJhdGluZy5rZXkpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5YiH5o2i5YiwJyArIHJhdGluZy5rZXkKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHJhdGluZ01hcFtpXSksCiAgICAgICAgICAgICAgICAgICAgfSkKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaycKICAgICAgICAgICAgICAgIH0pCgogICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQoKICAgICAgICAgICAgbGV0IHJldmlld0xpc3RIdG1sID0gcGFyc2VEb20oaHRtbCwgJyNjb250ZW50JiZkaXZbY2xhc3NePXJldmlldy1saXN0XSYmSHRtbCcpOwogICAgICAgICAgICByZXZpZXdMaXN0SHRtbCA9ICc8ZGl2PicgKyByZXZpZXdMaXN0SHRtbCArICc8L2Rpdj4nCiAgICAgICAgICAgIGxldCByZXZpZXdJdGVtTGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkocmV2aWV3TGlzdEh0bWwsICdkaXYmJmRpdlteZGF0YS1jaWRdJyk7CiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmV2aWV3SXRlbUxpc3QubGVuZ3RoOyBpKyspIHsKICAgICAgICAgICAgICAgIC8qZm9yKGxldCBqID0gMDsgaiA8IDE3OyBqKyspIHsKICAgICAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJwogICAgICAgICAgICAgICAgICAgIH0pCiAgICAgICAgICAgICAgICB9Ki8KICAgICAgICAgICAgICAgIGxldCByZXZpZXdIdG1sSXRlbSA9IHJldmlld0l0ZW1MaXN0W2ldOwogICAgICAgICAgICAgICAgdGhpcy5hZGRSZXZpZXdJdGVtKGQsIHJldmlld0h0bWxJdGVtKTsKICAgICAgICAgICAgICAgIGlmIChpIDwgcmV2aWV3SXRlbUxpc3QubGVuZ3RoIC0gMSkgewogICAgICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZScKICAgICAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgfSBjYXRjaCAoZSkgewogICAgIC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UGFnZSgpOyJ0b2FzdDovL+WIh+aNouaIkOWKnyJgCgogICAgICAgIC8qKgogICAgICAgICAqIG1vZHVsZSAwL+W4uOeUqCAxL+inhueVjOaQnOebuOWFsyAyL+ixhueTo+ivhOWIhuebuOWFsyAtMS/lhbbku5bmiJbkuI3luLjnlKgKICAgICAgICAgKiBtb2RlIC0xL+mAmueUqOaYvuekuiAwL+m7mOiupOaooeW8jyAxL+eugOa0geaooeW8jwogICAgICAgICAqLwogICAgICAgIGxldCBzZXR0aW5nc01lc3NhZ2UgPSB7CiAgICAgICAgICAgIG9wZW5TaW1wbGVEZXRhaWxWaWV3OiB7CiAgICAgICAgICAgICAgICBtb2RlOiAtMSwKICAgICAgICAgICAgICAgIG1vZHVsZTogMCwKICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5rSB5qih5byPJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3nirbmgIHvvJonICsgKHNldHRpbmdzLm9wZW5TaW1wbGVEZXRhaWxWaWV3ID09PSAxID8gJ+W8gOWQrycgOiAn5LiN5byA5ZCvJyksICcjZmY4YTAwJykKICAgICAgICAgICAgICAgICAgICArICdcbicKICAgICAgICAgICAgICAgICAgICArICfkuZ/orrjmmK/pq5jnuqfmqKHlvI/vvJ8nLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnTGF6eVN0YXJ0CiAgICAgICAgICAgICAgICAgICAgICAgICsgYGlmKHNldHRpbmdzLm9wZW5TaW1wbGVEZXRhaWxWaWV3PT09MSl7c2V0dGluZ3Mub3BlblNpbXBsZURldGFpbFZpZXc9MH1lbHNle3NldHRpbmdzLm9wZW5TaW1wbGVEZXRhaWxWaWV3PTF9YAogICAgICAgICAgICAgICAgICAgICAgICArIGNvbmZpZ0xhenlFbmQKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAganNGaWxlOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAtMSwKICAgICAgICAgICAgICAgIG1vZHVsZTogMCwKICAgICAgICAgICAgICAgIHRpdGxlOiAn6Ieq5a6a5LmJ6LGG55Oj6KeE5YiZ5o+S5Lu25Zyw5Z2AJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3lj4LmlbDvvJonICsgc2V0dGluZ3MuanNGaWxlLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChzZXR0aW5ncy5qc0ZpbGUsIHNldHRpbmdzTWVzc2FnZS5qc0ZpbGUudGl0bGUpLmlucHV0KChzZXR0aW5ncyk9PnsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlZmF1bHRWYWx1ZSA9ICJoaWtlcjovL2ZpbGVzL3J1bGVzL2pzL3J0LWRvdWJhbi5qcyIKICAgICAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MuanNGaWxlID0gKChpbnB1dCA9PT0gJ+m7mOiupCcgfHwgaW5wdXQgPT09ICcnKSA/IGRlZmF1bHRWYWx1ZSA6IGlucHV0KQogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc2V0dGluZ3Muc2V0dGluZ3NDYWNoZUZpbGUsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzLCBudWxsLDQpKQogICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoImRiX3NldHRpbmdzIiwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MpKQogICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnycKICAgICAgICAgICAgICAgICAgICB9LCBzZXR0aW5ncykKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgb3Blbkhpa2VyU2VhcmNoOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAtMSwKICAgICAgICAgICAgICAgIG1vZHVsZTogMSwKICAgICAgICAgICAgICAgIHRpdGxlOiAn6KeG55WM5pCcJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3nirbmgIHvvJonICsgKHNldHRpbmdzLm9wZW5IaWtlclNlYXJjaCA9PT0gMSA/ICflvIDlkK8nIDogJ+S4jeW8gOWQrycpLCAnI2ZmOGEwMCcpCiAgICAgICAgICAgICAgICAgICAgKyAnXG4nCiAgICAgICAgICAgICAgICAgICAgKyAn5byA5ZCv5ZCO54K55Ye756ys5LiA6aG55Y2z5Y+v5L2/55So77yM6Iul5LiN5byA5ZCv5YiZ54K55Ye75Li65p+l55yL5b2x54mH5L+h5oGvJywKICAgICAgICAgICAgICAgIGNsaWNrOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZ0xhenlTdGFydAogICAgICAgICAgICAgICAgICAgICAgICArIGBpZihzZXR0aW5ncy5vcGVuSGlrZXJTZWFyY2g9PT0xKXtzZXR0aW5ncy5vcGVuSGlrZXJTZWFyY2g9MH1lbHNle3NldHRpbmdzLm9wZW5IaWtlclNlYXJjaD0xfWAKICAgICAgICAgICAgICAgICAgICAgICAgKyBjb25maWdMYXp5RW5kCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIC8qKgogICAgICAgICAgICAgKiDmkJzntKLmqKHlvI8KICAgICAgICAgICAgICoKICAgICAgICAgICAgICogMDogImhpa2VyOi8vc2VhcmNoP3M95rWL6K+V77yM5bCG5Lya5omT5byA5pCc57Si5by556qX77yM6Ieq5Yqo5aGr5YWF5pCc57Si55qE5YWz6ZSu6K+N4oCc5rWL6K+V4oCd77yM55Sx55So5oi36Ieq5bex6YCJ5oup5YiG57uE5ZKM6KeE5YiZ5ZCO5pCc57SiIiwKICAgICAgICAgICAgICogMTogImhpa2VyOi8vc2VhcmNoP3M95rWL6K+VJmdyb3VwPeKRoeW9seaQnO+8jOWwhuS8muaJk+W8gOaQnOe0ouW8ueeql++8jOiHquWKqOWhq+WFheaQnOe0oueahOWFs+mUruivjeKAnOa1i+ivleKAneW5tuS4lOiHquWKqOWIh+aNouWIhue7hOS4uuKAnOKRoeW9seaQnOKAne+8jOeUqOaIt+WPr+WIh+aNouWIhue7hOWSjOinhOWImSIsCiAgICAgICAgICAgICAqIDI6ICJoaWtlcjovL3NlYXJjaD9zPea1i+ivlSZydWxlPea1t+mYlOinhueVjO+8jOWwhuS8muebtOaOpei3s+i9rOaQnOe0oue7k+aenOeVjOmdou+8jOiHquWKqOmAieaLqeagh+mimOS4uuKAnOa1t+mYlOinhueVjOKAneeahOinhOWImei/m+ihjOaQnOe0ou+8jOW5tuS4lOivpeeVjOmdouS4jeWPr+WIh+aNouWIq+eahOinhOWImSIsCiAgICAgICAgICAgICAqIDM6ICJoaWtlcjovL3NlYXJjaD9zPea1i+ivlSZydWxlPea1t+mYlOinhueVjCZzaW1wbGU9ZmFsc2XvvIzlsIbkvJroh6rliqjloavlhYXmkJzntKLnmoTlhbPplK7or43igJzmtYvor5XigJ3vvIzlubbkuJToh6rliqjliIfmjaLliIbnu4TkuLrigJzikaDmjqjojZDigJ3jgIHoh6rliqjpgInkuK3moIfpopjkuLrigJzmtbfpmJTop4bnlYzigJ3nmoTop4TliJnvvIznlKjmiLflj6/liIfmjaLliIbnu4Tlkozop4TliJnvvIzlubboh6rliqjlvIDlp4vmkJzntKIiCiAgICAgICAgICAgICAqLwogICAgICAgICAgICBzZWFyY2hNb2RlOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAtMSwKICAgICAgICAgICAgICAgIG1vZHVsZTogMSwKICAgICAgICAgICAgICAgIHRpdGxlOiAn5pCc57Si5qih5byPJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3lj4LmlbDvvJonICsgc2V0dGluZ3Muc2VhcmNoTW9kZSwgJyNmZjhhMDAnKQogICAgICAgICAgICAgICAgICAgICsgJ1xuJwogICAgICAgICAgICAgICAgICAgICsgJ+WFseaciSAwLzEvMi8zIOWbm+enjeaooeW8j++8jOivpemFjee9ruaPj+i/sOatpOWkhOaYvuekuuS4jeWFqO+8jOivt+WJjeW+gOmihOWkhOeQhuafpeeciyLmkJzntKLmqKHlvI8i55qE5rOo6YeKJywKICAgICAgICAgICAgICAgIGNsaWNrOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZ0xhenlTdGFydAogICAgICAgICAgICAgICAgICAgICAgICArIGBpZihzZXR0aW5ncy5zZWFyY2hNb2RlPT09Myl7c2V0dGluZ3Muc2VhcmNoTW9kZT0wfWVsc2V7c2V0dGluZ3Muc2VhcmNoTW9kZSsrfWAKICAgICAgICAgICAgICAgICAgICAgICAgKyBjb25maWdMYXp5RW5kCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIC8vIOaQnOe0ouWIhue7hAogICAgICAgICAgICBzZWFyY2hHcm91cDogewogICAgICAgICAgICAgICAgbW9kZTogLTEsCiAgICAgICAgICAgICAgICBtb2R1bGU6IDEsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+aQnOe0ouWIhue7hCcsCiAgICAgICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArIGdldENvbG9yVGV4dCgn5b2T5YmN5Y+C5pWw77yaJyArIHNldHRpbmdzLnNlYXJjaEdyb3VwLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChzZXR0aW5ncy5zZWFyY2hHcm91cCwgc2V0dGluZ3NNZXNzYWdlLnNlYXJjaEdyb3VwLnRpdGxlKS5pbnB1dCgoc2V0dGluZ3MpPT57CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZWZhdWx0VmFsdWUgPSAiIgogICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5zZWFyY2hHcm91cCA9ICgoaW5wdXQgPT09ICfpu5jorqQnKSA/IGRlZmF1bHRWYWx1ZSA6IGlucHV0KQogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc2V0dGluZ3Muc2V0dGluZ3NDYWNoZUZpbGUsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzLCBudWxsLDQpKQogICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoImRiX3NldHRpbmdzIiwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MpKQogICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnycKICAgICAgICAgICAgICAgICAgICB9LCBzZXR0aW5ncykKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgLy8g5pCc57Si6KeE5YiZCiAgICAgICAgICAgIHNlYXJjaFJ1bGU6IHsKICAgICAgICAgICAgICAgIG1vZGU6IC0xLAogICAgICAgICAgICAgICAgbW9kdWxlOiAxLAogICAgICAgICAgICAgICAgdGl0bGU6ICfmkJzntKLlvJXmk47nmoTop4TliJnlkI0nLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ+W9k+WJjeWPguaVsO+8micgKyBzZXR0aW5ncy5zZWFyY2hSdWxlLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChzZXR0aW5ncy5zZWFyY2hSdWxlLCBzZXR0aW5nc01lc3NhZ2Uuc2VhcmNoUnVsZS50aXRsZSkuaW5wdXQoKHNldHRpbmdzKT0+ewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdFZhbHVlID0gIiIKICAgICAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3Muc2VhcmNoUnVsZSA9ICgoaW5wdXQgPT09ICfpu5jorqQnKSA/IGRlZmF1bHRWYWx1ZSA6IGlucHV0KQogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc2V0dGluZ3Muc2V0dGluZ3NDYWNoZUZpbGUsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzLCBudWxsLDQpKQogICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoImRiX3NldHRpbmdzIiwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MpKQogICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnycKICAgICAgICAgICAgICAgICAgICB9LCBzZXR0aW5ncykKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgcmF0aW5nVHlwZTogewogICAgICAgICAgICAgICAgbW9kZTogMCwKICAgICAgICAgICAgICAgIG1vZHVsZTogMiwKICAgICAgICAgICAgICAgIHRpdGxlOiAn55+t6K+EL+WJp+ivhOivhOWIhuaYvuekuuexu+WeiycsCiAgICAgICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArIGdldENvbG9yVGV4dCgn5b2T5YmN54q25oCB77yaJyArIChzZXR0aW5ncy5yYXRpbmdUeXBlID09PSAxID8gJ+aWh+WtlycgOiAn5pif5pifJyksICcjZmY4YTAwJykKICAgICAgICAgICAgICAgICAgICArICdcbicKICAgICAgICAgICAgICAgICAgICArICfmmJ/mmJ/imIXimIYv5paH5a2XJywKICAgICAgICAgICAgICAgIGNsaWNrOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZ0xhenlTdGFydAogICAgICAgICAgICAgICAgICAgICAgICArIGBpZihzZXR0aW5ncy5yYXRpbmdUeXBlPT09MSl7c2V0dGluZ3MucmF0aW5nVHlwZT0wfWVsc2V7c2V0dGluZ3MucmF0aW5nVHlwZT0xfWAKICAgICAgICAgICAgICAgICAgICAgICAgKyBjb25maWdMYXp5RW5kCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIC8vIOixhueTo+ivhOWIhuaWh+acrOaYvuekuuaooeW8j++8jDAv57qv5paH5pysIDEv6L+b5bqm5p2hCiAgICAgICAgICAgIHJhdGluZ1RleHRNb2RlOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAyLAogICAgICAgICAgICAgICAgdGl0bGU6ICfosYbnk6Por4TliIbmlofmnKzmmL7npLrmqKHlvI8nLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ+W9k+WJjeeKtuaAge+8micgKyAoc2V0dGluZ3MucmF0aW5nVGV4dE1vZGUgPT09IDAgPyAnMC/nuq/mlofmnKwnIDogJzEv6L+b5bqm5p2hJyksICcjZmY4YTAwJykKICAgICAgICAgICAgICAgICAgICArICdcbicKICAgICAgICAgICAgICAgICAgICArICcwL+e6r+aWh+acrCAxL+i/m+W6puadoScsCiAgICAgICAgICAgICAgICBjbGljazogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25maWdMYXp5U3RhcnQKICAgICAgICAgICAgICAgICAgICAgICAgKyBgaWYoc2V0dGluZ3MucmF0aW5nVGV4dE1vZGU9PT0wKXtzZXR0aW5ncy5yYXRpbmdUZXh0TW9kZT0xfWVsc2V7c2V0dGluZ3MucmF0aW5nVGV4dE1vZGU9MH1gCiAgICAgICAgICAgICAgICAgICAgICAgICsgY29uZmlnTGF6eUVuZAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICBibG9ja1N1bTogewogICAgICAgICAgICAgICAgbW9kZTogMCwKICAgICAgICAgICAgICAgIG1vZHVsZTogMiwKICAgICAgICAgICAgICAgIHRpdGxlOiAn6LGG55Oj6K+E5YiG6L+b5bqm5p2h5qC85a2Q5oC75pWwJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3lj4LmlbDvvJonICsgKHNldHRpbmdzLmJsb2NrU3VtID09PSB1bmRlZmluZWQgPyAxNyA6IHNldHRpbmdzLmJsb2NrU3VtKSwgJyNmZjhhMDAnKSwKICAgICAgICAgICAgICAgIGNsaWNrOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgLy8gc2V0RXJyb3IgKEpTT04uc3RyaW5naWZ5KHJlcGxhY2VJdGVtKSkKICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBzZXR0aW5ncy5ibG9ja1N1bSA9PT0gdW5kZWZpbmVkID8gMTcgOiBzZXR0aW5ncy5ibG9ja1N1bQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHZhbHVlLCBzZXR0aW5nc01lc3NhZ2UuYmxvY2tTdW0udGl0bGUpLmlucHV0KChzZXR0aW5ncyk9PnsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlZmF1bHRWYWx1ZSA9IDE3CiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmJsb2NrU3VtID0gKChpbnB1dCA9PT0gJ+m7mOiupCcpID8gZGVmYXVsdFZhbHVlIDogcGFyc2VGbG9hdChpbnB1dCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShzZXR0aW5ncy5zZXR0aW5nc0NhY2hlRmlsZSwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MsIG51bGwsNCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcigiZGJfc2V0dGluZ3MiLCBKU09OLnN0cmluZ2lmeShzZXR0aW5ncykpCiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJwogICAgICAgICAgICAgICAgICAgIH0sIHNldHRpbmdzKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICBwZXJfYmxvY2tfbWFwcGluZzogewogICAgICAgICAgICAgICAgbW9kZTogMCwKICAgICAgICAgICAgICAgIG1vZHVsZTogMiwKICAgICAgICAgICAgICAgIHRpdGxlOiAn6LGG55Oj6K+E5YiG6L+b5bqm5p2h5q+P5qC85Luj6KGo55qE55m+5YiG5q+UJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3lj4LmlbDvvJonICsgKHNldHRpbmdzLnBlcl9ibG9ja19tYXBwaW5nID09PSB1bmRlZmluZWQgPyA1LjUgOiBzZXR0aW5ncy5wZXJfYmxvY2tfbWFwcGluZyksICcjZmY4YTAwJyksCiAgICAgICAgICAgICAgICBjbGljazogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9IHNldHRpbmdzLnBlcl9ibG9ja19tYXBwaW5nID09PSB1bmRlZmluZWQgPyA1LjUgOiBzZXR0aW5ncy5wZXJfYmxvY2tfbWFwcGluZwogICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHZhbHVlLCBzZXR0aW5nc01lc3NhZ2UucGVyX2Jsb2NrX21hcHBpbmcudGl0bGUpLmlucHV0KChzZXR0aW5ncyk9PnsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlZmF1bHRWYWx1ZSA9IDUuNQogICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5wZXJfYmxvY2tfbWFwcGluZyA9ICgoaW5wdXQgPT09ICfpu5jorqQnKSA/IGRlZmF1bHRWYWx1ZSA6IHBhcnNlRmxvYXQoaW5wdXQpKQogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc2V0dGluZ3Muc2V0dGluZ3NDYWNoZUZpbGUsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzLCBudWxsLDQpKQogICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoImRiX3NldHRpbmdzIiwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MpKQogICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnycKICAgICAgICAgICAgICAgICAgICB9LCBzZXR0aW5ncykKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgcHJvZ3Jlc3NCbG9ja1RleHQ6IHsKICAgICAgICAgICAgICAgIG1vZGU6IDAsCiAgICAgICAgICAgICAgICBtb2R1bGU6IDIsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+ixhueTo+ivhOWIhui/m+W6puadoei/m+W6puagvOWtkOaWh+acrCcsCiAgICAgICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArIGdldENvbG9yVGV4dCgn5b2T5YmN5Y+C5pWw77yaJyArIChzZXR0aW5ncy5wcm9ncmVzc0Jsb2NrVGV4dCA9PT0gdW5kZWZpbmVkID8gJ+KWkycgOiBzZXR0aW5ncy5wcm9ncmVzc0Jsb2NrVGV4dCksICcjZmY4YTAwJyksCiAgICAgICAgICAgICAgICBjbGljazogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9IHNldHRpbmdzLnByb2dyZXNzQmxvY2tUZXh0ID09PSB1bmRlZmluZWQgPyAn4paTJyA6IHNldHRpbmdzLnByb2dyZXNzQmxvY2tUZXh0CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQodmFsdWUsIHNldHRpbmdzTWVzc2FnZS5wcm9ncmVzc0Jsb2NrVGV4dC50aXRsZSkuaW5wdXQoKHNldHRpbmdzKT0+ewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdFZhbHVlID0gIuKWkyIKICAgICAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MucHJvZ3Jlc3NCbG9ja1RleHQgPSAoKGlucHV0ID09PSAn6buY6K6kJykgPyBkZWZhdWx0VmFsdWUgOiBpbnB1dCkKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNldHRpbmdzLnNldHRpbmdzQ2FjaGVGaWxlLCBKU09OLnN0cmluZ2lmeShzZXR0aW5ncywgbnVsbCw0KSkKICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCJkYl9zZXR0aW5ncyIsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzKSkKICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nCiAgICAgICAgICAgICAgICAgICAgfSwgc2V0dGluZ3MpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGJsYW5rQmxvY2tUZXh0OiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAyLAogICAgICAgICAgICAgICAgdGl0bGU6ICfosYbnk6Por4TliIbov5vluqbmnaHnqbrnmb3moLzlrZDmlofmnKwnLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ+W9k+WJjeWPguaVsO+8micgKyAoc2V0dGluZ3MuYmxhbmtCbG9ja1RleHQgPT09IHVuZGVmaW5lZCA/ICfilpEnIDogc2V0dGluZ3MuYmxhbmtCbG9ja1RleHQpLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBzZXR0aW5ncy5ibGFua0Jsb2NrVGV4dCA9PT0gdW5kZWZpbmVkID8gJ+KWkScgOiBzZXR0aW5ncy5ibGFua0Jsb2NrVGV4dAogICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHZhbHVlLCBzZXR0aW5nc01lc3NhZ2UuYmxhbmtCbG9ja1RleHQudGl0bGUpLmlucHV0KChzZXR0aW5ncyk9PnsKICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlZmF1bHRWYWx1ZSA9ICLilpEiCiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmJsYW5rQmxvY2tUZXh0ID0gKChpbnB1dCA9PT0gJ+m7mOiupCcpID8gZGVmYXVsdFZhbHVlIDogaW5wdXQpCiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShzZXR0aW5ncy5zZXR0aW5nc0NhY2hlRmlsZSwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MsIG51bGwsNCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcigiZGJfc2V0dGluZ3MiLCBKU09OLnN0cmluZ2lmeShzZXR0aW5ncykpCiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJwogICAgICAgICAgICAgICAgICAgIH0sIHNldHRpbmdzKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICBibGFua0Jsb2NrVGV4dENvbG9yOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAyLAogICAgICAgICAgICAgICAgdGl0bGU6ICf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aW5naWZ5KHNldHRpbmdzLCBudWxsLDQpKQogICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoImRiX3NldHRpbmdzIiwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MpKQogICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnycKICAgICAgICAgICAgICAgICAgICB9LCBzZXR0aW5ncykKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgYWRkSGVhZGVyTW9kdWxlOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAzLAogICAgICAgICAgICAgICAgdGl0bGU6ICfniYfljZXnroDku4vmqKHlnZfmjIHnu63lvIDlkK8nLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHlAbGF6eVJ1bGU9LmpzOicgKyBgInRvYXN0Oi8v6K+l5qih5Z2X5LiN5YWB6K645YiH5o2i54q25oCBIjtgCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGFkZFJhdGluZ01vZHVsZTogewogICAgICAgICAgICAgICAgbW9kZTogMCwKICAgICAgICAgICAgICAgIG1vZHVsZTogMywKICAgICAgICAgICAgICAgIHRpdGxlOiAn6LGG55Oj6K+E5YiG5qih5Z2XJyArIChzZXR0aW5ncy5hZGRSYXRpbmdNb2R1bGUgPT09IDAgPyAn5bey5YWz6ZetJyA6ICflt7LlvIDlkK8nKSwKICAgICAgICAgICAgICAgIGNsaWNrOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZ0xhenlTdGFydAogICAgICAgICAgICAgICAgICAgICAgICArIGBpZihzZXR0aW5ncy5hZGRSYXRpbmdNb2R1bGU9PT0wKXtzZXR0aW5ncy5hZGRSYXRpbmdNb2R1bGU9MX1lbHNle3NldHRpbmdzLmFkZFJhdGluZ01vZHVsZT0wfWAKICAgICAgICAgICAgICAgICAgICAgICAgKyBjb25maWdMYXp5RW5kCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGFkZEludHJvTW9kdWxlOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAzLAogICAgICAgICAgICAgICAgdGl0bGU6ICfliafmg4XnroDku4vmqKHlnZcnICsgKHNldHRpbmdzLmFkZEludHJvTW9kdWxlID09PSAwID8gJ+W3suWFs+mXrScgOiAn5bey5byA5ZCvJyksCiAgICAgICAgICAgICAgICBjbGljazogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25maWdMYXp5U3RhcnQKICAgICAgICAgICAgICAgICAgICAgICAgKyBgaWYoc2V0dGluZ3MuYWRkSW50cm9Nb2R1bGU9PT0wKXtzZXR0aW5ncy5hZGRJbnRyb01vZHVsZT0xfWVsc2V7c2V0dGluZ3MuYWRkSW50cm9Nb2R1bGU9MH1gCiAgICAgICAgICAgICAgICAgICAgICAgICsgY29uZmlnTGF6eUVuZAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICBhZGRUcmFpbGVyUGhvdG9Nb2R1bGU6IHsKICAgICAgICAgICAgICAgIG1vZGU6IDAsCiAgICAgICAgICAgICAgICBtb2R1bGU6IDMsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+mihOWRiueJhy/liafnhafmqKHlnZcnICsgKHNldHRpbmdzLmFkZFRyYWlsZXJQaG90b01vZHVsZSA9PT0gMCA/ICflt7LlhbPpl60nIDogJ+W3suW8gOWQrycpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnTGF6eVN0YXJ0CiAgICAgICAgICAgICAgICAgICAgICAgICsgYGlmKHNldHRpbmdzLmFkZFRyYWlsZXJQaG90b01vZHVsZT09PTApe3NldHRpbmdzLmFkZFRyYWlsZXJQaG90b01vZHVsZT0xfWVsc2V7c2V0dGluZ3MuYWRkVHJhaWxlclBob3RvTW9kdWxlPTB9YAogICAgICAgICAgICAgICAgICAgICAgICArIGNvbmZpZ0xhenlFbmQKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgYWRkQ29tbWVudHNNb2R1bGU6IHsKICAgICAgICAgICAgICAgIG1vZGU6IDAsCiAgICAgICAgICAgICAgICBtb2R1bGU6IDMsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+efreivhOaooeWdlycgKyAoc2V0dGluZ3MuYWRkQ29tbWVudHNNb2R1bGUgPT09IDAgPyAn5bey5YWz6ZetJyA6ICflt7LlvIDlkK8nKSwKICAgICAgICAgICAgICAgIGNsaWNrOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNvbmZpZ0xhenlTdGFydAogICAgICAgICAgICAgICAgICAgICAgICArIGBpZihzZXR0aW5ncy5hZGRDb21tZW50c01vZHVsZT09PTApe3NldHRpbmdzLmFkZENvbW1lbnRzTW9kdWxlPTF9ZWxzZXtzZXR0aW5ncy5hZGRDb21tZW50c01vZHVsZT0wfWAKICAgICAgICAgICAgICAgICAgICAgICAgKyBjb25maWdMYXp5RW5kCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCiAgICAgICAgICAgIGFkZFJldmlld3NNb2R1bGU6IHsKICAgICAgICAgICAgICAgIG1vZGU6IDAsCiAgICAgICAgICAgICAgICBtb2R1bGU6IDMsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+WJp+ivhOaooeWdlycgKyAoc2V0dGluZ3MuYWRkUmV2aWV3c01vZHVsZSA9PT0gMCA/ICflt7LlhbPpl60nIDogJ+W3suW8gOWQrycpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnTGF6eVN0YXJ0CiAgICAgICAgICAgICAgICAgICAgICAgICsgYGlmKHNldHRpbmdzLmFkZFJldmlld3NNb2R1bGU9PT0wKXtzZXR0aW5ncy5hZGRSZXZpZXdzTW9kdWxlPTF9ZWxzZXtzZXR0aW5ncy5hZGRSZXZpZXdzTW9kdWxlPTB9YAogICAgICAgICAgICAgICAgICAgICAgICArIGNvbmZpZ0xhenlFbmQKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgc2hvd1NvdXJjZTogewogICAgICAgICAgICAgICAgbW9kZTogMCwKICAgICAgICAgICAgICAgIG1vZHVsZTogLTEsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+aYvuekulwnW+afpeeci+WOn+aWh11cJycsCiAgICAgICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArIGdldENvbG9yVGV4dCgn5b2T5YmN54q25oCB77yaJyArIChzZXR0aW5ncy5zaG93U291cmNlID09PSAxID8gJ+aYvuekuicgOiAn5LiN5pi+56S6JyksICcjZmY4YTAwJyksCiAgICAgICAgICAgICAgICBjbGljazogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25maWdMYXp5U3RhcnQKICAgICAgICAgICAgICAgICAgICAgICAgKyBgaWYoc2V0dGluZ3Muc2hvd1NvdXJjZT09PTEpe3NldHRpbmdzLnNob3dTb3VyY2U9MH1lbHNle3NldHRpbmdzLnNob3dTb3VyY2U9MX1gCiAgICAgICAgICAgICAgICAgICAgICAgICsgY29uZmlnTGF6eUVuZAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICBzaG93QWxsQ29udGVudDogewogICAgICAgICAgICAgICAgbW9kZTogMCwKICAgICAgICAgICAgICAgIG1vZHVsZTogLTEsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+aYvuekulwnW+afpeeci+WFqOaWh11cJycsCiAgICAgICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArIGdldENvbG9yVGV4dCgn5b2T5YmN54q25oCB77yaJyArIChzZXR0aW5ncy5zaG93QWxsQ29udGVudCA9PT0gMSA/ICfmmL7npLonIDogJ+S4jeaYvuekuicpLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnTGF6eVN0YXJ0CiAgICAgICAgICAgICAgICAgICAgICAgICsgYGlmKHNldHRpbmdzLnNob3dBbGxDb250ZW50PT09MSl7c2V0dGluZ3Muc2hvd0FsbENvbnRlbnQ9MH1lbHNle3NldHRpbmdzLnNob3dBbGxDb250ZW50PTF9YAogICAgICAgICAgICAgICAgICAgICAgICArIGNvbmZpZ0xhenlFbmQKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgZGVzY0xpbmVNYXhMZW46IHsKICAgICAgICAgICAgICAgIG1vZGU6IDAsCiAgICAgICAgICAgICAgICBtb2R1bGU6IC0xLAogICAgICAgICAgICAgICAgdGl0bGU6ICdIZWFkZXIg5o+P6L+w55qE5LiJ6KGM5Lit5q+P6KGM55qE5pyA5aSn6ZW/5bqmJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3lj4LmlbDvvJonICsgc2V0dGluZ3MuZGVzY0xpbmVNYXhMZW4sICcjZmY4YTAwJyksCiAgICAgICAgICAgICAgICBjbGljazogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIGxldCB2YWx1ZSA9IHNldHRpbmdzLmRlc2NMaW5lTWF4TGVuCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQodmFsdWUsIHNldHRpbmdzTWVzc2FnZS5kZXNjTGluZU1heExlbi50aXRsZSkuaW5wdXQoKHNldHRpbmdzKT0+ewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdFZhbHVlID0gMjUKICAgICAgICAgICAgICAgICAgICAgICAgc2V0dGluZ3MuZGVzY0xpbmVNYXhMZW4gPSAoKGlucHV0ID09PSAn6buY6K6kJykgPyBkZWZhdWx0VmFsdWUgOiBwYXJzZUludChpbnB1dCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShzZXR0aW5ncy5zZXR0aW5nc0NhY2hlRmlsZSwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MsIG51bGwsNCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcigiZGJfc2V0dGluZ3MiLCBKU09OLnN0cmluZ2lmeShzZXR0aW5ncykpCiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJwogICAgICAgICAgICAgICAgICAgIH0sIHNldHRpbmdzKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICB1c2VyQ29sb3I6IHsKICAgICAgICAgICAgICAgIG1vZGU6IDAsCiAgICAgICAgICAgICAgICBtb2R1bGU6IC0xLAogICAgICAgICAgICAgICAgdGl0bGU6ICfor4TorrrnlKjmiLfpopzoibInLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ+W9k+WJjeWPguaVsO+8micsICcjZmY4YTAwJykgKyBnZXRDb2xvclRleHQoc2V0dGluZ3MudXNlckNvbG9yLCBzZXR0aW5ncy51c2VyQ29sb3IpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBzZXR0aW5ncy51c2VyQ29sb3IKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh2YWx1ZSwgc2V0dGluZ3NNZXNzYWdlLnVzZXJDb2xvci50aXRsZSkuaW5wdXQoKHNldHRpbmdzKT0+ewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdFZhbHVlID0gIiMyOTc5RkYiCiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLnVzZXJDb2xvciA9ICgoaW5wdXQgPT09ICfpu5jorqQnKSA/IGRlZmF1bHRWYWx1ZSA6IGlucHV0KQogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc2V0dGluZ3Muc2V0dGluZ3NDYWNoZUZpbGUsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzLCBudWxsLDQpKQogICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoImRiX3NldHRpbmdzIiwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MpKQogICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnycKICAgICAgICAgICAgICAgICAgICB9LCBzZXR0aW5ncykKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgLy8g5qih5Z2X55qE6Ze06LedCiAgICAgICAgICAgIGxpbmVfbW9kZWw6IHsKICAgICAgICAgICAgICAgIG1vZGU6IDAsCiAgICAgICAgICAgICAgICBtb2R1bGU6IC0xLAogICAgICAgICAgICAgICAgdGl0bGU6ICfmqKHlnZfnmoTpl7Tot50nLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ+W9k+WJjeWPguaVsO+8micgKyBzZXR0aW5ncy5saW5lX21vZGVsLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBzZXR0aW5ncy5saW5lX21vZGVsCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQodmFsdWUsIHNldHRpbmdzTWVzc2FnZS5saW5lX21vZGVsLnRpdGxlKS5pbnB1dCgoc2V0dGluZ3MpPT57CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZWZhdWx0VmFsdWUgPSAxCiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmxpbmVfbW9kZWwgPSAoKGlucHV0ID09PSAn6buY6K6kJykgPyBkZWZhdWx0VmFsdWUgOiBwYXJzZUludChpbnB1dCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShzZXR0aW5ncy5zZXR0aW5nc0NhY2hlRmlsZSwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MsIG51bGwsNCkpCiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcigiZGJfc2V0dGluZ3MiLCBKU09OLnN0cmluZ2lmeShzZXR0aW5ncykpCiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+u5pS55oiQ5YqfJwogICAgICAgICAgICAgICAgICAgIH0sIHNldHRpbmdzKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAogICAgICAgICAgICAvLyDmqKHlnZfpl7Tot53nsbvlnovvvIjpgILphY3ku6XlkI7lj6/og73kvJrmnInnmoTml6Dovrnot53nur/vvIkKICAgICAgICAgICAgbGluZV90eXBlX21vZGVsOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAtMSwKICAgICAgICAgICAgICAgIHRpdGxlOiAn5qih5Z2X6Ze06Led57G75Z6LJywKICAgICAgICAgICAgICAgIGRlc2M6ICfigJzigJzigJ3igJ0nICsgZ2V0Q29sb3JUZXh0KCflvZPliY3lj4LmlbDvvJonICsgc2V0dGluZ3MubGluZV90eXBlX21vZGVsLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPSBzZXR0aW5ncy5saW5lX3R5cGVfbW9kZWwKICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCh2YWx1ZSwgc2V0dGluZ3NNZXNzYWdlLmxpbmVfdHlwZV9tb2RlbC50aXRsZSkuaW5wdXQoKHNldHRpbmdzKT0+ewogICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdFZhbHVlID0gImxpbmVfYmxhbmsiCiAgICAgICAgICAgICAgICAgICAgICAgIHNldHRpbmdzLmxpbmVfdHlwZV9tb2RlbCA9ICgoaW5wdXQgPT09ICfpu5jorqQnKSA/IGRlZmF1bHRWYWx1ZSA6IGlucHV0KQogICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc2V0dGluZ3Muc2V0dGluZ3NDYWNoZUZpbGUsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzLCBudWxsLDQpKQogICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoImRiX3NldHRpbmdzIiwgSlNPTi5zdHJpbmdpZnkoc2V0dGluZ3MpKQogICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSkKICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/ruaUueaIkOWKnycKICAgICAgICAgICAgICAgICAgICB9LCBzZXR0aW5ncykKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgTW9yZV9pbmZvcm1hdGlvbjogewogICAgICAgICAgICAgICAgbW9kZTogMCwKICAgICAgICAgICAgICAgIG1vZHVsZTogLTEsCiAgICAgICAgICAgICAgICB0aXRsZTogJ+WJp+aDheeugOS7i+W6leS4i+aYvuekuuabtOWkmuWKn+iDvScsCiAgICAgICAgICAgICAgICBkZXNjOiAn4oCc4oCc4oCd4oCdJyArIGdldENvbG9yVGV4dCgn5b2T5YmN54q25oCB77yaJyArIChzZXR0aW5ncy5Nb3JlX2luZm9ybWF0aW9uID09PSAxID8gJ+aYvuekuicgOiAn5LiN5pi+56S6JyksICcjZmY4YTAwJyksCiAgICAgICAgICAgICAgICBjbGljazogZnVuY3Rpb24gKCkgewogICAgICAgICAgICAgICAgICAgIHJldHVybiBjb25maWdMYXp5U3RhcnQKICAgICAgICAgICAgICAgICAgICAgICAgKyBgaWYoc2V0dGluZ3MuTW9yZV9pbmZvcm1hdGlvbj09PTEpe3NldHRpbmdzLk1vcmVfaW5mb3JtYXRpb249MH1lbHNle3NldHRpbmdzLk1vcmVfaW5mb3JtYXRpb249MX1gCiAgICAgICAgICAgICAgICAgICAgICAgICsgY29uZmlnTGF6eUVuZAogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9LAoKICAgICAgICAgICAgLy8g566A5Y2V5qih5byP55qE5bi455So5pCc57Si6KeE5YiZCiAgICAgICAgICAgIHNpbXBsZVVzdWFsU2VhcmNoUnVsZTogewogICAgICAgICAgICAgICAgbW9kZTogMSwKICAgICAgICAgICAgICAgIG1vZHVsZTogMSwKICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5Y2V5qih5byP55qE5pCc57Si5bi455So6KeE5YiZJywKICAgICAgICAgICAgICAgIGRlc2M6ICfmoLzlvI/vvJrmmL7npLrlkI1AQOWbvueJh+WcsOWdgCjlj6/nqbopQEDop4TliJnlkI1cbicgKyAn4oCc4oCc4oCd4oCdJyArIGdldENvbG9yVGV4dCgn5b2T5YmN5Y+C5pWw77yaJyArIHNldHRpbmdzLnNpbXBsZVVzdWFsU2VhcmNoUnVsZSwgJyNmZjhhMDAnKSwKICAgICAgICAgICAgICAgIGNsaWNrOiBmdW5jdGlvbiAoKSB7CiAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID0gc2V0dGluZ3Muc2ltcGxlVXN1YWxTZWFyY2hSdWxlID09PSB1bmRlZmluZWQgPwogICAgICAgICAgICAgICAgICAgICAgICAn5aWI6I+y5b2x6KeGQEBodHRwczovL3MzLmF4MXguY29tLzIwMjAvMTEvMjMvREd4ZElBLnBuZ0BA5aWI6I+y5b2x6KeGJwogICAgICAgICAgICAgICAgICAgICAgICA6IHNldHRpbmdzLnNpbXBsZVVzdWFsU2VhcmNoUnVsZQogICAgICAgICAgICAgICAgICAgIHJldHVybiAkKHZhbHVlLCBzZXR0aW5nc01lc3NhZ2Uuc2ltcGxlVXN1YWxTZWFyY2hSdWxlLnRpdGxlKS5pbnB1dCgoc2V0dGluZ3MpPT57CiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZWZhdWx0VmFsdWUgPSAi5aWI6I+y5b2x6KeGQEBodHRwczovL3MzLmF4MXguY29tLzIwMjAvMTEvMjMvREd4ZElBLnBuZ0BA5aWI6I+y5b2x6KeGIgogICAgICAgICAgICAgICAgICAgICAgICBzZXR0aW5ncy5zaW1wbGVVc3VhbFNlYXJjaFJ1bGUgPSAoKGlucHV0ID09PSAn6buY6K6kJykgPyBkZWZhdWx0VmFsdWUgOiBpbnB1dCkKICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNldHRpbmdzLnNldHRpbmdzQ2FjaGVGaWxlLCBKU09OLnN0cmluZ2lmeShzZXR0aW5ncywgbnVsbCw0KSkKICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCJkYl9zZXR0aW5ncyIsIEpTT04uc3RyaW5naWZ5KHNldHRpbmdzKSkKICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpCiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv67mlLnmiJDlip8nCiAgICAgICAgICAgICAgICAgICAgfSwgc2V0dGluZ3MpCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0sCgogICAgICAgICAgICBoaWRlSW1nOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAtMSwKICAgICAgICAgICAgICAgIHRpdGxlOiAn6ZqQ6JeP5Zu+54mHKOecgea1geaooeW8jyknLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ+W9k+WJjeeKtuaAge+8micgKyAoc2V0dGluZ3MuaGlkZUltZyA9PT0gMSA/ICflvIDlkK8nIDogJ+S4jeW8gOWQrycpLCAnI2ZmOGEwMCcpLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnTGF6eVN0YXJ0CiAgICAgICAgICAgICAgICAgICAgICAgICsgYGlmKHNldHRpbmdzLmhpZGVJbWc9PT0xKXtzZXR0aW5ncy5oaWRlSW1nPTB9ZWxzZXtzZXR0aW5ncy5oaWRlSW1nPTF9YAogICAgICAgICAgICAgICAgICAgICAgICArIGNvbmZpZ0xhenlFbmQKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICAgICAgc2hvd0Z1bGxJbWdUaXBzOiB7CiAgICAgICAgICAgICAgICBtb2RlOiAwLAogICAgICAgICAgICAgICAgbW9kdWxlOiAtMSwKICAgICAgICAgICAgICAgIHRpdGxlOiAn5pi+56S655yL5aSn5Zu+5o+Q56S6KOmYsuatouaXoOazleWKoOi9veWbvueJhyknLAogICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnScgKyBnZXRDb2xvclRleHQoJ+W9k+WJjeeKtuaAge+8micgKyAoc2V0dGluZ3Muc2hvd0Z1bGxJbWdUaXBzID09PSAxID8gJ+aYvuekuicgOiAn5LiN5pi+56S6JyksICcjZmY4YTAwJykgKyAnXG7ms6jmhI/vvJror6XpgInpobnku4XlnKjnnIHmtYHmqKHlvI/kuI3lvIDlkK/ml7bnlJ/mlYgnLAogICAgICAgICAgICAgICAgY2xpY2s6IGZ1bmN0aW9uICgpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29uZmlnTGF6eVN0YXJ0CiAgICAgICAgICAgICAgICAgICAgICAgICsgYGlmKHNldHRpbmdzLnNob3dGdWxsSW1nVGlwcz09PTEpe3NldHRpbmdzLnNob3dGdWxsSW1nVGlwcz0wfWVsc2V7c2V0dGluZ3Muc2hvd0Z1bGxJbWdUaXBzPTF9YAogICAgICAgICAgICAgICAgICAgICAgICArIGNvbmZpZ0xhenlFbmQKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfSwKICAgICAgICB9CgogICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgIHRpdGxlOiBnZXRTdHJvbmdUZXh0KCLngrnlh7vkuIvmlrnpgInpobnljbPlj6/phY3nva4iKQogICAgICAgICAgICAgICAgKyAiPGJyPiIKICAgICAgICAgICAgICAgICsgZ2V0U21hbGxUZXh0KGdldEdyZXlUZXh0KCLlj6/kuIDmrKHphY3nva7lpJrkuKrvvIzliLfmlrDlkI7nlJ/mlYjvvIzovpPlhaVcIum7mOiupFwi5Y+v5oGi5aSN6buY6K6k6K6+572uIikpLAogICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcKICAgICAgICB9KQoKICAgICAgICBkLnB1c2goewogICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnCiAgICAgICAgfSkKCiAgICAgICAgbGV0IHNldHRpbmdNZXNzYWdlTGlzdCA9IFtdOwogICAgICAgIGZvciAobGV0IHNldHRpbmdzTWVzc2FnZUtleSBpbiBzZXR0aW5nc01lc3NhZ2UpIHsKICAgICAgICAgICAgc2V0dGluZ01lc3NhZ2VMaXN0LnB1c2goc2V0dGluZ3NNZXNzYWdlW3NldHRpbmdzTWVzc2FnZUtleV0pOwogICAgICAgIH0KCiAgICAgICAgZnVuY3Rpb24gc2V0RmlsdGVyU2V0dGluZ3NNZXNzYWdlKG1vZHVsZSwgbWVzc2FnZVR5cGVUaXRsZSwgbWVzc2FnZUNvbFR5cGUpIHsKICAgICAgICAgICAgbGV0IGZpbHRlclNldHRpbmdNZXNzYWdlTGlzdCA9IHNldHRpbmdNZXNzYWdlTGlzdC5maWx0ZXIoaXRlbSA9PiAoKGl0ZW0ubW9kZSA9PT0gLTEgfHwgaXRlbS5tb2RlID09PSBzZXR0aW5ncy5vcGVuU2ltcGxlRGV0YWlsVmlldykgJiYgaXRlbS5tb2R1bGUgPT09IG1vZHVsZSkpOwogICAgICAgICAgICBpZiAoZmlsdGVyU2V0dGluZ01lc3NhZ2VMaXN0Lmxlbmd0aCA+IDAgJiYgbWVzc2FnZVR5cGVUaXRsZSAhPT0gJycpIHsKICAgICAgICAgICAgICAgIGQucHVzaCh7CiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGdldEJpZ1RleHQoZ2V0U3Ryb25nVGV4dChtZXNzYWdlVHlwZVRpdGxlKSksCiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdyaWNoX3RleHQnCiAgICAgICAgICAgICAgICB9KQogICAgICAgICAgICB9CiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZmlsdGVyU2V0dGluZ01lc3NhZ2VMaXN0Lmxlbmd0aDsgaSsrKSB7CiAgICAgICAgICAgICAgICBsZXQgZmlsdGVyU2V0dGluZ01lc3NhZ2UgPSBmaWx0ZXJTZXR0aW5nTWVzc2FnZUxpc3RbaV07CiAgICAgICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgICAgIHRpdGxlOiBmaWx0ZXJTZXR0aW5nTWVzc2FnZS50aXRsZSwKICAgICAgICAgICAgICAgICAgICBkZXNjOiBmaWx0ZXJTZXR0aW5nTWVzc2FnZS5kZXNjLAogICAgICAgICAgICAgICAgICAgIHVybDogZmlsdGVyU2V0dGluZ01lc3NhZ2UuY2xpY2soKSwKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogbWVzc2FnZUNvbFR5cGUKICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICB9CiAgICAgICAgfQoKICAgICAgICBzZXRGaWx0ZXJTZXR0aW5nc01lc3NhZ2UoMCwgJ+W4uOeUqOiuvue9ricsICd0ZXh0XzEnKTsKICAgICAgICBzZXRGaWx0ZXJTZXR0aW5nc01lc3NhZ2UoMywgJycsICd0ZXh0XzInKTsKICAgICAgICBzZXRGaWx0ZXJTZXR0aW5nc01lc3NhZ2UoMSwgJ+inhueVjOaQnOebuOWFsycsICd0ZXh0XzEnKTsKICAgICAgICBzZXRGaWx0ZXJTZXR0aW5nc01lc3NhZ2UoMiwgJ+ixhueTo+ivhOWIhuebuOWFsycsICd0ZXh0XzEnKTsKICAgICAgICBzZXRGaWx0ZXJTZXR0aW5nc01lc3NhZ2UoLTEsICflhbbku5borr7nva4nLCAndGV4dF8xJyk7CgogICAgICAgIHJlcy5kYXRhID0gZDsKICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7CiAgICB9LAogICAgLyoqCiAgICAgKiDpooTlkYrniYfjgIHop4bpopHor4TorrrnlYzpnaIKICAgICAqLwogICAgdHJhaWxlckxpc3RWaWV3OiBmdW5jdGlvbiAoKSB7CiAgICAgICAgdmFyIHJlcyA9IHt9OwogICAgICAgIHZhciBkID0gW107CgogICAgICAgIHZhciBjb250ZW50ID0gJzxib2R5PicgKyBwYXJzZURvbShnZXRSZXNDb2RlKCksICdib2R5JiYjY29udGVudCYmSHRtbCcpICsgJzwvYm9keT4nOwogICAgICAgIHZhciB0aXRsZV9saXN0ID0gcGFyc2VEb21Gb3JBcnJheShjb250ZW50LCAnYm9keSYmaDJbaWRdJyk7CiAgICAgICAgdmFyIGxpc3RfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkoY29udGVudCwgJ2JvZHkmJi52aWRlby1saXN0Jyk7CgogICAgICAgIGZvciAodmFyIGkgaW4gdGl0bGVfbGlzdCkgewogICAgICAgICAgICBkLnB1c2goewogICAgICAgICAgICAgICAgdGl0bGU6IHBhcnNlRG9tRm9ySHRtbCh0aXRsZV9saXN0W2ldLCAnaDImJlRleHQnKS5zcGxpdCgiwqDCt8KgwrfCoMK3wqDCt8KgwrfCoMK3IilbMF0sCiAgICAgICAgICAgICAgICB1cmw6ICcnLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsb25nX3RleHQnCiAgICAgICAgICAgIH0pOwogICAgICAgICAgICB2YXIgdmlkZW9fbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkobGlzdF9saXN0W2ldLCAndWwmJmxpJyk7CiAgICAgICAgICAgIGZvciAodmFyIGogaW4gdmlkZW9fbGlzdCkgewogICAgICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKHZpZGVvX2xpc3Rbal0sICdhOm5vdChbY2xhc3NdKSYmVGV4dCcpLAogICAgICAgICAgICAgICAgICAgIGRlc2M6IHBhcnNlRG9tRm9ySHRtbCh2aWRlb19saXN0W2pdLCAnc3Ryb25nJiZUZXh0JyksCiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogcGFyc2VEb21Gb3JIdG1sKHZpZGVvX2xpc3Rbal0sICdpbWcmJnNyYycpLAogICAgICAgICAgICAgICAgICAgIHVybDogcGFyc2VEb21Gb3JIdG1sKHZpZGVvX2xpc3Rbal0sICdhJiZocmVmJykgKyBgQGxhenlSdWxlPWJvZHkmJnNvdXJjZSYmc3JjYCwKICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzInCiAgICAgICAgICAgICAgICB9KTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICByZXMuZGF0YSA9IGQ7CiAgICAgICAgc2V0SG9tZVJlc3VsdChyZXMpOwogICAgfSwKICAgIC8qKgogICAgICog5Ymn54Wn5YiX6KGo6aG16Z2iCiAgICAgKi8KICAgIHBob3RvTGlzdFZpZXc6IGZ1bmN0aW9uICgpIHsKICAgICAgICB2YXIgcmVzID0ge307CiAgICAgICAgdmFyIGQgPSBbXTsKCiAgICAgICAgdmFyIHBpY3MgPSAnPGJvZHk+JyArIHBhcnNlRG9tKGdldFJlc0NvZGUoKSwgJ2JvZHkmJi5hcnRpY2xlJiZIdG1sJykgKyAnPC9ib2R5Pic7CiAgICAgICAgdmFyIHBpY3NfbGlzdCA9IHBhcnNlRG9tRm9yQXJyYXkocGljcywgJ2JvZHkmJmxpJyk7CiAgICAgICAgZm9yICh2YXIgaSBpbiBwaWNzX2xpc3QpIHsKICAgICAgICAgICAgZC5wdXNoKHsKICAgICAgICAgICAgICAgIHBpY191cmw6IHBhcnNlRG9tRm9ySHRtbChwaWNzX2xpc3RbaV0sICdpbWcmJnNyYycpLAogICAgICAgICAgICAgICAgdXJsOiBwYXJzZURvbUZvckh0bWwocGljc19saXN0W2ldLCAnaW1nJiZzcmMnKS5yZXBsYWNlKC9cLyhzcXhzfG0pXC8vZywgJy9sLycpLAogICAgICAgICAgICAgICAgY29sX3R5cGU6ICdwaWNfMicKICAgICAgICAgICAgfSk7CiAgICAgICAgfQogICAgICAgIHJlcy5kYXRhID0gZDsKICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7CiAgICB9Cn07Cg==
Add Comment
Please, Sign In to add comment