xiaomianao666

小程序:规则连接转换器8.0

Oct 31st, 2023
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@规则连接转换器8.0@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6KeE5YiZ6L+e5o6l6L2s5o2i5ZmoOC4wIiwiYXV0aG9yIjoi5Za15Za1fiIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjoyMDIzMTAyNSwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuLyoq77mJ77mJ77mJ77mJ77mJ5aOw5piO77mJ77mJ77mJ77mJ77mJ77mJ77mJ77mJXG7mnKzop4TliJnku4XpmZDlrabkuaDkuI7kuqTmtYHvvIzor7fkuo7lr7zlhaXlkI4yNOWwj+aXtuWGheWIoOmZpO+8jOivt+WLv+S8oOaSre+8gVxu5bCP56iL5bqP6LCD55So5LqG5biF5Lq65omN4oia5aSn5L2s55qE5o6l5Y+j5Luj56CB54m55q2k6K+05piO6Z2e5pys5Lq65Y6f5Yib77yM5oSf6LCi5biF6ICB5YaZ5Ye66L+Z5LmI5LyY56eA55qE5Luj56CB77yM6K6p5bCP55m95Y+X55uK6Imv5aSaXG7vuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYnvuYlcbuWGmeinhOWImeWIneWTgFxu6I6r5ZCN5YW25aaZ5rW36ZiU5pS55LqG6ZO+5o6l44CC6Iqx6YeM6IOh5ZOo55qE5Yqf6IO95Y+I5aSa5LiA5Liq44CC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Skge1xuICAgICAgICAgICAgcmV0dXJuIFwidG9hc3Q6Ly/pk77mjqXkuI3mraPnoa7vvIzor7fph43mlrDovpPlhaVcIlxuICAgICAgICB9XG4gICAgICAgIHVybCA9IHVybC5yZXBsYWNlKC/kupE2b29vb2xlL2csICdodHRwczovL3Bhc3RlbWUudHlyYW50Zy5jb20nKS5yZXBsYWNlKC/kupEyb29vb2xlL2csICdodHRwczovL25ldGN1dC5jbicpLnJlcGxhY2UoL+S6kTVvb29vbGUvZywgJ2h0dHBzOi8vY21kLmltJykucmVwbGFjZSgv5LqRN29vb29sZS9nLCAnaHR0cHM6Ly9ub3RlLm1zJykucmVwbGFjZSgv5LqROW9vb29sZS9nLCAnaHR0cHM6Ly90eHRwYmJkLmNuJykucmVwbGFjZSgv5LqRMTBvb29vbGUvZywgJ2h0dHBzOi8vaGFzc2R0ZWJpbi5jb20nKTtcbiAgICAgICAgcHV0TXlWYXIoJ3RlbXBsYXRlLXVybCcsIHVybCk7XG4gICAgICAgIGNvbmZpcm0oe1xuICAgICAgICAgICAgdGl0bGU6IFwi5qyi6L+O5L2/55So5LqR5Za15a+85YWl5bel5YW3XCIsXG4gICAgICAgICAgICBjb250ZW50OiBcIueCueWHu+ehruiupOWvvOWFpe+8jOWPlua2iOi/lOWbnlwiLFxuICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKSA9PiB7XG4gICAgICAgICAgICAgICAgdmFyIGl0ZW07XG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCd0ZW1wbGF0ZS11cmwnKS5pbmNsdWRlcyhcIm5ldGN1dC5jblwiKSkge1xuXHRcdFx0XHRcdGxldCBudXJsID0gZ2V0TXlWYXIoJ3RlbXBsYXRlLXVybCcpLm1hdGNoKC9odHRwLipcXC9wXFwvKFthLXpBLVowLTldezE2fSkvKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBpdGVtID0gSlNPTi5wYXJzZShyZXF1ZXN0KCdodHRwczovL25ldGN1dC5jbi9hcGkvbm90ZTIvaW5mby8nLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcInJlZmVyZXJcIjogbnVybFswXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9keTogJ25vdGVfaWQ9JyArIG51cmxbMV0sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhLm5vdGVfY29udGVudDtcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcblx0XHRcdFx0XHRcdCAgICBpdGVtID0gSlNPTi5wYXJzZShyZXF1ZXN0KFwiaHR0cHM6Ly9uZXRjdXQuY24vYXBpL25vdGUyL2luZm8/bm90ZV9pZD1cIiArIG51cmxbMV0pKS5kYXRhLm5vdGVfY29udGVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZXJyb3InLCBcImVycm9yXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgaWYgKCEv5rW36ZiULy50ZXN0KGl0ZW0pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSBKU09OLnBhcnNlKGFlc0RlY29kZSgnU3JjSnUnLCBpdGVtKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKFwi6IGa6ZiF5Y+j5LukPiBcIiArIEpTT04uc3RyaW5naWZ5KGl0ZW0pKVxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0gPSBKU09OLnBhcnNlKGFlc0RlY29kZSgnSnV5aW5nJywgaXRlbSkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvZyhcIuiBmuW9sei1hOa6kOeggT4gXCIgKyBKU09OLnN0cmluZ2lmeShpdGVtKSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoL0pZc2hhcmVfLy50ZXN0KGdldE15VmFyKCd0ZW1wbGF0ZS11cmwnKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaXRlbSA9IEpTT04ucGFyc2UoYWVzRGVjb2RlKCdTcmNKdScsIGZldGNoKCdmaWxlOi8vJyArIGdldE15VmFyKCd0ZW1wbGF0ZS11cmwnKSkpKTtcbiAgICAgICAgICAgICAgICAgICAgbG9nKGl0ZW0pXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICghL15odHRwLy50ZXN0KGdldE15VmFyKCd0ZW1wbGF0ZS11cmwnKSkpIHtcbiAgICAgICAgICAgICAgICAgICAgaXRlbSA9IEpTT04ucGFyc2UoZ2V0TXlWYXIoJ3RlbXBsYXRlLXVybCcpKTtcbiAgICAgICAgICAgICAgICAgICAgbG9nKGl0ZW0pXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgaXRlbSA9IHBhcnNlUGFzdGUoZ2V0TXlWYXIoJ3RlbXBsYXRlLXVybCcpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKGdldE15VmFyKCdlcnJvcicpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFwidG9hc3Q6Ly/liarnspjmnb/miJbnvZHnu5zlvILluLjvvIzmlbDmja7ojrflj5bkuI3miJDlip/vvIzngrnlh7vovazmjaLlkI7ov57mjqXlr7zlhaXor5Xor5VcIjtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBNWV9SVUxFLnRpdGxlID0gdHlwZW9mKGl0ZW1bMF0ubmFtZSkgIT0gJ3VuZGVmaW5lZCcgJiYgaXRlbVswXS5uYW1lID8gaXRlbVswXS5uYW1lIDogaXRlbS5tYXRjaCgv77+laG9tZV9ydWxlW1xcc1xcU10qP0AoLiopQC8pWzFdO1xuICAgICAgICAgICAgICAgICAgICB0b2FzdChcIuasoui/juS9v+eUqOS4gOmUrui9rOaNouW3peWFt++8jOato+WcqOWvvOWFpVwiICsgTVlfUlVMRS50aXRsZSArIFwi77yM6K+356iN5YCZLi4uXCIpO1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignaXRlbWxhdGUtdXJsJywgaXRlbSlcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mKGl0ZW1bMF0ubmFtZSkgIT0gJ3VuZGVmaW5lZCcgJiYgaXRlbVswXS5uYW1lKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXN0ZXMgPSBnZXRQYXN0ZXMoKTtcbiAgICAgICAgICAgICAgICAgICAgbG9nKFwi5Y+v55SoPiBcIiArIHBhc3RlcylcbiAgICAgICAgICAgICAgICAgICAgbGV0IHBhc3RldXJsID0gc2hhcmVQYXN0ZShhZXNFbmNvZGUoJ1NyY0p1JywgSlNPTi5zdHJpbmdpZnkoaXRlbSkpLCBcIuS6keWJqui0tOadvzZcIik7XG4gICAgICAgICAgICAgICAgICAgIGxvZyhcIuWIhuS6qz4gXCIgKyBwYXN0ZXVybClcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhc3RldXJsKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29kZSA9ICfogZrpmIXmjqXlj6Pvv6UnICsgYWVzRW5jb2RlKCdTcmNKdScsIHBhc3RldXJsKSArICfvv6UnICsgaXRlbVswXS5uYW1lO1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGtvdWxpbiA9ICfkupHlj6Pku6TvvJonICsgY29kZSArIGBAaW1wb3J0PWpzOiQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9pbXBvcnQ/cnVsZT3ogZrpmIXiiJpcIik7YDtcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KCdoaWtlcjovL3BhZ2UvamsnKSkucnVsZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIEpZaW1wb3J0KGtvdWxpbilcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJzZUludChnZXRNeVZhcigna291bGluLWxlbicpKTwyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBcdGxvZyhcIuaBreWWnO+8ge+8geWwj+eoi+W6j+W3suaIkOWKn+WvvOWFpe+8jOaJk+W8gOiBmumYheWNs+WPr+ebtOaOpeS9v+eUqFwiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIFx0Y29weShrb3VsaW4pO1xuICAgICAgICAgICAgICAgICAgICAgICAgXHRwdXRNeVZhcigna291bGluLXVybCcsIGtvdWxpbik7XG4gICAgICAgICAgICAgICAgICAgICAgICBcdHJlZnJlc2hQYWdlKGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIFx0cmV0dXJuIFwidG9hc3Q6Ly8o5Y2V5LiqKeWIhuS6q+WPo+S7pOW3sueUn+aIkFwiO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIFx0cmV0dXJuIFwidG9hc3Q6Ly/lkIjorqFcIiArIGdldE15VmFyKCdrb3VsaW4tbGVuJykgKyBcIuS4qu+8jOWvvOWFpVwiICsgZ2V0TXlWYXIoJ2tvdWxpbi1udW0nKSArIFwi5LiqXCI7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJ0b2FzdDovL+WIhuS6q+Wksei0pe+8jOWJqueymOadv+aIlue9kee7nOW8guW4uFwiO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcInJ1bGU6Ly9cIiArIGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShpdGVtKSk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcInRvYXN0Oi8v5Ymq57KY5p2/5oiW572R57uc5byC5bi477yM5pWw5o2u6I635Y+W5LiN5oiQ5Yqf77yM54K55Ye76L2s5o2i5ZCO6L+e5o6l5a+85YWl6K+V6K+VXCI7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIGNhbmNlbDogXCIndG9hc3Q6Ly/lvojpgZfmhr7vvIzkuI3og73kuLrmgqjmnI3liqHjgIInXCJcbiAgICAgICAgfSk7XG4gICAgICAgIGNvcHkoZ2V0TXlWYXIoJ3RlbXBsYXRlLXVybCcpKVxuICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgIHJldHVybiBcInRvYXN0Oi8v6L2s5o2i5oiQ5Yqf77yBXCJcbiAgICB9KSxcbiAgICBjb2xfdHlwZTogXCJpbnB1dFwiLFxuICAgIGRlc2M6IFwi5aSN5Yi257KY6LS05LiA6ZSu5a+85Y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cIixcInBhdGhcIjpcImprXCIsXCJydWxlXCI6XCJmdW5jdGlvbiBKWWltcG9ydChpbnB1dCkge1xcbiAgICB0cnkge1xcbiAgICAgICAgaW5wdXQgPSBpbnB1dC5yZXBsYWNlKFxcXCLkupHlj6Pku6TvvJpcXFwiLFxcXCJcXFwiKTtcXG4gICAgICAgIGxldCBpbnB1dG5hbWUgPSBpbnB1dC5zcGxpdCgn77+lJylbMF07XFxuICAgICAgICBpZiAoaW5wdXRuYW1lID09IFxcXCLogZrpmIXmjqXlj6NcXFwiKSB7XFxuICAgICAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuato+WcqOWvvOWFpe+8jOivt+eojeWQji4uLlxcXCIpO1xcbiAgICAgICAgICAgIGxldCBwYXJzZXVybCA9IGFlc0RlY29kZSgnU3JjSnUnLCBpbnB1dC5zcGxpdCgn77+lJylbMV0pO1xcbiAgICAgICAgICAgIGxldCBkYXRhbGlzdDI7XFxuICAgICAgICAgICAgaWYoL15odHRwLy50ZXN0KHBhcnNldXJsKSl7XFxuICAgICAgICAgICAgICAgIGxldCBjb250ZW50ID0gcGFyc2VQYXN0ZShwYXJzZXVybCk7XFxuICAgICAgICAgICAgICAgIGRhdGFsaXN0MiA9IEpTT04ucGFyc2UoYWVzRGVjb2RlKCdTcmNKdScsIGNvbnRlbnQpKTtcXG4gICAgICAgICAgICB9ZWxzZSBpZigvSllzaGFyZV8vLnRlc3QocGFyc2V1cmwpKXtcXG4gICAgICAgICAgICAgICAgZGF0YWxpc3QyID0gSlNPTi5wYXJzZShhZXNEZWNvZGUoJ1NyY0p1JywgZmV0Y2goJ2ZpbGU6Ly8nK3BhcnNldXJsKSkpO1xcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBkYXRhbGlzdDIgPSBKU09OLnBhcnNlKHBhcnNldXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IG51bSA9IDA7XFxuICAgICAgICAgICAgbGV0IHNvdXJjZWZ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ICAgICAgICAgICAgLy/kuozmrKHmiYvlt6Xnoa7orqTku6PnoIFcXG4gICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0My5wdXNoKGRhdGFsaXN0MltpXSk7XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgLy/pu5jorqTmmK/opobnm5blt7LlrZjlnKjnmoRcXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGRhdGFsaXN0LmluZGV4T2YoZGF0YWxpc3QuZmlsdGVyKGQgPT4gZC5uYW1lID09IGRhdGFsaXN0MltpXS5uYW1lICYmIGQudHlwZT09ZGF0YWxpc3QyW2ldLnR5cGUpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0LnNwbGljZShpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdDJbJ3VwZGF0ZXRpbWUnXSA9ICQuZGF0ZUZvcm1hdChuZXcgRGF0ZSgpLFxcXCJ5eXl5LU1NLWRkIEhIOm1tOnNzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdC5wdXNoKGRhdGFsaXN0MltpXSk7XFxuICAgICAgICAgICAgICAgICAgICBudW0gPSBudW0gKyAxO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHdyaXRlRmlsZShzb3VyY2VmaWxlLCBKU09OLnN0cmluZ2lmeShkYXRhbGlzdCkpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X3NlYXJjaE1hcmsnKTtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIGlmKGRhdGFsaXN0My5sZW5ndGg9PTApe1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigna291bGluLWxlbicsIGRhdGFsaXN0Mi5sZW5ndGgpXFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrb3VsaW4tbnVtJywgbnVtKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lkIjorqFcXFwiICsgZGF0YWxpc3QyLmxlbmd0aCArIFxcXCLkuKrvvIzlr7zlhaVcXFwiICsgbnVtICsgXFxcIuS4qlxcXCI7XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIHRvYXN0KFxcXCLlkIjorqFcXFwiICtkYXRhbGlzdDIubGVuZ3RoICsgXFxcIuS4qu+8jOWvvOWFpVxcXCIgKyBudW0gKyBcXFwi5Liq77yM5pyJXFxcIiArIGRhdGFsaXN0My5sZW5ndGggKyBcXFwi5Liq6ZyA5omL5bel56Gu6K6kXFxcIik7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXCIpLnJ1bGUoKHNvdXJjZWZpbGUsZGF0YWxpc3QzKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBhZGRMaXN0ZW5lcihcXFwib25DbG9zZVxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X3NlYXJjaE1hcmsnKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5pys5qyh5a+85YWl5YWx5Y+R546wXFxcIitkYXRhbGlzdDMubGVuZ3RoK1xcXCLkuKrlt7LlrZjlnKjmjqXlj6NcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLngrnlh7vkuIvpnaLmjqXlj6Pov5vooYzlr7nlupTmk43kvZxcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZGF0YWxpc3QzLmZvckVhY2goaXRlbT0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAoaXRlbS5zdG9wP2A8Zm9udCBjb2xvcj0jZjIwYzAwPmA6XFxcIlxcXCIpICsgaXRlbS5uYW1lICsgKGl0ZW0ucGFyc2UgPyBcXFwiIFvkuLvpobXmupBdXFxcIiA6IFxcXCJcXFwiKSArIChpdGVtLmVycGFyc2UgPyBcXFwiIFvmkJzntKLmupBdXFxcIiA6IFxcXCJcXFwiKSArIChpdGVtLnN0b3A/YDwvZm9udD5gOlxcXCJcXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFtcXFwi5p+l55yL5a+85YWlXFxcIiwgXFxcIuafpeeci+acrOWcsFxcXCIsIFxcXCLopobnm5blr7zlhaVcXFwiLCBcXFwi5pS55ZCN5a+85YWlXFxcIl0sIDIpLnNlbGVjdCgoc291cmNlZmlsZSwgZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSA9IEpTT04ucGFyc2UoYmFzZTY0RGVjb2RlKGRhdGEpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi5p+l55yL5pys5ZywXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKCdoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IycpLnJ1bGUoKHNvdXJjZWZpbGUsIGRhdGFpZCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUoJ+afpeeci+acrOWcsOaVsOaNricpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2Uvc2V0Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gZGF0YWxpc3QuZmlsdGVyKGQgPT4gZC5uYW1lID09IGRhdGFpZC5uYW1lICYmIGQudHlwZT09ZGF0YWlkLnR5cGUpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaWVrb3VhcGkoc291cmNlZmlsZSwgZGF0YSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc291cmNlZmlsZSwge3R5cGU6ZGF0YS50eXBlLCBuYW1lOmRhdGEubmFtZX0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZiAoaW5wdXQgPT0gXFxcIuafpeeci+WvvOWFpVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnaGlrZXI6Ly9lbXB0eSNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMnKS5ydWxlKChzb3VyY2VmaWxlLCBkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5p+l55yL5a+85YWl5pWw5o2uJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9zZXQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamlla291YXBpKHNvdXJjZWZpbGUsIGRhdGEsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNvdXJjZWZpbGUsIGRhdGEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0ID09IFxcXCLopobnm5blr7zlhaVcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuWwhuimhuebluacrOWcsO+8jOehruiupO+8n1xcXCIpLmNvbmZpcm0oKHNvdXJjZWZpbGUsZGF0YSk9PntcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvdXJjZWRhdGEgPSBmZXRjaChzb3VyY2VmaWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGRhdGFsaXN0PVxcXCIgKyBzb3VyY2VkYXRhICsgXFxcIjtcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gZGF0YWxpc3QuaW5kZXhPZihkYXRhbGlzdC5maWx0ZXIoZCA9PiBkLm5hbWU9PWRhdGEubmFtZSAmJiBkLnR5cGU9PWRhdGEudHlwZSlbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhWyd1cGRhdGV0aW1lJ10gPSAkLmRhdGVGb3JtYXQobmV3IERhdGUoKSxcXFwieXl5eS1NTS1kZCBISDptbTpzc1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdC5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc291cmNlZmlsZSwgSlNPTi5zdHJpbmdpZnkoZGF0YWxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignU3JjSnVfc2VhcmNoTWFyaycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey6KaG55uW5a+85YWlJztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LHNvdXJjZWZpbGUsZGF0YSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcIuaUueWQjeWvvOWFpVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChkYXRhLm5hbWUsXFxcIui+k+WFpeaWsOWQjeensFxcXCIpLmlucHV0KChzb3VyY2VmaWxlLGRhdGEpPT57XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb3VyY2VkYXRhID0gZmV0Y2goc291cmNlZmlsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBkYXRhbGlzdD1cXFwiICsgc291cmNlZGF0YSArIFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGRhdGFsaXN0LmluZGV4T2YoZGF0YWxpc3QuZmlsdGVyKGQgPT4gZC5uYW1lPT1pbnB1dCAmJiBkLnR5cGU9PWRhdGEudHlwZSlbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpbmRleD4tMSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5bey5a2Y5Zyo77yM5pyq5L+d5a2YXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLm5hbWUgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbJ3VwZGF0ZXRpbWUnXSA9ICQuZGF0ZUZvcm1hdChuZXcgRGF0ZSgpLFxcXCJ5eXl5LU1NLWRkIEhIOm1tOnNzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdC5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNvdXJjZWZpbGUsIEpTT04uc3RyaW5naWZ5KGRhdGFsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdTcmNKdV9zZWFyY2hNYXJrJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5L+d5a2Y77yM5paw5o6l5Y+j5ZCN56ew5Li677yaJytpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sc291cmNlZmlsZSxkYXRhKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzb3VyY2VmaWxlLCBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoaXRlbSkpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogKGl0ZW0uZ3JvdXA/XFxcIltcXFwiK2l0ZW0uZ3JvdXArXFxcIl0gXFxcIjpcXFwiXFxcIikgKyBpdGVtLnR5cGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXRlbS5pbWcgfHwgXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8va2UvMzEucG5nXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0ZW0udHlwZStcXFwiX1xcXCIraXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZCk7XFxuICAgICAgICAgICAgICAgIH0sc291cmNlZmlsZSxkYXRhbGlzdDMpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6Z2e5rOV5Y+j5LukXFxcIjtcXG4gICAgICAgIH1cXG4gICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgIGxvZygn4oia5Y+j5Luk6Kej5p6Q5aSx6LSlPicrZS5tZXNzYWdlKTtcXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lj6Pku6TmnInor6/miJbml6Dms5Xorr/pl65cXFwiO1xcbiAgICB9XFxufVwifSx7XCJuYW1lXCI6XCJzZXRcIixcInBhdGhcIjpcInNldFwiLFwicnVsZVwiOlwibGV0IHB1YmxpY2ZpbGU7XFxudHJ5e1xcbiAgICBwdWJsaWNmaWxlID0gJ2hpa2VyOi8vcGFnZS9saWMnO1xcbn1jYXRjaChlKXtcXG4gICAgbGV0IGNmZ2ZpbGUgPSBcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9TcmMvSnUvY29uZmlnLmpzb25cXFwiO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Hkjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjJykucnVsZSgoc291cmNlZmlsZSkgPT4ge1xcbiAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5aKe5YqgIHwg6IGa6ZiF5o6l5Y+jJyk7XFxuICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3NldCcpO1xcbiAgICAgICAgICAgIGppZWtvdWFwaShzb3VyY2VmaWxlKTtcXG4gICAgICAgIH0sIHNvdXJjZWZpbGUpLFxcbiAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tb3JlLzI1LnBuZ1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fNFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKFxcXCJTcmNKdV/osIPor5XmqKHlvI9cXFwiKT8n6YCA5Ye66LCD6K+VJzon6LCD6K+V5qih5byPJyxcXG4gICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoZ2V0TXlWYXIoXFxcIlNyY0p1X+iwg+ivleaooeW8j1xcXCIpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiU3JjSnVf6LCD6K+V5qih5byPXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJTcmNKdV/osIPor5XmqKHlvI9cXFwiLCBcXFwiMVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey6K6+572uXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9LHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldEl0ZW0oXFxcIlNyY0p1X+aOpeWPo+aXpeW/l1xcXCIpPyflhbPmjqXlj6Pml6Xlv5cnOiflvIDmjqXlj6Pml6Xlv5cnLFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZihnZXRJdGVtKFxcXCJTcmNKdV/mjqXlj6Pml6Xlv5dcXFwiKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbShcXFwiU3JjSnVf5o6l5Y+j5pel5b+XXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcIlNyY0p1X+aOpeWPo+aXpeW/l1xcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lorr7nva5cXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfmk43kvZwnLFxcbiAgICAgICAgdXJsOiAkKFtcXFwi5om56YeP6YCJ5oupXFxcIixcXFwi5om56YeP5rWL6K+VXFxcIixcXFwi5o6l5Y+j5pu05pawXFxcIixcXFwi5riF56m65o6l5Y+jXFxcIl0sIDIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2xpYycpO1xcbiAgICAgICAgICAgIGlmKGlucHV0PT1cXFwi5o6l5Y+j5pu05pawXFxcIil7XFxuICAgICAgICAgICAgICAgIHNob3dMb2FkaW5nKFxcXCLmm7TmlrDkuK0uLi5cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IHVwZGF0ZWxpc3QgPSBbXTtcXG4gICAgICAgICAgICAgICAgeXhkYXRhbGlzdC5mb3JFYWNoKGl0PT57XFxuICAgICAgICAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwibGV0IHlwYXJzZSA9IFxcXCIgKyBpdC5wYXJzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHlwYXJzZSAmJiB5cGFyc2UuZXh0ICYmIC9eaHR0cC8udGVzdCh5cGFyc2UuZXh0KSAmJiB1cGRhdGVsaXN0LmluZGV4T2YoeXBhcnNlLmV4dCk9PS0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZldGNoQ2FjaGUoeXBhcnNlLmV4dCwgMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZWxpc3QucHVzaCh5cGFyc2UuZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwibGV0IGVwYXJzZSA9IFxcXCIgKyBpdC5lcnBhcnNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZXBhcnNlICYmIGVwYXJzZS5leHQgJiYgL15odHRwLy50ZXN0KGVwYXJzZS5leHQpICYmIHVwZGF0ZWxpc3QuaW5kZXhPZihlcGFyc2UuZXh0KT09LTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmV0Y2hDYWNoZShlcGFyc2UuZXh0LCAwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwibGV0IGdwYXJzZSA9IFxcXCIgKyBpdC5wdWJsaWMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChncGFyc2UgJiYgZ3BhcnNlLmV4dCAmJiAvXmh0dHAvLnRlc3QoZ3BhcnNlLmV4dCkgJiYgdXBkYXRlbGlzdC5pbmRleE9mKGdwYXJzZS5leHQpPT0tMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmZXRjaENhY2hlKGdwYXJzZS5leHQsIDApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1jYXRjaChlKXtcXG5cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WcqOe6v+aOpeWPo+abtOaWsOWujOaIkFxcXCI7XFxuICAgICAgICAgICAgfWVsc2UgaWYoaW5wdXQ9PVxcXCLmuIXnqbrmjqXlj6NcXFwiKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIuehruWumua4heepuuaJgOacieaOpeWPo+WQl++8n1xcXCIpLmNvbmZpcm0oKHNvdXJjZWZpbGUpPT57XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5oOz5aW95LqG5ZCX77yM5riF56m65ZCO5peg5rOV5oGi5aSN77yBXFxcIikuY29uZmlybSgoc291cmNlZmlsZSk9PntcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YWxpc3QgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc291cmNlZmlsZSwgSlNPTi5zdHJpbmdpZnkoZGF0YWxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdTcmNKdV9zZWFyY2hNYXJrJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LmuIXnqbonO1xcbiAgICAgICAgICAgICAgICAgICAgfSxzb3VyY2VmaWxlKVxcbiAgICAgICAgICAgICAgICB9LHNvdXJjZWZpbGUpXFxuICAgICAgICAgICAgfWVsc2UgaWYoaW5wdXQ9PVxcXCLmibnph4/pgInmi6lcXFwiKXtcXG4gICAgICAgICAgICAgICAgbGV0IHNtO1xcbiAgICAgICAgICAgICAgICBpZihnZXRNeVZhcignU3JjSnVf5om56YeP6YCJ5oup5qih5byPJykpe1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignU3JjSnVf5om56YeP6YCJ5oup5qih5byPJyk7XFxuICAgICAgICAgICAgICAgICAgICBzbSA9IFxcXCLpgIDlh7rmibnph4/pgInmi6nmqKHlvI9cXFwiO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdTcmNKdV/mibnph4/pgInmi6nmqKHlvI8nLCcxJyk7XFxuICAgICAgICAgICAgICAgICAgICBzbSA9IFxcXCLov5vlhaXmibnph4/pgInmi6nmqKHlvI9cXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIrc207XFxuICAgICAgICAgICAgfWVsc2UgaWYoaW5wdXQ9PVxcXCLmibnph4/mtYvor5VcXFwiKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoZ2V0SXRlbSgnc2VhcmNodGVzdGtleScsICfmlpfnvZflpKfpmYYnKSxcXFwi6L6T5YWl5rWL6K+V5pCc57Si5YWz6ZSu5a2XXFxcIikuaW5wdXQoKCk9PntcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInNlYXJjaHRlc3RrZXlcXFwiLGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXCIpLnJ1bGUoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRMaXN0ZW5lcihcXFwib25DbG9zZVxcXCIsICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwi5YGc5q2i5pCc57Si57q/56iLXFxcIiwgXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwi5YGc5q2i5pCc57Si57q/56iLXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJ0ZXN0c291c3VvbG9hZGluZ1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3NkYXRhbGlzdDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZHVvc2VsZWN0ID0gc3RvcmFnZTAuZ2V0TXlWYXIoJ1NyY0p1X2R1b3NlbGVjdCcpP3N0b3JhZ2UwLmdldE15VmFyKCdTcmNKdV9kdW9zZWxlY3QnKTpbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZihkdW9zZWxlY3QubGVuZ3RoPjApe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzc2RhdGFsaXN0ID0gZHVvc2VsZWN0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvbGljJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzZGF0YWxpc3QgPSB5eGRhdGFsaXN0LmZpbHRlcihpdD0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldE15VmFyKFxcXCJTcmNKdV9qaWVrb3VUeXBlXFxcIixcXFwi5YWo6YOoXFxcIik9PVxcXCLlhajpg6hcXFwiIHx8IGdldE15VmFyKFxcXCJTcmNKdV9qaWVrb3VUeXBlXFxcIixcXFwi5YWo6YOoXFxcIik9PWl0LnR5cGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYWdlID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3VjY2VzcyA9IDA7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZhaWxsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRhc2sgPSBmdW5jdGlvbiAob2JqKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBvYmpkYXRhID0gb2JqLmRhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuYW1lID0gb2JqLm5hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCDmoIfor4YgPSBvYmpkYXRhLnR5cGUgKyBcXFwiX1xcXCIgKyBvYmpkYXRhLm5hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFyc2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQg5YWs5YWxO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwibGV0IHNvdXJjZSA9IFxcXCIgKyBvYmpkYXRhLmVycGFyc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNvdXJjZS5leHQgJiYgL15odHRwLy50ZXN0KHNvdXJjZS5leHQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZUNhY2hlKHNvdXJjZS5leHQsIDQ4KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IGVyZGF0YTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBzb3VyY2U7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihwYXJzZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwibGV0IGdvbmdnb25nID0gXFxcIiArIG9iamRhdGEucHVibGljKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ29uZ2dvbmcgJiYgZ29uZ2dvbmcuZXh0ICYmIC9eaHR0cC8udGVzdChnb25nZ29uZy5leHQpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVDYWNoZShnb25nZ29uZy5leHQsIDQ4KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ29uZ2dvbmcgPSBnZ2RhdGE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOWFrOWFsSA9IGdvbmdnb25nIHx8IHBhcnNlWyflhazlhbEnXSB8fCB7fTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3NkYXRhID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwibGV0IOaQnOe0oiA9IFxcXCIgKyBwYXJzZVsn5pCc57SiJ10pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IOWPguaVsCA9IHtcXFwi6KeE5YiZ5ZCNXFxcIjogTVlfUlVMRS50aXRsZSwgXFxcIuagh+ivhlxcXCI6IOagh+ivhn1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBvY3IoY29kZXVybCxoZWFkZXJzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM9IGhlYWRlcnMgfHwge307XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbWcgPSBjb252ZXJ0QmFzZTY0SW1hZ2UoY29kZXVybCxoZWFkZXJzKS5yZXBsYWNlKCdkYXRhOmltYWdlL2pwZWc7YmFzZTY0LCcsJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29kZSA9IHJlcXVlc3QoJ2h0dHBzOi8vYXBpLnhob2ZlLnRvcC9vY3IvYjY0L3RleHQnLCB7IGJvZHk6IGltZywgbWV0aG9kOiAnUE9TVCcsIGhlYWRlcnM6IHtcXFwiQ29udGVudC1UeXBlXFxcIjpcXFwidGV4dC9odG1sXFxcIn19KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSA9IGNvZGUucmVwbGFjZSgvby9nLCAnMCcpLnJlcGxhY2UoL3UvZywgJzAnKS5yZXBsYWNlKC9JL2csICcxJykucmVwbGFjZSgvbC9nLCAnMScpLnJlcGxhY2UoL2cvZywgJzknKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoY29kZS5pbmNsdWRlcyhcXFwiK1xcXCIpJiZjb2RlLmluY2x1ZGVzKFxcXCI9XFxcIikpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSA9IGV2YWwoY29kZS5zcGxpdChcXFwiPVxcXCIpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gY29kZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3NkYXRhID0g5pCc57SiKG5hbWUscGFnZSzlhazlhbEs5Y+C5pWwKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ZGF0YSA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzZGF0YS5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihpdGVtLnRpdGxlLmluY2x1ZGVzKG5hbWUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdGRhdGEucHVzaChpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHtyZXN1bHQ6cmVzdWx0ZGF0YS5sZW5ndGgsIHN1Y2Nlc3M6MSwgaWQ65qCH6K+GfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB7c3VjY2VzczowLCBtZXNzYWdlOifmnKrmib7liLDmkJzntKLku6PnoIEnLCBpZDrmoIfor4Z9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge3N1Y2Nlc3M6MCwgbWVzc2FnZTplLm1lc3NhZ2UsIGlkOuagh+ivhn07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGxpc3QgPSBzc2RhdGFsaXN0Lm1hcCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuYzogdGFzayxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtOiB7XFxcImRhdGFcXFwiOml0ZW0sXFxcIm5hbWVcXFwiOm5hbWV9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGl0ZW0udHlwZStcXFwiX1xcXCIraXRlbS5uYW1lXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGlzdC5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcInRlc3Rzb3VzdW9sb2FkaW5nXFxcIiwgeyB0aXRsZTogXFxcIuKAmOKAmOKAmeKAmTxzbWFsbD4oXFxcIitsaXN0Lmxlbmd0aCtcXFwiKeaJuemHj+a1i+ivleaQnOe0ouS4rS48L3NtYWxsPlxcXCIgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJlKGxpc3QsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uIChvYmosIGlkLCBlcnJvciwgdGFza1Jlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGdldE15VmFyKFxcXCLlgZzmraLmkJzntKLnur/nqItcXFwiKT09XFxcIjFcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJicmVha1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBhZGRpdGVtID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRhc2tSZXN1bHQuaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoW1xcXCLliKDpmaRcXFwiLCBcXFwi56aB55SoXFxcIl0sIDIpLnNlbGVjdCgoaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc291cmNlZmlsZSA9IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL1NyYy9KdS9qaWVrb3UuanNvblxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLliKDpmaRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaTvvJpcXFwiK2lkKS5jb25maXJtKChzb3VyY2VmaWxlLGlkKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvdXJjZWRhdGEgPSBmZXRjaChzb3VyY2VmaWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBkYXRhbGlzdD1cXFwiICsgc291cmNlZGF0YSArIFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBkYXRhbGlzdC5pbmRleE9mKGRhdGFsaXN0LmZpbHRlcihkID0+IGQudHlwZStcXFwiX1xcXCIrZC5uYW1lID09IGlkKVswXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNvdXJjZWZpbGUsIEpTT04uc3RyaW5naWZ5KGRhdGFsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdTcmNKdV9zZWFyY2hNYXJrJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LliKDpmaQnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LHNvdXJjZWZpbGUsaWQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi56aB55SoXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc291cmNlZGF0YSA9IGZldGNoKHNvdXJjZWZpbGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgZGF0YWxpc3Q9XFxcIiArIHNvdXJjZWRhdGEgKyBcXFwiO1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBkYXRhbGlzdC5pbmRleE9mKGRhdGFsaXN0LmZpbHRlcihkID0+IGQudHlwZStcXFwiX1xcXCIrZC5uYW1lID09IGlkKVswXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0W2luZGV4XS5zdG9wID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNvdXJjZWZpbGUsIEpTT04uc3RyaW5naWZ5KGRhdGFsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X3NlYXJjaE1hcmsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgaWQgKyBcXFwi5bey56aB55SoXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB0YXNrUmVzdWx0LmlkKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHRhc2tSZXN1bHQuaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodGFza1Jlc3VsdC5zdWNjZXNzPT0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWNjZXNzKys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRpdGVtLnRpdGxlID0gXFxcIuKAmOKAmOKAmeKAmTxmb250IGNvbG9yPSNmMTNiNjZhPlxcXCIrYWRkaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZGl0ZW0uZGVzYyA9IFxcXCLmiJDlip/mkJzntKLliLDmnaHnm67mlbDvvJpcXFwiK3Rhc2tSZXN1bHQucmVzdWx0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShcXFwidGVzdHNvdXN1b2xvYWRpbmdcXFwiLCBhZGRpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRpdGVtLnRpdGxlID0gXFxcIuKAnOKAnFxcXCIrYWRkaXRlbS50aXRsZStcXFwi4oCd4oCdXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZGl0ZW0uZGVzYyA9IHRhc2tSZXN1bHQubWVzc2FnZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhaWxsaXN0LnB1c2goYWRkaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUoXFxcInRlc3Rzb3VzdW9sb2FkaW5nXFxcIiwgZmFpbGxpc3QpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJ0ZXN0c291c3VvbG9hZGluZ1xcXCIsIHsgdGl0bGU6IFxcXCLigJjigJjigJnigJk8c21hbGw+PGZvbnQgY29sb3I9I2YxM2I2NmE+XFxcIiArIHN1Y2Nlc3MgKyBcXFwiPC9mb250Pi9cXFwiICsgbGlzdC5sZW5ndGggKyBcXFwi77yM5rWL6K+V5pCc57Si5a6M5oiQPC9zbWFsbD5cXFwiIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcInRlc3Rzb3VzdW9sb2FkaW5nXFxcIiwgeyB0aXRsZTogXFxcIuKAmOKAmOKAmeKAmTxzbWFsbD7ml6DmjqXlj6M8L3NtYWxsPlxcXCIgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgaW5wdXQpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIGltZzogXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbW9yZS8yOTAucG5nXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaWNvbl80XFxcIlxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5a+85YWlJyxcXG4gICAgICAgIHVybDogJChbXFxcIuiBmumYheWPo+S7pFxcXCIsXFxcIuaWh+S7tuWvvOWFpVxcXCJdLCAyICwgXFxcIumAieaLqeWvvOWFpeaWueW8j1xcXCIpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgaWYoaW5wdXQ9PVxcXCLogZrpmIXlj6Pku6RcXFwiKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLogZrpmIXliIbkuqvlj6Pku6RcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2Uvc2V0Jyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gSllpbXBvcnQoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1lbHNlIGlmKGlucHV0PT1cXFwi5paH5Lu25a+85YWlXFxcIil7XFxuICAgICAgICAgICAgICAgIHJldHVybiBgZmlsZVNlbGVjdDovL2ArJC50b1N0cmluZygoKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgaWYoL0pZc2hhcmVfLy50ZXN0KGlucHV0KSAmJiBpbnB1dC5lbmRzV2l0aCgndHh0Jykpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QoJ2hpa2VyOi8vcGFnZS9zZXQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbnB1dCA9ICfogZrpmIXmjqXlj6Pvv6UnICsgYWVzRW5jb2RlKCdTcmNKdScsIGlucHV0KSArICfvv6Xmlofku7blr7zlhaUnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBKWWltcG9ydChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvSllpbXBvcnRfLy50ZXN0KGlucHV0KSAmJiBpbnB1dC5lbmRzV2l0aCgnaGlrZXInKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3NldCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb250ZW50ID0gZmV0Y2goJ2ZpbGU6Ly8nK2lucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSllpbXBvcnQoY29udGVudCk7XFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K+36YCJ5oup5q2j56Gu55qE6IGa6ZiF5o6l5Y+j5YiG5Lqr5paH5Lu2XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pLFxcbiAgICAgICAgaW1nOiBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tb3JlLzQzLnBuZ1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fNFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGxvbmdDbGljazogW3tcXG4gICAgICAgICAgICAgICAgdGl0bGU6IEp1Y29uZmlnWydJbXBvcnRUeXBlJ109PVxcXCJTa2lwXFxcIj8n5a+85YWl5qih5byP77ya6Lez6L+HJzpKdWNvbmZpZ1snSW1wb3J0VHlwZSddPT1cXFwiQ29uZmlybVxcXCI/J+WvvOWFpeaooeW8j++8muehruiupCc6J+WvvOWFpeaooeW8j++8muimhueblicsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChjZmdmaWxlLCBKdWNvbmZpZykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoW1xcXCLopobnm5ZcXFwiLCBcXFwi6Lez6L+HXFxcIiwgXFxcIuehruiupFxcXCJdLDIpLnNlbGVjdCgoY2ZnZmlsZSxKdWNvbmZpZykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIEp1Y29uZmlnW1xcXCJJbXBvcnRUeXBlXFxcIl0gPSBpbnB1dD09XFxcIuimhuebllxcXCI/XFxcIkNvdmVyYWdlXFxcIjppbnB1dD09XFxcIui3s+i/h1xcXCI/XFxcIlNraXBcXFwiOlxcXCJDb25maXJtXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoY2ZnZmlsZSwgSlNPTi5zdHJpbmdpZnkoSnVjb25maWcpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZihpbnB1dD09XFxcIuehruiupFxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b2FzdChcXFwi5o+Q6YaS77ya5omL5bel56Gu6K6k5qih5byP77yM5LiN5pSv5oyB5LqR5Y+j5Luk55u05o6l5a+85YWl77yM6ZyA54K55Ye75a+85YWl5oyJ6ZKuXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1c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gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBzaGFyZWxpc3QucmV2ZXJzZSgpOy8v5LuO5pi+56S65o6S5bqP5Zue5Yiw5a6e6ZmF5o6S5bqPXFxuICAgICAgICAgICAgbGV0IHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgIHBhc3Rlcy5wdXNoKCfmlofku7bliIbkuqsnKTtcXG4gICAgICAgICAgICBwYXN0ZXMucHVzaCgn5LqR5Y+j5Luk5paH5Lu2Jyk7XFxuICAgICAgICAgICAgcmV0dXJuICQocGFzdGVzLCAyICwgXFxcIumAieaLqeWJqui0tOadv1xcXCIpLnNlbGVjdCgoc2hhcmVsaXN0KSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmKGlucHV0PT0n5paH5Lu25YiG5LqrJyl7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgc2hhcmV0eHQgPSBhZXNFbmNvZGUoJ1NyY0p1JywgSlNPTi5zdHJpbmdpZnkoc2hhcmVsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgc2hhcmVmaWxlID0gJ2hpa2VyOi8vZmlsZXMvX2NhY2hlL0pZc2hhcmVfJytzaGFyZWxpc3QubGVuZ3RoKydfJyskLmRhdGVGb3JtYXQobmV3IERhdGUoKSxcXFwiSEhtbXNzXFxcIikrJy50eHQnO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNoYXJlZmlsZSwgc2hhcmV0eHQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoZmlsZUV4aXN0KHNoYXJlZmlsZSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnc2hhcmU6Ly8nK3NoYXJlZmlsZTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/liIbkuqvmlofku7bnlJ/miJDlpLHotKUnO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZihpbnB1dD09J+S6keWPo+S7pOaWh+S7ticpe1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNoYXJldHh0ID0gYWVzRW5jb2RlKCdTcmNKdScsIEpTT04uc3RyaW5naWZ5KHNoYXJlbGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNvZGUgPSAn6IGa6ZiF5o6l5Y+j77+lJyArIHNoYXJldHh0ICsgJ++/peS6keWPo+S7pOaWh+S7tic7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgc2hhcmVmaWxlID0gJ2hpa2VyOi8vZmlsZXMvX2NhY2hlL0pZaW1wb3J0Xycrc2hhcmVsaXN0Lmxlbmd0aCsnXycrJC5kYXRlRm9ybWF0KG5ldyBEYXRlKCksXFxcIkhIbW1zc1xcXCIpKycuaGlrZXInO1xcbiAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNoYXJlZmlsZSwgJ+S6keWPo+S7pO+8micrY29kZStgQGltcG9ydD1qczokLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9pbXBvcnQ/cnVsZT1gK01ZX1JVTEUudGl0bGUrYFxcXCIpO2ApO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoZmlsZUV4aXN0KHNoYXJlZmlsZSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnc2hhcmU6Ly8nK3NoYXJlZmlsZTtcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kupHlj6Pku6Tmlofku7bnlJ/miJDlpLHotKUnO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHNob3dMb2FkaW5nKCfliIbkuqvkuIrkvKDkuK3vvIzor7fnqI3lkI4uLi4nKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXN0ZXVybCA9IHNoYXJlUGFzdGUoYWVzRW5jb2RlKCdTcmNKdScsIEpTT04uc3RyaW5naWZ5KHNoYXJlbGlzdCkpLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9eaHR0cC8udGVzdChwYXN0ZXVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgY29kZSA9ICfogZrpmIXmjqXlj6Pvv6UnICsgYWVzRW5jb2RlKCdTcmNKdScsIHBhc3RldXJsKSArICfvv6XlhbEnICsgc2hhcmVsaXN0Lmxlbmd0aCArICfmnaEoJytpbnB1dCsnKSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29weSgn5LqR5Y+j5Luk77yaJytjb2RlK2BAaW1wb3J0PWpzOiQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2ltcG9ydD9ydWxlPWArTVlfUlVMRS50aXRsZStgXFxcIik7YCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ogZrpmIXliIbkuqvlj6Pku6Tlt7LnlJ/miJBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5YiG5Lqr5aSx6LSl77yM5Ymq57KY5p2/5oiW572R57uc5byC5bi4XFxcIitwYXN0ZXVybDtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sc2hhcmVsaXN0KVxcbiAgICAgICAgfSksXFxuICAgICAgICBpbWc6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21vcmUvMy5wbmdcXFwiLFxcbi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9IFxcXCLlhajpg6hcXFwiICYmIGdldEl0ZW0oaXQrJ3N0b3B0eXBlJyk9PVxcXCIxXFxcIil7XFxuICAgICAgICAgICAgdHlwZW5hbWUgPSB0eXBlbmFtZStcXFwiKOWBnClcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgKi9cXG4gICAgICAgIGxldCBvYmogPSB7XFxuICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKFxcXCJTcmNKdV9qaWVrb3VUeXBlXFxcIixcXFwi5YWo6YOoXFxcIik9PWl0P2DigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICMzMzk5Y2NcXFwiPmArdHlwZW5hbWUrYDwvc3Bhbj48L2I+YDp0eXBlbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGl0KSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmKGdldE15VmFyKFxcXCJTcmNKdV9qaWVrb3VUeXBlXFxcIikhPWl0KXtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJTcmNKdV9qaWVrb3VUeXBlXFxcIixpdCk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LGl0KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9XFxuICAgICAgICAvKlxcbiAgICAgICAgaWYoaXQgIT0gXFxcIuWFqOmDqFxcXCIpe1xcbiAgICAgICAgICAgIG9iai5leHRyYSA9IHt9O1xcbiAgICAgICAgICAgIGxldCBsb25nQ2xpY2sgPSBbXTtcXG4gICAgICAgICAgICBpZihnZXRNeVZhcihcXFwiU3JjSnVfamlla291VHlwZVxcXCIpPT1pdCl7XFxuICAgICAgICAgICAgICAgIGxvbmdDbGljay5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiAoZ2V0SXRlbShpdCsnc3RvcHR5cGUnKT09XFxcIjFcXFwiP1xcXCLlkK/nlKhcXFwiOlxcXCLlgZznlKhcXFwiKStpdCxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChpdCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKGdldEl0ZW0oaXQrJ3N0b3B0eXBlJyk9PVxcXCIxXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFySXRlbShpdCsnc3RvcHR5cGUnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShpdCsnc3RvcHR5cGUnLCcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSxpdClcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYobG9uZ0NsaWNrLmxlbmd0aD4wKXtvYmpbXFxcImV4dHJhXFxcIl0ubG9uZ0NsaWNrID0gbG9uZ0NsaWNrO31cXG4gICAgICAgIH1cXG4gICAgICAgICovXFxuICAgICAgICBkLnB1c2gob2JqKTtcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi8J+UjVxcXCIsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCJTcmNKdV9zZWFjcmhKaWVrb3VcXFwiLGlucHV0KTtcXG4gIC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biAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdC5zcGxpY2UoaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGktLTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc291cmNlZmlsZSwgSlNPTi5zdHJpbmdpZnkoZGF0YWxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X3NlYXJjaE1hcmsnKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X2R1b3NlbGVjdCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIoOmZpOmAieaLqSc7XFxuICAgICAgICAgICAgICAgIH0sc291cmNlZmlsZSxkdW9zZWxlY3QpXFxuICAgICAgICAgICAgfSxzb3VyY2VmaWxlKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIGprZGF0YWxpc3QuZm9yRWFjaChpdGVtID0+IHtcXG4gICAgICAgIGlmKGdldE15VmFyKFxcXCJTcmNKdV9qaWVrb3VUeXBlXFxcIixcXFwi5YWo6YOoXFxcIik9PVxcXCLlhajpg6hcXFwiIHx8IGdldE15VmFyKFxcXCJTcmNKdV9qaWVrb3VUeXBlXFxcIixcXFwi5YWo6YOoXFxcIik9PWl0ZW0udHlwZSl7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IChpdGVtLnN0b3A/YDxmb250IGNvbG9yPSNmMjBjMDA+YDpcXFwiXFxcIikgKyBpdGVtLm5hbWUgKyAoaXRlbS5wYXJzZSA/IFxcXCIgW+S4u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G9uZXNoYXJlID0gW11cXG4gICAgICAgICAgICAgICAgICAgICAgICBvbmVzaGFyZS5wdXNoKGRhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXN0ZXVybCA9IHNoYXJlUGFzdGUoYWVzRW5jb2RlKCdTcmNKdScsIEpTT04uc3RyaW5naWZ5KG9uZXNoYXJlKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhc3RldXJsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjb2RlID0gJ+iBmumYheaOpeWPo++/pScgKyBhZXNFbmNvZGUoJ1NyY0p1JywgcGFzdGV1cmwpICsgJ++/pScgKyBkYXRhLm5hbWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvcHkoJ+S6keWPo+S7pO+8micrY29kZStgQGltcG9ydD1qczokLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9pbXBvcnQ/cnVsZT1gK01ZX1JVTEUudGl0bGUrYFxcXCIpO2ApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vKOWNleS4qinliIbkuqvlj6Pku6Tlt7LnlJ/miJBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liIbkuqvlpLHotKXvvIzliarnspjmnb/miJbnvZHnu5zlvILluLhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcIue8lui+kVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJCgnaGlrZXI6Ly9lbXB0eSNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMnKS5ydWxlKChzb3VyY2VmaWxlLCBkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn57yW6L6RIHwg6IGa6ZiF5o6l5Y+jJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9zZXQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgamlla291YXBpKHNvdXJjZWZpbGUsIEpTT04ucGFyc2UoYmFzZTY0RGVjb2RlKGRhdGEpKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgc291cmNlZmlsZSwgYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGRhdGEpKSlcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcIuWIoOmZpFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi56Gu5a6a5Yig6Zmk77yaXFxcIitkYXRhLm5hbWUpLmNvbmZpcm0oKHNvdXJjZWZpbGUsZGF0YSk9PntcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvdXJjZWRhdGEgPSBmZXRjaChzb3VyY2VmaWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGRhdGFsaXN0PVxcXCIgKyBzb3VyY2VkYXRhICsgXFxcIjtcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gZGF0YWxpc3QuaW5kZXhPZihkYXRhbGlzdC5maWx0ZXIoZCA9PiBkLm5hbWU9PWRhdGEubmFtZSAmJiBkLnR5cGU9PWRhdGEudHlwZSlbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc291cmNlZmlsZSwgSlNPTi5zdHJpbmdpZnkoZGF0YWxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignU3JjSnVfc2VhcmNoTWFyaycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LliKDpmaQnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sc291cmNlZmlsZSxkYXRhKVxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi56aB55SoXFxcIiB8fCBpbnB1dCA9PSBcXFwi5ZCv55SoXFxcIiApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgc291cmNlZGF0YSA9IGZldGNoKHNvdXJjZWZpbGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBkYXRhbGlzdD1cXFwiICsgc291cmNlZGF0YSArIFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gZGF0YWxpc3QuaW5kZXhPZihkYXRhbGlzdC5maWx0ZXIoZCA9PiBkLm5hbWU9PWRhdGEubmFtZSAmJiBkLnR5cGU9PWRhdGEudHlwZSlbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzbTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZihpbnB1dCA9PSBcXFwi56aB55SoXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0W2luZGV4XS5zdG9wID0gMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc20gPSBkYXRhLm5hbWUgKyBcXFwi5bey56aB55SoXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGRhdGFsaXN0W2luZGV4XS5zdG9wO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbSA9IGRhdGEubmFtZSArIFxcXCLlt7LlkK/nlKhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc291cmNlZmlsZSwgSlNPTi5zdHJpbmdpZnkoZGF0YWxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdTcmNKdV9zZWFyY2hNYXJrJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgc207XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0PT1cXFwi6YCJ5oupXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9ob2QnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkdW9zZWxlY3QoZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcIuaUueWQjVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChkYXRhLm5hbWUsXFxcIui+k+WFpeaWsOWQjeensFxcXCIpLmlucHV0KChzb3VyY2VmaWxlLGRhdGEpPT57XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzb3VyY2VkYXRhID0gZmV0Y2goc291cmNlZmlsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBkYXRhbGlzdD1cXFwiICsgc291cmNlZGF0YSArIFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpbmRleCA9IGRhdGFsaXN0LmluZGV4T2YoZGF0YWxpc3QuZmlsdGVyKGQgPT4gZC5uYW1lPT1kYXRhLm5hbWUgJiYgZC50eXBlPT1kYXRhLnR5cGUpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YWxpc3RbaW5kZXhdLm5hbWUgPSBpbnB1dDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd3JpdGVGaWxlKHNvdXJjZWZpbGUsIEpTT04uc3RyaW5naWZ5KGRhdGFsaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X3NlYXJjaE1hcmsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey6YeN5ZG95ZCNJztcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LHNvdXJjZWZpbGUsZGF0YSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSwgc291cmNlZmlsZSwgYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGl0ZW0pKSksXFxuICAgICAgICAgICAgICAgIGRlc2M6IChpdGVtLmdyb3VwP1xcXCJbXFxcIitpdGVtLmdyb3VwK1xcXCJdIFxcXCI6XFxcIlxcXCIpICsgaXRlbS50eXBlLFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0uaW1nIHx8IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL2tlLzMxLnBuZ1xcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLnR5cGUrXFxcIl9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cXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcignU3JjSnVfamlla291bmFtZScpIHx8IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignU3JjSnVfamlla291bmFtZScsIGlucHV0KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5o6l5Y+j57G75Z6L77yaJysgZ2V0TXlWYXIoJ1NyY0p1X2ppZWtvdXR5cGUnLCfmvKvnlLsnKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgIHVybDogJChydW5Nb2RlcywyLFxcXCLmjqXlj6PnsbvlnotcXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdTcmNKdV9qaWVrb3V0eXBlJyxpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mjqXlj6Pnsbvlnovlt7Lorr7nva7kuLrvvJonICsgaW5wdXQ7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfmjqXlj6Plm77moIcnLFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICBkZXNjOlxcXCLmjqXlj6Plm77moIflj6/nlZnnqbpcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdTcmNKdV9qaWVrb3VpbWcnKSB8fCBcXFwiXFxcIixcXG4gICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1NyY0p1X2ppZWtvdWltZycsIGlucHV0KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5pCc57Si5YiG57uE77yaJysgZ2V0TXlWYXIoJ1NyY0p1X2ppZWtvdWdyb3VwJywnJyksXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6XFxcIuaQnOe0ouWIhue7hOWPr+eVmeepuizlvLrliLbmkJzntKLovpPlhaXlhajlhahcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCdTcmNKdV9qaWVrb3Vncm91cCcpIHx8IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcignU3JjSnVfamlla291Z3JvdXAnLCBpbnB1dCk7XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+S4gOe6p+S4u+mhteaVsOaNrua6kCcsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLkuIDnuqfkuLvpobXmlbDmja7mupAsIOWPr+S7peeVmeepulxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGR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T4ge1xcbiAgICAgICAgICAgICAgICBpZiAoL3t8fS8udGVzdChpbnB1dCkgfHwgIWlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwiU3JjSnVfamlla291ZXJwYXJzZVxcXCIsIGlucHV0KVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+WFrOWFseWPmOmHjycsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLlhazlhbHlj5jph48sIHt95a+56LGhXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBzdG9yYWdlMC5nZXRNeVZhcignU3JjSnVfamlla291cHVibGljJykgfHwgXFxcIlxcXCIsXFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICB0eXBlOiBcXFwidGV4dGFyZWFcXFwiLFxcbiAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICBoZWlnaHQ6IDIsXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoL3t8fS8udGVzdChpbnB1dCkgfHwgIWlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwiU3JjSnVfamlla291cHVibGljXFxcIiwgaW5wdXQpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgaWYoZGF0YSYmZGF0YS51cGRhdGV0aW1lKXtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmm7TmlrDml7bpl7TvvJonKyBkYXRhLnVwZGF0ZXRpbWUsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGlmKCFsb29rKXtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmtYvor5XmkJzntKInLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8yJyxcXG4gICAgICAgICAgICB1cmw6ICQoZ2V0SXRlbSgnc2VhcmNodGVzdGtleScsICfmlpfnvZflpKfpmYYnKSxcXFwi6L6T5YWl5rWL6K+V5pCc57Si5YWz6ZSu5a2XXFxcIikuaW5wdXQoKCk9PntcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFwic2VhcmNodGVzdGtleVxcXCIsaW5wdXQpO1xcbiAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IGdldE15VmFyKCdTcmNKdV9qaWVrb3VuYW1lJyk7XFxuICAgICAgICAgICAgICAgIGxldCB0eXBlID0gZ2V0TXlWYXIoJ1NyY0p1X2ppZWtvdXR5cGUnLCfmvKvnlLsnKTtcXG4gICAgICAgICAgICAgICAgbGV0IGVycGFyc2UgPSBnZXRNeVZhcignU3JjSnVfamlla291ZXJwYXJzZScpO1xcbiAgICAgICAgICAgICAgICBsZXQgcHVibGljID0gZ2V0TXlWYXIoJ1NyY0p1X2ppZWtvdXB1YmxpYycpO1xcbiAgICAgICAgICAgICAgICBpZighbmFtZSB8fCAhZXJwYXJzZSl7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5oiW5pCc57Si5rqQ5o6l5Y+j5LiN6IO95Li656m6XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgc291cmNlID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHlwZTogdHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBlcnBhcnNlOiBlcnBhcnNlXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZihwdWJsaWMpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZS5wdWJsaWMgPSBwdWJsaWM7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZygn4oia5rqQ5o6l5Y+j5byC5bi4PicrZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mkJzntKLmupDmjqXlj6PmnInlvILluLjvvIznnIvml6Xlv5dcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYoc291cmNlKXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCJoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IyMjZnlwYWdlXFxcIikucnVsZSgobmFtZSxzZGF0YSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGFkZExpc3RlbmVyKFxcXCJvbkNsb3NlXFxcIiwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X3NvdXN1b1Rlc3QnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1NyY0p1X3NvdXN1b1Rlc3QnLCcxJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlKGNvbmZpZy7kvp3otZYpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQgPSBzZWFyY2gobmFtZSxcXFwic291c3VvdGVzdFxcXCIsc2RhdGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5rWL6K+V5pCc57Si56ysXFxcIitNWV9QQUdFK1xcXCLpobXnu5PmnZ9cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpO1xcbiAgICAgICAgICAgICAgICAgICAgfSxpbnB1dCxzb3VyY2UpXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ehruiupOaQnOe0oua6kOaOpeWPo+aVsOaNru+8n1xcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJ+S/neWtmOaOpeWPoycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcbiAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChzb3VyY2VmaWxlLG9sZHR5cGUscnVuTW9kZXMpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKCFnZXRNeVZhcignU3JjSnVfamlla291bmFtZScpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5ZCN56ew5LiN6IO95Li656m6XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoIWdldE15VmFyKCdTcmNKdV9qaWVrb3VwYXJzZScpICYmICFnZXRNeVZhcignU3JjSnVfamlla291ZXJwYXJzZScpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Li76aG15rqQ5pWw5o2u5ZKM5pCc57Si5rqQ5pWw5o2u5LiN6IO95ZCM5pe25Li656m6XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5hbWUgPSBnZXRNeVZhcignU3JjSnVfamlla291bmFtZScpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGltZyA9IGdldE15VmFyKCdTcmNKdV9qaWVrb3VpbWcnKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChydW5Nb2Rlcy5pbmRleE9mKG5hbWUpPi0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aOpeWPo+WQjeensOS4jeiDveWxnuS6juexu+Wei+WQjVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBsZXQgdHlwZSA9IGdldE15VmFyKCdTcmNKdV9qaWVrb3V0eXBlJywn5ryr55S7Jyk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgZ3JvdXAgPSBnZXRNeVZhcignU3JjSnVfamlla291Z3JvdXAnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwYXJzZSA9IGdldE15VmFyKCdTcmNKdV9qaWVrb3VwYXJzZScpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVycGFyc2UgPSBnZXRNeVZhcignU3JjSnVfamlla291ZXJwYXJzZScpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHB1YmxpYyA9IGdldE15VmFyKCdTcmNKdV9qaWVrb3VwdWJsaWMnKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBuZXdhcGkgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmFtZTogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiB0eXBlXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZihncm91cCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3YXBpWydncm91cCddID0gZ3JvdXA7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAocGFyc2UpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcImxldCB5cGFyc2UgPSBcXFwiICsgcGFyc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfiiJrkuIDnuqfkuLvpobXmupDku6PnoIHlvILluLg+JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LiA57qn5Li76aG15rqQ5pyJ6ZSZ6K+v77yM55yL5pel5b+XXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdhcGlbJ3BhcnNlJ10gPSBwYXJzZTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGlmIChlcnBhcnNlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJsZXQgZXBhcnNlID0gXFxcIiArIGVycGFyc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKCfiiJrkuoznuqfmkJzntKLmupDku6PnoIHlvILluLg+JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5LqM57qn5pCc57Si5rqQ5pyJ6ZSZ6K+v77yM55yL5pel5b+XXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXdhcGlbJ2VycGFyc2UnXSA9IGVycGFyc2U7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAocHVibGljKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJsZXQgZ3BhcnNlID0gXFxcIiArIHB1YmxpYyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coJ+KImuWFrOWFseS7o+eggeW8guW4uD4nK2UubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lhazlhbHku6PnoIHmnInplJnor6/vvIznnIvml6Xlv5dcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ld2FwaVsncHVibGljJ10gPSBwdWJsaWM7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW1nKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3YXBpWydpbWcnXSA9IGltZztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIG5ld2FwaVsndXBkYXRldGltZSddID0gJC5kYXRlRm9ybWF0KG5ldyBEYXRlKCksXFxcInl5eXktTU0tZGQgSEg6bW06c3NcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBzb3VyY2VkYXRhID0gZmV0Y2goc291cmNlZmlsZSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlZGF0YSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoXFxcInZhciBkYXRhbGlzdD1cXFwiICsgc291cmNlZGF0YSArIFxcXCI7XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YWxpc3QgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciBkYXRhbGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gZGF0YWxpc3QuaW5kZXhPZihkYXRhbGlzdC5maWx0ZXIoZCA9PiBkLm5hbWU9PW5hbWUgJiYgKGQudHlwZT09dHlwZXx8IWQudHlwZSkpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpbmRleCA+IC0xICYmIGdldE15VmFyKCdTcmNKdV9qaWVrb3VlZGl0JykgIT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWtmOWcqC1cXFwiICsgbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBkYXRhbGlzdC5pbmRleE9mKGRhdGFsaXN0LmZpbHRlcihkID0+IGQubmFtZT09bmFtZSAmJiAoZC50eXBlPT1vbGR0eXBlfHwhZC50eXBlKSlbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignU3JjSnVfamlla291ZWRpdCcpID09IFxcXCIxXFxcIiAmJiBpbmRleCA+IC0xKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0LnNwbGljZShpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0LnB1c2gobmV3YXBpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc291cmNlZmlsZSwgSlNPTi5zdHJpbmdpZnkoZGF0YWxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdTcmNKdV9zZWFyY2hNYXJrJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSgnaGlrZXI6Ly9maWxlcy9fY2FjaGUvJyt0eXBlKydfJytuYW1lKycuanNvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJhY2sodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suS/neWtmFxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mjqXlj6PmlbDmja7lvILluLjvvIzor7fnoa7orqTlr7nosaHmoLzlvI9cXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgc291cmNlZmlsZSxkYXRhP2RhdGEudHlwZTpcXFwiXFxcIixydW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BudW0gPSAwO1xcbiAgICAgICAgICAgIGRhdGFsaXN0LnJldmVyc2UoKTtcXG4gICAgICAgICAgICBsZXQgZGF0YWxpc3QzID0gW107Ly/lrZjmlL7lvoXkuozmrKHnoa7orqTnmoTkuLTml7bmjqXlj6NcXG4gICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGRhdGFsaXN0Mi5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICBkYXRhbGlzdDJbJ3VwZGF0ZXRpbWUnXSA9ICQuZGF0ZUZvcm1hdChuZXcgRGF0ZSgpLFxcXCJ5eXl5LU1NLWRkIEhIOm1tOnNzXFxcIik7XFxuICAgICAgICAgICAgICAgIGlmICghZGF0YWxpc3Quc29tZShpdGVtID0+IGl0ZW0ubmFtZSA9PSBkYXRhbGlzdDJbaV0ubmFtZSAmJiBpdGVtLnR5cGU9PWRhdGFsaXN0MltpXS50eXBlKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZGF0YWxpc3QucHVzaChkYXRhbGlzdDJbaV0pO1xcbiAgICAgICAgICAgICAgICAgICAgbnVtID0gbnVtICsgMTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoSnVjb25maWdbJ0ltcG9ydFR5cGUnXT09XFxcIlNraXBcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIC8v5bey5a2Y5Zyo55qE6Lez6L+H77yM5ZWl5Lmf5LiN5YGaXFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKEp1Y29uZmlnWydJbXBvcnRUeXBlJ109PVxcXCJDb25maXJtXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICAvL+S6jOasoeaJi+W3peehruiupOS7o+eggVxcbiAgICAgICAgICAgICAgICAgICAgZGF0YWxpc3QzLnB1c2goZGF0YWxpc3QyW2ldKTtcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAvL+m7mOiupOaYr+imhuebluW3suWtmOWcqOeahFxcbiAgICAgICAg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vIzmnIlcXFwiICsgZGF0YWxpc3QzLmxlbmd0aCArIFxcXCLkuKrpnIDmiYvlt6Xnoa7orqRcXFwiKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcImhpa2VyOi8vZW1wdHkjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjXFxcIikucnVsZSgoc291cmNlZmlsZSxkYXRhbGlzdDMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGFkZExpc3RlbmVyKFxcXCJvbkNsb3NlXFxcIiwgJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignU3JjSnVfc2VhcmNoTWFyaycpO1xcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmnKzmrKHlr7zlhaXlhbHlj5HnjrBcXFwiK2RhdGFsaXN0My5sZW5ndGgrXFxcIuS4quW3suWtmOWcqOaOpeWPo1xcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIueCueWHu+S4i+mdouaOpeWPo+i/m+ihjOWvueW6lOaTjeS9nFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkYXRhbGlzdDMuZm9yRWFjaChpdGVtPT57XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChpdGVtLnN0b3A/YDxmb250IGNvbG9yPSNmMjBjMDA+YDpcXFwiXFxcIikgKyBpdGVtLm5hbWUgKyAoaXRlbS5wYXJzZSA/IFxcXCIgW+S4u+mhtea6kF1cXFwiIDogXFxcIlxcXCIpICsgKGl0ZW0uZXJwYXJzZSA/IFxcXCIgW+aQnOe0oua6kF1cXFwiIDogXFxcIlxcXCIpICsgKGl0ZW0uc3RvcD9gPC9mb250PmA6XFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoW1xcXCLmn6XnnIvlr7zlhaVcXFwiLCBcXFwi5p+l55yL5pys5ZywXFxcIiwgXFxcIuimhuebluWvvOWFpVxcXCIsIFxcXCLmlLnlkI3lr7zlhaVcXFwiXSwgMikuc2VsZWN0KChzb3VyY2VmaWxlLCBkYXRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhID0gSlNPTi5wYXJzZShiYXNlNjREZWNvZGUoZGF0YSkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXCLmn6XnnIvmnKzlnLBcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoJ2hpa2VyOi8vZW1wdHkjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjJykucnVsZSgoc291cmNlZmlsZSwgZGF0YWlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZSgn5p+l55yL5pys5Zyw5pWw5o2uJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9zZXQnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBkYXRhbGlzdC5maWx0ZXIoZCA9PiBkLm5hbWUgPT0gZGF0YWlkLm5hbWUgJiYgZC50eXBlPT1kYXRhaWQudHlwZSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppZWtvdWFwaShzb3VyY2VmaWxlLCBkYXRhLCAxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCBzb3VyY2VmaWxlLCB7dHlwZTpkYXRhLnR5cGUsIG5hbWU6ZGF0YS5uYW1lfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmIChpbnB1dCA9PSBcXFwi5p+l55yL5a+85YWlXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKCdoaWtlcjovL2VtcHR5I25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5IycpLnJ1bGUoKHNvdXJjZWZpbGUsIGRhdGEpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKCfmn6XnnIvlr7zlhaXmlbDmja4nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL3NldCcpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaWVrb3VhcGkoc291cmNlZmlsZSwgZGF0YSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgc291cmNlZmlsZSwgZGF0YSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT0gXFxcIuimhuebluWvvOWFpVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJChcXFwi5bCG6KaG55uW5pys5Zyw77yM56Gu6K6k77yfXFxcIikuY29uZmlybSgoc291cmNlZmlsZSxkYXRhKT0+e1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc291cmNlZGF0YSA9IGZldGNoKHNvdXJjZWZpbGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKFxcXCJ2YXIgZGF0YWxpc3Q9XFxcIiArIHNvdXJjZWRhdGEgKyBcXFwiO1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5kZXggPSBkYXRhbGlzdC5pbmRleE9mKGRhdGFsaXN0LmZpbHRlcihkID0+IGQubmFtZT09ZGF0YS5uYW1lICYmIGQudHlwZT09ZGF0YS50eXBlKVswXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0LnNwbGljZShpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFbJ3VwZGF0ZXRpbWUnXSA9ICQuZGF0ZUZvcm1hdChuZXcgRGF0ZSgpLFxcXCJ5eXl5LU1NLWRkIEhIOm1tOnNzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0LnB1c2goZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShzb3VyY2VmaWxlLCBKU09OLnN0cmluZ2lmeShkYXRhbGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdTcmNKdV9zZWFyY2hNYXJrJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7Lopobnm5blr7zlhaUnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sc291cmNlZmlsZSxkYXRhKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PSBcXFwi5pS55ZCN5a+85YWlXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKGRhdGEubmFtZSxcXFwi6L6T5YWl5paw5ZCN56ewXFxcIikuaW5wdXQoKHNvdXJjZWZpbGUsZGF0YSk9PntcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHNvdXJjZWRhdGEgPSBmZXRjaChzb3VyY2VmaWxlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChcXFwidmFyIGRhdGFsaXN0PVxcXCIgKyBzb3VyY2VkYXRhICsgXFxcIjtcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGluZGV4ID0gZGF0YWxpc3QuaW5kZXhPZihkYXRhbGlzdC5maWx0ZXIoZCA9PiBkLm5hbWU9PWlucHV0ICYmIGQudHlwZT09ZGF0YS50eXBlKVswXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKGluZGV4Pi0xKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lkI3np7Dlt7LlrZjlnKjvvIzmnKrkv53lrZhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEubmFtZSA9IGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVsndXBkYXRldGltZSddID0gJC5kYXRlRm9ybWF0KG5ldyBEYXRlKCksXFxcInl5eXktTU0tZGQgSEg6bW06c3NcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFsaXN0LnB1c2goZGF0YSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3cml0ZUZpbGUoc291cmNlZmlsZSwgSlNPTi5zdHJpbmdpZnkoZGF0YWxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1NyY0p1X3NlYXJjaE1hcmsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7Lkv53lrZjvvIzmlrDmjqXlj6PlkI3np7DkuLrvvJonK2lucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxzb3VyY2VmaWxlLGRhdGEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHNvdXJjZWZpbGUsIGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShpdGVtKSkpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiAoaXRlbS5ncm91cD9cXFwiW1xcXCIraXRlbS5ncm91cCtcXFwiXSBcXFwiOlxcXCJcXFwiKSArIGl0ZW0udHlwZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1nOiBpdGVtLmltZyB8fCBcXFwiaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9rZS8zMS5wbmdcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS50eXBlK1xcXCJfXFxcIitpdGVtLm5hbWVcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICA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cImp1eXVlXFxcIik7XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICB0b2FzdChcXFwi6L2v5Lu254mI5pys6L+H5L2O77yM5Y+v6IO95a2Y5Zyo5byC5bi4XFxcIik7XFxuICAgICAgICB9XFxuICAgICAgICB0cnl7XFxuICAgICAgICAgICAgbGV0IGxpc3RNeVZhciA9IGxpc3RNeVZhcktleXMoKTtcXG4gICAgICAgICAgICBsaXN0TXlWYXIuZm9yRWFjaChpdD0+e1xcbiAgICAgICAgICAgICAgICBpZighL15TcmNKdV98aW5pdENvbmZpZy8udGVzdChpdCkpe1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfWNhdGNoKGUpe1xcbiAgICAgICAgICAgIHhsb2coJ+a4hU15VmFy5aSx6LSlPicrZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKE1ZX1JVTEUudGl0bGUgKyBcXFwi5YiG57G7XFxcIik7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihNWV9SVUxFLnRpdGxlICsgXFxcIuabtOaWsFxcXCIpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoTVlfUlVMRS50aXRsZSArIFxcXCLnsbvliKtcXFwiKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKE1ZX1JVTEUudGl0bGUgKyBcXFwi5Zyw5Yy6XFxcIik7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihNWV9SVUxFLnRpdGxlICsgXFxcIui/m+W6plxcXCIpO1xcbiAgICAgICAgICAgIGNsZWFyTXlWYXIoTVlfUlVMRS50aXRsZSArIFxcXCLmjpLluo9cXFwiKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKFxcXCLmjpLlkI1cXFwiKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKFxcXCLliIbnsbtcXFwiKTtcXG4gICAgICAgICAgICBjb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AgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJsb2FkaW5nX2dpZlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJsb2FkaW5nX2dpZlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvaW1nL0xvYWRpbmcxLmdpZlxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwicGljXzFfY2VudGVyXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGNsczogXFxcImxvYWRpbmdfZ2lmXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBzZXRQcmVSZXN1bHQoZCk7XFxuICAgICAgICAgICAgZCA9IFtdO1xcbiAgICAgICAgICAgIHB1dE15VmFyKCfliqjmgIHliqDovb1sb2FkaW5nJywgaXRlbWlkKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBkYXRhID0gW107XFxuICAgICAgICB0cnl7XFxuICAgICAgICAgICAgZ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ICAgIGlmIChpID4gZGF0YS5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgaSA9IDBcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciBpdGVtID0gZGF0YVtpXTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgcmVxdWlyZShvYmoubWV0aG9kKTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKCdiYXInLCB0b2VyamkoaXRlbSxvYmouaW5mbykpO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpXFxuICAgICAgICAgICAgdW5SZWdpc3RlclRhc2soJ2p1eXVlJylcXG4gICAgICAgIH1cXG4gICAgICAgIHB1dE15VmFyKCdiYW5uZXJpJywgaSk7XFxuICAgIH0sIG9iaikpXFxufVwifV0iLCJpY29uIjoiaHR0cDovL3BpYy4yODkuY29tL3VwLzIwMjEtNy8yMDIxNzE0MTUyNDU1NTY4LnBuZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment