Advertisement
xiaomianao666

邀您一起看:全部规则

Nov 7th, 2022
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥全部规则@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuW3peWFt1wiLFwicGF0aFwiOlwidXRpbGl5XCIsXCJydWxlXCI6XCJqczpcXG5sZXQgaG9zdCA9IFxcXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3NcXFwiO1xcbi8vbGV0IGhvc3QgPSBcXFwiaHR0cDovLzE5Mi4xNjguMy45NDo4MDc5XFxcIjtcXG5sZXQgaG9tZSA9IGJhc2U2NERlY29kZShcXFwiYUdsclpYSTZMeTlvYjIxbFxcXCIpO1xcbnZhciBhcGkgPSB7XFxuICAgIGhvc3Q6IGhvc3QrXFxcIi9oaWtlcnVsZVxcXCIsXFxuICAgIHVzZXJzVXJsOiBcXFwiL2Rldi91c2Vycz9vcmRlcj1cXFwiLCAvL+eUqOaIt+WIl+ihqFxcbiAgICBydWxlQ291bnRVcmw6IFxcXCIvZGV2L3J1bGVjb3VudFxcXCIsIC8v6I635Y+W6KeE5YiZ5pWw6YePXFxuICAgIHJ1bGVzVXJsOiBcXFwiL2Rldi9nZXRcXFwiLCAvL+eUqOaIt+WvueW6lOeahOinhOWImeWIl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BlcmF0b3IyID0gXFxcIjpcXFwiO1xcbiAgICAgICAgICAgIGxldCBtb250aCA9IGRhdGUuZ2V0TW9udGgoKSArIDE7XFxuICAgICAgICAgICAgbGV0IHN0ckRhdGUgPSBkYXRlLmdldERhdGUoKTtcXG4gICAgICAgICAgICBsZXQgc3RySG91cnMgPSBkYXRlLmdldEhvdXJzKCk7XFxuICAgICAgICAgICAgbGV0IHN0ck1pbnV0ZXMgPSBkYXRlLmdldE1pbnV0ZXMoKTtcXG4gICAgICAgICAgICBsZXQgc3RyU2Vjb25kcyA9IGRhdGUuZ2V0U2Vjb25kcygpKzE7XFxuICAgICAgICAgICAgaWYgKG1vbnRoID49IDEgJiYgbW9udGggPD0gOSkge1xcbiAgICAgICAgICAgICAgICBtb250aCA9IFxcXCIwXFxcIiArIG1vbnRoXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJEYXRlID49IDAgJiYgc3RyRGF0ZSA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckRhdGUgPSBcXFwiMFxcXCIgKyBzdHJEYXRlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJIb3VycyA+PSAwICYmIHN0ckhvdXJzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RySG91cnMgPSBcXFwiMFxcXCIgKyBzdHJIb3Vyc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyTWludXRlcyA+PSAwICYmIHN0ck1pbnV0ZXMgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJNaW51dGVzID0gXFxcIjBcXFwiICsgc3RyTWludXRlc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyU2Vjb25kcyA+PSAwICYmIHN0clNlY29uZHMgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJTZWNvbmRzID0gXFxcIjBcXFwiICsgc3RyU2Vjb25kc1xcbiAgICAgICAgICAgIH1cXG4gICA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uG6K6i6ZiF77yaXFxcIit0aXRsZSsnXFxcXG4nK3VybDtcXG4gICAgICAgICAgICAgICAgY29weShpbXBvcnRfcnVsZSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSAnaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3J1bGVDYWNoZS9zdWIuanNvbic7XFxuICAgICAgICAgICAgICAgICQucmMoY29uZmlnLmxpYi5zdWIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4g6K6i6ZiF5a+85YWlKHBhdGgpXFxuICAgICAgICAgICAgfSxkYXRhSXRlbSxzdWJVcmwpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuaWYgKHJ1bGVDb2RlKSB7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuWIhuS6q+inhOWImVxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJjb3B5Oi8vXFxcIiArIHJ1bGVDb2RlLFxcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgIH0pO1xcbn1cXG5cXG5mdW5jdGlvbiBzZXRTZXR0aW5nSXRlbShiYXNpYywgcGF0dGVybikge1xcbiAgICBsZXQgdGVtcCA9IHtcXG4gICAgICAgIHRpdGxlOiBiYXNpYy50aXRsZSxcXG4gICAgICAgIGNvbF90eXBlOiBiYXNpYy5jb2xfdHlwZSxcXG4gICAgICAgIHVybDogJChiYXNpYy5jb25maXJtKS5jb25maXJtKCh1cmwsIG1zZywgcGF0dGVybikgPT4ge1xcbiAgICAgICAgICAgIGxldCBiYWNrQSA9IHJlcXVlc3QodXJsKTtcXG4gICAgICAgICAgICBsZXQgcmV0ID0gSlNPTi5wYXJzZShiYWNrQSk7XFxuICAgICAgICAgICAgaWYgKHJldC5zdGF0dXMgPT0gMCkge1xcbiAgICAgICAgICAgICAgICBwYXR0ZXJuID8gYmFjaygpI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aW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgYmFjayA9IHJlcXVlc3QoaW5wdXQpO1xcbiAgICAgICAgICAgIGxldCByZXQgPSBKU09OLnBhcnNlKGJhY2spO1xcbiAgICAgICAgICAgIGlmIChyZXQuc3RhdHVzID09IDApIHtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey55Sf5oiQ6ZqP5py65a+G56CBXFxcXG5cXFwiICsgcmV0LnJlc3VsdFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZqP5py65a+G56CB55Sf5oiQ5aSx6LSlXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBsZXQgdGltZU92ZXIgPSB7XFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgfTtcXG4gICAgaWYgKGRhdGFJdGVtLnRpbWVfb3Zlcikge1xcbiAgICAgICAgdGltZU92ZXIudGl0bGUgPSBzbWFsbChjb2xvcihcXFwi55+t5pe25a+G6ZKlXFxcIiwgXFxcImdyZWVuXFxcIikgKyBjb2xvcihcXFwiKOKGkuawuOS5hSlcXFwiLCBcXFwicmVkXFxcIikpO1xcbiAgICAgICAgdGltZU92ZXIudXJsID0gZ2V0QXBpKFxcXCJ0aW1lb3ZlclxcXCIpICsgcmVxQnlHZXQgKyBcXFwiJmZsYWc9MVxcXCI7XFxuICAgICAgICB0aW1lT3Zlci5jb25maXJtID0gXFxcIuaYr+WQpuehruiupOS7peWQjueahOengeiXj+inhOWImeWIhuS6q+S4jei/h+acnz9cXFwiO1xcbiAgICAgICAgdGltZU92ZXIubXNnID0gW1xcXCLlt7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sXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2luZm9cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgdHlwZTogXFxcImxvbmdfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIHRleHQ6IGl0ZW0uZGlzY3Vzc190ZXh0XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbmRhdGEucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG59KTtcXG5zZXRSZXN1bHQoZGF0YSk7XCJ9LHtcImNvbF90eXBlXCI6XCJpY29uXzJfcm91bmRcIixcIm5hbWVcIjpcIuinhOWImeWIl+ihqFwiLFwicGF0aFwiOlwicnVsZXNcIixcInJ1bGVcIjpcImpzOlxcbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsJC50b1N0cmluZygoKT0+e1xcbiAgICAgICAgY2xlYXJWYXIoXFxcIldhcmVob3VzZS5iYWNrXFxcIik7XFxuICAgICAgICBjbGVhclZhcihcXFwiV2FyZWhvdXNlLmZpbHRlclxcXCIpO1xcbiAgICAgICAgY2xlYXJWYXIoXFxcIldhcmVob3VzZS50eXBlXFxcIik7XFxuICAgICAgICBpZihnZXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJywnJykpe1xcbiAgICAgICAgICAgIGxvZygn5pON5L2c6L+H56aB5q2i5LiK5LygOicrZ2V0VmFyKCdXYXJlaG91c2UuY2FuX3VwbG9hZCcpKTtcXG4gICAgICAgICAgICBjbGVhclZhcihcXFwiV2FyZWhvdXNlLmNhbl91cGxvYWRcXFwiKTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgIH1cXG4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gICAgdGl0bGU6J+KaoOiDveWQpuS4iuS8oDonKyhnZXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJyl8fHRpcHMpLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOidoaWtlcjovL2VtcHR5J1xcbiAgICB9KTtcXG4gICAgZnVuY3Rpb24gc2V0VXBsb2FkKGZsYWcsY2FuX3VwbG9hZF9hcGkpIHtcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKGNhbl91cGxvYWRfYXBpLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjYW5fdXBsb2FkXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+emgeatouS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn56aB5q2i6K+l5byA5Y+R6ICF5LiK5Lyg6KeE5YiZP+S9oOeahOaTjeS9nOWwhuiiq+ezu+e7n+iusOW9lScpLmNvbmZpcm0oKGlkLGNhbl91cGxvYWRfYXBpLHNldFVwbG9hZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0VXBsb2FkKGZhbHNlLGNhbl91cGxvYWRfYXBpKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdXYXJlaG91c2UuY2FuX3VwbG9hZCcsJ+WQpicpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxpZCxjYW5fdXBsb2FkX2FwaSxzZXRVcGxvYWQpXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J+KcheWFgeiuuOS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn5YWB6K646K+l5byA5Y+R6ICF5LiK5Lyg6KeE5YiZP+S9oOeahOaTjeS9nOWwhuiiq+ezu+e7n+iusOW9lScpLmNvbmZpcm0oKGlk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aCh7XFxuICAgICAgICAgICAgdGl0bGU6ICforqLpmIXlkIjpm4YnLFxcbiAgICAgICAgICAgIHVybDogc3ViX3VybCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGUyXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6ICNmZjcwMDBcXFwiPuWvvOWFpei9u+WQiOmbhjwvc3Bhbj4nLFxcbiAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChkYXRhSXRlbSxzdWJVcmwpPT57XFxuICAgICAgICAgICAgICAgIGNvbnN0IHtnZW5SdWxlfT0kLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9nZW5BcGlcXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IGltcG9ydF9ydWxlPWdlblJ1bGUoZGF0YUl0ZW0ubmFtZStcXFwiLlxcXCIrZGF0YUl0ZW0uYXV0aG9yLHN1YlVybCk7XFxuICAgICAgICAgICAgICAgIC8vY29weShpbXBvcnRfcnVsZSk7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlQ29kZT1wYXJzZVBhc3RlKGltcG9ydF9ydWxlLnNwbGl0KFxcXCJcXFxcblxcXCIpWzBdKTtcXG4gICAgICAgICAgICAgICAgLy9yZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIGltcG9ydFVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShydWxlQ29kZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBpbXBvcnRVcmxcXG4gICAgICAgICAgICB9LGRhdGFJdGVtLHJ1bGVMaXN0SnNvbiArIGRhdGFJdGVtLmlkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGUyXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6ICNmZjcwMDBcXFwiPuWvvOWFpemBk+W+t+e7jzwvc3Bhbj4nLFxcbiAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChkYXRhSXRlbSxzdWJVcmwpPT57XFxuICAgICAgICAgICAgICAgIC8vIGxldCB0aXRsZSA9IFxcXCJILVxcXCIrZGF0YUl0ZW0ubmFtZStcXFwiLlxcXCIrZGF0YUl0ZW0uYXV0aG9yO1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBcXFwiSi1cXFwiK2RhdGFJdGVtLm5hbWUuc3BsaXQoJy4nKVswXTtcXG4gICAgICAgICAgICAgICAgbGV0IHN1Yk9iaiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc3ViVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvXFxcIit0aXRsZStcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmU6IGZhbHNlLC8v56aB55So5bm25Y+R5pu05pawXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHNoYXJlVGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJPYmopKTtcXG4gICAgICAgICAgICAgICAgdmFyIHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShzaGFyZVRleHQscGFzdGVzLnNsaWNlKC0xKVswXSk7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRfcnVsZT0gXFxcIui9u+WQiOmbhuiu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lKTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICforqLpmIXop4TliJknLFxcbiAgICAgICAgICAgIHVybDogc3ViX3VybCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgICAgIH0pXFxuICAgIH1cXG59XFxuaWYgKGRhdGFJdGVtLmlzX2pzb24gJiYgZGF0YUl0ZW0uZGF0YV90eXBlID09PSBcXFwiaG9tZV9ydWxlX3VybFxcXCIgJiYgIWRhdGFJdGVtLmlzX2pzb25fbGlzdCkge1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfov5vlhaXpopHpgZMnLFxcbiAgICAgICAgdXJsOiAkKCAvKlxcXCIjbm9Mb2FkaW5nI1xcXCIqLyApLmxhenlSdWxlKChuYW1lLGhvbWUpID0+IHtcXG4gICAgICAgICAgICBsZXQgcnVsZUxpc3QgPSBKU09OLnBhcnNlKHJlcXVlc3QoaG9tZSkpO1xcbiAgICAgICAgICAgIGxldCBoYXNSdWxlID0gcnVsZUxpc3Quc29tZShpdGVtID0+IGl0ZW0udGl0bGUgPT09IG5hbWUpO1xcbiAgICAgICAgICAgIGlmIChoYXNSdWxlKSB7XFxuICAgICAgICAgICAgICAgIHB1dFZhcihcXFwiV2FyZWhvdXNlLmJhY2tcXFwiLCBcXFwiMVxcXCIpO1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBob21lK1xcXCJzQFxcXCIgKyBuYW1lO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mnKrlronoo4VcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sIGRhdGFJdGVtLm5hbWUsYXBpLmhvbWUpLFxcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgIH0pXFxufVxcbmxldCBtYW5fcnVsZV9zYWZlID0gZ2V0QXBpKFxcXCJtYW5SdWxlU2FmZVxcXCIpK2RhdGFJdGVtLmlkO1xcbmxldCBtYW5fcnVsZV9nb29kID0gZ2V0QXBpKFxcXCJtYW5SdWxlR29vZFxcXCIpK2RhdGFJdGVtLmlkO1xcbi8vIGRhdGFJdGVtLmlzX3NhZmU7XFxuaWYoZ2V0VmFyKCdob3VzZS5pc19tYW5hZ2VyJykpe1xcbiAgICBmdW5jdGlvbiBzZXRJc1NhZmUoZmxhZyxtYW5fcnVsZV9zYWZlKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9zYWZlLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19zYWZlXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGZ1bmN0aW9uIHNldElzR29vZChmbGFnLG1hbl9ydWxlX2dvb2QpIHtcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKG1hbl9ydWxlX2dvb2QsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX2dvb2RcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICA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gICAgICAgaWYgKFt1c2VybmFtZSwgcGFzc3dvcmQsIG5hbWVdLmluY2x1ZGVzKFxcXCJcXFwiKSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/otKblj7cs5a+G56CB5ZKM5pi156ew5LiN6IO95Li656m6XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIHNob3dMb2FkaW5nKFxcXCLmraPlnKjmj5DkuqTnlLPor7fooahcXFwiKTtcXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicmVhc29uXFxcIjogZGVzY3JpcHRpb24sXFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IG5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdwb3N0J1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGlkcmVzdWx0ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldElkICsgXFxcIj9xcT1cXFwiICsgdXNlcm5hbWUpKTtcXG4gICAgICAgIGlmIChpZHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIGlkcmVzdWx0LmRldGFpbDtcXG4gICAgICAgIH1cXG4gICAgICAgIFxcbiAgICAgICAgcmV0dXJuICQoXFxcIlxcXCIsIFxcXCLovpPlhaXpgq7nrrHpqozor4HnoIFcXFxcblxcXCIgKyByZXN1bHQuZGV0YWlsKS5pbnB1dCgoY29uZmlybSwgaWQsIGFjY291bnQpID0+IHtcXG4gICAgICAgICAgICBzaG93TG9hZGluZyhcXFwi6K+36ICQ5b+D562J5b6FXFxcIik7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoY29uZmlybSwge1xcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInJlZ2lzdF9pZFxcXCI6IGlkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwieXptXFxcIjogaW5wdXRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3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TogXFxcIuS/neWtmFxcXCIsXFxuICAgICAgICB1cmw6ICQoZ2V0QXBpKFxcXCJtb2RpZnlfbmFtZVxcXCIpICsgcGF0aCkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBuZXdQZXROYW1lID0gZ2V0VmFyKCdXYXJlaG91c2UubS5wZXROYW1lJywgJycpO1xcbiAgICAgICAgICAgIGlmIChuZXdQZXROYW1lID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHloavllYohXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJm5hbWU9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChuZXdQZXROYW1lKSk7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpO1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcbiAgICB9KTtcXG59XFxuXFxuZnVuY3Rpb24gbV9hdmF0YXIoKSB7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5paw55qE5aS05YOP6ZO+5o6lXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uYXZhdGFyJywgJycpIHx8IGRldi5hdmF0YXIsXFxuICAgICAgICAgICAgb25DaGFuZ2U6ICdwdXRWYXIoXFxcIldhcmVob3VzZS5tLmF2YXRhclxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIuS/neWtmFxcXCIsXFxuICAgICAgICB1cmw6ICQoZ2V0QXBpKFxcXCJtb2RpZnlfYXZhXFxcIikgKyBwYXRoKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgbGV0IG5ld0F2YXRhciA9IGdldFZhcignV2FyZWhvdXNlLm0uYXZhdGFyJywgJycpO1xcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0ICsgXFxcIiZhdmF0YXJfdXJsPVxcXCIgKyBlbmNvZGVVUklDb21wb25lbnQobmV3QXZhdGFyKSk7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpO1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuI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AnJyk7XFxuICAgICAgICAgICAgbGV0IG5ld19wYXNzd29yZF9hZ2FpbiA9IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQuYycsICcnKTtcXG4gICAgICAgICAgICBpZiAob2xkX3Bhc3N3b3JkIT09cGFzc3dvcmQpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+WOn+WvhueggemUmeivr1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmKG5ld19wYXNzd29yZD09PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpeaWsOWvhueggVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmKG5ld19wYXNzd29yZCE9PW5ld19wYXNzd29yZF9hZ2Fpbil7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kuKTmrKHlr4bnoIHkuI3lkIxcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0ICsgXFxcIiZuZXdfcGFzc3dvcmQ9XFxcIiArIG5ld19wYXNzd29yZCtcXFwiJm5ld19wYXNzd29yZF9yZT1cXFwiK25ld19wYXNzd29yZF9hZ2Fpbik7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpO1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9XYXJlaG91c2VVU0VSLmpzb25cXFwiLEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHVzZXJuYW1lOnVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmQ6bmV3X3Bhc3N3b3JkXFxuICAgICAgICAgICAgIC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1xcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwibm90ZVxcXCI6bm90ZXNcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgIH1cXG4gICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S/ruaUueaIkOWKn1xcXCI7XFxuICAgIH0sIHVzZXJuYW1lLCBwYXNzd29yZClcXG59KTtcXG5zZXRSZXN1bHQoZGF0YSk7XCJ9LHtcImNvbF90eXBlXCI6XCJsaW5lXCIsXCJuYW1lXCI6XCLor4TorrrliJfooahcIixcInBhdGhcIjpcIkNvbW1lbnRcIixcInJ1bGVcIjpcImpzOlxcbnNldFBhZ2VUaXRsZShcXFwi6K+E6K665YiX6KGoXFxcIik7XFxuY29uc3Qge1xcbiAgICBhcGlcXG59ID0g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pO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIrcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTpcXFwidGV4dF8yXFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOlxcXCLliKDpmaTor4TorrpcXFwiLFxcbiAgICAgICAgICAgIHVybDokKFxcXCLnoa7orqTliKDpmaTor6Xor4Torro/XFxcIikuY29uZmlybSgoaW5wdXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQ9SlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH0sYXBpLmRpc19kZXZfY29udHJvbCtwaWQrXFxcIj9xcT1cXFwiICsgdXNlcm5hbWUgKyBcXFwiJnBhc3N3b3JkPVxcXCIgKyBwYXNzd29yZCtcXFwiJmRlbGV0ZT0xXFxcIiksXFxuICAgICAgICAgICAgY29sX3R5cGU6XFxcInRleHRfMlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTpcXFwibGluZVxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTpcXFwibGluZVxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbmlmICh0b3RhbFN1bSA9PT0gMCkge1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCI8aDUgc3R5bGU9J3Rle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iICsgaXRlbS5xcSxcXG5cXHRcXHQgICAgICAgdXJsOm5vX2FjdGl2ZT9cXFwiaGlrZXI6Ly9wYWdlL1JlcGx5XFxcIjpcXFwibXFxd3BhOi8vaW0vY2hhdD9jaGF0X3R5cGU9d3BhJnVpbj1cXFwiK2l0ZW0ucXEsXFxuICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBydWxlSWQ6IGlkLFxcbiAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIHBhc3N3b3JkOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgdXNlcm5hbWU6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICByZXBseUlkOml0ZW0uaWRcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLmRpc2N1c3NfdGV4dCxcXG4gICAgICAgICAgICBkZXNjOiBSZXBseStpdGVtLmNyZWF0ZV9kYXRlICsgXFxcIsK3XFxcIiArIGljb25baXRlbS5kaXNjdXNzX3R5cGVdLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvaW5mb1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBuYW1lOml0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgdHlwZTpcXFwibG9uZ190ZXh0XFxcIixcXG4gICAgICAgICAgICAgICAgdGV4dDppdGVtLmRpc2N1c3NfdGV4dFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGNvbnRyb2woaXRl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t1xcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBpZih0ZXh0PT1cXFwiXFxcIil7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWGmeWVilxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBmdW5jdGlvbiByKHApIHtcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHApLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHAgPSB7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfdGV4dFxcXCI6IHRleHQsXFxuICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxLFxcbiAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190eXBlXFxcIjogdHlwZSxcXG4gICAgICAgICAgICAgICAgXFxcImF1dGhfY29kZVxcXCI6IGF1dGhfY29kZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByKHApO1xcbiAgICAgICAgaWYocmVzdWx0LnN0YXR1cz09PTApe1xcbiAgICAgICAgICAgIGJhY2soZmFsc2UpO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIrcmVzdWx0LmRldGFpbDtcXG5cXG4gICAgf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PlhaVxcVxcXCIsXFxuICAgIHVybDogJC50b1N0cmluZygoYSwgYikgPT4ge1xcbiAgICAgICAgbGV0IHFxID0gaW5wdXQ7XFxuICAgICAgICBpZiAocXEgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5aGr5ZWKIVxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBzaG93TG9hZGluZyhcXFwi6I635Y+W5LitLi4uXFxcIilcXG4gICAgICAgIHJldHVybiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChxcSwgYSwgYikgPT4ge1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChhLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiBxcVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9IG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Z5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImF1dGhfY29kZVxcXCI6IHl6bVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgZi51c2VyID0gW3FxLCB5em1dO1xcbiAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9XYXJlaG91c2VVU0VSLmpzb25cXFwiLCBKU09OLnN0cmluZ2lmeShmKSk7XFxuICAgICAgICAgICAgbGV0IGluZGV4ID0gbC5maW5kSW5kZXgoaXRlbSA9PiBpdGVtWzBdID09PSBxcSk7XFxuICAgICAgICAgICAgaWYgKGluZGV4ID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgbC5zcGxpY2UoaW5kZXgsIDEsIFtxcSwgeXptXSk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChsLmxlbmd0aCA8IDYpIHtcXG4gICAgICAgICAgICAgICAgbC5wdXNoKFtxcSwgeXptXSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbC5zcGxpY2UoMCwgMSk7XFxuICAgICAgICAgICAgICAgIGwucHVzaChbcXEsIHl6bV0pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvV2FyZWhvdXNlVVNFUkEuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGwpKTtcXG4gICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAg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G4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX3RleHRcXFwiOiB0ZXh0LFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX2lkXFxcIjogcnVsZUlkXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBiYWNrKGZhbHNlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG5cXG4gICAgfSwgcGFzc3dvcmQsIHVzZXJuYW1lLCByZXBseUlkKVxcbn0pO1xcblxcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaIkeeahOWbnuWkjVwiLFwicGF0aFwiOlwiTXlSZXBseVwiLFwicnVsZVwiOlwianM6XFxuY29uc3Qge1xcbiAgICBhcGlcXG59ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5XFxcIik7XFxubGV0IHtcXG4gICAgYX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AgICAgICAgICAgIGxvZygn5byA5aeL6I635Y+W5rqQ56CBJyk7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgcmVxdWVzdEFzeW5jKHdlYl91cmwscGFyYW1zLGZ1bmN0aW9uIChrZXksY29kZSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IGNvZGU7XFxuICAgICAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IGdldEl0ZW0oJ2hvdXNlLmZpbGVfdWEnKT09PSfnlLXohJEnP2ZldGNoKHdlYl91cmwscGFyYW1zKTpyZXF1ZXN0KHdlYl91cmwscGFyYW1zKTtcXG4gICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lj5HnlJ/kuobplJnor686XFxcXG4nK2UubWVzc2FnZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxvZygn5Li76aKY6ZO+5o6lJyk7XFxuICAgICAgICAgICAgbGV0IHdlYl91cmxfYXJyID0gaW5wdXQuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGxldCB3ZWJfdXJsID0gd2ViX3VybF9hcnJbd2ViX3VybF9hcnIubGVuZ3RoLTFdO1xcbiAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBwYXJzZVBhc3RlKHdlYl91cmwpO1xcbiAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5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PYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2Uud2ViX3VybCcsUEFUSCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG9uQ2xpY2tUeXBlOidjb25maXJtJyxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qc3wudHh0fC5oaWtlcnwuanNvbnwuaHRtbFxcXCIsXFxuICAgICAgICAgICAgcGF0dGVybjogMCxcXG4gICAgICAgICAgICByZXF1aXJlVXJsOmZwLFxcbiAgICAgICAgICAgIGluaXRpYWxQYXRoOmdldFBhdGgoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS8nKS5zbGljZSg3KSxcXG4gICAgICAgICAgICBtZW1vcnk6J3RydWUnLFxcbiAgICAgICAgfSk7XFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOifkuIrkvKDnsbvlnosnLFxcbiAgICBkZXNjOifkuIrkvKDmlofku7bnmoTnsbvlnoss5b2T5YmN5Li6OicrY29sb3IoZ2V0SXRlbSgnaG91c2UuZmlsZV90eXBlJywn6Z2Z5oCB5paH5Lu2JyksJyNmZjcwMDAnKSxcXG4gICAgY29sX3R5cGU6J3RleHRfMScsXFxuICAgIHVybDokKGZpbGVfdHlwZV90aXRsZSwyKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgc2V0SXRlbSgnaG91c2UuZmlsZV90eXBlJyxpbnB1dC5yZXBsYWNlKCfwn5GJJywnJykpO1xcbiAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFx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pb24gY29tcGFyZShuYW1lKSB7XFxuICAgIHJldHVybiBmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICByZXR1cm4gaXRlbS5uYW1lID09PSBuYW1lO1xcbiAgICB9XFxufVxcbmQucHVzaCh7XFxuICAgIHRpdGxlOifwn5eE77iP546v5aKDJyxcXG4gICAgY29sX3R5cGU6J2ZsZXhfYnV0dG9uJyxcXG4gICAgdXJsOiQoKS5sYXp5UnVsZSgoZmlsZV90eXBlLGNvbXBhcmUpPT57XFxuICAgICAgICBsb2coJ+afpeeci+eOr+Wig+WPmOmHjycpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgdXBfY29kZSA9IGdldFZhcignaG91c2UudXBsb2FkX2NvZGUnLCcnKTtcXG4gICAgICAgICAgICBsZXQgZnR5cGUgPSAgZmlsZV90eXBlLmZpbHRlcihjb21wYXJlKGdldEl0ZW0oJ2hvdXNlLmZpbGVfdHlwZScsJ+mdmeaAgeaWh+S7ticpKSlbMF0udmFsdWU7XFxuICAgICAgICAgICAgbGV0IHJlZGlyZWN0ID0gZ2V0SXRlbSgnaG91c2UuZmlsZV9yZWRpcmVjdCcsJ+acrOWcsCcpIT09J+acrOWcsCc7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSAhcmVkaXJlY3Q/dXBfY29kZTppbnB1dDtcXG4gICAgICAgICAgICBsZXQgZW52ID0ge1xcbiAgICAgICAgICAgICAgICB3ZWJfdXJsOmdldFZhcignaG91c2Uud2ViX3VybCcsJycpLFxcbiAgICAgICAgICAgICAgICBkZXZpY2U6Z2V0SXRlbSgnaG91c2UuZmlsZV91YScsJ+eUteiEkScpLFxcbiAgICAgICAgICAgICAgICBmdHlwZTpmdHlwZXx8XFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgIHJlZGlyZWN0OnJlZGlyZWN0LFxcbiAgICAgICAgICAgICAgICBjb2RlOmNvZGUuc3Vic3RyaW5nKDAsNDApfHxcXFwiXFxcIixcXG4gICAgIC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gd2ViX3VybC5zcGxpdCgnLycpW3dlYl91cmwuc3BsaXQoJy8nKS5sZW5ndGgtMV07XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxldCBia2FyciA9IHVwX2NvZGUuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGlmKGJrYXJyLmxlbmd0aDwzKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S6keWJqui0tOadv+WGheWuueacieivrydcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3dpdGNoIChia2FyclsxXSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3RoZW1lJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfc2luZ2xlJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2pzX3VybCc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ++/pScpWzJdLnNwbGl0KCdAJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM572R6aG16ZO+5o6l5peg5YaF5a65ISc7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdWEgPSBnZXRJdGVtKCdob3VzZS5maWxlX3VhJyk9PT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HliYWNrLGh0bWwsaXNQaWMpPT57XFxuICAgICAgICBsZXQgdD1wYXJTdHIuc3BsaXQoXFxcIjtcXFwiKTtcXG4gICAgICAgIGxldCBkPVtdO1xcbiAgICAgICAgLy8gbGV0IGxpc3Q9cGRmYShnZXRSZXNDb2RlKCksdFswXSk7XFxuICAgICAgICBsZXQgbGlzdD1wZGZhKGh0bWwsdFswXSk7XFxuICAgICAgICBsZXQgbGF6eSA9ICQoJycpLmxhenlSdWxlKCgpPT57XFxuICAgICAgICAgICAgY29uc3Qge2xhenlQYXJzZX0gPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9nbG9iYWxQYXJzZT9ydWxlPemBk+mVv+S7k+W6k1BybycpO1xcbiAgICAgICAgICAgIHJldHVybiBsYXp5UGFyc2UoaW5wdXQpXFxuICAgICAgICB9KTtcXG4gICAgICAgIGZvcihsZXQgaSBpbiBsaXN0KXtcXG4gICAgICAgICAgICBsZXQgX3BpYyA9IHRbMl0/cGQobGlzdFtpXSx0WzJdKTonJztcXG4gICAgICAgICAgICBpZihpc1BpYyhfcGljKSYmIS9AUmVmZXJlcj0vLnRlc3QoX3BpYykpe1xcbiAgICAgICAgICAgICAgICBfcGljKz0nQFJlZmVyZXI9J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgaXQ9e1xcbiAgICAgICAgICAgICAgICB0aXRsZTpwZGZoKGxpc3RbaV0sdFsxXSksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6X3BpYyxcXG4gICAgICAgICAgICAgICAgZGVzYzpwZGZoKGxpc3RbaV0sdFszXSksXFxuICAgICAgICAgICAgICAgIHVybDplaj9wZChsaXN0W2ldLHRbNF0pOnBkKGxpc3RbaV0sdFs0XSkrbGF6eVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgaWYodC5sZW5ndGg+NSl7Ly/lhoXlrrnvvIznlKjkuo7mkJzntKJcXG4gICAgICAgICAgICAgICAgaXQuY29udGVudD1wZGZoKG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xcIik7Ly/lvJXnlKjlrZDpobXpnaLmnKzlnLDlgqjlrZjmj5Lku7ZcXG4gICAgICAgIGxldCBsb2NhbF9tcyA9IGxzZy5nZXRJdGVtKCd0aW1lb3V0Jyk7XFxuICAgICAgICBsZXQgbXMgPSBwYXJzZUludChtcyl8fHBhcnNlSW50KGxvY2FsX21zKXx8NTAwMDtcXG4gICAgICAgIGxldCBtYXhfY291bnQ9TWF0aC5jZWlsKG1zLzI1MCk7XFxuICAgICAgICBsb2coXFxcIuacrOasoeWXheaOoui2heaXtjpcXFwiK21zK1xcXCLlhbHorqHlvoXmipPljIU6XFxcIittYXhfY291bnQrXFxcIuasoVxcXCIpO1xcbiAgICAgICAgc2hvd0xvYWRpbmcoJ+WXheaOouS4re+8jOiLpeWksei0peWwseWIh+aNondlYuWXheaOoi4uLicpO1xcbiAgICAgICAgbGV0IF94NSA9ICQudG9TdHJpbmcoKGlzVmlkZW8scmVjaGFuZ2UscGxheVVybCxtYXhfY291bnQsUENfVUEsaXNCYWRWaWRlbyk9PntcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YoZmJhKT09J3VuZGVmaW5lZCd8fCFmYmEpe1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZiYSA9IGZ5X2JyaWRnZV9hcHA7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZXF1ZXN0KT09J3VuZGVmaW5lZCd8fCFyZXF1ZXN0KXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJfeDVqeFVybFxcXCIscGxheVVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5jb3VudCA9PSBudWxsKXtcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudD0xO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT09MSl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50Oicrd2luZG93LmNvdW50KycsbWF4X2NvdW50OicrbWF4X2NvdW50KTtcXG4gICAgICAgICAgICAgICAgaWYoIHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6LaF6L+HXFxcIittYXhfY291bnQqMjUwK1xcXCLmr6vnp5LmnKrojrflj5bliLDotYTmupDlnLDlnYDvvIzot7PliLDmupDnvZHpobUs5Lul5LiL5piv5Yqg6L296L+H55qE5Zyw5Z2AXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyh0ZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkoX2dldFVybHMoKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSwgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJlbWJlZFxcXCIpLCB2MyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcIiNwbGF5ZXJcXFwiKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2aWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKEpTT04uc3RyaW5naWZ5KHVybHMpKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy98aW5kZXhcXFxcLm0zdTgkXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXC8xXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1LHJlY2hhbmdlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFVybCk9PSdzdHJpbmcnJiYhaXNCYWRWaWRlbyh1KSl7Ly/ov4fmu6TlkIrmr5vop4bpopFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9meV9icmlkZ2VfYXBwLnNldFdlYlVhKFBDX1VBKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYS5nZXRIZWFkZXJVcmwpIT09J3VuZGVmaW5lZCcmJnR5cGVvZihyZWNoYW5nZSkhPT0nZnVuY3Rpb24nKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1LnJlcGxhY2UoXFxcIjt7XFxcIixcXFwiI2lzVmlkZW89dHJ1ZSM7e1xcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1cmxzW2ldKS5yZXBsYWNlKCc7eycsJyNpZ25vcmVJbWc9dHJ1ZSMjaXNWaWRlbz10cnVlIzt7Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTEgPSBiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSAnI2lnbm9yZUltZycrYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBcXFwiaHR0cFxcXCIrdTEuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja1VybCA9IHUxICsgdTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCfov5Tlm57oh6rliqjliqBjb29raWXpk77mjqU6JytiYWNrVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coJ+i/lOWbnumTvuaOpTonK3UrJ+W5tuiHquWKqOWKoOS6hmNvb2tpZSzlhbfkvZNjb29raWXlnKjop4bpopHmkq3mlL7lpITmn6XnnIsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrVXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLov5Tlm57ku5PlupN4NeWFjeWXhee7k+aenDpcXFwiK3JlYWxVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZ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gIHZhciBmYmEgPSBmeV9icmlkZ2VfYXBwO1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIChyZXF1ZXN0KSA9PSAndW5kZWZpbmVkJyB8fCAhcmVxdWVzdCkge1xcbiAgICAgICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxuICAgICAgICB9XFxuICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBpZiAod2luZG93LmNvdW50ID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50ID0gMTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHRleHQ9Jyc7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09MSl7XFxuICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6JyArIHdpbmRvdy5jb3VudCArICcsbWF4X2NvdW50OicgKyBtYXhfY291bnQpO1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KSB7XFxuICAgICAgICAgICAgICAgIGZiYS5jbGVhclZhcigneDVMaXN0Jyk7XFxuICAgICAgICAgICAgICAgIGZiYS5oaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICBsZXQgZm1zZyA9ICfpgZPplb/ku5PlupPpgJrlhY3op6PmnpDlpLHotKUs5Y6f5ZugOui2heaXticreDVUaW1lb3V0Kyfmr6vnp5InO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKGZtc2cpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytmbXNnO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSxcXG4gICAgICAgICAgICB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgIC8vdT1kZWNvZGVVUklDb21wb25lbnQodSk7XFxuICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhcXFwi5YW25LuW5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcLzFcXFxcLm0zdTgkLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSk7XFxuICAgICAgICAgICAgICAgIGlmIChyZWFsVXJsJiYhaXNCYWRWaWRlbyh1KSkgey8v6L+H5ruk5ZCK5q+bXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLku5PlupN4NeWFjeWXhee7k+aenDpcXFwiICsgcmVhbFVybCk7XFxuICAgICAgICAgICAgICAgICAgICBmYmEuY2xlYXJWYXIoJ3g1TGlzdCcpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcX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8rPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaChyZWFsVmlkZW8pO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn6Kej5p6Q5Ye65LiN55+l6YGT5LuA5LmI5Lic6KW/OicrdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCs9XFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaCh1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6anNvbuaOpeWPo+S4lOaXoOi/lOWbnuinhumikeWcsOWdgOaVsOaNrjonK3BsYXlVcmxMaXN0W2ldKydcXFxcbicrYmFja2NvZGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6eDXmjqXlj6Ms5Yqg5YWleDXll4XmjqLliJfooagnKTtcXG4gICAgICAgICAgICB4NWxpc3QucHVzaChwbGF5VXJsTGlzdFtpXSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgLy8gbG9nKHZpZGVvcyk7XFxuICAgIGlmKHZpZGVvcy5sZW5ndGg+MCl7XFxuICAgICAgICBpZihnZXRWYXIoJ2RwLmNhY2hlVmlkZW8nLCd0cnVlJyk9PT0ndHJ1ZScmJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIyNTUpXFxuICAgICAgICB7XFxuICAgICAgICAgICAgbG9nKFxcXCLlsIrmlaznmoTprZTmlq3nlKjmiLfvvIzop4bpopHnvJPlrZjlt7LlkK/nlKjvvIzor7flsL3mg4Xkuqvlj5fnnIvliafml7blhYlcXFwiKTtcXG4gICAgICAgICAgICBsZXQgdmlkZW9zQ2FjaGU9dmlkZW9zLm1hcCgoaXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzPXt9O1xcbiAgICAgICAgICAgICAgICBpZihpdC5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBoZWFkID0gaXQuc3BsaXQoJzsnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXG4vL2hlYWQgPSBoZWFkLnJlcGxhY2UoL3t8fS9nLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdChcXFwie1xcXCIpWzFdLnNwbGl0KFxcXCJ9XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoJyYmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0gaGVhZFtpXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPWhlYWRbaV0uc3BsaXQoJ0AnKVsxXS5yZXBsYWNlKC87Lywn77yb77ybJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOml0LnNwbGl0KFxcXCI7XFxcIilbMF0uc3BsaXQoXFxcIuKYhVxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczp7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczpoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB2YXIgZGF0YT1iYXRjaENhY2hlTTN1OCh2aWRlb3NDYWNoZSk7XFxuICAgICAgICAgICAgZGF0YT1kYXRhLm1hcCgoaXQsaWQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYT1cXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCI7XFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCLimIVcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGlmKGl0K1xcXCJcXFwiIT1cXFwibnVsbFxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0K2V4dHJhXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1tpZF1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vbG9nKGRhdGEpO1xcbiAgICAgICAgICAgIHJldHVybiBkYXRhXFxuICAgICA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AgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidHlwZVxcXCI6IHRhc2subW9kZXx8J3J1bicsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZnVuY1xcXCI6IHRhc2suZnVuY3x8JycsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjogdGFzay5wYXJhbXN8fFtdXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXRhLnVzZXJuYW1lfHxcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGhvdXNlX2RhdGEucGFzc3dvcmR8fFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgIH0pO1xcbiAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG59XFxuXFxuZnVuY3Rpb24gdGFza191cGxvYWQodGFzayl7IC8vIOmAmueUqOS7u+WKoeWPkeW4g+aWsOWinuWPiuS/ruaUueWKn+iDvVxcbiAgICBjb25zdCB7YXBpLGdldEZpbGV9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5P3J1bGU96YGT6ZW/5LuT5bqTUHJvXFxcIik7XFxuICAgIGxldCBob3VzZUZpbGUgPSBnZXRGaWxlfHxmYWxzZTtcXG4gICAgaWYoIWhvdXNlRmlsZSl7XFxuICAgICAgICBzZXRJdGVtKCdpc19ob3VzZV92aXAnLCAnZmFsc2UnKTtcXG4gICAgfVxcbiAgICBsZXQgYXBpX3VybCA9IGFwaS5ob3N0KycvaGlrZXJ1bGUvdGFzay9hZGQnO1xcbiAgICBsZXQgaG91c2VfZGF0YSA9IGhvdXNlRmlsZSgpO1xcbiAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChhcGlfdXJsLCB7XFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgfSxcXG4gICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiZGF0YVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogdGFzay5uYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInB5Y29kZVxcXCI6IHRhc2sucHljb2RlLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5vdGVcXFwiOiB0YXNrLm5vdGUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidGVzdF9jb2RlXFxcIjogdGFzay50ZXN0X2NvZGUsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXRhLnVzZXJuYW1lfHxcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGhvdXNlX2RhdGEucGFzc3dvcmR8fFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgIH0pO1xcbiAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG59XFxuXFxuZnVuY3Rpb24gdGFza19jYWxsKGlkLGZ1bmMscGFyYW1zKXtcXG4gICAgY29uc3Qge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kKd+XFxcIixcXG4gICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcignZGV2SW5mbycsICcnKXx8XFxcIlxcXCIsXFxuICAgICAgICB0eXBlOiBcXFwidGV4dGFyZWFcXFwiLFxcbiAgICAgICAgaGVpZ2h0Oi0xLFxcbiAgICAgICAgb25DaGFuZ2U6ICdwdXRNeVZhcihcXFwiZGV2SW5mb1xcXCIsaW5wdXQpJ1xcbiAgICB9XFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6XFxcIuS/neWtmOWFrOWRilxcXCIsXFxuICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxuICAgIHVybDokKCfnoa7orqTkv53lrZjlhazlkYrlkJfvvJ/lsIbkvJrkuI7pgZPplb/ku5PlupPmnI3liqHlmajpgJrorq8nKS5jb25maXJtKCgpPT57XFxuICAgICAgICBsZXQgZGV2X3NldF9pbmZvID0gZ2V0TXlWYXIoXFxcImRldl9zZXRfaW5mb1xcXCIpLnNwbGl0KCckJCcpO1xcbiAgICAgICAgbGV0IGlucHV0X3RleHQgPSBnZXRNeVZhcignZGV2SW5mbycsICcnKTtcXG4gICAgICAgIGlmKGlucHV0X3RleHQubGVuZ3RoID49IDQpe1xcbiAgICAgICAgICAgIGxldCBpbmZvX3NldF91cmw9IGRldl9zZXRfaW5mb1syXTtcXG4gICAgICAgICAgICBsZXQgc2VuZF9kYXRhID0ge1xcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAge1xcXCJkYXRhXFxcIjoge1xcXCJpbmZvXFxcIjogaW5wdXRfdGV4dH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBkZXZfc2V0X2luZm9bMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZGV2X3NldF9pbmZvWzFdfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgLy8gbG9nKHNlbmRfZGF0YSk7XFxuICAgICAgICAgICAgbGV0IHBhcjIgPSB7aGVhZGVyczp7J2NvbnRlbnQtdHlwZSc6J2FwcGxpY2F0aW9uL2pzb247Y2hhcnNldD1VVEYtOCcsJ1VzZXItQWdlbnQnOmRldl9zZXRfaW5mb1szXX0sYm9keTpKU09OLnN0cmluZ2lmeShzZW5kX2RhdGEpLG1ldGhvZDonUE9TVCd9O1xcbiAgICAgICAgICAgIC8vIHBhcjIgPSBKU09OLnN0cmluZ2lmeShwYXIyKTsgLy94NemHjOmdouivt+axguaJjemcgOimgee8lueggVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX3JldCA9IHJlcXVlc3QoaW5mb19zZXRfdXJsLCBwYXIyKTtcXG4gICAgICAgICAgICAgICAgYmFja19yZXQgPSBKU09OLnBhcnNlKGJhY2tfcmV0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfcmV0LnN0YXR1cz09PTApe1xcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjmiJDlip9cXFxcbicrYmFja19yZXQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjlpLHotKVcXFxcbicrYmFja19yZXQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor69cXFxcbicrZS5tZXNzYWdlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIG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AgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChjYW5fdXBsb2FkX2FwaSwge1xcXFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogTU9CSUxFX1VBfSxcXFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwicGFyYW1zXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ1c2VybmFtZVxcXFxcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXNzd29yZFxcXFxcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjYW5fdXBsb2FkXFxcXFxcXCI6ICEhZmxhZ1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcXFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG4gICAgZGF0YS5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6J/CfmqvnpoHmraLkuIrkvKAnLFxcXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgIHVybDokKCfnpoHmraLor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55qE5pON5L2c5bCG6KKr57O757uf6K6w5b2VJykuY29uZmlybSgoaWQsY2FuX3VwbG9hZF9hcGksc2V0VXBsb2FkKT0+e1xcXFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldFVwbG9hZChmYWxzZSxjYW5fdXBsb2FkX2FwaSk7XFxcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXFxcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJywn5ZCmJyk7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxcXG4gICAgICAgIH0saWQsY2FuX3VwbG9hZF9hcGksc2V0VXBsb2FkKVxcXFxuICAgIH0pO1xcXFxuICAgIGRhdGEucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOifinIXlhYHorrjkuIrkvKAnLFxcXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgIHVybDokKCflhYHorrjor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55qE5pON5L2c5bCG6KKr57O757uf6K6w5b2VJykuY29uZmlybSgoaWQsY2FuX3VwbG9hZF9hcGksc2V0VXBsb2FkKT0+e1xcXFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldFVwbG9hZCh0cnVlLGNhbl91cGxvYWRfYXBpK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FxcXFxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImlzX3NhZmVcXFxcXFxcIjogISFmbGFnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBmdW5jdGlvbiBzZXRJc0dvb2QoZmxhZyxtYW5fcnVsZV9nb29kKSB7XFxcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9nb29kLCB7XFxcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBNT0JJTEVfVUF9LFxcXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInVzZXJuYW1lXFxcXFxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImlzX2dvb2RcXFxcXFxcIjogISFmbGFnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICBkYXRhLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTon8J+aq+mjjumZqScsXFxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumjjumZqT/po47pmanop4TliJnml6Dms5Xooqvlr7zlhaUnKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2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dnuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXFxcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc0dvb2QoZmFsc2UsbWFuX3J1bGVfZ29vZCk7XFxcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXRcXFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9nb29kLHNldElzR29vZClcXFxcbiAgICB9KTtcXFxcbiAgICBkYXRhLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTon8J+SluS8mOi0qCcsXFxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXFxcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc0dvb2QodHJ1ZSxtYW5fcnVsZV9nb29kKTtcXFxcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcXFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX2dvb2Qsc2V0SXNHb29kKVxcXFxuICAgIH0pO1xcXFxufVxcXFxuXFxcXG5kYXRhLnB1c2goe1xcXFxuICAgIGNvbF90eXBlOiBcXFxcXFxcImxpbmVfYmxhbmtcXFxcXFxcIlxcXFxufSk7XFxcXG5kYXRhLnB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ICAgaWYgKFt1c2VybmFtZSwgcGFzc3dvcmQsIG5hbWVdLmluY2x1ZGVzKFxcXFxcXFwiXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+i0puWPtyzlr4bnoIHlkozmmLXnp7DkuI3og73kuLrnqbpcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBzaG93TG9hZGluZyhcXFxcXFxcIuato+WcqOaPkOS6pOeUs+ivt+ihqFxcXFxcXFwiKTtcXFxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXFxcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXFxcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgIFxcXFxcXFwicGFyYW1zXFxcXFxcXCI6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWFzb25cXFxcXFxcIjogZGVzY3JpcHRpb24sXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IHBhc3N3b3JkLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInFxXFxcXFxcXCI6IHVzZXJuYW1lXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICBtZXRob2Q6ICdwb3N0J1xcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXFxcbiAgICAgICAgaGlkZUxvYWRpbmcoKTtcXFxcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8vXFxcXFxcXCIgKyByZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBpZHJlc3VsdCA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRJZCArIFxcXFxcXFwiP3FxPVxcXFxcXFwiICsgdXNlcm5hbWUpKTtcXFxcbiAgICAgICAgaWYgKGlkcmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9cXFxcXFxcIiArIGlkcmVzdWx0LmRldGFpbDtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBcXFxcbiAgICAgICAgcmV0dXJuICQoXFxcXFxcXCJcXFxcXFxcIiwgXFxcXFxcXCLovpPlhaXpgq7nrrHpqozor4HnoIFcXFxcXFxcXG5cXFxcXFxcIiArIHJlc3VsdC5kZXRhaWwpLmlucHV0KChjb25maXJtLCBpZCwgYWNjb3VudCkgPT4ge1xcXFxuICAgICAgICAgICAgc2hvd0xvYWRpbmcoXFxcXFxcXCLor7fogJDlv4PnrYnlvoVcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGNvbmZpcm0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcXFxuICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhcmFtc1xcXFxcXFwiOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJyZWdpc3RfaWRcXFxcXFxcIjogaWQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJ5em1cXFxcXFxcIjogaW5wdXRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXFxcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL1xcXFxcXFwiICsgcmVzdWx0LmRldGFpbDtcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcXFxcXCJXYXJlaG91c2VVc2VybmFtZVxcXFxcXFwiLCBhY2NvdW50WzBdKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXFxcXFwiV2FyZWhvdXNlUGFzc3dvcmRcXFxcXFxcIiwgYWNjb3VudFsxXSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/miJDlip/mj5DkuqTms6jlhozms6jlhoxcXFxcXFxcXG5cXFxcXFxcIityZXN1bHQuZGV0YWlsO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcb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ixcXFxcbiAgICBjb2xfdHlwZTogJ2lucHV0JyxcXFxcbiAgICBkZXNjOiBcXFxcXFxcIuivt+i+k+WFpXFxXFxcXFxcXCIsXFxcXG4gICAgdXJsOiAkLnRvU3RyaW5nKChhLCBiKSA9PiB7XFxcXG4gICAgICAgIGxldCBxcSA9IGlucHV0O1xcXFxuICAgICAgICBpZiAocXEgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHloavllYohXFxcXFxcXCI7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgc2hvd0xvYWRpbmcoXFxcXFxcXCLojrflj5bkuK0uLi5cXFxcXFxcIilcXFxcbiAgICAgICAgcmV0dXJuICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgocXEsIGEsIGIpID0+IHtcXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGEsIHtcXFxcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXFxcbiAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJxcVxcXFxcXFwiOiBxcVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShy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2FyZWhvdXNlLm0ucXEnLCAnJyk7XFxcXG4gICAgICAgIGxldCB5em0gPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnl6bScsICcnKTtcXFxcbiAgICAgICAgaWYgKHFxID09IFxcXFxcXFwiXFxcXFxcXCIgfHwgeXptID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8vcXHmiJbpqozor4HnoIHkuLrnqbpcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChsb2dpbiwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInFxXFxcXFxcXCI6IHFxLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImF1dGhfY29kZVxcXFxcXFwiOiB5em1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxcXG4gICAgICAgIH0pO1xcXFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcXFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcXFxuICAgICAgICAgICAgZi51c2VyID0gW3FxLCB5em1dO1xcXFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXFxcXFwiaGlrZXI6Ly9maWxlcy9XYXJlaG91c2VVU0VSLmpzb25cXFxcXFxcIiwgSlNPTi5zdHJpb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ICAgIHVybDogJChhcGkuZGlzX3JlcGx5ICsgcnVsZUlkKS5sYXp5UnVsZSgocGFzc3dvcmQsIHVzZXJuYW1lLCBydWxlSWQpID0+IHtcXFxcbiAgICAgICAgbGV0IHRleHQgPSBnZXRWYXIoJ1dhcmVob3VzZS5jb21tZW50LnRleHQnLCAnJyk7XFxcXG4gICAgICAgIGlmIChwYXNzd29yZCA9PSBcXFxcXFxcIlxcXFxcXFwiIHx8IHVzZXJuYW1lID09IFxcXFxcXFwiXFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5pyq55m75b2V6LSm5Y+3XFxcXFxcXCI7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgaWYgKHRleHQgPT0gXFxcXFxcXCJcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHlhpnllYpcXFxcXFxcIjtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcXFxuICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgXFxcXFxcXCJwYXJhbXNcXFxcXFxcIjoge1xcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImRpc2N1c3NfdGV4dFxcXFxcXFwiOiB0ZXh0LFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInFxXFxcXFxcXCI6IHVzZXJuYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IHBhc3N3b3JkLFxcXFxuICAgICAgICAgICAgICAg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X3VybF9hcnJbMl0udG9VcHBlckNhc2UoKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7aGVhZGVyczpoZWFkZXJzLHdpdGhIZWFkZXJzOmZhbHNlLHJlZGlyZWN0OmZhbHNlfTtcXFxcbiAgICAgICAgICAgIGlmKHdlYl91cmxfYXJyLmxlbmd0aD49MiYmd2ViX3VybF9hcnJbMV0ubGVuZ3RoPjIpeyAvLyDorr7nva7or7fmsYLmlrnms5VcXFxcbiAgICAgICAgICAgICAgICBwYXJhbXNbJ21ldGhvZCddID0gd2ViX3VybF9hcnJbMV0udG9VcHBlckNhc2UoKTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxvZygn5byA5aeL6I635Y+W5rqQ56CBJyk7XFxcXG4gICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgIC8qXFxcXG4gICAgICAgICAgICAgICAgcmVxdWVzdEFzeW5jKHdlYl91cmwscGFyYW1zLGZ1bmN0aW9uIChrZXksY29kZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gY29kZTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXFxcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAqL1xcXFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBnZXRJdGVtKCdob3VzZS5maWxlX3VhJyk9PT0n55S16ISRJz9mZXRjaCh3ZWJfdXJsLHBhcmFtcyk6cmVxdWVzdCh3ZWJfdXJsLHBhcmFtcyk7XFxcXG4gICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXFxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lj5HnlJ/kuobplJnor686XFxcXFxcXFxuJytlLm1lc3NhZ2U7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1lbHNlIGlmKC/kuLvpopjvv6V85YWD57Sg77+lLy50ZXN0KGlucHV0KSl7XFxcXG4gICAgICAgICAgICBsb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ntcXFxcbiAgICAgICAgLypcXFxcbiAgICAgICAgbGV0IGZwID0gJ2h0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfMzIzOTQzNTEvZHIvLS9yYXcvbWFzdGVyL2pzL2ZpbGVTZWxlY3QuanMnO1xcXFxuICAgICAgICBsZXQgZiA9IHJlcXVpcmUoZnApO1xcXFxuICAgICAgICAqL1xcXFxuICAgICAgICBsZXQgZnA9Y29uZmlnLmxpYi5maWxlU2VsZWN0O1xcXFxuICAgICAgICBsZXQgZj0kLnJjKGZwKTtcXFxcbiAgICAgICAgcmV0dXJuIGYuZmlsZVNlbGVjdGlvblVyaSh7XFxcXG4gICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGZpbmRJdGVtKFxcXFxcXFwiZmlsZVBhdGhcXFxcXFxcIikuZXh0cmE7XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShcXFxcXFxcImZpbGVQYXRoXFxcXFxcXCIsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IE9iamVjdC5hc3NpZ24odGFyZ2V0LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLndlYl91cmwnLFBBVEgpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcXFxuICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICBvbkNsaWNrVHlwZTonY29uZmlybScsXFxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcXFxcXCIuanN8LnR4dHwuaGlrZXJ8Lmpzb258Lmh0bWxcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHBhdHRlcm46IDAsXFxcXG4gICAgICAgICA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7XFxcXG4gICAgICAgICAgICBmaWxlTmFtZSA9IHdlYl91cmwuc3BsaXQoJy8nKVt3ZWJfdXJsLnNwbGl0KCcvJykubGVuZ3RoLTFdO1xcXFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcXFxuICAgICAgICAgICAgbGV0IGJrYXJyID0gdXBfY29kZS5zcGxpdCgn77+lJyk7XFxcXG4gICAgICAgICAgICBpZihia2Fyci5sZW5ndGg8Myl7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S6keWJqui0tOadv+WGheWuueacieivrydcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIHN3aXRjaCAoYmthcnJbMV0pIHtcXFxcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3RoZW1lJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfc2luZ2xlJzpcXFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfjgIwnKVsxXS5zcGxpdCgn44CNJylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgIGNhc2UgJ2pzX3VybCc6XFxcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn77+lJylbMl0uc3BsaXQoJ0AnKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOe9kemhtemTvuaOp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ICAgICAgIGlmKGlzUGljKF9waWMpJiYhL0BSZWZlcmVyPS8udGVzdChfcGljKSl7XFxcXG4gICAgICAgICAgICAgICAgX3BpYys9J0BSZWZlcmVyPSdcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCBpdD17XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6cGRmaChsaXN0W2ldLHRbMV0pLFxcXFxuICAgICAgICAgICAgICAgIHBpY191cmw6X3BpYyxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOnBkZmgobGlzdFtpXSx0WzNdKSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ZWo/cGQobGlzdFtpXSx0WzRdKTpwZChsaXN0W2ldLHRbNF0pK2xhenlcXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICBpZih0Lmxlbmd0aD41KXsvL+WGheWuue+8jOeUqOS6juaQnOe0olxcXFxuICAgICAgICAgICAgICAgIGl0LmNvbnRlbnQ9cGRmaChsaXN0W2ldLHRbNV0pXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBkLnB1c2goaXQpO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmKG9ubHliYWNrKXtcXFxcbiAgICAgICAgICAgIHJldHVybiBkXFxcXG4gICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxcXG4gICAgICAgIH1cXFxcbiAgICB9LHBhclN0cixlaixvbmx5YmFjayxodG1sLGlzUGljKVxcXFxufVxcXFxuXFxcXG5mdW5jdGlvbiBpc0JhZFZpZGVvKHZpZGVvVXJsKSB7Ly/mmK/lnY/nmoTop4bpopFcXFxcbiAgICBsZXQgZG1QYXRoID0gJ2hpa2VyOi8vZmlsZXMvY2FjaGUvZGlhb21hby50eHQnOy8v5ZCK5q+b5qih5byP6L+H5ruk5paH5Lu26Lev5b6EXFxcXG4gICAgbGV0IGRtVXJscztcXFxcbiAgICB0cnkge1xcXFxuICAgICAg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ICAgICAgICBsZXQgbG9jYWxfbXMgPSBsc2cuZ2V0SXRlbSgndGltZW91dCcpO1xcXFxuICAgICAgICBsZXQgbXMgPSBwYXJzZUludChtcyl8fHBhcnNlSW50KGxvY2FsX21zKXx8NTAwMDtcXFxcbiAgICAgICAgbGV0IG1heF9jb3VudD1NYXRoLmNlaWwobXMvMjUwKTtcXFxcbiAgICAgICAgbG9nKFxcXFxcXFwi5pys5qyh5ZeF5o6i6LaF5pe2OlxcXFxcXFwiK21zK1xcXFxcXFwi5YWx6K6h5b6F5oqT5YyFOlxcXFxcXFwiK21heF9jb3VudCtcXFxcXFxcIuasoVxcXFxcXFwiKTtcXFxcbiAgICAgICAgc2hvd0xvYWRpbmcoJ+WXheaOouS4re+8jOiLpeWksei0peWwseWIh+aNondlYuWXheaOoi4uLicpO1xcXFxuICAgICAgICBsZXQgX3g1ID0gJC50b1N0cmluZygoaXNWaWRlbyxyZWNoYW5nZSxwbGF5VXJsLG1heF9jb3VudCxQQ19VQSxpc0JhZFZpZGVvKT0+e1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YoZmJhKT09J3VuZGVmaW5lZCd8fCFmYmEpe1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZmJhID0gZnlfYnJpZGdlX2FwcDtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlcXVlc3QpPT0ndW5kZWZpbmVkJ3x8IXJlcXVlc3Qpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmYmEuZ2V0SW50ZXJuYWxKcygpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGZiYS5wdXRWYXIoXFxcXFxcXCJfeDVqeFVybFxcXFxcXFwiLHBsYXlVcmwpO1xcXFxuICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5jb3VudCA9PSBudWxsKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNvdW50PTE7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFxcXFxcImJvZHlcXFxcXFxcIikuaW5uZXJUZXh0O1xcXFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXFxcbiAgICAgICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09PTEpe1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2xvY2F0aW9uLnJlbG9hZCgpO1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWZiYS5nZXRWYXIoXFxcXFxcXCJfeDVqeFVybFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6Jyt3aW5kb3cuY291bnQrJyxtYXhfY291bnQ6JyttYXhfY291bnQpO1xcXFxuICAgICAgICAgICAgICAgIGlmKCB3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KXtcXFxcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcIui2hei/h1xcXFxcXFwiK21heF9jb3VudCoyNTArXFxcXFxcXCLmr6vnp5LmnKrojrflj5bliLDotYTmupDlnLDlnYDvvIzot7PliLDmupDnvZHpobUs5Lul5LiL5piv5Yqg6L296L+H55qE5Zyw5Z2AXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFxcXFxcImJvZHlcXFxcXFxcIikuaW5uZXJUZXh0O1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyh0ZXh0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKEpTT04uc3RyaW5naWZ5KF9nZXRVcmxzKCkpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZiYS5nZXRWYXIoXFxcXFxcXCJfeDVqeFVybFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucGF1c2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXFxcXFwidmlkZW9cXFxcXFxcIiksIGF1ZGlvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcXFxcXCJhdWRpb1xcXFxcXFwiKSwgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXFxcXFwiZW1iZWRcXFxcXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFxcXFxcIiNwbGF5ZXJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHZpZGVvcywgZnVuY3Rpb24gKHZpZGVvKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjIsIGZ1bmN0aW9uICh2KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuICAgICAgICAgICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXFxcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKEpTT04uc3RyaW5naWZ5KHVybHMpKTtcXFxcbiAgICAgICAgICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gdXJscykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXFxcXFwidXJsPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFxcXFxcInVybOWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXFxcXFwvLy50ZXN0KHUpJiYvXFxcXFxcXFwubTN1OC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXFxcXFwvXFxcXFxcXFwvKC4qPylcXFxcXFxcXC8vKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXFxcXFwidXJsPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFxcXFxcInVybOWIhuWJsjpcXFxcXFxcIit1KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFxcXFxcInZpZD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCJ2aWTliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFxcXFxcLy8udGVzdCh1KSYmL1xcXFxcXFxcLm0zdTgvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFxcXFxcL1xcXFxcXFxcLyguKj8pXFxcXFxcXFwvLylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFxcXFxcInZpZD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCJ2aWTliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcXFxcXD8oLiopPWh0dHAvLnRlc3QodSkmJi9cXFxcXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJodHRwXFxcXFxcXCIrdS5zcGxpdCgvXFxcXFxcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcXFxcXCLlhbbku5bliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3xpbmRleFxcXFxcXFxcLm0zdTgkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcXFxcXC8xXFxcXFxcXFwubTN1OC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1LHJlY2hhbmdlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVXJsKT09J3N0cmluZycmJiFpc0JhZFZpZGVvKHUpKXsvL+i/h+a7pOWQiuavm+inhumikVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnlfYnJpZGdlX2FwcC5zZXRXZWJVYShQQ19VQSk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYS5nZXRIZWFkZXJVcmwpIT09J3VuZGVmaW5lZCcmJnR5cGVvZihyZWNoYW5nZSkhPT0nZnVuY3Rpb24nKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHUucmVwbGFjZShcXFxcXFxcIjt7XFxcXFxcXCIsXFxcXFxcXCIjaXNWaWRlbz10cnVlIzt7XFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tVcmwgPSBmYmEuZ2V0SGVhZGVyVXJsKHVybHNbaV0pLnJlcGxhY2UoJzt7JywnI2lnbm9yZUltZz10cnVlIyNpc1ZpZGVvPXRydWUjO3snKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUxID0gYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSAnI2lnbm9yZUltZycrYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1MSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFxcXFxcInVybD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFxcXFxcLy8udGVzdCh1MSkmJi9cXFxcXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdDEgPSB1MS5tYXRjaCgvKC4qKVxcXFxcXFxcL1xcXFxcXFxcLyguKj8pXFxcXFxcXFwvLylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXFxcXFwidXJsPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXFxcXFwidXJs5YiG5YmyOlxcXFxcXFwiK3UpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUxKSl7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXFxcXFwidmlkPVxcXFxcXFwiKS5zbGljZSgtMSlbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXFxcXFwvLy50ZXN0KHUxKSYmL1xcXFxcXFxcLm0zdTgvLnRlc3QodTEpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXFxcXFwvXFxcXFxcXFwvKC4qPylcXFxcXFxcXC8vKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcXFxcXCJ2aWQ9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcXFxcXD8oLiopPWh0dHAvLnRlc3QodTEpJiYvXFxcXFxcXFwubTN1OC8udGVzdCh1MSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBcXFxcXFxcImh0dHBcXFxcXFxcIit1MS5zcGxpdCgvXFxcXFxcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tVcmwgPSB1MSArIHUyO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCfov5Tlm57oh6rliqjliqBjb29raWXpk77mjqU6JytiYWNrVXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZygn6L+U5Zue6ZO+5o6lOicrdSsn5bm26Ieq5Yqo5Yqg5LqGY29va2llLOWFt+S9k2Nvb2tpZeWcqOinhumikeaSreaUvuWkhOafpeeciycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFja1VybDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFxcXFxcIui/lOWbnuS7k+W6k3g15YWN5ZeF57uT5p6cOlxcXFxcXFwiK3JlYWxVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbFVybFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAvLyBmeV9icmlkZ2VfYXBwLmxvZygneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcXFxuICAgICAgICAgICAgICAgIGFsZXJ0KCd4NeWkp+iMg+WbtOmUmeivrzonK2UubWVzc2FnZSk7XFxcXG4gICAgICA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2VfYXBwO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBpZiAodHlwZW9mIChyZXF1ZXN0KSA9PSAndW5kZWZpbmVkJyB8fCAhcmVxdWVzdCkge1xcXFxuICAgICAgICAgICAgICAgIGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICAvLy0tLS0tLS0tLS0tLS0tLS0tLVxcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgaWYgKHdpbmRvdy5jb3VudCA9PSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50ID0gMTtcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcXFxcXCJib2R5XFxcXFxcXCIpLmlubmVyVGV4dDtcXFxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXFxcbiAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT0xKXtcXFxcbiAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcXFxcbiAgICAgICAgICAgICAgICBmYmEubG9nKFxcXFxcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxcXG4gICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonICsgd2luZG93LmNvdW50ICsgJyxtYXhfY291bnQ6JyArIG1heF9jb3VudCk7XFxcXG4gICAgICAgICAgICBpZiAod2luZG93LmNvdW50ID49IG1heF9jb3VudCkge1xcXFxuICAgICAgICAgICAgICAgIGZiYS5jbGVhclZhcigneDVMaXN0Jyk7XFxcXG4gICAgICAgICAgICAgICAgZmJhLmhpZGVMb2FkaW5nKCk7XFxcXG4gICAgICAgICAgICAgICAgbGV0IGZtc2cgPSAn6YGT6ZW/5LuT5bqT6YCa5YWN6Kej5p6Q5aSx6LSlLOWOn+WboDrotoXml7YnK3g1VGltZW91dCsn5q+r56eSJztcXFxcbiAgICAgICAgICAgICAgICBmYmEubG9nKGZtc2cpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK2Ztc2c7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1jYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcXFxuICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgdmFyIHZpZGVvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcXFxcXCJ2aWRlb1xcXFxcXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFxcXFxcImF1ZGlvXFxcXFxcXCIpLFxcXFxuICAgICAgICAgICAgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXFxcXFwiZW1iZWRcXFxcXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFxcXFxcIiNwbGF5ZXJcXFxcXFxcIik7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXFxcbiAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXFxcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHVybHMpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcXFxuICAgICAgICAgICAgICAgIC8vdT1kZWNvZGVVUklDb21wb25lbnQodSk7XFxcXG4gICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcXFxcXCJ1cmw9XFxcXFxcXCIpLnNsaWNlKC0xKVswXTtcXFxcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFxcXFxcInZpZD1cXFxcXFxcIikuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcXFxcXD8oLiopPWh0dHAvLnRlc3QodSkpe1xcXFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcXFxcXCJodHRwXFxcXFxcXCIrdS5zcGxpdCgvXFxcXFxcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcXFxuICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coXFxcXFxcXCLlhbbku5bliIblibI6XFxcXFxcXCIrdSk7XFxcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFxcXFxcLzFcXFxcXFxcXC5tM3U4JC8udGVzdCh1KSl7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVml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WUrXFxcXFxcXCIubTN1OFxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgLy93cml0ZUZpbGUobGNhY2hlLGJhY2tjb2RlKTtcXFxcbiAgICAgICAgICAgIC8vdmlkZW9zLnB1c2gobGNhY2hlKTtcXFxcbiAgICAgICAgICAgIGxldCBwVXJsPWNhY2hlTTN1OCh0dXJsKTtcXFxcbiAgICAgICAgICAgIHZpZGVvcy5wdXNoKHBVcmwpO1xcXFxuICAgICAgICAgICAgY29udGludWU7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIGxldCB1cmwgPSBKU09OLnBhcnNlKGJhY2tjb2RlKS51cmw7XFxcXG4gICAgICAgICAgICBpZigvXmh0dHAvLnRlc3QodXJsKSl7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJlYWxWaWRlbyA9IGlzVmlkZW8odXJsKTtcXFxcbiAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFZpZGVvKT09J3N0cmluZycpe1xcXFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+W3suino+aekOWHuuinhumikTonK3JlYWxWaWRlbyk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlYWxWaWRlbys9XFxcXFxcXCLimIVcXFxcXFxcIitqbmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHZpZGVvcy5wdXNoKHJlYWxWaWRlbyk7XFxcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn6Kej5p6Q5Ye65LiN55+l6YGT5LuA5LmI5Lic6KW/OicrdXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCs9XFxcXFxcXCLimIVcXFxcXFxcIitqbmFtZVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHZpZGVvcy5wdXNoKHVybCk7XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfWVsc2V7XFxcXG4gICAgICAgICAgICAgICAgbG9nKHRuYW1lKyfkuLpqc29u5o6l5Y+j5LiU5peg6L+U5Zue6KeG6aKR5Zyw5Z2A5pWw5o2uOicrcGxheVVybExpc3RbaV0rJ1xcXFxcXFxcbicrYmFja2NvZGUpO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9Y2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6eDXmjqXlj6Ms5Yqg5YWleDXll4XmjqLliJfooagnKTtcXFxcbiAgICAgICAgICAgIHg1bGlzdC5wdXNoKHBsYXlVcmxMaXN0W2ldKTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH1cXFxcbiAgICAvLyBsb2codmlkZW9zKTtcXFxcbiAgICBpZih2aWRlb3MubGVuZ3RoPjApe1xcXFxuICAgICAgICBpZihnZXRWYXIoJ2RwLmNhY2hlVmlkZW8nLCd0cnVlJyk9PT0ndHJ1ZScmJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIyNTUpXFxcXG4gICAgICAgIHtcXFxcbiAgICAgICAgICAgIGxvZyhcXFxcXFxcIuWwiuaVrOeahOmtlOaWreeUqOaIt++8jOinhumikee8k+WtmOW3suWQr+eUqO+8jOivt+WwveaDheS6q+WPl+eci+WJp+aXtuWFiVxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgIGxldCB2aWRlb3NDYWNoZT12aWRlb3MubWFwKChpdCk9PntcXFxcbiAgICAgICAgICAgICAgICBsZXQgaGVhZGVycz17fTtcXFxcbiAgICAgICAgICAgICAgICBpZihpdC5zcGxpdChcXFxcXFxcIjtcXFxcXFxcIikubGVuZ3RoPjEpe1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgaGVhZCA9IGl0LnNwbGl0KCc7JylbMV07XFxcXG4gICAgICAgICAgICAgICAgICAgIGlmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXFxcbi8vaGVhZCA9IGhlYWQucmVwbGFjZSgve3x9L2csJycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoXFxcXFxcXCJ7XFxcXFxcXCIpWzFdLnNwbGl0KFxcXFxcXFwifVxcXFxcXFwiKVswXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFkLnNwbGl0KCcmJicpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBrZXkgPSBoZWFkW2ldLnNwbGl0KCdAJylbMF07XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID1oZWFkW2ldLnNwbGl0KCdAJylbMV0ucmVwbGFjZSgvOy8sJ++8m++8mycpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDppdC5zcGxpdChcXFxcXFxcIjtcXFxcXFxcIilbMF0uc3BsaXQoXFxcXFxcXCLimIVcXFxcXFxcIilbMF0sXFxcXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6e1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczpoZWFkZXJzXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgIHZhciBkYXRhPWJhdGNoQ2FjaGVNM3U4KHZpZGVvc0NhY2hlKTtcXFxcbiAgICAgICAgICAgIGRhdGE9ZGF0YS5tYXAoKGl0LGlkKT0+e1xcXFxuICAgICAgICAgICAgICAgIGxldCBleHRyYT1cXFxcXFxcIlxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcXFxcXCI7XFxcXFxcXCIpLmxlbmd0aD4xKXtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcXFxcXCI7XFxcXFxcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFxcXFxcIjtcXFxcXFxcIilbMV07XFxcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYodmlkZW9zW2lkXS5zcGxpdChcXFxcXFxcIuKYhVxcXFxcXFwiKS5sZW5ndGg+MSl7XFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXFxcXFwi4piFXFxcXFxcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFxcXFxcIuKYhVxcXFxcXFwiKVsxXTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgICAgICBpZihpdCtcXFxcXFxcIlxcXFxcXFwiIT1cXFxcXFxcIm51bGxcXFxcXFxcIil7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdCtleHRyYVxcXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmlkZW9zW2lkXVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgLy9sb2coZGF0YSk7XFxcXG4gICAgICAgICAgICByZXR1cm4gZGF0YV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XG4gICAgICAgICAgICBsZXQgaW5mb19zZXRfdXJsPSBkZXZfc2V0X2luZm9bMl07XFxcXG4gICAgICAgICAgICBsZXQgc2VuZF9kYXRhID0ge1xcXFxcXFwicGFyYW1zXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgIHtcXFxcXFxcImRhdGFcXFxcXFxcIjoge1xcXFxcXFwiaW5mb1xcXFxcXFwiOiBpbnB1dF90ZXh0fSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwibmFtZVxcXFxcXFwiOiBkZXZfc2V0X2luZm9bMF0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcInBhc3N3b3JkXFxcXFxcXCI6IGRldl9zZXRfaW5mb1sxXX1cXFxcbiAgICAgICAgICAgIH07XFxcXG4gICAgICAgICAgICAvLyBsb2coc2VuZF9kYXRhKTtcXFxcbiAgICAgICAgICAgIGxldCBwYXIyID0ge2hlYWRlcnM6eydjb250ZW50LXR5cGUnOidhcHBsaWNhdGlvbi9qc29uO2NoYXJzZXQ9VVRGLTgnLCdVc2VyLUFnZW50JzpkZXZfc2V0X2luZm9bM119LGJvZHk6SlNPTi5zdHJpbmdpZnkoc2VuZF9kYXRhKSxtZXRob2Q6J1BPU1QnfTtcXFxcbiAgICAgICAgICAgIC8vIHBhcjIgPSBKU09OLnN0cmluZ2lmeShwYXIyKTsgLy94NemHjOmdouivt+axguaJjemcgOimgee8lueggVxcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgYmFja19yZXQgPSByZXF1ZXN0KGluZm9fc2V0X3VybCwgcGFyMik7XFxcXG4gICAgICAgICAgICAgICAgYmFja19yZXQgPSBKU09OLnBhcnNlKGJhY2tfcmV0KS5yZXN1bHQ7XFxcXG4gICAgICAgICAgICAgICAgaWYoYmFja19yZXQuc3RhdHVzPT09MCl7XFxcXG4gICAgICAgICAgICAgICAgICAgIC8vIHJlZnJlc2hQYWdl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3pgZPplb/ku5PlupNQcm9cXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgIGxldCBydWxlSGVhZCA9ICfmtbfpmJTop4bnlYzvvIznvZHpobXmj5Lku7bvv6Vqc191cmzvv6UkaGlrZXJAJztcXFxcbiAgICAgICAgICAgICAgbGV0IHVybCA9IGdldEFwaSgnaW1wb3J0VXJsJykrXFxcXFxcXCI1MTExXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgIGxldCBpbXBvcnRVcmwgPSAncnVsZTovLycrYmFzZTY0RW5jb2RlKHJ1bGVIZWFkK3VybCk7XFxcXG4gICAgICAgICAgICAgIHJldHVybiBpbXBvcnRVcmxcXFxcbiAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICBjYW5jZWw6ICQudG9TdHJpbmcoKCk9PntcXFxcbiAgICAgICAgICAgICAgXFxcXG4gICAgICAgICAgfSksXFxcXG4gICAgICB9KVxcXFxuICB9XFxcXG59XFxcIn1dXCIsXCJwcm94eVwiOlwiXCJ9IiwidGl0bGUiOiLlhajpg6jop4TliJkifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement