Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6YGT6ZW/5LuT5bqTUHJvIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTIxLCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuICAgIGNvbnN0IHtcbiAgICAgICAgZ2V0QXBpLFxuICAgICAgICBjb2xvcixcbiAgICAgICAgc21hbGwsXG4gICAgICAgIGdldEZpbGUsXG4gICAgICAgIGh0bWxUYWcsXG4gICAgICAgIGFwaSxcbiAgICAgICAgbWRcbiAgICB9ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVwiKTtcblxuY29uc3QgbHNnPSQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9sb2NhbFN0b3JhZ2U/cnVsZT3pgZPplb/ku5PlupNQcm9cIik7XG5sZXQgY2xhc3NBID0gZ2V0VmFyKFwiV2FyZWhvdXNlLmNsYXNzXCIsIFwiMFwiKTtcbmxldCBsaXN0VXJsID0gZ2V0QXBpKFwidXNlcnNVcmxcIikgKyBjbGFzc0EsXG4gICAgbXlVcmwgPSBnZXRBcGkoXCJkZXZTZWxmXCIpO1xuICAgIC8vIG15VXJsID0gZ2V0QXBpKFwicnVsZXNBbGxVcmxcIik7XG5wdXRWYXIoXCJXYXJlaG91c2UuZmlsdGVyXCIsIFwiXCIpO1xudmFyIG5vV2FpdD10cnV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mdldERhdGUoKTtcXG4gICAgICAgICAgICBsZXQgc3RySG91cnMgPSBkYXRlLmdldEhvdXJzKCk7XFxuICAgICAgICAgICAgbGV0IHN0ck1pbnV0ZXMgPSBkYXRlLmdldE1pbnV0ZXMoKTtcXG4gICAgICAgICAgICBsZXQgc3RyU2Vjb25kcyA9IGRhdGUuZ2V0U2Vjb25kcygpKzE7XFxuICAgICAgICAgICAgaWYgKG1vbnRoID49IDEgJiYgbW9udGggPD0gOSkge1xcbiAgICAgICAgICAgICAgICBtb250aCA9IFxcXCIwXFxcIiArIG1vbnRoXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJEYXRlID49IDAgJiYgc3RyRGF0ZSA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckRhdGUgPSBcXFwiMFxcXCIgKyBzdHJEYXRlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJIb3VycyA+PSAwICYmIHN0ckhvdXJzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RySG91cnMgPSBcXFwiMFxcXCIgKyBzdHJIb3Vyc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyTWludXRlcyA+PSAwICYmIHN0ck1pbnV0ZXMgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJNaW51dGVzID0gXFxcIjBcXFwiICsgc3RyTWludXRlc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyU2Vjb25kcyA+PSAwICYmIHN0clNlY29uZHMgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJTZWNvbmRzID0gXFxcIjBcXFwiICsgc3RyU2Vjb25kc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvL2xldCBjdXJyZW50ZGF0ZSA9IGRhdGUuZ2V0RnVsbFllYXIoKSArIHNlcGVyYXRvcjEgKyBtb250aCArIHNlcGVyYXRvcjEgKyBzdHJEYXRlICsgXFxcIi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JlcUJ5R2V0ICsgXFxcIiZmbGFnXFxcIiArIFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suiuvuS4uuWFrOW8gFxcXCI7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICB9LCB7XFxuICAgICAgICB0aXRsZTogXFxcIumaj+acuuWvhumSpVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGUsXFxuICAgICAgICB1cmw6ICQoZ2V0QXBpKFxcXCJnZW5BdXRoXFxcIikgKyByZXFCeUdldCArIFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgYmFjayA9IHJlcXVlc3QoaW5wdXQpO1xcbiAgICAgICAgICAgIGxldCByZXQgPSBKU09OLnBhcnNlKGJhY2spO1xcbiAgICAgICAgICAgIGlmIChyZXQuc3RhdHVzID09IDApIHtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey55Sf5oiQ6ZqP5py65a+G56CBXFxcXG5cXFwiICsgcmV0LnJlc3VsdFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZqP5py65a+G56CB55Sf5oiQ5aSx6LSlXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH0pO1xcbiAgICBsZXQgdGltZU92ZXIgPSB7XFxuICAgICAgICBjb2xfd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ICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICBwYXNzd29yZDogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgIHVzZXJuYW1lOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgcmVwbHlJZDppdGVtLmlkXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgZGF0YS5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogaXRlbS5kaXNjdXNzX3RleHQsXFxuICAgICAgICAgICAgZGVzYzogUmVwbHkraXRlbS5jcmVhdGVfZGF0ZSArIFxcXCLCt1xcXCIgKyBpY29uW2l0ZW0uZGlzY3Vzc190eXBlXSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2luZm9cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIG5hbWU6IGl0ZW0ubmFtZSxcXG4gICAgICAgICAgICAgICAgdHlwZTogXFxcImxvbmdfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIHRleHQ6IGl0ZW0uZGlzY3Vzc190ZXh0XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbmRhdGEucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG59KTtcXG5zZXRSZXN1bHQoZGF0YSk7XCJ9LHtcImNvbF90eXBlXCI6XCJpY29uXzJfcm91bmRcIixcIm5hbWVcIjpcIuinhOWImeWIl+ihqFwiLFwicGF0aFwiOlwicnVsZXNcIixcInJ1bGVcIjpcImpzOlxcbiAgICBhZGRMaXN0ZW5lcignb25DbG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0aXBzOicrdGlwcyk7XFxuICAgIC8vIGxvZygnY2FuX3VwbG9hZDonK2Nhbl91cGxvYWQpO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J+KaoOiDveWQpuS4iuS8oDonKyhnZXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJyl8fHRpcHMpLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOidoaWtlcjovL2VtcHR5J1xcbiAgICB9KTtcXG4gICAgZnVuY3Rpb24gc2V0VXBsb2FkKGZsYWcsY2FuX3VwbG9hZF9hcGkpIHtcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKGNhbl91cGxvYWRfYXBpLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjYW5fdXBsb2FkXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+emgeatouS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn56aB5q2i6K+l5byA5Y+R6ICF5LiK5Lyg6KeE5YiZP+S9oOeahOaTjeS9nOWwhuiiq+ezu+e7n+iusOW9lScpLmNvbmZpcm0oKGlkLGNhbl91cGxvYWRfYXBpLHNldFVwbG9hZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0VXBsb2FkKGZhbHNlLGNhbl91cGxvYWRfYXBpKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdXYXJlaG91c2UuY2FuX3VwbG9hZCcsJ+WQpicpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxpZCxjYW5fdXBsb2FkX2FwaSxzZXRVcGxvYWQpXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J+KcheWFgeiuuOS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCg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9PT0gbmFtZSk7XFxuICAgICAgICAgICAgaWYgKGhhc1J1bGUpIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2UuYmFja1xcXCIsIFxcXCIxXFxcIik7XFxuICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGhvbWUrXFxcInNAXFxcIiArIG5hbWU7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+acquWuieijhVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSwgZGF0YUl0ZW0ubmFtZSxhcGkuaG9tZSksXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgfSlcXG59XFxubGV0IG1hbl9ydWxlX3NhZmUgPSBnZXRBcGkoXFxcIm1hblJ1bGVTYWZlXFxcIikrZGF0YUl0ZW0uaWQ7XFxubGV0IG1hbl9ydWxlX2dvb2QgPSBnZXRBcGkoXFxcIm1hblJ1bGVHb29kXFxcIikrZGF0YUl0ZW0uaWQ7XFxuLy8gZGF0YUl0ZW0uaXNfc2FmZTtcXG5pZihnZXRWYXIoJ2hvdXNlLmlzX21hbmFnZXInKSl7XFxuICAgIGZ1bmN0aW9uIHNldElzU2FmZShmbGFnLG1hbl9ydWxlX3NhZmUpIHtcXG4gICAgICAgIGZsYWcgPSBmbGFnIHx8ICcnO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBsZXQgY29kZSA9IGZldGNoKG1hbl9ydWxlX3NhZmUsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX3NhZmVcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZnVuY3Rpb24gc2V0SXNHb29kKGZsYWcsbWFuX3J1bGVfZ29vZCkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfZ29vZCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfZ29vZFxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/Cfmqvpo47pmaknLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumjjumZqT/po47pmanop4TliJnml6Dms5Xooqvlr7zlhaUnKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKGZhbHNlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pyF5q2j5bi4JyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrmraPluLg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfc2FmZSxzZXRJc1NhZmUpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzU2FmZSh0cnVlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pml6Z2e5LyY6LSoJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrpnZ7kvJjotKg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzR29vZChmYWxzZSxtYW5fcnVsZV9nb29kKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO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FtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ3Bvc3QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgaWRyZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0SWQgKyBcXFwiP3FxPVxcXCIgKyB1c2VybmFtZSkpO1xcbiAgICAgICAgaWYgKGlkcmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgaWRyZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpemCrueusemqjOivgeeggVxcXFxuXFxcIiArIHJlc3VsdC5kZXRhaWwpLmlucHV0KChjb25maXJtLCBpZCwgYWNjb3VudCkgPT4ge1xcbiAgICAgICAgICAgIHNob3dMb2FkaW5nKFxcXCLor7fogJDlv4PnrYnlvoVcXFwiKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChjb25maXJtLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVnaXN0X2lkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ5em1cXFwiOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VVc2VybmFtZVxcXCIsIGFjY291bnRbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VQYXNzd29yZFxcXCIsIGFjY291bnRbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/miJDlip/mj5DkuqTms6jlhozms6jlhoxcXFxcblxcXCIrcmVzdWx0LmRldGFpbDtcXG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VmFyKCdXYXJlaG91c2UubS5hdmF0YXInLCAnJyk7XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJmF2YXRhcl91cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChuZXdBdmF0YXIpKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcbn1cXG5cXG5mdW5jdGlvbiBtX3B3ZCgpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi5Y6f5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeWOn+WvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQueScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhv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YXNzd29yZD1cXFwiICsgbmV3X3Bhc3N3b3JkK1xcXCImbmV3X3Bhc3N3b3JkX3JlPVxcXCIrbmV3X3Bhc3N3b3JkX2FnYWluKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXNlcm5hbWU6dXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDpuZXdfcGFzc3dvcmRcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LHBhc3N3b3JkLHVzZXJuYW1lKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcblxcbnN3aXRjaCAoUGF0dGVybikge1xcbiAgICBjYXNlIDA6XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuS/ruaUueWktOWDj1xcXCIpO1xcbiAgICAgICAgbV9hdmF0YXIoKTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIDE6XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuS/ruaUueaYteensFxcXCIpO1xcbiAgICAgICAgbV9wZXROYW1lKCk7XFxuICAgICAgICBicmVhaztcXG4gICAgY2FzZSAy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VxcXCIsXFxuICAgICAgICBoZWlnaHQ6LTEsXFxuICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLnJ1bGUubm90ZXNcXFwiLGlucHV0KSdcXG4gICAgfVxcbn0pO1xcblxcbmRhdGEucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi5L+d5a2YXFxcIixcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgdXJsOiAkKGdldEFwaShcXFwic2V0X3J1bGVfbm90ZVxcXCIpICsgaWQpLmxhenlSdWxlKCh1c2VybmFtZSwgcGFzc3dvcmQpID0+IHtcXG4gICAgICAgIGxldCBub3RlcyA9IGdldFZhcignV2FyZWhvdXNlLnJ1bGUubm90ZXMnLCAnJyk7XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJub3RlXFxcIjpub3Rlc1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgIC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mxhenlSdWxlKChBY2NvdW50KSA9PiB7XFxuICAgICAgICBsZXQgdGV4dCA9IGdldFZhcignV2FyZWhvdXNlLmNvbW1lbnQudGV4dCcsICcnKTtcXG4gICAgICAgIGxldCBbcXEsYXV0aF9jb2RlXSA9IEFjY291bnQ7XFxuICAgICAgICBsZXQgdHlwZSA9IGdldFZhcignV2FyZWhvdXNlLmNvbW1lbnQudHlwZScpIHx8ICdnb29kJztcXG4gICAgICAgIHFxPXFxfHxcXFwiXFxcIjtcXG4gICAgICAgIGF1dGhfY29kZT1hdXRoX2NvZGV8fFxcXCJcXFwiO1xcbiAgICAgICAgaWYocXE9PVxcXCJcXFwifHxhdXRoX2NvZGU9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pyq55m75b2V6LSm5Y+3XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmKHRleHQ9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5YaZ5ZWKXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGZ1bmN0aW9uIHIocCkge1xcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkocCksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcCA9IHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxc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2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQyID0gSlNPTi5wYXJzZShyZXF1ZXN0KGIgKyBcXFwiP3FxPVxcXCIgKyBxcSkpO1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdDIuZGV0YWlsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICB9XFxuICAgICAgICB9LCBxcSwgYSwgYik7XFxuXFxuICAgIH0sIGFwaS5kaXNfbmV3X3VzZXIsIGFwaS5kaXNfdmVyaWZ5KSxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIHR5cGU6IFxcXCJudW1iZXJcXFwiLFxcbiAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRWYXIoJ1dhcmVob3VzZS5tLnFxJywgJycpIHx8IHVzZXJOYW1lLFxcbiAg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XRWYXIoJ1dhcmVob3VzZS5tLnFxJywgJycpO1xcbiAgICAgICAgbGV0IHl6bSA9IGdldFZhcignV2FyZWhvdXNlLm0ueXptJywgJycpO1xcbiAgICAgICAgaWYgKHFxID09IFxcXCJcXFwiIHx8IHl6bSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9xceaIlumqjOivgeeggeS4uuepulxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChsb2dpbiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogeXptXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBmLnVzZXIgPSBbcXEsIHl6bV07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGYpKTtcXG4gICAgICAgICAgICBsZXQgaW5kZXggPSBsLmZpbmRJbmRleChpdGVtID0+IGl0ZW1bMF0gPT09IHFxKTtcXG4gICAgICAgICAgICBpZiAoaW5k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d29yZCwgdXNlcm5hbWUsIHJ1bGVJZCkgPT4ge1xcbiAgICAgICAgbGV0IHRleHQgPSBnZXRWYXIoJ1dhcmVob3VzZS5jb21tZW50LnRleHQnLCAnJyk7XFxuICAgICAgICBpZiAocGFzc3dvcmQgPT0gXFxcIlxcXCIgfHwgdXNlcm5hbWUgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pyq55m75b2V6LSm5Y+3XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0ZXh0ID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S9oOi/mOS7gOS5iOmDveayoeWGmeWVilxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfdGV4dFxcXCI6IHRleHQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImRpc2N1c3NfaWRcXFwiOiBydWxlSWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1b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gICAgICAgICAgaGVhZGVyc1snY29udGVudC10eXBlJ10gPSAnY2hhcnNldD0nK3dlYl91cmxfYXJyWzJdLnRvVXBwZXJDYXNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7aGVhZGVyczpoZWFkZXJzLHdpdGhIZWFkZXJzOmZhbHNlLHJlZGlyZWN0OmZhbHNlfTtcXG4gICAgICAgICAgICBpZih3ZWJfdXJsX2Fyci5sZW5ndGg+PTImJndlYl91cmxfYXJyWzFdLmxlbmd0aD4yKXsgLy8g6K6+572u6K+35rGC5pa55rOVXFxuICAgICAgICAgICAgICAgIHBhcmFtc1snbWV0aG9kJ10gPSB3ZWJfdXJsX2FyclsxXS50b1VwcGVyQ2FzZSgpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsb2coJ+W8gOWni+iOt+WPlua6kOeggScpO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIC8qXFxuICAgICAgICAgICAgICAgIHJlcXVlc3RBc3luYyh3ZWJfdXJsLHBhcmFtcyxmdW5jdGlvbiAoa2V5LGNvZGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBjb2RlO1xcbiAgICAgICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/plJnor6/vvIzmnKzmrKHojrflj5bliLDnqbrmlofmnKzvvIznlpHkvLzkvaDmsqHmnInmraTmlofku7YhJztcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICovXFxuICAgICAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBnZXRJdGVtKCdob3VzZS5maWxlX3VhJyk9PT0n55S16ISRJz9mZXRjaCh3ZWJfdXJsLHBhcmFtcyk6cmVxdWVzdCh3ZWJfdXJsLHBhcmFtcyk7XFxuICAgICAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApe1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS51cGxvYWRfY29kZScsYmFja19jb2RlKTtcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+a6kOeggeW3suiOt+WPlizlubbpg6jliIbmj5LlhaXliLDmlofmnKzljLrln58nXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5Y+R55Sf5LqG6ZSZ6K+vOlxcXFxuJytlLm1lc3NhZ2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWVsc2UgaWYoL+S4u+mimO+/pXzlhYPntKDvv6UvLnRlc3QoaW5wdXQpKXtcXG4gICAgICAgICAgICBsb2coJ+S4u+mimOmTvuaOpScpO1xcbiAgICAgICAgICAgIGxldCB3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gJyc7XFxuICAgICAgICBpZigvXmhpa2VyOnxeZmlsZTp8Xmh0dHA6fF5odHRwczp8XlxcXFwvc3RvcmFnZVxcXFwvfF5cXFxcL3NkY2FyZFxcXFwvLy50ZXN0KHdlYl91cmwpKXtcXG4gICAgICAgICAgICBmaWxlTmFtZSA9IHdlYl91cmwuc3BsaXQoJy8nKVt3ZWJfdXJsLnNwbGl0KCcvJykubGVuZ3RoLTFdO1xcbiAgICAgICAgfWVsc2UgaWYoL+S4u+mimO+/pXzlhYPntKDvv6UvLnRlc3QoaW5wdXQpKXtcXG4gICAgICAgICAgICBsZXQgYmthcnIgPSB1cF9jb2RlLnNwbGl0KCfvv6UnKTtcXG4gICAgICAgICAgICBpZihia2Fyci5sZW5ndGg8Myl7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kupHliarotLTmnb/lhoXlrrnmnInor68nXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN3aXRjaCAoYmthcnJbMV0pIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnbXlfaG9tZV90aGVtZSc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ+OAjCcpWzFdLnNwbGl0KCfjgI0nKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3NpbmdsZSc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ+OAjCcpWzFdLnNwbGl0KCfjgI0nKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdqc191cmwnOlxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2RlLnNwbGl0KCfvv6UnKVsyXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICA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fcGljKSl7XFxuICAgICAgICAgICAgICAgIF9waWMrPSdAUmVmZXJlcj0nXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBpdD17XFxuICAgICAgICAgICAgICAgIHRpdGxlOnBkZmgobGlzdFtpXSx0WzFdKSxcXG4gICAgICAgICAgICAgICAgcGljX3VybDpfcGljLFxcbiAgICAgICAgICAgICAgICBkZXNjOnBkZmgobGlzdFtpXSx0WzNdKSxcXG4gICAgICAgICAgICAgICAgdXJsOmVqP3BkKGxpc3RbaV0sdFs0XSk6cGQobGlzdFtpXSx0WzRdKStsYXp5XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZih0Lmxlbmd0aD41KXsvL+WGheWuue+8jOeUqOS6juaQnOe0olxcbiAgICAgICAgICAgICAgICBpdC5jb250ZW50PXBkZmgobGlzdFtpXSx0WzVdKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goaXQpO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYob25seWJhY2spe1xcbiAgICAgICAgICAgIHJldHVybiBkXFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgIH1cXG4gICAgfSxwYXJTdHIsZWosb25seWJhY2ssaHRtbCxpc1BpYylcXG59XFxuXFxuZnVuY3Rpb24gbGF6eVBhcnNlKHBsYXlVcmwsbXMsdG0scmVjaGFuZ2Upe1xcbiAgICAvLyBsb2coJ+iwg+eUqOS7k+W6k+WFjeWXheaOouS8oOWPgui2heaXtuS4ujonK21zKTtcXG4gICAgdG0gPSBwYXJzZUludCh0bSl8fDUwMDA7XFxuICAgIGNvbnN0IHtpc1ZpZGVvLGdldEhlYWRlcnN9ID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZ2xvYmFsUGFyc2U/cnVsZT3pgZPplb/ku5PlupNQcm8nKTtcXG4gICAgbGV0IHJlYWxVcmwgPSBpc1ZpZGVvKHBsYXlVcmw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xcIik7XFxuICAgICAgICBzaG93TG9hZGluZygn5ZeF5o6i5Lit77yM6Iul5aSx6LSl5bCx6YeN6KOFeDUuLi4nKTtcXG4gICAgICAgIGxldCBfeDUgPSAkLnRvU3RyaW5nKChpc1ZpZGVvLHJlY2hhbmdlLHBsYXlVcmwsbWF4X2NvdW50LFBDX1VBKT0+e1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGlmKHR5cGVvZihmYmEpPT0ndW5kZWZpbmVkJ3x8IWZiYSl7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgZmJhID0gZnlfYnJpZGdlX2FwcDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlcXVlc3QpPT0ndW5kZWZpbmVkJ3x8IXJlcXVlc3Qpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGZiYS5wdXRWYXIoXFxcIl94NWp4VXJsXFxcIixwbGF5VXJsKTtcXG4gICAgICAgICAgICAgICAgaWYod2luZG93LmNvdW50ID09IG51bGwpe1xcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmNvdW50PTE7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICAgICAgaWYoL+inpuWPkeS6humYsuebl+mTvnzmnKrmjojmnYN85o6l5Y+j6Ziy55uXLy50ZXN0KHRleHQpJiZ3aW5kb3cuY291bnQ9PT0xKXtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuajgOa1i+WIsOacieaOiOadg++8jOW8gOWni+i/h+aOiOadg1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2NhdGlvbi5yZWxvYWQoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxvY2F0aW9uLmhyZWY9ZmJhLmdldFZhcihcXFwiX3g1anhVcmxcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6Jyt3aW5kb3cuY291bnQrJyxtYXhfY291bnQ6JyttYXhfY291bnQpO1xcbiAgICAgICAgICAgICAgICBpZiggd2luZG93LmNvdW50ID49IG1heF9jb3VudCl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLotoXov4dcXFwiK21heF9jb3VudCoyNTArXFxcIuavq+enkuacquiOt+WPluWIsOi1hOa6kOWcsOWdgO+8jOi3s+WIsOa6kOe9kemhtSzku6XkuIvmmK/liqDovb3ov4fnmoTlnLDlnYBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKHRleHQpO1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhKU09OLnN0cmluZ2lmeShfZ2V0VXJscygpKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmJhLmdldFZhcihcXFwiX3g1anhVcmxcXFwiKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmdW5jdGlvbiBtdXRlTWUoZWxlbSkge1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbGVtLnBhdXNlKCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJ2aWRlb1xcXCIpLCBhdWRpb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJhdWRpb1xcXCIpLCB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHZpZGVvcywgZnVuY3Rpb24gKHZpZGVvKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYyLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkodXJscykpO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHU9dW5lc2NhcGUodSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwidmlk5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1cXFxcLy8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBob3N0K3Uuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cFxcXCIrdS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuWFtuS7luWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL3xpbmRleFxcXFwubTN1OCRcXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC9cXFxcLzFcXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgdT11LnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHJlYWxVcmwgPSBpc1ZpZGVvKHUscmVjaGFuZ2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVXJsKT09J3N0cmluZycpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLku5PlupN4NeWFjeWXhee7k+aenDpcXFwiK3JlYWxVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2Z5X2JyaWRnZV9hcHAuc2V0V2ViVWEoUENfVUEpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbFVybFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAvLyBmeV9icmlkZ2VfYXBwLmxvZygneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICBhbGVydCgneDXlpKfojIPlm7T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AgICAgICB0cnkge1xcbiAgICAgICAgICAgIGlmICh0eXBlb2YgKHJlcXVlc3QpID09ICd1bmRlZmluZWQnIHx8ICFyZXF1ZXN0KSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoZmJhLmdldEludGVybmFsSnMoKSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tXFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPT0gbnVsbCkge1xcbiAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQgPSAxO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT0xKXtcXG4gICAgICAgICAgICAgICAgbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuajgOa1i+WIsOacieaOiOadg++8jOW8gOWni+i/h+aOiOadg1xcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB3aW5kb3cuY291bnQrKztcXG4gICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonICsgd2luZG93LmNvdW50ICsgJyxtYXhfY291bnQ6JyArIG1heF9jb3VudCk7XFxuICAgICAgICAgICAgaWYgKHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpIHtcXG4gICAgICAgICAgICAgICAgZmJhLmNsZWFyVmFyKCd4NUxpc3QnKTtcXG4gICAgICAgICAgICAgICAgZmJhLmhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIGxldCBmbXNnID0gJ+mBk+mVv+S7k+W6k+mAmuWFjeino+aekOWksei0pSzljp/lm6A66LaF5pe2Jyt4NVRpbWVvdXQrJ+avq+enkic7XFxuICAgICAgICAgICAgICAgIGZiYS5sb2coZm1zZyk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK2Ztc2c7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBlbGVtLnBhdXNlKCk7XFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciB2aWRlb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJ2aWRlb1xcXCIpLCBhdWRpb3MgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJhdWRpb1xcXCIpLFxcbiAgICAgICAgICAgIHYyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiZW1iZWRcXFwiKSwgdjMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCIjcGxheWVyXFxcIik7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwoYXVkaW9zLCBmdW5jdGlvbiAoYXVkaW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKGF1ZGlvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYyLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBmb3IgKGxldCBpIGluIHVybHMpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgLy91PWRlY29kZVVSSUNvbXBvbmVudCh1KTtcXG4gICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgIHU9dW5lc2NhcGUodSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcPyguKik9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgLy9mYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFwvMVxcXFwubTN1OCQvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdT11LnJlcGxhY2UoLyZmcm9tPS4qfCZuZXh0PS4qfCZqdW1wPS4qLywnJyk7XFxuICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1KTtcXG4gICAgICAgICAgICAgICAgaWYgKHJlYWxVcmwpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIuS7k+W6k3g15YWN5ZeF57uT5p6cOlxcXCIgKyByZWFsVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5jbGVhclZhcigneDVMaXN0Jyk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVhbFVybFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKVxcbiAgICAgICAgfVxcbiAgICB9LCBpc1ZpZGVvLCBtYXhfY291bnQseDVUaW1lb3V0KTtcXG4gICAgY29uc3QgbHNnPSQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2xvY2FsU3RvcmFnZT9ydWxlPemBk+mVv+S7k+W6k1Byb1xcXCIpO1xcbiAgICBsZX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ICAgICAgICAgICAgIHVybCs9XFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaCh1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6anNvbuaOpeWPo+S4lOaXoOi/lOWbnuinhumikeWcsOWdgOaVsOaNrjonK3BsYXlVcmxMaXN0W2ldKydcXFxcbicrYmFja2NvZGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6eDXmjqXlj6Ms5Yqg5YWleDXll4XmjqLliJfooagnKTtcXG4gICAgICAgICAgICB4NWxpc3QucHVzaChwbGF5VXJsTGlzdFtpXSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgLy8gbG9nKHZpZGVvcyk7XFxuICAgIGlmKHZpZGVvcy5sZW5ndGg+MCl7XFxuICAgICAgICBpZihnZXRWYXIoJ2RwLmNhY2hlVmlkZW8nLCd0cnVlJyk9PT0ndHJ1ZScmJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIyNTUpXFxuICAgICAgICB7XFxuICAgICAgICAgICAgbG9nKFxcXCLlsIrmlaznmoTprZTmlq3nlKjmiLfvvIzop4bpopHnvJPlrZjlt7LlkK/nlKjvvIzor7flsL3mg4Xkuqvlj5fnnIvliafml7blhYlcXFwiKTtcXG4gICAgICAgICAgICBsZXQgdmlkZW9zQ2FjaGU9dmlkZW9zLm1hcCgoaXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzPXt9O1xcbiAgICAgICAgICAgICAgICBpZihpdC5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBoZWFkID0gaXQuc3BsaXQoJzsnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXG4vL2hlYWQgPSBoZWFkLnJlcGxhY2UoL3t8fS9nLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdChcXFwie1xcXCIpWzFdLnNwbGl0KFxcXCJ9XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoJyYmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0gaGVhZFtpXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPWhlYWRbaV0uc3BsaXQoJ0AnKVsxXS5yZXBsYWNlKC87Lywn77yb77ybJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnNba2V5XSA9IHZhbHVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4ge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsOml0LnNwbGl0KFxcXCI7XFxcIilbMF0uc3BsaXQoXFxcIuKYhVxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9uczp7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczpoZWFkZXJzXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB2YXIgZGF0YT1iYXRjaENhY2hlTTN1OCh2aWRlb3NDYWNoZSk7XFxuICAgICAgICAgICAgZGF0YT1kYXRhLm1hcCgoaXQsaWQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBleHRyYT1cXFwiXFxcIjtcXG4gICAgICAgICAgICAgICAgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCI7XFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhPVxcXCLimIVcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIuKYhVxcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIGlmKGl0K1xcXCJcXFwiIT1cXFwibnVsbFxcXCIpe1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGl0K2V4dHJhXFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1tpZF1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIC8vbG9nKGRhdGEpO1xcbiAgICAgICAgICAgIHJldHVybiBkYXRhXFxuICAgICAgICAgICAgLy9yZXR1cm4gdmlkZW9zXFxuICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICByZXR1cm4gdmlkZW9zXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbG9nKCflhbHmnIknK3g1bGlzdC5sZW5ndGgrJ+S4qng15Zyw5Z2A6L+b6KGM6L2u5rWB5ZeF5o6iJyk7XFxuICAgIC8v5rKh5pyJ55qE6K+d5bCx5byA5aeL5L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cInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IHRhc2submFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJweWNvZGVcXFwiOiB0YXNrLnB5Y29kZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJub3RlXFxcIjogdGFzay5ub3RlLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInRlc3RfY29kZVxcXCI6IHRhc2sudGVzdF9jb2RlLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aFxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaG91c2VfZGF0YS51c2VybmFtZXx8XFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBob3VzZV9kYXRhLnBhc3N3b3JkfHxcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICB9KTtcXG4gICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxufVxcblxcbmZ1bmN0aW9uIHRhc2tfY2FsbChpZCxmdW5jLHBhcmFtcyl7XFxuICAgIGNvbnN0IHthcGl9ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5P3J1bGU96YGT6ZW/5LuT5bqTUHJvXFxcIik7XFxuICAgIGxldCB0YXNrX2FwaSA9IGFwaS5ob3N0KycvaGlrZXJ1bGUvdGFzay9ydW4vJytpZDtcXG4gICAgbGV0IHRhc2sgPSB7XFxuICAgICAgICBtb2RlOidjYWxsJyxcXG4gICAgICAgIGZ1bmM6ZnVuYyxcXG4gICAgICAgIHBhcmFtczpwYXJhbXN8fFtdXFxuICAgIH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9XSIsImljb24iOiJodHRwczovL2xhbm1laWd1b2ppYW5nLmNvbS90dWJpYW8vb3RoZXIvMzAuc3ZnIn0=
Add Comment
Please, Sign In to add comment