Advertisement
xiaomianao666

邀您一起看:选择器|信息素说我们不可能

Apr 28th, 2022
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥选择器|信息素说我们不可能@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIiNmLkZpbGXlt6XlhbdcIixcInBhdGhcIjpcIkZpbGUuanNcIixcInJ1bGVcIjpcImNvbnN0IEZpbGUgPSBqYXZhLmlvLkZpbGU7XFxuY29uc3Qge1xcbiAgICBGaWxlcyxcXG4gICAgUGF0aHMsXFxuICAgIFN0YW5kYXJkQ29weU9wdGlvbixcXG4gICAgU3RhbmRhcmRPcGVuT3B0aW9uXFxufSA9IGphdmEubmlvLmZpbGU7XFxuY29uc3QgamF2YVN0cmluZyA9IGphdmEubGFuZy5TdHJpbmc7XFxubGV0IGphdmFTY29wZSA9IG5ldyBKYXZhSW1wb3J0ZXIoamF2YS5pbywgamF2YS5sYW5nLCBqYXZhLmxhbmcucmVmbGVjdCwgamF2YS51dGlsLlZlY3Rvcik7XFxuXFxuZnVuY3Rpb24gZGVsZXRlRmxpZXMoZmlsZU5hbWUpIHtcXG4gICAgbGV0IGZpbGUgPSBuZXcgRmlsZShmaWxlTmFtZSk7XFxuICAgIGlmICghZmlsZS5leGlzdHMoKSkge1x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ICAgICAgd2hpbGUgKChsZW4gPSBpcy5yZWFkKHRieXMpKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdG9zLndyaXRlKHRieXMsIDAsIGxlbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaXMuY2xvc2UoKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICB0b3MuY2xvc2UoKTtcXG4gICAgICAgIC8v6KeE5YiZ5pu/5o2i6KeE5YiZO1xcbiAgICAgICAgbGV0IG91dEZpbGUgPSBuZXcgRmlsZShmaWxlT3V0KTtcXG4gICAgICAgIGlmICh0eXBlb2YgaW50ZXJjZXB0ID09PSBcXFwiZnVuY3Rpb25cXFwiKSB7XFxuICAgICAgICAgICAgbGV0IHRpcyA9IG5ldyBGaWxlSW5wdXRTdHJlYW0odG1wRmlsZSk7XFxuICAgICAgICAgICAgbGV0IG9zID0gbmV3IEJ1ZmZlcmVkT3V0cHV0U3RyZWFtKG5ldyBGaWxlT3V0cHV0U3RyZWFtKG91dEZpbGUpKTtcXG4gICAgICAgICAgICBsZXQgbGVuID0gMDtcXG4gICAgICAgICAgICBsZXQgYnlzID0gQXJyYXkubmV3SW5zdGFuY2UoQnl0ZS5UWVBFLCBCVUZGRVJfU0laRSk7XFxuICAgICAgICAgICAgd2hpbGUgKChsZW4gPSB0aXMucmVhZChieXMpKSAhPSAtMSkge1xcbiAgICAgICAgICAgICAgICBsZXQgbmJ5cyA9IGludGVyY2VwdChuZXcgU3RyaW5nKGJ5cywwLGxlbikpO1xcbiAgICAgICAgICAgICAgICBvcy53cml0ZShuYnlzLCAwLCBuYnlzLmxlbmd0aCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHRtcEZpbGUuZGVsZXRlKCk7XFxuICAgICAgICAgICAgdGlzLmNsb3NlKCk7XFxuICAgICAgICAgICAgb3MuY2xvc2UoKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAg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IsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCIjXFxcIiArIGlcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxldCByZXN1bHQgPSBcXFwidG9hc3Q6Ly/kuIvovb3lpLHotKVcXFwiO1xcbiAgICB0cnkge1xcbiAgICAgICAgdG9hc3QoXFxcIuW8gOWni+S4i+i9vTpcXFwiICsgaXRlbS50aXRsZSk7XFxuICAgICAgICBsZXQgZG93bmxvYWQgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9Eb3dubG9hZC5leGUuanNcXFwiKTtcXG4gICAgICAgIHJlc3VsdCA9IGRvd25sb2FkKGl0ZW0sIGluZm8sIE1ZX0lELCBpKTtcXG4gICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCcXFxcIiArIGl0ZW0udGl0bGUgKyBcXFwi4oCd4oCdXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJ0b2FzdDovL+W3suS4i+i9vVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcIiNcXFwiICsgaVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS50aXRsZSxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwiI1xcXCIgKyBpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgfSBmaW5hbGx5IHtcXG4gICAgICAgIGxvYWRpbmdUZWFtLnNwbGljZShFbGVtZW50SW5kZXgsIDEpO1xcbiAgICAgICAgcHV0TXlWYXIoTVlfSU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jFcXFwiKTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvmraPlnKjlgZzmraIuLi5dXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX0lEICsgXFxcInx85LiL6L295o6n5Yi2XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ato+WcqOWPlua2iOS4i+i9veS7u+WKoVxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChzdGF0dXMgPT09IFxcXCIxXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5q2j5Zyo5pqC5YGcLi4uXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHN0YXR1cyA9PT0gXFxcIjJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sumAgOWHuuS4i+i9veWZqFxcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChbXFxcIjNcXFwiLCBcXFwiNFxcXCJdLmluY2x1ZGVzKHN0YXR1cykpIHtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcihNWV9JRCArIFxcXCI6aXNTdGFydFxcXCIpO1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKE1ZX0lEICsgXFxcIjpzdGF0dXNcXFwiKTtcXG4gICAgICAgICAgICAgICAgY2xlYXJNeVZhcihNWV9JRCArIFxcXCI6bG9nXFxcIik7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/ph43mlrDngrnlh7vkuIvov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dGVtLFxcbiAgICAgICAgICAgIGluZm86IGluZm8sXFxuICAgICAgICAgICAgTVlfSUQ6IE1ZX0lEXFxuICAgICAgICB9XFxuICAgIH0pKTtcXG4gICAgbGV0IGxvZ051bSA9IENvbmZpZy5sb2dOdW07XFxuXFxuICAgIGZ1bmN0aW9uIHB1dExvZyh0ZXh0KSB7XFxuICAgICAgICBsb2codGV4dCk7XFxuICAgICAgICBpZiAobG9nQ291bnQgPj0gbG9nTnVtKSB7XFxuICAgICAgICAgICAgZGVsZXRlSXRlbShNWV9JRCArIFxcXCIjbG9nI1xcXCIgKyAobG9nQ291bnQgLSAxMCkpO1xcbiAgICAgICAgfVxcbiAgICAgICAgYWRkSXRlbUFmdGVyKE1ZX0lEICsgXFxcInx85pel5b+XXFxcIiwge1xcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwiJD5cXFwiICsgdGV4dCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwiI2xvZyNcXFwiICsgbG9nQ291bnRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGxvZ0NvdW50Kys7XFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gbGlzdGVuZXIocGVyY2gsIGlkLCBlcnJvciwgQ0lEKSB7XFxuICAgICAgICBjb3VudCsrO1xcbiAgICAgICAgbGV0IGlzU3VjY2VzcyA9IGZhbHNlO1xcbiAgICAgICAgaWYgKGVycm9yICE9PSBudWxsKSB7XFxuICAgICAgICAgICAgZmFpbE5hbWUucHVzaChpZCk7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJd5LiL6L295aSx6LSl77yaXFx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ICAgICAgICAgICBwdXRNeVZhcihNWV9JRCArIFxcXCI6c3RhdHVzXFxcIiwgXFxcIjNcXFwiKTtcXG4gICAgICAgICAgICBwdXRMb2coXFxcIuS4i+i9veWksei0pTpbXFxcIiArIGZhaWxOYW1lLmpvaW4oXFxcIl3vvIxbXFxcIikgKyBcXFwiXeOAglxcXCIpO1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIlvlpITnkIblpLHotKVdXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBNWV9JRCArIFxcXCJ8fOS4i+i9veaOp+WItlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIGlmIChmYWlsVGVhbS5sZW5ndGggPiAwICYmIHN0YXR1cyA9PT0gXFxcIjFcXFwiKSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCI0XFxcIik7XFxuICAgICAgICAgICAgcHV0TG9nKFxcXCJbbGlzdGVuZXJdI+W3suWBnOatouaJgOacieS7u+WKoe+8jOS9huW3suaciei/m+W6puS4jeS8mua2iOWksSNcXFwiKTtcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJb6YeN5paw5byA5aeLXVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogTVlfSUQgKyBcXFwifHzkuIvovb3mjqfliLZcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoTVlfSUQgKyBcXFwiOnN0YXR1c1xcXCIsIFxcXCIyXFxcIik7XFxuICAgICAgICAgIC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gdGV4dC5zbGljZShpbmRleCArIHRhcmdldC5sZW5ndGgpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGFycmF5O1xcbiAgICB9LFxcbiAgICBjaHVuayhhcnIsIHNpemUpIHtcXG4gICAgICAgIHZhciByZXN1bHQgPSBbXTtcXG4gICAgICAgIGZvciAodmFyIGkgPSAwLCBsZW4gPSBhcnIubGVuZ3RoOyBpIDwgbGVuOyBpICs9IHNpemUpIHtcXG4gICAgICAgICAgICByZXN1bHQucHVzaChhcnIuc2xpY2UoaSwgaSArIHNpemUpKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiByZXN1bHQ7XFxuICAgIH0sXFxuICAgIGhpa2VyUGljKHVybCkge1xcbiAgICAgICAgdmFyIGhlYWRlcnMgPSB7fTtcXG4gICAgICAgIGxldCB1cmxzID0gdXJsLnNwbGl0KFxcXCJAXFxcIik7XFxuICAgICAgICBsZXQgcGljVXJsID0gdXJscy5zaGlmdCgpO1xcbiAgICAgICAgbGV0IGxlbmd0aCA9IHVybHMubGVuZ3RoO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB1cmxzW2ldLnNwbGl0KFxcXCI9XFxcIik7XFxuICAgICAgICAgICAgaGVhZGVyc1trZXldID0gdmFsdWU7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gW3BpY1VybCwgaGVhZGVyc107XFxuICAgIH0sXFxuICAgIHJhbmdlKHN0YXJ0LCBlbmQpIHtcXG4gICAgICAgIHJldHVybiBBcnJheShlbmQgLSBzdGFydCkuZmlsbCgwKS5tYXAoKGVsLCBpKSA9PiBzdGFydCArIGkpO1xcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwiI2ouQ29uZmlnXCIsXCJwYXRoXCI6XCJDb25maWcuanNvblwiLFwicnV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gICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIFxcXCLkuIDmnKzkuZ/msqHmnIlcXFwiLmJpZygpLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9TZXR0aW5nLnZpZXcjbm9SZWZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uLFxcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgcmV0dXJuIHNldFJlc3VsdChsYXlvdXQpO1xcbiAgICB9XFxuICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgIHVybDogJ1xcXCJoaWtlcjovL3NlYXJjaD9zPVxcXCIraW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuaQnOS9oOaDs+imgeeahCNcXFwiICsgdHlwZSArIFxcXCIjLi4uLi4uXFxcIixcXG4gICAgICAgIHRpdGxlOiAn5pCc57SiJyxcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBydWxlczogJC50b1N0cmluZygodGFnLCB0eXBlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBhcnIxID0gW107XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgdGFnLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBhcnIxLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ0aXRsZVxcXCI6IHRhZ1tpXS5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJz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gICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuKAnOKAnFxcXCIgKyBpdC5uYW1lICsgXFxcIuKAneKAnVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogJFUuYnVpbGQoJFUoW1xcXCLliKDpmaTor6Xnm67lvZVcXFwiLCBcXFwi6Lez6L2s5bCP56iL5bqPXFxcIl0sIDEsIFxcXCLpgInmi6nmk43kvZxcXFwiKS5zZWxlY3QoKG5hbWUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChcXFwi6Lez6L2s5bCP56iL5bqPXFxcIiA9PT0gaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vaG9tZUBcXFwiICsgbmFtZTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRoZW4oW1xcXCLor6Xmk43kvZzkuI3kvJrliKDpmaTlsI/nqIvluo/vvIzkvYbor6XlsI/nqIvluo/kuIvovb3nmoTmiYDmnInmvKvnlLvlsIbooqvliKDpmaRcXFwiXSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0sIGl0Lm5hbWUpLmNvbmZpcm0oKHBhdGgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IEZpbGUgPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGbGllcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoXFxcIi50Z251bVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdC5wYXRoKSlcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKGkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcIi50Z251bVxcXCIsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGkpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxldCBwYXRoID0gdGFnW3RnbnVtXS5wYXRoO1xcbiAgICBsZXQgbWhsaXN0ID0gRmlsZS5nZXRGaWxlUGF0aChwYXRoLCBcXFwiZGlyXFxcIik7XFxuXFxuICAgIGlmIChtaGxpc3QubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgXFxcIuS4gOacrOS5n+ayoeaciVxcXCIuYmlnKCksXFxuICAgICAgIC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gIGxldCBuYW1lID0gZ2V0VGl0bGUoaXRlbS5uYW1lKTtcXG4gICAgICAgIGFycmF5LnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9Ob3ZlbE1haW5Cb2R5I2F1dG9QYWdlIyNyZWFkVGhlbWUjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBwYXRoOiBpdGVtLnBhdGgsXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBuYW1lLFxcbiAgICAgICAgICAgICAgICBpc1JlcGxhY2U6IGJvb2tJbmZvLmlzUmVwbGFjZVxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IENvbmZpZy5kZWZfVmlld19TdHlsZVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59IGVsc2Uge1xcbiAgICBmb3IgKGxldCBpdGVtIG9mIGNoYXB0ZXJMaXN0KSB7XFxuICAgICAgICBsZXQgbmFtZSA9IGdldFRpdGxlKGl0ZW0ubmFtZSk7XFxuICAgICAgICBhcnJheS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogbmFtZSxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOWIoOmZpFtcXFwiICsgbmFtZSArIFxcXCJd77yfXFxcIikuY29uZmlybSgocGF0aCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25zdCBGaWxlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvRmlsZS5qc1xcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGbGllcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5Yig6Zmk5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgfS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FxuXFxuICAgICAgICBsZXQgY2FjaGVEaXIgPSBGaWxlLmdldEZpbGVQYXRoKENvbmZpZy5ob21lUGF0aCwgXFxcImRpclxcXCIpO1xcblxcbiAgICAgICAgZnVuY3Rpb24gY2xlYW5DYWNoZShwYXRoKSB7XFxuICAgICAgICAgICAgY29uc3QgRmlsZSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL0ZpbGUuanNcXFwiKTtcXG4gICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGbGllcyhwYXRoKSkge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/muIXpmaTlrozmiJBcXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/muIXpmaTlpLHotKVcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGNhY2hlIG9mIGNhY2hlRGlyKSB7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogY2FjaGUubmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuWkp+Wwj++8mlxcXCIgKyBGaWxlLmdldEZpbGVTaXplKGNhY2hlLnBhdGgpICsgXFxcIlxcXFxu5o+P6L+w77yaXFxcIiArIGtub3duTGlzdC5nZXQoY2FjaGUubmFtZSkgfHwgXFxcIuacquefpeebruW9lVvpo47pmanmnKrnn6VdXFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIuehruiupOa4hemZpCBcXFwiICsgY2FjaGUubmFtZSArIFxcXCIgP1xcXCIpLmNvbmZpcm0oY2xlYW5DYWNoZSwgY2FjaGUucGF0aClcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWFqOmDqOa4hemZpChcXFwiICsgRmlsZS5nZXRGaWxlU2l6ZShDb25maWcuaG9tZVBhdGgpICsgXFxcIilcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiAkKFxcXCLnoa7orqTmuIXpmaTlhajpg6jnvJPlrZjmlbDmja4/XFxcIikuY29uZmlybShjbGVhbkNhY2hlLCBDb25maWcuaG9tZVBhdGgpXFxuICAgICAgICB9KTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIFxcXCJkZWZhdWx0UGljXFxcIjpcXG4gICAgICAgIHNldFBhZ2VUaXRsZShcXFwi6buY6K6k5bCB6Z2ifOiuvue9rlxcXCIpO1xcblxcbiAgICAgICAgZnVuY3Rpb24gc2V0RGVmYXVsdFBpYyh1cmwpIHtcXG4gICAgICAgICAgICBsZXQgQ29uZmlnID0gSlNPTi5wYXJzZShyZWFkRmlsZShcXFwiY29uZmlnLmpzb25cXFwiKSB8fCBcXFwie31cXFwiKTtcXG4gICAgICAgICAgICBDb25maWcuZGVmX1BpYyA9IHVybDtcXG4gICAgICAgICAgICBzYXZlRmlsZShcXFwiY29uZmlnLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShDb25maWcpKTtcXG4gICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBpID0gMTsgaSA8PSA0OyBpKyspIHtcXG4gICAgICAgICAgICB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GlucHV0LnN0YXJ0c1dpdGgoXFxcImZpbGU6Ly9cXFwiKSA/IGlucHV0IDogXFxcImZpbGU6Ly9cXFwiICsgaW5wdXRcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVUZXh0ID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgICAgIGlmICghcnVsZVRleHQpIHJldHVybiBcXFwidG9hc3Q6Ly/ojrflj5bmlofku7bkuLrnqbpcXFwiO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5ld1J1bGVMaXN0ID0gSlNPTi5wYXJzZShydWxlVGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgbmV3Q291bnQgPSAwLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUNvdW50ID0gMDtcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbmV3UnVsZUxpc3QpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3UnVsZSA9IG5ld1J1bGVMaXN0W2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpZCA9IG5ld1J1bGUuaWQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpZEluZGV4ID0gcnVsZUxpc3QuZmluZEluZGV4KHJ1bGUgPT4gcnVsZS5pZCA9PT0gaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZEluZGV4ID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3Quc3BsaWNlKGlkSW5kZXgsIDEsIG5ld1J1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnB1c2gobmV3UnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShydWxlTGlzdCkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhcXFwiXFxcXG7ot6/lvoTvvJpcXFwiICsgaW5wdXQgKyBcXFwiXFxcXG7mgLvop4TliJnmlbDvvJpcXFwiICsgbmV3UnVsZUxpc3QubGVuZ3RoICsgXFxcIlxcXFxu5pu05paw6KeE5YiZIFxcXCIgKyB1cGRhdGVDb3VudCArIFxcXCIg5p2hXFxcXHTmlrDlop7op4TliJkgXFxcIiArIG5ld0NvdW50ICsgXFxcIiDmnaFcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXmiJDlip9cXFwiO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lr7zlhaXlpLHotKVcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsZW4gPSBydWxlTGlzdC5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xcbiAgICAgICAgICAgIGxldCByZXBsYWNlUnVsZSA9IHJ1bGVMaXN0W2ldO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IChyZXBsYWNlUnVsZS5pc0VuYWJsZWQgPyBcXFwi4pePXFxcIiA6IFxcXCLil4tcXFwiKSArIHJlcGxhY2VSdWxlLm5hbWUsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaWQgKyBpLFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5Yig6ZmkXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcInJlcGxhY2VSdWxlLmpzb25cXFwiKSB8fCBcXFwiW11cXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0LnNwbGljZShpbmRleCwgMSk7XFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFwicmVwbGFjZVJ1bGUuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICsgaW5kZXgpO1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArXFxcIiNcXFwiICtpbmRleCk7XFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKGlkICtcXFwiJFxcXCIgK2luZGV4KTtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0oaWQgK1xcXCJAXFxcIiAraW5kZXgpO1xcbiAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIuWIoOmZpOaIkOWKn1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgfSwgaWQsIGkpLFxcbiAgICAgICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaWQrXFxcIiNcXFwiK2lcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIue8lui+kVxcXCIsXFxuICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9lZGl0UmVwbGFjZVJ1bGUudmlldyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMjbm9SZWZyZXNoIz9pbmRleD1cXFwiICsgaSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzNcXFwiLFxcbiAgICAgICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaWQrXFxcIiRcXFwiK2lcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGxheW91dC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLlvIDlkK8v5YWz6ZetXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChpZCwgaW5kZXgsIHRpdGxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIikgfHwgXFxcIltdXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaXNFbmFibGVkID0gcnVsZUxpc3RbaW5kZXhdLmlzRW5hYmxlZDtcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0W2luZGV4XS5pc0VuYWJsZWQgPSAhaXNFbmFibGVkO1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkICsgaW5kZXgsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChpc0VuYWJsZWQgPyBcXFwi4peLXFxcIiA6IFxcXCLil49cXFwiKSArIHRpdGxlXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICAgIH0sIGlkLCBpLCByZXB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ZyZXNoIyNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSNcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgdmVyc2lvbjogTVlfUlVMRS52ZXJzaW9uLFxcXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICByZXR1cm4gc2V0UmVzdWx0KGxheW91dCk7XFxcXG4gICAgfVxcXFxuICAgIGxheW91dC5wdXNoKHtcXFxcbiAgICAgICAgdXJsOiAnXFxcXFxcXCJoaWtlcjovL3NlYXJjaD9zPVxcXFxcXFwiK2lucHV0JyxcXFxcbiAgICAgICAgZGVzYzogXFxcXFxcXCLmkJzkvaDmg7PopoHnmoQjXFxcXFxcXCIgKyB0eXBlICsgXFxcXFxcXCIjLi4uLi4uXFxcXFxcXCIsXFxcXG4gICAgICAgIHRpdGxlOiAn5pCc57SiJyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxcXG4gICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICBydWxlczogJC50b1N0cmluZygodGFnLCB0eXBlKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGFycjEgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IHRhZy5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBhcnIxLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ0aXRsZVxcXFxcXFwiOiB0YWdbaV0ubmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwic2VhcmNoX3VybFxcXFxcXFwiOiBcXFxcXFxcImhpa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lsZSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9GaWxlLmpzXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoRmlsZS5kZWxldGVGbGllcyhwYXRoKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFxcXFxcIi50Z251bVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+WIoOmZpOaIkOWKn1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/liKDpmaTlpLHotKVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0sIGl0LnBhdGgpKVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0Lm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwic2Nyb2xsX2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKGkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcIi50Z251bVxcXFxcXFwiLCBpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiO1xcX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AgICAgICAgICAgaW5wdXQgPSBpbnB1dC5zdGFydHNXaXRoKFxcXFxcXFwiZmlsZTovL1xcXFxcXFwiKSA/IGlucHV0IDogXFxcXFxcXCJmaWxlOi8vXFxcXFxcXCIgKyBpbnB1dFxcXFxuICAgICAgICAgICAgICAgIGxldCBydWxlVGV4dCA9IHJlcXVlc3QoaW5wdXQpO1xcXFxuICAgICAgICAgICAgICAgIGlmICghcnVsZVRleHQpIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v6I635Y+W5paH5Lu25Li656m6XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5ld1J1bGVMaXN0ID0gSlNPTi5wYXJzZShydWxlVGV4dCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlTGlzdCA9IEpTT04ucGFyc2UocmVhZEZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIpIHx8IFxcXFxcXFwiW11cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBuZXdDb3VudCA9IDAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVDb3VudCA9IDA7XFxcXG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgaW4gbmV3UnVsZUxpc3QpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBuZXdSdWxlID0gbmV3UnVsZUxpc3RbaV07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaWQgPSBuZXdSdWxlLmlkO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3UnVsZS5pZCA9IGlkIHx8IG5ldyBEYXRlKCkuZ2V0VGltZSgpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlkSW5kZXggPSBydWxlTGlzdC5maW5kSW5kZXgocnVsZSA9PiBydWxlLmlkID09PSBpZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaWRJbmRleCA+IC0xKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlQ291bnQrKztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5zcGxpY2UoaWRJbmRleCwgMSwgbmV3UnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld0NvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVsZUxpc3QucHVzaChuZXdSdWxlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcInJlcGxhY2VSdWxlLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKFxcXFxcXFwiXFxcXFxcXFxu6Lev5b6E77yaXFxcXFxcXCIgKyBpbnB1dCArIFxcXFxcXFwiXFxcXFxcXFxu5oC76KeE5YiZ5pWw77yaXFxcXFxcXCIgKyBuZXdSdWxlTGlzdC5sZW5ndGggKyBcXFxcXFxcIlxcXFxcXFxcbuabtOaWsOinhOWImSBcXFxcXFxcIiArIHVwZGF0ZUNvdW50ICsgXFxcXFxcXCIg5p2hXFxcXFxcXFx05paw5aKe6KeE5YiZIFxcXFxcXFwiICsgbmV3Q291bnQgKyBcXFxcXFxcIiDmnaFcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5a+85YWl5oiQ5YqfXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2coZS50b1N0cmluZygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/lr7zlhaXlpLHotKVcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfM1xcXFxcXFwiXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJsaW5lX2JsYW5rXFxcXFxcXCJcXFxcbiAgICAgICAgfSk7XFxcXG4gICAgICAgIGZvciAobGV0IGkgPSAwLCBsZW4gPSBydWxlTGlzdC5sZW5ndGg7IGkgPCBsZW47IGkrKykge1xcXFxuICAgICAgICAgICAgbGV0IHJlcGxhY2VSdWxlID0gcnVsZUxpc3RbaV07XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IChyZXBsYWNlUnVsZS5pc0VuYWJsZWQgPyBcXFxcXFxcIuKXj1xcXFxcXFwiIDogXFxcXFxcXCLil4tcXFxcXFxcIikgKyByZXBsYWNlUnVsZS5uYW1lLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIHVybDogXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGlkICsgaSxcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBsYXlvdXQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5Yig6ZmkXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKGlkLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlYWRGaWxlKFxcXFxcXFwicmVwbGFjZVJ1bGUuanNvblxcXFxcXFwiKSB8fCBcXFxcXFxcIltdXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICBydWxlTGlzdC5zcGxpY2UoaW5kZXgsIDEpO1xcXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZShcXFxcXFxcInJlcGxhY2VSdWxlLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpbmdpZnkocnVsZUxpc3QpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArIGluZGV4KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArXFxcXFxcXCIjXFxcXFxcXCIgK2luZGV4KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArXFxcXFxcXCIkXFxcXFxcXCIgK2luZGV4KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShpZCArXFxcXFxcXCJAXFxcXFxcXCIgK2luZGV4KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcXFxcXCLliKDpmaTmiJDlip9cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCwgaSksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6e1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogaWQrXFx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S5pc0VuYWJsZWQ7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVMaXN0W2luZGV4XS5pc0VuYWJsZWQgPSAhaXNFbmFibGVkO1xcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGlkICsgaW5kZXgsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChpc0VuYWJsZWQgPyBcXFxcXFxcIuKXi1xcXFxcXFwiIDogXFxcXFxcXCLil49cXFxcXFxcIikgKyB0aXRsZVxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoXFxcXFxcXCJyZXBsYWNlUnVsZS5qc29uXFxcXFxcXCIsIEpTT04uc3RyaW5naWZ5KHJ1bGVMaXN0KSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIjtcXFxcbiAgICAgICAgICAgICAgICB9LCBpZCwgaSwgcmVwbGFjZVJ1bGUubmFtZSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF8zXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6e1xcXFxuICAgICAgICAgICAgICAgICAgICBpZDogaWQrXFxcXFxcXCJAXFxcXFxcXCIraVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgbGF5b3V0LnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVcXFxcXFxc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