Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@uckk云@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoidWNra+S6kSIsImF1dGhvciI6IlRob21hc+WWsiZMb3lEZ0lrIiwidXJsIjoiaGlrZXI6Ly9lbXB0eT9wYWdlPWZ5cGFnZSIsInZlcnNpb24iOjIwMjQwMjIyLCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImFsbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOiQucmVxdWlyZSgnaG9tZT9ydWxlPXVja2vkupEnKTsiLCJzZWFyY2hfdXJsIjoiaGlrZXI6Ly9lbXB0eT9rZXl3b3JkPSoqIiwiZ3JvdXAiOiLikaDmjqjojZAiLCJzZWFyY2hGaW5kIjoianM6XG5zZXRSZXN1bHQoW3tcbiAgICB0aXRsZTogXCLmkJzntKIgPT4gXCIgKyBNWV9LRVlXT1JELFxuICAgIGRlc2M6ICfpgJrov4dcIumrmOe6p+aQnOe0olwi6aG16Z2i5pCc57SiJyxcbiAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGtleXdvcmQpID0+IHtcbiAgICAgICAga2V5d29yZCA9IFN0cmluZyhrZXl3b3JkKS50cmltKCk7XG4gICAgICAgIGlmIChrZXl3b3JkLm1hdGNoKC9xdWFyay4qXFwvc1xcLy4rLykpIHtcbiAgICAgICAgICAgIHUxID0gXCJxdWFya0xpc3RcIjtcbiAgICAgICAgICAgIHUyID0gXCJyZWFsdXJsPVwiICsgZW5jb2RlVVJJQ29tcG9uZW50KGtleXdvcmQpO1xuICAgICAgICB9IGVsc2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aWxlX3R5cGU6YXNjLFxcXCIgKyBvcmRlckJ5XFxuICAgICAgICB9KS5lcnJvcldpdGhSZXRyeSgoZXJyLCByZXMsIGh0dHApID0+IHtcXG4gICAgICAgICAgICBpZiAoSlNPTi5wYXJzZShyZXMuYm9keSkubWVzc2FnZS5pbmNsdWRlcygnc3Rva2VuJykpIHtcXG4gICAgICAgICAgICAgICAgaHR0cC5tZXJnZUhlYWRBbmRCb2R5KHtcXG4gICAgICAgICAgICAgICAgICAgIGJ1aWxkVXJsOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3Rva2VuOiBlbmNvZGVVUklDb21wb25lbnQodGhpcy5nZXRTaGFyZVRva2VuKCl8fFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSkuc3RhcnQodHJ1ZSk7XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9XFxufSk7XFxuJC5leHBvcnRzID0gUXVhcmtTaGFyZUFwaTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTgeivt+axguWHveaVsFwiLFwicGF0aFwiOlwiaHR0cFJlcXVlc3RcIixcInJ1bGVcIjpcImZ1bmN0aW9uIGh0dHBSZXF1ZXN0KHVybCwgb3B0aW9ucykge1xcbiAgICB0aGlzLnJldHJ5Q291bnQgPSAwO1xcbiAgICB0aGlzLnVybCA9IHVybDtcXG4gICAgdGhpcy5vcHRpb25zID0gT2JqZWN0LmFzc2lnbih7fSwgb3B0aW9ucywge1xcbiAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgfSk7XFxuICAgIHRoaXMuZXJyb3JDYWxsYmFjayA9IChlcnIsIHJlcykgPT4ge3Rocm93IGVycn07XFxuICAgIHRoaXMuZXJyb3JDYWxsYmFja1dpdGhSZ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ICAgIHJldHVybiB0aGlzLnN1Y2Nlc3NDYWxsYmFjayhib2R5LCByZXMpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihTdHJpbmcocmVzLnN0YXR1c0NvZGUpKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlcnIpIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBlcnIgPSB0aGlzLmVycm9yVHlwZUNhbGxiYWNrKGVyciwgcmVzKTtcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0aGlzLnJldHJ5Q291bnQpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHRyeVJlc3VsdCA9IHRoaXMuZXJyb3JDYWxsYmFja1dpdGhSZXRyeShlcnIsIHJlcywgdGhpcyk7XFxuICAgICAgICAgICAgICAgIGlmICh0cnlSZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudC0tO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3RhcnQodG9Kc29uKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmV0cnlDb3VudCA9IDA7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5lcnJvckNhbGxiYWNrKGVyciwgcmVzKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmVycm9yQ2FsbGJhY2soZXJyLCByZXMpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSxcXG4gICAgc2V0T3B0aW9ucyhvcHRpb25zKSB7XFxuICAgICAgICB0aGlzLm9wdGlvbnMgPSBPYmplY3QuYXNzaWduKHt9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CIsIFxcXCLor7fovpPlhaVDb29raWVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcInRvb2xcXFwiKS5pc0xvZ2luQ29va2llKGlucHV0KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBpbnB1dC5yZXBsYWNlKC9cXFxccy9nLCBcXFwiXFxcIikpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgPT09IFxcXCLljp/nlLvkuIvovb3nur/nqItcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKGdldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgXFxcIjEwXFxcIiksIFxcXCLor7fovpPlhaUzLTMy5LmL6Ze055qE5pW05pWwXFxcIikuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNwZWVkVGhyZWFkID0gcGFyc2VJbnQoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNwZWVkVGhyZWFkIDwgMyB8fCBzcGVlZFRocmVhZCA+IDMyKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iu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ICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldEhlYWQoaXRlbS5vYmpfY2F0ZWdvcnkpICsgaXRlbS5maWxlX25hbWUsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICQuZGF0ZUZvcm1hdChpdGVtLnVwZGF0ZWRfYXQsICd5eXl5LU1NLWRkJykgKyAnICAnICsgZm9ybWF0U2l6ZShpdGVtLnNpemUpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdGVtLnRodW1ibmFpbCxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKGZpZCwgZmlkX3Rva2VuLCBwd2RfaWQsIHN0b2tlbiwgY2F0ZWdvcnkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBwbGF5VXJsQ2FjaGUgPSBzdG9yYWdlMC5nZXRNeVZhcihcXFwicGxheVVybENhY2hlXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBsYXlVcmxDYWNoZVtmaWRdKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHBsYXlVcmxDYWNoZVtmaWRdO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gJC5yZXF1aXJlKFxcXCJwbGF5XFxcIikuZ2V0UGxheVVybChmaWQsIGZpZF90b2tlbiwgcHdkX2lkLCBzdG9rZW4sIGNhdGVnb3J5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwbGF5VXJsQ2FjaGVbZmlkXSA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGxheVVybENhY2hlXFxcIiwgcGxheVVybENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV9maWRfdG9rZW4sIHNoYXJlSWQsIHF1YXJrU2hhcmVBcGkuZ2V0VG9rZW4oKSwgaXRlbS5vYmpfY2F0ZWdvcnkpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogc3R5bGUsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaXRlbS5maWQsXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgY2xzOiAncGxheWxpc3QgJyArIGl0ZW0ub2JqX2NhdGVnb3J5XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGUubWVzc2FnZSxcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBpZiAoZS5tZXNzYWdlLmluY2x1ZGVzKFxcXCLmj5Dlj5bnoIFcXFwiKSkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIui+k+WFpeaPkOWPlueggVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKCkuaW5wdXQoKE1ZX1BBUkFNUykgPT4ge1xcbiAgICAgICAgICAgICAgICBzZXRQYWdlUGFyYW1zKE9iamVjdC5hc3NpZ24oe30sIE1ZX1BBUkFNUywge1xcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVQd2Q6IGlucHV0XFxuICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICB9LCBNWV9QQVJBTVMpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbnNldFJlc3VsdChkKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKTgeiOt+WPlumTvuaOpVwiLFwicGF0aFwiOlwicGxheVwiLFwicnVsZVwiOlwianM6XFxuY29uc3QgY29va2llID0gZ2V0SXRlbShcXFwicXVhcmtDb29raWVcXFwiLCBcXFwiXFxcIik7XFxubGV0IGh0dHBSZXF1ZXN0ID0gJC5yZXF1aXJlKFxcXCJodHRwUmVxdWVzdFxcXCIpO1xcblxcbmZ1bmN0aW9uIENvb2tpZU1hbmFnZShjb29raWUpIHtcXG4gICAgdGhpcy5jb29raWUgPSB7fTtcXG4gICAgdGhpcy5hZGQoY29va2llKTtcXG59XFxuT2JqZWN0LmFzc2lnbihDb29raWVNYW5hZ2UucHJvdG90eXBlLCB7XFxuICAgIGFkZChjb29raWUpIHtcXG4gICAgICAgIGxldCBjb29raWVzID0gW107XFxuICAgICAgICBpZiAodHlwZW9mIGNvb2tpZSA9PT0gXFxcInN0cmluZ1xcXCIpIHtcXG4gICAgICAgICAgICBjb29raWVzID0gY29va2llLnNwbGl0KFxcXCI7XFxcIik7XFxuICAgICAgICB9IGVsc2UgaWYgKEFycmF5LmlzQXJyYXkoY29va2llKSkge1xcbiAgICAgICAgICAgIGNvb2tpZXMgPSBjb29raWU7XFxuICAgICAgICB9XFxuICAgICAgICBjb29raWVzLmZvckVhY2godiA9PiB7XFxuICAgICAgICAgICAgdiA9IHYuc3BsaXQoXFxcIj1cXFwiKTtcXG4gICAgICAgICAgICBpZiAodi5sZW5ndGggPCAyKSByZXR1cm47XFxuICAgICAgICAgICAgdGhpcy5jb29raWVbdlswXS50cmltKCldID0gdlsxXS50cmltKCk7XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgZ2V0KCkge1xcbiAgICAgICAgcmV0dXJuIE9iamVjdC5lbnRyaWVzKHRoaXMuY29va2llKS5tYXAodiA9PiB2WzBdICsgXFxcIj1cXFwiICsgdlsxXSkuam9pbihcXFwiO1xcXCIpO1xcbiAgICB9XFxufSk7XFxuY29uc3QgY29va2llTWFuYWdlID0gbmV3IENvb2tpZU1hbmFnZShjb29raWUpO1xcblxcbmZ1bmN0aW9uIHdhaXRTbGVlcCh0aW1lKSB7XFxuICAgIGphdmEubGFuZy5UaHJlYWQuc2xlZXAodGltZSB8fCA2MDApO1xcbn1cXG5cXG5mdW5jdGlvbiByZXF1ZXN0SHR0cCh1cmwpIHtcXG4gICAgcmV0dXJuIG5ldyBodHRwUmVxdWVzdCh1cmwpXFxuICAgICAgICAuc3VjY2VzcygoYm9keSwgcmVzKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGJvZHkuc3RhdHVzICE9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGJvZHkubWVzc2FnZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNvb2tpZU1hbmFnZS5hZGQocmVzLmhlYWRlcnNbXFxcInNldC1jb29raWVcXFwiXSk7XFxuICAgICAgICAgICAgcmV0dXJuIGJvZHk7XFxuICAgICAgICB9KVxcbiAgICAgICAgLmVycm9yVHlwZSgoZXJyLCByZXMpID0+IHtcXG4gICAgICAgICAgICByZXR1cm4gbmV3IEVycm9yKEpTT04ucGFyc2UocmVzLmJvZHkpLm1lc3NhZ2UpO1xc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VRhc2soZmlkLCBmaWRfdG9rZW4sIHB3ZF9pZCwgc3Rva2VuKS5kYXRhLnRhc2tfaWQ7XFxuICAgICAgICBsZXQgYXNmaWQgPSBxdWVyeVRhc2sodGFza0lkKTtcXG4gICAgICAgIGlmICghYXNmaWQpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6I635Y+W5aSx6LSlXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwbGF5Q29va2llID0gY29va2llTWFuYWdlLmdldCgpO1xcbiAgICAgICAgbGV0IHBsYXlIZWFkZXIgPSB7XFxuICAgICAgICAgICAgUmVmZXJlcjogXFxcImh0dHA6Ly9wYW4ucXVhcmsuY24vXFxcIixcXG4gICAgICAgICAgICBjb29raWU6IHBsYXlDb29raWUsXFxuICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiY29tLnN0dWIuU3R1YkFwcC8xLjMuMCAoTGludXg7QW5kcm9pZCAxNCkgQW5kcm9pZFhNZWRpYTMvMS4xLjFcXFwiXFxuICAgICAgICB9O1xcbiAgICAgICAgaWYgKGNhdGVnb3J5ID09IFxcXCJ2aWRlb1xcXCIpIHtcXG4gICAgICAgICAgICBsZXQgcGxheU1vZGUgPSBnZXRJdGVtKFxcXCJxdWFya19wbGF5TW9kZVxcXCIsIFxcXCLovaznoIFcXFwiKTtcXG4gICAgICAgICAgICBpZiAocGxheU1vZGUgPT09IFxcXCLovaznoIFcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGxldCB2aWRlb1JlcyA9IGdldFByZXZpZXdWaWRlbyhhc2ZpZCk7XFxuICAgICAgICAgICAgICAgIGxldCB2aWRlb0xpc3QgPSB2aWRlb1Jlcy5kYXRhLnZpZGVvX2xpc3Q7XFxuICAgICAgICAgICAgICAgIGxldCBwbGF5TGlzdCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWVzOiBbXSxcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFtdLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW11cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgdmlkZW9MaXN0LmZpbHRlcih2ID0+IHYuYWNjZXNzYWJsZSkuZm9yRWFjaCh2ID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlMaXN0Lm5hbWVzLnB1c2godi5yZXNvbHV0aW9uKTtcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlMaXN0LnVybHMucHVzaCh2LnZpZGVvX2luZm8udXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBwbGF5TGlzdC5oZWFkZXJzLnB1c2gocGxheUhlYWRlcik7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjcmVhdGVEZWxldGVUYXNrKGFzZmlkKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHBsYXlMaXN0KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsZXQgcGxheVVybCA9IGdldERvd25sb2FkVXJsKGFzZmlkKS5kYXRhWzBdLmRvd25sb2FkX3VybDtcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtcXFwi5Y6f55S7XFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbcGxheVVybCArIFxcXCIjaXNWaWRlbz10cnVlIyNmYXN0UGxheU1vZGUjI3RocmVhZHM9XFxcIiArIGdldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgXFxcIjEwXFxcIikgKyBcXFwiI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW3BsYXlIZWFkZXJdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY3JlYXRlRGVsZXRlVGFzayhhc2ZpZCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShwbGF5TGlzdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHsgLy8g5LiN5piv6KeG6aKR6LWE5rqQXFxuICAgICAgICAgICAgbGV0IHBsYXlJbmZvID0gZ2V0RG93bmxvYWRVcmwoYXNmaWQpLmRhdGFbMF07XFxuICAgICAgICAgICAgbGV0IHBsYXlVcmwgPSBwbGF5SW5mby5kb3dubG9hZF91cmw7XFxuXFxuICAgICAgICAgICAgLy8g6Z+z6aKR6LWE5rqQXFxuICAgICAgICAgICAgaWYgKHBsYXlJbmZvLmZvcm1hdF90eXBlLmluY2x1ZGVzKCdhdWRpbycpIHx8IHBsYXlJbmZvLmZpbGVfbmFtZS5tYXRjaCgvXFxcXC4oYWFjfGFjM3xhaWZmfGFtcnxtNGF8bXAyfG1wM3xvZ2d8cmF8YXV8d2F2fHdtYXxta2F8ZmxhY3x3YXYpLykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtcXFwi6Z+z6aKRXFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbcGxheVVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczogW3BsYXlIZWFkZXJdLFxcbiAgICAgICAgICAgICAgICAgICAgbHlyaWM6IFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY3JlYXRlRGVsZXRlVGFzayhhc2ZpZCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShwbGF5TGlzdCk7XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIC8vIOa8j+e9keS5i+mxvFxcbiAgICAgICAgICAgIGlmIChwbGF5SW5mby5mb3JtYXRfdHlwZS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cXCIpO1xcbiAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgfVxcbiAgICBjbGVhclZhcihcXFwicXVhcmtDb29raWVcXFwiKTtcXG59KTtcXG5kLnB1c2goe1xcbiAgICBjb2xfdHlwZTogXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcIixcXG4gICAgdXJsOiBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY24vXFxcIixcXG4gICAgZGVzYzogXFxcImZsb2F0JiYxMDAlXFxcIixcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGpzOiAkLnRvU3RyaW5nKChBcGlSb290VXJsKSA9PiB7XFxuICAgICAgICAgICAgbGV0IHRpbWVJbnRlciA9IHNldEludGVydmFsKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IENvb2tpZSA9IGZiYS5nZXRDb29raWUoQXBpUm9vdFVybCk7XFxuICAgICAgICAgICAgICAgIGlmIChDb29raWUuaW5jbHVkZXMoXFxcIl9VUF9GN0VfOERfPVxcXCIpICYmIENvb2tpZS5pbmNsdWRlcyhcXFwiX191aWQ9XFxcIikmJkNvb2tpZS5pbmNsdWRlcyhcXFwiX19wdXVzPVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJxdWFya0Nvb2tpZVxcXCIsIENvb2tpZSlcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFySW50ZXJ2YWwodGltZUludGVyKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coQ29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5iYWNrKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIDYwMCk7XFxuICAgICAgICB9LCBcXFwiaHR0cHM6Ly9wYW4ucXVhcmsuY25cXFwiKSxcXG4gICAgICAgIHVhOiBQQ19VQSxcXG4gICAgICAgIGpzTG9hZGluZ0luamVjdDogZmFsc2VcXG4gICAgfVxcbn0pO1xcbnNldFJlc3VsdChkKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi4pOB55m75b2V5qOA5rWLXCIsXCJwYXRoXCI6XCJ0b29sXCIsXCJydWxlXCI6XCJqczpcXG4kLmV4cG9ydHMgPSB7XFxuICAgIGlzTG9naW5Db29raWUoY29va2llKSB7XFxuICAgICAgICByZXR1cm4gISEoY29va2llICYmIGNvb2tpZS5pbmNsdWRlcyhcXFwiX1VQX0Y3RV84RF89XFxcIikgJiYgY29va2llLmluY2x1ZGVzKFxcXCJfX3VpZD1cXFwiKSAmJiBjb29raWUuaW5jbHVkZXMoXFxcIl9fcHV1cz1cXFwiKSk7XFxuICAgIH0sXFxuXFxuXFxuXFxuICAgIHNldFJ1bGUoaW5wdXQpIHtcXG4gICAgICAgIHNob3dMb2FkaW5nKCd1Y2tr5LqRIOino+aekOS4rS4uLicpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAvLyDmoLzlvI/ljJZcXG4gICAgICAgICAgICBbbG9nVCwgdHlwZSwgdGV4dF0gPSBTdHJpbmcoaW5wdXQpLnNwbGl0KFxcXCLvv6VcXFwiKTtcXG4gICAgICAgICAgICBzd2l0Y2ggKFN0cmluZyh0eXBlKSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICdQYXN0ZSc6XFxuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gcGFyc2VQYXN0ZSh0ZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdMYW56b3UnOlxcbiAgICAgICAgICAgICAgICAgICAgW3VybCwgcHdkXSA9IHRleHQuc3BsaXQoXFxcIiMjXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBkdXJsID0gJC5yZXF1aXJlKCdsYW56b3U/cnVsZT11Y2tr5LqRJykub25lX3VybCh1cmwsIHB3ZCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gU3RyaW5nKGZldGNoKGR1cmwpKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmICgoc3AgPSB0ZXh0LnNwbGl0KFxcXCLvv6VcXFwiKSkubGVuZ3RoID09IDMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0ID0gc3BbMl0uc3BsaXQoXFxcIkBcXFwiKVswXS50cmltKCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgYXJyMSA9IEpTT04ucGFyc2UoYmFzZTY0RGVjb2RlKHRleHQpKTtcXG5cXG5cXG4gICAgICAgICAgICAvLyDlkIjlubbvvIzljrvph41cXG4gICAgICAgICAgICBhcnIyID0gJC5yZXF1aXJlKFxcXCJjb25maWdzP3J1bGU9dWNra+S6kVxcXCIpLmdldEpzb24oKTtcXG4gICAgICAgICAgICBhcnIzID0gYXJyMi5jb25jYXQoYXJyMSkuZmlsdGVyKChvYmosIGluZGV4LCBhcnIpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGFyci5maW5kSW5kZXgobyA9PiBvYmouZ3JvdXAgPT09IG8uZ3JvdXAgJiYgb2JqLnRpdGxlID09PSBvLnRpdGxlICYmIChvYmoudGltZSA+IG8udGltZSB8fCBvYmoudGltZSA9PSBvLnRpbWUpKSA9PT0gaW5kZXg7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgJC5yZXF1aXJlKFxcXCJjb25maWdzP3J1bGU9dWNra+S6kVxcXCIpLnNhdmVKc29uKGFycjMpO1xcblxcblxcbiAgICAgICAgICAgIC8vIOiuoeeul+S9memHj1xcbiAgICAgICAgICAgIHggPSBhcnIzLmxlbmd0aCAtIGFycjIubGVuZ3RoO1xcbiAgICAgICAgICAgIGYgPSBhcnIxLmxlbmd0aCAtIHhcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgIHRvYXN0KFxcXCL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iXFxcIiAmJiAoXy5leHBsb3JlX1g1ID09IFxcXCIxXFxcIiB8fCBfLmZpbmRfcnVsZSAhPSBcXFwiXFxcIikpKSB7XFxuICAgICAgICAgICAgICAgIGZvciAodCBpbiBfKSB7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF9bdF0gPT0gXFxcIlxcXCIgfHwgX1t0XSA9PSBcXFwiMFxcXCIgfHwgX1t0XSA9PSBcXFwiTU9CSUxFX1VBXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBfW3RdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9ICQucmVxdWlyZShcXFwiY29uZmlncz9ydWxlPXVja2vkupFcXFwiKS5nZXRKc29uKCk7XFxuICAgICAgICAgICAgICAgIHVpZHMgPSBqeGxpc3QubWFwKF9fID0+IG1kNShfXy5ncm91cCArIF9fLnRpdGxlKSk7XFxuICAgICAgICAgICAgICAgIGkgPSB1aWRzLmluZGV4T2YoZ2V0TXlWYXIoJ3J1bGVfdWlkJywgJy0xJykpO1xcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAganhsaXN0LnB1c2goXyk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBqeGxpc3Quc3BsaWNlKGksIDEsIF8pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdGlkJyk7XFxuICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ3J1bGVfdWlkJyk7XFxuICAgICAgICAgICAgICAgIGp4bGlzdCA9IGp4bGlzdC5maWx0ZXIoKG9iaiwgaW5kZXgsIGFycikgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgc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cXCZcXFxcO1xcXFwjXFxcXFxcXCJcXFxcJ1xcXFx7XSspQD8vZyxcXG4gICAgICAgICAgICAoJDAsICQxKSA9PiB7XFxuICAgICAgICAgICAgICAgIHBhZ2UyID0gcGFnZTtcXG4gICAgICAgICAgICAgICAgJDEuc3BsaXQoXFxcIkBcXFwiKS5tYXAoXyA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBldmFsKFN0cmluZygncGFnZTI9cGFnZTInICsgXykpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhZ2UyO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIClcXG4gICAgICAgIC5yZXBsYWNlKC9meXBhZ2UvZywgcGFnZSlcXG4gICAgICAgIC5yZXBsYWNlKC9cXFxcKlxcXFwqL2csIEtleXdvcmQgfHwgXFxcIlxcXCIpO1xcbiAgICBpZiAoIWtleXdvcmQpIGJhc2VVID0gU3RyaW5nKGJhc2VVKVxcbiAgICAgICAgLnJlcGxhY2UoXFxuICAgICAgICAgICAgL2Z5KGNsYXNzfGFyZWF8eWVhcnxzb3J0KS9nLFxcbiAgICAgICAgICAgICgkMCwgJDEpID0+IHJ1bGVbJDEgKyAnX3VybCddW2V2YWwoJDEgKyAnX2knKV0gfHwgXFxcIlxcXCJcXG4gICAgICAgIClcXG4gICAgICAgIC5yZXBsYWNlKFxcbiAgICAgICAgICAgIC9meUFsbC9nLFxcbiAgICAgICAgICAgICgkMCwgJDEpID0+IHtcXG4gICAgICAgICAgICAgICAgRnlBbGxfaWkgPSBGeUFsbF9pO1xcbiAgICAgICAgICAgICAgICBpZiAoRnlBbGxfaWkgPiAocnVsZS5jbGFzc19pIC0gMSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIEZ5QWxsX2lpIC09IHJ1bGUuY2xhc3NfaTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChGeUFsbF9paSA+IChydWxlLmFyZWFfaSAtIDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgRnlBbGxfaWkgLT0gcnVsZS5hcmVhX2k7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEZ5QWxsX2lpID4gKHJ1bGUueWVhcl9pIC0gMSkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuc29ydF91cmxbRnlBbGxfaWkgLSBydWxlLnllYXJfaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUueWVhcl91cmxbRnlBbGxfaWldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuYXJlYV91cmxbRnlBbGxfaWldO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuY2xhc3NfdXJsW0Z5QWxsX2lpXTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICk7XFxuICAgIHJldHVybiBiYXNlVTtcXG59XFxuY29uc3QgZ2V0UnVsZUdyb3VwID0gKGNvbF90eXBlLCBTb3UpID0+IHtcXG4gICAgZm9yIChpdCBvZiBbJ2NsYXNzJywgJ2FyZWEnLCAneWVhcicsICdzb3J0J10pIHtcXG4gICAgICAgIGV2YWwoYGluZGV4ID0ge1xcbiAgICBjbGFzczogMCxcXG4gICAgYXJlYTogcnVsZS5jbGFzc19pLFxcbiAgICB5ZWFyOiBydWxlLmNsYXNzX2kgKyBydWxlLmFyZWFfaSxcXG4gICAgc29ydDogcnVsZS5jbGFzc19pICsgcnVsZS5hcmVhX2kgKyBydWxlLnllYXJfaSxcXG59W2l0XVxcbnJ1bGUuJHtpdH1fbmFtZS5tYXAoKG5hbWUsIGkpID0+IHtcXG4gICAgaWYgKGlzRnlBbGwpIHtcXG4gICAgICAgIGkgPSBpbmRleCArIGk7XFxuICAgICAgICB0ID0gRnlBbGxfaSA9PSBpO1xcbiAgICAgICAgayA9ICdGeUFsbF9pJztcXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHQgPSAke2l0fV9pID09IGk7XFxuICAgICAgICBrID0gJyR7aXR9X2knXFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiB0ID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGssIGkpID0+IHtcXG4gICAgICAgICAgICBwdXRNeVZhcihrLCBpKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgIH0sIGssIGkpLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCIke2NvbF90eXBlfHxcXFwiXFxcIn1cXFwiIHx8ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICB9KTtcXG59KTtcXG5kLnB1c2goe1xcbiAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbn0pO2ApO1xcbiAgICB9XFxuICAgIGlmIChTb3UpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDlpLjlhYvpk77mjqUnLFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQubWF0Y2goL3F1YXJrLmNuLipcXFxcL3NcXFxcLy4rLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3F1YXJrTGlzdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cmVhbHVybD1cXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KGlucHV0KSArIFxcXCImcnVsZT11Y2tr5LqRJnNoYXJlUHdkPVxcXCI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6c2VhcmNoXFxcIixcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdrZXl3b3JkJyxpbnB1dClcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHVybDogXFxcInRvYXN0Oi8v5Yqg6L295LitLi4uXFxcIixcXG4gICAgICAgIGltZzogXFxcImh0dHBzOi8vaGlrZXJmYW5zLmNvbS93ZWlzeXIvaW1nL0xvYWRpbmcxLmdpZlxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcInBpY18xX2NlbnRlclxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGNsczogXFxcImxvYWRpbmdfZ2lmXFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgc2V0UHJlUmVzdWx0KGQpO1xcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuKduua4qemmqOaPkOekulwiLFwicGF0aFwiOlwibm90aWNlXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSBmdW5jdGlvbigpIHtcXG4gICAgZiA9IFxcXCJHcmF5XFxcIjtcXG4gICAgdCA9IGZhbHNlO1xcbiAgICB1cCA9IGdldE15VmFyKCdSdWxlX25vdXBkYXRlJywgJycpO1xcbiAgICBpZiAodXAgIT0gJzEnKSB7XFxuICAgICAgICB2ZXJzaW9uID0gSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL2hvbWVAdWNra+S6kVxcXCIpKS52ZXJzaW9uO1xcbiAgICAgICAgaWYgKHVwID09ICcnKSB7XFxuICAgICAgICAgICAgW3VybCwgdiwgcnVuXSA9ICQucmVxdWlyZShcXFwibGFuem91P3J1bGU9dWNra+S6kVxcXCIpLmxpc3Rfb25lKFxcXCJodHRwczovL3d3ci5sYW56b3VpLmNvbS9iMDNxZjI4cWJcXFwiLCBcXFwicmVhZFxcXCIpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB1cmwgPSBmYWxzZTtcXG4gICAgICAgICAgICB2ID0gdmVyc2lvbiArIDE7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodmVyc2lvbiA8IHYpIHtcXG4gICAgICAgICAgICBmID0gXFxcInJlZFxcXCI7XFxuICAgICAgICAgICAgdCA9IFxcXCLmo4DmtYvliLDmlrDniYjmm7TmlrDvvIzngrnlh7vkuobop6Por6bmg4XjgIJcXFwiO1xcbiAgICAgICAgICAgIFQgPSBcXFwi5pu05paw5YaF5a65XFxcIjtcXG4gICAgICAgICAgICBpZiAodXAgPT0gJycpIHtcXG4gICAgICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+abtOaWsOaPkOekuicsXFxuICAgICAgICAgICAgICAgICAgICBjb250ZW50OiAn5qOA5rWL5Yiw5L2g55qE6KeE5YiZ54mI5pys5bCP5LqO5pyN5Yqh5Zmo54mI5pys77yM5piv5ZCm56uL5Y2z5pu05paw77yfJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKGRhKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZiA9ICQucmVxdWlyZShcXFwibGFuem91P3J1bGU9dWNra+S6kVxcXCIpLm9uZV91cmwoZGEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgJzEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcIlxcXFx1NmQ3N1xcXFx1OTYxNFxcXFx1ODljNlxcXFx1NzU0Y1xcXFx1ZmZlNWhvbWVfcnVsZV91cmxcXFxcdWZmZTVcXFwiICsgZ2V0UGF0aChmKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIHVybClcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdSdWxlX25vdXBkYXRlJywgdXJsKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdXJsID0gJChcXFwiaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcXFwiKS5ydWxlKCh1cCwgdmVyc2lvbikgPT4ge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJsYW56b3U/cnVsZT11Y2tr5LqRXFxcIikub25lX2luZm8odXAsIFxcXCJ1Y2trXFxcIiwgdmVyc2lvbik7XFxuICAgICAgICAgICAgfSwgdXJsIHx8IHVwLCB2ZXJzaW9uKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnMScpO1xcbiAgICAgICAgfVxcbiAgICB9XFxuXFxuXFxuICAgIGlmICghJC5yZXF1aXJlKFxcXCJ0b29sXFxcIikuaXNMb2dpbkNvb2tpZShnZXRJdGVtKFxcXCJxdWFya0Nvb2tpZVxcXCIsIFxcXCJcXFwiKSkpIHtcXG4gICAgICAgIGNsZWFySXRlbShcXFwicXVhcmtDb29raWVcXFwiKTtcXG4gICAgICAgIGYgPSBcXFwicmVkXFxcIjtcXG4gICAgICAgIFQgPSBcXFwi55m75b2V6LSm5Y+3XFxcIjtcXG4gICAgICAgIHQgPSBcXFwi5pyq5qOA5rWL5Yiw55m75b2V5L+h5oGvXFxcIjtcXG4gICAgICAgIHVybCA9ICQoW1xcXCLovpPlhaVDb29raWVcXFwiLCBcXFwi572R6aG155m75b2VXFxcIl0pLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgaWYgKGlucHV0ID09PSBcXFwi572R6aG155m75b2VXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS9sb2dpblxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLor7fovpPlhaVDb29raWVcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoJC5yZXF1aXJlKFxcXCJ0b29sXFxcIikuaXNMb2dpbkNvb2tpZShpbnB1dCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJxdWFya0Nvb2tpZVxcXCIsIGlucHV0LnJlcGxhY2UoL1xcXFxzL2csIFxcXCJcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH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bik7XFxuICAgICAgICB9IGNhdGNoIChlcnIwKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgcGF0aCA9IGh0bWwubWF0Y2goLycoXFxcXD8uKz8pJy8pWzFdO1xcbiAgICAgICAgICAgICAgICBob3N0ID0gXFxcImh0dHBzOi8vZGV2ZWxvcGVyLmxhbnpvdWcuY29tXFxcIjtcXG4gICAgICAgICAgICB9IGNhdGNoIChlcnIxKSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvdmFsdWVcXFxcOyhbXFxcXHNcXFxcU10rPylcXFxcJFxcXFwoL2kpWzFdKTtcXG4gICAgICAgICAgICAgICAgZXZhbCgnYm9keT0nICsgaHRtbC5tYXRjaCgvW1xcXFxzXFxcXFNdKmRhdGEgOihbXFxcXHNcXFxcU10qP1xcXFx9KSxcXFxccysvKVsxXSk7XFxuICAgICAgICAgICAgICAgIHUgPSBTdHJpbmcodXJsKS5yZXBsYWNlKC9cXFxcLmNvbS4qLywgXFxcIi5jb20vYWpheG0ucGhwXFxcIik7XFxuICAgICAgICAgICAgICAgIF8gPSBKU09OLnBhcnNlKHBvc3QodSwge1xcbiAgICAgICAgICAgICAgICAgICAgYm9keTogYm9keSxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IGhlYWQuaGVhZGVyc1xcbiAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgIHBhdGggPSBfLnVybDtcXG4gICAgICAgICAgICAgICAgaG9zdCA9IF8uZG9tO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHUgPSBob3N0ICsgXFxcIi9maWxlL1xcXCIgKyBwYXRoO1xcbiAgICAgICAgayA9IEpTT04ucGFyc2UoZmV0Y2godSwge1xcbiAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXG4gICAgICAgICAgICBvbmx5SGVhZGVyczogdHJ1ZVxcbiAgICAgICAgfSkpLmh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B0eVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCBcXFwiLm1kbyYmSHRtbFxcXCIpLnJlcGxhY2UoLyg8XFxcXC9zcGFuPik/XFxcXHMqPHNwYW4+L2dpLCBcXFwiPGJyPlxcXCIpLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiPGI+4oCc4oCc56Gu5a6a5pu05paw4oCd4oCdPC9iPlxcXCIuYmlnKCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIikubGF6eVJ1bGUoKHVybCwgcHdkLCBpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChnZXRNeVZhcignUnVsZV9ub3VwZGF0ZScpID09ICcxJykge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGJhY2sodHJ1ZSksIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQge1xcbiAgICAgICAgICAgICAgICAgICAgb25lX3VybFxcbiAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvbGFuem91P3J1bGU95q2M6K+N6YCC6YWNXFxcIik7XFxuICAgICAgICAgICAgICAgIGxldCBLID0gb25lX3VybCh1cmwsIHB3ZCwgMSwgMCwgaXRlbSk7XFxuICAgICAgICAgICAgICAgIGlmICghSykge1xcbiAgICAgICAgICAgICAgICAgICAgSyA9IG9uZV91cmwodXJsLCBwd2QsIDEpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICghSykge1xcbiAgICAgICAgICAgICAgICAgICAgSyA9IG9uZV91cmwodXJsLnNwbGl0KFxcXCI/XFxcIilbMF0sIHB3ZCwgMSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKEspIHtcXG4gICAgICAgICAgICAgICAgICAgIGYgPSBcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9fZmlsZVNlbGVjdF9ydWxlLmpzb25cXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgZG93bmxvYWRGaWxlKEssIGYpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ1J1bGVfbm91cGRhdGUnLCAnMScpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJcXFxcdTZkNzdcXFxcdTk2MTRcXFxcdTg5YzZcXFxcdTc1NGNcXFxcdWZmZTVob21lX3J1bGVfdXJsXFxcXHVmZmU1XFxcIiArIGdldFBhdGgoZik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6I635Y+W5LiL6L296ZO+5o6l5aSx6LSlXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIHVybCwgcHdk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ZGluZyMnKS5sYXp5UnVsZSgoZ3JvdXApID0+IHtcXG4gICAgICAgICAgICBwdXRNeVZhcigncGxhdGZvcm0nLCBncm91cCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgfSwgZ3JvdXApLFxcbiAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICfliKDpmaQnICsgZ3JvdXAucmVwbGFjZSgn57u85ZCIJywgJ+WFqOmDqCcpICsgJ+inhOWImScsXFxuICAgICAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoZ3JvdXApID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAkJCA9ICQucmVxdWlyZSgnY29uZmlncz9ydWxlPXVja2vkupEnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXAgPT0gXFxcIue7vOWQiFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSgkJC5ydWxlUGF0aCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZXMgPSAkJC5nZXRKc29uXzEoXFxcImdyb3VwXFxcIiwgZ3JvdXApO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zYXZlSnNvbihydWxlcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGdyb3VwKVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+WIhuS6qycgKyBncm91cC5yZXBsYWNlKCfnu7zlkIgnLCAn5YWo6YOoJykgKyAn6KeE5YiZJyxcXG4gICAgICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChncm91cCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICQkID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChncm91cCA9PSBcXFwi57u85ZCIXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb24oKS5zbGljZSgxKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlcyA9ICQkLmdldEpzb25fMShcXFwiZ3JvdXBcXFwiLCBncm91cCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnJlcXVpcmUoXFxcInRvb2w/cnVsZT11Y2tr5LqRXFxcIikuZ2V0UnVsZVBhc3RlKHJ1bGVzKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGdyb3VwKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgXVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG59KTtcXG5kLnB1c2goe1xcbiAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbn0pO1xcbnJ1bGVzID0gJC5yZXF1aXJlKCdjb25maWdzP3J1bGU9dWNra+S6kScpLmdldEdyb3VwSnNvbihmYWxzZSwgXFxcImdyb3VwXFxcIiwgcGxhdGZvcm0sIFxcXCLnu7zlkIhcXFwiKTtcXG5cXG5cXG5cXG5cXG5cXG5waWQgPSBOdW1iZX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AgICAgICAgICAgICAgICAgICAgcmV0dXJuICQucmVxdWlyZShcXFwidG9vbD9ydWxlPXVja2vkupFcXFwiKS5nZXRSdWxlUGFzdGUoW19dKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+e8lui+kSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gJC5yZXF1aXJlKCd0b29sP3J1bGU9dWNra+S6kScpLmdldFZhcmlhYmxlcygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBhcnIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcih0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgYXJyID0gT2JqZWN0LmtleXMoXyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh0IG9mIGFycikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcih0LCBfW3RdIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3J1bGVfdWlkJywgbSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlYXJjaF9lbmFibGVkJywgXy5zZWFyY2hfZW5hYmxlZCB8fCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdleHBsb3JlX2VuYWJsZWQnLCBfLmV4cGxvcmVfZW5hYmxlZCB8fCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL3J1bGVFZGl0I25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5Iz9wYWdlVGl0bGU96KeE5YiZ57yW6L6RJnJ1bGU9dWNra+S6kSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICfliKDpmaQnOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLnoa7lrprliKDpmaRcXFwiICsgXy5ncm91cCArIFxcXCLop4TliJnigJxcXFwiICsgXy50aXRsZSArICfigJ3lkJfvvJ9cXFxcbuatpOaTjeS9nOS4jeWPr+mAhu+8jOivt+iwqOaFjumAieaLqeOAgicpLmNvbmZpcm0oKG0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgJCQgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVzID0gJCQuZ2V0SnNvbl8yKG0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkJC5zYXZlSnNvbihydWxlcyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LCBtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+enu+WKqCc6XFxuICAgICAgICAgICAgICAgICAgICAgICAgenkgPSAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHp1ID0genkuc2xpY2UoMSkubWFwKF8gPT4gXy50aXRsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQoenUuY29uY2F0KFxcXCLmnIDlkI7pnaJcXFwiKSwgMiwgJ+ivt+mAieaLqeenu+WKqOS9jee9ricpLnNlbGVjdCgoenksIHp1LCBfKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSB6dS5pbmRleE9mKGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPT0gLTEpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5wdXNoKF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eS5zcGxpY2UoaSArIDEsIDAsIF8pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuc2F2ZUpzb24oenkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwgenksIHp1LCBfKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgIGNhc2UgJ+mAieS4reinhOWImSc6XFxuICAgICAgICAgICAgICAgICAgICAgICAganhsaXN0MiA9IHN0b3JhZ2UwLmdldE15VmFyKFxcXCJqeGxpc3QyXFxcIiwge30pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGp4bGlzdDJbbV0gPSBfO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2UwLnB1dE15VmFyKFxcXCJqeGxpc3QyXFxcIiwganhsaXN0Mik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn5Y+W5raI6YCJ5LitJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICBqeGxpc3QyID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCB7fSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGp4bGlzdDJbbV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoXFxcImp4bGlzdDJcXFwiLCBqeGxpc3QyKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICBjYXNlICflkK/nlKjlj5HnjrAnOlxcbiAgICAgICAgICAgICAgICAgICAgY2FzZSAn56aB55So5Y+R546wJzpcXG4gICAgICAgICAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0sIFxcXCJleHBsb3JlX2VuYWJsZWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LCBtLCBfKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiBfLmljb25cXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXy5ncm91cCArICfkuKgnICsgXy5zZWFyY2hfZ3JvdXAgKyAn5LioJyArIChfLng1X3VybCB8fCAoXy51cmwgPyBfLnVybCA6IF8uc2VhcmNoX3VybCkuc3BsaXQoXFxcIi9cXFwiKS5zbGljZSgwLCAzKS5qb2luKFxcXCIvXFxcIikpLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgobSkgPT4ge1xcbiAgICAgICAgICAgICAgICAkLnJlcXVpcmUoJ2NvbmZpZ3M/cnVsZT11Y2tr5LqRJykuZ2V0SnNvbl8yKG0sIFxcXCJzZWFyY2hfZW5hYmxlZFxcXCIpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICA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xcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgY2FuQmFjazogdHJ1ZSxcXG4gICAgICAgICAgICB1YTogXy54NV91YSA/IChfLng1X3VhID09IFxcXCJQQ19VQVxcXCIgPyBQQ19VQSA6IF8ueDVfdWEpIDogTU9CSUxFX1VBLFxcbiAgICAgICAgICAgIHJlZmVyZXI6IF8ueDVfcmVmZXJlcixcXG4gICAgICAgICAgICBqczogXy54NV9qcyxcXG4gICAgICAgICAgICBqc0xvYWRpbmdJbmplY3Q6ICEhXy54NV9qc0xvYWRpbmdJbmplY3QsXFxuICAgICAgICAgICAgYXV0b1BsYXk6ICEhXy54NV9hdXRvUGxheSxcXG4gICAgICAgICAgICBmbG9hdFZpZGVvOiAhIV8ueDVfZmxvYXRWaWRlbyxcXG4gICAgICAgICAgICBpbWdMb25nQ2xpY2s6ICFfLng1X2ltZ0xvbmdDbGljayxcXG4gICAgICAgICAgICBzaG93UHJvZ3Jlc3M6ICFfLng1X3Nob3dQcm9ncmVzcyxcXG4gICAgICAgICAgICBibG9ja1J1bGVzOiBldmFsKF8ueDVfYmxvY2tSdWxlcykgfHwgW10sXFxuICAgICAgICAgICAgdXJsSW50ZXJjZXB0b3I6ICQudG9TdHJpbmcoKHVybEludGVyY2VwdG9yX2pzLCB4NVVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlLmNvbS9cXFwiKSB8fCBpbnB1dC5pbmNsdWRlcyhcXFwiYWxpeXVuZHJpdmUubmV0L1xcXCIpIHx8IGlucHV0LmluY2x1ZGVzKFxcXCJhbGlwYW4uY29tL1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlOiAn5LqR55uY5ZCbLueugCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9hbGl5dW4jbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU95LqR55uY5ZCbLueugCZwYWdlPWZ5cGFnZSZyZWFsdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJxdWFyay5jblxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWkuOWFi+e9keebmFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9xdWFya0xpc3Qjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjP3J1bGU9dWNra+S6kSZyZWFsdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgICAgIH0sIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgeDVfdXJsSW50ZXJjZXB0b3IgPSBuZXcgRnVuY3Rpb24oXFxcImlucHV0XFxcIiwgXFxcIng1VXJsXFxcIiwgdXJsSW50ZXJjZXB0b3JfanMpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4geDVfdXJsSW50ZXJjZXB0b3IoaW5wdXQsIHg1VXJsKTtcXG4gICAgICAgICAgICB9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ge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH1cXG59IGVsc2UgeyAvLyDmkJzntKIv5Y+R546wXFxuICAgIGlmIChfUEFHRSkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcoXFxcIuaIkeeahOaUtuiXj1xcXCIpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vY29sbGVjdGlvbj9ydWxlPVxcXCIgKyBpZCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl9kb3dubG9hZFxcXCJcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKFxcXCLljoblj7LorrDlvZVcXFwiKSxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2hpc3Rvcnk/cnVsZT1cXFwiICsgaWQsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJpY29uX3NtYWxsXzNcXFwiLFxcbiAgICAgICAgICAgIGltZzogXFxcImhpa2VyOi8vaW1hZ2VzL2ljb25faGlzXFxcIlxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcoXFxcIuinhOWImeeuoeeQhlxcXCIpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9ydWxlTGlzdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cGFnZVRpdGxlPeinhOWImeeuoeeQhiZydWxlPVxcXCIgKyBpZCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImljb25fc21hbGxfM1xcXCIsXFxuICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvaWNvbl94aXV0YW5cXFwiXFxuICAgICAgICB9LCB7XFxuICAgICAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgICAgIGRlc2M6ICfmkJzntKLlhbPplK7or40gLyDlpLjlhYvpk77mjqUnLFxcbiAgICAgICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXQudHJpbSgpO1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQubWF0Y2goL3F1YXJrLmNuLipcXFxcL3NcXFxcLy4rLykpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9wYWdlL3F1YXJrTGlzdCNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cmVhbHVybD1cXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KGlucHV0KSArIFxcXCImcnVsZT11Y2tr5LqRJnNoYXJlUHdkPVxcXCI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoaW5wdXQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBpZCArIFxcXCI6c2VhcmNoXFxcIixcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBrZXl3b3JkLFxcbiAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdrZXl3b3JkJyxpbnB1dClcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwge1xcbiAgICAgICAgICAgIHRpdGxlOiBSaWNoKFN0cm9uZyhDb2xvcihydWxlVHlwZSwgXFxcIiMzMzk5Y2NcXFwiKSkpLFxcbiAgICAgICAgICAgIHVybDogJChbXFxcIue7vOWQiFxcXCJdLmNvbmNhdChncm91cHMpLm1hcChuYW1lID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKG5hbWUgPT0gcnVsZVR5cGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHNlYXJjaF90eXBlLmluZGV4T2YobmFtZSkgPT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBSaWNoKFxcXCI8Uz5cXFwiICsgbmFtZSArIFxcXCI8L1M+XFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIG5hbWU7XFxuICAgICAgICAgICAgfSksIDMsIFxcXCLpgInmi6nmkJzntKLnsbvliKtcXFwiKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQuaW5kZXhPZihcXFwiPFM+XFxcIikgIT0gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/msqHmnInlr7nlupTop4TliJlcXFwiO1xcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluZGV4T2YoXFxcIjxcXFwiKSA9PSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgZ2V0TXlWYXIoJ2tleXdvcmQnKSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncnVsZVR5cGUnLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCJydWxlR3JvdXBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcInNpZFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBzZWFyY2hfZ3JvdXAubWFwKChuYW1lLCBpKSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHJ1bGVHcm91cCA9PSBpID8gUmljaChTdHJvbmcoQ29sb3IobmFtZSkpKSA6IG5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2tleXdvcmQyJywgZ2V0TXlWYXIoJ2tleXdvcmQnKSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncnVsZUdyb3VwJywgaSk7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCJzaWRcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgICAgICB9LCBpKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgICAgICB9KTtcXG4gICAgICAgIHNlYXJjaF9ydWxlLm1hcCgoXywgaSkgPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBzaWQgPT0gaSA/IFJpY2goU3Ryb25nKENvbG9yKF8udGl0bGUpKSkgOiBfLnRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdrZXl3b3JkMicsIGdldE15VmFyKCdrZXl3b3JkJykpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NpZCcsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgICAgIH0sIGkpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgIH1cXG5cXG5cXG5cXG5cXG5cXG4gICAgaWYgKF9TT1UpIHtcXG4gICAgICAgIGlmIChkYXRhLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBwYWdlICsgXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcIiArIGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKF9QQUdFKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmsqHmnInlj6/nlKjnmoTmkJzntKLop4TliJlcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSBpZiAoX1BBR0UgfHwgcnVsZS51cmwubWF0Y2goXFxcImZ5cGFnZVxcXCIpKSB7XFxuICAgICAgICBpZiAoX1BBR0UpIHtcXG4gICAgICAgICAgICBpZiAocnVsZS50aXRsZSAhPSBcXFwi6IGa5pCcXFxcIikgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj4nICsgQ29sb3IocnVsZS50aXRsZSwgJyNmZjY2MDEnKSArICc8L2I+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCh1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAodCBvZiBbXFxcImNsYXNzXFxcIiwgXFxcImFyZWFcXFwiLCBcXFwieWVhclxcXCIsIFxcXCJzb3J0XFxcIiwgXFxcIkZ5QWxsXFxcIl0pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKHQgKyBcXFwiX2lcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmw7XFxuICAgICAgICAgICAgICAgIH0sIFxcXCJoaWtlcjovL3BhZ2UvcnVsZUhvbWU/cnVsZT11Y2tr5LqRJnBhZ2U9ZnlwYWdlJnJ1bGVOYW1lPVxcXCIgKyBydWxlLnRpdGxlICsgXFxcIiZydWxlR3JvdXA9XFxcIiArIHJ1bGUuZ3JvdXApLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgICAgICBpbWc6IHJ1bGUuaWNvbixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIGhvbWU6IDFcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGdldFJ1bGVHcm91cCgpO1xcbiAgICAgICAgfVxcbiAgICAgICAgYmFzZVVybCA9IGhvbWVfYmFzZVVybDtcXG4gICAgICAgIGV2YWwocnVsZS5wcmVSdWxlKTtcXG4gICAgICAgIGV2YWwocnVsZS5maW5kX3J1bGUpO1xcbiAgICB9XFxufVxcbl9QQUdFID8gc2V0UHJlUmVzdWx0KGQpIDogc2V0UmVzdWx0KGQpO1xcbmRlbGV0ZUl0ZW1CeUNscygnbG9hZGluZ19naWYnKTtcXG5cXG5cXG5cXG4vLyDmkJzntKJcXG5pZiAoKCFydWxlX3g1IHx8IChydWxlLlNlYXJjaCAmJiBydWxlLnNlYXJjaF91cmwgIT0gXFxcIlxcXCIgJiYgcnVsZS5zZWFyY2hGaW5kICE9IFxcXCJcXFwiKSkgJiYgX1NPVSAmJiBkYXRhLmxlbmd0aCA+IDApIHtcXG4gICAgc2V0SGlzdG9yeUtleXdvcmQoKTtcXG4gICAgbGV0IHRhc2tzID0gZGF0YS5tYXAoaXQgPT4ge1xcbiAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihydWxlKSB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBwYWdlID0gTVlfUEFHRTtcXG4gICAgICAgICAgICAgICAgICAgIGJhc2VVcmwgPSBnZXRSdWxlQmFzZVVybChydWxlLnNlYXJjaF91cmwsIGtleXdvcmQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHBhZ2UgPT0gMSB8fCBydWxlLnNlYXJjaF91cmwubWF0Y2goXFxcImZ5cGFnZVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChydWxlLnByZVJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzZWFyY2hmaW5kID0gbmV3IEZ1bmN0aW9uKFxcXCJydWxlXFxcIiwgXFxcImJhc2VVcmxcXFwiLCBcXFwia2V5d29yZFxcXCIsIFxcXCJwYWdlXFxcIiwgcnVsZS5zZWFyY2hGaW5kKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbGlzdCA9IHNlYXJjaGZpbmQocnVsZSwgYmFzZVVybCwga2V5d29yZCwgcGFnZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFsaXN0KSByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRlc2NUaXBzID0gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBydWxlLnRpdGxlLmZvbnRjb2xvcihcXFwiI2YxM2I2NmFcXFwiKSArIFxcXCImbmJzcDsmbmJzcDtcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZXNMaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgbGlzdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNMaXN0LnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGl0LnRpdGxlLmluY2x1ZGVzKFxcXCLigJzigJzigJ3igJ1cXFwiKSA/IGl0LnRpdGxlIDogXFxcIuKAnOKAnOKAneKAnVxcXCIgKyBpdC50aXRsZS5yZXBsYWNlKC88XFxcXC9lbT4vZywgXFxcIlxcXCIpLnJlcGxhY2UobmV3IFJlZ0V4cChrZXl3b3JkLCBcXFwiZ1xcXCIpLCBcXFwiPHN0cm9uZz48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAjMUU5MEZGXFxcXFxcXCI+XFxcIiArIGtleXdvcmQgKyBcXFwiPC9zcGFuPjwvc3Ryb25nPlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogZGVzY1RpcHMgKyAoaXQuZGVzYyB8fCBcXFwiXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltZzogaXQuaW1nIHx8IGl0LnBpY191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQuY29sX3R5cGUgfHwgXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub1BpYzogdHJ1ZVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgaXQuZXh0cmEgfHwge30pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzTGlzdDtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFtdO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coXy50aXRsZSArIFxcXCI6XFxcIiArIGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gW107XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBhcmFtOiBpdCxcXG4gICAgICAgICAgICBpZDogXFxcInVja2tfcnVsZUBcXFwiICsgaXQudGl0bGVcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGJhdGNoRXhlY3V0ZSh0YXNrcywge1xcbiAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgcGFyYW0uaSArPSAxO1xcbiAgICAgICAgICAgIGlmIChBcnJheS5pc0FycmF5KHJlc3VsdCkpIHtcXG4gICAgICAgICAgICAgICAgZGVsZXRlSXRlbShcXFwiX25vdGhhdmVcXFwiKTtcXG4gICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHJlc3VsdCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYXJhbS5pID09PSBwYXJhbS5hbGwpIHtcXG4gICAgICAgICAgICAgICAgaWYgKCFyZXN1bHQgfHwgIXJlc3VsdC5sZW5ndGgpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oXFxcIl9ub3RoYXZlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIn5+fuS7gOS5iOi1hOa6kOmDveayoeacieWTpn5+flxcXCIuZm9udGNvbG9yKFxcXCJHcmF5XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcIl9ub3RoYXZlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHBhZ2VpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliqDovb3nrKxcXFwiICsgTVlfUEFHRSArIFxcXCLpobXkuK3vvIzov5vluqbvvJpcXFwiICsgKHBhcmFtLmkgKyAxKSArIFxcXCIvXFxcIiArIHBhcmFtLmFsbCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgIC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ywgaWQsIHZhbHVlLCBqc29uLCBoZWlnaHQpID0+IHtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICB0aXRsZTogXFxcIjwvPlxcXCIsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKGlkKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGdyb3VwID0gJC5yZXF1aXJlKFxcXCJjb25maWdzP3J1bGU9dWNra+S6kVxcXCIpLmdldEdyb3VwTmFtZXMoMCwgXFxcInNlYXJjaF9ncm91cFxcXCIpO1xcbiAgICAgICAgICAgIGlmICghZ3JvdXAubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICQoZ3JvdXAsIDMsIFxcXCLpgInmi6nop4TliJnliIbnu4RcXFwiKS5zZWxlY3QoKGlkKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShpZCwge1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24oZXh0cmEsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9LCBpZCk7XFxuICAgICAgICB9LCBpZCksXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHtcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKGlkLCB2YWx1ZSksXFxuICAgICAgICAgICAgb25DaGFuZ2U6IGBwdXRNeVZhcihcXFwiJHtpZH1cXFwiLCBpbnB1dClgLFxcbiAgICAgICAgICAgIHR5cGU6ICd0ZXh0YXJlYScsXFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiB0cnVlLFxcbiAgICAgICAgICAgIGhpZ2hsaWdodDogdHJ1ZSxcXG4gICAgICAgICAgICBoZWlnaHQ6IGhlaWdodCB8fCA1LFxcbiAgICAgICAgICAgIGlkOiBpZCxcXG4gICAgICAgIH0sIGpzb24gfHwge30pXFxuICAgIH0pO1xcbn1cXG5zd2l0Y2ggKHJ1bGVfdGlkKSB7XFxuICAgIGNhc2UgJ+WfuuacrCc6XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDlkI3np7AnLCAndGl0bGUnLCAnJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIzmupDlm77moIcnLCAnaWNvbicsICcnXSxcXG4gICAgICAgICAgICBbJ+mAieWhq++8jOa6kOS9nOiAhScsICdhdXRob3InLCAn5L2a5ZCNJ10sXFxuICAgICAgICAgICAgWyfpgInloavvvIxKc0xpYicsICdwcmVSdWxlJywgJycsIHtcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAzXFxuICAgICAgICAgICAgfV0sXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcbiAgICAgICAgICAgIGlucHV0X3B1c2goYSwgYiwgYywgZSwgMSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmkJzntKInOlxcbiAgICAgICAgW1xcbiAgICAgICAgICAgIFsn5b+F5aGr77yM5pCc57Si6ZO+5o6lJywgJ3NlYXJjaF91cmwnLCAnJ10sXFxuICAgICAgICAgICAgWyflv4XloavvvIzmkJzntKLliIbnu4QnLCAnc2VhcmNoX2dyb3VwJywgJ+WFqOWFqCcsIHtcXG4gICAgICAgICAgICAgICAgaGlnaGxpZ2h0OiBmYWxzZSxcXG4gICAgICAgICAgICB9XSxcXG4gICAgICAgICAgICBbJ+W/heWhq++8jOWIl+ihqOinhOWImVxcXFxu5o+Q5L6b5Y+Y6YePOiBiYXNlVXJsLCBrZXl3b3JkLCBwYWdlXFxcXG5cXFxcbumcgOimgei/lOWbnuaVsOe7hO+8mnJldHVybiBbXTsnLCAnc2VhcmNoRmluZCcsICcnLCB7XFxuICAgICAgICAgICAgICAgIGhlaWdodDogNVxcbiAgICAgICAgICAgIH1dLFxcbiAgICAgICAgXS5tYXAoW2EsIGIsIGMsIGVdID0+IHtcXG4gICAgICAgICAgICBpbnB1dF9wdXNoKGEsIGIsIGMsIGUsIDEpO1xcbiAgICAgICAgfSk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAn5Y+R546wJzpcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygn5L2/55SoIHg1X3dlYnZpZXdfc2luZ2xlJyksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChleHBsb3JlX1g1KSA9PiB7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKCdleHBsb3JlX1g1JywgZXhwbG9yZV9YNSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCBleHBsb3JlX1g1ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbicsXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKGV4cGxvcmVfWDUgPyA1NSA6IDYzKSArICcuc3ZnJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBbXFxuICAgICAgICAgICAgWyflv4XloavvvIzmupDpk77mjqUnLCAndXJsJywgJycsIHtcXG4gICAgICAgICAgICAgICAgaGVpZ2h0OiAxXFxuICAgICAgICAgICAgfV0sXFxuICAgICAgICAgICAgWyflv4XloavvvIzliJfooajop4TliJlcXFxcbuWQr+eUqHg15bCx5LiN55So5YaZ5LqGXFxcXG5cXFxcbue7p+aJv+aVsOe7hGTvvJogZC5wdXNoKGpzb24pOycsICdmaW5kX3J1bGUnLCAnJ10sXFxuICAgICAgICBdLm1hcChbYSwgYiwgYywgZV0gPT4ge1xcbiAgICAgICAgICAgIGlucHV0X3B1c2goYSwgYiwgYywgZSk7XFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlICfmm7/mjaInOlxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogU3Ryb25nKCflj5HnjrDpk77mjqXmm7/mjaInKSxcXG4gICAgICAgICAgICBkZXNjOiAn6YCJ5aGrJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIFtcXG4gICAgICAgICAgICBbJ+WIhuexu+WQjeensCcsICdjbGFzc19uYW1lJywgJyddLFxcbiAgICAgICAgICAgIFsn5YiG57G75pu/5o2iJywgJ2NsYXNzX3VybCcsICcnXSxcXG4gICAgICAgICAgICBbJ+WcsOWMuuWQjeensCcsICdhcmVhX25hbWUnLCAnJ10sXFxuICAgICAgICAgICAgWyflnLDljLrmm7/mjaInLCAnYXJlYV91cmwnLCAnJ10sXFxuICAgICAgICAgICAgWyflubTku6PlkI3np7AnLCAneWVhcl9uYW1lJywgJyddLFxcbiAgICAgICAgICAgIFsn5bm05Luj5pu/5o2iJywgJ3llYXJfdXJsJywgJyddLFxcbiAgICAgICAgICAgIFsn5o6S5bqP5ZCN56ewJywgJ3NvcnRfbmFtZScsICcnXSxcXG4gICAgICAgICAgICBbJ+aOkuW6j+abv+aNoicsICdzb3J0X3VybCcsICcnXSxcXG4g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ICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHgpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3g1X2pzTG9hZGluZ0luamVjdCcsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfanNMb2FkaW5nSW5qZWN0ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfanNMb2FkaW5nSW5qZWN0ID8gNTUgOiA2MykgKyAnLnN2ZycsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2ljb24nXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlucHV0X3B1c2goXFxcIuWmguaenOWQr+eUqOS6huWcqOWKoOi9veS4reS5n+aJp+ihjO+8jGpz5Lya5omn6KGM5Lik5qyh77yM6ZyA6KaB6Ieq6KGM5aSE55CG6YeN5aSN5Yqg6L2955qE6Zeu6aKYXFxcIiwgXFxcIng1X2pzXFxcIiwgXFxcIlxcXCIsIHt9LCAzKTtcXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBTdHJvbmcoJ+aLpuaIqui1hOa6kCcpLFxcbiAgICAgICAgICAgIGRlc2M6ICfpgInloasnLFxcbiAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcXG4gICAgICAgICAgICBpbWc6ICdoaWtlcjovL2ltYWdlcy9ob21lX2ljb25fZWRpdCdcXG4gICAgICAgIH0pO1xcbiA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JcXFwiLCB7fSwgNyk7XFxuICAgICAgICBpbnB1dF9wdXNoKFxcXCLlrZDpobXpnaLop4TliJnvvIzkuIrpnaLnmoTop4TliJnlj6/ku6XpgJrov4d4NVVybOi3s+i9rOWIsOi/memHjOOAgmJhc2VVcmzmmK/ot7PovaznmoTpk77mjqVcXFwiLCBcXFwieDVfcGFnZUhvbWVcXFwiLCBcXFwiXFxcIiwge30sIDMpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygneDXorr7nva4nKSxcXG4gICAgICAgICAgICBkZXNjOiAn5LiA6Iis5LiN55So566hJyxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcicsXFxuICAgICAgICAgICAgaW1nOiAnaGlrZXI6Ly9pbWFnZXMvaG9tZV9pY29uX2VkaXQnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlucHV0X3B1c2goXFxcIlJlZmVyZXJcXFwiLCBcXFwieDVfcmVmZXJlclxcXCIsIFxcXCJcXFwiLCB7fSwgMSk7XFxuICAgICAgICBpbnB1dF9wdXNoKFxcXCJVQe+8jE1PQklMRV9VQS9QQ19VQS/oh6rlrprkuYlcXFwiLCBcXFwieDVfdWFcXFwiLCBcXFwiXFxcIiwge30sIDEpO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPumVv+aMieWbvueJh+S4jeaYvuekuuiPnOWNlTwvYj4nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigneDVfaW1nTG9uZ0NsaWNrJywgeCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB4NV9pbWdMb25nQ2xpY2sgPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh4NV9pbWdMb25nQ2xpY2sgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuS4jeaYvuekuui/m+W6puadoTwvYj4nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigneDVfc2hvd1Byb2dyZXNzJywgeCk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5JztcXG4gICAgICAgICAgICB9LCB4NV9zaG93UHJvZ3Jlc3MgPyAnMCcgOiAnMScpLFxcbiAgICAgICAgICAgIGltZzogJ2h0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvJyArICh4NV9zaG93UHJvZ3Jlc3MgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPuaCrOa1ruWXheaOouaSreaUvjwvYj4nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigneDVfZmxvYXRWaWRlbycsIHgpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSc7XFxuICAgICAgICAgICAgfSwgeDVfZmxvYXRWaWRlbyA/ICcwJyA6ICcxJyksXFxuICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8nICsgKHg1X2Zsb2F0VmlkZW8gPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogJzxiPumfs+inhumikeiHquWKqOaSreaUvjwvYj4nLFxcbiAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcigneDVfYXV0b1BsYXknLCB4KTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknO1xcbiAgICAgICAgICAgIH0sIHg1X2F1dG9QbGF5ID8gJzAnIDogJzEnKSxcXG4gICAgICAgICAgICBpbWc6ICdodHRwczovL2hpa2VyZmFucy5jb20vdHViaWFvL21lc3N5LycgKyAoeDVfYXV0b1BsYXkgPyA1NSA6IDYzKSArICcuc3ZnJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfaWNvbidcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFN0cm9uZygne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iKSxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgfVxcbn0pO1xcbmVsc2UgaGlzdG9yeS5tYXAoKGtleSwgaSkgPT4ge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGtleSxcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgIGxldCBleHRyYSA9IGZpbmRJdGVtKGlkICsgXFxcIjpzZWFyY2hcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICBleHRyYS5kZWZhdWx0VmFsdWUgPSBrZXk7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICB9LCBpZCwga2V5KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogaWQgKyBcXFwiOmtleTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWIoOmZpOWFs+mUruivjTpcXFwiICsga2V5LFxcbiAgICAgICAgICAgICAgICBqczogJC50b1N0cmluZygoaWQsIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGhpc3RvcnkgPSBzdG9yYWdlMC5nZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgW10pO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlpID0gaGlzdG9yeS5pbmRleE9mKGtleSk7XFxuICAgICAgICAgICAgICAgICAgICBoaXN0b3J5LnNwbGljZShpaSwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5zZXRJdGVtKFxcXCJzZWFyY2hIaXN0b3J5XFxcIiwgaGlzdG9yeSk7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgXFxcIjprZXk6XFxcIiArIGtleSk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaGlzdG9yeS5sZW5ndGggPT09IDApIGFkZEl0ZW1BZnRlcihpZCArIFxcXCI6c2VhcmNoSGlzdG9yeVxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCJ+fn7ku4DkuYjpg73msqHmnInlk6Z+fn5cXFwiLmZvbnRjb2xvcihcXFwiR3JheVxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogaWQgKyBcXFwiOmtleVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9LCBpZCwga2V5KVxcbiAgICAgICAgICAgIH1dXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn0pO2AsXFxuXFxuICAgICAgICBjbGFzc19uYW1lOiBcXFwiXFxcIixcXG4gICAgICAgIGNsYXNzX3VybDogXFxcIlxcXCIsXFxuICAgICAgICBhcmVhX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