Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@AI聚集@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiQUnogZrpm4YiLCJhdXRob3IiOiIiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyNmeWNsYXNzIyNmeXBhZ2UiLCJ2ZXJzaW9uIjo1NCwiY29sX3R5cGUiOiJtb3ZpZV8zX21hcnF1ZWUiLCJjbGFzc19uYW1lIjoi6aaW6aG1JuixjOixhibojLbmna/ni5Am5pCc54mHJumdkum6pibnlLXlvbHni5cm6Iy25p2v6JmOJuWcn+aLqOm8oCbliqjmvKvlt7Tlo6siLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6ImhvbWUmaHR0cHM6Ly93d3cud2FuZG91LmxhLyZodHRwczovL2N1cGZveC5hcHAvJmh0dHA6Ly9zb3VwaWFuLnh5ei8maHR0cHM6Ly9tLnFtdHYuYXBwLyZodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20veWluZ2t1LyZodHRwczovL3d3dy43MjU5OTguY29tL3lpbmdrdSZodHRwczovL3d3dy50YnNkeS5jb20vbS9pbmRleC5odG1sJmh0dHBzOi8vZG04NC50diIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxudmFyIG15dXJsID0gTVlfVVJMLnNwbGl0KFwiIyNcIilbMV07XG5cbmxldCBhbmNob3JJZCA9IG15dXJsO1xubGV0IGpzID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3g1YWlcIikoTVlfUlVMRS50aXRsZSwgYW5jaG9ySWQpO1xuXG5mdW5jdGlvbiBsb2FkVXJsKG15dXJsLCBteXJ1bGUsIG0pIHtcbiAgICBzZXRSZXN1bHQoW3tcbiAgICAgICAgY29sX3R5cGU6IFwieDVfd2Vidmlld19zaW5nbGVcIixcbiAgICAgICAgdXJsOiBteXVybCxcbiAgICAgICAgZGVzYzogXCJmbG9hdCYmdG9wXCIsXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBmbG9hdFZpZGVvOiB0cnVlLFxuICAgICAgICAgICAgY2FuQmFjazogdHJ1ZSxcbiAgICAgICAgICAgIHVybEludGVyY2VwdG9yOiAkLnRvU3RyaW5nKChNWV9SVUxFLCBtb2JhbikgPT4ge1xuICAgICAgICAgICAgICAgIGxvZyhpbnB1dClcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aCgnaHR0cHM6Ly93d3cuYWxpeXVuZHJpdmUuY29tL3MvJykpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6ICfkupHnm5jmsYflvbEnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyB1cmwgKyAnPz9meXBhZ2UnXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuc3RhcnRzV2l0aCgnaHR0cHM6Ly9kbTg0LnR2L3YvJykpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgTVlfUlVMRSwgbW9iYW4pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1ID0gJ2hpa2VyOi8vZW1wdHk/dT0nICsgdXJsO1xuICAgICAgICAgICAgICAgICAgICAgICAgdSA9IG1vYmFuID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnO1xuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IE1ZX1JVTEUudGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICflvbHniYfor6bmg4UnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwOiBNWV9SVUxFLmdyb3VwLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZVJ1bGU6IE1ZX1JVTEUucHJlUnVsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlczogTVlfUlVMRS5wYWdlcyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFJ1bGU6IE1ZX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZVxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xuICAgICAgICAgICAgICAgICAgICB9LCBpbnB1dCwgTVlfUlVMRSwgbW9iYW4pXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICghaW5wdXQuc3RhcnRzV2l0aCgnaHR0cHM6Ly9kbTg0LnR2JykgJiYgIWlucHV0LnN0YXJ0c1dpdGgoXCJodHRwczovL2N1cGZveC5hcHAvXCIpICYmICFpbnB1dC5zdGFydHNXaXRoKFwiaHR0cHM6Ly81MXNvdWp1LmNvbS9cIikgJiZcbiAgICAgICAgICAgICAgICAgICAgIWlucHV0LnN0YXJ0c1dpdGgoXCJodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vXCIpICYmICFpbnB1dC5zdGFydHNXaXRoKFwiaHR0cHM6Ly93d3cud2FuZG91LmxhL1wiKSAmJiAhaW5wdXQuc3RhcnRzV2l0aChcImh0dHA6Ly9zb3VwaWFuLnh5ei9cIikgJiYgIWlucHV0LnN0YXJ0c1dpdGgoXCJodHRwczovL3d3dy5xaW1haXR2LmNvbS9cIikgJiYgIVxuICAgICAgICAgICAgICAgICAgICBpbnB1dC5zdGFydHNXaXRoKFwiaHR0cHM6Ly93d3cuNzI1OTk4LmNvbS9cIikgJiYgIWlucHV0LmluY2x1ZGVzKFwic2VhcmNoXCIpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIE1ZX1JVTEUsIG1vYmFuKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdSA9ICdoaWtlcjovL2VtcHR5P3U9JyArIHVybDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBtb2JhbiA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJztcbiAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiBNWV9SVUxFLnRpdGxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5b2x54mH6K+m5oOFJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBncm91cDogTVlfUlVMRS5ncm91cCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVSdWxlOiBNWV9SVUxFLnByZVJ1bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZXM6IE1ZX1JVTEUucGFnZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmRSdWxlOiBNWV9SVUxFLmRldGFpbF9maW5kX3J1bGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcbiAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQsIE1ZX1JVTEUsIG1vYmFuKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICA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zAnKSA9PSAnMScpIHtcXG4gICAgdmFyIGxhenkgPSAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KS5tYXRjaCgvciBwbGF5ZXJfLio/PSguKj8pPC8pWzFdKVxcbiAgICAgICAgICAgIHZhciB1cmwgPSBodG1sLnVybFxcbiAgICAgICAgICAgIGlmIChodG1sLmVuY3J5cHQgPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVuZXNjYXBlKHVybCk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChodG1sLmVuY3J5cHQgPT0gJzInKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVuZXNjYXBlKGJhc2U2NERlY29kZSh1cmwpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKC9tM3U4fG1wNC8udGVzdCh1cmwpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB1cmxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3ZpZGVvOi8vJyArIGlucHV0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAndmlkZW86Ly8nICsgaW5wdXRcXG4gICAgICAgIH1cXG4gICAgfSlcXG5cXG4gICAgdHJ5IHtcXG4gICAgICAgIGxvZyh1cmwpXFxuICAgICAgICBNWV9VUkwgPSAnaGlrZXI6Ly9lbXB0eSMjJyArIHVybFxcbiAgICAgICAgcmVxdWlyZShjb25maWcu6Ieq5Yqo5Yy56YWNKTtcXG4gICAgICAgIOiHquWKqOS6jOe6pyhsYXp5KTtcXG4gICAgICAgIHB1dE15VmFyKCdibScsICcxJylcXG4gICAgfSBjYXRjaCB7XFxuICAgICAgICBwdXRNeVZhcignYm0nLCAnMCcpXFxuICAgIH1cXG59XFxuXFxuXFxubG9nKCfmqKHmnb86JyArIGdldE15VmFyKCdibScsICcwJykpXFxuXFxuaWYgKGdldE15VmFyKCdibScsICcwJykgPT0gJzAnKSB7XFxuXFxuICAgIHZhciBkID0gW107XFxuICAgIE1ZX1VSTCA9IHVybFxcblxcbiAgICBmdW5jdGlvbiBnZXRUaXRsZShodG1sLCBzKSB7XFxuICAgICAgICB2YXIgdGl0bGUgPSAnJztcXG4gICAgICAgIHZhciB0aXRsZXMgPSBwZGZhKGh0bWwsIHMpO1xcbiAgICAgICAgLy9sb2codGl0bGVzKTtcXG4gICAgICAgIGlmICh0aXRsZXMubGVuZ3RoID09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gdGl0bGVcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IHggb2YgdGl0bGVzKSB7XFxuICAgICAgICAgICAgaWYgKHguaW5jbHVkZXMoJzxmb250JykpIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKHgsICdoMS0tZm9udCYmVGV4dCcpO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoeC5pbmNsdWRlcygnPHNwYW4nKSkge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHBkZmgoeCwgJ2gxLS1zcGFuJiZUZXh0Jyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdGl0bGUgPSBwZGZoKHgsICdUZXh0Jyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0aXRsZSAhPSAnJykge1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdGl0bGVcXG4gICAgfVxcblxcbiAgICBpZiAoaHRtbCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgaHRtbCA9IGZldGNoUEModXJsKVx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RoID4gOCkge1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8v5o6S6ZmkXFxuICAgICAgICBsZXQgcmVnID0gL1xcXFwufOmrmOa4heebtOaSrXzlhpnnnJ/mjqjojZB85b2x6ZmifOW9seinhnzok53lhYnnlLXlvbF86auY5riF55S15b2xfOesrOS4gOWto3znrKzkuozlraN856ys5LiJ5a2jfOesrOWbm+Wto3znrKzkupTlraMvO1xcbiAgICAgICAgaWYgKHRpdCAhPSBcXFwiXFxcIiAmJiAhdGl0LmluY2x1ZGVzKGl0KSB8fCByZWcudGVzdChpdCkpIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXQubWF0Y2goL+WOn+eUu3zlpIfnlKh86JOd5YWJfOi2hea4hXzpq5jmuIV85q2j54mHfOmfqeeJiHw0S3w0a3wxMDgwUHw3MjBQfFRDfEhEfEJEfOS4reWtly8pXFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gbm90Q2hhcHRlcihpdCkge1xcbiAgICAgICAgaWYgKGl0ID09IG51bGwgfHwgaXQudGV4dCA9PSBudWxsKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXQudGV4dC5tYXRjaCgvWzAtOV1cXFxcLlswLTld5YiGLyk7XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gaXNDaGFwdGVyKGl0LCBwcmUsIG5leHQpIHtcXG4gICAgICAgIGlmIChub3RDaGFwdGVyKGl0KSkge1xcbiAgICAgICAgICAgIC8v5LyY5YWI5o6S6ZmkXFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy/liKTmlq3mmK/kuI3mmK/nlLXlvbFcXG4gICAgICAgIGlmIChpc01vdmllKGl0KSkge1xcbiAgICAgICAgICAgIHJldHVybi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2V0Q2hhcHRlck51bShpdCk7XFxuICAgICAgICAvL2lmIChkZWJ1ZykgbG9nKGl0KTtcXG4gICAgICAgIGlmIChpdCA8IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICBicm90aGVyID0gZ2V0Q2hhcHRlck51bShicm90aGVyKTtcXG4gICAgICAgIC8vaWYgKGRlYnVnKSBsb2coYnJvdGhlcik7XFxuICAgICAgICBpZiAoYnJvdGhlciA8IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gaXQgLSBicm90aGVyIDwgMiAmJiBpdCAtIGJyb3RoZXIgPiAtMjtcXG4gICAgfVxcblxcbiAgICBsZXQgdGZwdXNoID0gZ2V0SXRlbSgnd2VicHVzaCcsICcwJyk7XFxuXFxuICAgIGxldCBfd2ViID0gJC50b1N0cmluZygodGZwdXNoKSA9PiB7XFxuICAgICAgICBsZXQgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICBsZXQgcmVnID0gL1xcXFwuaHRtbHxcXFxcLmNzc3xcXFxcLmpzLztcXG4gICAgICAgIGZvciAobGV0IGsgaW4gdXJscykge1xcbiAgICAgICAgICAgIGlmICghcmVnLnRlc3QodXJsc1trXSkgJiYgdXJsc1trXS5tYXRjaCgvXFxcXC5tcDR8XFxcXC5tM3U4LykpIHtcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5sb2codXJsc1trXSk7XFxuICAgICAgICAgICAgICAgIC8vcmV0dXJuIGZ5X2JyaWRnZV9hcHAuZ2V0SGVhZGVyVXJsKHVybHNba10ucmVwbGFjZSgvLio/dXJsPS8sIFxcXCJcXFwiKSkgKyBcXFwiI2lnbm9yZUltZz10cnVlI1xcXCI7XFxuICAgICAgICAgICAgICAgIGlmICh0ZnB1c2ggPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKSArIFxcXCIjaWdub3JlSW1nPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwbGF5ID0gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGRvY3VtZW50LnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBwbGF5XFxuICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0sIHRmcHVzaCk7XFxuXFxuICAgIGZ1bmN0aW9uIF9fd2ViKG1vZGUpIHtcXG4gICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh0ZnB1c2gpID0+IHtcXG4gICAgICAgICAgICBsZXQgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICAgICAgbGV0IHJlZyA9IC9cXFxcLmh0bWx8XFxcXC5jc3N8XFxcXC5qcy87XFxuICAgICAgICAgICAgZm9yIChsZXQgayBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgIGlmICghcmVnLnRlc3QodXJsc1trXSkgJiYgdXJsc1trXS5tYXRjaCgvXFxcXC5tcDR8XFxcXC5tM3U4LykpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAubG9nKHVybHNba10pO1xcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKSArIFxcXCIjaWdub3JlSW1nPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ZnB1c2ggPT0gJzAnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZ5X2JyaWRnZV9hcHAuZ2V0SGVhZGVyVXJsKHVybHNba10ucmVwbGFjZSgvLio/dXJsPS8sIFxcXCJcXFwiKSkgKyBcXFwiI2lnbm9yZUltZz10cnVlI1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwbGF5ID0gZnlfYnJpZGdlX2FwcC5nZXRIZWFkZXJVcmwodXJsc1trXS5yZXBsYWNlKC8uKj91cmw9LywgXFxcIlxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9wdXNoP3B1c2h1cmw9JyArIGVuY29kZVVSSUNvbXBvbmVudChKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZG9jdW1lbnQudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBwbGF5XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgbW9kZSk7XFxuICAgIH1cXG5cXG4gICAgJC5leHRlbmQoe1xcbiAgICAgICAgbHdlYjogX193ZWJcXG4gICAgfSlcXG5cXG4gICAgbGV0IHdlYiA9IGdldEl0ZW0oJ3dlYicsICcwJyk7XFxuICAgIHZhciBwdXNodHlwZSA9IFsn5YiX6KGoJywgJ+WNlembhiddXFxuICAgIHZhciBwYXJzZXR5cGUgPSBbJ1dlYuWXheaOojowJywgJ+inhumikeWXheaOojoxJywgJ2Rt55uS5a2QOjInXVxcbiAgICBsb2coJ+aOqOmAgeexu+WeizonICsgcHVzaHR5cGVbcGFyc2VJbnQodGZwdXNoKV0pXFxuICAgIGxvZygn5ZeF5o6i57G75Z6LOicgKyBwYXJzZXR5cGVbcGFyc2VJbnQod2ViKV0uc3BsaXQoJzonKVswXSlcXG5cXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgIGxldCB0ID0gaXQudGV4dDtcXG4gICAgICAgIGlmICghaXQuaHJlZiB8fCBpdC5ocmVmID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcHJlID0gaSA9PSAwID8gbnVsbCA6IGFycltpIC0gMV07XFxuICAgICAgICBsZXQgbmV4dCA9IGkgPT0gKGFyci5sZW5ndGggLSAxKSA/IG51bGwgOiBhcnJbaSArIDFdO1xcbiAgICAgICAgaWYgKGlzQ2hhcHRlcihpdCwgcHJlLCBuZXh0KSkge1xcbiAgICAgICAgICAgIGlmICh0ZnB1c2ggPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgIC8qdmFyIHVybHggPSBcXFwid2ViUnVsZTovL1xcXCIgKyBpdC5ocmVmICsgXFxcIkBcXFwiICsgX3dlYjtcXG4gICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGpzTG9hZGluZ0luamVjdDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycubTRhJywgJy5tcDMnLCAnLmZsdicsICcuYXZpJywgJy4zZ3AnLCAnLm1wZWcnLCAnLndtdicsICcubW92JywgJy5ybXZiJywgJy5naWYnLCAnLmpwZWcnLCAnLnBuZycsICcuaWNvJywgJy5zdmcnXVxcbiAgICAgICAgICAgICAgICB9OyovXFxuICAgICAgICAgICAgICAgIHZhciB1cmx4ID0gJ2hpa2VyOi8vcGFnZS9wdXNoPyZwdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBnZXRQYWdlVGl0bGUoKSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ1cmxcXFwiOiBpdC50ZXh0ICsgJyQnICsgaXQuaHJlZixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50XFxcIjogTVlfVVJMLnRpdGxlLFxcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaXQuaHJlZixcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAod2ViID09ICcwJykge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFwid2ViUnVsZTovL1xcXCIgKyBpdC5ocmVmICsgXFxcIkBcXFwiICsgX3dlYjtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5tNGEnLCAnLm1wMycsICcuZmx2JywgJy5hdmknLCAnLjNncCcsICcubXBlZycsICcud212JywgJy5tb3YnLCAnLnJtdmInLCAnLmdpZicsICcuanBlZycsICcucG5nJywgJy5pY28nLCAnLnN2ZyddXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdlYiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB1cmx4ID0gXFxcInZpZGVvOi8vXFxcIiArIGl0LmhyZWY7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2ViID09ICcyJykge1xcbiAgICAgICAgICAgICAgICAgICAgbGF6eSA9ICQoJycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvbGF6eVRvWDU/cnVsZT1kbeebkuWtkCcpLnZpZGVvWDUoKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB2YXIgdXJseCA9IGl0LmhyZWYgKyBsYXp5XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmF4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHQsXFxuICAgICAgICAgICAgICAgIHVybDogdXJseCxcXG4gICAgICAgICAgICAgICAgcGg6IHQgKyBcXFwiJFxcXCIgKyBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYXhcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBpZiAoZC5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgLy/ljLnphY3lpLHotKVcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwieDVfd2Vidmlld19zaW5nbGVcXFwiLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCJmbG9hdCYmMTAwJVxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgZmxvYXRWaWRlbzogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgY2FuQmFjazogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgYmxvY2tSdWxlczogW1xcXCIuZ2lmXFxcIiwgXFxcIi9hZC9cXFwiLCBcXFwiZ29vZ2xlXFxcIiwgXFxcIi9zaC90by9cXFwiLCBcXFwiLkdJRlxcXCJdXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICB0b2FzdChcXFwiQUnljLnphY3lpLHotKXvvIzlt7Lkvb/nlKhYNeWKoOi9vVxcXCIpO1xcbiAgICAgICAgbG9nKFxcXCLlvZPliY3pobXpnaLlnLDlnYA6IFxcXCIgKyB1cmwpXFxuICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICAvL+S4uue6v+i3r+WKoOWIhuWJsue6v1xcbiAgICAgICAgbGV0IGQyID0gW107XFxuICAgICAgICBsZXQgbXRhYiA9IFtdO1xcblxcbiAgICAgICAgZCA9IHVuaXF1ZShkKVxcbiAgICAgICAgLy9sb2coQml0VFMpXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBkMi5wdXNoKGRbaV0pO1xcbiAgICAgICAgICAgIG10YWIucHVzaChkW2ldLnBoKTtcXG4gICAgICAgICAgICBpZiAoaSA8IGQubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBkW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdDEgPSBwYXJzZUludChjbGVhclRleHQoaXQudGl0bGUpKTtcXG4gICAgICAgICAgICAgICAgbGV0IG5leHQgPSBkW2kgKyAxXTtcXG4gICAgICAgICAgICAgICAgbGV0IHQyID0gcGFyc2VJbnQoY2xlYXJUZXh0KG5leHQudGl0bGUpKTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyIC0gdDEgPiAxIHx8IHQxIC0gdDIgPiAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBtdGFiLnB1c2goJyMnKTtcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICBsZXQgcGxheWwgPSBtdGFiLmpvaW4oJyMnKS5yZXBsYWNlKC8jIyMvZywgJyQkJCQkJCcpO1xcblxcblxcbiAgICAgICAgbGV0IGZyb20gPSBbXTtcXG4gICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgcGxheWwuc3BsaXQoJyQkJCcpLmxlbmd0aDsgaisrKSB7XFxuICAgICAgICAgICAgZnJvbS5wdXNoKFxcXCLmkq3mlL7liJfooahcXFwiICsgW2ogKyAxXSk7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcHVzaCA9IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwibmFtZVxcXCI6IGdldFBhZ2VUaXRsZSgpLFxcbiAgICAgICAgICAgIFxcXCJmcm9tXFxcIjogZnJvbS5qb2luKCckJCQnKSxcXG4gICAgICAgICAgICBcXFwidXJsXFxcIjogcGxheWwucmVwbGFjZSgvXFxcXCYvZywgJ++8hu+8hicpLFxcbiAgICAgICAgICAgIFxcXCJjb250ZW50XFxcIjogTVlfUlVMRS50aXRsZVxcbiAgICAgICAgfSk7XFxuICAgICAgICAvL2xvZyhwdXNoKTtcXG5cXG4gICAgICAgIHZhciB0Y29uZmlnID0ge1xcbiAgICAgICAgICAgIG5hbWU6IGdldFBhZ2VUaXRsZSgpLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IE1ZX1JVTEUudGl0bGVcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5o6o6YCB5pys6aG1PT5UVkJveFxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKHB1c2gpLmxhenlSdWxlKCh0Y29uZmlnKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBkbGlzdCA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJkdW9zZWxlY3RcXFwiKTtcXG4gICAgICAgICAgICAgICAgaWYgKGRsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwbGF5cyA9IGRsaXN0Lm1hcCh4ID0+IHgudGl0bGUgKyBcXFwiJFxcXCIgKyB4LnVybCkuam9pbihcXFwiI1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGRwdXNoID0gSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogdGNvbmZpZy5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJmcm9tXFxcIjogXFxcIuaSreaUvuWIl+ihqFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVybFxcXCI6IHBsYXlzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50XFxcIjogdGNvbmZpZy5jb250ZW50XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGRwdXNoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvcHVzaD9wdXNodXJsPScgKyBlbmNvZGVVUklDb21wb25lbnQoZHB1c2gpO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3B1c2g/cHVzaHVybD0nICsgZW5jb2RlVVJJQ29tcG9uZW50KGlucHV0KTtcXG4gICAgICAgICAgICB9LCB0Y29uZmlnKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiAncHVzaHMnLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcblxcbiAgICAgICAgZDIudW5zaGlmdCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfpgInmjqgnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnd2VicHVzaCcsICcwJyk7XFxuXFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ3NwdXNoJywge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfljZXmjqgnLFxcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKGZpbmRJdGVtKCdkc2VsZWN0JykuZXh0cmEubW9kZSA9PSAnb3BlbicpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KCfpgInmjqjmqKHlvI/lhbPpl60nKTtcXG4gICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJkdW9zZWxlY3RcXFwiLCBbXSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBsZXQgSWRzID0gKGZpbmRJdGVtc0J5Q2xzKCdwbGF5cycpKS5tYXAoaXQgPT4gaXQuZXh0cmEuaWQpO1xcbiAgICAgICAgICAgICAgICBJZHMuZm9yRWFjaCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGZpbmRJdGVtKHgpLnRpdGxlO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkLm1zbSh0aXRsZSwgeCksXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGZpbmRJdGVtKCdkc2VsZWN0JykudGl0bGU7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ2RzZWxlY3QnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogYOKAnOKAnOKAneKAnTxzcGFuIHN0eWxlPVxcXCJjb2xvcjojNDY4MkI0XFxcIj5gICsgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vZGU6ICdvcGVuJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgncHVzaHMnLCB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+aOqOmAgemAieS4rT0+VFZCb3gnLFxcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgdG9hc3QoJ+mAieaOqOaooeW8j+W8gOWQrycpXFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6ICdkc2VsZWN0JyxcXG4gICAgICAgICAgICAgICAgJ21vZGUnOiAnY2xvc2UnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG5cXG5cXG4gICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiAoZ2V0SXRlbSgnd2VicHVzaCcsICcwJykgPT0gJzEnID8gJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCIjMDBGRjAwXFxcIj7ljZXmjqg8L2ZvbnQ+JyA6ICfljZXmjqgnKSxcXG4gICAgICAgICAgICB1cmw6IGBoaWtlcjovL2VtcHR5QGxhenlSdWxlPS5qczpnZXRJdGVtKCd3ZWJwdXNoJywnMCcpP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xuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBsZXQgdGlwcyA9ICfor7fpgInmi6nll4XmjqLmqKHlvI8nO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJCjll4XmjqIsIDEsIHRpcHMpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0LnJlcGxhY2UoL+Keoe+4jy9nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCfll4XmjqInLCBpbnB1dC5zcGxpdCgnOicpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBtb2RlID0gaW5wdXQuc3BsaXQoJzonKVsxXVxcbiAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbSgnd2ViJywgbW9kZSlcXG4gICAgICAgICAgICAgICAgICAgIGxldCBvbGRJZHMgPSAoZmluZEl0ZW1zQnlDbHMoJ3BsYXlzJykpLm1hcChpdCA9PiBpdC5leHRyYS5pZCk7XFxuICAgICAgICAgICAgICAgICAgICBvbGRJZHMuZm9yRWFjaCh4ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJ3ZWJSdWxlOi8vXFxcIiArIHggKyBcXFwiQFxcXCIgKyAkLmx3ZWIoJzAnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiB4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlzJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5tNGEnLCAnLm1wMycsICcuZmx2JywgJy5hdmknLCAnLjNncCcsICcubXBlZycsICcud212JywgJy5tb3YnLCAnLnJtdmInLCAnLmdpZicsICcuanBlZycsICcucG5nJywgJy5pY28nLCAnLnN2ZyddXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJ2aWRlbzovL1xcXCIgKyB4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogeCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5cycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW9kZSA9PSAnMicpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh4LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHggKyAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2xhenlUb1g1P3J1bGU9ZG3nm5LlrZAnKS52aWRlb1g1KCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheXMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSgncGFyc2UnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHN0b3JhZ2UwLmdldEl0ZW0oJ+WXheaOoicsICdXZWLll4XmjqInKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIh+WXheaOouaWueW8j+S4ujonICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgcGFyc2V0eXBlKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogJ3BhcnNlJyxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNtYWxsPuKaoe+4jycgKyBkdXJsICsgJzwvc21hbGw+JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIHVybDogZHVybCxcXG4gICAgICAgIH0pO1xcblxcblxcbiAgICAgICAgaWYgKE1ZX1BBUkFNUy53ZWIgPT0gXFxcIuWTlOa7tOW9seinhlxcXCIpIHtcXG4gICAgICAgICAgICB2YXIgdHJ1bGU9cmVxdWVzdChcXFwiaGlrZXI6Ly9ob21lQOWTlOWYgOW9seinhlxcXCIpXFxuICAgICAgICAgICAgLy9sb2codHJ1bGUpXFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgaWYodHJ1bGUhPW51bGwpe1xcbiAgICAgICAgICAgIHZhciB0anNvbj1KU09OLnBhcnNlKHRydWxlKTtcXG4gICAgICAgICAgICB2YXIganNyID0gdGpzb24ucHJlUnVsZTtcXG4gICAgICAgICAgICB2YXIgdGljb249dGpzb24uaWNvbjtcXG4gICAgICAgICAgICAvL2xvZyhqc3IpXFxuICAgICAgICAgICAgZXZhbChqc3IpXFxuICAgICAgICAgICAgLy9sb2coY29uZmlnLnVpKVxcbiAgICAgICAgICAgIGQyLnVuc2hpZnQoe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+WTlOa7tOW9seinhicsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICAgICAgaW1nOnRpY29uLFxcbiAgICAgICAgICAgICAgICB1cmw6XFxcImhpa2VyOi8vcGFnZS9kZXRhaWxzP3J1bGU95ZOU5ZiA5b2x6KeGJnVybD1cXFwiK2R1cmwrJyNpbW1lcnNpdmVUaGVtZSMnLFxcbiAgICAgICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWc6SlNPTi5zdHJpbmdpZnkoY29uZmlnKSxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG5cXG5cXG4gICAgICAgIHZhciBkMyA9IFtdO1xcbiAgICAgICAgaWYgKGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMScpIHtcXG5cXG4gICAgICAgICAgICBkMy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgd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gICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIfmjaLmiJDlip8nXFxuICAgICAgICAgICAgfSwgaSksXFxuICAgICAgICB9KVxcbiAgICB9KVxcblxcbiAgICB2YXIgd2ViID0gZ2V0SXRlbSgnd2ViJywgJzAnKVxcbiAgICAvL2xvZyh3ZWIpXFxuICAgIHZhciB0aXRsZSA9ICcnXFxuICAgIHN3aXRjaCAod2ViKSB7XFxuICAgICAgICBjYXNlICcwJzpcXG4gICAgICAgICAgICB0aXRsZSA9ICdXZWLll4XmjqInXFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICcxJzpcXG4gICAgICAgICAgICB0aXRsZSA9ICfop4bpopHll4XmjqInXFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICBjYXNlICcyJzpcXG4gICAgICAgICAgICB0aXRsZSA9ICdkbeebkuWtkCdcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgfVxcbiAgICBzZXRJdGVtKCfll4XmjqInLCB0aXRsZSlcXG5cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn6K6+572uJyxcXG4gICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9zZXR0aW5nXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnZmxleF9idXR0b24nXFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiBcXFwi6aG16Z2i5Yqg6L29OlxcXCIgKyBnZXRJdGVtKCdob21lJywgJ+WFsycpLFxcbiAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGdldEl0ZW0oJ2hvbWUnLCAn5YWzJykgPT0gJ+WFsycpIHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSgnaG9tZScsICflvIAnKVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oJ2hvbWUnLCAn5YWzJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJmbGV4X2J1dHRvblxcXCJcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgd2ViID0gZ2V0SXRlbSgnd2ViJywgJzAnKVxcbiAgICAgICAgICAgIHN3aXRjaCAod2ViKSB7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzAnOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzEnKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzEnOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzInKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJzInOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgnd2ViJywgJzAnKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6ICdwYXJzZXQnXFxuICAgICAgICB9XFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiAn5qih5p2/OicgKyAoZ2V0SXRlbSgnYW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TXlWYXIoJ2NmcGFnZScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBwdGFnKSxcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICB9KVxcbiAgICByZXR1cm4gZ2V0TXlWYXIocHRhZywgXFxcIjBcXFwiKVxcbn1cXG5cXG4vL3VybOino+aekFxcbmZ1bmN0aW9uIHVybFBhcnNlKHUpIHtcXG4gICAgdmFyIGRpY3QgPSB7fVxcbiAgICBkaWN0LlNvdXJjZSA9IHU7XFxuICAgIGxldCBwYXJhbXMgPSAodXJsKSA9PiB7XFxuICAgICAgICBsZXQgcXVlcnlQYXJhbXMgPSB7fTtcXG4gICAgICAgIGxldCByZWcgPSAvKFtePz0mXSspPShbXj89Jl0rKS9nO1xcbiAgICAgICAgdXJsLnJlcGxhY2UocmVnLCBmdW5jdGlvbigpIHtcXG4gICAgICAgICAgICBxdWVyeVBhcmFtc1thcmd1bWVudHNbMV1dID0gYXJndW1lbnRzWzJdO1xcbiAgICAgICAgfSlcXG4gICAgICAgIHJldHVybiBxdWVyeVBhcmFtc1xcbiAgICB9XFxuICAgIHZhciBqYXZhVXJsID0gSmF2YUltcG9ydGVyKGphdmEubmV0LlVSTCk7XFxuICAgIHdpdGgoamF2YVVybCkge1xcbiAgICAgICAgdmFyIHVybCA9IG5ldyBVUkwodSk7XFxuICAgICAgICBkaWN0LlByb3RvY29sID0gdXJsLmdldFByb3RvY29sKCk7XFxuICAgICAgICBkaWN0Lkhvc3QgPSB1cmwuZ2V0SG9zdCgpO1xcbiAgICAgICAgZGljdC5Qb3J0ID0gdXJsLmdldFBvcnQoKTtcXG4gICAgICAgIGRpY3QuRmlsZSA9IHVybC5nZXRGaWxlKCk7XFxuICAgICAgICBkaWN0LlBhdGggPSB1cmwuZ2V0UGF0aCgpO1xcbiAgICA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NoaSA9IEpTT04ucGFyc2UobG9jYWxEYXRhKTtcXG4gICAgICAgICAgICAgICAgbGV0IGNjYyA9IGxpc2hpLmluZGV4T2YobmFtZSk7XFxuICAgICAgICAgICAgICAgIGlmIChjY2MgPiAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGlzaGkuc3BsaWNlKGNjYywgMSlcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgbGlzaGkucHVzaChuYW1lKTtcXG5cXG4gICAgICAgICAgICAgICAgbGlzaGkgPSBsaXNoaS5zbGljZSgtbnVtKTtcXG4gICAgICAgICAgICAgICAgLy9sb2cobGlzaGkpXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9jYWNoZS8nICsgcnVsZV9uYW1lICsgJy3mkJzntKLorrDlvZUuanNvbicsIEpTT04uc3RyaW5naWZ5KGxpc2hpKSk7XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBnZXREYXRhOiBmdW5jdGlvbihydWxlX25hbWUpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHJlcyA9IHJlcXVlc3QoJ2hpa2VyOi8vZmlsZXMvY2FjaGUvJyArIHJ1bGVfbmFtZSArICct5pCc57Si6K6w5b2VLmpzb24nKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UocmVzKVxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgZGVsRGF0YTogZnVuY3Rpb24oaW5kZXgsIHJ1bGVfbmFtZSkge1xcbiAgICAgICAgICAgICAgICBsZXQgbG9jYWxEYXRhID0gdGhpcy5nZXREYXRhKHJ1bGVfbmFtZSkucmV2ZXJzZSgpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhsb2NhbERhdGEpXFxuICAgICAgICAgICAgICAgIGlmIChsb2NhbERhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaW5kZXgpXFxuICAgICA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rDlvZU6JyArIG51bSlcXG4gICAgICAgICAgICAgICAgdmFyIGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGxvY2FsRGF0YSA9IHJlcXVlc3QoJ2hpa2VyOi8vZmlsZXMvY2FjaGUvJyArIHJ1bGVfbmFtZSArICct5pCc57Si6K6w5b2VLmpzb24nKTtcXG4gICAgICAgICAgICAgICAgaWYgKCFsb2NhbERhdGEpIGxvY2FsRGF0YSA9IFxcXCJbXVxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCBsaXNoaSA9IEpTT04ucGFyc2UobG9jYWxEYXRhKS5zbGljZSgtbnVtKS5yZXZlcnNlKCk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKGxpc2hpKVxcbiAgICAgICAgICAgICAgICAvL2xvZyhsb2NhbERhdGEpXFxuICAgICAgICAgICAgICAgIGNvbmZpZy5zdWcgPSBsaXNoaTtcXG4gICAgICAgICAgICAgICAgaW5pdENvbmZpZyh7XFxuICAgICAgICAgICAgICAgICAgICBzdWc6IGNvbmZpZy5zdWdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKGNvbmZpZy5zdWcpXFxuICAgICAgICAgICAgICAgIGNvbmZpZy5zdWcubWFwKCh4LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBg4oCc4oCc4oCd4oCdPHNtYWxsPiR7eH08L3NtYWxsPmAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh4LCBydWxlX25hbWUsIG51bSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgeCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICQuc2VhcmNod29yZHMuYWRkRGF0YSh4LCBydWxlX25hbWUsIG51bSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHgsIHJ1bGVfbmFtZSwgbnVtKSwgLy8naGlrZXI6Ly9zZWFyY2g/cz0nICsgeCArICcmcnVsZT0nICsgcnVsZV9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5Yig6ZmkJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKCh4LCBydWxlX25hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnNlYXJjaHdvcmRzLmRlbERhdGEoaSwgcnVsZV9uYW1lKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKCdjbHNpZCcgKyBpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB4LCBydWxlX25hbWUsIGkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogJ2Nsc2lkJyArIGksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBg4oCc4oCc4oCd4oCdPHNtYWxsPua4hemZpOWOhuWPsuiusOW9lTwvc21hbGw+YCxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocnVsZV9uYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRlc3QgPSAkKFxcXCLmmK/lkKbnoa7orqTvvJ9cXFwiKS5jb25maXJtKChydWxlX25hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKCdoaWtlcjovL2ZpbGVzL2NhY2hlLycgKyBydWxlX25hbWUgKyAnLeaQnOe0ouiusOW9lS5qc29uJywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5a6M5oiQXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBydWxlX25hbWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0ZXN0XFxuICAgICAgICAgICAgICAgICAgICB9LCBydWxlX25hbWUpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFwiI3NcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICB9LCBydWxlX25hbWUsIG51bSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiAnMTNpbnB1dCcsXFxuICAgICAgICAgICAgICAgIC8vY2xzOiBcXFwiI3NcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBpZiAoc3VnKSB7XFxuICAgICAgICBhcnIucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLmkJzntKJcXFwiLFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygocnVsZV9uYW1lLCBudW0pID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgJC5zZWFyY2h3b3Jkcy5hZGREYXRhKGlucHV0LCBydWxlX25hbWUsIG51bSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgcnVsZV9uYW1lLCBudW0pLFxcbiAgICAgICAgICAgIC8vJ1xcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIgKyBpbnB1dCArIFxcXCImcnVsZT1cXFwiK01ZX1JVTEUudGl0bGUgJyxcXG4gICAgICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5YWz6ZSu6K+N77yM5bC96YeP5bCR5a2X5LiN6KaB5aSa5a2XXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAvL2RlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoXFxcInNvdVxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKHJ1bGVfbmFtZSwgc2V0dGluZykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgLy9wdXRNeVZhcihcXFwic291XFxcIiwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBsZXQgc3VnID0gY29uZmlnLnN1ZyB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gc3VnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShzdWdbaV0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKFxcXCIjc1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09ICfmuIXpmaTmkJzntKLorrDlvZUnKSB3cml0ZUZpbGUoJ2hpa2VyOi8vZmlsZXMvY2FjaGUvJyArIHJ1bGVfbmFtZSArICct5pCc57Si6K6w5b2VLmpzb24nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5pdENvbmZpZyh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1ZzogW2lucHV0XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGh0dHAuZmV0Y2goYGh0dHBzOi8vd3d3LmRvdWJhbi5jb20vai9zZWFyY2hfc3VnZ2VzdD9kZWJ1Zz0mcT0ke2lucHV0fWAsIHt9KS5zdWNjZXNzKGRhdGEgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZ2cgPSBKU09OLnBhcnNlKGRhdGEpLndvcmRzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyhnZylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+W7uuiuruaVsOaNricsIGdnKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLmVycm9yKG1zZyA9PiBsb2cobXNnLnRvU3RyaW5nKCkpKS5zdGFydChsb2coMikpXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGdnID0gSlNPTi5wYXJzZShnZXRNeVZhcign5bu66K6u5pWw5o2uJykpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBudW0gPSBzZXR0aW5nLnNob3cgIT0gdW5kZWZpbmVkID8gc2V0dGluZy5zaG93IDogMztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoXFxcIiNzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBnZykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgbm4gPSBnZ1tpXTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKFxcXCIxMmlucHV0XFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG5uLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChubiwgcnVsZV9uYW1lLCBudW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgbm4pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICQuc2VhcmNod29yZHMuYWRkRGF0YShubiwgcnVsZV9uYW1lLCBudW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ2hpa2VyOi8vc2VhcmNoP3M9JyArIG5uICsgJyZydWxlPScgKyBydWxlX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIG5uLCBydWxlX25hbWUsIG51bSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCIjc1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBydWxlX25hbWUsIHNldHRpbmcpLFxcbiAgICAgICAgICAgICAgICAvL3RpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgIGlkOiBcXFwiMTJpbnB1dFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIGFyci5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuaQnOe0olxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5YWz6ZSu6K+N77yM5bC96YeP5bCR5a2X5LiN6KaB5aSa5a2XXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBleHRyY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ICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiB1cmwsXFxuICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTpuYW1lLFxcbiAgICAgICAgICAgICAgICB3ZWI6d2ViLFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn0gZWxzZSB7XFxuXFxufVxcblxcbmlmIChnZXRJdGVtKCdob21lJywgJ+WFsycpID09ICflvIAnKSB7XFxuICAgIHZhciBodG1sID0gcmVxdWVzdChgaHR0cDovLyR7Y29uZmlnLnNvdXBpYW59L2AsIHt9KVxcblxcblxcbiAgICBmdW5jdGlvbiBzZXRMaXN0cyhpdGVtKSB7XFxuICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnNwbGl0KCctJylbMF1cXG4gICAgICAgIHZhciB0ID0gaXRlbS5zcGxpdCgnLScpWzFdXFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMTAucG5nJ1xcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCBgYm9keSYmLmxpc3QtaGVhZGVyOm1hdGNoZXMoJHt0fSkrKiYmYWApXFxuXFxuICAgICAgICBsaXN0Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICB2YXIgbmFtZSA9IHBkZmgoeCwgJy5wb3N0ZXItaXRlbS10aXRsZSYmVGV4dCcpXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogcGRmaCh4LCAnaW1nJiZzcmMnKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgWyfng63pl6jnlLXlvbEt55S15b2xJywgJ+eDremXqOeUteinhuWJpy3nlLXop4bliacnLCAn54Ot6Zeo57u86Im6Lee7vOiJuicsICfng63pl6jliqjmvKst5Yqo5ryrJ10ubWFwKHggPT4ge1xcbiAgICAgICAgc2V0TGlzdHMoeClcXG4gICAgfSlcXG5cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCIxLuixjOixhlwiLFwicGF0aFwiOlwid2FuZG91XCIsXCJydWxlXCI6XCJqczpcXG5sZXQgZHVybCA9IGdldE15VmFyKFxcXCJkdXJsXFxcIiwgXFxcIlxcXCIpO1xcbmlmIChkdXJsICE9ICcnKSB7XFxuXFxuICAgIGR1cmwgPSAnaHR0cHM6Ly93d3cud2FuZG91LmxhJyArIGR1cmwucmVwbGFjZSgnLmh0bWwnLCAnJylcXG4gICAgbGV0IHVybCA9IGR1cmw7XFxuICAgIGxldCBpZCA9IHVybDtcXG4gICAgbGV0IGh0bWwgPSBmZXRjaCh1cmwpO1xcbiAgICB2YXIgcnVsZSA9IE1ZX1JVTEUudGl0bGVcXG4gICAgdmFyIG5hbWUgPSBwZGZoKGh0bWwsICcubW92aWUtY29udGVudCYmcCYmVGV4dCcpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICBpbWc6IHBkZmgo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T1cXFwiICsgYmFzZTY0RW5jb2RlKHUpO1xcbiAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQuc2l0ZV9uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBpdC5zaXRlX2ljb24sXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZnJvbTogJ2hvbWUnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWI6IGl0LnNpdGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGlmIChNWV9QQUdFID09IDEpIHtcXG4gICAgICAgICAgICAgICAgLy9hZGRJdGVtQWZ0ZXIoaWQsIGxpc3QpO1xcbiAgICAgICAgICAgICAgICBkID0gZC5jb25jYXQobGlzdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn1cXG5cXG5sZXQgciA9IFxcXCJcXFwiO1xcbmlmIChzICE9IFxcXCJcXFwiKSB7XFxuXFxuICAgIGpzb24gPSBcXFwiaHR0cHM6Ly9cXFwiK2NvbmZpZy53YW5kb3UrXFxcIi9tb3ZpZS9nZXRzZWFyY2hsaXN0L2tleXdvcmRzL1xcXCIgKyBzICsgXFxcIi9wYWdlLzEvcm93cy8xNi5qc29uXFxcIjtcXG4gICAgZGF0YSA9IEpTT04ucGFyc2UoZmV0Y2goanNvbikpLmRhdGE7XFxuICAgIGxldCB7XFxuICAgICAgICB3cmFwXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sXFxcIik7XFxuICAgIGZvciAobGV0IGl0IG9mIGRhdGEpIHtcXG4gICAgICAgIGxldCBuYW1lID0gaXQubW92aWVfbmFtZTtcXG4gICAgICAgIC8vbG9nKG5hbWUpXFxuICAgICAgICBsZXQgaW1nID0gaXQubW92aWVfaW1nX3VybDtcXG4gICAgICAgIGxldCB1cmwgPSBcXFwiaHR0cHM6Ly93d3cud2FuZG91LmxhXFxcIiArIGl0Lm1vdmllX3VybC5yZXBsYWNlKFxcXCIuaHRtbFxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgIC8vbG9nKHVybClcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IHdyYXAobmFtZSwgcyksXFxuICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHJ1bGUsIGlkLCBzLCBuYW1lKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyhpZCk7XFxuICAgICAgICAgICAgICAgIGlmICghIWNscykge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKGlkKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaCh1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbClcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0ID0gcGRmaChodG1sLCBcXFwiYm9keSYmI19fTkVYVF9EQVRBX18mJkh0bWxcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKHRleHQpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVyamkgPSBKU09OLnBhcnNlKHRleHQpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coZXJqaSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IGVyamkucHJvcHMucGFnZVByb3BzLmRhdGEucGxheURhdGE7XFxuXFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9VUkwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3Rvb2w/cnVsZT1cXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0Lm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IGl0LmRhdGFfdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC5zaXRlX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGl0LnNpdGVfaWNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbHM6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiAnaG9tZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2ViOiBpdC5zaXRlX25hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICA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T04ucGFyc2UocGRmaChodG1sLCBcXFwiYm9keSYmI19fTkVYVF9EQVRBX18mJkh0bWxcXFwiKSk7XFxuXFxuICAgICAgICBmdW5jdGlvbiBzZXRMaXN0cyhpdGVtKSB7XFxuICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS5zcGxpdCgnIycpWzBdXFxuICAgICAgICAgICAgdmFyIGtleSA9IGl0ZW0uc3BsaXQoJyMnKVsxXVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vbW9yZS8xMC5wbmcnXFxuICAgICAgICAgICAgfSlcXG5cXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGpzb24ucHJvcHMucGFnZVByb3BzLmZhbGxiYWNrW2tleV0uZGF0YVxcblxcbiAgICAgICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgbmFtZSA9IHguaG90X25hbWVcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiB4LmhvdF9pbWdfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogeC5ob3RfcmF0ZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKG4sIHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgbilcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAna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3ZhcmlldHknLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IHR5cGVzXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgbmFtZTogJ+e6quW9leeJhycsXFxuICAgICAgICAgICAgaWQ6ICdkb2N1bWVudGFyeScsXFxuICAgICAgICAgICAgY29udGVudDogdHlwZXNcXG4gICAgICAgIH1dXFxuXFxuICAgICAgICB2YXIg5aSn57G7ID0gW107XFxuICAgICAgICBvanNvbi5tYXAoeCA9PiB7XFxuICAgICAgICAgICAg5aSn57G7LnB1c2goeC5uYW1lICsgXFxcIkBcXFwiICsgeC5pZCk7XFxuICAgICAgICB9KVxcbiAgICAgICAgdmFyIGluZGV4ID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImluZGV4XFxcIiwgJzAnKTtcXG4gICAgICAgIHZhciBqID0gb2pzb25baW5kZXhdO1xcbiAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhqLmNvbnRlbnQpO1xcblxcbiAgICAgICAgdmFyIHRlbXAgPSB7fTtcXG4gICAgICAgIGtleXMuZm9yRWFjaCh4ID0+IHtcXG4gICAgICAgICAgICB2YXIgdHlwZSA9IHg7XFxuICAgICAgICAgICAgdmFyIGwgPSBqLmNvbnRlbnRbeF07XFxuICAgICAgICAgICAgaWYgKFsndmVyc2lvbiddLmluY2x1ZGVzKHgpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVyblxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAobC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIHZhciBucyA9IGwubWFwKChrKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbmFtZSA9IGsuc3BsaXQoJzonKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpZCA9IGsuc3BsaXQoJzonKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25hbWUnOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1cmwnOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHhcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgdGVtcFt4XSA9IG5zO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuXFxuICAgICAgICB2YXIgdCA9IE9iamVjdC52YWx1ZXModGVtcCkubWFwKHggPT4geC5tYXAoeiA9PiBKU09OLnN0cmluZ2lmeSh6KSkuam9pbignIycpKVxcblxcbiAgICAgICAgdmFyIFRydWVKc29uID0ge1xcbiAgICAgICAgICAgIHR5cGU6IEFycmF5KOWkp+exuy5qb2luKCcjJykpLFxcbiAgICAgICAgICAgIGl0ZW06IHQgIT0gXFxcIlxcXCIgPyB0IDogW10sXFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhUcnVlSnNvbilcXG5cXG4gICAgICAgIC8v6ZyA5qC55o2u5a6e6ZmF5L+u5pS5XFxuICAgICAgICBjb25zdCDpobXpnaLmoIfor4YgPVxcXCJ3YW5kb3VwYWdlXFxcIjtcXG4gICAgICAgIGNvbnN0IOWNlemhuea4hemZpCA9W107XFxuICAgICAgICBjb25zdCDliIbnsbvpopzoibIgPSBnZXRSYW5nZUNvbG9ycygpO1xcbiAgICAgICAgY29uc3QgSnNvbuWkp+exuyA9ICd0eXBlJztcXG4gICAgICAgIGNvbnN0IEpzb27mi7zmjqUgPSAnaXRlbSc7XFxuICAgICAgICBjb25zdCBKc29u5ouG5YiGID0gJyMnO1xcbiAgICAgICAgY29uc3QgSnNvbuWNlemhuSA9ICdAJztcXG4gICAgICAgIGNvbnN0IEpzb27liJfooaggPSBbXFxcIndhbmRvdV90YWdcXFwiLCBcXFwid2FuZG91X2NvdW50cnlcXFwiLCBcXFwid2FuZG91X3llYXJcXFwiLCBcXFwid2FuZG91X3NvcnRcXFwiXTsgLy/liIfmjaLm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XG4gICAgICAgIHZhciBwbGlzdCA9IEpTT04ucGFyc2UoZmV0Y2goanVybCkpLmRhdGFcXG4gICAgICAgIHBsaXN0Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICB2YXIgbmFtZSA9IHgubW92aWVfbmFtZTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgaW1nOiB4Lm1vdmllX2ltZ191cmwgKyBcXFwiQFJlZmVyZXI9XFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogeC5tb3ZpZV9yYXRlLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuLCB1KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgbilcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdkdXJsJywgdSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgbmFtZSwgeC5tb3ZpZV91cmwpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ21vdmllXzNfbWFycXVlZSdcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIjIu6Iy25p2v54uQXCIsXCJwYXRoXCI6XCJjdXBmb3hcIixcInJ1bGVcIjpcImpzOlxcbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UveHRvb2xzJykpLnJ1bGUpXFxuXFxuaWYgKHMgIT0gXFxcIlxcXCIpIHtcXG4gICAgbGV0IHtcXG4gICAgICAgIHdyYXAxLFxcbiAgICAgICAgcmVodG1sXFxuICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sXFxcIik7XFxuICAgIHZhciBqc29uID0gc2VhcmNoKHMsIHN0b3JhZ2UwLmdldE15VmFyKCdwYWdlJywgTVlfUEFHRSkpXFxuICAgIGlmIChKU09OLnN0cmluZ2lmeShqc29uKSAhPSBcXFwie31cXFwiKSB7XFxuICAgICAgICB2YXIgbGlzdCA9IGpzb24ucmVzb3VyY2VzO1xcbiAgICAgICAgbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgIC8vbG9nKGl0LndlYnNpdGUrJy0nK3JlaHRtbChpdC50ZXh0KSlcXG4gICAgICAgICAgICB2YXIgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD91PVxcXCIgKyBiYXNlNjRFbmNvZGUoaXQudXJsKVxcbiAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogd3JhcDEoaXQud2Vic2l0ZSArICctJyArIHJlaHRtbChpdC50ZXh0KSwgcyksXFxuICAgICAgICAgICAgICAgIHVybDogdSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0Lmljb24sXFxuICAgICAgICAgICAgICAgIGRlc2M6IGl0LndlYnNpdGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiByZWh0bWwoaXQudGV4dCksXFxuICAgICAgICAgICAgICAgICAgICB3ZWI6IGl0LndlYnNpdGUsXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgc2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AnLm1vdmllLXRpdGxlJiZUZXh0JylcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBwZGZoKHgsICdpbWcmJnNyYycpLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogcGRmaCh4LCAnLm1vdmllLXJhdGluZyYmVGV4dCcpLCAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKG4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgbilcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgbmFtZSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcblxcbiAgICAgICAgWyfng63mkq3mlrDliactdHYnLCAn54Ot6Zeo55S15b2xLW1vdmllJywgJ+eDreaSreWKqOa8qy1hbmltZScsICfng63mkq3nu7zoibotc2hvdycsICfng63mkq3nuqrlvZXniYctZG9jdW1lbnRhcnknXS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgc2V0TGlzdHMoeClcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgaWYgKHBpbmRleCA9PSBcXFwiMVxcXCIpIHtcXG5cXG5cXG4gICAgICAgIHZhciBvanNvbiA9IFt7XFxuICAgICAgICAgICAgbmFtZTogJ+eUteW9sScsXFxuICAgICAgICAgICAgaWQ6ICdtb3ZpZScsXFxuICAgICAgICAgICAgY29udGVudDoge1xcbiAgICAgICAgICAgICAgICBcXFwiY3VwZm94X2dlbnJlc1xcXCI6IFtcXFwi5YWo6YOo57G75Z6LOlxcXCIsIFxcX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BvanNvbi5tYXAoeCA9PiB7XFxuICAgICAgICAgICAg5aSn57G7LnB1c2goeC5uYW1lICsgXFxcIkBcXFwiICsgeC5uYW1lKVxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciBpbmRleCA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJpbmRleFxcXCIsICcwJylcXG5cXG4gICAgICAgIHZhciBqID0gb2pzb25baW5kZXhdXFxuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKGouY29udGVudClcXG5cXG4gICAgICAgIHZhciB0ZW1wID0ge31cXG4gICAgICAgIGtleXMuZm9yRWFjaCh4ID0+IHtcXG4gICAgICAgICAgICB2YXIgdHlwZSA9IHhcXG5cXG4gICAgICAgICAgICB2YXIgbCA9IGouY29udGVudFt4XVxcblxcbiAgICAgICAgICAgIGlmIChbJ2FyZWEnLCAnbGFuZycsICd2ZXJzaW9uJywgJ3N0YXRlJ10uaW5jbHVkZXMoeCkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGlmIChsLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgdmFyIG5zID0gbC5tYXAoKGspID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gay5pbmNsdWRlcyhcXFwiOlxcXCIpID8gay5zcGxpdCgnOicpWzBdIDoga1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGlkID0gay5pbmNsdWRlcyhcXFwiOlxcXCIpID8gay5zcGxpdCgnOicpWzFdIDoga1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnbmFtZSc6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3VybCc6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd0eXBlJzogeFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC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cCh4ID0+IHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogeC50aXRsZSxcXG4gICAgICAgICAgICAgICAgaW1nOiB4LmNvdmVyICsgXFxcIkBSZWZlcmVyPVxcXCIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IHguc3RhcixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8zX21hcnF1ZWUnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJycpLmxhenlSdWxlKChuKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwic291XFxcIiwgbilcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgeC50aXRsZSksXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLlh73mlbBcIixcInBhdGhcIjpcInh0b29sc1wiLFwicnVsZVwiOlwianM6XFxuZnVuY3Rpb24gZW5jb2RlVVRGOChzKSB7XFxudmFyIGksIHIgPSBbXSwgYywgeDtcXG5mb3IgKGkgPSAwOyBpIDwgcy5sZW5ndGg7IGkrKylcXG5pZiAoKGMgPSBzLmNoYXJDb2RlQXQoaSkpIDwgMHg4MCkgci5wdXNoKGMpO1xcbmVsc2UgaWYgKGMgPCAweDgwMCkgci5wdXNoKDB4QzAgKyAoYyA+PiA2ICYgMHgxRiksIDB4ODAgKyAoYyAmIDB4M0YpKTtcXG5lbHNlIHtcXG5pZiAoKHggPSBjIF4gMHhEODAwKSA+PiAxMCA9PSAwKSAvL+WvueWbm+Wtl+iKglVURi0xNui9rOaNouS4ulVuaWNvZGVcXG5jID0gKHggPDwgMTApICsgKHMuY2hhckNvZGVBdCg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AgICAgIH0pXFxuXFxuICAgICAgICAgICAgdmFyIGpzb24gPSBKU09OLnBhcnNlKGZldGNoUEMoYGh0dHBzOi8vd3d3LnFtdHYuYXBwL3Byb2QtYXBpL2FwcC9tb3ZpZS9pbmRleC9zZWFyY2hBbGxNb3ZpZWApKVxcblxcblxcbiAgICAgICAgICAgIHZhciBsaXN0ID0ganNvbi5kYXRhW3RdLnJlY29yZHM7XFxuXFxuICAgICAgICAgICAgbGlzdC5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBuYW1lID0geC50aXRsZTtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nOiB4LmNvdmVyLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogeC5yYXRlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3VcXFwiLCBuKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCBuYW1lKVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuXFxuICAgICAgICBbJ+eDreaSreeUteW9sS1saXN0SG90TW92aWUnLCAn54Ot5pKt55S16KeG5YmnLWxpc3RIb3RUdicsICfng63mkq3liqjmvKstbGlzdEhvdENvbWljJywgJ+eDreaSree7vOiJui1saXN0SG90VmFyaWV0eSddLm1hcCh4ID0+IHtcXG4gICAgICAgICAgICBzZXRMaXN0cyh4KVxcbiAgICAgICAgfSlcXG5cXG4gICAgfVxcblxcblxcbiAgICBpZiAocGluZGV4ID09IDEpIHtc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cXCIsIFxcXCIyMDE0XFxcIiwgXFxcIjIwMTNcXFwiLCBcXFwiMjAxMlxcXCIsIFxcXCIyMDEwXFxcIl0sXFxuICAgICAgICAgICAgICAgIFxcXCJxbXR2X3NvcnRcXFwiOiBbXFxcIui/keacn+eDreW6pjp0aW1lXFxcIiwgXFxcIumrmOWIhuS8mOWFiDpyYXRlXFxcIl0sXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfV1cXG5cXG5cXG4gICAgICAgIHZhciDlpKfnsbsgPSBbXVxcbiAgICAgICAgb2pzb24ubWFwKHggPT4ge1xcbiAgICAgICAgICAgIOWkp+exuy5wdXNoKHgubmFtZSArIFxcXCJAXFxcIiArIHgubmFtZSlcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICB2YXIgaW5kZXggPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwiaW5kZXhcXFwiLCAnMCcpXFxuXFxuICAgICAgICB2YXIgaiA9IG9qc29uW2luZGV4XVxcbiAgICAgICAgdmFyIGtleXMgPSBPYmplY3Qua2V5cyhqLmNvbnRlbnQpXFxuXFxuICAgICAgICB2YXIgdGVtcCA9IHt9XFxuICAgICAgICBrZXlzLmZvckVhY2goeCA9PiB7XFxuICAgICAgICAgICAgdmFyIHR5cGUgPSB4XFxuXFxuICAgICAgICAgICAgdmFyIGwgPSBqLmNvbnRlbnRbeF1cXG5cXG4gICAgICAgICAgICBpZiAoWydhcmVhJywgJ2xhbmcnLCAndmVyc2lvbicsICdzdGF0ZSddLmluY2x1ZGVzKHgpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVyblxcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICBpZiAobC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIHZhciBucyA9IGwubWFwKChrKSA9PiB7XFxuXFxuICAgICAgICAgICAgICAgICAgICB2YXIgbmFtZSA9IGsuaW5jbHVkZXMoXFxcIjpcXFwiKSA/IGsuc3BsaXQoJzonKVswXSA6IGtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpZCA9IGsuaW5jbHVkZXMoXFxcIjpcXFwiKSA/IGsuc3BsaXQoJzonKVsxXSA6IGtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ25hbWUnOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICd1cmwnOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAndHlwZSc6IHhcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgdGVtcFt4XSA9IG5zXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG5cXG4gICAgICAgIHZhciB0ID0gT2JqZWN0LnZhbHVlcyh0ZW1wKS5tYXAoeCA9PiB4Lm1hcCh6ID0+IEpTT04uc3RyaW5naWZ5KHopKS5qb2luKCcjJykpXFxuXFxuXFxuICAgICAgICB2YXIgVHJ1ZUpzb24gPSB7XFxuICAgICAgICAgICAgdHlwZTogQXJyYXko5aSn57G7LmpvaW4oJyMnKSksXFxuICAgICAgICAgICAgaXRlbTogdCAhPSBcXFwiXFxcIiA/IHQgOiBbXSxcXG4gICAgICAgIH1cXG4gICAgICAgIC8vbG9nKFRydWVKc29uKVxcblxcbiAgICAgICAgLy/pnIDmoLnmja7lrp7pmYXkv67mlLlcXG4gICAgICAgIGNvbnN0IOWIhuexu+minOiJsiA9IGdldFJhbmdlQ29sb3JzKCk7XFxuICAgICAgICBjb25zdCBKc29u5aSn57G7ID0gJ3R5cGUnO1xcbiAgICAgICAgY29uc3QgSnNvbuaLvOaOpSA9ICdpdGVtJztcXG4gICAgICAgIGNvbnN0IEpzb27mi4bliIYgPSAnIyc7XFxuICAgICAgICBjb25zdCBKc29u5Y2V6aG5ID0gJ0AnO1xcbiAgICAgICAgY29uc3QgSnNvbuWIl+ihqCA9IFtcXFwicW10dl9jbGFzc2lmeVxcXCIsIFxcX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ICAgICAgICAgICAgICAgICBcXFwicmVnaW9uXFxcIjogY291bnRyeSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzb3J0XFxcIjogc29ydCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0cHllXFxcIjogdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ5ZWFyc1xcXCI6IHllYXIsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJwYWdlU2l6ZVxcXCI6IDI4LFxcbiAgICAgICAgICAgICAgICBcXFwicGFnZU51bVxcXCI6IHBhZ2UsXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgKVxcbiAgICAgICAgLy9sb2coYm9keSlcXG5cXG4gICAgICAgIHZhciBqc29uID0gZmV0Y2hQQyhcXFwiaHR0cHM6Ly93d3cucW10di5hcHAvcHJvZC1hcGkvYXBwL21vdmllL2luZGV4L3NjcmVlbk1vdmllXFxcIiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgJ09yaWdpbic6ICdodHRwczovL3d3dy5xbXR2LmFwcCdcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IGJvZHksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICAvL2xvZyhqc29uKVxcblxcbiAgICAgICAgdmFyIGluZm8gPSBbXTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgaW5mbyA9IEpTT04ucGFyc2UoanNvbikuZGF0YS5yZWNvcmRzO1xcbiAgICAgICAgfSBjYXRjaCB7fVxcblxcbiAgICAgICAgaWYgKGluZm8ubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgIHZhciBkYXRhID0gaW5mbztcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgZGF0YSA9IFtdXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c21hbGw+5peg57uT5p6cPC9zYW1sbD4nLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGRhdGEubWFwKHggPT4ge1xcbiAgICAgICAgICAgIHZhciBuYW1lID0geC5uYW1lO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IHguY292ZXIsXFxuICAgICAgICAgICAgICAgIGRlc2M6IHgucmF0ZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuXFxuICAgIH1cXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLlh73mlbAyXCIsXCJwYXRoXCI6XCJ6dG9vbHNcIixcInJ1bGVcIjpcImpzOlxcbi8vdXJs6Kej5p6QXFxubGV0IHtcXG4gICAgdXJsUGFyc2VcXG59ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbFxcXCIpO1xcblxcblxcbmZ1bmN0aW9uIHN0cmluZ0luQXJyYXkoc3RyLCBhcnIpIHtcXG4gICAgcm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U6IGDigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6I0ZGNTczM1xcXCI+YCArIGRhdGF0aXRsZVxcbiAgICAgICAgICAgICAgICAvL3RpdGxlOmDigJjigJhgK2RhdGF0aXRsZStg4oCZ4oCZYFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBmdW5jdGlvbiByZW1vdmVCeVZhbHVlKGFyciwgdmFsKSB7XFxuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgYXJyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoYXJyW2ldWyd1cmwnXSA9PSB2YWwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhcnIuc3BsaWNlKGksIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlbW92ZUJ5VmFsdWUoZHVvc2VsZWN0LCBkYXRhdXJsKVxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oZGF0YXVybCwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogZGF0YXRpdGxlXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwiZHVvc2VsZWN0XFxcIiwgZHVvc2VsZWN0KTtcXG4gICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgfSwgbmFtZSwgaWQpXFxufVxcblxcbiQuZXh0ZW5kKHtcXG4gICAgbXNtOiBNdWx0aVNlbGVjdE1vZGUsXFxufSlcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaOqOmAgVwiLFwicGF0aFwiOlwicHVzaFwiLFwicnVsZVwiOlwianM6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SA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKCdzY29uZmlnJywgbyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9KVxcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICflkK/nlKjljoblj7LorrDlvZUnLFxcbiAgICAgICAgdXJsOiBsYXp5LnJlcGxhY2UoJ2FjdGlvbicsICdoaXN0b3J5JyksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfaWNvblxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgIHBpY191cmw6IFRvZignaGlzdG9yeScpLFxcbiAgICB9KTtcXG5cXG4gICAgaWYgKHNmaWcuaGlzdG9yeSA9PSB0cnVlKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5Y6G5Y+y5L+d55WZJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgICAgICBkZXNjOiAn6buY6K6kMTAnLFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoY29mKSA9PiB7XFxuICAgICAgICAgICAgICAgICQuR29TLnNhdmUoY29mLCAnaGlzdHNob3cnLCBOdW1iZXIoaW5wdXQpKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Y6G5Y+y5pWw5o2u5L+d55WZ6K6+572uOicgKyBpbnB1dDtcXG4gICAgICAgICAgICB9LCBzdG9yYWdlMC5nZXRJdGVtKCdzY29uZmlnJywgc2ZpZykpLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogJC5Hb1MuZ2V0KCdoaXN0c2hvdycpID09IDAgPyAxMCA6ICQuR29TLmdldCgnaGlzdHNob3cnKSxcXG4gICAgICAgICAgICAgICAgdHlwZTogJ251bWJlcidcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+WQr+eUqOW7uuiuricsXFxuICAgICAgICB1cmw6IGxhenkucmVwbGFjZSgnYWN0aW9uJywgJ3N1Z2dlc3QnKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9pY29uXFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgcGljX3VybDogVG9mKCdzdWdnZXN0JyksXFxuICAgIH0pO1xcblxcbiAgICAvL2xvZyhzZmlnKVxcblxcbn1cXG5cXG5zZXRSZXN1bHQoZClcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIng1YWlcIixcInBhdGhcIjpcIng1YWlcIixcInJ1bGVcIjpcIiQuZXhwb3J0cyA9IGZ1bmN0aW9uKHJ1bGUsIGFuY2hvcklkKSB7XFxuICAgIHJldHVybiAkLnRvU3RyaW5nKChydWxlLCBhbmNob3JJZCwgbW9iYW4pID0+IHtcXG4gICAgICAgIGlmICh3aW5kb3cuY2hlY2swID09IG51bGwpIHtcXG4gICAgICAgICAgICBmdW5jdGlvbiBjaGVjazAoKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImh0bWxcXFwiKS5pbm5lckhUTUw7XFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJodG1sMFxcXCIsIGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLnBhcnNlTGF6eVJ1bGVBc3luYygkJCQoKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBhbmNob3JJZCwgbW9iYW4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGdldFZhcihcXFwiaHRtbDBcXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpdXJsID0gJyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyVmFyKFxcXCJodG1sMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZygndXJsOicgKyB1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuc3RhcnRzV2l0aCgnaHR0cHM6Ly9jdXBmb3guYXBwL3BhZ2U/dXJsPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYmFzZXVybCA9IHVybC5yZXBsYWNlKC8uK3VybD0oLio/KSYuKy9nbSwgJyQxJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl1cmwgPSBiYXNlNjREZWNvZGUoYmFzZXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignaWZyYW1lJywgaXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZygnaXVybDonICsgaXVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cmwuc3RhcnRzV2l0aCgnaHR0cHM6Ly9tLnFtdHYuYXBwLyMvdGhpcmQtcGFnZT9wbGF5dXJsPScpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgYmFzZXVybD11cmwucmVwbGFjZSgvLio/cGxheXVybD0oLio/KSQvZ20sJyQxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdXJsPWRlY29kZVVSSUNvbXBvbmVudChiYXNldXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignaWZyYW1lJywgaXVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ2l1cmw6JyArIGl1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBpdXJsLmxlbmd0aCA+IDAgPyBcXFwiMVxcXCIgOiBcXFwiMFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBydWxlLCBsb2NhdGlvbi5ocmVmLCBhbmNob3JJZCwgbW9iYW4pLCAkJCQudG9TdHJpbmcoKHJ1bGUsIG1vYmFuKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhydWxlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChcXFwiMFxcXCIgPT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmNoZWNrYyA9IHdpbmRvdy5jaGVja2MgKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmlmICh3aW5kb3cuY2hlY2tjID4gMTIwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmiafooYzotoXov4czMOenku+8jOaXoOazleino+aekFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQod2luZG93LmNoZWNrMCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy99XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybCA9IGZiYS5nZXRWYXIoJ2lmcmFtZScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKCdtb2JhbicgKyBtb2JhbilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1vYmFuID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGU6IHJ1bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+W9seeJh+ivpuaDhScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncm91cDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVSdWxlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VzOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vcGFnZS9wP3J1bGU9JyArIHJ1bGUgKyAnJnU9JyArIHVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmRSdWxlOiBcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja3VybCA9IGxvY2F0aW9uLmhyZWY7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrdTAoKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2luZG93LmNoZWNrdXJsICE9IGxvY2F0aW9uLmhyZWYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2hhc2jlj5HnlJ/kuoblj5jljJZcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2tjID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2swKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMjAwMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2t1MCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja3UwKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgcnVsZSwgbW9iYW4pKTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dCh3aW5kb3cuY2hlY2swLCAyNTApO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSAwO1xcbiAgICAgICAgICAgIHdpbmRvdy5jaGVjazAgPSBjaGVjazA7XFxuICAgICAgICAgICAgY2hlY2swKCk7XFxuICAgICAgICB9XFxuICAgIH0sIHJ1bGUsIGF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ICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG5cXG5cXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnLm1vdmllWnkmJmEnKVxcbiAgICAgICAgaWYgKGxpc3QgJiYgbGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgTVlfVVJMID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICBtZXJnZVxcbiAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ3VsJiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG1lcmdlKHQsICfor6bmg4UnLCAxKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL29uTGluZS5wbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyb206ICdob21lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBkID0gZC5jb25jYXQobGlzdClcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfml6DotYTmupAnLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgfVxcblxcbn1cXG5zID0gZ2V0TXlWYXIoXFxcInNvdVxcXCIsIFxcXCJcXFwiKTtcXG5cXG5sZXQgciA9IFxcXCJcXFwiO1xcbmlmIChzICE9IFxcXCJcXFwiKSB7XFxuXFxuICAgIHZhciB1cmwgPSBwb3N0KGBodHRwczovL3d3dy43MjU5OTguY29tL2tleXdvcmRzLmh0bWxgLCB7XFxuICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAga2V5d29yZHM6IHMsXFxuICAgICAgICAgICAgdHlwZTogJ21vdmllJ1xcbiAgICAgICAgfSxcXG4gICAgICAgIG9ubHlIZ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RpY2FsX3BpYycsXFxuICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgZGVzYzogJ+ivhOWIhjonICsgc2NvcmUgKyAnXFxcXG4nICsgZGVzYyxcXG4gICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocnVsZSwgdXJsLCBzKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyh1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoISFjbHMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh1cmwpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJy5tb3ZpZVp5JiZhJylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ZX1VSTCA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVyZ2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3Rvb2w/cnVsZT1cXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBsaXN0Lm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdCA9IHBkZmgoaXQsICd1bCYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJoaWtlcjovL3BhZ2UvcD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZ1PVxcXCIgKyBiYXNlNjRFbmNvZGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gZ2V0SXRlbSgnYWknLCAnMCcpID09ICcwJyA/IHUgOiB1ICsgJyNpbW1lcnNpdmVUaGVtZSMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBtZXJnZSh0LCAn6K+m5oOFJywgMSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cuNzI1OTk4LmNvbS9zdGF0aWMvc2VhcmNoL2ltYWdlcy9vbkxpbmUucG5nJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcm9tOiAnaG9tZScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn5peg6LWE5rqQJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgTVlfUlVMRS50aXRsZSwgdXJsLCBzKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBzZXRSZXN1bHQoZClcXG59IGVsc2Uge1xcblxcbn1cXG5cXG5pZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5byAJykge1xcbiAgICBmdW5jdGlvbiBzZXRMaXN0cyhpdGVtKSB7XFxuICAgICA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ICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBzY29yZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIG5hbWUsIHVybClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBbJ+eUteW9sSMxJywgJ+eUteinhuWJpyMyJywgJ+WKqOa8qyMzJywgJ+e6quW9leeJhyM0J10ubWFwKHggPT4ge1xcblxcbiAgICAgICAgc2V0TGlzdHMoeClcXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCI2LueUteW9seeLl1wiLFwicGF0aFwiOlwiZHlkb2dcIixcInJ1bGVcIjpcImpzOlxcbk1ZX1VSTD0naHR0cHM6Ly93d3cuZGlhbnlpbmdnb3UuY29tL3NvTW9yZS9hbGwtYWxsLWFsbC1hbGwtJztcXG5sZXQgZHVybCA9IGdldE15VmFyKFxcXCJkdXJsXFxcIiwgXFxcIlxcXCIpO1xcbmlmIChkdXJsICE9ICcnKSB7XFxuICAgIC8vbG9nKGR1cmwpXFxuXFxuICAgIGxldCB1cmwgPSBkdXJsO1xcbiAgICBsZXQgaWQgPSB1cmw7XFxuICAgIGxldCBuYW1lID0gcztcXG4gICAgdHJ5IHtcXG4gICAgICAgIHZhciBodG1sID0gZmV0Y2godXJsKTtcXG4gICAgfSBjYXRjaCB7XFxuICAgICAgICB2YXIgaHRtbCA9ICcnXFxuICAgIH1cXG4gICAgdmFyIHJ1bGUgPSBNWV9SVUxFLnRpdGxlXFxuXFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogcGRmaChodG1sLCAnaDQmJlRleHQnKSxcXG4gICAgICAgIGltZzogcGRmaChodG1sLCAnaW1nJiZkYXRhLXVybCcpLFxcbiAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycsXFxuICAgICAgICBkZXNjOiBwZGZoKGh0bWwsICdib2R5JiYucHViVGltZSYmVGV4dCcpLFxcbiAgICAgICAgdXJsOiB1cmwsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiB1cmwsXFxuICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICB9KVxcblxcbiAgICBsZXQgaHRtbCA9IGZldGNoKGBodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vU3BpZGVyTW92aWUvenkvJHtuYW1lfWAsIHtcXG4gICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAneC1yZXF1ZXN0ZWQtd2l0aCc6ICdYTUxIdHRwUmVxdWVzdCdcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnLm1vdmllWnkmJmEnKVxcbiAgICBpZiAobGlzdCAmJiBsaXN0Lmxlbmd0aCA+IDApIHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgTVlfVVJMID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgd3JhcDFcXG4gICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICBcXG4gICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdSA9IHBkZmgoaXQsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ2xpLDAmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgbGV0IHdlYj1wZGZoKGl0LCAnbGksMSYmVGV4dCcpO1xcbiAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAxKHdlYisnLScrdCwgcyksXFxuICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL29uTGluZS5wbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTp0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdlYjp3ZWIsXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBkID0gZC5jb25jYXQobGlzdClcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtc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ub1Njb3JlJiZUZXh0Jyk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiB3cmFwKG5hbWUsIHMpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcbiAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgIGRlc2M6ICfor4TliIY6JyArIHNjb3JlICsgJ1xcXFxuJyArIGRlc2MsXFxuICAgICAgICAgICAgdXJsOiAkKHVybCkubGF6eVJ1bGUoKHJ1bGUsIHVybCwgcywgbmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgY2xzID0gZmluZEl0ZW1zQnlDbHModXJsKTtcXG4gICAgICAgICAgICAgICAgaWYgKCEhY2xzKSB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtQnlDbHModXJsKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlkID0gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChgaHR0cHM6Ly93d3cuZGlhbnlpbmdnb3UuY29tL1NwaWRlck1vdmllL3p5LyR7bmFtZX1gLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAneC1yZXF1ZXN0ZWQtd2l0aCc6ICdYTUxIdHRwUmVxdWVzdCdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnLm1vdmllWnkmJmEnKVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxpc3QgJiYgbGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgTVlfVVJMID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cmFwMVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbD9ydWxlPVxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IGxpc3QubWFwKGl0ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1ID0gcGRmaChpdCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgJ2xpLDAmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3ZWI9cGRmaChpdCwgJ2xpLDEmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaGlrZXI6Ly9wYWdlL3A/cnVsZT1cXFwiICsgcnVsZSArIFxcXCImdT1cXFwiICsgYmFzZTY0RW5jb2RlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGdldEl0ZW0oJ2FpJywgJzAnKSA9PSAnMCcgPyB1IDogdSArICcjaW1tZXJzaXZlVGhlbWUjJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogd3JhcDEod2ViKyctJyt0LCBzKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy43MjU5OTguY29tL3N0YXRpYy9zZWFyY2gvaW1hZ2VzL29uTGluZS5wbmcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTp0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWI6d2ViLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1BZnRlcihpZCwgbGlzdCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgIH0sIE1ZX1JVTEUudGl0bGUsIHVybCwgcywgbmFtZSksXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHVybCxcXG4gICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cX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ICAgICAgIGlmIChpbWcgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgaW1nID0gXFxcImh0dHBzOi8vd3d3LmRpYW55aW5nZ291LmNvbS9WaWV3L2ltYWdlcy9ibGFua19iZy5wbmdcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgdXJsID0gcGQoeCwgJ2EmJmhyZWYnKTtcXG4gICAgICAgICAgICBsZXQgc2NvcmUgPSBwZGZoKHgsICcubm9TY29yZSYmVGV4dCcpO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgZGVzYzogc2NvcmUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnJykubGF6eVJ1bGUoKG4sIHUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3VcXFwiLCBuKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2R1cmwnLCB1KVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBuYW1lLCB1cmwpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gaG9tZSgpIHtcXG4gICAgICAgIFsn55S15b2xI21vdmllJywgJ+eUteinhuWJpyN0dicsICfnuqrlvZXniYcjZG9jJywgJ+WKqOa8qyNjb21pYyddLm1hcCh4ID0+IHtcXG5cXG4gICAgICAgICAgICBzZXRMaXN0cyh4KVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBcXG4gICAgdmFyIHBhZ2U9TVlfUEFHRTtcXG4gICAgbGV0IHRydWVfdXJsID0gZ2V0TXlWYXIoTVl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G4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1LFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3ZWI6IHdlYixcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQgPSBkLmNvbmNhdChsaXN0KVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn1cXG5zID0gZ2V0TXlWYXIoXFxcInNvdVxcXCIsIFxcXCJcXFwiKTtcXG5sZXQgciA9IFxcXCJcXFwiO1xcbmlmIChzICE9IFxcXCJcXFwiKSB7XFxuICAgIHZhciBwYWdlID0gTVlfUEFHRTtcXG4gICAgTVlfVVJMID0gYGh0dHBzOi8vd3d3LnRic2R5LmNvbS9zZWFyY2guaHRtbD9rZXl3b3JkPSR7c30mcGFnZWQ9JHtwYWdlfSZjYXRlZ29yeT1gO1xcbiAgICAvL2xvZyhNWV9VUkwpXFxuICAgIGxldCBodG1sID0gZmV0Y2goTVlfVVJMLCB7XFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgdmFyIGxpc3QgPSBwZGZhKGh0bWw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AgIHZhciBjbHMgPSBmaW5kSXRlbXNCeUNscyh1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoISFjbHMpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscyh1cmwpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICdib2R5JiYudmlkZW9fZG93bmxvYWRfbGlua19pdGVtJylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChsaXN0ICYmIGxpc3QubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1ZX1VSTCA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyYXAxXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS90b29sP3J1bGU9XFxcIiArIHJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gbGlzdC5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUgPSBwZGZoKGl0LCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCAnLnZpZGVvX2Rvd25sb2FkX2xpbmtfbmFtZV90ZXh0JiZUZXh0Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgd2ViID0gcGRmaChpdCwgJy5yZXNvdXJjZV93ZWJzaXRlX25hbWUmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBwZChpdCwgJy52aWRlb19sYWJlbHMmJmltZyYmc3JjJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImhpa2VyOi8vcGFnZS9wP3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnU9XFxcIiArIGJhc2U2NEVuY29kZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBnZXRJdGVtKCdhaScsICcwJykgPT0gJzAnID8gdSA6IHUgKyAnI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAxKHdlYiArICctJyArIHQsIHMpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiB1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2VUaXRsZTogdCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2ViOiB3ZWIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKGlkLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgTVlfUlVMRS50aXRsZSwgdXJsLCBzLCBuYW1lKSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogdXJsLFxcbiAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcblxcbiAgICBzZXRSZXN1bHQoZClcXG59IGVsc2Uge1xcblxcbn1cXG5cXG5pZiAoZ2V0SXRlbSgnaG9tZScsICflhbMnKSA9PSAn5byAJykge1xcbiAgICB2YXIgcGFnZSA9IE1ZX1BBR0U7XFxuICAgIGxldCB7XFxuICAgICAgICBzZXRwYWdlZFxcbiAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdG9vbFxcXCIpO1xcblxcbiAgICB2YXIgcGluZGV4ID0gc2V0cGFnZWQoZCwgcGFnZSwgXFxcInRic2R5X3B0YWdcXFwiLCBbXFxcIummlumhtVxcXCIsIFxcXCLliIbnsbtcXFwiXSwgXFxcIiM0NjgyQjRcXFwiKTtcXG4gICAgaWYgKHBpbmRleCA9PSAwKSB7XFxuXFxuICAgICAgICBsZXQgaHRtbCA9IGZldGNoKCdodHRwczovL3d3dy50YnNkeS5jb20vJywge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBQQ19VQVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgZnVuY3Rpb24gc2V0TGlzdHMoaXRlbSkge1xcbiAgICAgICAgICAgIE1ZX1VSTCA9ICdodHRwczovL3d3dy50YnNkeS5jb20vJztcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLm5hbWU7XFxuICAgICAgICAgICAgdmFyIGtleSA9IGl0ZW0uc2VsZWN0O1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nLFxcbiAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsIGBib2R5JiYuY29udGFpbmVyX21haW5faG90XyR7a2V5fSYmLmhvdF9yZXNvdXJjZV9vbmVgKVxcblxcbiAgICAgICAgICAgIGxpc3QubWFwKHggPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgbmFtZSA9IHBkZmgoeCwgJy5yZXNvdXJjZV9uYW1lJiZUZXh0JylcXG4gICAgICAgICAgICAgICAgbGV0IGltZyA9IHBkKHgsICcucmVzb3VyY2VfcG9zdGVycyYmZGF0YS11cmwnKTtcXG4gICAgICAgICAgICAgICAgaWYgKGltZyA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgaW1nID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IHBkKHgsICdhJiZocmVmJyk7XFxuXFxuICAgICAgICAgICAgICAgIGxldCBzY29yZSA9IHBkZmgoeCwgJy51cGRhdGVfdGlwfHwucmVzb3VyY2Vfc2NvcmV8fGltZyYmVGV4dCcpO1xcblxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IHNjb3JlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJzb3VcXFwiLCBuKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdkdXJsJywgdSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICAgICAgfSwgbmFtZSwgdXJsKVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuXFxuICAgICAgICBbe1xcbiAgICAgICAgICAgIG5hbWU6ICfng63pl6jnlLXop4bliacnLFxcbiAgICAgICAgICAgIHNlbGVjdDogJ3R2cycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF90di5zdmcnLFxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIG5hbWU6ICfng63pl6jnlLXlvbEnLFxcbiAgICAgICAgICAgIHNlbGVjdDogJ21vdmllcycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF9tdi5zdmcnXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgbmFtZTogJ+eDremXqOWKqOa8qycsXFxuICAgICAgICAgICAgc2VsZWN0OiAnYW5pbWVzJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy50YnNkeS5jb20vaW1nL21yc3cvd2ViL2luZGV4L2luZGV4X3Nob3cuc3ZnJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIG5hbWU6ICfng63pl6jnu7zoibonLFxcbiAgICAgICAgICAgIHNlbGVjdDogJ3ZhcmlldHlzJyxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL3d3dy50YnNkeS5jb20vaW1nL21yc3cvd2ViL2luZGV4L2luZGV4X3JlY29yZHMuc3ZnJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIG5hbWU6ICfng63pl6jnuqrlvZXniYcnLFxcbiAgICAgICAgICAgIHNlbGVjdDogJ2RvY3VtZW50YXJ5cycsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly93d3cudGJzZHkuY29tL2ltZy9tcnN3L3dlYi9pbmRleC9pbmRleF9yZWNvcmRzLnN2ZycsXFxuICAgICAgICB9XS5tYXAoeCA9PiB7XFxuXFxuICAgICAgICAgICAgc2V0TGlzdHMoeClcXG4gICAgICAgIH0pXFxuICAgIH1cXG5cXG4gICAgaWYgKHBpbmRleCA9PSAxKSB7XFxuICAgICAgICBNWV9VUkwgPSBcXFwiaHR0cHM6Ly93d3cudGJzZHkuY29tL2NsYXNzaWZ5Lmh0bWxcXFwiO1xcblxcbiAgICAgICAgY29uc3Qg6aG16Z2i5qCH6K+GID0gJ2FpdGJzZHknXFxuICAgICAgICBjb25zdCDliIbnsbvpopzoibIgPSBnZXRSYW5nZUNvbG9ycygpO1xcbiAgICAgICAgY29uc3Qg5aSn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xcbiAgICAgICAgdmFyIGh0bWwgPSBmZXRjaFBDKHRydWVfdXJsKTtcXG4gICAgICAgIC8vbG9nKGh0bWwpXFxuXFxuICAgICAgICAvL+WKqOaAgeWIhuexu1xcbiBldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL2R0ZmwnKSkucnVsZSk7XFxuXFxuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJi5jbGFzc2lmeV9tYWluX3Jlc291cmNlcyYmYScpXFxuXFxuICAgICAgICBsaXN0Lm1hcCh4ID0+IHtcXG4gICAgICAgICAgICB2YXIgbmFtZSA9IHBkZmgoeCwgJy5yZXNvdXJjZV9uYW1lJiZUZXh0JylcXG4gICAgICAgICAgICBsZXQgaW1nID0gcGQoeCwgJ2ltZyYmZGF0YS11cmwnKTtcXG4gICAgICAgICAgICBpZiAoaW1nID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGltZyA9IFxcXCJodHRwczovL3d3dy5kaWFueWluZ2dvdS5jb20vVmlldy9pbWFnZXMvYmxhbmtfYmcucG5nXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHVybCA9IHBkKHgsICdhJiZocmVmJyk7XFxuICAgICAgICAgICAgbGV0IHNjb3JlID0gcGRmaCh4LCAnLnJlc291cmNlX3Njb3JlJiZUZXh0Jyk7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5hbWUsXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBzY29yZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcnKS5sYXp5UnVsZSgobiwgdSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcInNvdVxcXCIsIG4pXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZHVybCcsIHUpXFxuICAg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ICAgICAgICAgICBpZih0aXRsZT09Jycpe1xcbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm5cXG4gICAgICAgICAgICAgICAgICAgIH1cXG7CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoGQucHVzaCh7XFxuwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoHRpdGxlOsKga2V5LnRvU3RyaW5nKCnCoD09PcKgY2F0ZV90ZW1wW2luZGV4XcKgP8KgXFxcIuKAnOKAnOKAneKAnVxcXCLCoCvCoHRpdGxlLmZvbnRjb2xvcijliIbnsbvpopzoibIpwqA6wqB0aXRsZSxcXG7CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgdXJsOsKgJChpdGVtKycjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMscGFnZXRhYixsaXN0KcKgPT7CoHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqPUpTT04ucGFyc2UoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHVybD1vYmpbJ3VybCddXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHR5cGU9b2JqWyd0eXBlJ11cXG4gICAgICAgICAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0Lm1hcChrZXk9PntcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXG7CoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF3CoD3CoHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcblxcbsKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqD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