xiaomianao666

小程序:本地资源管理

Dec 28th, 2024
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@本地资源管理@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5pys5Zyw6LWE5rqQ566h55CGIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTA0LCJjb2xfdHlwZSI6Im1vdmllXzNfbWFycXVlZSIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuLypcbnNldFJlc3VsdChbe1xuICAgIHRpdGxlOlwi4oCc4oCc6K+l5bCP56iL5bqP5bey5YGc5q2i57u05oqk4oCd4oCdXCIuYmlnKCkuYmlnKCksXG4gICAgY29sX3R5cGU6XCJ0ZXh0X2NlbnRlcl8xXCJcbn1dKTtcbiovXG5pZiAoIWdldEl0ZW0oXCI6c3RhcnRVc2VcIiwgZmFsc2UpKSB7XG4gICAgdG9hc3QoXCI6LSnliJ3mrKHop4HpnaLvvIzor7flpJrlhbPnhadcIik7XG4gICAgY29uZmlybSh7XG4gICAgICAgIHRpdGxlOiBcIuS9v+eUqOmhu+efpVwiLFxuICAgICAgICBjb250ZW50OiBcIjEu5pmu6YCa55So5oi377ya5pys56iL5bqP5Y+q5o+Q5L6b5pys5Zyw6ZiF6K+75pyN5Yqh77yM5LiN5o+Q5L6b572R57uc5YaF5a6544CCXFxuXFxuMi7lvIDlj5HogIXvvJrmj5DkvpvlpJrnur/nqIvkuIvovb3mlK/mjIHjgIJcXG5cXG4zLuWmguS9leiOt+WPluWGheWuuT9cX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1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0b0ZpbGUuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICBpZiAoIXRvRmlsZS5kZWxldGUoKSkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgRmlsZXMubW92ZShmcm9tRmlsZS50b1BhdGgoKSwgdG9GaWxlLnRvUGF0aCgpLCBTdGFuZGFyZENvcHlPcHRpb24uUkVQTEFDRV9FWElTVElORyk7XFxuICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgIH1cXG59XFxuXFxuZnVuY3Rpb24gbW92ZUZpbGVzKGZyb21QYXRoLCB0b1BhdGgpIHtcXG4gICAgbGV0IGZyb21GaWxlID0gbmV3IEZpbGUoZnJvbVBhdGgpO1xcbiAgICBsZXQgdG9GaWxlID0gbmV3IEZpbGUodG9QYXRoKTtcXG4gICAgdHJ5IHtcXG4gICAgICAgIGlmICghZnJvbUZpbGUuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodG9GaWxlLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgaWYgKCFkZWxldGVGaWxlcyh0b1BhdGgpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBGaWxlcy5tb3ZlKGZyb21GaWxlLnRvUGF0aCgpLCB0b0ZpbGUudG9QYXRoKCksIFN0YW5kYXJkQ29weU9wdGlvbi5SRVBMQUNFX0VYSVNUSU5HKTtcXG4gICAgICAgIHJldHVybiB0cnVlO1xcbiAgICB9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gICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6aXNTdGFydFxcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIGxldCBkb3dubG9hZCA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0JhdGNoU3RhdGlzdGljcy5qc1xcXCIpO1xcbiAgICAgICAgICAgIGlmKGluZm8udHlwZT09PVxcXCJjb21pY1xcXCImJmluZm8uY29taWNTY2hlbWU9PT1cXFwiMVxcXCIpe1xcbiAgICAgICAgICAgICAgICBkb3dubG9hZD1kb3dubG9hZC5iO1xcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBkb3dubG9hZD1kb3dubG9hZC5hO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gZG93bmxvYWQoY2hhcHRlclRlYW0sIGluZm8sIE1ZX0lEKSB8fCBcXFwidG9hc3Q6Ly/kuIvovb3plJnor69cXFwiO1xcbiAgICAgICAgfSwgY2hhcHRlclRlYW0sIGluZm8sIE1ZX0lEKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOW8gOWni+S4i+i9vVxcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5Lu75Yqh5YiX6KGo77yaXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIixcXG4gICAgfSk7XFxuICAgIGZvciAobGV0IGl0ZW0gb2YgY2hhcHRlclRlYW0pIHtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJ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GF6eVJ1bGUoKE1ZX0lEKSA9PiB7XFxuICAgICAgICAgICAgbGV0IHN0YXR1cyA9IGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgIGlmIChzdGF0dXMgPT09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvmraPlnKjlgZzmraIuLi5dXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ato+WcqOWPlua2iOS4i+i9veS7u+WKoVxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5q2j5Zyo5pqC5YGcLi4uXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gXFxcIjJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sumAgOWHuuS4i+i9veWZqFxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChbXFxcIjNcXFwiLCBcXFwiNFxcXCJdLmluY2x1ZGVzKHN0YXR1cykpIHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcihNWV9JRCArIFxcXCI6aXNTdGFydFxcXCIpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcihNWV9JRCArIFxcXCI6bG9nXFxcIik7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ph43mlrDngrnlh7vkuIvovb1cXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgTVlfSUQpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3mjqfliLZcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgIH0pO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIjxzdHJvbmc+5LiL6L295pel5b+XPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIixcXG4gICAgICAgIFxcbiAgICB9KTtcXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85pel5b+XXFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdGl0bGU6XFxcIuKAnOKAnOKAneKAnSQ+XFxcIitcXFwi5byA5aeL5LiL6L29Li4uLi4uXFxcIi5mb250Y29sb3IoXFxcIiMwMGZmMDBcXFwiKSxcXG4gICAgICAgIHVybDp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3VudCkuZm9udGNvbG9yKFxcXCIjZmZhYzJkXFxcIikgKyBcXFwi4paHXFxcIi5yZXBlYXQoMTAgLSBzdHJpcENvdW50KS5mb250Y29sb3IoXFxcIiNlNWUxZTRcXFwiKSArIFxcXCIgXFxcIiArIFN0cmluZygocmF0aW8gKiAxMDApKS5zbGljZSgwLCA1KSArIFxcXCIlXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9vei/m+W6plxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXeW3suWujOaIkOS4i+i9ve+8mlxcXCIgKyBpZCk7XFxuICAgICAgICB9IGVsc2UgaWYgKENJRCA9PT0gLTEpIHtcXG4gICAgICAgICAgICBmYWlsTmFtZS5wdXNoKGlkKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlgZzmraLvvJpcXFwiICsgaWQpO1xcbiAgICAgICAgICAgIGNvdW50ID0gdGFza0NvdW50O1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKHRhc2tDb3VudCAhPT0gY291bnQpIHJldHVybjtcXG4gICAgICAgIGlmIChzdWNjZXNzQ0lELmxlbmd0aCA9PT0gdGFza0NvdW50KSB7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuKWh1xcXCIucmVwZWF0KDEwKS5mb250Y29sb3IoXFxcIiMwMGZmMDBcXFwiKSArIFxcXCIgMTAwJVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3ov5vluqZcXFwiXFxuICAgICAgICAgICAgICAgIH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gICAgICAgICAgIHB1dE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiNFxcXCIpO1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiW2xpc3RlbmVyXSPlt7LlgZzmraLmiYDmnInku7vliqHvvIzkvYblt7LmnInov5vluqbkuI3kvJrmtojlpLEjXFxcIik7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwiW+mHjeaWsOW8gOWni11cXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJicmVha1xcXCI7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiMlxcXCIpO1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwi5LiL6L295Lu75YqhW1xcXCIgKyBpbmZvLmJvb2tOYW1lICsgXFxcIl3lt7Llhajpg6jmiJDlip/lrozmiJBcXFwiKTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJb6L+U5ZueXVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3mjqfliLZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIHRvYXN0KFxcXCLkuIvovb3ku7vliqFbXFxcIiArIGluZm8uYm9va05hbWUgKyBcXFwiXeW3suWujOaIkFxcXCIpO1xcbiAgICB9XFxuICAgIGxldCB0YXNrV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cihNWV9JRCArIFxcXCJ8fOaXpeW/l1xcXCIsIHtcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICB0aXRsZTogXFxcIiQ+XFxcIiArIHRleHQsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcIiNsb2cjXFxcIiArIGxvZ0NvdW50XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsb2dDb3VudCsrO1xcbiAgICB9XFxuXFxuICAgIGZ1bmN0aW9uIHRhc2sodGFza1BhcmFtKSB7XFxuICAgICAgICBjb25zdCBUb29sID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvVG9vbC5qc1xcXCIpO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCAxMDsgaSsrKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IHBpYyA9IFRvb2wuaGlrZXJQaWModGFza1BhcmFtLnVybCk7XFxuICAgICAgICAgICAgICAgIFRvb2wucGljRG93bmxvYWQocGljWzBdLCB0YXNrUGFyYW0uY2hhcHRlclBhdGggKyAodGFza1BhcmFtLmkgKyAxKSArIFxcXCIuanBnXFxcIiwgcGljWzFdLCB0YXNrUGFyYW0uZGVjb2RlKTtcXG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKHRhc2tQYXJhbS5NWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIlxcXCIpID09PSBcXFwiMVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAtMTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBlcnJvck51bSA9IDA7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT09IDkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdGFza1BhcmFtLkNJRDtcXG4gICAgfVxcbiAgICBsZXQgY291bnQgPSAwO1xcbiAgICBsZXQgdG90YWxDb3VudCA9IDA7XFxuICAgIGxldCBzdWNjZXNzQ0lEID0gW107XFxuXFxuICAgIGZ1bmN0aW9uIGxpc3RlbmVyKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICB0b3RhbENvdW50Kys7XFxuXFxuICAgICAgICAgICAgaWYgKGVycm9yICE9IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5LiL6L295aSx6LSl77yaXFxcIiArIGlkICsgXFxcIjxFUlJPUkAgXFxcIiArIGVycm9yICsgXFxcIj5cXFwiKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdCA9PT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5bey5YGc5q2i77yaXFxcIiArIGlkKTtcXG4gICAgICAgICAgICAgICAgdG90YWxDb3VudCA9IHBhcmFtLnBpdkNvdW50O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGNvdW50Kys7XFxuICAgICAgICAgICAgICAgIGxldCByYXRpbyA9ICgoY291bnQgLyBwYXJhbS5waXZDb3VudCkpLnRvRml4ZWQoNCk7XFxuICAgICAgICAgICAgICAgIGxldCBzdHJpcENvdW50ID0gTWF0aC5jZWlsKHJhdGlvICogMTApO1xcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0ucGl2Q291bnQgPT09IHRvdGFsQ291bnQgJiYgdG90YWxDb3VudCA9PT0gY291bnQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Y2Nlc3NDSUQucHVzaChwYXJhbS5DSUQpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLkuIvovb3ov5vluqbvvJpcXFwiICsgKHN1Y2Nlc3NDSUQubGVuZ3RoKSArIFxcXCIvXFxcIiArIHBhcmFtLnRvdGFsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBcXFwi4paHXFxcIi5yZXBlYXQoc3RyaXBDb3VudCkuZm9udGNvbG9yKFxcXCIjZmZhYzJkXFxcIikgKyBcXFwi4paHXFxcIi5yZXBlYXQoMTAgLSBzdHJpcENvdW50KS5mb250Y29sb3IoXFxcIiNlNWUxZTRcXFwiKSArIFxcXCIgXFxcIiArIFN0cmluZygocmF0aW8gKiAxMDApKS5zbGljZSgwLCA1KSArIFxcXCIlXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L296L+b5bqmXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgLy9wdXRMb2coXFxcIltsaXN0ZW5lcl3lt7LlrozmiJDkuIvovb3vvJpcXFwiICsgaWQpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCAhPT0gcGFyYW0ucGl2Q291bnQpIHJldHVybjtcXG4gICAgICAgICAgICBpZiAodG90YWxDb3VudCA9PT0gY291bnQpIHtcXG4gICAgICAgICAgICAgICAgRmlsZS5yZW5hbWVGaWxl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xuICAgICAgICBsZXQgY2hhcHRlclBhdGggPSBtYWluUGF0aCArIGl0ZW0uQ0lEICsgXFxcIiRCJFxcXCIgKyBUb29sLnRleHRTaGllbGQoaXRlbS50aXRsZSkgKyBcXFwiL1xcXCI7XFxuICAgICAgICBsZXQgcGljTGlzdCA9IFtdO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgZ2V0UGljTGlzdCA9IG5ldyBGdW5jdGlvbihcXFwiaW5wdXRcXFwiLCBcXFwidXJsXFxcIiwgXFxcImluZGV4XFxcIiwgXFxcInRpdGxlXFxcIiwgXFxcInJldHVyblxcXCIgKyBpbmZvLnBhcnNlQ29kZSk7XFxuICAgICAgICAgICAgcGljTGlzdCA9IGdldFBpY0xpc3QoaXRlbS51cmwsIGl0ZW0udXJsLCBrLCBpdGVtLnRpdGxlKTtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHBpY0xpc3QgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHBpY0xpc3QgPSBwaWNMaXN0LnJlcGxhY2UoXFxcInBpY3M6Ly9cXFwiLCBcXFwiXFxcIikuc3BsaXQoXFxcIiYmXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHB1dExvZyhcXFwiPOa8q+eUu+WbvueJh+ino+aekOmUmeivrz4gXFxcIiArIGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAocGljTGlzdC5sZW5ndGggPT09IDApIHtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIjzmvKvnlLvlm77niYfop6PmnpDplJnor6/vvJrlm77niYfpk77mjqXov5Tlm57kuLrnqbo+XFxcIik7XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBwaWNMaXN0ID0gcGljTGlzdC5maWx0ZXIocCA9PiBwKTtcXG4gICAgICAgIHZhciB0YXNrVGVhbSA9IHBpY0xpc3QubWFwKCh1cmwsIGkpID0+ICh7XFxuICAgICAgICAgICAgZnVuYzogdGFzayxcXG4gICAgICAgICAgICBpZDogaSxcXG4gICAgICAgICAgICBwYXJhbToge1xcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXG4gICAgICAgICAgICAgICAgaTogaSxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoLFxcbiAgICAgICAgICAgICAgICBNWV9JRDogTVlfSUQsXFxuICAgICAgICAgICAgICAgIGRlY29kZTogaW5mby5kZWNvZGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSk7XFxuICAgICAgICBiZSh0YXNrVGVhbSwge1xcbiAgICAgICAgICAgIGZ1bmM6IGxpc3RlbmVyLFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgIHBpdkNvdW50OiBwaWNMaXN0Lmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgdG90YWw6IGNoYXB0ZXJUZWFtLmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgb3JkZXI6IG9yZGVyLFxcbiAgICAgICAgICAgICAgICBDSUQ6IGl0ZW0uQ0lELFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcXG4gICAgICAgICAgICAgICAgY2hhcHRlclBhdGg6IGNoYXB0ZXJQYXRoXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBpZiAoZ2V0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCJcXFwiKSA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG4gICAgbGV0IHN0YXR1cyA9IGdldE15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiLCBcXFwiMFxcXCIpO1xcbiAgICBqYXZhLmxhbmc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kZWZpbmVkID8gMSA6IGNvdW50O1xcbiAgICAgICAgbGV0IGFycmF5ID0gW3RleHRdO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7XFxuICAgICAgICAgICAgdGV4dCA9IGFycmF5W2ldO1xcbiAgICAgICAgICAgIGxldCBpbmRleCA9IHRleHQuaW5kZXhPZih0YXJnZXQpO1xcbiAgICAgICAgICAgIGlmIChpbmRleCA9PT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGFycmF5W2ldID0gdGV4dC5zbGljZSgwLCBpbmRleCk7XFxuICAgICAgICAgICAgYXJyYXlbaSArIDFdID0gdGV4dC5zbGljZShpbmRleCArIHRhcmdldC5sZW5ndGgpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGFycmF5O1xcbiAgICB9LFxcbiAgICBjaHVuayhhcnIsIHNpemUpIHtcXG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBhcnIubGVuZ3RoOyBpIDwgbGVuOyBpICs9IHNpemUpIHtcXG4gICAgICAgICAgICByZXN1bHQucHVzaChhcnIuc2xpY2UoaSwgaSArIHNpemUpKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiByZXN1bHQ7XFxuICAgIH0sXFxuICAgIGhpa2VyUGljKHVybCkge1xcbiAgICAgICAgdmFyIGhlYWRlcnMgPSB7fTtcXG4gICAgICAgIGxldCB1cmxzID0gdXJsLnNwbGl0KFxcXCJAXFxcIik7XFxuICAgICAgICBsZXQgcGljVXJsID0gdXJscy5zaGlmdCgpO1xcbiAgICAgICAgbGV0IGxlbmd0aCA9IHVybHMubGVuZ3RoO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB2LnNwbGl0KHVybHNbaV0sIFxcXCI9XFxcIik7XFxuICAgICAgICAgICAgaWYgKGtleSA9PT0gXFxcImhlYWRlcnNcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKGhlYWRlcnMsIEpTT04ucGFyc2UodmFsdWUpKTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGtleS5pbmNsdWRlcyhcXFwiLlxcXCIpIHx8IGtleS5pbmNsdWRlcyhcXFwiP1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHBpY1VybCArPSBcXFwiQFxcXCIgKyBrZXkgKyAodmFsdWUgPyBcXFwiPVxcXCIgKyB2YWx1ZSA6IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGtleSAhPT0gXFxcImpzXFxcIikge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzW2tleV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gW3BpY1VybCwgaGVhZGVyc107XFxuICAgIH0sXFxuICAgIHJhbmdlKHN0YXJ0LCBlbmQpIHtcXG4gICAgICAgIHJldHVybiBBcnJheShlbmQgLSBzdGFydCkuZmlsbCgwKS5tYXAoKGVsLCBpKSA9PiBzdGFydCArIGkpO1xcbiAgICB9LFxcbiAgICBwaWNEb3dubG9hZCh1cmwsIHBhdGgsIGhlYWRlcnMsIGRlY2lwaGUpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgZGVjaXBoZSA9PT0gXFxcInN0cmluZ1xcXCIgJiYgZGVjaXBoZS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgbGV0IGluc3RyZWFtO1xcbiAgICAgICAgICAgIGxldCBvdXRzdHJlYW07XFxuICAgICAgICAgICAgbGV0IGZpbGU7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZmlsZSA9IG5ldyBqYXZhLmlvLkZpbGUocGF0aCk7XFxuICAgICAgICAgICAgICAgIGlmIChmaWxlLmV4aXN0cygpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IGRpciA9IGZpbGUuZ2V0UGFyZW50RmlsZSgpO1xcbiAgICAgICAgICAgICAgICBpZiAoZGlyICE9IG51bGwgJiYgIWRpci5leGlzdHMoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZGlyLm1rZGlycygpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGluc3RyZWFtID0gZmV0Y2godXJsLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBoZWFkZXJzLFxcbiAgICAgICAgICAgICAgICAgICAgaW5wdXRTdHJlYW06IHRydWVcXG4gICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgIG91dHN0cmVhbSA9IG5ldyBqYXZhLmlvLkZpbGVPdXRwdXRTdHJlYW0ocGF0aCk7XFxuICAgICAgICAgICAgICAgIGxldCB0ID0gJC5oaWtlci5pbnB1dCxcXG4gICAgICAgICAgICAgICAgICAgIGMgPSAkLmhpa2VyLnVybDtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IGluc3RyZWFtO1xcbiAgICAgICAgICAgICAgICAkLmhpa2VyLnVybCA9IHVybDtcXG4gICAgICAgICAgICAgICAgbGV0IHBpY2luID0gKG5ldyBGdW5jdGlvbihcXFwicmV0dXJuIFxcXCIgKyBkZWNpcGhlKSkoKTtcXG4gICAgICAgICAgICAgICAgJC5oaWtlci5pbnB1dCA9IHQ7XFxuICAgICAgICAgICAgICAgICQuaGlrZXIudXJsID0gYztcXG4gICAgICAgICAgICAgICAgbGV0IGJ1ZiA9IGphdmEubGFuZy5yZWZsZWN0LkFycmF5Lm5ld0luc3RhbmNlKGphdmEubGFuZy5CeXRlLlRZUEUsIDEwMjQpO1xcbiAgICAgICAgICAgICAgICBsZXQgbGVuO1xcbiAgICAgICAgICAgICAgICB3aGlsZSAoKGxlbiA9IHBpY2luLnJlYWQoYnVmKSkgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIG91dHN0cmVhbS53cml0ZShidWYsIDAsIGxlbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY2xvc2VNZShpbnN0cmVhbSk7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUob3V0c3RyZWFtKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGNsb3NlTWUoaW5zdHJlYW0pO1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKG91dHN0cmVhbSk7XFxuICAgICAgICAgICAgICAgIGlmIChmaWxlIGluc3RhbmNlb2YgamF2YS5pby5GaWxlICYmIGZpbGUuZXhpc3RzKCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZpbGUuZGVsZXRlKCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbG9nKFxcXCI86Kej5a+G5LiL6L29RXJyb3I+XFxcIiArIGUudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgdGhyb3cgZTtcXG4gICAgICAgICAgICB9IGZpbmFsbHkge1xcbiAgICAgICAgICAgICAgICBjbG9zZU1lKGluc3RyZWFtKTtcXG4gICAgICAgICAgICAgICAgY2xvc2VNZShvdXRzdHJlYW0pO1xcbiAgICAgICAgICAgIH1cXG5cXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHVybCwgcGF0aCwgaGVhZGVycyk7XFxuICAgICAgICB9XFxuICAgIH0sXFx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95rKh5pyJ6IC2PC9oMT4nLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicmljaF90ZXh0XFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGxheW91dCk7XFxuICAgIH1cXG4gICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgdXJsOiAnXFxcImhpa2VyOi8vc2VhcmNoP3M9XFxcIitpbnB1dCcsXFxuICAgICAgICBkZXNjOiBcXFwi5pCc5L2g5oOz6KaB55qEI1xcXCIgKyB0eXBlICsgXFxcIiMuLi4uLi5cXFwiLFxcbiAgICAgICAgdGl0bGU6IFxcXCLwn5SNXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBydWxlczogJC50b1N0cmluZygodGFnLCB0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBhcnIxID0gW107XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGFnLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIxLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IHRhZ1tpXS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hfdXJsXFxcIjogXFxcImhpa2VyOi8vZW1wdHk/aXNBbGw9MSZzZWFyY2hUZXJtcz0qKiZ0eXBlPVxcXCIgKyB0eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJzZWFyY2hGaW5kXFxcIjogXFxcImpzOiQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL1NlYXJjaC52aWV3P3J1bGU9JytNWV9SVUxFLl90aXRsZSk7XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICA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cXCIpLnNlbGVjdCgoaXQsIHR5cGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChcXFwi6Lez6L2s5bCP56iL5bqPXFxcIiA9PT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vaG9tZUBcXFwiICsgaXQubmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihcXFwi5Yig6Zmk6K+l55uu5b2VXFxcIj09PWlucHV0KXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JldHVybiB0aGVuKFtcXFwi6K+l5pON5L2c5LiN5Lya5Yig6Zmk5bCP56iL5bqP77yM5L2G6K+l5bCP56iL5bqP5LiL6L2955qE5omA5pyJ5ryr55S75bCG6KKr5Yig6ZmkXFxcIl0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnIkg5ryr55S7L+Wwj+ivtCDlsIbooqvliKDpmaRcXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCIudGdudW1cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQucGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9Cb29rcmFjay52aWV3P3J1bGU95pys5Zyw6LWE5rqQ566h55CGJnJ1bGVOYW1lPVxcXCIraXQubmFtZStcXFwiJnR5cGU9XFxcIit0eXBlO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdCwgdHlwZSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKGkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIi50Z251bVxcXCIsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGkpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxldCBwYXRoID0gdGFnW3RnbnVtXS5wYXRoO1xcbiAgICBsZXQgbWhsaXN0ID0gRmlsZS5nZXRGaWxlUGF0aChwYXRoLCBcXFwiZGlyX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ICAgICAgICAgcGljX3VybDogcGljLFxcbiAgICAgICAgICAgIHVybDogdHlwZSA9PT0gXFxcIm5vdmVsXFxcIiA/cGFnZVVybCArIFxcXCI/cnVsZT1cXFwiICsgTVlfUlVMRS50aXRsZTokKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYWdlVXJsLCBwYXRoKT0+e1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsb25nUHJlc3MuanNcXFwiKS5zaW5nbGVFbnRlcihwYWdlVXJsLCBwYXRoKTtcXG4gICAgICAgICAgICB9LCBwYWdlVXJsLCBpdGVtLnBhdGgpLFxcbiAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKGl0ZW0sIHtcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliKDpmaRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsb25nUHJlc3MuanNcXFwiKS5kZWxldGVGaWxlRm9yQm9vayhwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgaXRlbS5wYXRoKVxcbiAgICAgICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0ucGF0aFxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBzZXRSZXN1bHQobGF5b3V0KTtcXG59XFxuXFxubWFpbigpO1wifSx7XCJjb2xfdHlwZVwiOlwidGV4dF8xXCIsXCJuYW1lXCI6XCIjdi7mvKvnlLvnq6DoioLliJfooahcIixcInBhdGhcIjpcIkNvbWljQnJvd3Nlci52aWV3XCIsXCJydWxlXCI6XCJqczpcXG5jb25zdCBUb29sID0gJC5yZXF1aXJlKFxcXCJUb29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lLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdGVtLnBhdGggKyBcXFwiLzEuanBnXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIHBhdGg6IGl0ZW0ucGF0aCxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRUaXRsZTIoaXRlbS5uYW1lKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG5cXG59IGVsc2Uge1xcbiAgICBmb3IgKGxldCBpdGVtIG9mIG1obGlzdCkge1xcbiAgICAgICAgbGV0IG5hbWUgPSBnZXRUaXRsZTIoaXRlbS5uYW1lKTtcXG4gICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5Yig6ZmkW1xcXCIgKyBuYW1lICsgXFxcIl3vvJ9cXFwiKS5jb25maXJtKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChGaWxlLmRlbGV0ZUZpbGVzKHBhdGgpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOWksei0pVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBpdGVtLnBhdGgpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBDb25maWcuZGVmX0NvbWljX1N0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jb2xfdHlwZTogXFxcInRleHRfMVxcXCJcXG59KTtcXG5sZXQgdGlkID0gRGF0ZS5ub3coKTtcXG5sYXlvdXQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi5qOA5rWL5pu05pawXFxcIixcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKG9sZFZlcnNpb24sIHRpZCkgPT4ge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgbmV3VmVyc2lvbiA9IEpTT04ucGFyc2UocmVxdWVzdChcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL2Rldi9nZXRieWlkP2lkPTM1NTlcXFwiLCB7XFxuICAgICAgICAgICAgICAgIHRpbWVvdXQ6IDIwMDBcXG4gICAgICAgICAgICB9KSkucmVzdWx0LnZlcjtcXG4gICAgICAgICAgICBpZiAobmV3VmVyc2lvbiA8PSBvbGRWZXJzaW9uKSB7XFxuICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0odGlkICsgXFxcIiPorr7nva5f5pu05pawXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlt7Lnu4/mmK/mnIDmlrDniYjmnKzkuoZcXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey57uP5piv5pyA5paw54mI5pys5LqGXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHRpZCArIFxcXCIj6K6+572uX+abtOaWsFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5pyJ5paw54mI5pys6L+Y5pyq5pu05pawXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgdG9hc3QoX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VDb3VudCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpeato+ehruiMg+WbtOWGheeahOaVsOWtl1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYWdlTnVtID09PSBpbnB1dE51bSkgcmV0dXJuIFxcXCJ0b2FzdDovL+ato+WcqOW9k+WJjemhtemdolxcXCI7XFxuICAgICAgICAgICAgcHV0TXlWYXIoXFxcIi5wYWdlTnVtXFxcIiwgXFxcIlxcXCIgKyBpbnB1dE51bSk7XFxuICAgICAgICAgICAgY29uc3QgYm9va0luZm8gPSBKU09OLnBhcnNlKHJlcXVlc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIpIHx8IFxcXCJ7fVxcXCIpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLmZvb3QgPSBpbnB1dE51bTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGJvb2tJbmZvKSk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgfSwgdmlld1BhZ2VDb3VudCwgcGFnZU51bSwgcGF0aCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfNVxcXCJcXG4gICAgfSk7XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5LiK5LiA6aG1XFxcIixcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFnZU51bSwgcGF0aCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBpbnB1dE51bSA9IHBhZ2VOdW0gLSAxO1xcbiAgICAgICAgICAgIGlmIChpbnB1dE51bSA8IDApIHtcXG4gICAgICAgICAgICAgIC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EaXIgPSBGaWxlLmdldEZpbGVQYXRoKENvbmZpZy5ob21lUGF0aCwgXFxcImRpclxcXCIpO1xcblxcbiAgICAgICAgZnVuY3Rpb24gY2xlYW5DYWNoZShwYXRoKSB7XFxuICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/muIXpmaTlrozmiJBcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/muIXpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGNhY2hlIG9mIGNhY2hlRGlyKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogY2FjaGUubmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuWkp+Wwj++8mlxcXCIgKyBGaWxlLmdldEZpbGVTaXplKGNhY2hlLnBhdGgpICsgXFxcIlxcXFxu5o+P6L+w77yaXFxcIiArIChrbm93bkxpc3QuZ2V0KGNhY2hlLm5hbWUpIHx8IFxcXCLmnKrnn6Xnm67lvZVb6aOO6Zmp5pyq55+lXVxcXCIpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwi56Gu6K6k5riF6ZmkIFxcXCIgKyBjYWNoZS5uYW1lICsgXFxcIiA/XFxcIikuY29uZmlybShjbGVhbkNhY2hlLCBjYWNoZS5wYXRoKVxcbiAgICAgICAgICAgIH0pO1x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0cmluZ2lmeShDb25maWcpLCAwKTtcXG4gICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgc3RhcnQgPSAxO1xcbiAgICAgICAgaWYgKHR5cGVvZihNWV9OQU1FKSAhPT0gXFxcInVuZGVmaW5lZFxcXCIgJiYgTVlfTkFNRSA9PT0gXFxcIuWXheiniea1j+iniOWZqFxcXCIpIHtcXG4gICAgICAgICAgICBzdGFydCA9IDQ7XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Zu+54mHbGF0ZVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfM1xcXCIsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX2xhdGVcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoc2V0RGVmYXVsdFBpYywgXFxcImhpa2VyOi8vaW1hZ2VzL2hvbWVfbGF0ZVxcXCIpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBmb3IgKGxldCBpID0gc3RhcnQ7IGkgPD0gNDsgaSsrKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWbvueJh1xcXCIgKyBpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcIm1vdmllXzNcXFwiLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaG9tZV9waWNcXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKHNldERlZmF1bHRQaWMsIFxcXCJoaWtlcjovL2ltYWdlcy9ob21lX3BpY1xcXCIgKyBpKVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6Ieq5a6a5LmJ4p6VXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFtcXFwi6Ieq5a6a5LmJdXJsXFxcIiwgXFxcIumAieaLqeaWh+S7tui3r+W+hFxcXCJdKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLoh6rlrprkuYl1cmxcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpeWbvueJh+eahOi3r+W+hOaIluiAhemTvuaOpVxcXCIpLmlucHV0KCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCAwKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJjb25maWcuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KENvbmZpZyksIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJlcXVpcmVVcmwgPSBcXFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9NTA5OVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9ICQucmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmaWxlU2VsZWN0LmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IENvbmZpZyA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgMCkgfHwgXFxcInt9XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIENvbmZpZy5kZWZfUGljID0gXFxcImZpbGU6Ly9cXFwiICsgUEFUSDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcImNvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoQ29uZmlnKSwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCI6ZGVmYXVsdFBpY0JhY2tcXFwiLCBcXFwidHJ1ZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGVUeXBlOiBcXFwiLmpwZ3wuanBlZ3wuZ2lmfC5wbmd8LnN2Z3wuYm1wXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlOiBcXFwic2VsZWN0UGF0aENhY2hlMlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWVtb3J5UGF0aDogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIFxcXCJyZXBsYWNlUnVsZVxcXCI6XFxuICAgICAgICBpZiAoTVlfUEFSQU1TLmlzUmVmcmVzaCkge1xcbiAgICAgICAgICAgIGFkZExpc3RlbmVyKFxcXCJvbkNsb3NlXFxcIiwgJC50b1N0cmluZygoKSA9PiByZWZyZXNoUGFnZSgpKSk7XFxuICAgICAgICB9XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuabv+aNouinhOWImXzorr7nva5cXFwiKTtcXG4gICAgICAgIGxldCBydWxlTGlzdCA9IFtdO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKSB8fCBcXFwiW11cXFwiKTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfplJnor6/mj5DnpLonLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiAn5pu/5o2i5pWw5o2u6K+75Y+W5aSx6LSl77yM5piv5ZCm5Yid5aeL5YyW77yfXFxcXG7or6Xmk43kvZzkvJrmuIXpmaTkvaDnmoTmm7/mjaLmlbDmja4hISEnLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLliJ3lp4vljJblrozmiJBcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAvL3RvYXN0KFxcXCLlj5bmtohcXFwiKTtcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi5paw5bu65pu/5o2iXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZWRpdFJlcGxhY2VSdWxlLnZpZXcjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aXNOZXc9dHJ1ZVxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWHuuinhOWImVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTlr7zlh7pcXFwiICsgcnVsZUxpc3QubGVuZ3RoICsgXFxcIuadoeinhOWIme+8n1xcXFxuKHtob21lUHRhaH0vcmVwbGFjZVJ1bGUuanNvbilcXFwiKS5jb25maXJtKChudW0pID0+IHtcXG4gICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBzYXZlUHRhID0gQ29uZmlnLmhvbWVQYXRoICsgXFxcIi9yZXBsYWNlUnVsZS5qc29uXFxcIjtcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNhdmVQdGEsIHJlYWRGaWxlK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AgICAgICAgICAgIHVwZGF0ZUNvdW50ID0gMDtcXG4gICAgICAgICAgICAgICAgZm9yIChsZXQgaSBpbiBuZXdSdWxlTGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5ld1J1bGUgPSBuZXdSdWxlTGlzdFtpXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICghbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFwicmVwbGFjZW1lbnRcXFwiKSB8fCAhbmV3UnVsZS5oYXNPd25Qcm9wZXJ0eShcXFwicGF0dGVyblxcXCIpIHx8ICFuZXdSdWxlLmhhc093blByb3BlcnR5KFxcXCJuYW1lXFxcIikgfHwgKG5ld1J1bGUuc2NvcGVDb250ZW50ID09PSB1bmRlZmluZWQgPyBmYWxzZSA6ICFuZXdSdWxlLnNjb3BlQ29udGVudCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IG5ld1J1bGUuaWQ7XFxuICAgICAgICAgICAgICAgICAgICBuZXdSdWxlLmlkID0gaWQgfHwgbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaWRJbmRleCA9IHJ1bGVMaXN0LmZpbmRJbmRleChydWxlID0+IHJ1bGUuaWQgPT09IGlkKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpZEluZGV4ID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCsrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnNwbGljZShpZEluZGV4LCAxLCBuZXdSdWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3Q291bnQrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5wdXNoKG5ld1J1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXG4gICAgICAgICAgICAgICAgaWYgKGlzYmFjaykge1xcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsb2coXFxcIlxcXFxu6Lev5b6E77yaXFxcIiArIGlucHV0ICsgXFxcIlxcXFxu5oC76KeE5YiZ5pWw77yaXFxcIiArIG5ld1J1bGVMaXN0Lmxlbmd0aCArIFxcXCJcXFxcbuabtOaWsOinhOWImSBcXFwiICsgdXBkYXRlQ291bnQgKyBcXFwiIOadoVxcXFx05paw5aKe6KeE5YiZIFxcXCIgKyBuZXdDb3VudCArIFxcXCIg5p2hXFxcIik7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLnRvU3RyaW5nKCkpO1xcbiAgICAgICAgICAgICAgICBpZiAoaXNiYWNrKSBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXlpLHotKVcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLlr7zlhaXop4TliJlcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIuWklumDqOaWh+S7tlxcXCIsIFxcXCLlhoXpg6jmlofku7ZcXFwiXSwgMSwgXFxcIuinhOWImeWvvOWFpVxcXCIpLnNlbGVjdCgoaW1wb3J0UnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgPT09IFxcXCLlpJbpg6jmlofku7ZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImZpbGVTZWxlY3Q6Ly9cXFwiICsgJC50b1N0cmluZyhpbXBvcnRSdWxlKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVTZWxlY3QgPSByZXF1aXJlKHJlcXVpcmVVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2s6ICQudG9TdHJpbmcoaW1wb3J0UnVsZSwgdHJ1ZSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZVVybDogcmVxdWlyZVVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNsaWNrVHlwZTogXFxcImNvbmZpcm1cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG1lbW9yeTogXFxcInNlbGVjdFBhdGhDYWNoZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgaW1wb3J0UnVsZSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsZW4gPSBydWxlTGlzdC5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xcbiAgICAgICAgICAgIGxldCByZXBsYWNlUnVsZSA9IHJ1bGVMaXN0W2ldO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpFxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQsIGluZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZyA9IHJ1bGVMaXN0LnNwbGljZShpbmRleCwgMSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAvL2RlbGV0ZUl0ZW1CeUNscyhpZCArIFxcXCIuXFxcIiArIGluZGV4KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLliKDpmaTmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGlkLCBpKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLnvJbovpFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZWRpdFJlcGxhY2VSdWxlLnZpZXcjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjI25vUmVmcmVzaCM/aW5kZXg9XFxcIiArIGksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiLlxcXCIgKyBpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBjbHM6IGlkICsgXFxcIi5cXFwiICsgaVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSBcXFwiY29udGVudHNcXFwiOlxcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIik7XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuebruW9leiuvue9rnzorr7nva5cXFwiKTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIumAieaLqeaWh+S7tuWkuVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBKU09OLnN0cmluZ2lmeShmLmZpbGVTZWxlY3Rpb25Vcmkoe1xcbiAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShpZCkuZXh0cmE7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKGlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxuICAgICAgICAgICAgICAgIGluaXRpYWxQYXRoOiBDb25maWcuaG9tZVBhdGgsXFxuICAgICAgICAgICAgICAgIHJlcXVpcmVVcmw6IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD01MDk5XFxcIixcXG4gICAgICAgICAgICAgICAgcGF0dGVybjogMVxcbiAgICAgICAgICAgIH0pKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwi5pSv5oyBaGlrZXI6Ly9maWxlc+i3r+W+hCjor6Xmk43kvZzkuI3kvJrliJ3lp4vljJbnm67lvZUpXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IENvbmZpZy5ob21lUGF0aCxcXG4gICAgICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihpZCwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICB9LCBpZCksXFxuICAgICAgICAgICAgICAgIGlkOiBpZFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi56Gu6K6kXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBpbnB1dCA9IGdldE15VmFyKGlkLCBmaW5kSXRlbShpZCkuZXh0cmEuZGVmYXVsdFZhbHVlIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dC5zdGFydHNXaXRoKFxcXCJoaWtlcjovL2ZpbGVzL1xcXCIpKSBpbnB1dCA9IG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cIuW8gOWQr1xcXCIsXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCRpZCwgcmVwbGFjZVJ1bGUsIHBhdGgpID0+IHtcXG4gICAgICAgICAgICBpZiAoZmluZEl0ZW0oJGlkKS5leHRyYS5pc1RydWUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suW8gOWQr1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNvbnN0IGJvb2tJbmZvID0gT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgIHNlbGVjdGVkOiBbXVxcbiAgICAgICAgICAgIH0sIEpTT04ucGFyc2UocmVxdWVzdChcXFwiZmlsZTovL1xcXCIgKyBwYXRoICsgXFxcIi9ib29rSW5mby5qc29uXFxcIikgfHwgXFxcInt9XFxcIikpO1xcbiAgICAgICAgICAgIGJvb2tJbmZvLnNlbGVjdGVkLnB1c2gocmVwbGFjZVJ1bGUuaWQpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJGlkLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4pePXFxcIiArIHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpc1RydWU6IHRydWUsXFxuICAgICAgICAgICAgICAgICAgICBpZDogJGlkLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIvYm9va0luZm8uanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGJvb2tJbmZvKSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAg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wdXQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIumAieaLqeS6humUmeivr+eahOaWh+S7tuexu+Wei1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IENvbmZpZyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0NvbmZpZy5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IGlucHV0Lm1hdGNoKC9cXFxcLyhbXlxcXFwvXSo/KShcXFxcLnR4dHxcXFxcLmVwdWIpJC9pKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV0ucmVwbGFjZShcXFwiX2ZpbGVTZWxlY3RfXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdG9wYXRoQ2FjaGUgPSBDb25maWcuY29udGVudHNDYWNoZSArIG5vdmVsTmFtZSArIGZpbGVNYXRjaFsyXTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXRoID0gaW5wdXQucmVwbGFjZShcXFwiZmlsZTovL1xcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWvvOWFpeaPkOekulxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLlt7LlrZjlnKhbXFxcIiArIG5vdmVsTmFtZSArIFxcXCJd5piv5ZCm6KaG55uWP1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCwgdHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXModG9wYXRoQ2FjaGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WvvOWFpeaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHBhdGgsIHRvcGF0aCwgdG9wYXRoQ2FjaGUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuY29weUZpbGUocGF0aCwgdG9wYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KFxcXCJmaWxlOi8vXFxcIiArIHRvcGF0aENhY2hlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlr7zlhaXmiJDlip9cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXF1aXJlVXJsID0gXFxcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTUwOTlcXFwiO1xcbiAgICAgICAgICAgICAgICBsZXQgZmlsZVNlbGVjdCA9ICQucmVxdWlyZShyZXF1aXJlVXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZpbGVTZWxlY3QuZmlsZVNlbGVjdGlvblVyaSh7XFxuICAgICAgICAgICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQ29uZmlnID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvQ29uZmlnLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZpbGVNYXRjaCA9IFBBVEgubWF0Y2goL1xcXFwvKFteXFxcXC9dKj8pKFxcXFwudHh0fFxcXFwuZXB1YikkL2kpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub3ZlbE5hbWUgPSBmaWxlTWF0Y2hbMV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aCA9IENvbmZpZy5leHRlcm5hbEltcG9ydFBhdGggKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRvcGF0aENhY2hlID0gQ29uZmlnLmNvbnRlbnRzQ2FjaGUgKyBub3ZlbE5hbWUgKyBmaWxlTWF0Y2hbMl07XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhdGggPSBQQVRIO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5bey5a2Y5ZyoW1xcXCIgKyBub3ZlbE5hbWUgKyBcXFwiXeaYr+WQpuimhueblj9cXFwiKS5jb25maXJtKChwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmlsZS5jb3B5RmlsZShwYXRoLCB0b3BhdGgsIHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdChcXFwiZmlsZTovL1xcXCIgKyB0b3BhdGhDYWNoZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBwYXRoLCB0b3BhdGgsIHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmNvcHlGaWxlKHBhdGgsIHRvcGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgdG9wYXRoQ2FjaGUpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxlLmRlbGV0ZUZpbGVzKHRvcGF0aENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIudHh0fC5lcHViXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIG9uQ2xpY2tUeXBlOiBcXFwiY29uZmlybVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBzdG9yZTogXFxcInNlbGVjdFBhdGhDYWNoZTFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgbWVtb3J5UGF0aDogdHJ1ZVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG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lcm5hbEltcG9ydFBhdGhcXFwiXFxuICAgIH0pO1xcbiAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgIH0pO1xcblxcbiAgICBmdW5jdGlvbiBvcGVyYXRpb24ocGF0aCwgbmFtZSwgdHlwZSkge1xcbiAgICAgICAgbGV0IHBhdHRlcm4gPSBnZXRNeVZhcihcXFwiOnR4dFBhdHRlcm5cXFwiLCBcXFwi6ZiF6K+7XFxcIik7XFxuICAgICAgICBzd2l0Y2ggKHBhdHRlcm4pIHtcXG4gICAgICAgICAgICBjYXNlIFxcXCLliIbkuqtcXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInNoYXJlOi8vXFxcIiArIHBhdGg7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgXFxcIuWIoOmZpFxcXCI6XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7orqTliKDpmaRbXFxcIiArIG5hbWUgKyBcXFwiXVxcXCIpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGaWxlcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCArIFxcXCIuanNvblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUuZGVsZXRlRmlsZXMocGF0aCArIFxcXCIuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3JlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgcGF0aCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIGNhc2UgXFxcIumYheivu1xcXCI6XFxuICAgICAgICAgICAgICAgIHJldHVybiAodHlwZT09PVxcXCIudHh0XFxcIj9cXFwiaGlrZXI6Ly9wYWdlL3R4dFBhcnNlci52aWV3XFxcIjpcXFwiaGlrZXI6Ly9wYWdlL2VwdWJQYXJzZXIudmlldyNhdXRvQ2FjaGUjXFxcIikrXFxcIj9ydWxlPVxcXCIgKyBNWV9SVUxFLnRpdGxlO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICBjYXNlIFxcXCLmiZPlvIDmlrnlvI9cXFwiOlxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcIm9wZW5GaWxlOi8vZmlsZTovL1xcXCIgKyBwYXRoO1xcbiAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgIH1cXG4gICAgfVxcblxcbiAgICBmb3IgKGxldCBub3ZlbCBvZiBmaWxlcykge1xcbiAgICAgICAgbGV0IHR5cGUgPSBub3ZlbC5uYW1lLnN1YnN0cmluZyhub3ZlbC5uYW1lLmxhc3RJbmRleE9mKFxcXCIuXFxcIikpO1xcbiAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBub3ZlbC5uYW1lLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShvcGVyYXRpb24sIG5vdmVsLnBhdGgsIG5vdmVsLm5hbWUsIHR5cGUpLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCLlpKflsI/vvJpcXFwiICsgRmlsZS5nZXRGaWxlU2l6ZShub3ZlbC5wYXRoKSArIFxcXCJcXFxcbuS/ruaUueaXtumXtO+8mlxcXCIgKyAkLmRhdGVGb3JtYXQobm92ZWwubGFzdE1vZGlmaWVkLCBcXFwieXl5eS1NTS1kZCBISDptbTpzc1xcXCIpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYXRoOiBub3ZlbC5wYXRoLFxcbiAgICAgICAgICAgICAgICBpc0NhY2hlOiB0cnVlLFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbm92ZWwubmFtZSxcXG4gICAgICAgICAgICAgICAgaWQ6IG5vdmVsLnBhdGgsXFxuICAgICAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YiG5LqrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwic2hhcmU6Ly9cXFwiICsgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpmIXor7tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAganM6IEpTT04uc3RyaW5naWZ5KCh0eXBlPT09XFxcIi50eHRcXFwiP1xcXCJoaWtlcjovL3BhZ2UvdHh0UGFyc2VyLnZpZXdcXFwiOlxcXCJoaWtlcjovL3BhZ2UvZXB1YlBhcnNlci52aWV3I2F1dG9DYWNoZSNcXFwiKStcXFwiP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5omT5byA5pa55byPXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiBKU09OLnN0cmluZ2lmeShcXFwib3BlbkZpbGU6Ly9maWxlOi8vXFxcIiArIG5vdmVsLnBhdGgpXFxuICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwibG9uZ1ByZXNzLmpzXFxcIikuZGVsZXRlRmlsZUZvclR4dChwYXRoKVxcbiAgICAgICAgICAgICAgICAgICAgfSwgbm92ZWwucGF0aClcXG4gICAgICAgICAgICAgICAgfV1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBpZiAoZmlsZXMubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLorr7nva5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2ZXJzaW9uOiBNWV9SVUxFLnZlcnNpb25cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOW4ruWKqeKAneKAnVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2hlbHAudmlldyNub1JlZnJlc2gjI25vUmVjb3Jk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AgICAgaGFzUHJlZmFjZSA9IGMuaGFzUHJlZmFjZTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YeN5paw6Kej5p6Q55uu5b2VXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTpcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c3Ryb25nPuebruW9leino+aekOWksei0pSjph43mlrDop6PmnpApPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXRoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVGaWxlKHBhdGgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIHBhdGgrXFxcIi5qc29uXFxcIiksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBzaG93TG9hZGluZyhcXFwi5q2j5Zyo6Kej5p6Q55uu5b2VXFxcIik7XFxuICAgICAgICBsZXQgdHh0ID0gcmVxdWVzdChwYXRoLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAvL1xcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwidGV4dC9wbGFpbjsgY2hhcnN0PVxcXCIgKyBjaGFyc3RcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxldCBwYXR0ZXJuID0gcmVncy5nZXRUb2NSdWxlKHR4dCk7XFxuICAgICAgICBpZiAoIXBhdHRlcm4pIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnOKAneKAnTxzdHJvbmc+55uu5b2V6Kej5p6Q5aSx6LSlPC9zdHJvbmc+XFxcIi5iaWcoKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1dKTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgbWF0Y2hlciA9IHBhdHRlcm4ubWF0Y2hlcih0eHQpO1xcbiAgICAgICAgbGV0IHBvaW50ZXIgPSAwO1xcbiAgICAgICAgd2hpbGUgKG1hdGNoZXIuZmluZCgpKSB7XFxuICAgICAgICAgICAgbGV0IHN0YXJ0ID0gbWF0Y2hlci5zdGFydCgpO1xcbiAgICAgICAgICAgIGxldCBlbmQgPSBtYXRjaGVyLmVuZCgpO1xcbiAgICAgICAgICAgIGxldCB0ID0gbWF0Y2hlci5ncm91cCgpO1xcbiAgICAgICAgICAgIGlmIChwb2ludGVyID09PSAwICYmIHN0YXJ0ID4gMzApIHtcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZSA9IHRydWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNoYXB0ZXJOYW1lcy5wdXNoKHQpO1xcbiAgICAgICAgICAgIGludGVydmFscy5wdXNoKFtwb2ludGVyLCBzdGFydF0pO1xcbiAgICAgICAgICAgIHBvaW50ZXIgPSBlbmQ7XFxuICAgICAgICB9XFxuICAgICAgICBpbnRlcnZhbHMucHVzaChbcG9pbnRlciwgdHh0Lmxlbmd0aF0pO1xcbiAgICAgICAgaWYgKGlzQ2FjaGUpIHtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoY2FjaGVQYXRoLCBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJOYW1lczogY2hhcHRlck5hbWVzLFxcbiAgICAgICAgICAgICAgICBpbnRlcnZhbHM6IGludGVydmFscyxcXG4gICAgICAgICAgICAgICAgaGFzUHJlZmFjZTogaGFzUHJlZmFjZVxcbiAgICAgICAgICAgIH0pKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgIH1cXG5cXG5cXG4gICAgaWYgKGhhc1ByZWZhY2UpIHtcXG4gICAgICAgIGxldCBpbnRlcnZhbCA9IGludGVydmFsc1swXTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuW6j+iogFxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9UWFRWaWV3ZXIudmlldyNhdXRvUGFnZSMjcmVhZFRoZW1lI1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgY2hhcHRlck5hbWU6IFxcXCLluo/oqIBcXFwiLFxcbiAgICAgICAgICAgICAgICBzdGFydDogaW50ZXJ2YWxbMF0sXFxuICAgICAgICAgICAgICAgIGVuZDogaW50ZXJ2YWxbMV0sXFxuICAgICAgICAgICAgICAgIHBhdGg6IHBhdGgsXFxuICAgICAgICAgICAgICAgIGNoYXJzdDogY2hhcnN0XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFwdGVyTmFtZXMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGxldCBuYW1lID0gY2hhcHRlck5hbWVzW2ldO1xcbiAgICAgICAgbGV0IGludGVydmFsID0gaW50ZXJ2YWxzW2kgKyAxXTtcXG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55q6K56ym5Y+3IOagh+mimCjljZXkuKopXFxcIixcXG4gICAgICAgIFxcXCJydWxlXFxcIjogXFxcIig/PD1bXFxcXFxcXFxz44CAXXswLDR9KSg/OlvimIbimIXinKbinKddLnsxLDMwfXwoPzrlhoXlrrl85paH56ugKT/nroDku4t85paH5qGIfOWJjeiogHzluo/nq6B85qWU5a2QfOato+aWhyg/IeWujHznu5MpfOe7iOeroHzlkI7orrB85bC+5aOwfOeVquWklilbIOOAgF17MCw0fSRcXFwiLFxcbiAgICAgICAgXFxcImV4YW1wbGVcXFwiOiBcXFwi4piG44CB5pmL5rGf5L2c6ICF5pyA5Zac5qyi55qE5qC85byPXFxcIixcXG4gICAgICAgIFxcXCJzZXJpYWxOdW1iZXJcXFwiOiAxMlxcbiAgICB9LFxcbiAgICB7XFxuICAgICAgICBcXFwiaWRcXFwiOiAtMTUsXFxuICAgICAgICBcXFwiZW5hYmxlXFxcIjogdHJ1ZSxcXG4gICAgICAgIFxcXCJuYW1lXFxcIjogXFxcIueroC/ljbcg5bqP5Y+3IOagh+mimFxcXCIsXFxuICAgICAgICBcXFwicnVsZVxcXCI6IFxcXCJeWyBcXFxcXFxcXHTjgIBdezAsNH0oPzooPzrlhoXlrrl85paH56ugKT/nroDku4t85paH5qGIfOWJjeiogHzluo/nq6B85qWU5a2QfOato+aWhyg/IeWujHznu5MpfOe7iOeroHzlkI7orrB85bC+5aOwfOeVquWklnxb5Y2356ugXVtcXFxcXFxcXGTjgIfpm7bkuIDkuozkuKTkuInlm5vkupTlha3kuIPlhavkuZ3ljYHnmb7ljYPkuIflo7notLDlj4HogobkvI3pmYbmn5LmjYznjpbmi77kvbDku59dezEsOH0pWyDjgIBdezAsNH0uezAsMzB9JFxcXCIsXFxuICAgICAgICBcXFwiZXhhbXBsZVxcXCI6IFxcXCLljbfkupQg5byA5rqQ55ub5LiWXFxcIixcXG4gICAgICAgIFxcXCJzZXJpYWxOdW1iZXJcXFwiOiAxM1xcbiAgICB9LFxcbiAgICB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XlvdXQucHVzaCh7XFxuICAgICAgICB1cmw6ICdcXFwiaGlrZXI6Ly9zZWFyY2g/cz1cXFwiK2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLmkJzkvaDmg7PopoHnmoQjXFxcIiArIHR5cGUgKyBcXFwiIy4uLi4uLlxcXCIsXFxuICAgICAgICB0aXRsZTogXFxcIvCflI1cXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHJ1bGVzOiAkLnRvU3RyaW5nKChydWxlTmFtZSwgdHlwZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgYXJyMSA9IFt7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInRpdGxlXFxcIjogcnVsZU5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaF91cmxcXFwiOiBcXFwiaGlrZXI6Ly9lbXB0eT9pc0FsbD0xJnNlYXJjaFRlcm1zPSoqJnR5cGU9XFxcIiArIHR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInNlYXJjaEZpbmRcXFwiOiBcXFwianM6JC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvU2VhcmNoLnZpZXc/cnVsZT0nK01ZX1JVTEUuX3RpdGxlKTtcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9XTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShhcnIxKTtcXG4gICAgICAgICAgICB9LCBydWxlTmFtZSwgdHlwZSksXFxuICAgICAgICAgICAgLypkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdzZWFyY2hLZXknLCAnJyksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IFxcXCJwdXRNeVZhcignc2VhcmNoS2V5JyxpbnB1dClcXFwiKi9cXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi8J+nqVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgICAgIHVybDogJChjb2xUeXBlcy5tYXAodj0+dj09PWNvbF90eXBlP1xcXCLigJzigJxcXFwiK3YrXFxcIuKAneKAnVxcXCI6dikpLnNlbGVjdCgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgIGlmKC/igJzigJwuKj/igJ3igJ0vLnRlc3QoaW5wdXQpKSByZXR1cm47XFxuICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6Y29sX3R5cGVcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBmb3IgKGxldCBuYW1lIG9mIHJhbmtNZXRob2RzKSB7XFxuICAgICAgICBsZXQgYSA9IHJhbmtNZXRob2QgPT09IG5hbWU7XFxuICAgICAgICBsZXQgdGl0bGVhID0gYSA/IFxcXCLigJjigJhcXFwiICsgbmFtZSArIFxcXCLigJnigJlcXFwiIDogbmFtZTtcXG4gICAgICAgIGxldCB0aXRsZWIgPSBcXFwiXFxcIjtcXG4gICAgICAgIGlmIChhKSB7XFxuICAgICAgICAgICAgdGl0bGViID0gIXJhbmtJc1JldmVyc2UgPyBcXFwi4oaTXFxcIiA6IFxcXCLihpFcXFwiO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB0aXRsZWIgPSBcXFwi4oaVXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogdGl0bGVhICsgdGl0bGViLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcmFua01ldGhvZCA9IGdldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtNZXRob2RcXFwiLCBcXFwi57O757ufXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCByYW5rSXNSZXZlcnNlID0gZ2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIFxcXCJcXFwiKTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKHJhbmtNZXRob2QgPT09IG5hbWUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChyYW5rSXNSZXZlcnNlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmFua0lzUmV2ZXJzZSA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByYW5rSXNSZXZlcnNlID0gXFxcIjFcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIHJhbmtJc1JldmVyc2UpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiYm9va3JhY2s6cmFua0lzUmV2ZXJzZVxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcImJvb2tyYWNrOnJhbmtNZXRob2RcXFwiLCBuYW1lKTtcXG5cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgfSwgbmFtZSlcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGxldCByYW5rTWV0aG9kTWFwID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