Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6YGT6ZW/5LuT5bqTUHJvIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTQyLCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuICAgIGNvbnN0IHtcbiAgICAgICAgZ2V0QXBpLFxuICAgICAgICBjb2xvcixcbiAgICAgICAgc21hbGwsXG4gICAgICAgIGdldEZpbGUsXG4gICAgICAgIGh0bWxUYWcsXG4gICAgICAgIGFwaSxcbiAgICAgICAgbWRcbiAgICB9ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVwiKTtcblxuY29uc3QgbHNnPSQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9sb2NhbFN0b3JhZ2U/cnVsZT3pgZPplb/ku5PlupNQcm9cIik7XG5sZXQgY2xhc3NBID0gZ2V0VmFyKFwiV2FyZWhvdXNlLmNsYXNzXCIsIFwiMFwiKTtcbmxldCBsaXN0VXJsID0gZ2V0QXBpKFwidXNlcnNVcmxcIikgKyBjbGFzc0EsXG4gICAgbXlVcmwgPSBnZXRBcGkoXCJkZXZTZWxmXCIpO1xuICAgIC8vIG15VXJsID0gZ2V0QXBpKFwicnVsZXNBbGxVcmxcIik7XG5wdXRWYXIoXCJXYXJlaG91c2UuZmlsdGVyXCIsIFwiXCIpO1xudmFyIG5vV2FpdD10cnV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F0ZS5nZXREYXRlKCk7XFxuICAgICAgICAgICAgbGV0IHN0ckhvdXJzID0gZGF0ZS5nZXRIb3VycygpO1xcbiAgICAgICAgICAgIGxldCBzdHJNaW51dGVzID0gZGF0ZS5nZXRNaW51dGVzKCk7XFxuICAgICAgICAgICAgbGV0IHN0clNlY29uZHMgPSBkYXRlLmdldFNlY29uZHMoKSsxO1xcbiAgICAgICAgICAgIGlmIChtb250aCA+PSAxICYmIG1vbnRoIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgbW9udGggPSBcXFwiMFxcXCIgKyBtb250aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyRGF0ZSA+PSAwICYmIHN0ckRhdGUgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJEYXRlID0gXFxcIjBcXFwiICsgc3RyRGF0ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RySG91cnMgPj0gMCAmJiBzdHJIb3VycyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckhvdXJzID0gXFxcIjBcXFwiICsgc3RySG91cnNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0ck1pbnV0ZXMgPj0gMCAmJiBzdHJNaW51dGVzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyTWludXRlcyA9IFxcXCIwXFxcIiArIHN0ck1pbnV0ZXNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0clNlY29uZHMgPj0gMCAmJiBzdHJTZWNvbmRzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyU2Vjb25kcyA9IFxcXCIwXFxcIiArIHN0clNlY29uZHNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy9sZXQgY3VycmVudGRhdGUgPSBkYXRlLmdldEZ1bGxZZWFyKCkgKyBzZXBlcmF0b3IxICsgbW9udGggKyBzZXBlcmF0b3IxICsgc3RyRGF0ZSArIFxcXC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gIHVybDogJChnZXRBcGkoXFxcInNoYXJlXFxcIikgKyByZXFCeUdldCArIFxcXCImZmxhZ1xcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lorr7kuLrlhazlvIBcXFwiO1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IFxcXCLpmo/mnLrlr4bpkqVcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlLFxcbiAgICAgICAgdXJsOiAkKGdldEFwaShcXFwiZ2VuQXV0aFxcXCIpICsgcmVxQnlHZXQgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGJhY2sgPSByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICBsZXQgcmV0ID0gSlNPTi5wYXJzZShiYWNrKTtcXG4gICAgICAgICAgICBpZiAocmV0LnN0YXR1cyA9PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sueUn+aIkOmaj+acuuWvhueggVxcXFxuXFxcIiArIHJldC5yZXN1bHRcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+maj+acuuWvhueggeeUn+aIkOWksei0pVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9KTtcXG4gICAgbG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ZDogZGF0YUl0ZW0uaWQsXFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgcGFzc3dvcmQ6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICB1c2VybmFtZTogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgIHJlcGx5SWQ6aXRlbS5pZFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGlzY3Vzc190ZXh0LFxcbiAgICAgICAgICAgIGRlc2M6IFJlcGx5K2l0ZW0uY3JlYXRlX2RhdGUgKyBcXFwiwrdcXFwiICsgaWNvbltpdGVtLmRpc2N1c3NfdHlwZV0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9pbmZvXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBuYW1lOiBpdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIHR5cGU6IFxcXCJsb25nX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICB0ZXh0OiBpdGVtLmRpc2N1c3NfdGV4dFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgfVxcbn1cXG5kYXRhLnB1c2goe1xcbiAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxufSk7XFxuc2V0UmVzdWx0KGRhdGEpO1wifSx7XCJjb2xfdHlwZVwiOlwiaWNvbl8yX3JvdW5kXCIsXCJuYW1lXCI6XCLop4TliJnliJfooahcIixcInBhdGhcIjpcInJ1bGVzXCIsXCJydWx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hc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjYW5fdXBsb2FkXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+emgeatouS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn56aB5q2i6K+l5byA5Y+R6ICF5LiK5Lyg6KeE5YiZP+S9oOeahOaTjeS9nOWwhuiiq+ezu+e7n+iusOW9lScpLmNvbmZpcm0oKGlkLGNhbl91cGxvYWRfYXBpLHNldFVwbG9hZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0VXBsb2FkKGZhbHNlLGNhbl91cGxvYWRfYXBpKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdXYXJlaG91c2UuY2FuX3VwbG9hZCcsJ+WQpicpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAg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gY29kZSA9IGZldGNoKG1hbl9ydWxlX3NhZmUsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX3NhZmVcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZnVuY3Rpb24gc2V0SXNHb29kKGZsYWcsbWFuX3J1bGVfZ29vZCkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfZ29vZCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfZ29vZFxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/Cfmqvpo47pmaknLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumjjumZqT/po47pmanop4TliJnml6Dms5Xooqvlr7zlhaUnKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKGZhbHNlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pyF5q2j5bi4JyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrmraPluLg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfc2FmZSxzZXRJc1NhZmUpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzU2FmZSh0cnVlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pml6Z2e5LyY6LSoJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrpnZ7kvJjotKg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzR29vZChmYWxzZSxtYW5fcnVsZV9nb29kKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXRcXG4gICAgICAgIH0sZGF0YUl0ZW0uaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/CfkpbkvJjotKgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNHb29kKHRydWUsbWFuX3J1bGVfZ29vZCk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX2dvb2Qsc2V0SXNHb29kKVxcbiAgICB9KTtcXG59XFxuXFxuZGF0YS5wdXNoKHtcXG4gICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbn0pO1xcbmRhdGEucHVzaCh7XFxuICAgIHRpdGxlOiBkYXRhSXRlbS5nb29kX251bSxcXG4gICAgcGljX3VybDog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AnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJyZWFzb25cXFwiOiBkZXNjcmlwdGlvbixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ3Bvc3QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgaWRyZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0SWQgKyBcXFwiP3FxPVxcXCIgKyB1c2VybmFtZSkpO1xcbiAgICAgICAgaWYgKGlkcmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgaWRyZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpemCrueusemqjOivgeeggVxcXFxuXFxcIiArIHJlc3VsdC5kZXRhaWwpLmlucHV0KChjb25maXJtLCBpZCwgYWNjb3VudCkgPT4ge1xcbiAgICAgICAgICAgIHNob3dMb2FkaW5nKFxcXCLor7fogJDlv4PnrYnlvoVcXFwiKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChjb25maXJtLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVnaXN0X2lkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ5em1cXFwiOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VVc2VybmFtZVxcXCIsIGFjY291bnRbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxc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zdWx0ID0gcmVxdWVzdChpbnB1dCArIFxcXCImbmFtZT1cXFwiICsgZW5jb2RlVVJJQ29tcG9uZW50KG5ld1BldE5hbWUpKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcbn1cXG5cXG5mdW5jdGlvbiBtX2F2YXRhcigpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLor7fovpPlhaXmlrDnmoTlpLTlg4/pk77mjqVcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0VmFyKCdXYXJlaG91c2UubS5hdmF0YXInLCAnJykgfHwgZGV2LmF2YXRhcixcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0uYXZhdGFyXFxcIixpbnB1dCknXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgY29sX3R5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zYzogXFxcIuivt+i+k+WFpeWOn+WvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQueScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0uUGFzc3dvcmQueVxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi5paw5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeaWsOWvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQueCcsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0uUGFzc3dvcmQueFxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOlxcXCLph43lpI3mlrDlr4bnoIFcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36YeN5aSN5paw5a+G56CBXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdHlwZTpcXFwicGFzc3dvcmRcXFwiLFxcbiAgICAg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ICAgICAgICB9XFxuICAgICAgICAgICAgaWYobmV3X3Bhc3N3b3JkIT09bmV3X3Bhc3N3b3JkX2FnYWluKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4pOasoeWvhueggeS4jeWQjFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJm5ld19wYXNzd29yZD1cXFwiICsgbmV3X3Bhc3N3b3JkK1xcXCImbmV3X3Bhc3N3b3JkX3JlPVxcXCIrbmV3X3Bhc3N3b3JkX2FnYWluKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXNlcm5hbWU6dXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDpuZXdfcGFzc3dvcmRcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LHBhc3N3b3JkLHVzZXJuYW1lKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcblxcbnN3aXRjaCAoUGF0dGVybikge1xcbiAgICBjYXNlIDA6XFxuICAg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gICAgICAgICAgICAgIHJlcGx5SWQ6aXRlbS5pZFxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGlzY3Vzc190ZXh0LFxcbiAgICAgICAgICAgIGRlc2M6IFJlcGx5K2l0ZW0uY3JlYXRlX2RhdGUgKyBcXFwiwrdcXFwiICsgaWNvbltpdGVtLmRpc2N1c3NfdHlwZV0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9pbmZvXFxcIixcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgIG5hbWU6aXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICB0eXBlOlxcXCJsb25nX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICB0ZXh0Oml0ZW0uZGlzY3Vzc190ZXh0XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgY29udHJvbChpdGVtLmlkLGl0ZW0uYWN0aXZlKTtcXG4gICAgfVxcbiAgICBpZiAoY29tbWVudExpc3QubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcblxcbnNldFJlc3VsdChkYXRhKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Y+R6KGo6K+E6K66XCIsXCJwYXRoXCI6XCJNYWtlQWNvbW1lbnRcIixcInJ1bGVcIjpcImpzOlxcbmxldCBkYXRhID0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gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkocCksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcCA9IHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190ZXh0XFxcIjogdGV4dCxcXG4gICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX3R5cGVcXFwiOiB0eXBlLFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogYXV0aF9jb2RlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHIocCk7XFxuICAgICAgICBpZihyZXN1bHQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQuZGV0YWlsO1xcblxcbiAgICB9LHVzZXIpXFxufSk7XFxuXFxuc2V0UmVzdWx0KGRhdGEpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Lyq55So5oi35rOo5YaMXCIsXCJwYXRoXCI6XCJVc2VycmVnaXN0cmF0aW9uXCIsXCJydWxlXCI6XCJqczpcXG5jb25zdCB7XFxuICAgIGFwaSxcXG4gICAgZ2V0RmlsZSxcXG4gICAgZ2V0VXNlckRhdGVcXG59ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5XFxcIik7XFxubGV0IGRhdGEgPSBbXTtcXG5kYXRhLnB1c2goe1xcbiAgICBjb2xfdHlwZT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FxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGEsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQyID0gSlNPTi5wYXJzZShyZXF1ZXN0KGIgKyBcXFwiP3FxPVxcXCIgKyBxcSkpO1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdDIuZGV0YWlsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICB9XFxuICAgICA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N0ID0gZ2V0VXNlckRhdGUoKTtcXG5kYXRhLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIumqjOivgS/nmbvlvZVcXFwiLFxcbiAgICB1cmw6ICQoXFxcIuehruWumuS/neWtmO+8jOmqjOivgeeggeWhq+mUme+8jOaXoOazleivhOiuuuWTplxcXCIpLmNvbmZpcm0oKGYsIGwsIGxvZ2luKSA9PiB7XFxuICAgICAgICBsZXQgcXEgPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnFxJywgJycpO1xcbiAgICAgICAgbGV0IHl6bSA9IGdldFZhcignV2FyZWhvdXNlLm0ueXptJywgJycpO1xcbiAgICAgICAgaWYgKHFxID09IFxcXCJcXFwiIHx8IHl6bSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9xceaIlumqjOivgeeggeS4uuepulxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChsb2dpbiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogeXptXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBm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J2FwcGxpY2F0aW9uL2pzb24sIHRleHQvamF2YXNjcmlwdCwgKi8qOyBxPTAuMDEnLFxcbiAgICAgICAgICAgICAgICAnQWNjZXB0LUxhbmd1YWdlJzonemgtQ04nLFxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgaWYod2ViX3VybF9hcnIubGVuZ3RoPj0zJiZ3ZWJfdXJsX2FyclsyXS5sZW5ndGg+Mil7IC8v6K6+572u57yW56CBXFxuICAgICAgICAgICAgICAgIGhlYWRlcnNbJ2NvbnRlbnQtdHlwZSddID0gJ2NoYXJzZXQ9Jyt3ZWJfdXJsX2FyclsyXS50b1VwcGVyQ2FzZSgpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgcGFyYW1zID0ge2hlYWRlcnM6aGVhZGVycyx3aXRoSGVhZGVyczpmYWxzZSxyZWRpcmVjdDpmYWxzZX07XFxuICAgICAgICAgICAgaWYod2ViX3VybF9hcnIubGVuZ3RoPj0yJiZ3ZWJfdXJsX2FyclsxXS5sZW5ndGg+Mil7IC8vIOiuvue9ruivt+axguaWueazlVxcbiAgICAgICAgICAgICAgICBwYXJhbXNbJ21ldGhvZCddID0gd2ViX3VybF9hcnJbMV0udG9VcHBlckNhc2UoKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbG9nKCflvIDlp4vojrflj5bmupDnoIEnKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAvKlxcbiAgICAgICAgICAgICAgICByZXF1ZXN0QXN5bmMod2ViX3VybCxwYXJhbXMsZnVuY3Rpb24gKGtleSxjb2RlKSB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gY29kZTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBsZXQgYmFja19jb2RlID0gZ2V0SXRlbSgnaG91c2UuZmlsZV91YScpPT09J+eUteiEkSc/ZmV0Y2god2ViX3VybCxwYXJhbXMpOnJlcXVlc3Qod2ViX3VybCxwYXJhbXMpO1xcbiAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bliLDnqbrmlofmnKzvvIznlpHkvLzkvaDmsqHmnInmraTmlofku7YhJztcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBsb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+WPkeeUn+S6humUmeivrzpcXFxcbicrZS5tZXNzYWdlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNlIGlmKC/kuLvpopjvv6V85YWD57Sg77+lLy50ZXN0KGlucHV0KSl7XFxuICAgICAgICAgICAgbG9nKCfkuLvpopjpk77mjqUnKTtcXG4gICAgICAgICAgICBsZXQgd2ViX3VybF9hcnIgPSBpbnB1dC5zcGxpdCgn77+lJyk7XFxuICAgICAgICAgICAgbGV0IHdlYl91cmwgPSB3ZWJfdXJsX2Fyclt3ZWJfdXJsX2Fyci5sZW5ndGgtMV07XFxuICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IHBhcnNlUGFzdGUod2ViX3VybCk7XFxuICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCkge1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bov5Tlm57kuLo6XFxcXG4nK2JhY2tfY29kZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6Z2e5rOV6ZO+5o6lOlxcXFxuJytnZXRWYXIoJ2hvdXNlLndlYl91cmwnKTtcXG4gICAgICAgIH1cXG4gICAgfSksXFxuICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiXFxufSk7XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLpgInmi6nmlofku7bot6/lvoRcXFwiLFxcbiAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKT0+e1xcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKFxcXCJodHRwczovL2hqZGhueC5jb2RpbmcubmV0L3AvaGlrZXIvZC9kci9naXQvcmF3L21hc3Rlci9qcy9maWxlU2VsZWN0LmpzXFxcIik7XFxuICAgICAgICByZXR1cm4gZi5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShcXFwiZmlsZVBhdGhcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShcXFwiZmlsZVBhdGhcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih0YXJnZXQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLndlYl91cmwnLFBBVEgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGF0dGVybjogMFxcbiAgICAgICAgfSk7XFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOifkuIrkvKDnsbvlnosnLFxcbiAgICBkZXNjOifkuIrkvKDmlofku7bnmoTnsbvlnoss5b2T5YmN5Li6OicrY29sb3IoZ2V0SXRlbSgnaG91c2UuZmls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sJywnJyk7XFxuICAgICAgICBsZXQgd2ViX3VybCA9IGlucHV0LnNwbGl0KCc7JylbMF07XFxuICAgICAgICBsZXQgZmlsZU5hbWUgPSAnJztcXG4gICAgICAgIGlmKC9eaGlrZXI6fF5maWxlOnxeaHR0cDp8Xmh0dHBzOnxeXFxcXC9zdG9yYWdlXFxcXC98XlxcXFwvc2RjYXJkXFxcXC8vLnRlc3Qod2ViX3VybCkpe1xcbiAgICAgICAgICAgIGZpbGVOYW1lID0gd2ViX3VybC5zcGxpdCgnLycpW3dlYl91cmwuc3BsaXQoJy8nKS5sZW5ndGgtMV07XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxldCBia2FyciA9IHVwX2NvZGUuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGlmKGJrYXJyLmxlbmd0aDwzKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S6keWJqui0tOadv+WGheWuueacieivrydcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3dpdGNoIChia2FyclsxXSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3RoZW1lJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfc2luZ2xlJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2pzX3VybCc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3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RtVXJscy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlXFxuICAgICAgICB9XFxuICAgICAgICBmdW5jdGlvbiBwcmludChzdHIpe1xcbiAgICAgICAgICAgIGlmKHR5cGVvZihsb2cpIT09J3VuZGVmaW5lZCcpe1xcbiAgICAgICAgICAgICAgICBsb2coc3RyKTtcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhzdHIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGRtVXJsIG9mIGRtVXJscykge1xcbiAgICAgICAgICAgIGlmICgobmV3IFJlZ0V4cChkbVVybCkpLnRlc3QodmlkZW9VcmwpKSB7Ly/mkq3mlL7lnLDlnYDljIXlkKvlkIrmr5vmoIflv5fnmoTlnLDlnYBcXG4gICAgICAgICAgICAgICAgcHJpbnQoJ+WQiuavm+inhumikSzoh6rliqjov4fmu6Q6Jyt2aWRlb1VybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcHJpbnQoJ+mdnuWQiuavm+inhumikSzlj6/mkq3mlL46Jyt2aWRlb1VybCk7XFxuICAgICAgICByZXR1cm4gZmFsc2VcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBpc0RtKHJldCkge1xcbiAgICAgICAgaWYgKCFyZXQpIHtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGhhc0RtKHJldC5zcGxpdCgnIycpWzBdLnNwbGl0KCc7JylbMF0sIGRtVXJscylcXG4gICAgfVxcbiAgICByZXR1cm4gaXNEbSh2aWRlb1VybClcXG59XFxuXFxuZnVuY3Rpb24gbGF6eVBhcnNlKHBsYXlVcmwsbXMsdG0scmVjaGFuZ2Upe1xcbiAgICAvLyBsb2coJ+iwg+eUqO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XN0KT09J3VuZGVmaW5lZCd8fCFyZXF1ZXN0KXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJfeDVqeFVybFxcXCIscGxheVVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5jb3VudCA9PSBudWxsKXtcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudD0xO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT09MSl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50Oicrd2luZG93LmNvdW50KycsbWF4X2NvdW50OicrbWF4X2NvdW50KTtcXG4gICAgICAgICAgICAgICAgaWYoIHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6LaF6L+HXFxcIittYXhfY291bnQqMjUwK1xcXCLmr6vnp5LmnKrojrflj5bliLDotYTmupDlnLDlnYDvvIzot7PliLDmupDnvZHpobUs5Lul5LiL5piv5Yqg6L296L+H55qE5Zyw5Z2AXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyh0ZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkoX2dldFVybHMoKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSwgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJlbWJlZFxcXCIpLCB2MyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcIiNwbGF5ZXJcXFwiKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2aWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKEpTT04uc3RyaW5naWZ5KHVybHMpKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy98aW5kZXhcXFxcLm0zdTgkXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXC8xXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1LHJlY2hhbmdlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFVybCk9PSdzdHJpbmcnJiYhaXNCYWRWaWRlbyh1KSl7Ly/ov4fmu6TlkIrmr5vop4bpopFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9meV9icmlkZ2VfYXBwLnNldFdlYlVhKFBDX1VBKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYS5nZXRIZWFkZXJVcmwpIT09J3VuZGVmaW5lZCcmJnR5cGVvZihyZWNoYW5nZSkhPT0nZnVuY3Rpb24nKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1LnJlcGxhY2UoXFxcIjt7XFxcIixcXFwiI2lzVmlkZW89dHJ1ZSM7e1xcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1cmxzW2ldKS5yZXBsYWNlKCc7eycsJyNpZ25vcmVJbWc9dHJ1ZSMjaXNWaWRlbz10cnVlIzt7Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTEgPSBiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSAnI2lnbm9yZUltZycrYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBcXFwiaHR0cFxcXCIrdTEuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja1VybCA9IHUxICsgdTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCfov5Tlm57oh6rliqjliqBjb29raWXpk77mjqU6JytiYWNrVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coJ+i/lOWbnumTvuaOpTonK3UrJ+W5tuiHquWKqOWKoOS6hmNvb2tpZSzlhbfkvZNjb29raWXlnKjop4bpopHmkq3mlL7lpITmn6XnnIsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrVXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLov5Tlm57ku5PlupN4NeWFjeWXhee7k+aenDpcXFwiK3JlYWxVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAvLyBmeV9icmlkZ2VfYXBwLmxvZygneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICBhbGVydCgneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5oql6ZSZ57uT5p2feDUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxpc1ZpZGVvLHJlY2hhbmdlLHBsYXlVcmwsbWF4X2NvdW50LFBDX1VBLGlzQmFkVmlkZW8pO1xcbiAgICAgICAgbGV0IHVzZVdlYj1sc2cuZ2V0SXRlbShcXFwi6YCa5YWNXFxcIixcXFwiWDVcXFwiKT09PVxcXCJXRUJcXFwiO1xcbiAgICAgICAgLy9sb2coXFxcIuS7k+W6k+S9v+eUqHdlYumAmuWFjeabv+S7o3g1OlxcXCIrdXNlV2ViKTtcXG4gICAgICAgIGxldCBydWxlSGVhZD11c2VXZWImJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIzMzk/XFxcIndlYlJ1bGU6Ly9cXFwiOlxcXCJ4NVJ1bGU6Ly9cXFwiO1xcbiAgICAgICAgbGV0IHg1VXJsID0gcnVsZUhlYWQrcGxheVVybCsgJ0AnICtfeDU7XFxuICAgICAgICByZXR1cm4geDVVcmxcXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiB4NVBhcnNlUHJvKHg1bGlzdCx4NV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09MSl7XFxuICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6JyArIHdpbmRvdy5jb3VudCArICcsbWF4X2NvdW50OicgKyBtYXhfY291bnQpO1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KSB7XFxuICAgICAgICAgICAgICAgIGZiYS5jbGVhclZhcigneDVMaXN0Jyk7XFxuICAgICAgICAgICAgICAgIGZiYS5oaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICBsZXQgZm1zZyA9ICfpgZPplb/ku5PlupPpgJrlhY3op6PmnpDlpLHotKUs5Y6f5ZugOui2heaXticreDVUaW1lb3V0Kyfmr6vnp5InO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKGZtc2cpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytmbXNnO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSxcXG4gICAgICAgICAgICB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgIC8vdT1kZWNvZGVVUklDb21wb25lbnQodSk7XFxuICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhcXFwi5YW25LuW5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcLzFcXFxcLm0zdTgkLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSk7XFxuICAgICAgICAgICAgICAgIGlmIChyZWFsVXJsJiYhaXNCYWRWaWRlbyh1KSkgey8v6L+H5ruk5ZCK5q+bXF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IHJlYWxWaWRlbyA9IGlzVmlkZW8odXJsKTtcXG4gICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlYWxWaWRlbyk9PSdzdHJpbmcnKXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5bey6Kej5p6Q5Ye66KeG6aKROicrcmVhbFZpZGVvKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFsVmlkZW8rPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaChyZWFsVmlkZW8pO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn6Kej5p6Q5Ye65LiN55+l6YGT5LuA5LmI5Lic6KW/OicrdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCs9XFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaCh1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6anNvbuaOpeWPo+S4lOaXoOi/lOWbnuinhumikeWcsOWdgOaVsOaNrjonK3BsYXlVcmxMaXN0W2ldKydcXFxcbicrYmFja2NvZGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6eDXmjqXlj6Ms5Yqg5YWleDXll4XmjqLliJfooagnKTtcXG4gICAgICAgICAgICB4NWxpc3QucHVzaChwbGF5VXJsTGlzdFtpXSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgLy8gbG9nKHZpZGVvcyk7XFxuICAgIGlmKHZpZGVvcy5sZW5ndGg+MCl7XFxuICAgICAgICBpZihnZXRWYXIoJ2RwLmNhY2hlVmlkZW8nLCd0cnVlJyk9PT0ndHJ1ZScmJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIyNTUpXFxuICAgICAgICB7XFxuICAgICAgICAgICAgbG9nKFxcXCLlsIrmlaznmoTprZTmlq3nlKjmiLfvvIzop4bpopHnvJPlrZjlt7LlkK/nlKjvvIzor7flsL3mg4Xkuqvlj5fnnIvliafml7blhYlcXFwiKTtcXG4gICAgICAgICAgICBsZXQgdmlkZW9zQ2FjaGU9dmlkZW9zLm1hcCgoaXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzPXt9O1xcbiAgICAgICAgICAgICAgICBpZihpdC5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBoZWFkID0gaXQuc3BsaXQoJzsnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXG4vL2hlYWQgPSBoZWFkLnJlcGxhY2UoL3t8fS9nLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdChcXFwie1xcXCIpWzFdLnNwbGl0KFxcXCJ9XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoJyYmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0gaGVhZFtpXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPWhlYWRbaV0uc3BsaXQoJ0AnKVsxXS5yZXBsYWNlKC87Lywn77yb77ybJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOml0LnNwbGl0KFxcXCI7XFxcIilbMF0uc3BsaXQoXFxcIuKYhVxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczp7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczpoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB2YXIgZGF0YT1iYXRjaENhY2hlTTN1OCh2aWRlb3NDYWNoZSk7XFxuICAgICAgICAgICAgZGF0YT1kYXRhLm1hcCgoaXQsaWQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYT1cXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCI7XFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCLimIVcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGlmKGl0K1xcXCJcXFwiIT1cXFwibnVsbFxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0K2V4dHJhXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1tpZF1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vbG9nKGRhdGEpO1xcbiAgICAgICAgICAgIHJldHVybiBkYXRhXFxuICAgICAgICAgICAgLy9yZXR1cm4gdmlkZW9zXFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gdmlkZW9zXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbG9nKCflhbHmnIknK3g1bGlzdC5sZW5ndGgrJ+S4qng15Zyw5Z2A6L+b6KGM6L2u5rWB5ZeF5o6iJyk7XFxuICAgIC8v5rKh5pyJ55qE6K+d5bCx5byA5aeL5L6d5qyheDXll4XmjqJcXG4gICAgc2hvd0xvYWRpbmcoJ+WXheaOouS4re+8jOiLpeWksei0peWwseWIh+aNondlYuWXheaOoi4uLicpO1xcbiAgICByZXR1cm4geDVQYXJzZVBybyh4NWxpc3QseDVUaW1lb3V0LGlzVmlkZW8pO1xcbn1cXG52YXIgbGF6eT0kKCcnKS5sYXp5UnVsZSgoKT0+e1xcbiAgICB0cnl7XFxuICAgICAgICByZWFsVXJsPWlucHV0O1xcbiAgICAgICAgZXZhbChcXFwidmFyIGNvbmZpZ19kcCA9XFxcIiArIGZldGNoKFxcXCJoaWtlcjovL2ZpbGVzL2NhY2hlL015UGFyc2VTZXQuanNvblxcXCIpKTtcXG4gICAgICAgIGV2YWwoZmV0Y2goY29uZmlnX2RwLmNqKSk7XFxuICAgICAgICBsb2coaW5wdXQrJy0+5q2j5Zyo5pat5o+S6a2U5pS554mI6Kej5p6QLi4uJyk7XFxuICAgICAgICAvLyDliqDlhaXotoXml7borr7nva7vvIzlu7rorq7lnKjpppbpobXorr7nva5cXG4gIC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UnKTtcXG4gICAgfVxcbiAgICBsZXQgaG91c2VfZGF0YSA9IGhvdXNlRmlsZSgpO1xcbiAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdCh0YXNrX2FwaSwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgIH0sXFxuICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwidHlwZVxcXCI6IHRhc2subW9kZXx8J3J1bicsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZnVuY1xcXCI6IHRhc2suZnVuY3x8JycsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjogdGFzay5wYXJhbXN8fFtdXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIFxcXCJhdXRoXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBob3VzZV9kYXRhLnVzZXJuYW1lfHxcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGhvdXNlX2RhdGEucGFzc3dvcmR8fFxcXCJcXFwiXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KSxcXG4gICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgIH0pO1xcbiAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG59XFxuXFxuZnVuY3Rpb24gdGFza191cGxvYWQodGFzayl7IC8vIOmAmueUqOS7u+WKoeWPkeW4g+aWsOWinuWPiuS/ruaUueWKn+iDvVxcbiAgICBjb25zdCB7YXBpLGdldEZpbGV9ID0gJC5yZXF1aX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faW5mb1syXTtcXG4gICAgICAgICAgICBsZXQgc2VuZF9kYXRhID0ge1xcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAge1xcXCJkYXRhXFxcIjoge1xcXCJpbmZvXFxcIjogaW5wdXRfdGV4dH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcIm5hbWVcXFwiOiBkZXZfc2V0X2luZm9bMF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZGV2X3NldF9pbmZvWzFdfVxcbiAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgLy8gbG9nKHNlbmRfZGF0YSk7XFxuICAgICAgICAgICAgbGV0IHBhcjIgPSB7aGVhZGVyczp7J2NvbnRlbnQtdHlwZSc6J2FwcGxpY2F0aW9uL2pzb247Y2hhcnNldD1VVEYtOCcsJ1VzZXItQWdlbnQnOmRldl9zZXRfaW5mb1szXX0sYm9keTpKU09OLnN0cmluZ2lmeShzZW5kX2RhdGEpLG1ldGhvZDonUE9TVCd9O1xcbiAgICAgICAgICAgIC8vIHBhcjIgPSBKU09OLnN0cmluZ2lmeShwYXIyKTsgLy94NemHjOmdouivt+axguaJjemcgOimgee8lueggVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX3JldCA9IHJlcXVlc3QoaW5mb19zZXRfdXJsLCBwYXIyKTtcXG4gICAgICAgICAgICAgICAgYmFja19yZXQgPSBKU09OLnBhcnNlKGJhY2tfcmV0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfcmV0LnN0YXR1cz09PTApe1xcbiAgICAgICAgICAgICAgICAgICAgLy8gcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjmiJDlip9cXFxcbicrYmFja19yZXQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kv53lrZjlpLHotKVcXFxcbicrYmFja19yZXQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor69cXFxcbicrZS5tZXNzYWdlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIGNvbmZpcm0oe3RpdGxlOifpgZPplb/mj5DnpLonLGNvbnRlbnQ6J+iZveeEtuS9oOW+iOaHku+8jOS9huaYr+WFrOWRiuiHs+WwkeWGmTTkuKrlrZflkKfvvIEnfSk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfVxcbiAgICB9KVxcbn0pO1xcblxcbnNldFJlc3VsdChkKTtcIn1dIiwiaWNvbiI6Imh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9vdGhlci8zMC5zdmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment