xiaomianao666

小程序:APP影视(P)

Nov 25th, 2024
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@APP影视(P)@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvY2hhcHRlcicsIHt9KSkucnVsZSk7IiwidGl0bGUiOiJBUFDlvbHop4YoUCkiLCJhdXRob3IiOiLpppnpm4Xmg4UiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTMsImNvbF90eXBlIjoibW92aWVfMyIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoiYWxsIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgaXRlbXMgPSBbXTtcbnZhciBzZWxmID0gSlNPTi5wYXJzZShnZXRSdWxlKCkpLnRpdGxlO1xudmFyIHNldGpzb24gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL3h5cS9hcHBtc2V0Lmpzb24nLCB7fSkpO1xudmFyIHNzbWQgPSBzZXRqc29uLnNzbW9kZTtcbnZhciBzc3hjID0gc2V0anNvbi5zc2NvdW50O1xudmFyIGxvY3ZlciA9IE1ZX1JVTEUudmVyc2lvbjtcblxuaXRlbXMucHVzaCh7XG4gICAgdGl0bGU6ICfwn5SN6K6+572uJyArICcoJyArIChzc21kID09IDEgPyAn6IGaJyArIHNzeGMgOiAn5YiXJykgKyAnKScsXG4gICAgLy90aXRsZSA6ICfwn5SN6K6+572uJysnKCcrc3N4YysnKScsXG4gICAgdXJsOiAkKCdoaWtlcjovL2VtcHR5JykucnVsZSgobG9j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AgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KZpeW9k+WJjeesrCcgKyBwbiArICfpobUnLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IHVybG8ucmVzb3VyY2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gdXJsby5yZXNvdXJjZXNbaV0udGV4dC5yZXBsYWNlKC9cXDwuKj9cXD4vZywgJycpO1xuICAgICAgICAgICAgICAgIHZhciB1cmwgPSB1cmxvLnJlc291cmNlc1tpXS51cmw7XG4gICAgICAgICAgICAgICAgdmFyIGRlc2MgPSB1cmxvLnJlc291cmNlc1tpXS53ZWJzaXRlO1xuICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZS5yZXBsYWNlKGdldFZhcigneHlxYXBweXN0ZXh0JyksICfigJzigJwnICsgZ2V0VmFyKCd4eXFhcHB5c3RleHQnKSArICfigJ3igJ0nKSArICcgICcgKyBkZXNjICsgJyAg5Zyo57q/JyxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiB1cmwsXG4gICAgICAgICAgICAgICAgICAgIC8vZGVzYzogJ+WcqOe6v+aQnOe0oue7k+aenCcsXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJ1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHVybHQucmVzb3VyY2VzLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgIGZvciAodmFyIGogPSAwOyBqIDwgdXJsdC5yZXNvdXJjZXMubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSB1cmx0LnJlc291cmNlc1tqXS50ZXh0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nVybDtcbiAgICAgICAgdmFyIGltZyA9IGxpc3Rbal0uaW1nO1xuICAgICAgICB2YXIgbGl0aXQgPSBsaXN0W2pdLm11cmw7XG4gICAgICAgIGlmICgvXFwvdm9kXFwvL2kudGVzdCh0dXJsKSkge1xuICAgICAgICAgICAgdmFyIHVybCA9ICdoaWtlcjovL2VtcHR5JCQnICsgbGl0aXQgKyAnJCQnICsgdHVybCArICckJD9hYz1saXN0JmNsYXNzPSZwYWdlPWZ5cGFnZSZhcmVhPSZ0eXBlPSZzdGFydD0kJCc7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAodHVybC5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgIHZhciB1cmwgPSAnaGlrZXI6Ly9lbXB0eSQkJyArIGxpdGl0ICsgJyQkJyArIHR1cmwgKyAnJCRpbmRleF92aWRlbz90b2tlbj0kJCc7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHR1cmwuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgdmFyIHVybCA9ICdoaWtlcjovL2VtcHR5JCQnICsgbGl0aXQgKyAnJCQnICsgdHVybCArICckJGluZGV4X3ZpZGVvP3Rva2VuPSQkJztcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdmFyIHVybCA9ICdoaWtlcjovL2VtcHR5JCQnICsgbGl0aXQgKyAnJCQnICsgdHVybCArICckJC92b2RQaGJBbGwkJCc7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgICAgIHBpY191cmw6IGltZyxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9yb3VuZF9zbWFsbF80J1xuICAgICAgICB9KTtcbiAgICB9XG59XG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gICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHR5cGxbaV0sXG4gICAgICAgICAgICAgICAgdXJsOiAkKHR5dXJsKS5ydWxlKChtdXJsKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XG4gICAgICAgICAgICAgICAgICAgIHZhciBtdXJsID0gbXVybDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3R2bGlzdGRhdGEnLCB7fSkpLnJ1bGUpO1xuICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xuICAgICAgICAgICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XG4gICAgICAgICAgICAgICAgfSwgbXVybCksXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHRyeSB7XG4gICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShmZXRjaCh0dXJsKSk7XG4gICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3R2bGlzdGRhdGEnLCB7fSkpLnJ1bGUpO1xuICAgIH0gY2F0Y2ggKGUpIHt9XG59IGVsc2Uge1xuICAgIGlmICgvZGlqaWF4aWEvLnRlc3QobXVybCkpIHtcbiAgICAgICAgbXVybCA9ICdodHRwOi8vd3d3LmRpamlheGlhLmNvbS9hcGkucGhwL2FwcC8nXG4gICAgfVxuICAgIHRyeSB7XG4gICAgICAgIGlmIChtdXJsLnNlYXJjaCgvYXBpLnBocFxcL2FwcC8pICE9IC0xKSB7XG5cbiAgICAgICAgICAgIHZhciB0eXBjb2RlID0gcmVxdWVzdChtdXJsICsgXCJuYXY/dG9rZW49XCIsIHtcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgIFwiVXNlci1BZ2VudFwiOiBcIkRhcnQvMi4xNCAoZGFydDppbylcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgaWYgKHR5cGNvZGUuaW5kZXhPZign5qOA5rWL5LitJykgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICB0eXBjb2RlID0gZmV0Y2gobXVybCArIFwibmF2P3Rva2VuPVwiICsgJyZidHdhZicgKyB0eXBjb2RlLm1hdGNoKC9idHdhZiguKj8pXFxcIi8pWzFdLCB7fSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB2YXIgdHlwZWMgPSBKU09OLnBhcnNlKHR5cGNvZGUpLmxpc3Q7XG5cbiAgICAgICAgfSBlbHNlIGlmIChtdXJsLnNlYXJjaCgveGdhcHAucGhwXFwvdjEvKSAhPSAtMSkge1xuXG4gICAgICAgICAgICB2YXIgdHlwY29kZSA9IHJlcXVlc3QobXVybCArIFwibmF2P3Rva2VuPVwiLCB7XG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogXCJEYXJ0LzIuMTQgKGRhcnQ6aW8pXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGlmICh0eXBjb2RlLmluZGV4T2YoJ+ajgOa1i+S4rScpICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgdHlwY29kZSA9IGZldGNoKG11cmwgKyBcIm5hdj90b2tlbj1cIiArICcmYnR3YWYnICsgdHlwY29kZS5tYXRjaCgvYnR3YWYoLio/KVxcXCIvKVsxXSwge30pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHR5cGVjID0gSlNPTi5wYXJzZSh0eXBjb2RlKS5kYXRhO1xuXG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobXVybC5zZWFyY2goL21vZ2FpX2FwaS8pICE9IC0xKSB7XG4gICAgICAgICAgICAgICAgdmFyIHR5cGNvZGUgPSByZXF1ZXN0KG11cmwgKyBcIi90eXBlc1wiLCB7XG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiVXNlci1BZ2VudFwiOiBcIkRhcnQvMi4xNCAoZGFydDppbylcIlxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHZhciB0eXBjb2RlID0gcmVxdWVzdChtdXJsICsgXCIvdHlwZXNcIiwge1xuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogXCJva2h0dHAvNC4xLjBcIlxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpZiAodHlwY29kZS5pbmRleE9mKCfmo4DmtYvkuK0nKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgIHR5cGNvZGUgPSBmZXRjaChtdXJsICsgXCIvdHlwZXNcIiArICc/YnR3YWYnICsgdHlwY29kZS5tYXRjaCgvYnR3YWYoLio/KVxcXCIvKVsxXSwge30pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgdmFyIHR5cGVjID0gSlNPTi5wYXJzZSh0eXBjb2RlKS5kYXRhLmxpc3Q7XG5cbiAgICAgICAgfVxuICAgICAgICB2YXIgdHlwZXQgPSBcIlwiLFxuICAgICAgICAgICAgdHlwZWwgPSBcIlwiO1xuICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHR5cGVjLmxlbmd0aDsgaisrKSB7XG4gICAgICAgICAgICB0eXBldCArPSB0eXBlY1tqXS50eXBlX25hbWU7XG4gICAgICAgICAgICB0eXBlbCArPSB0eXBlY1tqXS50eXBlX2lkO1xuICAgICAgICAgICAgaWYgKGogPCB0eXBlYy5sZW5ndGggLSAxKSB7XG4gICAgICAgICAgICAgICAgdHlwZXQgKz0gXCImXCI7XG4gICAgICAgICAgICAgICAgdHlwZWwgKz0gXCImXCI7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdmFyIHR5cHQgPSB0eXBldC5zcGxpdCgnJicpO1xuICAgICAgICB2YXIgdHlwbCA9IHR5cGVsLnNwbGl0KCcmJyk7XG5cbiAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCB0eXB0Lmxlbmd0aDsgaSsrKSB7XG4gICAgICAgICAgICBpZiAobXVybC5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xuICAgICAgICAgICAgICAgIGlmICgvZmFudHVhbi8udGVzdChtdXJsKSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgdHl1cmwgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW8/cGc9ZnlwYWdlJnRpZD0nICsgdHlwbFtpXSArICcmY2xhc3M9JmFyZWE9Jmxhbmc9JnllYXI9JnRva2VuPTtnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0eXVybCA9IG11cmwgKyAndmlkZW8/cGc9ZnlwYWdlJnRpZD0nICsgdHlwbFtpXSArICcmY2xhc3M9JmFyZWE9Jmxhbmc9JnllYXI9JnRva2VuPTtnZXQ7dXRmLTg7e1VzZXItQWdlbn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hZ2UmbGltaXQ9OTtnZXQ7dXRmLTg7e1VzZXItQWdlbnRAb2todHRwLzQuMS4wfSdcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogdHlwdFtpXSxcbiAgICAgICAgICAgICAgICB1cmw6ICQodHl1cmwpLnJ1bGUoKG11cmwpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlcyA9IHt9O1xuICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcbiAgICAgICAgICAgICAgICAgICAgdmFyIG11cmwgPSBtdXJsO1xuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzY29kZSA9IGdldFJlc0NvZGUoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHJlc2NvZGUuaW5kZXhPZign5qOA5rWL5LitJykgIT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc2NvZGUgPSBmZXRjaChNWV9VUkwgKyAnJmJ0d2FmJyArIHJlc2NvZGUubWF0Y2goL2J0d2FmKC4qPylcXFwiLylbMV0sIHt9KTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UocmVzY29kZSk7XG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcGxpc3RkYXRhJywge30pKS5ydWxlKTtcblxuICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xuICAgICAgICAgICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XG4gICAgICAgICAgICAgICAgfSwgbXVybCksXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgICAgaXRlbXMucHVzaCh7XG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXG4gICAgICAgIH0pO1xuICAgIH0gY2F0Y2ggKGUpIHt9XG5cblxuICAgIHRyeSB7XG4gICAgICAgIGlmIChtdXJsLnNlYXJjaCgvbW9nYWlfYXBpLykgIT0gLTEpIHtcbiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdCh0dXJsLCB7XG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogXCJEYXJ0LzIuMTQgKGRhcnQ6aW8pXCJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHZhciBodG1sID0gcmVxdWVzdCh0dXJsLCB7XG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICBcIlVzZXItQWdlbnRcIjogXCJva2h0dHAvNC4xLjBcIlxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGlmIChodG1sLmluZGV4T2YoJ+ajgOa1i+S4rScpICE9IC0xKSB7XG4gICAgICAgICAgICBodG1sID0gZmV0Y2godHVybCArICcmYnR3YWYnICsgaHRtbC5tYXRjaCgvYnR3YWYoLio/KVxcXCIvKVsxXSwge30pO1xuICAgICAgICB9XG4gICAgICAgIHZhciBodG1sID0gSlNPTi5wYXJzZShodG1sKTtcbiAgICAgICAgLy9sb2coaHRtbCk7XG4gICAgICAgIC8vaWYgKG11cmwuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XG4gICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcGluZGV4ZGF0YScsIHt9KSkucnVsZSk7XG4gICAgICAgIC8vfSBlbHNlIHtcbiAgICAgICAgLy9sb2coaHRtbCk7XG4gICAgICAgIC8vZXZhbChKU09OLn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xpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJz9hYz1saXN0JnptPScgKyBrZXkgKyAnJnBhZ2U9ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP2FjPWxpc3Qmd2Q9JyArIGtleSArICcmcGFnZT1meXBhZ2UnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKC9kaWppYXhpYS8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGluayA9ICdodHRwOi8vd3d3LmRpamlheGlhLmNvbS9hcGkucGhwL2FwcC8nXFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIGlmIChsaW5rLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz1meXBhZ2UmdGV4dD0nICsga2V5ICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmsuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz1meXBhZ2UmdGV4dD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9pb3Blbnl1bi8udGVzdChsaW5rKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnL2xpc3Q/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGhtdXJsID0gbGluayArICc/cGFnZT1meXBhZ2UmbGltaXQ9MTAmd2Q9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGxpc3Rbal0udGl0bGUsXFxuICAgICAgICAgICAgICAgIGltZzogbGlzdFtqXS5pbWcsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSN4IycgKyBobXVybCArICcjeCMnICsgbGluayArICcjeCMnICsgbGl0aXQgKyAnI3gjJyArIGtleSArICcjeCMnKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3NlYXJlcmonKTtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnaWNvbl9yb3VuZF9zbWFsbF80J1xcbiAgICAgICAgICAgICAgICAvL2NvbF90eXBlOiAndGV4dF8zJ1xcbiAgICAgICAgICAgICAgICAvL2xpbms6bGluayxcXG4gICAgICAgICAgICAgICAgLy90eXBlOiBpXFxuICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICB9IC8vZm9yIGpcXG5cXG5cXG4gICAgfSAvL2ZvciBpXFxuXFxufSAvL2VuZCBtb2RlIDBcXG5cXG5cXG5yZXMuZGF0YSA9IGl0ZW1zO1xcbnNldEhvbWVSZXN1bHQocmVzKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIkFQUOWIhuexu+WIl+ihqFwiLFwicGF0aFwiOlwiYXBwbGlzdGRhdGFcIixcInJ1bGVcIjpcImlmIChodG1sLmxpc3QpIHtcXG4gICAgdmFyIGxpc3QgPSBodG1sLmxpc3Q7XFxufSBlbHNlIGlmIChodG1sLmRhdG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L2FwaS5waHAvYXBwL3ZpZGVvX2RldGFpbD9pZD0nICsgdXJsO1xcbiAgICB9XFxuICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICB1cmw6ICQobGluaykucnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgdmFyIHJlcyA9IHt9O1xcbiAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAnJyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZWZyZXNoWDVXZWJWaWV3KCcnKTtcXG4gICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXG4gICAgICAgICAgICB2YXIgbXl1cmwgPSBNWV9VUkwubWF0Y2goLyhbXFxcXFNdKj86XFxcXC9cXFxcL1tcXFxcU10qPylcXFxcLy8pWzFdO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcG1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgcmVzLmRhdGEgPSBpdGVtcztcXG4gICAgICAgICAgICBzZXRIb21lUmVzdWx0KHJlcyk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICBjb2xfdHlwZTogJ21vdmllXzNfbWFycXVlZSdcXG4gICAgfSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiVFbliJfooajop6PmnpBcIixcInBhdGhcIjpcInR2bGlzdGRhdGFcIixcInJ1bGVcIjpcInZhciBsaXN0ID0gaHRtbC5kYXRhO1xcbmZvciAodmFyIGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnRpdGxlO1xcbiAgICB2YXIgaW1nID0gbGlzdFtpXS5waWM7XFxuICAgIHZhciB1cmwgPSBsaXN0W2ldLm5leHRsaW5rO1xcbiAgICB2YXIgZGVzYyA9IGxpc3RbaV0uc3RhdGU7XFxuICAgIHVybCA9IHVybC5zdGFydHNXaXRoKCdodHRwJykgPyB1cmwgOiBtdXJsICsgJz9hYz1kZXRhaWwmaWRzPScgKyB1cmw7XFxuICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICB1cmw6ICQodXJsKS5ydWxlKCgpID0+IHtcXG4gICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgdmFyIGl0ZW1zID0gW107XFxuICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxuICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxTXSo/OlxcXFwvXFxcXC9bXFxcXFNdKj8pXFxcXC8vKVsxXTtcXG4gICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICBkZXNjOiAnMjU1JiZmbG9hdCcsXFxuICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nb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biAgICAgICAgICAgIGlmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UyICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UyKS5pbmRleE9mKFxcXCI9XFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgdmFyIGppZWsgPSAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlMikucmVwbGFjZSgvXFxcXC5cXFxcLi9nLCBcXFwiLlxcXCIpLnNwbGl0KCcsJylbMF0ucmVwbGFjZSgnanNvbmJzJywgJycpO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLmluZGV4T2YoXFxcIj1cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICB2YXIgamllayA9IChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLnJlcGxhY2UoL1xcXFwuXFxcXC4vZywgXFxcIi5cXFwiKS5zcGxpdCgnLCcpWzBdO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBqaWVrID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vc2V0RXJyb3Ioamllayk7ICAgICAgICAgICAgICAgIFxcbiAgICAgICAgfVxcbiAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAvL2ppZWvmi7zmjqVcXG4gICAgaWYgKGppZWsgIT0gJycgJiYgamllayAhPSBudWxsKSB7XFxuICAgICAgICBpZiAoamllay5zdWJzdHJpbmcoMCwgNCkgPT0gJ2h0dHAnKSB7XFxuICAgICAgICAgICAgamllay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AmJiBodG1sLmRhdGEudm9kX2luZm8udm9kX3VybF93aXRoX3BsYXllcikge1xcbiAgICAgICAgICAgICAgICBsb2coJ1xcXFxu57q/6Lev77yaJyArIHB0YWIgKyAnXFxcXG7op4bpopHvvJonICsgdmxpbmsgKyAnXFxcXG4nICsgJ+ino+aekOaOpeWPo++8mlxcXFxuJyArIGppZWspO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UyICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UyKS5pbmRleE9mKFxcXCI9XFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZygnXFxcXG7nur/ot6/vvJonICsgcHRhYiArICdcXFxcbuinhumike+8micgKyB2bGluayArICdcXFxcbicgKyAn6Kej5p6Q5o6l5Y+j77yaXFxcXG4nICsgY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlMi5yZXBsYWNlKC9cXFxcLlxcXFwuL2csIFxcXCIuXFxcIikucmVwbGFjZSgvXFxcXCwvZywgXFxcIlxcXFxuXFxcXG5cXFwiKSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY29udHNbZ2V0TXlWYXIodGl0bGUsICcwJyldLnBsYXllcl9pbmZvLnBhcnNlICYmIChjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UpLmluZGV4T2YoXFxcIj1cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdcXFxcbue6v+i3r++8micgKyBwdGFiICsgJ1xcXFxu6KeG6aKR77yaJyArIHZsaW5rICsgJ1xcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcbicgKyBjb250c1tnZXRNeVZhcih0aXRsZSwgJzAnKV0ucGxheWVyX2luZm8ucGFyc2UucmVwbGFjZSgvXFxcXC5cXFxcLi9nLCBcXFwiLlxcXCIpLnJlcGxhY2UoL1xcXFwsL2csIFxcXCJcXFxcblxcXFxuXFxcIikpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCdcXFxcbue6v+i3r++8micgKyBwdGFiICsgJ1xcXFxu6KeG6aKR77yaJyArIHZsaW5rICsgJ1xcXFxuJyArICfop6PmnpDmjqXlj6PvvJpcXFxcbicgKyBqaWVrKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAvL3NldEVycm9yKGppZWspOyAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgIC8v5aOw5piO6ZO+5o6lXFxuICAgIHZhciBsaW5rID0gamllayArIHZsaW5rO1xcbiAgICAvKlxcbiAgICBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvcy8udGVzdCh2bGluaykgJiYgL2h0dHAvLnRlc3QodmxpbmspKSB7XFxuICAgICAgICBsaW5rID0gdmxpbms7XFxuICAgIH1cXG4gICAgKi9cXG4gICAgLy9sb2cobGluayk7XFxuICAgIHRpdGxlID0gdGl0bGUubWF0Y2goLyjnrKx8XFxcXGR8LSkqKOmbhnzor5185pyfKS9nKSA/IHRpdGxlLnJlcGxhY2UoL+esrHzpm4Z86K+dfOacny9nLCAnJykgOiB0aXRsZTtcXG4gICAgaWYgKGxpc3QubGVuZ3RoIDw9IDQpIHtcXG4gICAgICAgIHZhciBjbHQgPSAndGV4dF8yJztcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHZhciBjbHQgPSBpc05hTih0aXRsZSkgPyAnZmxleF9idXR0b24nIDogJ3RleHRfNSdcXG4gICAgfTtcXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICB1cmw6ICQoJ2hpa2VyOi8vZW1wdHknKS5sYXp5UnVsZSgocHRhYiwgbGluaywgbXl1cmwsIHZsaW5rKSA9PiB7XFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG9wZW51cmwocmVzdXJsKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzdXJsLm1hdGNoKC95b3VrdXxtZ3R2fGl4aWd1YXxxcS5jb218cWl5aXxtaWd1fGJpbGliaWxpfHNvaHV8cHB0dnxsZXwxOTA1LmNvbS8pICYmIHJlc3VybC5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL2h0bWznvZHpobXosIPnlKjmlq3mj5Lop6PmnpBcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBjb25maWcgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UocmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvc3xuZXRlYXNlXFxcXC5jb20vLnRlc3QocmVzdXJsKSAmJiAvaHR0cC8udGVzdChyZXN1cmwpICYmICEvXFxcXC5odG1sLy50ZXN0KHJlc3VybCkgJiYgIS9cXFxcPWh0dHAvLnRlc3QocmVzdXJsKSAmJiBwdGFiICE9ICdkdW9kdW96eScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChyZXN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcPS8udGVzdChyZXN1cmwpID8gcmVzdXJsLnNwbGl0KCc9JylbMV0gOiByZXN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/osIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW5EbiA9PSAnMScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5LpgJrnlKjlh73mlbDop6PmnpBcXFxcbicgKyBwdGFiICsgJyjpgJrnlKjlh73mlbApJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBjb25maWcgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gcHRhYiArICco6YCa55So5Ye95pWwKSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQYXJzZVNbbmFtZV0ocmVzdXJsLCBteXVybCk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdkdW9kdW96eScpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gRGUod29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGEgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShtZDUoJ3JYald2WGw2JykpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdCA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKCdOWGJIb1dKYnBzRU9pbjhiJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh3b3JkLCBhLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXY6IHQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW9kZTogQ3J5cHRvSlMubW9kZS5DQkMsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgZGR6eSA9ICdhZEh1Um8wZGN1SG9NMTYzTDF5NCcgKyBiYXNlNjRFbmNvZGUoc3JjdXJsKS5zbGljZSgxMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9iby5kZDUyMC5jYy94cGxheS9hcGkucGhwXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vaHR0cHM6Ly9iby5kZDUyMC5jYy94bXBsYXllci9hcGkucGhwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGR3eSA9IGZldGNoKCdodHRwczovL2pocGMubWFuZHVodS5jb20vZHVvZHVvL2FwaS5waHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib2R5OiAndXJsPScgKyByZXN1cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2coZGR3eSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBEZShKU09OLnBhcnNlKGRkd3kpLnVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgvbWlhb3BhcnR5Ly50ZXN0KHB0YWIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZSgnaHR0cHM6Ly9jb2RlLmFsaXl1bi5jb20vbHprMjM1NTkvUHVibGljUnVsZS9yYXcvbWFzdGVyL3g1cnVsZS5qcycsIDI0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZSgnaHR0cHM6Ly93d3cuZnVuNGsuY29tL2FwbGF5ZXIvP3VybD0nICsgcmVzdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZW5EbiA9IEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vZmlsZXMvcnVsZXMveHlxL2FwcG1zZXQuanNvbicsIHt9KSkuZW5EbjtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJyAmJiB2bGluay5tYXRjaCgveW91a3V8bWd0dnxpeGlndWF8cXEuY29tfHFpeWl8bWlndXxiaWxpYmlsaXxzb2h1fHBwdHZ8bGV8MTkwNS5jb20vKSAmJiB2bGluay5zZWFyY2goL2h0bWx8YmlsaWJpbGl8aXhpZ3VhLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+W3suW8gOWQr+aWreaPku+8jOWwhuiwg+eUqOaWreaPkuino+aekGh0bWwnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZSh2bGluayk7XFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICBcXG4gICAgICAgICAgICAgICAgdmFyIHNyY3VybCA9IGxpbms7XFxuICAgICAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxuICAgICAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB5byA5aeLXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAvL+WkhOeQhuaMh+WumuinhumikeS4jue6v+i3r1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcLm0zdTh8XFxcXC5tcDR8b2JqXFxcXC90b3N8bmV0ZWFzZVxcXFwuY29tLy50ZXN0KHNyY3VybCkgJiYgL2h0dHAvLnRlc3Qoc3JjdXJsKSAmJiAhL1xcXFwuaHRtbC8udGVzdChzcmN1cmwpICYmICEvXFxcXD1odHRwLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3drZmlsZS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzcmN1cmwgKyAnO3tSZWZlcmVyQGh0dHBzOi8vZmFudHVhbi53a2ZpbGUuY29tL30nXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC9cXFxcPS8udGVzdChzcmN1cmwpID8gc3JjdXJsLnNwbGl0KCc9JylbMV0gOiBzcmN1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoc3JjdXJsLmluZGV4T2YoXFxcIi9zaGFyZS9cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXCIvc2hhcmVcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGZjID0gZmV0Y2goc3JjdXJsLCB7fSkucmVwbGFjZShcXFwidmFyIHB1cmxcXFwiLCBcXFwidmFyIG1haW5cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZjLmluZGV4T2YoXFxcIm1haW5cXFwiKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwobWF0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBtYWluID0gZmMubWF0Y2goL3VybDouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBsYXkgPSAobWFpbi5pbmRleE9mKFxcXCJodHRwXFxcIikgIT0gLTEgPyBtYWluIDogbGluayArIG1haW4pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC85ODN2aXAvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC94XFxcXC1uXFxcXC5jY3xuaGR6NjY2Ly50ZXN0KHNyY3VybCkgJiYgL1xcXFwuaHRtbHxiaWxpYmlsaS8udGVzdChzcmN1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgLy/lpITnkIbmjIflrprop4bpopHlkoznur/ot6/nu5PmnZ9cXG4gICAgICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNjb2RlID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIm9raHR0cC80LjEuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB3aXRoU3RhdHVzQ29kZTogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coc2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMicgfHwgc2NvZGUuc3RhdHVzQ29kZSA9PSAnMzAxJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8v5omT5byA6Kej5p6Q5pyJMzAy6YeN5a6a5ZCR55qE6ZO+5o6lXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlZHVybCA9IHNjb2RlLmhlYWRlcnMubG9jYXRpb25bMF0ucmVwbGFjZSgvXFxcXFxcXFwvZywgJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvXFxcXD1odHRwLy50ZXN0KHJlZHVybCkgJiYgL2h0bWx8YmlsaWJpbGl8a2V5XFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw9aHR0cC8udGVzdChyZWR1cmwpICYmIC9cXFxcLm0zdTh8XFxcXC5tcDR8XFxcXC5mbHYvLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVkdXJsLnN1YnN0cmluZyhyZWR1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL2h0dHAvLnRlc3QocmVkdXJsKSAmJiAva2V5XFxcXD18dWlkXFxcXD0vLnRlc3QocmVkdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShmZXRjaChyZWR1cmwsIHt9KSkudXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWR1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGh0bWwgPSByZXF1ZXN0KHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBzY29kZS5ib2R5O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvNDA0IE5vdCBGb3VuZHzlpIfmoYjlkI7lj6/nu6fnu63orr/pl64vLnRlc3QoaHRtbCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw8Ym9keS8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+WwneivlemdnkpTT07mjqXlj6PnvZHpobXop6PmnpAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZUNhY2hlKCdodHRwczovL2NvZGUuYWxpeXVuLmNvbS9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9tYXN0ZXIveDVydWxlLmpzJywgMjQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4geDVydWxlKHNyY3VybCwgc3JjdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gb3BlbnVybChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vanNvbuino+aekOeahOWPlumTvuaOpVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IGh0bWwubWF0Y2goL1tcXFxcJ1xcXFxcXFwiXXVybFtcXFxcJ1xcXFxcXFwiXTouKj9bXFxcXCdcXFxcXFxcIl0oLio/KVtcXFxcJ1xcXFxcXFwiXS8pWzFdLnJlcGxhY2UoL1xcXFxcXFxcL2csICcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sb2cocHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvaHR0cC8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gJ2JpbGliaWxpJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJzt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHB0YWIgPT0gJ21ndHYnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29qYmsvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICc7e1JlZmVyZXJAaHR0cHM6Ly9iYWsub2pia2p4LmNvbS99JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVuZXNjYXBlKHB1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy/pnZ5odHRw5byA5aS055qE5omT5byA5Y6f6ZO+5o6lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8v5oql6ZSZ5Yik5pat5aSE55CGXFxuICAgICAgICAgICAgICAgICAgICBsb2coJ+aJp+ihjOaKpemUmei3s+i9rOWkhOeQhicpO1xcbiAgICAgICAgICAgICAgICAgICAgLyppZiAoc3JjdXJsLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXC9cXFxcLycpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCgnaHR0cHM6JyArIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPWh0dHAvLnRlc3Qoc3JjdXJsKSAmJiAvXFxcXC5odG1sfGJpbGliaWxpLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiBzcmN1cmwuc3BsaXQoJz0nKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwodmxpbmspXFxuICAgICAgICAgICAgICAgICAgICAvL3JldHVybiAneDVXZWJWaWV3Oi8vJytzcmN1cmxcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB57uT5p2fXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwdGFiLFxcbiAgICAgICAgICAgIGxpbmssXFxuICAgICAgICAgICAgbXl1cmwsXFxuICAgICAgICAgICAgdmxpbmspLFxcbiAgICAgICAgY29sX3R5cGU6IGNsdFxcbiAgICB9KTtcXG59XFxuLy99XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJUVueugOS7i+S4jumAiembhlwiLFwicGF0aFwiOlwidHZtb3ZsaXN0XCIsXCJydWxlXCI6XCJ2YXIgdGFicyA9IE9iamVjdC5rZXlzKGh0bWwudmlkZW9saXN0KTtcXG52YXIgdGh1bWIgPSBodG1sLmltZ191cmw7XFxuaXRlbXMucHVzaCh7XFxuICAgIHRpdGxlOiAn5Ymn5oOF566A5LuL77yaJyxcXG4gICAgZGVzYzogaHRtbC5pbnRybyxcXG4gICAgcGljX3VybDogdGh1bWIsXFxuICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub1JlY29yZEhpc3RvcnkjJykucnVsZSgoZGVzKSA9PiB7XFxuICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICB0aXRsZTogZGVzLFxcbiAgICAg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ICBpdGVtcy5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eScpLmxhenlSdWxlKChwdGFiLCBzcmN1cmwsIG15dXJsKSA9PiB7XFxuICAgICAgICAgICAgZnVuY3Rpb24gb3BlbnVybChyZXN1cmwpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHJlc3VybC5tYXRjaCgveW91a3V8bWd0dnxpeGlndWF8cXEuY29tfHFpeWl8bWlndXxiaWxpYmlsaXxzb2h1fHBwdHZ8bGV8MTkwNS5jb20vKSAmJiByZXN1cmwuc2VhcmNoKC9odG1sfGJpbGliaWxpLykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBlbkRuID0gSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9maWxlcy9ydWxlcy94eXEvYXBwbXNldC5qc29uJywge30pKS5lbkRuO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGVuRG4gPT0gJzEnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpAnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmV0Y2goY29uZmlnLmNqKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGF5dG1QYXJzZShyZXN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdXJsXFxuICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9cXFxcPUxUXFxcXC0vLnRlc3QocmVzdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5JsdG5i6YCa55So6Kej5p6QJyk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBuYW1lID0gJ2x0bmIo6YCa55So5Ye95pWwKSc7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gUGFyc2VTW25hbWVdKHJlc3VybC5zdWJzdHJpbmcocmVzdXJsLmluZGV4T2YoJz1MVC0nKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1cmxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdmFyIGVuRG4gPSBKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL3h5cS9hcHBtc2V0Lmpzb24nLCB7fSkpLmVuRG47XFxuICAgICAgICAgICAgICAgIGlmIChlbkRuID09ICcxJyAmJiBzcmN1cmwubWF0Y2goL3lvdWt1fG1ndHZ8aXhpZ3VhfHFxLmNvbXxxaXlpfG1pZ3V8YmlsaWJpbGl8c29odXxwcHR2fGxlfDE5MDUuY29tLykgJiYgc3JjdXJsLnNlYXJjaCgvaHRtbHxiaWxpYmlsaXxpeGlndWEvKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKCfosIPnlKjmlq3mj5Lop6PmnpBodG1sJyk7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChmZXRjaChjb25maWcuY2opKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2Uoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIC8vbG9nKHNyY3VybCk7XFxuICAgICAgICAgICAgLy/liqjmgIHop6PmnpDku6PnoIHlvIDlp4tcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvcy8udGVzdChzcmN1cmwpICYmIC9odHRwLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAvXFxcXD0vLnRlc3Qoc3JjdXJsKSA/IHNyY3VybC5zcGxpdCgnPScpWzFdIDogc3JjdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzcmN1cmwuaW5kZXhPZihcXFwiL3NoYXJlL1xcXCIpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaW5rID0gc3JjdXJsLnNwbGl0KFxcXCIvc2hhcmVcXFwiKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgZmMgPSBmZXRjaChzcmN1cmwsIHt9KS5yZXBsYWNlKFxcXCJ2YXIgcHVybFxcXCIsIFxcXCJ2YXIgbWFpblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmYy5pbmRleE9mKFxcXCJtYWluXFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1hdCA9IGZjLm1hdGNoKC92YXIgbWFpbi4qPzsvKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChtYXQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGxheSA9IChtYWluLmluZGV4T2YoXFxcImh0dHBcXFwiKSAhPSAtMSA/IG1haW4gOiBsaW5rICsgbWFpbik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG1haW4gPSBmYy5tYXRjaCgvdXJsOi4qP1tcXFxcJ1xcXFxcXFwiXSguKj8pW1xcXFwnXFxcXFxcXCJdLylbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwbGF5ID0gKG1haW4uaW5kZXhPZihcXFwiaHR0cFxcXCIpICE9IC0xID8gbWFpbiA6IGxpbmsgKyBtYWluKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXk7XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd4NVdlYlZpZXc6Ly8nICsgKHNyY3VybClcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChwdGFiID09ICdhbGl6eScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gZmV0Y2goJ2h0dHBzOi8vZm91YmluLmNvbS9qaWV4aS5waHA/dXJsPScgKyBzcmN1cmwsIHt9KS5tYXRjaCgvXFxcXFxcXCJ1cmxcXFxcXFxcIjpcXFxcXFxcIiguKj8pXFxcXFxcXCIvKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC8xOWp4XFxcXC52aXB8bmZ5aW5nc2hpLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gSlNPTi5wYXJzZShmZXRjaChzcmN1cmwucmVwbGFjZSgnaHR0cDovLycsICdodHRwczovLycpLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpdGhIZWFkZXJzOiB0cnVlXFxuICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvdGl0YW4ubWd0di8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLyplbHNlIGlmICgvemhhaWthbnlzLy50ZXN0KHNyY3VybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcHVybCA9IEpTT04ucGFyc2UoZmV0Y2goc3JjdXJsICsgJyZhcHA9MTAwMDMmYWNjb3VudD0yNzI3NzUwMjgmcGFzc3dvcmQ9cXEyNzI3NzUwMjgnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmwgKyAnI2lzVmlkZW89dHJ1ZSMnICsgJzt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKC9vYmpcXFxcL3Rvcy8udGVzdChwdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHB1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSovXFxuXFxuICAgICAgICAgICAgICAgIC8vLS0tLeWIhuWJsue6vy0tLS0vL1xcbiAgICAgICAgICAgICAgICB2YXIgc2NvZGUgPSBKU09OLnBhcnNlKGZldGNoKHNyY3VybCwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhzY29kZSk7XFxuICAgICAgICAgICAgICAgIGlmIChzY29kZS5zdGF0dXNDb2RlID09ICczMDInIHx8IHNjb2RlLnN0YXR1c0NvZGUgPT0gJzMwMScpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gc2NvZGUuaGVhZGVycy5sb2NhdGlvblswXS5yZXBsYWNlKC9cXFxcXFxcXC9nLCAnJyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBodG1sID0gcmVxdWVzdChzcmN1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBzY29kZS5ib2R5O1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoLzQwNCBOb3QgRm91bmR85aSH5qGI5ZCO5Y+v57un57ut6K6/6ZeufOS4jeWtmOWcqC8udGVzdChodG1sKSB8fCBodG1sID09ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsLnN1YnN0cmluZyhzcmN1cmwuaW5kZXhPZignPWh0dHAnKSArIDEpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFxcXFwidXJsXFxcXFxcXCJcXFxcOlxcXFxcXFwiaHR0cC8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwdXJsID0gaHRtbC5tYXRjaCgvXFxcXFxcXCJ1cmxcXFxcXFxcIjpcXFxcXFxcIiguKj8pXFxcXFxcXCIvKVsxXS5yZXBsYWNlKC9cXFxcXFxcXC9nLCAnJyk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuc3RhcnRzV2l0aCgneycpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHB1cmwgPSBzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIHB1cmwgPSBzcmN1cmxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlQ2FjaGUoJ2h0dHBzOi8vY29kZS5hbGl5dW4uY29tL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L21hc3Rlci94NXJ1bGUuanMnLCAyNCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZShzcmN1cmwsIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gJ3g1V2ViVmlldzovLycrKHNyY3VybCkgXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgIC8vbG9nKHB1cmwpO1xcbiAgICAgICAgICAgICAgICBpZiAoL3RpdGFuLm1ndHYvLnRlc3QocHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwdXJsICsgJyNpc1ZpZGVvPXRydWUjJyArICc7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfSc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL29ialxcXFwvdG9zLy50ZXN0KHB1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybCArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHVybFxcbiAgICAgICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgaWYgKHNyY3VybC5zdWJzdHJpbmcoMCwgMikgPT0gJ1xcXFwvXFxcXC8nKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybCgnaHR0cHM6JyArIHNyY3VybCk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL1xcXFw9aHR0cC8udGVzdChzcmN1cmwpICYmIC9cXFxcLmh0bWx8YmlsaWJpbGkvLnRlc3Qoc3JjdXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgLy9yZXR1cm4gc3JjdXJsLnNwbGl0KCc9JylbMV07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gb3BlbnVybChzcmN1cmwuc3Vic3RyaW5nKHNyY3VybC5pbmRleE9mKCc9aHR0cCcpICsgMSkpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG9wZW51cmwoc3JjdXJsKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8v5Yqo5oCB6Kej5p6Q5Luj56CB57uT5p2fXFxuICAgICAgICB9LCBwdGFiLCBzcmN1cmwsI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XN0W2ldLnRpdGxlO1xcbiAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS5waWM7XFxuICAgICAgICAgICAgICAgIC8vdmFyIHZpZD10ZG9taW4rJy9kZXRhaWw/dm9kX2lkPScrbGlzdFtpXS5uZXh0bGluaysnJnJlbF9saW1pdD0xMCc7XFxuICAgICAgICAgICAgICAgIHZhciB2aWQgPSBsaXN0W2ldLm5leHRsaW5rO1xcbiAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS5zdGF0ZTtcXG4gICAgICAgICAgICAgICAgLy92YXIgY29uPWxpc3RbaV0uc3RhdGU7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHRkb21pbi5pbmRleE9mKCdhcGkucGhwL2FwcC8nKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2ZhbnR1YW4vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWxJRD92b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0udm9kX3JlbWFya3M7XFxuICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUucmVwbGFjZShrZXksICfigJzigJwnICsga2V5ICsgJ+KAneKAnScpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBwaWMgKyAnQFJlZmVyZXI9JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKHRkb21pbi5pbmRleE9mKFxcXCJtb2dhaV9hcGlcXFwiKSAhPSAtMSA/IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JyA6IHZpZCArICc7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QG9raHR0cC80LjEuMH0nKS5ydWxlKCh0ZG9taW4pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBKU09OLnBhcnNlKGdldFJlc0NvZGUoKSk7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogJzI1NSYmZmxvYXQnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd4NV93ZWJ2aWV3X3NpbmdsZSdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFg1V2ViVmlldygnJyk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgbXl1cmwgP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AgaWYgKC9mYW50dWFuLy50ZXN0KG11cmwpKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmwgKyAnJnRva2VuPTtnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nO1xcbiAgICAgICAgfSBlbHNlIGlmICgvaW9wZW55dW4vLnRlc3QobXVybCkpIHtcXG4gICAgICAgICAgICB2YXIgbGluayA9IG11cmwgKyAnL2RldGFpbElEP3ZvZF9pZD0nICsgdXJsICsgJyZyZWxfbGltaXQ9MTA7Z2V0O3V0Zi04O3tVc2VyLUFnZW50QERhcnQvMi4xNCAoZGFydDppbyl9JztcXG4gICAgICAgIH0gZWxzZSBpZiAoL2RpamlheGlhLy50ZXN0KG11cmwpKSB7XFxuICAgICAgICAgICAgdmFyIGxpbmsgPSAnaHR0cDovL3d3dy5kaWppYXhpYS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyB1cmw7XFxuICAgICAgICB9XFxuICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgcGljX3VybDogaW1nICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgdXJsOiAkKGxpbmspLnJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgcmVzID0ge307XFxuICAgICAgICAgICAgICAgIHZhciBpdGVtcyA9IFtdO1xcbiAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnJyxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6ICcyNTUmJmZsb2F0JyxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3g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ufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfmo4DmtYvmm7TmlrAnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKChsb2N2ZXIpID0+IHtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgdmFyIHJlbWYgPSBmZXRjaENhY2hlKCdodHRwczovL2NvZGViZXJnLm9yZy9semsyMzU1OS9jbG91ZHJ1bGUvcmF3L2JyYW5jaC9tYXN0ZXIvYXBwbW92aWUudHh0JywgMjQpO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJlbWYgPSAnJztcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICgv77+lYmFzZTY0Ly50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgdmFyIHJlbXYgPSBKU09OLnBhcnNlKGJhc2U2NERlY29kZShyZW1mLnNwbGl0KCdAJylbMl0pKS52ZXJzaW9uO1xcbiAgICAgICAgfSBlbHNlIGlmICgv77+laG9tZV9ydWxl77+lLy50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgdmFyIHJlbXYgPSBKU09OLnBhcnNlKHJlbWYuc3BsaXQoJ++/pWhvbWVfcnVsZe+/pScpWzFdKS52ZXJzaW9uO1xcbiAgICAgICAgfTtcXG4gICAgICAgIGlmICgv77+laG9tZV9ydWxlLy50ZXN0KHJlbWYpKSB7XFxuICAgICAgICAgICAgbG9nKCfov5znqIvniYjmnKzvvJonICsgcmVtdik7XFxuICAgICAgICAgICAgbG9nKCfmnKzlnLDniYjmnKzvvJonICsgbG9jdmVyKTtcXG4gICAgICAgICAgICBpZiAobG9jdmVyICE9IHJlbXYpIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdhcHBudmVyJywgcmVtZik7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mnInmlrDniYjmnKzvvIzngrnlr7zlhaXm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F91cmxfd2l0aF9wbGF5ZXI7XFxuICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhLnZvZF9wbGF5X3VybC5zcGxpdCgnJCQkJyk7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhLnZvZF9pbmZvICYmIGh0bWwuZGF0YS52b2RfaW5mby52b2RfdXJsX3dpdGhfcGxheWVyKSB7XFxuICAgICAgICB2YXIgY29udHMgPSBodG1sLmRhdGEudm9kX2luZm8udm9kX3VybF93aXRoX3BsYXllcjtcXG4gICAgICAgIGlmIChjb250cy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX2luZm8udm9kX3BsYXlfdXJsLnNwbGl0KCckJCQnKTtcXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHZhciBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV9saXN0O1xcbiAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoJyQkJCcpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGlmIChodG1sLnZpZGVvbGlzdCkge1xcbiAgICAgICAgICAgIHZhciBsaXN0ID0gaHRtbC52aWRlb2xpc3RbY29udHNbaV1dO1xcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmxzKSB7XFxuICAgICAgICAgICAgdmFyIGxpc3QgPSBjb250c1tpXS51cmxzO1xcbiAgICAgICAgfSBlbHNlIGlmIChjb250c1tpXS51cmwpIHtcXG4gICAgICAgICAgICB2YXIgbGlzdCA9IGNvbnRzW2ldLnVybC5zcGxpdChcXFwiI1xcXC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gICAgICBpZiAoL2RpamlheGlhLy50ZXN0KGxpbmspKSB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5rID0gJ2h0dHA6Ly93d3cuZGlqaWF4aWEuY29tL2FwaS5waHAvYXBwLydcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgaWYgKGxpbmsuaW5kZXhPZignYXBpLnBocC9hcHAvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnc2VhcmNoP3BnPTEmdGV4dD0nICsga2V5ICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmsuaW5kZXhPZigneGdhcHAucGhwL3YxLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJ3NlYXJjaD9wZz0xJnRleHQ9JyArIGtleTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgvaW9wZW55dW4vLnRlc3QobGluaykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgaG11cmwgPSBsaW5rICsgJy9saXN0P3BhZ2U9ZnlwYWdlJmxpbWl0PTEwJndkPScgKyBrZXk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBobXVybCA9IGxpbmsgKyAnP3BhZ2U9MSZsaW1pdD0xMCZ3ZD0nICsga2V5O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIC8vRGF0YS5wdXNoKHt1cmw6IGhtdXJsLG9wdGlvbnM6IHtoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiRGFydC8yLjE0IChkYXJ0OmlvKVxcXCJ9LHRpbWVvdXQ6IHRpbWVvdX19KTtcXG4gICAgICAgICAgICBEYXRhLnB1c2goe1xcbiAgICAgICAgICAgICAgICB1cmw6IGhtdXJsLFxcbiAgICAgICAgICAgICAgICBvcHRpb25zOiB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBsaW5rLmluZGV4T2YoXFxcIm1vZ2FpX2FwaVxcXCIpICE9IC0xID8gXFxcIkRhcnQvMi4xNCAoZGFydDppbylcXFwiIDogXFxcIm9raHR0cC80LjEuMFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICB0aW1lb3V0OiB0aW1lb3VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIFRpdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0OiBsaXN0W2pdLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBsaW5rOiBsaW5rLFxcbiAgICAgICAgICAgICAgICB0eXBubTogbGl0aXRcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gLy9pZlxcbiAgICB9IC8vZm9yIGpcXG59IGNhdGNoIChlKSB7fVxcbmlmIChEYXRhLmxlbmd0aCA8PSAwKSB7XFxuICAgIHNldFJlc3VsdChbXSk7XFxufSBlbHNlIHtcXG4gICAgaXRlbXMucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuato+WcqOWKoOi9veS4reesrFxcXCIgKyBNWV9QQUdFICsgXFxcIumhte+8jOi/m+W6pu+8mjEvXFxcIiArIERhdGEubGVuZ3RoLFxcbiAgICAgICAgdXJsOiBcXFwiXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBzZXRSZXN1bHQoaXRlbXMpO1xcbiAgICBsZXQgdGFza3MgPSBbXTtcXG5cXG4gICAgZm9yIChsZXQgayBpbiBEYXRhKSB7XFxuICAgICAgICBsZXQgaXQgPSBEYXRhW2tdO1xcbiAgICAgICAgdGFza3MucHVzaCh7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0pIHtcXG4gICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgbGV0IGh0bWwgPSBmZXRjaChwYXJhbS5pdC51cmwsIHBhcmFtLml0Lm9wdGlvbnMpO1xcbiAgICAgICAgICAgICAgICAvL2xvZyhodG1sKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBodG1sLnN1YnN0cmluZygwLCAyKSA9PSAnXFxcXHJcXFxcbicgPyBodG1sLnJlcGxhY2UoJ1xcXFxyXFxcXG4nLCAnJykgOiBodG1sO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICBpZiAoL2J0d2FmLy50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgICAgICBodG1sID0gZmV0Y2gocGFyYW0uaXQudXJsICsgJyZidHdhZicgKyBodG1sLm1hdGNoKC9idHdhZiguKj8pXFxcXFxcXCIvKVsxXSwge30pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChodG1sID09IFxcXCJcXFwiIHx8IGh0bWwgPT0gbnVsbCB8fCBodG1sLnN1YnN0cmluZygwLCA1KSA9PSAnZXJyb3InIHx8ICFodG1sLnN0YXJ0c1dpdGgoJ3snKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5sZW5ndGggPCA4MCkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGh0bWwgPSBKU09OLnBhcnNlKGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdHlwZXQgPSBwYXJhbS50aXQudHlwbm07XFxuICAgICAgICAgICAgICAgICAgICB2YXIgdGRvbWluID0gcGFyYW0udGl0Lmxpbms7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaHRtbC5saXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmxpc3Q7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGh0bWwuZGF0YS5saXN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmRhdGEubGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaHRtbC5kYXRhKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBodG1sLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgbGlzdC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnBpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSBsaXN0W2ldLm5leHRsaW5rO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHJlbSA9IGxpc3RbaV0uc3RhdGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGRvbWluLmluZGV4T2YoJ2FwaS5waHAvYXBwLycpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHRpdGxlID0gbGlzdFtpXS52b2RfbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcGljID0gbGlzdFtpXS52b2RfcGljO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgvZmFudHVhbi8udGVzdCh0ZG9taW4pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB2aWQgPSAnaHR0cHM6Ly9mYW50dWFuLndrZmlsZS5jb20vYXBpLnBocC9hcHAvdmlkZW9fZGV0YWlsP2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJ3ZpZGVvX2RldGFpbD9pZD0nICsgbGlzdFtpXS52b2RfaWQgKyAnJnRva2VuPSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnR5cGUudHlwZV9kZXM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRkb21pbi5pbmRleE9mKCd4Z2FwcC5waHAvdjEvJykgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBsaXN0W2ldLnZvZF9uYW1lO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBwaWMgPSBsaXN0W2ldLnZvZF9waWM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICd2aWRlb19kZXRhaWw/aWQ9JyArIGxpc3RbaV0udm9kX2lkO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZW0gPSBsaXN0W2ldLnZvZF9yZW1hcmtzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnR5cGUudHlwZV9kZXM7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IGxpc3RbaV0udm9kX25hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHBpYyA9IGxpc3RbaV0udm9kX3BpYztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL2lvcGVueXVuLy50ZXN0KHRkb21pbikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHZpZCA9IHRkb21pbiArICcvZGV0YWlsSUQ/dm9kX2lkPScgKyBsaXN0W2ldLnZvZF9pZCArICcmdG9rZW49JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdmlkID0gdGRvbWluICsgJy9kZXRhaWw/a2V5PScgKyBkYXRlU3RyICsgJyZ2b2RfaWQ9JyArIGxpc3RbaV0udm9kX2lkICsgJyZ0b2tlbj0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgcmVtID0gbGlzdFtpXS52b2RfcmVtYXJrcztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3ZhciBjb249bGlzdFtpXS50eXBlLnR5cGVfZGVzO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdmFyIGNvbj1saXN0W2ldLnN0YXRlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh2aWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IE1ZX1RZUEUgPT0gXFxcImhvbWVcXFwiID8gdGl0bGUucmVwbGFjZShrZXksICfigJzigJwnICsga2V5ICsgJ+KAneKAnScpICsgJ1xcXFxuJyArIHJlbSA6IHRpdGxlICsgcmVtLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogcGljICsgJ0BSZWZlcmVyPScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodGRvbWluLmluZGV4T2YoXFxcIm1vZ2FpX2FwaVxcXCIpICE9IC0xID8gdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRARGFydC8yLjE0IChkYXJ0OmlvKX0nIDogdmlkICsgJztnZXQ7dXRmLTg7e1VzZXItQWdlbnRAb2todHRwLzQuMS4wfScpLnJ1bGUoKHRkb21pbikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciByZXMgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaXRlbXMgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IEpTT04ucGFyc2UoZ2V0UmVzQ29kZSgpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICcnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAnMjU1JiZmbG9hdCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJycsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAneDVfd2Vidmlld19zaW5nbGUnXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIG15dXJsID0gTVlfVVJMLm1hdGNoKC8oW1xcXFxTXSo/OlxcXFwvXFxcXC9bXFxcXFNdKj8pXFxcXC8vKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwvdm9kXFxcXC8vLnRlc3QodGRvbWluKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS90dm1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL2FwcG1vdmxpc3QnLCB7fSkpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMuZGF0YSA9IGl0ZW1zO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEhvbWVSZXN1bHQocmVzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sdGRvbWluKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY29udGVudDogcmVtLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogdHl0aXQgKyAnID0+ICcgKyBwYXJhbS50aXQudGl0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYydcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSAvL2ZvciBpXFxuICAgICAgICAgICAgICAgICAgICB9IC8vaWYgbGlzdC5sZW5ndGhcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBkO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICBpdDogaXQsXFxuICAgICAgICAgICAgICAgIHRpdDogVGl0W2tdXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBpZDogXFxcInRhc2tcXFwiXFxuICAgICAgICB9KVxcbiAgICB9XFxuXFxuICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgLy9sb2coXFxcImxpc3RlbmVyOiBcXFwiICsgKHJlc3VsdCB8fCBbXSkubGVuZ3RoKVxcbiAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXG4gICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgcGFyYW0uaiA9IHBhcmFtLmogKyAxO1xcbiAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbW92aWVfMV92ZXJ0aWNhbF9waWMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwiX19hcHBcXFwiICsgTVlfUEFHRSArIFxcXCJAXFxcIiArIHBhcmFtLmpcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5q2j5Zyo5Yqg6L2956ysXFxcIiArIE1ZX1BBR0UgKyBcXFwi6aG177yM6L+b5bqm77yaXFxcIiArIChwYXJhbS5pICsgMSkgKyBcXFwiL1xcXCIgKyBwYXJhbS5hbGwsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICBhbGw6IERhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIGk6IDAsXFxuICAgICAgICAgICAgajogLTFcXG4gICAgICAgIH1cXG4gICAgfSlcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLmlbDmja7ovazmjaJcIixcInBhdGhcIjpcImNvbnZlclwiLFwicnVsZVwiOlwiLy9qczpcXG4vL3JlbShyZXMpO1xcbnZhciDorrDlvZUgPSBbXTtcXG52YXIg6L6T5YWl5p2h55uuID0gcmVtZmlsZS5tYXRjaCgvLis9aHR0cC4rL2cpO1xcbmZvciAodmFyIGogaW4g6L6T5YWl5p2h55uuKSB7XFxuICAgIHZhciB0aXRsZSA9IOi+k+WFpeadoeebrltqXS5zcGxpdCgnQCcpWzFdLnNwbGl0KCc9JylbMF07XFxuICAgIHZhciB1cmwgPSDovpPlhaXmnaHnm65bal0uc3BsaXQoJ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M5pyJ5bCx5re75Yqg5Yiw5b2T5YmN6aG5XFxuICAgICAgICBpZiAoaXRlbS50aXRsZSA9PSDorrDlvZVbaV0udHlwZSkge1xcbiAgICAgICAgICAgIGl0ZW0ubGlzdCA9IOW9k+WJjeadoeebri5jb25jYXQoaXRlbS5saXN0LmZpbHRlcihkID0+IGQudXJsICE9IOiusOW9lVtpXS51cmwpKTtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgaWYgKCFyZXMpIHtcXG4gICAgICAgIC8v5aaC5p6c5rKh5om+55u45ZCM57G75Z6L5re75Yqg5LiA5Liq57G75Z6LXFxuICAgICAgICDmlrDorrDlvZUucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IOiusOW9lVtpXS50eXBlLFxcbiAgICAgICAgICAgIGxpc3Q6IOW9k+WJjeadoeebrlxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgfVxcbn1cXG52YXIgbmV3ZmlsZSA9IHt9O1xcbm5ld2ZpbGUuZGF0YSA9IOaWsOiusOW9lTtcXG4vL2xvZyhyZW1maWxlKTtcIn1dIiwiaWNvbiI6Imh0dHBzOi8vY29kZWJlcmcub3JnL2x6azIzNTU5L1B1YmxpY1J1bGUvcmF3L2JyYW5jaC9tYXN0ZXIvYXBwbW92LnBuZyJ9
Add Comment
Please, Sign In to add comment