Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥MX影视@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJqczpcXG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9jaGFwdGVyJywge30pKS5ydWxlKTtcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0olwiLFwicGF0aFwiOlwic2VhclwiLFwicnVsZVwiOlwidmFyIHJlcyA9IHt9O1xcbnZhciBpdGVtcyA9IFtdO1xcbi8v6K6+572u5pCc57Si57q/56iLXFxudmFyIHNzbW9kZSA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuc3Ntb2RlO1xcbnZhciBrZXkgPSBNWV9VUkwuc3BsaXQoJyQkJCcpWzFdO1xcbi8vc2V0RXJyb3IobGUpO1xcbmlmIChzc21vZGUgPT0gJzAnKSB7XFxuICAgIHNldFBhZ2VUaXRsZShrZXkgKyAnIOeahOaQnOe0oue7k+aenCcpXFxufTtcXG4vKnRyeSB7XFxuICAgIHZhciBhcHBmaWxlID0gZmV0Y2hDYWNoZSgnaHR0cHM6Ly9pbm1lbW9yeS5jb2RpbmcubmV0L3AvSW5NZW1vcnkvZC9NQnJvd3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RlbXMucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IE1ZX1RZUEUgPT0gXFxcImhvbWVcXFwiID8gXFxcIueCueWHu+afpeeciyBcXFwiICsgdHl0aXQgKyBcXFwiIOWIhuexuyDigJzigJxcXFwiICsga2V5ICsgXFxcIuKAneKAnSDnmoTogZrmkJznu5PmnpxcXFwiIDogXFxcIueCueWHu+afpeeciyBcXFwiICsgdHl0aXQgKyBcXFwiIOWIhuexuyBcXFwiICsga2V5ICsgXFxcIiDnmoTogZrmkJznu5PmnpxcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9zczJcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaXN0OiBsaXN0LFxcbiAgICAgICAgICAgICAgICB0eXRpdDogdHl0aXQsXFxuICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHkkJCQnICsga2V5ICsgJyQkJGZ5cGFnZSQkJCdcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgfSAvL2ZvciBpXFxufTsgLy9lbmQgbW9kZSAxXFxuXFxuaWYgKHNzbW9kZSA9PSAnMCcgfHwgTVlfVFlQRSA9PSAnaG9tZScpIHtcXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBkbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgdmFyIGxpc3QgPSBkbGlzdFtpXS5saXN0O1xcbiAgICAgICAgdmFyIHR5dGl0ID0gZGxpc3RbaV0udGl0bGU7XFxuXFxuICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogTVlfVFlQRSA9PSBcXFwiaG9tZVxcXCIgPyBcXFwiIOmAieaLqeS4gOS4qiBcXFwiICsgZGxpc3RbaV0udGl0bGUgKyBcXFwiIOmhueebruafpeeciyDigJzigJxcXFwiICsga2V5ICsgXFxcIuKAneKAnSDnmoTmkJzntKLnu5PmnpxcXFwiIDogXFxcIiDpgInmi6nkuIDkuKogXFxcIiArIGRsaXN0W2ldLnRpdGxlICsgXFxcIiDpobnnm67mn6XnnIsgXFxcIiArIGtleSArIFxcXCIg55qE5pCc57Si57uT5p6cXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSBsaXN0W2pdLnVybDtcXG4gICAgICAgICAgICB2YXIgbGl0aXQgPSBsaXN0W2pdLm11cmw7XFxuICAgICAgICAgICAgaWYgKC9cXFxcL3ZvZFxcXFwvLy50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgIGlmICgvMTlqeHwyOTN5c3x6aGFpa2FueXN8amlcXFxcLWRpbmdcXFxcLWhlfHBob2ViZXx5dW5ib1xcXFwuYnhpbnxsYW5yZW50a3xoZXRhb3lzfHB4dW58MTM5XFxcXC4xNTV8ZmtrZHl8MDU2MTU4fGFpeGl4aXxydW94aW5ld3xmZWlmYW4xMjN8c2lxaXR2Ly50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9hYz1saXN0JnptPScgKyBrZXkgKyAnJnBhZ2U9ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP2FjPWxpc3Qmd2Q9JyArIGtleSArICcmcGFnZT1meXBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKC9kaWppYXhpYS8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGluayA9ICdodHRwOi8vd3d3LmRpamlheGlhLmNvbS9hcGkucGhwL2FwcC8nXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGlmIChsaW5rLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz1meXBhZ2UmdGV4dD0nICsga2V5ICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmsuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz1meXBhZ2UmdGV4dD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9pb3Blbnl1bi8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnL2xpc3Q/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGxpc3Rbal0udGl0bGUsXFxuICAgICAgICAgICAgICAgIGltZzogbGlzdFtqXS5pbWcsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSN4IycgKyBobXVybCArICcjeCMnICsgbGluayArICcjeCMnICsgbGl0aXQgKyAnI3gj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hdGU7XFxuICAgIHVybCA9IHVybC5zdGFydHNXaXRoKCdodHRwJykgPyB1cmwgOiBtdXJsICsgJz9hYz1kZXRhaWwmaWRzPScgKyB1cmw7XFxuICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICB1cmw6ICQodXJsKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxuICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxuICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxTXSo/OlxcXFwvXFxcXC9bXFxcXFNdKj8pXFxcXC8vKVsxXTtcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAnMjU1JiZmbG9hdCcsXFxuICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgcmVzLmRhdGEgPSBpdGVtcztcXG4gICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICBjb2xfdHlwZTog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ICAgICAgIH0gZWxzZSBpZiAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLmluZGV4T2YoXFxcIj1cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICB2YXIgamllayA9IChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLnJlcGxhY2UoL1xcXFwuXFxcXC4vZywgXFxcIi5cXFwiKS5zcGxpdCgnLCcpWzBdO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBqaWVrID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vc2V0RXJyb3Ioamllayk7ICAgICAgICAgICAgICAgIFxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAvL2ppZWvmi7zmjqVcXG4gICAgaWYgKGppZWsgIT0gJycgJiYgamllayAhPSBudWxsKSB7XFxuICAgICAgICBpZiAoamllay5zdWJzdHJpbmcoMCwgNCkgPT0gJ2h0dHAnKSB7XFxuICAgICAgICAgICAgamllayA9IGppZWs7XFxuICAgICAgICB9IGVsc2UgaWYgKGppZWsuc3Vic3RyaW5nKDAsIDIpID09ICdcXFxcL1xcXFwvJykge1xcbiAgICAgICAgICAgIGppZWsgPSAnaHR0cHM6JyArIGppZWs7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBqaWVrID0gXFxcIlxcXCI7XFxuICAgIH1cXG4gICAgLy/lr7nlpLHmlYjmjqXlj6Pov5vooYzmm7/mjaJcXG4gICAgaWYgKC9jb2tlbXYvLnRlc3QobXl1cmwpICYmIC9jb2tlcWllfHhpbnw5MG1tLy50ZXN0KHB0YWIpKSB7XFxuICAgICAgICBqaWVrID0gJ2h0dHBzOi8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RleE9mKFxcXCI9XFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZygnXFxcXG7nur/ot6/vvJonICsgcHRhYiArICdcXFxcbuinhumike+8micgKyB2bGluayArICdcXFxcbicgKyAn6Kej5p6Q5o6l5Y+j77yaXFxcXG4nICsgY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlMi5yZXBsYWNlKC9cXFxcLlxcXFwuL2csIFxcXCIuXFxcIikucmVwbGFjZSgvXFxcXCwvZywgXFxcIlxcXFxuXFxcXG5cXFwiKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLmluZGV4T2YoXFxcIj1cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdcXFxcbue6v+i3r++8micgKyBwdGFiICsgJ1xcXFxu6KeG6aKR77yaJyArIHZsaW5rICsgJ1xcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcbicgKyBjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UucmVwbGFjZSgvXFxcXC5cXFxcLi9nLCBcXFwiLlxcXCIpLnJlcGxhY2UoL1xcXFwsL2csIFxcXCJcXFxcblxcXFxuXFxcIikpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdcXFxcbue6v+i3r++8micgKyBwdGFiICsgJ1xcXFxu6KeG6aKR77yaJyArIHZsaW5rICsgJ1xcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcbicgKyBqaWVrKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL3NldEVycm9yKGppZWspOyA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ICAgICAgICAgICAgICAgICAgICAgICAvL2h0bWznvZHpobXosIPnlKjmlq3mj5Lop6PmnpBcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBjb25maWcgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UocmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvc3xuZXRlYXNlXFxcXC5jb20vLnRlc3QocmVzdXJsKSAmJiAvaHR0cC8udGVzdChyZXN1cmwpICYmICEvXFxcXC5odG1sLy50ZXN0KHJlc3VybCkgJiYgIS9cXFxcPWh0dHAvLnRlc3QocmVzdXJsKSAmJiBwdGFiICE9ICdkdW9kdW96eScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChyZXN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcPS8udGVzdChyZXN1cmwpID8gcmVzdXJsLnNwbGl0KCc9JylbMV0gOiByZXN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/osIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXFxcbicgKyBwdGFiICsgJyjpgJrnlKjlh73mlbApJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBjb25maWcgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gcHRhYiArICco6YCa55So5Ye95pWwKSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQYXJzZVNbbmFtZV0ocmVzdXJsLCBteXVybCk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdkdW9kdW96eScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gRGUod29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGEgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShtZDUoJ3JYald2WGw2JykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKCdOWGJIb1dKYnBzRU9pbjhiJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh3b3JkLCBhLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXY6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgZGR6eSA9ICdhZEh1Um8wZGN1SG9NMTYzTDF5NCcgKyBiYXNlNjRFbmNvZGUoc3JjdXJsKS5zbGljZSgxMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9iby5kZDUyMC5jYy94cGxheS9hcGkucGhwXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9iby5kZDUyMC5jYy94bXBsYXllci9hcGkucGhwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGR3eSA9IGZldGNoKCdodHRwczovL2pocGMubWFuZHVodS5jb20vZHVvZHVvL2FwaS5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiAndXJsPScgKyByZXN1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coZGR3eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBEZShKU09OLnBhcnNlKGRkd3kpLnVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvbWlhb3BhcnR5Ly50ZXN0KHB0YWIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9jb2RlLmFsaXl1bi5jb20vbHprMjM1NTkvUHVibGljUnVsZS9yYXcvbWFzdGVyL3g1cnVsZS5qcycsIDI0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZSgnaHR0cHM6Ly93d3cuZnVuNGsuY29tL2FwbGF5ZXIvP3VybD0nICsgcmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJyAmJiB2bGluay5tYXRjaCgveW91a3V8bWd0dnxpeGlndWF8cXEuY29tfHFpeWl8bWlndXxiaWxpYmlsaXxzb2h1fHBwdHZ8bGV8MTkwNS5jb20vKSAmJiB2bGluay5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+W3suW8gOWQr+aWreaPku+8jOWwhuiwg+eUqOaWreaPkuino+aekGh0bWwnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZSh2bGluayk7XFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgdmFyIHNyY3VybCA9IGxpbms7XFxuICAgICAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxuICAgICAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB5byA5aeLXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAvL+WkhOeQhuaMh+WumuinhumikeS4jue6v+i3r1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcLm0zdTh8XFxcXC5tcDR8b2JqXFxcXC90b3N8bmV0ZWFzZVxcXFwuY29tLy50ZXN0KHNyY3VybCkgJiYgL2h0dHAvLnRlc3Qoc3JjdXJsKSAmJiAhL1xcXFwuaHRtbC8udGVzdChzcmN1cmwpICYmICEvXFxcXD1odHRwLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcmN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcPS8udGVzdChzcmN1cmwpID8gc3JjdXJsLnNwbGl0KCc9JylbMV0gOiBzcmN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3JjdXJsLmluZGV4T2YoXFxcIi9zaGFyZS9cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXCIvc2hhcmVcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZjID0gZmV0Y2goc3JjdXJsLCB7fSkucmVwbGFjZShcXFwidmFyIHB1cmxcXFwiLCBcXFwidmFyIG1haW5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZjLmluZGV4T2YoXFxcIm1haW5cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwobWF0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYWluID0gZmMubWF0Y2goL3VybDouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXkgPSAobWFpbi5pbmRleE9mKFxcXCJodHRwXFxcIikgIT0gLTEgPyBtYWluIDogbGluayArIG1haW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC85ODN2aXAvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC94XFxcXC1uXFxcXC5jY3xuaGR6NjY2Ly50ZXN0KHNyY3VybCkgJiYgL1xcXFwuaHRtbHxiaWxpYmlsaS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgLy/lpITnkIbmjIflrprop4bpopHlkoznur/ot6/nu5PmnZ9cXG4gICAgICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb2RlID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIm9raHR0cC80LjEuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coc2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMicgfHwgc2NvZGUuc3RhdHVzQ29kZSA9PSAnMzAxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5omT5byA6Kej5p6Q5pyJMzAy6YeN5a6a5ZCR55qE6ZO+5o6lXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlZHVybCA9IHNjb2RlLmhlYWRlcnMubG9jYXRpb25bMF0ucmVwbGFjZSgvXFxcXFxcXFwvZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL2h0bWx8YmlsaWJpbGl8a2V5XFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9cXFxcLm0zdTh8XFxcXC5tcDR8XFxcXC5mbHYvLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVkdXJsLnN1YnN0cmluZyhyZWR1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL2h0dHAvLnRlc3QocmVkdXJsKSAmJiAva2V5XFxcXD18dWlkXFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWR1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGh0bWwgPSByZXF1ZXN0KHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBzY29kZS5ib2R5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl64vLnRlc3QoaHRtbCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw8Ym9keS8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+WwneivlemdnkpTT07mjqXlj6PnvZHpobXop6PmnpAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZUNhY2hlKCdodHRwczovL2NvZGUuYWxpeXVuLmNvbS9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9tYXN0ZXIveDVydWxlLmpzJywgMjQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geDVydWxlKHNyY3VybCwgc3JjdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gb3BlbnVybChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vanNvbuino+aekOeahOWPlumTvuaOpVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IGh0bWwubWF0Y2goL1tcXFxcJ1xcXFxcXFwiXXVybFtcXFxcJ1xcXFxcXFwiXTouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdLnJlcGxhY2UoL1xcXFxcXFxcL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvaHR0cC8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gJ2JpbGliaWxpJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJzt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB0YWIgPT0gJ21ndHYnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29qYmsvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICc7e1JlZmVyZXJAaHR0cHM6Ly9iYWsub2pia2p4LmNvbS99JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZXNjYXBlKHB1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pnZ5odHRw5byA5aS055qE5omT5byA5Y6f6ZO+5o6lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8v5oql6ZSZ5Yik5pat5aSE55CGXFxuICAgICAgICAgICAgICAgICAgICBsb2coJ+aJp+ihjOaKpemUmei3s+i9rOWkhOeQhicpO1xcbiAgICAgICAgICAgICAgICAgICAgLyppZiAoc3JjdXJsLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXC9cXFxcLycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCgnaHR0cHM6JyArIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPWh0dHAvLnRlc3Qoc3JjdXJsKSAmJiAvXFxcXC5odG1sfGJpbGliaWxpLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBzcmN1cmwuc3BsaXQoJz0nKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspXFxuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAneDVXZWJWaWV3Oi8vJytzcmN1cmxcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgI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cXG4gICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShyZXN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPUxUXFxcXC0vLnRlc3QocmVzdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5JsdG5i6YCa55So6Kej5p6QJyk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gJ2x0bmIo6YCa55So5Ye95pWwKSc7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFyc2VTW25hbWVdKHJlc3VybC5zdWJzdHJpbmcocmVzdXJsLmluZGV4T2YoJz1MVC0nKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdmFyIGVuRG4gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL3h5cS9hcHBtc2V0Lmpzb24nLCB7fSkpLmVuRG47XFxuICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJyAmJiBzcmN1cmwubWF0Y2goL3lvdWt1fG1ndHZ8aXhpZ3VhfHFxLmNvbXxxaXlpfG1pZ3V8YmlsaWJpbGl8c29odXxwcHR2fGxlfDE5MDUuY29tLykgJiYgc3JjdXJsLnNlYXJjaCgvaHRtbHxiaWxpYmlsaXxpeGlndWEvKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2Uoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxuICAgICAgICAgICAgLy/liqjmgIHop6PmnpDku6PnoIHlvIDlp4tcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvcy8udGVzdChzcmN1cmwpICYmIC9odHRwLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAvXFxcXD0vLnRlc3Qoc3JjdXJsKSA/IHNyY3VybC5zcGxpdCgnPScpWzFdIDogc3JjdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzcmN1cmwuaW5kZXhPZihcXFwiL3NoYXJlL1xcXCIpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXCIvc2hhcmVcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmMgPSBmZXRjaChzcmN1cmwsIHt9KS5yZXBsYWNlKFxcXCJ2YXIgcHVybFxcXCIsIFxcXCJ2YXIgbWFpblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYy5pbmRleE9mKFxcXCJtYWluXFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChtYXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGxheSA9IChtYWluLmluZGV4T2YoXFxcImh0dHBcXFwiKSAhPSAtMSA/IG1haW4gOiBsaW5rICsgbWFpbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1haW4gPSBmYy5tYXRjaCgvdXJsOi4qP1tcXFxcJ1xcXFxcXFwiXSguKj8pW1xcXFwnXFxcXFxcXCJdLylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXk7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdhbGl6eScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gZmV0Y2goJ2h0dHBzOi8vZm91YmluLmNvbS9qaWV4aS5waHA/dXJsPScgKyBzcmN1cmwsIHt9KS5tYXRjaCgvXFxcXFxcXCJ1cmxcXFxcXFxcIjpcXFxcXFxcIiguKj8pXFxcXFxcXCIvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC8xOWp4XFxcXC52aXB8bmZ5aW5nc2hpLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwucmVwbGFjZSgnaHR0cDovLycsICdodHRwczovLycpLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvdGl0YW4ubWd0di8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLyplbHNlIGlmICgvemhhaWthbnlzLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IEpTT04ucGFyc2UoZmV0Y2goc3JjdXJsICsgJyZhcHA9MTAwMDMmYWNjb3VudD0yNzI3NzUwMjgmcGFzc3dvcmQ9cXEyNzI3NzUwMjgnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcbiAgICAgICAgICAgICAgICB2YXIgc2NvZGUgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhzY29kZSk7XFxuICAgICAgICAgICAgICAgIGlmIChzY29kZS5zdGF0dXNDb2RlID09ICczMDInIHx8IHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gc2NvZGUuaGVhZGVycy5sb2NhdGlvblswXS5yZXBsYWNlKC9cXFxcXFxcXC9nLCAnJyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBodG1sID0gcmVxdWVzdChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBzY29kZS5ib2R5O1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoLzQwNCBOb3QgRm91bmR85aSH5qGI5ZCO5Y+v57un57ut6K6/6ZeufOS4jeWtmOWcqC8udGVzdChodG1sKSB8fCBodG1sID09ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFwidXJsXFxcXFxcXCJcXFxcOlxcXFxcXFwiaHR0cC8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gaHRtbC5tYXRjaCgvXFxcXFxcXCJ1cmxcXFxcXFxcIjpcXFxcXFxcIiguKj8pXFxcXFxcXCIvKVsxXS5yZXBsYWNlKC9cXFxcXFxcXC9nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuc3RhcnRzV2l0aCgneycpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHB1cmwgPSBzcmN1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlQ2FjaGUoJ2h0dHBzOi8vY29kZS5hbGl5dW4uY29tL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L21hc3Rlci94NXJ1bGUuanMnLCAyNCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZShzcmN1cmwsIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3g1V2ViVmlldzovLycrKHNyY3VybCkgXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIC8vbG9nKHB1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29ialxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcbiAgICAgICAgICAgICAgICB9O1xcblxcbiAgICA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ICAgICAgICAgaWYgKHRkb21pbi5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2ZhbnR1YW4vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWxJRD92b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZShrZXksICfigJzigJwnICsga2V5ICsgJ+KAneKAnScpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBwaWMgKyAnQFJlZmVyZXI9JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKHRkb21pbi5pbmRleE9mKFxcXCJtb2dhaV9hcGlcXFwiKSAhPSAtMSA/IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JyA6IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QG9raHR0cC80LjEuMH0nKS5ydWxlKCh0ZG9taW4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFNdKj86XFxcXC9cXFxcL1tcXFxcU10qPylcXFxcLy8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcL3ZvZFxcXFwvLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9hcHBt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7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JztcXG4gICAgICAgIH0gZWxzZSBpZiAoL2RpamlheGlhLy50ZXN0KG11cmwpKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSAnaHR0cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmw7XFxuICAgICAgICB9XFxuICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgdXJsOiAkKGxpbmspLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xcbiAgICAgICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFNdKj86XFxcXC9cXFxcL1tcXFxcU10qPylcXFxcLy8pWzFdO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvYXB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ZTY0Ly50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgdmFyIHJlbXYgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZShyZW1mLnNwbGl0KCdAJylbMl0pKS52ZXJzaW9uO1xcbiAgICAgICAgfSBlbHNlIGlmICgv77+laG9tZV9ydWxl77+lLy50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgdmFyIHJlbXYgPSBKU09OLnBhcnNlKHJlbWYuc3BsaXQoJ++/pWhvbWVfcnVsZe+/pScpWzFdKS52ZXJzaW9uO1xcbiAgICAgICAgfTtcXG4gICAgICAgIGlmICgv77+laG9tZV9ydWxlLy50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgbG9nKCfov5znqIvniYjmnKzvvJonICsgcmVtdik7XFxuICAgICAgICAgICAgbG9nKCfmnKzlnLDniYjmnKzvvJonICsgbG9jdmVyKTtcXG4gICAgICAgICAgICBpZiAobG9jdmVyICE9IHJlbXYpIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdhcHBudmVyJywgcmVtZik7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mnInmlrDniYjmnKzvvIzngrnlr7zlhaXmm7TmlrDlj6/mm7TmlrDop4TliJnjgIInO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mmoLml6DmlrDniYjmnKzvvIwyNOWwj+aXtuWGheajgOa1i+aXoOaViOOAgidcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5qOA5rWL5pu05paw5aSx6LSl77yM5Y+v6IO95LqR56uv5oq96aOO5LqG44CCJ1xcbiAgICAgICAgfVxcbiAgICB9LCBsb2N2ZXIpLFxcbiAgICBjb2xfdHlwZTogJ3RleHRfMidcXG59KT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uICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX2luZm8udm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHZhciBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV9saXN0O1xcbiAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoJyQkJCcpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGlmIChodG1sLnZpZGVvbGlzdCkge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC52aWRlb2xpc3RbY29udHNbaV1dO1xcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmxzKSB7XFxuICAgICAgICAgICAgdmFyIGxpc3QgPSBjb250c1tpXS51cmxzO1xcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmwpIHtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGNvbnRzW2ldLnVybC5zcGxpdChcXFwiI1xcXCIpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGNvbnRzW2ldLnNwbGl0KFxcXCIjXFxcIik7XFxuICAgICAgICB9XFxuICAgICAgICBjaHAucHVzaChsaXN0Lmxlbmd0aCk7XFxuICAgIH1cXG59IGNhdGNoIChlKSB7fVxcbi8vbG9nKE1hdGgubWF4LmFwcGx5KE1hdGgsY2hwKSk7XFxuc2V0UmVzdWx0KCfmm7TmlrDoh7M6JyArIChNYXRoLm1heC5hcHBseShNYXRoLCBjaHApKSk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLliIbnsbvmkJzntKJcIixcIn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ndGgpIHtcXG4gICAgICAgICAgICB2YXIgbGluayA9IGxpc3Rbal0udXJsO1xcbiAgICAgICAgICAgIHZhciBsaXRpdCA9IGxpc3Rbal0ubXVybDtcXG4gICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vaS50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgIGlmICgvMTlqeHwyOTN5c3x6aGFpa2FueXN8amlcXFxcLWRpbmdcXFxcLWhlfHBob2ViZXx5dW5ib1xcXFwuYnhpbnxsYW5yZW50a3xoZXRhb3lzfHB4dW58MTM5XFxcXC4xNTV8ZmtrZHl8MDU2MTU4fGFpeGl4aXxydW94aW5ld3xmZWlmYW4xMjN8c2lxaXR2Ly50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9hYz1saXN0JnptPScgKyBrZXkgKyAnJnBhZ2U9MSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9hYz1saXN0JndkPScgKyBrZXkgKyAnJnBhZ2U9MSc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoL2RpamlheGlhLy50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5rID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwLydcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgaWYgKGxpbmsuaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPTEmdGV4dD0nICsga2V5ICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmsuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz0xJnRleHQ9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvaW9wZW55dW4vLnRlc3QobGluaykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJy9saXN0P3BhZ2U9ZnlwYWdlJmxpbWl0PTEwJndkPScgKyBrZXk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP3BhZ2U9MSZsaW1pdD0xMCZ3ZD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vRGF0YS5wdXNoKHt1cmw6IGhtdXJsLG9wdGlvbnM6IHtoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiRGFydC8yLjE0IChkYXJ0OmlvKVxcXCJ9LHRpbWVvdXQ6IHRpbWVvdX19KTtcXG4gICAgICAgICAgICBEYXRhLnB1c2goe1xcbiAgICAgICAgICAgICAgICB1cmw6IGhtdXJsLFxcbiAgICAgICAgICAgICAgICBvcHRpb25zOiB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBsaW5rLmluZGV4T2YoXFxcIm1vZ2FpX2FwaVxcXCIpICE9IC0xID8gXFxcIkRhcnQvMi4xNCAoZGFydDppbylcXFwiIDogXFxcIm9raHR0cC80LjEuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiB0aW1lb3VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIFRpdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0OiBsaXN0W2pdLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBsaW5rOiBsaW5rLFxcbiAgICAgICAgICAgICAgICB0eXBubTogbGl0aXRcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gLy9pZlxcbiAgICB9IC8vZm9yIGpcXG59IGNhdGNoIChlKSB7fVxcbmlmIChEYXRhLmxlbmd0aCA8PSAwKSB7XFxuICAgIHNldFJlc3VsdChbXSk7XFxufSBlbHNlIHtcXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuato+WcqOWKoOi9veS4reesrFxcXCIgKyBNWV9QQUdFICsgXFxcIumhte+8jOi/m+W6pu+8mjEvXFxcIiArIERhdGEubGVuZ3RoLFxcbiAgICAgICAgdXJsOiBcXFwiXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBzZXRSZXN1bHQoaXRlbXMpO1xcbiAgICBsZXQgdGFza3MgPSBbXTtcXG5cXG4gICAgZm9yIChsZXQgayBpbiBEYXRhKSB7XFxuICAgICAgICBsZXQgaXQgPSBEYXRhW2tdO1xcbiAgICAgICAgdGFza3MucHVzaCh7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0pIHtcXG4gICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChwYXJhbS5pdC51cmwsIHBhcmFtLml0Lm9wdGlvbnMpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhodG1sKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBodG1sLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXHJcXFxcbicgPyBodG1sLnJlcGxhY2UoJ1xcXFxyXFxcXG4nLCAnJykgOiBodG1sO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICBpZiAoL2J0d2FmLy50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gZmV0Y2gocGFyYW0uaXQudXJsICsgJyZidHdhZicgKyBodG1sLm1hdGNoKC9idHdhZiguKj8pXFxcXFxcXCIvKVsxXSwge30pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChodG1sID09IFxcXCJcXFwiIHx8IGh0bWwgPT0gbnVsbCB8fCBodG1sLnN1YnN0cmluZygwLCA1KSA9PSAnZXJyb3InIHx8ICFodG1sLnN0YXJ0c1dpdGgoJ3snKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5sZW5ndGggPCA4MCkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBKU09OLnBhcnNlKGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZXQgPSBwYXJhbS50aXQudHlwbm07XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGRvbWluID0gcGFyYW0udGl0Lmxpbms7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5saXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZGF0YS5saXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmRhdGEubGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnBpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSBsaXN0W2ldLm5leHRsaW5rO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0uc3RhdGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGRvbWluLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvZmFudHVhbi8udGVzdCh0ZG9taW4pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJ3ZpZGVvX2RldGFpbD9pZD0nICsgbGlzdFtpXS52b2RfaWQgKyAnJnRva2VuPSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnR5cGUudHlwZV9kZXM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnR5cGUudHlwZV9kZXM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0udm9kX3BpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsSUQ/dm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS52b2RfcmVtYXJrcztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnN0YXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh2aWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IE1ZX1RZUEUgPT0gXFxcImhvbWVcXFwiID8gdGl0bGUucmVwbGFjZShrZXksICfigJzigJwnICsga2V5ICsgJ+KAneKAnScpICsgJ1xcXFxuJyArIHJlbSA6IHRpdGxlICsgcmVtLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogcGljICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodGRvbWluLmluZGV4T2YoXFxcIm1vZ2FpX2FwaVxcXCIpICE9IC0xID8gdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nIDogdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRAb2todHRwLzQuMS4wfScpLnJ1bGUoKHRkb21pbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnMjU1JiZmbG9hdCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxTXSo/OlxcXFwvXFxcXC9bXFxcXFNdKj8pXFxcXC8vKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcG1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGRvbWluKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29udGVudDogcmVtLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogdHl0aXQgKyAnID0+ICcgKyBwYXJhbS50aXQudGl0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSAvL2ZvciBpXFxuICAgICAgICAgICAgICAgICAgICB9IC8vaWYgbGlzdC5sZW5ndGhcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBpdDogaXQsXFxuICAgICAgICAgICAgICAgIHRpdDogVGl0W2tdXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBpZDogXFxcInRhc2tcXFwiXFxuICAgICAgICB9KVxcbiAgICB9XFxuXFxuICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgLy9sb2coXFxcImxpc3RlbmVyOiBcXFwiICsgKHJlc3VsdCB8fCBbXSkubGVuZ3RoKVxcbiAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmpcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5q2j5Zyo5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG177yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICBhbGw6IERhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIGk6IDAsXFxuICAgICAgICAgICAgajogLTFcXG4gICAgICAgIH1cXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmlbDmja7ovazmjaJcIixcInBhdGhcIjpcImNvbnZlclwiLFwicnVsZVwiOlwiLy9qczpcXG4vL3JlbShyZXMpO1xcbnZhciDorrDlvZUgPSBbXTtcXG52YXIg6L6T5YWl5p2h55uuID0gcmVtZmlsZS5tYXRjaCgvLis9aHR0cC4rL2cpO1xcbmZvciAodmFyIGogaW4g6L6T5YWl5p2h55uuKSB7XFxuICAgIHZhciB0aXRsZSA9IOi+k+WFpeadoeebrltqXS5zcGxpdCgnQCcpWzFdLnNwbGl0KCc9JylbMF07XFxuICAgIHZhciB1cmwgPSDovpPlhaXmnaHnm65bal0uc3BsaXQoJz0nKVsxXS5zcGxpdCgnIycpWzBdO1xcbiAgICB2YXIgaW1nID0g6L6T5YWl5p2h55uuW2pdLnNwbGl0KCcjJylbMV07XFxuICAgIGlmIChpbWcuaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xKSB7XFxuICAgICAgICB2YXIgaW1nID0gaW1nO1xcbiAgICB9IGVsc2UgaWYgKGltZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgdmFyIGltZyA9IFxcXCJodHRwczovL2lubWVtb3J5LmNvZGluZy5uZXQvcC9Jbk1lbW9yeS9kL01Ccm93c2VyL2dpdC9yYXcvbWFzdGVyL0FwcEZpbGUvQXBwSWNvbi/pgJrnlKjlm77moIcucG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XRsZTogdGl0bGUsXFxuICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgbXVybDogbXVybCxcXG4gICAgICAgIHR5cGU6IHR5cGVcXG4gICAgfSk7XFxufVxcbi8vaWYgKF8ucmVhZChmaWxlbmFtZSkpIHtcXG4vL3ZhciDmlrDorrDlvZUgPSBKU09OLnBhcnNlKF8ucmVhZChmaWxlbmFtZSkpO1xcbi8vfSBlbHNlIHtcXG52YXIg5paw6K6w5b2VID0gW107XFxuLy99XFxuZm9yICh2YXIgaSBpbiDorrDlvZUpIHtcXG4gICAgdmFyIOW9k+WJjeadoeebriA9IFtdO1xcbiAgICDlvZPliY3mnaHnm64ucHVzaCjorrDlvZVbaV0pO1xcbiAgICBpZiAo5paw6K6w5b2VLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICDmlrDorrDlvZUucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IOiusOW9lVtpXS50eXBlLFxcbiAgICAgICAgICAgIGxpc3Q6IOW9k+WJjeadoeebrlxcbiAgICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgIGxldCByZXMgPSDmlrDorrDlvZUuc29tZShpdGVtID0+IHtcXG4gICAgICAgIC8v5Yik5pat57G75Z6L77yM5pyJ5bCx5re75Yqg5Yiw5b2T5YmN6aG5XFxuICAgICAgICBpZiAoaXRlbS50aXRsZSA9PSDorrDlvZVbaV0udHlwZSkge1xcbiAgICAgICAgICAgIGl0ZW0ubGlzdCA9IOW9k+WJjeadoeebri5jb25jYXQoaXRlbS5saXN0LmZpbHRlcihkID0+IGQudXJsICE9IOiusOW9lVtpXS51cmwpKTtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgaWYgKCFyZXMpIHtcXG4gICAgICAgIC8v5aaC5p6c5rKh5om+55u45ZCM57G75Z6L5re75Yqg5LiA5Liq57G75Z6LXFxuICAgICAgICDmlrD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J+eUteW9sSbov57nu63liacm57u86Im6JuWKqOa8qycpLnNwbGl0KCcmJyk7XFxuICAgICAgICAvL3ZhciB0eXBsID0gKCdtb3ZpZSZ0dnBsYXkmdHZzaG93JmNvbWljJykuc3BsaXQoJyYnKTtcXG4gICAgICAgIHZhciB0eXBsID0gT2JqZWN0LmtleXMoSlNPTi5wYXJzZShmZXRjaChtdXJsICsgJz9hYz1mbGl0dGVyJywge30pKSk7XFxuXFxuICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHR5cGwubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICB2YXIgdHl1cmwgPSBtdXJsICsgJz9hYz1saXN0JmNsYXNzPScgKyB0eXBsW2ldICsgJyZwYWdlPWZ5cGFnZSZhcmVhPSZ0eXBlPSZzdGFydD0nO1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdHlwbFtpXSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKHR5dXJsKS5ydWxlKChtdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBtdXJsID0gbXVybDtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdHZsaXN0ZGF0YScsIHt9KSkucnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SG9tZVJlc3VsdChyZXMpO1xcbiAgICAgICAgICAgICAgICB9LCBtdXJsKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSk7XFxuICAgIH1cXG5cXG4gICAgdHJ5IHtcXG4gICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShmZXRjaCh0dXJsKSk7XFxuICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dmxpc3RkYXRhJywge30pKS5ydWxlKTtcXG4gICAgfSBjYXRjaCAoZSkge31cXG59IGVsc2Uge1xcbiAgICBpZiAoL2RpamlheGlhLy50ZXN0KG11cmwpKSB7XFxuICAgICAgICBtdXJsID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwLydcXG4gICAgfVxcbiAgICB0cnkge1xcbiAgICAgICAgaWYgKG11cmwuc2VhcmNoKC9hcGkucGhwXFxcXC9hcHAvKSAhPSAtMSkge1xcblxcbiAgICAgICAgICAgIHZhciB0eXBjb2RlID0gcmVxdWVzdChtdXJsICsgXFxcIm5hdj90b2tlbj1cXFwiLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIkRhcnQvMi4xNCAoZGFydDppbylcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBpZiAodHlwY29kZS5pbmRleE9mKCfmo4DmtYvkuK0nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICB0eXBjb2RlID0gZmV0Y2gobXVybCArIFxcXCJuYXY/dG9rZW49XFxcIiArICcmYnR3YWYnICsgdHlwY29kZS5tYXRjaCgvYnR3YWYoLio/KVxcXFxcXFwiLylbMV0sIHt9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdmFyIHR5cGVjID0gSlNPTi5wYXJzZSh0eXBjb2RlKS5saXN0O1xcblxcbiAgICAgICAgfSBlbHNlIGlmIChtdXJsLnNlYXJjaCgveGdhcHAucGhwXFxcXC92MS8pICE9IC0xKSB7XFxuXFxuICAgICAgICAgICAgdmFyIHR5cGNvZGUgPSByZXF1ZXN0KG11cmwgKyBcXFwibmF2P3Rva2VuPVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiRGFydC8yLjE0IChkYXJ0OmlvKVxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmICh0eXBjb2RlLmluZGV4T2YoJ+ajgOa1i+S4rScpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgIHR5cGNvZGUgPSBmZXRjaChtdXJsICsgXFxcIm5hdj90b2tlbj1cXFwiICsgJyZidHdhZicgKyB0eXBjb2RlLm1hdGNoKC9idHdhZiguKj8pXFxcXFxcXCIvKVsxXSwge30pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgdHlwZWMgPSBKU09OLnBhcnNlKHR5cGNvZGUpLmRhdGE7XFxuXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmIChtdXJsLnNlYXJjaCgvbW9nYWlfYXBpLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHR5cGNvZGUgPSByZXF1ZXN0KG11cmwgKyBcXFwiL3R5cGVzXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIkRhcnQvMi4xNCAoZGFydDppbylcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB0eXBjb2RlID0gcmVxdWVzdChtdXJsICsgXFxcIi90eXBlc1xcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IFxcXCJva2h0dHAvNC4xLjBcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodHlwY29kZS5pbmRleE9mKCfmo4DmtYvkuK0nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICB0eXBjb2RlID0gZmV0Y2gobXVybCArIFxcXCIvdHlwZXNcXFwiICsgJz9idHdhZicgKyB0eXBjb2RlLm1hdGNoKC9idHdhZiguKj8pXFxcXFxcXCIvKVsxXSwge30pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgdHlwZWMgPSBKU09OLnBhcnNlKHR5cGNvZGUpLmRhdGEubGlzdDtcXG5cXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB0eXBldCA9IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIHR5cGVsID0gXFxcIlxcXCI7XFxuICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHR5cGVjLmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgdHlwZXQgKz0gdHlwZWNbal0udHlwZV9uYW1lO1xcbiAgICAgICAgICAgIHR5cGVsICs9IHR5cGVjW2pdLnR5cGVfaWQ7XFxuICAgICAgICAgICAgaWYgKGogPCB0eXBlYy5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgICAgIHR5cGV0ICs9IFxcXCImXFxcIjtcXG4gICAgICAgICAgICAgICAgdHlwZWwgKz0gXFxcIiZcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB0eXB0ID0gdHlwZXQuc3BsaXQoJyYnKT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G11cmwgPSBtdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlc2NvZGUgPSBnZXRSZXNDb2RlKCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzY29kZS5pbmRleE9mKCfmo4DmtYvkuK0nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc2NvZGUgPSBmZXRjaChNWV9VUkwgKyAnJmJ0d2FmJyArIHJlc2NvZGUubWF0Y2goL2J0d2FmKC4qPylcXFxcXFxcIi8pWzFdLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UocmVzY29kZSk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9hcHBsaXN0ZGF0YScsIHt9KSkucnVsZSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SG9tZVJlc3VsdChyZXMpO1xcbiAgICAgICAgICAgICAgICB9LCBtdXJsKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSk7XFxuICAgIH0gY2F0Y2ggKGUpIHt9XFxuXFxuXFxuICAgIHRyeSB7XFxuICAgICAgICBpZiAobXVybC5zZWFyY2goL21vZ2FpX2FwaS8pICE9IC0xKSB7XFxuICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KHR1cmwsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiRGFydC8yLjE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pIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoLzE5anh8MjkzeXN8emhhaWthbnlzfGppXFxcXFxcXFwtZGluZ1xcXFxcXFxcLWhlfHBob2ViZXx5dW5ib1xcXFxcXFxcLmJ4aW58bGFucmVudGt8aGV0YW95c3xweHVufDEzOVxcXFxcXFxcLjE1NXxma2tkeXwwNTYxNTh8YWl4aXhpfHJ1b3hpbmV3fGZlaWZhbjEyM3xzaXFpdHYvLnRlc3QobGluaykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/YWM9bGlzdCZ6bT0nICsga2V5ICsgJyZwYWdlPWZ5cGFnZSc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/YWM9bGlzdCZ3ZD0nICsga2V5ICsgJyZwYWdlPWZ5cGFnZSc7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoL2RpamlheGlhLy50ZXN0KGxpbmspKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmsgPSAnaHR0cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvJ1xcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgaWYgKGxpbmsuaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICdzZWFyY2g/cGc9ZnlwYWdlJnRleHQ9JyArIGtleSArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmsuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPWZ5cGFnZSZ0ZXh0PScgKyBrZXk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9pb3Blbnl1bi8udGVzdChsaW5rKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICcvbGlzdD9wYWdlPWZ5cGFnZSZsaW1pdD0xMCZ3ZD0nICsga2V5O1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBsaXN0W2pdLnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgIGltZzogbGlzdFtqXS5pbWcsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I3gjJyArIGhtdXJsICsgJyN4IycgKyBsaW5rICsgJyN4IycgKyBsaXRpdCArICcjeCMnICsga2V5ICsgJyN4IycpLnJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9zZWFyZXJqJyk7XFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdpY29uX3JvdW5kX3NtYWxsXzQnXFxcXG4gICAgICAgICAgICAgICAgLy9jb2xfdHlwZTogJ3RleHRfMydcXFxcbiAgICAgICAgICAgICAgICAvL2xpbms6bGluayxcXFxcbiAgICAgICAgICAgICAgICAvL3R5cGU6IGlcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuXFxcXG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lzdFtpXS5zdGF0ZTtcXFxcbiAgICB1cmwgPSB1cmwuc3RhcnRzV2l0aCgnaHR0cCcpID8gdXJsIDogbXVybCArICc/YWM9ZGV0YWlsJmlkcz0nICsgdXJsO1xcXFxuICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgIHBpY191cmw6IGltZyArICdAUmVmZXJlcj0nLFxcXFxuICAgICAgICB1cmw6ICQodXJsKS5ydWxlKCgpID0+IHtcXFxcbiAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXFxcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcXFxuICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxcXG4gICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFxcXFxTXSo/OlxcXFxcXFxcL1xcXFxcXFxcL1tcXFxcXFxcXFNdKj8pXFxcXFxcXFwvLylbMV07XFxcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxcXG4gICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJycsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdHZtb3ZsaXN0Jywge30pKS5ydWxlKTtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG4gICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xcXFxuICAgICAgICA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5tYXRjaCgveW91a3V8bWd0dnxpeGlndWF8cXEuY29tfHFpeWl8bWlndXxiaWxpYmlsaXxzb2h1fHBwdHZ8bGV8MTkwNS5jb20vKSAmJiByZXN1cmwuc2VhcmNoKC9odG1sfGJpbGliaWxpfGl4aWd1YS8pICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2h0bWznvZHpobXosIPnlKjmlq3mj5Lop6PmnpBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFxcXFxcInZhciBjb25maWcgPVxcXFxcXFwiICsgZmV0Y2goXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXFxcXFwiKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKHJlc3VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFxcLm0zdTh8XFxcXFxcXFwubXA0fG9ialxcXFxcXFxcL3Rvc3xuZXRlYXNlXFxcXFxcXFwuY29tLy50ZXN0KHJlc3VybCkgJiYgL2h0dHAvLnRlc3QocmVzdXJsKSAmJiAhL1xcXFxcXFxcLmh0bWwvLnRlc3QocmVzdXJsKSAmJiAhL1xcXFxcXFxcPWh0dHAvLnRlc3QocmVzdXJsKSAmJiBwdGFiICE9ICdkdW9kdW96eScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvd2tmaWxlLy50ZXN0KHJlc3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsICsgJzt7UmVmZXJlckBodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS99J1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gL1xcXFxcXFxcPS8udGVzdChyZXN1cmwpID8gcmVzdXJsLnNwbGl0KCc9JylbMV0gOiByZXN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/osIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXFxcXFxcXG4nICsgcHRhYiArICco6YCa55So5Ye95pWwKScpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcXFxcXCJ2YXIgY29uZmlnID1cXFxcXFxcIiArIGZldGNoKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG5hbWUgPSBwdGFiICsgJyjpgJrnlKjlh73mlbApJztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFyc2VTW25hbWVdKHJlc3VybCwgbXl1cmwpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB0YWIgPT0gJ2R1b2R1b3p5Jykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBEZSh3b3JkKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBhID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UobWQ1KCdyWGpXdlhsNicpKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKCdOWGJIb1dKYnBzRU9pbjhiJylcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIENyeXB0b0pTLkFFUy5kZWNyeXB0KHdvcmQsIGEsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl2OiB0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBkZHp5ID0gJ2FkSHVSbzBkY3VIb00xNjNMMXk0JyArIGJhc2U2NEVuY29kZShzcmN1cmwpLnNsaWNlKDEwKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2h0dHBzOi8vYm8uZGQ1MjAuY2MveHBsYXkvYXBpLnBocFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9iby5kZDUyMC5jYy94bXBsYXllci9hcGkucGhwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkZHd5ID0gZmV0Y2goJ2h0dHBzOi8vamhwYy5tYW5kdWh1LmNvbS9kdW9kdW8vYXBpLnBocCcsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IE1PQklMRV9VQVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiAndXJsPScgKyByZXN1cmwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coZGR3eSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIERlKEpTT04ucGFyc2UoZGR3eSkudXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL21pYW9wYXJ0eS8udGVzdChwdGFiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9jb2RlLmFsaXl1bi5jb20vbHprMjM1NTkvUHVibGljUnVsZS9yYXcvbWFzdGVyL3g1cnVsZS5qcycsIDI0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geDVydWxlKCdodHRwczovL3d3dy5mdW40ay5jb20vYXBsYXllci8/dXJsPScgKyByZXN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICBcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnICYmIHZsaW5rLm1hdGNoKC95b3VrdXxtZ3R2fGl4aWd1YXxxcS5jb218cWl5aXxtaWd1fGJpbGliaWxpfHNvaHV8cHB0dnxsZXwxOTA1LmNvbS8pICYmIHZsaW5rLnNlYXJjaCgvaHRtbHxiaWxpYmlsaXxpeGlndWEvKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCflt7LlvIDlkK/mlq3mj5LvvIzlsIbosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXFxcXFwidmFyIGNvbmZpZyA9XFxcXFxcXCIgKyBmZXRjaChcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKHZsaW5rKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgICAgIHZhciBzcmN1cmwgPSBsaW5rO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxcXG4gICAgICAgICAgICAgICAgLy/liqjmgIHop6PmnpDku6PnoIHlvIDlp4tcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAvL+WkhOeQhuaMh+WumuinhumikeS4jue6v+i3r1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcLm0zdTh8XFxcXFxcXFwubXA0fG9ialxcXFxcXFxcL3Rvc3xuZXRlYXNlXFxcXFxcXFwuY29tLy50ZXN0KHNyY3VybCkgJiYgL2h0dHAvLnRlc3Qoc3JjdXJsKSAmJiAhL1xcXFxcXFxcLmh0bWwvLnRlc3Qoc3JjdXJsKSAmJiAhL1xcXFxcXFxcPWh0dHAvLnRlc3Qoc3JjdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC93a2ZpbGUvLnRlc3Qoc3JjdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcmN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAvXFxcXFxcXFw9Ly50ZXN0KHNyY3VybCkgPyBzcmN1cmwuc3BsaXQoJz0nKVsxXSA6IHNyY3VybCArICcjaXNWaWRlbz10cnVlIyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3JjdXJsLmluZGV4T2YoXFxcXFxcXCIvc2hhcmUvXFxcXFxcXCIpICE9IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXFxcXFwiL3NoYXJlXFxcXFxcXCIpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmYyA9IGZldGNoKHNyY3VybCwge30pLnJlcGxhY2UoXFxcXFxcXCJ2YXIgcHVybFxcXFxcXFwiLCBcXFxcXFxcInZhciBtYWluXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYy5pbmRleE9mKFxcXFxcXFwibWFpblxcXFxcXFwiKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWF0ID0gZmMubWF0Y2goL3ZhciBtYWluLio/Oy8pWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKG1hdCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFxcXFxcImh0dHBcXFxcXFxcIikgIT0gLTEgPyBtYWluIDogbGluayArIG1haW4pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYWluID0gZmMubWF0Y2goL3VybDouKj9bXFxcXFxcXFwnXFxcXFxcXFxcXFxcXFxcIl0oLio/KVtcXFxcXFxcXCdcXFxcXFxcXFxcXFxcXFwiXS8pWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGxheSA9IChtYWluLmluZGV4T2YoXFxcXFxcXCJodHRwXFxcXFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC85ODN2aXAvLnRlc3Qoc3JjdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UoZmV0Y2goc3JjdXJsLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogTU9CSUxFX1VBXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5oZWFkZXJzLmxvY2F0aW9uWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC94XFxcXFxcXFwtblxcXFxcXFxcLmNjfG5oZHo2NjYvLnRlc3Qoc3JjdXJsKSAmJiAvXFxcXFxcXFwuaHRtbHxiaWxpYmlsaS8udGVzdChzcmN1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCh2bGluayk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgLy/lpITnkIbmjIflrprop4bpopHlkoznur/ot6/nu5PmnZ9cXFxcbiAgICAgICAgICAgICAgICAgICAgLy8tLS0t5YiG5Ymy57q/LS0tLS8vXFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBzY29kZSA9IEpTT04ucGFyc2UoZmV0Y2goc3JjdXJsLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IFxcXFxcXFwib2todHRwLzQuMS4wXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgICAgICB9KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKHNjb2RlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMicgfHwgc2NvZGUuc3RhdHVzQ29kZSA9PSAnMzAxJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/miZPlvIDop6PmnpDmnIkzMDLph43lrprlkJHnmoTpk77mjqVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZWR1cmwgPSBzY29kZS5oZWFkZXJzLmxvY2F0aW9uWzBdLnJlcGxhY2UoL1xcXFxcXFxcXFxcXFxcXFwvZywgJycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL2h0bWx8YmlsaWJpbGl8a2V5XFxcXFxcXFw9Ly50ZXN0KHJlZHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXFxcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9cXFxcXFxcXC5tM3U4fFxcXFxcXFxcLm1wNHxcXFxcXFxcXC5mbHYvLnRlc3QocmVkdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWR1cmwuc3Vic3RyaW5nKHJlZHVybC5pbmRleE9mKCc9aHR0cCcpICsgMSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9odHRwLy50ZXN0KHJlZHVybCkgJiYgL2tleVxcXFxcXFxcPXx1aWRcXFxcXFxcXD0vLnRlc3QocmVkdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHJlZHVybCwge30pKS51cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWR1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGh0bWwgPSByZXF1ZXN0KHNyY3VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IHNjb2RlLmJvZHk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhodG1sKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl64vLnRlc3QoaHRtbCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCh2bGluayk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcXFxcXDxib2R5Ly50ZXN0KGh0bWwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCflsJ3or5XpnZ5KU09O5o6l5Y+j572R6aG16Kej5p6QJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZUNhY2hlKCdodHRwczovL2NvZGUuYWxpeXVuLmNvbS9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9tYXN0ZXIveDVydWxlLmpzJywgMjQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB4NXJ1bGUoc3JjdXJsLCBzcmN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmV0dXJuIG9wZW51cmwoc3JjdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9qc29u6Kej5p6Q55qE5Y+W6ZO+5o6lXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBodG1sLm1hdGNoKC9bXFxcXFxcXFwnXFxcXFxcXFxcXFxcXFxcIl11cmxbXFxcXFxcXFwnXFxcXFxcXFxcXFxcXFxcIl06Lio/W1xcXFxcXFxcJ1xcXFxcXFxcXFxcXFxcXCJdKC4qPylbXFxcXFxcXFwnXFxcXFxcXFxcXFxcXFxcIl0vKVsxXS5yZXBsYWNlKC9cXFxcXFxcXFxcXFxcXFxcL2csICcnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhwdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2h0dHAvLnRlc3QocHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gJ2JpbGliaWxpJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vd3d3LmJpbGliaWxpLmNvbS8mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdtZ3R2Jykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvb2piay8udGVzdChwdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vYmFrLm9qYmtqeC5jb20vfSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdW5lc2NhcGUocHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL+mdnmh0dHDlvIDlpLTnmoTmiZPlvIDljp/pk77mjqUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHZsaW5rKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy/miqXplJnliKTmlq3lpITnkIZcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfmiafooYzmiqXplJnot7PovazlpITnkIYnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLyppZiAoc3JjdXJsLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXFxcXFwvXFxcXFxcXFwvJykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoJ2h0dHBzOicgKyBzcmN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcXFxcXD1odHRwLy50ZXN0KHNyY3VybCkgJiYgL1xcXFxcXFxcLmh0bWx8YmlsaWJpbGkvLnRlc3Qoc3JjdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gc3JjdXJsLnNwbGl0KCc9JylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHZsaW5rKVxcXFxuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAneDVXZWJWaWV3Oi8vJytzcmN1cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgLy99XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB57uT5p2fXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgcHRhYixcXFxcbiAgICAgICAgICAgIGxpbmssXFxcXG4gICAgICAgICAgICBteXVybCxcXFxcbiAgICAgICAgICAgIHZsaW5rKSxcXFxcbiAgICAgICAgY29sX3R5cGU6IGNsdFxcXFxuICAgIH0pO1xcXFxufVxcXFxuLy99XFxcIn0se1xcXCJjb2xfdHlwZVxcXCI6XFxcIm1vdmllXzNcXFwiLFxcXCJuYW1lXFxcIjpcXFwiVFbnroDku4vkuI7pgInpm4ZcXFwiLFxcXCJwYXRoXFxcIjpcXFwidHZtb3ZsaXN0XFxcIixcXFwicnVsZVxcXCI6XFxcInZhciB0YWJzID0gT2JqZWN0LmtleXMoaHRtbC52aWRlb2xpc3QpO1xcXFxudmFyIHRodW1iID0gaHRtbC5pbWdfdXJsO1xcXFxuaXRlbXMucHVzaCh7XFxcXG4gICAgdGl0bGU6ICfliafmg4XnroDku4vvvJonLFxcXFxuICAgIGRlc2M6IGh0bWwuaW50cm8sXFxcXG4gICAgcGljX3VybDogdGh1bWIsXFxcXG4gICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMnKS5ydWxlKChkZXMpID0+IHtcXFxcbiAgICAgICAgc2V0UmVzdWx0KFt7XFxcXG4gICAgICAgICAgICB0aXRsZTogZGVzLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsb25nX3RleHQnXFxcXG4gICAgICAgIH1dKTtcXFxcbiAgICB9LCBodG1sLmludHJvKSxcXFxcbiAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJ1xcXFxufSk7XFxcXG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9kbn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pdGxlLFxcXFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknKS5sYXp5UnVsZSgocHRhYiwgc3JjdXJsLCBteXVybCkgPT4ge1xcXFxuICAgICAgICAgICAgZnVuY3Rpb24gb3BlbnVybChyZXN1cmwpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAocmVzdXJsLm1hdGNoKC95b3VrdXxtZ3R2fGl4aWd1YXxxcS5jb218cWl5aXxtaWd1fGJpbGliaWxpfHNvaHV8cHB0dnxsZXwxOTA1LmNvbS8pICYmIHJlc3VybC5zZWFyY2goL2h0bWx8YmlsaWJpbGkvKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+iwg+eUqOaWreaPkuino+aekCcpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFxcXFxcInZhciBjb25maWcgPVxcXFxcXFwiICsgZmV0Y2goXFxcXFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXFxcXFwiKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShyZXN1cmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VybFxcXFxuICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFxcPUxUXFxcXFxcXFwtLy50ZXN0KHJlc3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5JsdG5i6YCa55So6Kej5p6QJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcXFxcXCJ2YXIgY29uZmlnID1cXFxcXFxcIiArIGZldGNoKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbmFtZSA9ICdsdG5iKOmAmueUqOWHveaVsCknO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFyc2VTW25hbWVdKHJlc3VybC5zdWJzdHJpbmcocmVzdXJsLmluZGV4T2YoJz1MVC0nKSArIDEpKTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIFxcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXFxcbiAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScgJiYgc3JjdXJsLm1hdGNoKC95b3VrdXxtZ3R2fGl4aWd1YXxxcS5jb218cWl5aXxtaWd1fGJpbGliaWxpfHNvaHV8cHB0dnxsZXwxOTA1LmNvbS8pICYmIHNyY3VybC5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcXFxcXCJ2YXIgY29uZmlnID1cXFxcXFxcIiArIGZldGNoKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFxcXFxcIikpO1xcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXl0bVBhcnNlKHNyY3VybC5zdWJzdHJpbmcoc3JjdXJsLmluZGV4T2YoJz1odHRwJykgKyAxKSk7XFxcXG4gICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG4gICAgICAgICAgICBcXFxcbiAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxcXG4gICAgICAgICAgICAvL+WKqOaAgeino+aekOS7o+eggeW8gOWni1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcLm0zdTh8XFxcXFxcXFwubXA0fG9ialxcXFxcXFxcL3Rvcy8udGVzdChzcmN1cmwpICYmIC9odHRwLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcXFxcXD0vLnRlc3Qoc3JjdXJsKSA/IHNyY3VybC5zcGxpdCgnPScpWzFdIDogc3JjdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNyY3VybC5pbmRleE9mKFxcXFxcXFwiL3NoYXJlL1xcXFxcXFwiKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpbmsgPSBzcmN1cmwuc3BsaXQoXFxcXFxcXCIvc2hhcmVcXFxcXFxcIilbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmMgPSBmZXRjaChzcmN1cmwsIHt9KS5yZXBsYWNlKFxcXFxcXFwidmFyIHB1cmxcXFxcXFxcIiwgXFxcXFxcXCJ2YXIgbWFpblxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYy5pbmRleE9mKFxcXFxcXFwibWFpblxcXFxcXFwiKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYXQgPSBmYy5tYXRjaCgvdmFyIG1haW4uKj87LylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChtYXQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFxcXFxcImh0dHBcXFxcXFxcIikgIT0gLTEgPyBtYWluIDogbGluayArIG1haW4pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbWFpbiA9IGZjLm1hdGNoKC91cmw6Lio/W1xcXFxcXFxcJ1xcXFxcXFxcXFxcXFxcXCJdKC4qPylbXFxcXFxcXFwnXFxcXFxcXFxcXFxcXFxcIl0vKVsxXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGxheSA9IChtYWluLmluZGV4T2YoXFxcXFxcXCJodHRwXFxcXFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5O1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3g1V2ViVmlldzovLycgKyAoc3JjdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdhbGl6eScpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBmZXRjaCgnaHR0cHM6Ly9mb3ViaW4uY29tL2ppZXhpLnBocD91cmw9JyArIHNyY3VybCwge30pLm1hdGNoKC9cXFxcXFxcXFxcXFxcXFwidXJsXFxcXFxcXFxcXFxcXFxcIjpcXFxcXFxcXFxcXFxcXFwiKC4qPylcXFxcXFxcXFxcXFxcXFwiLylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoLzE5anhcXFxcXFxcXC52aXB8bmZ5aW5nc2hpLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybC5yZXBsYWNlKCdodHRwOi8vJywgJ2h0dHBzOi8vJyksIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogTU9CSUxFX1VBXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvdGl0YW4ubWd0di8udGVzdChwdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvb2JqXFxcXFxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcXFxuICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAvKmVsc2UgaWYgKC96aGFpa2FueXMvLnRlc3Qoc3JjdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybCArICcmYXBwPTEwMDAzJmFjY291bnQ9MjcyNzc1MDI4JnBhc3N3b3JkPXFxMjcyNzc1MDI4Jywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IE1PQklMRV9VQVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvdGl0YW4ubWd0di8udGVzdChwdXJsKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcXFxcXC90b3MvLnRlc3QocHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXFxcblxcXFxuICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcXFxuICAgICAgICAgICAgICAgIHZhciBzY29kZSA9IEpTT04ucGFyc2UoZmV0Y2goc3JjdXJsLCB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBNT0JJTEVfVUFcXFxcbiAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcXFxuICAgICAgICAgICAgICAgIH0pKTtcXFxcbiAgICAgICAgICAgICAgICAvL2xv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gICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5zdGFydHNXaXRoKCd7JykpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgcHVybCA9IHNyY3VybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZUNhY2hlKCdodHRwczovL2NvZGUuYWxpeXVuLmNvbS9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9tYXN0ZXIveDVydWxlLmpzJywgMjQpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZShzcmN1cmwsIHNyY3VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAneDVXZWJWaWV3Oi8vJysoc3JjdXJsKSBcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgLy9sb2cocHVybCk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKC90aXRhbi5tZ3R2Ly50ZXN0KHB1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvb2JqXFxcXFxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcXFxuICAgICAgICAgICAgICAgIH07XFxcXG5cXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICBpZiAoc3JjdXJsLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXFxcXFwvXFxcXFxcXFwvJykge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCgnaHR0cHM6JyArIHNyY3VybCk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvXFxcXFxcXFw9aHR0cC8udGVzdChzcmN1cmwpICYmIC9cXFxcXFxcXC5odG1sfGJpbGliaWxpLy50ZXN0KHNyY3VybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gc3JjdXJsLnNwbGl0KCc9JylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBvcGVudXJsKHNyY3VybC5zdWJzdHJpbmcoc3JjdXJsLmluZGV4T2YoJz1odHRwJykgKyAxKSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB57uT5p2fXFxcXG4gICAgICAgIH0sIHB0YWIsIHNyY3VybCwgbXl1cmwpLFxcXFxuICAgICAgICBjb2xfdHlwZTogY2x0XFxcXG4gICAgfSk7XFxcXG59XFxcXG4vL31cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLliJfooajmqKHlvI/mkJzntKLkuoznuqdcXFwiLFxcXCJwYXRoXFxcIjpcXFwic2VhcmVyalxcXCIsXFxcInJ1bGVcXFwiOlxcXCJ2YXIgcmVzID0ge307XFxcXG52YXIgaXRlbXM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Ly8udGVzdCh0ZG9taW4pKSB7XFxcXG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS50aXRsZTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS5waWM7XFxcXG4gICAgICAgICAgICAgICAgLy92YXIgdmlkPXRkb21pbisnL2RldGFpbD92b2RfaWQ9JytsaXN0W2ldLm5leHRsaW5rKycmcmVsX2xpbWl0PTEwJztcXFxcbiAgICAgICAgICAgICAgICB2YXIgdmlkID0gbGlzdFtpXS5uZXh0bGluaztcXFxcbiAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS5zdGF0ZTtcXFxcbiAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS5zdGF0ZTtcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHRkb21pbi5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2ZhbnR1YW4vLnRlc3QodGRvbWluKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9ICdodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS9hcGkucGhwL2FwcC92aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGRvbWluLmluZGV4T2YoJ3hnYXBwLnBocC92MS8nKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJ3ZpZGVvX2RldGFpbD9pZD0nICsgbGlzdFtpXS52b2RfaWQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvaW9wZW55dW4vLnRlc3QodGRvbWluKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsSUQ/dm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSB0ZG9taW4gKyAnL2RldGFpbD9rZXk9JyArIGRhdGVTdHIgKyAnJnZvZF9pZD0nICsgbGlzdFtpXS52b2RfaWQgKyAnJnRva2VuPSc7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnR5cGUudHlwZV9kZXM7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZShrZXksICfigJzigJwnICsga2V5ICsgJ+KAneKAnScpLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IHBpYyArICdAUmVmZXJlcj0nLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCh0ZG9taW4uaW5kZXhPZihcXFxcXFxcIm1vZ2FpX2FwaVxcXFxcXFwiKSAhPSAtMSA/IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JyA6IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QG9raHR0cC80LjEuMH0nKS5ydWxlKCh0ZG9taW4pID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHt9O1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoWDVXZWJWaWV3KCcnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxcXFxcU10qPzpcXFxcXFxcXC9cXFxcXFxcXC9bXFxcXFxcXFxTXSo/KVxcXFxcXFxcLy8pWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFxcXFxcL3ZvZFxcXFxcXFxcLy8udGVzdCh0ZG9taW4pKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvYXBwbW92bGlzdCcsIHt9KSkucnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgcmVzLmRhdGEgPSBpdGVtcztcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0SG9tZVJlc3VsdChyZXMpO1xcXFxuICAgICAgICAgICAgICAgIH0sIHRkb21pbiksXFxcXG4gICAgICAgICAgICAgICAgLy9jb250ZW50OnJlbSxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiByZW0sXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYydcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IC8vZm9yIGlcXFxcbiAgICB9IC8vZWxzZSBsaXN0Lm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ocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmw7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpbWcgKyAnQFJlZmVyZXI9JyxcXFxcbiAgICAgICAgICAgIHVybDogJChsaW5rKS5ydWxlKCgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxcXG4gICAgICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICcnLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g1X3dlYnZpZXdfc2luZ2xlJ1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hYNVdlYlZpZXcoJycpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xcXFxuICAgICAgICAgICAgICAgIHZhciBteXVybCA9IE1ZX1VSTC5tYXRjaCgvKFtcXFxcXFxcXFNdKj86XFxcXFxcXFwvXFxcXFxcXFwvW1xcXFxcXFxcU10qPylcXFxcXFxcXC8vKVsxXTtcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9hcHBtb3ZsaXN0Jywge30pKS5ydWxlKTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIHJlcy5kYXRhID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vob21lX3J1bGXvv6UvLnRlc3QocmVtZikpIHtcXFxcbiAgICAgICAgICAgIHZhciByZW12ID0gSlNPTi5wYXJzZShyZW1mLnNwbGl0KCfvv6Vob21lX3J1bGXvv6UnKVsxXSkudmVyc2lvbjtcXFxcbiAgICAgICAgfTtcXFxcbiAgICAgICAgaWYgKC/vv6Vob21lX3J1bGUvLnRlc3QocmVtZikpIHtcXFxcbiAgICAgICAgICAgIGxvZygn6L+c56iL54mI5pys77yaJyArIHJlbXYpO1xcXFxuICAgICAgICAgICAgbG9nKCfmnKzlnLDniYjmnKzvvJonICsgbG9jdmVyKTtcXFxcbiAgICAgICAgICAgIGlmIChsb2N2ZXIgIT0gcmVtdikge1xcXFxuICAgICAgICAgICAgICAgIHB1dFZhcignYXBwbnZlcicsIHJlbWYpO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+acieaWsOeJiOacrO+8jOeCueWvvOWFpeabtOaWsOWPr+abtOaWsOinhOWImeOAgic7XFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mmoLml6DmlrDniYjmnKzvvIwyNOWwj+aXtuWGheajgOa1i+aXoOaViOOAgidcXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5qOA5rWL5pu05paw5aSx6LSl77yM5Y+v6IO95LqR56uv5oq96aOO5LqG44CCJ1xcXFxuICAgICAgICB9XFxcXG4gICAgfSwgbG9jdmVyKSxcXFxcbiAgICBjb2xfdHlwZTogJ3RleHRfMidcXFxcbn0pO1xcXFxuaWYgKGdldFZhcignYXBwbnZlcicpKSB7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICflr7zlhaXmm7TmlrAnLFxcXFxuICAgICA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CAxKSB7XFxcXG4gICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfaW5mby52b2RfcGxheV91cmwuc3BsaXQoJyQkJCcpO1xcXFxuICAgICAgICB9XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgdmFyIGNvbnRzID0gaHRtbC5kYXRhLnZvZF9wbGF5X2xpc3Q7XFxcXG4gICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxcXG4gICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoJyQkJCcpO1xcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxuXFxcXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cy5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICBpZiAoaHRtbC52aWRlb2xpc3QpIHtcXFxcbiAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC52aWRlb2xpc3RbY29udHNbaV1dO1xcXFxuICAgICAgICB9IGVsc2UgaWYgKGNvbnRzW2ldLnVybHMpIHtcXFxcbiAgICAgICAgICAgIHZhciBsaXN0ID0gY29udHNbaV0udXJscztcXFxcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmwpIHtcXFxcbiAgICAgICAgICAgIHZhciBsaXN0ID0gY29udHNbaV0udXJsLnNwbGl0KFxcXFxcXFwiI1xcXFxcXFwiKTtcXFxcbiAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgIHZhciBsaXN0ID0gY29udHNbaV0uc3BsaXQoXFxcXFxcXCIjXFxcXFxcXCIpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGNocC5wdXNoKGxpc3QubGVuZ3RoKTtcXFxcbiAgICB9XFxcXG59IGNhdGNoIChlKSB7fVxcXFxuLy9sb2coTWF0aC5tYXguYXBwbHkoTWF0aCxjaHApKTtcXFxcbnNldFJlc3VsdCgn5pu05paw6IezOicgKyAoTWF0aC5tYXguYXBwbH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cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvJ1xcXFxuICAgICAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAgICAgaWYgKGxpbmsuaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICdzZWFyY2g/cGc9MSZ0ZXh0PScgKyBrZXkgKyAnJnRva2VuPSc7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5rLmluZGV4T2YoJ3hnYXBwLnBocC92MS8nKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz0xJnRleHQ9JyArIGtleTtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KGxpbmspKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJy9saXN0P3BhZ2U9ZnlwYWdlJmxpbWl0PTEwJndkPScgKyBrZXk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9wYWdlPTEmbGltaXQ9MTAmd2Q9JyArIGtleTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIC8vRGF0YS5wdXNoKHt1cmw6IGhtdXJsLG9wdGlvbnM6IHtoZWFkZXJzOiB7XFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IFxcXFxcXFwiRGFydC8yLjE0IChkYXJ0OmlvKVxcXFxcXFwifSx0aW1lb3V0OiB0aW1lb3V9fSk7XFxcXG4gICAgICAgICAgICBEYXRhLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHVybDogaG11cmwsXFxcXG4gICAgICAgICAgICAgICAgb3B0aW9uczoge1xcXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogbGluay5pbmRleE9mKFxcXFxcXFwibW9nYWlfYXBpXFxcXFxcXCIpICE9IC0xID8gXFxcXFxcXCJEYXJ0LzIuMTQgKGRhcnQ6aW8pXFxcXFxcXCIgOiBcXFxcXFxcIm9raHR0cC80LjEuMFxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHRpbWVvdXQ6IHRpbWVvdVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgVGl0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdDogbGlzdFtqXS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICBsaW5rOiBsaW5rLFxcXFxuICAgICAgICAgICAgICAgIHR5cG5tOiBsaXRpdFxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gLy9pZlxcXFxuICAgIH0gLy9mb3IgalxcXFxufSBjYXRjaCAoZSkge31cXFxcbmlmIChEYXRhLmxlbmd0aCA8PSAwKSB7XFxcXG4gICAgc2V0UmVzdWx0KFtdKTtcXFxcbn0gZWxzZSB7XFxcXG4gICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiBcXFxcXFxcIuato+WcqOWKoOi9veS4reesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG177yM6L+b5bqm77yaMS9cXFxcXFxcIiArIERhdGEubGVuZ3RoLFxcXFxuICAgICAgICB1cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgZGVzYzogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGlkOiBwYWdlaWRcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuICAgIHNldFJlc3VsdChpdGVtcyk7XFxcXG4gICAgbGV0IHRhc2tzID0gW107XFxcXG5cXFxcbiAgICBmb3IgKGxldCBrIGluIERhdGEpIHtcXFxcbiAgICAgICAgbGV0IGl0ID0gRGF0YVtrXTtcXFxcbiAgICAgICAgdGFza3MucHVzaCh7XFxcXG4gICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChwYXJhbS5pdC51cmwsIHBhcmFtLml0Lm9wdGlvbnMpO1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBodG1sLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXFxcXFxyXFxcXFxcXFxuJyA/IGh0bWwucmVwbGFjZSgnXFxcXFxcXFxyXFxcXFxcXFxuJywgJycpIDogaHRtbDtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIGlmICgvYnR3YWYvLnRlc3QoaHRtbCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaHRtbCA9IGZldGNoKHBhcmFtLml0LnVybCArICcmYnR3YWYnICsgaHRtbC5tYXRjaCgvYnR3YWYoLio/KVxcXFxcXFxcXFxcXFxcXCIvKVsxXSwge30pO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoaHRtbCA9PSBcXFxcXFxcIlxcXFxcXFwiIHx8IGh0bWwgPT0gbnVsbCB8fCBodG1sLnN1YnN0cmluZygwLCA1KSA9PSAnZXJyb3InIHx8ICFodG1sLnN0YXJ0c1dpdGgoJ3snKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwubGVuZ3RoIDwgODApIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGxcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gSlNPTi5wYXJzZShodG1sKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0eXBldCA9IHBhcmFtLnRpdC50eXBubTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRkb21pbiA9IHBhcmFtLnRpdC5saW5rO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5saXN0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IGh0bWwubGlzdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmRhdGEubGlzdCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmRhdGEubGlzdDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmRhdGEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC5kYXRhO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPCAxKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXFxcXFwvdm9kXFxcXFxcXFwvLy50ZXN0KHRkb21pbikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS50aXRsZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0ucGljO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gbGlzdFtpXS5uZXh0bGluaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0uc3RhdGU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRkb21pbi5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2ZhbnR1YW4vLnRlc3QodGRvbWluKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWxJRD92b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0uc3RhdGU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2codmlkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogTVlfVFlQRSA9PSBcXFxcXFxcImhvbWVcXFxcXFxcIiA/IHRpdGxlLnJlcGxhY2Uoa2V5LCAn4oCc4oCcJyArIGtleSArICfigJ3igJ0nKSArICdcXFxcXFxcXG4nICsgcmVtIDogdGl0bGUgKyByZW0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IHBpYyArICdAUmVmZXJlcj0nLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodGRvbWluLmluZGV4T2YoXFxcXFxcXCJtb2dhaV9hcGlcXFxcXFxcIikgIT0gLTEgPyB2aWQgKyAnO2dldDt1dGYtODt7VXNlci1BZ2VudEBEYXJ0LzIuMTQgKGRhcnQ6aW8pfScgOiB2aWQgKyAnO2dldDt1dGYtODt7VXNlci1BZ2VudEBva2h0dHAvNC4xLjB9JykucnVsZSgodGRvbWluKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShnZXRSZXNDb2RlKCkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICcnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBteXVybCA9IE1ZX1VSTC5tYXRjaCgvKFtcXFxcXFxcXFNdKj86XFxcXFxcXFwvXFxcXFxcXFwvW1xcXFxcXFxcU10qPylcXFxcXFxcXC8vKVsxXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXFxcXFwvdm9kXFxcXFxcXFwvLy50ZXN0KHRkb21pbikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9hcHBtb3ZsaXN0Jywge30pKS5ydWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLmRhdGEgPSBpdGVtcztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSx0ZG9taW4pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2NvbnRlbnQ6IHJlbSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogdHl0aXQgKyAnID0+ICcgKyBwYXJhbS50aXQudGl0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzFfdmVydGljYWxfcGljJ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSAvL2ZvciBpXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gLy9pZiBsaXN0Lmxlbmd0aFxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZDtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgcGFyYW06IHtcXFxcbiAgICAgICAgICAgICAgICBpdDogaXQsXFxcXG4gICAgICAgICAgICAgICAgdGl0OiBUaXRba11cXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBpZDogXFxcXFxcXCJ0YXNrXFxcXFxcXCJcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9XFxcXG5cXFxcbiAgICBiYXRjaEV4ZWN1dGUodGFza3MsIHtcXFxcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAvL2xvZyhcXFxcXFxcImxpc3RlbmVyOiBcXFxcXFxcIiArIChyZXN1bHQgfHwgW10pLmxlbmd0aClcXFxcbiAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXFxcbiAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByZXN1bHQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcXFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaXQucGljX3VybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJfX2FwcFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwiQFxcXFxcXFwiICsgcGFyYW0ualxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcblxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKHBhcmFtLmkgPj0gcGFyYW0uYWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYWdlaWQpXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLmraPlnKjliqDovb3nrKxcXFxcXFxcIiArIE1ZX1BBR0UgKyBcXFxcXFxcIumhte+8jOi/m+W6pu+8mlxcXFxcXFwiICsgKHBhcmFtLmkgKyAxKSArIFxcXFxcXFwiL1xcXFxcXFwiICsgcGFyYW0uYWxsLFxcXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVz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bGlzdDog5b2T5YmN5p2h55uuXFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgbGV0IHJlcyA9IOaWsOiusOW9lS5zb21lKGl0ZW0gPT4ge1xcXFxuICAgICAgICAvL+WIpOaWreexu+Wei++8jOacieWwsea3u+WKoOWIsOW9k+WJjemhuVxcXFxuICAgICAgICBpZiAoaXRlbS50aXRsZSA9PSDorrDlvZVbaV0udHlwZSkge1xcXFxuICAgICAgICAgICAgaXRlbS5saXN0ID0g5b2T5YmN5p2h55uuLmNvbmNhdChpdGVtLmxpc3QuZmlsdGVyKGQgPT4gZC51cmwgIT0g6K6w5b2VW2ldLnVybCkpO1xcXFxuICAgICAgICAgICAgcmV0dXJuIHRydWVcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuICAgIGlmICghcmVzKSB7XFxcXG4gICAgICAgIC8v5aaC5p6c5rKh5om+55u45ZCM57G75Z6L5re75Yqg5LiA5Liq57G75Z6LXFxcXG4gICAgICAgIOaWsOiusOW9lS5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiDorrDlvZVbaV0udHlwZSxcXFxcbiAgICAgICAgICAgIGxpc3Q6IOW9k+WJjeadoeebrlxcXFxuICAgICAgICB9KTtcXFxcbiAgICB9XFxcXG4gICAgfVxcXFxufVxcXFxudmFyIG5ld2ZpbGUgPSB7fTtcXFxcbm5ld2ZpbGUuZGF0YSA9IOaWsOiusOW9lTtcXFxcbi8vbG9nKHJlbWZpbGUpO1xcXCJ9XVwifSIsInBpY1VybCI6Imh0dHBzOi8vaW5tZW1vcnkuY29kaW5nLm5ldC9wL0luTWVtb3J5L2QvTUJyb3dzZXIvZ2l0L3Jhdy9tYXN0ZXIvQXBwRmlsZS9BcHBJY29uL+mAmueUqOWbvuaghy5wbmciLCJ0aXRsZSI6Ik1Y5b2x6KeGIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement