xiaomianao666

小程序:道长仓库Pro

Nov 16th, 2024
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6YGT6ZW/5LuT5bqTUHJvIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTY0LCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuY29uc3Qge1xuICAgIGdldEFwaSxcbiAgICBjb2xvcixcbiAgICBzbWFsbCxcbiAgICBnZXRGaWxlLFxuICAgIGh0bWxUYWcsXG4gICAgYXBpLFxuICAgIG1kXG59ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVwiKTtcbnZhciByID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2Uvbm90aWNlJyk7XG5cblxuY29uc3QgbHNnID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL2xvY2FsU3RvcmFnZT9ydWxlPemBk+mVv+S7k+W6k1Byb1wiKTtcbmxldCBjbGFzc0EgPSBnZXRWYXIoXCJXYXJlaG91c2UuY2xhc3NcIiwgXCIwXCIpO1xubGV0IGxpc3RVcmwgPSBnZXRBcGkoXCJ1c2Vyc1VybFwiKSArIGNsYXNzQSxcbiAgICBteVVybCA9IGdldEFwaShcImRldlNlbGZcIiksXG4gICAgbm90aWNlVXJsID0gZ2V0QXBpKFwibm90aWNlVXJsXCIpO1xuLy8gbXlVcmw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vL2xvZyhub3RpY2VzKTtcbiAgICBpZihub3RpY2VzLmxlbmd0aD4wKXtcbiAgICAvLyBsZXQgaW5mbyA9ICfpgZPplb/ku5PlupPpooTorqHkuo4yMDI05bm0M+aciOS4reaXrOS4i+aetuWBnOatoui/kOiQpe+8jOivt+WQhOS9jeW8gOWPkeiAheWkp+S9rOWmpeWWhOWkh+S7veWlveiHquW3seeahOinhOWIme+8jOaPkuS7tu+8jOS4u+mimOetieaVsOaNric7XG4gICAvLyBsZXQgbXNnPWluZm87XG4gICAgLy9tc2c9aW5mby5zbGljZSgwLDIwKSsnLi4uJztcbiAgICBsZXQgbXNnPSfwn5SUJytub3RpY2VzWzBdLm5hbWUrJzonK25vdGljZXNbMF0uY29udGVudF90ZXh0O1xuICAgIGxldCBub3RpY2VfY29sb3I9bm90aWNlc1swXS5jb2xvcnx8JyNmZjcwMDAnO1xuICAgIGxldCBpbmZvPW5vdGljZXMubWFwKGl0PT5gPGgyPiR7aXQubmFtZX0gJHtpdC5wdWJsaXNoX3RpbWV9PC9oMj5gK2l0LmNvbnRlbnQpLmpvaW4oJ1xcbicpO1xuICAgIHIuc2hvdyhkYXRhLCBtc2csIG5vdGljZV9jb2xvcixudWxsLGluZm8pO1xuICAgIFxuICAgIC8vci5zaG93KGRhdGEsIG1zZyxcInJlZFwiKTtcbi8vci5zaG93KGRhdGEsIG1zZyxcInJlZFwiLHVuZGVmaW5lZCwgXCLor6bnu4blhazlkYpcIik7XG5cbi8vci5zaG93KGQsIG1zZyxcInJlZFwiLCBcIndlYjovL2h0dHBzOi8vYmFpZHUuY29tXCIpO1xuICAgIH1cbiAgICBcbiAgXG4gICAgbGV0IGNsYXNzVGFiID0gW1xuICAgICAgICBbXCLkuIrmrKHmtLvot4NcIiwgXCIwXCJdLFxuICAgICAgICBbXCLop4TliJnmlbBcIiwgXCIxXCJdLFxuICAgICAgICBbXCLms6jlhozml7bpl7RcIiwgXCItMVwiXVxuICAgIF1cbiAgICBmb3IgKGxldCBpdGVtIG9mIGNsYXNzVGFiKSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogaXRlbVsxXSA9PT0gY2xhc3NBID8gXCLigJzigJxcIiArIGl0ZW1bMF0gKyBcIuKAneKAnVwiIDogaXRlbVswXSxcbiAgICAgICAgICAgIHVybDogJChcIiNub0xvYWRpbmcjXCIpLmxhenlSdWxlKChrZXkpID0+IHtcbiAgICAgICAgICAgICAgICBwdXRWYXIoXCJXYXJlaG91c2UuY2xhc3NcIiwga2V5KTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9lbXB0eVwiO1xuICAgICAgICAgICAgfSwgaXRlbVsxXSksXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiBcIuWFqOmDqOinhOWImVwiLFxuICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL0FsbFB1YmxpY1J1bGU/dXJsPWhpa2VyOi8vZW1wdHkjZnlwYWdlI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1wiLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogXCLliLfmlrDkvp3otZZcIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChqc29uVXJsKSA9PiB7XG4gICAgICAgICAgICBqc29uVXJsID0ganNvblVybCArICcyNTA1JztcbiAgICAgICAgICAgIC8vIGxvZyhqc29uVXJsKTtcbiAgICAgICAgICAgIGxldCB0ZXh0ID0gcmVxdWVzdChqc29uVXJsKTtcbiAgICAgICAgICAgIGlmICghL3ZlcnNpb24vLnRlc3QodGV4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0ZUl0ZW0oJ3NvcnQnLCB7XG4gICAgICAgICAgICAgICAgdGl0bGU6IFwi5o6S5bqPOlwiICsgY29sb3IobmV4dCwgXCIjZmY3MDAwXCIpXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgcmV0dXJuIFwidG9hc3Q6Ly/lt7Lorr7nva7ku5PlupPlvIDlj5HogIXop4TliJnmjpLluo/mqKHlvI/kuLo6XCIgKyBuZXh0O1xuICAgICAgICB9LCBjb2xvciksXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBpZDogJ3NvcnQnXG4gICAgICAgIH1cbiAgICB9KTtcbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogY29sb3IoXCLku5PlupPlhazlkYpcIiwgXCIjZmY3MDAwXCIpLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCIsXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMnKS5ydWxlKChtZCkgPT4ge1xuICAgICAgICAgICAgcmVxdWlyZShtZCk7XG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xuICAgICAgICAgICAgbGV0IOS7k+W6k+WFrOWRiiA9IFwi5pqC5peg5YWs5ZGKXCI7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIOS7k+W6k+WFrOWRiiA9IGZldGNoKCdodHRwczovL2dpdGNvZGUubmV0L3FxXzMyMzk0MzUxL2RyLy0vcmF3L21hc3Rlci9qcy/ku5PlupPlhazlkYoubWQnKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgICAgICBpZiAo5LuT5bqT5YWs5ZGKKSB7XG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG1hcmtlZC5wYXJzZSjku5PlupPlhazlkYopLFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXG4gICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZXRSZXN1bHQoZCk7XG4gICAgICAgIH0sIG1kKVxuICAgIH0pO1xuXG4gICAgZGF0YS5wdXNoKHtcbiAgICAgICAgdGl0bGU6IGNvbG9yKFwi5Y2H57qn5LuT5bqTXCIsIFwiIzE1YWIyMVwiKSxcbiAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgICAgIGdldEFwaVxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS91dGlsaXlcIik7XG4gICAgICAgICAgICBsZXQgcnVsZUhlYWQgPSAn5rW36ZiU6KeG55WM6aaW6aG16aKR6YGT6KeE5YiZ44CQ6YGT6ZW/5LuT5bqTUHJv44CR77+laG9tZV9ydWxlX3VybO+/pSc7XG4gICAgICAgICAgICBsZXQgdXJsID0gZ2V0QXBpKCdpbXBvcnRVcmwnKSArIFwiMTA5NFwiO1xuICAgICAgICAgICAgbGV0IGltcG9ydFVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShydWxlSGVhZCArIHVybCk7XG4gICAgICAgICAgICByZXR1cm4gaW1wb3J0VXJsXG4gICAgICAgIH0pXG4gICAgfSk7XG5cbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogY29sb3IoXCLljYfnuqck5omp5bGVXCIsIFwiIzE1YWIyMVwiKSxcbiAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgICAgIGdldEFwaVxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS91dGlsaXlcIik7XG4gICAgICAgICAgICBsZXQgcnVsZUhlYWQgPSAn5rW36ZiU6KeG55WM77yM572R6aG15o+S5Lu277+lanNfdXJs77+lJGhpa2VyQCc7XG4gICAgICAgICAgICBsZXQgdXJsID0gZ2V0QXBpKCdpbXBvcnRVcmwnKSArIFwiNTExMVwiO1xuICAgICAgICAgICAgbGV0IGltcG9ydFVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShydWxlSGVhZCArIHVybCk7XG4gICAgICAgICAgICByZXR1cm4gaW1wb3J0VXJsXG4gICAgICAgIH0pXG4gICAgfSk7XG5cbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKCkgPT4ge1xuICAgICAgICBjbGVhclZhcihcIldhcmVob3VzZS5jbGFzc1wiKTtcbiAgICB9KSk7XG4gICAgbGV0IHtcbiAgICAgICAgdXNlcm5hbWUsXG4gICAgICAgIHBhc3N3b3JkLFxuICAgICAgICB1c2VyXG4gICAgfSA9IGdldEZpbGUoKTtcblxuICAgIGxldCBpc19sb2dpbiA9IGZhbHNlO1xuICAgIGxldCBpc19tYW5hZ2VyID0gZmFsc2U7XG4gICAgaWYgKHVzZXJuYW1lICE9PSB2b2lkIDAgJiYgcGFzc3dvcmQgIT09IHZvaWQgMCkge1xuICAgICAgICBteVVybCArPSAnP3FxPScgKyB1c2VybmFtZSArICcmcGFzc3dvcmQ9JyArIHBhc3N3b3JkO1xuICAgICAgICBsZXQgY29kZV9zdHIgPSByZXF1ZXN0KG15VXJsLCB0bXBfaGVhZGVycyk7XG4gICAgICAgIGxldCBjb2RlID0ge307XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlX3N0cik7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCAmJiBjb2RlLnJlc3VsdC5hY3RpdmUpIHtcbiAgICAgICAgICAgIGlzX2xvZ2luID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChjb2RlLnJlc3VsdC5pc19tYW5hZ2VyKSB7XG4gICAgICAgICAgICAgICAgaXNfbWFuYWdlciA9IHRydWU7XG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS5pc19tYW5hZ2VyJywgJ+ecnycpO1xuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXNlcm5hbWUnLCB1c2VybmFtZSk7XG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS5wYXNzd29yZCcsIHBhc3N3b3JkKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS5pc19tYW5hZ2VyJywgJycpO1xuICAgICAgICAgICAgICAgIGNsZWFyVmFyKCdob3VzZS51c2VybmFtZScpO1xuICAgICAgICAgICAgICAgIGNsZWFyVmFyKCdob3VzZS5wYXNzd29yZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIGlmIChpc19sb2dpbikge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgbm93Q29uID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldEFwaShcIm5vd0NvblVybFwiKSwgdG1wX2hlYWRlcnMpKS5yZXN1bHQ7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIG5vd0NvbiA9ICfmnKrnn6UnO1xuICAgICAgICB9XG4gICAgICAgIGxldCBkZXZEYXRhID0gdXNlckxpc3QuZmluZChpdGVtID0+IGl0ZW0ucXEgPT09IHVzZXJuYW1lKTtcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiAnPHN0cm9uZz48c3BhbiBzdHlsZT1cImNvbG9yOiAjZmY3MDAwXCI+JyArI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WPkeiAheeZu+W9lVwiLCBcIiMwMEJGRkZcIikpLFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcbiAgICAgICAgICAgIGRlc2M6IHNtYWxsKFwi546w5pyJXCIgKyBjb2xvcih1c2VyTGlzdC5sZW5ndGgsIFwiI2ZmNzAwMFwiKSArIFwi5ZCN5byA5Y+R6ICF77yMXCIgKyBjb2xvcihydWxlQ291bnRbMF0sIFwiI2ZmNzAwMFwiKSArIFwi5p2h5YWs5byA6KeE5YiZ77yMXCIgKyBjb2xvcigwLCBcIiNmZjcwMDBcIikgKyBcIuadoembhuiKs+mYgeinhOWImeOAglwiKSxcbiAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvZGV2TG9naW5cIlxuICAgICAgICB9KTtcbiAgICB9XG4gICAgaWYgKEFycmF5LmlzQXJyYXkodXNlcikgJiYgdXNlci5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgbGV0IHVzZXJsb2dpbiA9IHJlcXVlc3QoYXBpLmRpc19sb2dpbiwge1xuICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgXCJwYXJhbXNcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInFxXCI6IHVzZXJbMF0sXG4gICAgICAgICAgICAgICAgICAgIFwiYXV0aF9jb2RlXCI6IHVzZXJbMV1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgdGltZW91dDogdGltZW91dFxuICAgICAgICB9KTtcbiAgICAgICAgdXNlcmxvZ2luID0gSlNPTi5wYXJzZSh1c2VybG9naW4pLnJlc3VsdDtcbiAgICAgICAgaWYgKHVzZXJsb2dpbi5zdGF0dXMgPT09IDApIHtcbiAgICAgICAgICAgIHVzZXJsb2dpbiA9IHVzZXJsb2dpbi5yZXN1bHRcbiAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJsb2dpbi5uYW1lICsgXCImbmJzcDsmbmJzcDtcIiArIHVzZXJsb2dpbi5xcSArIFwiJm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7PHNtYWxsPjx1PuabtOaNoui0puWPtyA+PC91Pjwvc21hbGw+XCIsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxuICAgICAgICAgICAgICAgIHBpY191cmw6IHVzZXJsb2dpbi5hdmF0YXJfdXJsLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvVXNlcnJlZ2lzdHJhdGlvblwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEuc3BsaWNlKDMsIDAsIHtcbiAgICAgICAgICAgICAgICB0aXRsZTogdXNlcmxvZ2luLmhhc19yZXBseSA/IFwi8J+GleWbnuWkjVwiIDogXCLwn5SU5Zue5aSNXCIsXG4gICAgICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9NeVJlcGx5P3VybD1oaWtlcjovL2VtcHR5I2Z5cGFnZSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcIixcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCIsXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgYXV0aF9jb2RlOiB1c2VyWzFdLFxuICAgICAgICAgICAgICAgICAgICBxcTogdXNlclswXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogdXNlcmxvZ2luLmRldGFpbCxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxuICAgICAgICAgICAgICAgIGRlc2M6IFwi4oCc4oCc4oCd4oCdPHNtYWxsPjx1PumHjeaWsOiOt+WPlumqjOivgeeggSA+PC91Pjwvc21hbGw+XCIsXG4gICAgICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9Vc2VycmVnaXN0cmF0aW9uXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBcIuivhOiuuueZu+W9lS/ms6jlhoxcIixcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXG4gICAgICAgICAgICBkZXNjOiBcIlwiLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9Vc2VycmVnaXN0cmF0aW9uXCJcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGZvciAodmFyIGl0ZW0gb2YgdXNlckxpc3QpIHtcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUgKyBcIihcIiArIGl0ZW0ucnVsZV9udW0gKyBcIilcIixcbiAgICAgICAgICAgIGRlc2M6IGl0ZW0uaWQgKyAnOicgKyBpdGVtLm5pY2tfbmFtZSxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9ydWxlcyNub0hpc3RvcnkjXCIsXG4gICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgIGF2YXRhclVybDogaXRlbS5hdmF0YXIsXG4gICAgICAgICAgICAgICAgcXE6IGl0ZW0ucXEsXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0uaWQsXG4gICAgICAgICAgICAgICAgY2FuX3VwbG9hZDogaXRlbS5jYW5fdXBsb2FkXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0J1xuICAgIH0pO1xuICAgIHNldFJlc3VsdChkYXRhKTtcbiAgICB0cnkge1xuICAgICAgICBsZXQgaW1nID0gW1xuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFwiaGlrZXI6Ly9maWxlcy9pY29uL+i1ni5zdmdcIiwgXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD02NzU2XCJcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgXCJoaWtlcjovL2ZpbGVzL2ljb24v6LipLnN2Z1wiLCBcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTY3NTdcIlxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICBcImhpa2VyOi8vZmlsZXMvaWNvbi/or4Torrouc3ZnXCIsIFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9Njc1OFwiXG4gICAgICAgICAgICBdXG4gICAgICAgIF07XG4gICAgICAgIGZvciAobGV0IGl0ZW0gb2YgaW1nKSB7XG4gICAgICAgICAgICBpZiAoIWZpbGVFeGlzdChpdGVtWzBdKSkge1xuICAgICAgICAgICAgICAgIGRvd25sb2FkRmlsZShpdGVtWzFdLCBpdGVtWzBdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gY2F0Y2ggKGUpIHtcblxuICAgIH1cbn0iLCJzZWFyY2hfdXJsIjoiaGlrZXI6Ly9lbXB0eSMqKiIsImdyb3VwIjoiI++4j+KDo+i9u+S4u+mhtSIs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b250aCA+PSAxICYmIG1vbnRoIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgbW9udGggPSBcXFwiMFxcXCIgKyBtb250aFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyRGF0ZSA+PSAwICYmIHN0ckRhdGUgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJEYXRlID0gXFxcIjBcXFwiICsgc3RyRGF0ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RySG91cnMgPj0gMCAmJiBzdHJIb3VycyA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckhvdXJzID0gXFxcIjBcXFwiICsgc3RySG91cnNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0ck1pbnV0ZXMgPj0gMCAmJiBzdHJNaW51dGVzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyTWludXRlcyA9IFxcXCIwXFxcIiArIHN0ck1pbnV0ZXNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHN0clNlY29uZHMgPj0gMCAmJiBzdHJTZWNvbmRzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RyU2Vjb25kcyA9IFxcXCIwXFxcIiArIHN0clNlY29uZHNcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy9sZXQgY3VycmVudGRhdGUgPSBkYXRlLmdldEZ1bGxZZWFyKCkgKyBzZXBlcmF0b3IxICsgbW9udGggKyBzZXBlcmF0b3IxICsgc3RyRGF0ZSArIFxcXCIgXFxcIiArIHN0ckhvdXJzICsgc2VwZXJhdG9yMiArIHN0ck1pbnV0ZXMgKyBzZXBlcmF0b3IyICsgc3RyU2Vjb25kcztcXG4gICAgICAgICAgICBsZXQgY3VycmVudGRhdGUgPSAoZGF0ZS5nZXRGdWxsWWVhcigpLTIwMjApKycnKyBtb250aCArJycrIHN0ckRhdGUgKycnKyBzdHJIb3VycysnJyArIHN0ck1pbnV0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AgICAgICAgZGVzYzogXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvXFxcIit0aXRsZStcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmU6IGZhbHNlLC8v56aB55So5bm25Y+R5pu05pawXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHNoYXJlVGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJPYmopKTtcXG4gICAgICAgICAgICAgICAgdmFyIHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShzaGFyZVRleHQscGFzdGVzLnNsaWNlKC0xKVswXSk7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRfcnVsZT0gXFxcIui9u+WQiOmbhuiuoumYhe+8mlxcXCIrdGl0bGUrJ1xcXFxuJyt1cmw7XFxuICAgICAgICAgICAgICAgIGNvcHkoaW1wb3J0X3J1bGUpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gJ2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvc3ViLmpzb24nO1xcbiAgICAgICAgICAgICAgICAkLnJjKGNvbmZpZy5saWIuc3ViKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIOiuoumYheWvvOWFpShwYXRoKVxcbiAgICAgICAgICAgIH0sZGF0YUl0ZW0sc3ViVXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcbmlmIChydWxlQ29kZSkge1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCLliIbkuqvop4TliJlcXFwiLFxcbiAgICAgICAgdXJsOiB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IixcXG4gICAgICAgIHVybDogJChnZXRBcGkoXFxcInNoYXJlXFxcIikgKyByZXFCeUdldCArIFxcXCImZmxhZ1xcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lorr7kuLrlhazlvIBcXFwiO1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgfSwge1xcbiAgICAgICAgdGl0bGU6IFxcXCLpmo/mnLrlr4bpkqVcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlLFxcbiAgICAgICAgdXJsOiAkKGdldEFwaShcXFwiZ2VuQXV0aFxcXCIpICsgcmVxQnlHZXQgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgbGV0IGJhY2sgPSByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICBsZXQgcmV0ID0gSlNPTi5wYXJzZShiYWNrKTtcXG4gICAgICAgICAgICBpZiAocmV0LnN0YXR1cyA9PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3sueUn+aIkOmaj+acuuWvhueggVxcXFxuXFxcIiArIHJldC5yZXN1bHRcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+maj+acuuWvhueggeeUn+aIkOWksei0pVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9K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X2FwaSA9IGdldEFwaShcXFwibWFuQ2FuVXBsb2FkXFxcIikgKyBpZDtcXG5pZiAoZ2V0VmFyKCdob3VzZS5pc19tYW5hZ2VyJykpIHtcXG4gICAgbGV0IHRpcHMgPSBjYW5fdXBsb2FkID8gJ+iDvScgOiAn5ZCmJztcXG4gICAgLy8gbG9nKCd0aXBzOicrdGlwcyk7XFxuICAgIC8vIGxvZygnY2FuX3VwbG9hZDonK2Nhbl91cGxvYWQpO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfimqDog73lkKbkuIrkvKA6JyArIChnZXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJykgfHwgdGlwcyksXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgfSk7XFxuXFxuICAgIGZ1bmN0aW9uIHNldFVwbG9hZChmbGFnLCBjYW5fdXBsb2FkX2FwaSkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2goY2FuX3VwbG9hZF9hcGksIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUFcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjYW5fdXBsb2FkXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn8J+aq+emgeatouS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKCfnpoHmraLor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55qE5pON5L2c5bCG6KKr57O757uf6K6w5b2VJykuY29uZmlybSgoaWQsIGNhbl91cGxvYWRfYXBpLCBzZXRVcGxvYWQpID0+IHtcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0VXBsb2FkKGZhbHNlLCBjYW5fdXBsb2FkX2FwaSk7XFxuICAgICAgICAgICAgaWYgKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdXYXJlaG91c2UuY2FuX3VwbG9hZCcsICflkKYnKTtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0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AgICAgICAgIGxldCBzdWJPYmogPSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IHN1YlVybCxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCJoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL1xcXCIrdGl0bGUrXFxcIi5qc29uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvZGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgYWN0aXZlOiBmYWxzZSwvL+emgeeUqOW5tuWPkeabtOaWsFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBzaGFyZVRleHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoc3ViT2JqKSk7XFxuICAgICAgICAgICAgICAgIHZhciBwYXN0ZXMgPSBnZXRQYXN0ZXMoKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoc2hhcmVUZXh0LHBhc3Rlcy5zbGljZSgtMSlbMF0pO1xcbiAgICAgICAgICAgICAgICBsZXQgaW1wb3J0X3J1bGU9IFxcXCLovbvlkIjpm4borqLpmIXvvJpcXFwiK3RpdGxlKydcXFxcbicrdXJsO1xcbiAgICAgICAgICAgICAgICBjb3B5KGltcG9ydF9ydWxlKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgcGF0aCA9ICdoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL3N1Yi5qc29uJztcXG4gICAgICAgICAgICAgICAgJC5yYyhjb25maWcubGliLnN1Yik7XFxuICAgICAgICAgICAgICAgIHJldHVybiDorqLpmIXlr7zlhaUocGF0aClcXG4gICAgICAgICAgICB9LGRhdGFJdGVtLHJ1bGVMaXN0SnNvbiArIGRhdGFJdGVtLmlkKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogbXl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ICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX3NhZmVcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZnVuY3Rpb24gc2V0SXNHb29kKGZsYWcsbWFuX3J1bGVfZ29vZCkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfZ29vZCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfZ29vZFxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/Cfmqvpo47pmaknLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumjjumZqT/po47pmanop4TliJnml6Dms5Xooqvlr7zlhaUnKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKGZhbHNlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pyF5q2j5bi4JyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrmraPluLg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfc2FmZSxzZXRJc1NhZmUpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzU2FmZSh0cnVlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pml6Z2e5LyY6LSoJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrpnZ7kvJjotKg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzR29vZChmYWxzZSxtYW5fcnVsZV9nb29kKTtcXG4gICAgICAgICAgICBpZigh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XCJyZWFzb25cXFwiOiBkZXNjcmlwdGlvbixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ3Bvc3QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgaWRyZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0SWQgKyBcXFwiP3FxPVxcXCIgKyB1c2VybmFtZSkpO1xcbiAgICAgICAgaWYgKGlkcmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgaWRyZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpemCrueusemqjOivgeeggVxcXFxuXFxcIiArIHJlc3VsdC5kZXRhaWwpLmlucHV0KChjb25maXJtLCBpZCwgYWNjb3VudCkgPT4ge1xcbiAgICAgICAgICAgIHNob3dMb2FkaW5nKFxcXCLor7fogJDlv4PnrYnlvoVcXFwiKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChjb25maXJtLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVnaXN0X2lkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ5em1cXFwiOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VVc2VybmFtZVxcXCIsIGFjY291bnRbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VQYXNzd29yZFxcXCIsIGFjY291bnRbMV0pO1xcbiAgICAgICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB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XFwiKSArIHBhdGgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgbmV3QXZhdGFyID0gZ2V0VmFyKCdXYXJlaG91c2UubS5hdmF0YXInLCAnJyk7XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJmF2YXRhcl91cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChuZXdBdmF0YXIpKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcbn1cXG5cXG5mdW5jdGlvbiBtX3B3ZCgpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi5Y6f5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeWOn+WvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXN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gICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJm5ld19wYXNzd29yZD1cXFwiICsgbmV3X3Bhc3N3b3JkK1xcXCImbmV3X3Bhc3N3b3JkX3JlPVxcXCIrbmV3X3Bhc3N3b3JkX2FnYWluKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXNlcm5hbWU6dXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDpuZXdfcGFzc3dvcmRcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LHBhc3N3b3JkLHVzZXJuYW1lKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcblxcbnN3aXRjaCAoUGF0dGVybikge1xcbiAgICBjYXNlIDA6XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuS/ruaUueWktOWDj1xcXCIpO1xcbiAgICAgICAgbV9hdmF0YXIoKTtcXG4gICAgICAgIGJyZWFrO1xcbiAgICBjYXNlIDE6XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuS/ru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cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgdXJsOiAkKGFwaS5kaXNfbmV3ICsgaWQpLmxhenlSdWxlKChBY2NvdW50KSA9PiB7XFxuICAgICAgICBsZXQgdGV4dCA9IGdldFZhcignV2FyZWhvdXNlLmNvbW1lbnQudGV4dCcsICcnKTtcXG4gICAgICAgIGxldCBbcXEsYXV0aF9jb2RlXSA9IEFjY291bnQ7XFxuICAgICAgICBsZXQgdHlwZSA9IGdldFZhcignV2FyZWhvdXNlLmNvbW1lbnQudHlwZScpIHx8ICdnb29kJztcXG4gICAgICAgIHFxPXFxfHxcXFwiXFxcIjtcXG4gICAgICAgIGF1dGhfY29kZT1hdXRoX2NvZGV8fFxcXCJcXFwiO1xcbiAgICAgICAgaWYocXE9PVxcXCJcXFwifHxhdXRoX2NvZGU9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5pyq55m75b2V6LSm5Y+3XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmKHRleHQ9PVxcXCJcXFwiKXtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5YaZ5ZWKXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGZ1bmN0aW9uIHIocCkge1xcbiAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkocCksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZ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dGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQyID0gSlNPTi5wYXJzZShyZXF1ZXN0KGIgKyBcXFwiP3FxPVxcXCIgKyBxcSkpO1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdDIuZGV0YWlsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICB9XFxuICAgICAgICB9LCBxcSwgYSwgYik7XFxuXFxuICAgIH0sIGFwaS5kaXNfbmV3X3VzZXIsIGFwaS5kaXNfdmVyaWZ5KSxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIHR5cGU6IFxcXCJudW1iZXJcXFwiLFxcbiAgICAgICAgZ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hOiuuuWTplxcXCIpLmNvbmZpcm0oKGYsIGwsIGxvZ2luKSA9PiB7XFxuICAgICAgICBsZXQgcXEgPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnFxJywgJycpO1xcbiAgICAgICAgbGV0IHl6bSA9IGdldFZhcignV2FyZWhvdXNlLm0ueXptJywgJycpO1xcbiAgICAgICAgaWYgKHFxID09IFxcXCJcXFwiIHx8IHl6bSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9xceaIlumqjOivgeeggeS4uuepulxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChsb2dpbiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogeXptXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBmLnVzZXIgPSBbcXEsIHl6bV07XFxuICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsIEpTT04uc3RyaW5naWZ5KGYpKTtcXG4gICAgICAgICAgICBsZXQgaW5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biAgICAgICAgaWYgKHRleHQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5YaZ5ZWKXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190ZXh0XFxcIjogdGV4dCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc19pZFxcXCI6IHJ1bGVJZFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuXFxuICAgIH0sIHBhc3N3b3JkLCB1c2VybmFtZSwgcmVwbHlJZClcXG59KTtcXG5cXG5zZXRSZXN1bHQoZGF0YSk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3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OmZhbHNlLHJlZGlyZWN0OmZhbHNlfTtcXG4gICAgICAgICAgICBpZih3ZWJfdXJsX2Fyci5sZW5ndGg+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+mimOmTvuaOpScpO1xcbiAgICAgICAgICAgIGxldCB3ZWJfdXJsX2FyciA9IGlucHV0LnNwbGl0KCfvv6UnKTtcXG4gICAgICAgICAgICBsZXQgd2ViX3VybCA9IHdlYl91cmxfYXJyW3dlYl91cmxfYXJyLmxlbmd0aC0xXTtcXG4gICAgICAgICAgICBsZXQgYmFja19jb2RlID0gcGFyc2VQYXN0ZSh3ZWJfdXJsKTtcXG4gICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKSB7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXBsb2FkX2NvZGUnLGJhY2tfY29kZSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPlui/lOWbnuS4ujpcXFxcbicrYmFja19jb2RlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pnZ7ms5Xpk77mjqU6XFxcXG4nK2dldFZhcignaG91c2Uud2ViX3VybCcpO1xcbiAgICAgICAgfVxcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCJcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIumAieaLqeaWh+S7tui3r+W+hFxcXCIsXFxuICAgIHVybDokKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKCgpPT57XFxuICAgICAgICAvKlxcbiAgICAgICAgbGV0IGZwID0gJ2h0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfMzIzOTQzNTEvZHIvLS9yYXcvbWFzdGVyL2pzL2ZpbGVTZWxlY3QuanMnO1xcbiAgICAgICAgbGV0IGYgPSByZXF1aXJlKGZwKTtcXG4gICAgICAgICovXFxuICAgICAgICBsZXQgZnA9Y29uZmlnLmxpYi5maWxlU2VsZWN0O1xcbiAgICAgICAgbGV0IGY9JC5yYyhmcCk7XFxuICAgICAgICByZXR1cm4gZi5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShcXFwiZmlsZVBhdGhcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShcXFwiZmlsZVBhdGhcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih0YXJnZXQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLndlYl91cmwnLFBBVEgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBvbkNsaWNrVHlwZTonY29uZmlybScsXFxuICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanN8LnR4dHwuaGlrZXJ8Lmpzb258Lmh0bWxcXFwiLFxcbiAgICAgICAgICAgIHBhdHRlcm46IDAsXFxuICAgICAgICAgICAgcmVxdWlyZVVybDpmcCxcXG4gICAgICAgICAgICBpbml0aWFsUGF0aDpnZXRQYXRoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvJykuc2xpY2UoNyksXFxuICAgICAgICAgICAgbWVtb3J5Oid0cnVlJyxcXG4gICAgICAgIH0pO1xcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTon5LiK5Lyg57G75Z6LJyxcXG4gICAgZGVzYzon5LiK5Lyg5paH5Lu255qE57G75Z6LLOW9k+WJjeS4ujonK2NvbG9yKGdldEl0ZW0oJ2hvdXNlLmZpbGVfdHlwZScsJ+mdmeaAgeaWh+S7ticpLCcjZmY3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gICAgICAgbGV0IHdlYl91cmwgPSBpbnB1dC5zcGxpdCgnOycpWzBdO1xcbiAgICAgICAgbGV0IGZpbGVOYW1lID0gJyc7XFxuICAgICAgICBpZigvXmhpa2VyOnxeZmlsZTp8Xmh0dHA6fF5odHRwczp8XlxcXFwvc3RvcmFnZVxcXFwvfF5cXFxcL3NkY2FyZFxcXFwvLy50ZXN0KHdlYl91cmwpKXtcXG4gICAgICAgICAgICBmaWxlTmFtZSA9IHdlYl91cmwuc3BsaXQoJy8nKVt3ZWJfdXJsLnNwbGl0KCcvJykubGVuZ3RoLTFdO1xcbiAgICAgICAgfWVsc2UgaWYoL+S4u+mimO+/pXzlhYPntKDvv6UvLnRlc3QoaW5wdXQpKXtcXG4gICAgICAgICAgICBsZXQgYmthcnIgPSB1cF9jb2RlLnNwbGl0KCfvv6UnKTtcXG4gICAgICAgICAgICBpZihia2Fyci5sZW5ndGg8Myl7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kupHliarotLTmnb/lhoXlrrnmnInor68nXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHN3aXRjaCAoYmthcnJbMV0pIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAnbXlfaG9tZV90aGVtZSc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ+OAjCcpWzFdLnNwbGl0KCfjgI0nKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3NpbmdsZSc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ+OAjCcpWzFdLnNwbGl0KCfjgI0nKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICdqc191cmwnOlxcbiAgICAgICAgICAgICAgICAgICAgZmlsZU5hbWUgPSB1cF9jb2R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QocGxheVVybCkpe1xcbiAgICAgICAgICAgICAgICBwbGF5VXJsKz1cXFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgfWVsc2UgaWYoL3B0d29cXFxcLndrZmlsZVxcXFwuY29tLy50ZXN0KHBsYXlVcmwpJiYvdXJsPS8udGVzdChwbGF5VXJsKSl7XFxuICAgICAgICAgICAgICAgIHBsYXlVcmw9cGxheVVybC5zcGxpdChcXFwidXJsPVxcXCIpWzFdK1xcXCI7e1JlZmVyZXJAaHR0cHM6Ly9mYW50dWFuLnR2fVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8g5aSE55CG5aSn5biI5YWE5LmL57G755qEYXBwXFxuICAgICAgICAgICAgLy8gZWxzZXtcXG4gICAgICAgICAgICAvLyAgICAgcGxheVVybCs9XFxcIjt7VXNlci1BZ2VudEBNb3ppbGxhLzUuMH1cXFwiO1xcbiAgICAgICAgICAgIC8vIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHBsYXlVcmw9cmVjaGFuZ2UocGxheVVybCk7XFxuICAgICAgICBpZighLyNpc1ZpZGVvPXRydWUjLy50ZXN0KHBsYXlVcmwpKXtcXG4gICAgICAgICAgICBwbGF5VXJsKz1cXFwiI2lzVmlkZW89dHJ1ZSNcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy8gbGV0IHQyID0gbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAvLyBwcmludCgn5Yik5pataXNWaWRlb+iAl+aXtjonKyh0Mi10MSkpO1xcbiAgICAgICAgcmV0dXJuIHBsYXlVcmw7XFxuICAgIH1lbHNle1xcbiAgICAgICAgLy8gbGV0IHQyID0gbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAvLyBwcmludCgn5Yik5pataXNWaWRlb+iAl+aXtjonKyh0Mi10MSkpO1xcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICB9XFxufV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ys9J0BSZWZlcmVyPSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGl0PXtcXG4gICAgICAgICAgICAgICAgdGl0bGU6cGRmaChsaXN0W2ldLHRbMV0pLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOl9waWMsXFxuICAgICAgICAgICAgICAgIGRlc2M6cGRmaChsaXN0W2ldLHRbM10pLFxcbiAgICAgICAgICAgICAgICB1cmw6ZWo/cGQobGlzdFtpXSx0WzRdKTpwZChsaXN0W2ldLHRbNF0pK2xhenlcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmKHQubGVuZ3RoPjUpey8v5YaF5a6577yM55So5LqO5pCc57SiXFxuICAgICAgICAgICAgICAgIGl0LmNvbnRlbnQ9cGRmaChsaXN0W2ldLHRbNV0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaChpdCk7XFxuICAgICAgICB9XFxuICAgICAgICBpZihvbmx5YmFjayl7XFxuICAgICAgICAgICAgcmV0dXJuIGRcXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHNldFJlc3VsdChkKVxcbiAgICAgICAgfVxcbiAgICB9LHBhclN0cixlaixvbmx5YmFjayxodG1sLGlzUGljKVxcbn1cXG5cXG5mdW5jdGlvbiBpc0JhZFZpZGVvKHZpZGVvVXJsKSB7Ly/mmK/lnY/nmoTop4bpopFcXG4gICAgbGV0IGRtUGF0aCA9ICdoaWtlcjovL2ZpbGVzL2NhY2hlL2RpYW9tYW8udHh0JzsvL+WQiuavm+aooeW8j+i/h+a7pOaWh+S7tui3r+W+hFxcbiAgICBsZXQgZG1VcmxzO1xcbiAgICB0cnkge1xcbiAgICAgICAgZG1VcmxzID0gcmVxdWVzdChkbVBhdGgpLnRyaW0oKS5zcGxpdCgnXFxcXG4nKS5maWx0ZXIoaXQgPT4gaXQgJiYgIWl0LnN0YXJ0c1dpdGgoJy8vJykpO1xcbiAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICBkbVVybHMgPSBbXTtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBoYXNEbSh2aWRlb1VybCwgZG1VcmxzKSB7Ly/mkq3mlL7lnLDlnYDmmK/lkKbkuLrlkIrmr5vop4bpopFcXG4gICAgICAgIGlmIChkbVVybHMubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgIHJldHVybiBmYWxzZVxcbiAgICAgICAgfVxcbiAgICAgICAgZnVuY3Rpb24gcHJpbnQoc3RyKXtcXG4gICAgICAgICAgICBpZih0eXBlb2YobG9nKSE9PSd1bmRlZmluZWQnKXtcXG4gICAgICAgICAgICAgICAgbG9nKHN0cik7XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGZiYS5sb2coc3RyKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICBmb3IgKGxldCBkbVVybCBvZiBkbVVybHMpIHtcXG4gICAgICAgICAgICBpZiAoKG5ldyBSZWdFeHAoZG1VcmwpKS50ZXN0KHZpZGVvVXJsKSkgey8v5pKt5pS+5Zyw5Z2A5YyF5ZCr5ZCK5q+b5qCH5b+X55qE5Zyw5Z2AXFxuICAgICAgICAgICAgICAgIHByaW50KCflkIrmr5vop4bpopEs6Ieq5Yqo6L+H5rukOicrdmlkZW9VcmwpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHByaW50KCfpnZ7lkIrmr5vop4bpopEs5Y+v5pKt5pS+OicrdmlkZW9VcmwpO1xcbiAgICAgICAgcmV0dXJuIGZhbHNlXFxuICAgIH1cXG5cXG4gICAgZnVuY3Rpb24gaXNEbShyZXQpIHtcXG4gICAgICAgIGlmICghcmV0KSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRydWVcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBoYXNEbShyZXQuc3BsaXQoJyMnKVswXS5zcGxpdCgn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mKGZiYSk9PSd1bmRlZmluZWQnfHwhZmJhKXtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBmYmEgPSBmeV9icmlkZ2VfYXBwO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVxdWVzdCk9PSd1bmRlZmluZWQnfHwhcmVxdWVzdCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmYmEuZ2V0SW50ZXJuYWxKcygpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZmJhLnB1dFZhcihcXFwiX3g1anhVcmxcXFwiLHBsYXlVcmwpO1xcbiAgICAgICAgICAgICAgICBpZih3aW5kb3cuY291bnQgPT0gbnVsbCl7XFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQ9MTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgdGV4dD0nJztcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcbiAgICAgICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09PTEpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZj1mYmEuZ2V0VmFyKFxcXCJfeDVqeFVybFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudCsrO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonK3dpbmRvdy5jb3VudCsnLG1heF9jb3VudDonK21heF9jb3VudCk7XFxuICAgICAgICAgICAgICAgIGlmKCB3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KXtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIui2hei/h1xcXCIrbWF4X2NvdW50KjI1MCtcXFwi5q+r56eS5pyq6I635Y+W5Yiw6LWE5rqQ5Zyw5Z2A77yM6Lez5Yiw5rqQ572R6aG1LOS7peS4i+aYr+WKoOi9vei/h+eahOWcsOWdgFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2codGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKEpTT04uc3RyaW5naWZ5KF9nZXRVcmxzKCkpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYmEuZ2V0VmFyKFxcXCJfeDVqeFVybFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucGF1c2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHZpZGVvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcInZpZGVvXFxcIiksIGF1ZGlvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImF1ZGlvXFxcIiksIHYyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiZW1iZWRcXFwiKSwgdjMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCIjcGxheWVyXFxcIik7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwoYXVkaW9zLCBmdW5jdGlvbiAoYXVkaW8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUoYXVkaW8pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjIsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhKU09OLnN0cmluZ2lmeSh1cmxzKSk7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gdXJscykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3VybD1cXFxcLy8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBob3N0K3Uuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwidmlk5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5YW25LuW5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vfGluZGV4XFxcXC5tM3U4JFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFwvMVxcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSxyZWNoYW5nZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlYWxVcmwpPT0nc3RyaW5nJyYmIWlzQmFkVmlkZW8odSkpey8v6L+H5ruk5ZCK5q+b6KeG6aKRXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnlfYnJpZGdlX2FwcC5zZXRXZWJVYShQQ19VQSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihmYmEuZ2V0SGVhZGVyVXJsKSE9PSd1bmRlZmluZWQnJiZ0eXBlb2YocmVjaGFuZ2UpIT09J2Z1bmN0aW9uJyl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodS5yZXBsYWNlKFxcXCI7e1xcXCIsXFxcIiNpc1ZpZGVvPXRydWUjO3tcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodXJsc1tpXSkucmVwbGFjZSgnO3snLCcjaWdub3JlSW1nPXRydWUjI2lzVmlkZW89dHJ1ZSM7eycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUxID0gYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUyID0gJyNpZ25vcmVJbWcnK2JhY2tVcmwuc3BsaXQoJyNpZ25vcmVJbWcnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1cXFxcLy8udGVzdCh1MSkmJi9cXFxcLm0zdTgvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdDEgPSB1MS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBob3N0MSt1MS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gXFxcImh0dHBcXFwiK3UxLnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tVcmwgPSB1MSArIHUyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZygn6L+U5Zue6Ieq5Yqo5YqgY29va2ll6ZO+5o6lOicrYmFja1VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKCfov5Tlm57pk77mjqU6Jyt1Kyflubboh6rliqjliqDkuoZjb29raWUs5YW35L2TY29va2ll5Zyo6KeG6aKR5pKt5pS+5aSE5p+l55yLJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFja1VybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6L+U5Zue5LuT5bqTeDXlhY3ll4Xnu5Pmnpw6XFxcIityZWFsVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFsVXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgLy8gZnlfYnJpZGdlX2FwcC5sb2coJ3g15aSn6IyD5Zu06ZSZ6K+vOicrZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgYWxlcnQoJ3g15aSn6IyD5Zu06ZSZ6K+vOicrZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aKpemUmee7k+adn3g1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0saXNWaWRlbyxyZWNoYW5nZSxwbGF5VXJsLG1heF9jb3VudCxQQ19VQSxpc0JhZFZpZGVvKTtcXG4gICAgICAgIGxldCB1c2VXZWI9bHNnLmdldEl0ZW0oXFxcIumAmuWFjVxcXCIsXFxcIlg1XFxcIik9PT1cXFwiV0VCXFxcIjtcXG4gICAgICAgIC8vbG9nKFxcXCLku5PlupPkvb/nlKh3ZWLpgJrlhY3mm7/ku6N4NTpcXFwiK3VzZVdlYik7XFxuICAgICAgICBsZXQgcnVsZUhlYWQ9dXNlV2ViJiZ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AgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgaWYoL+inpuWPkeS6humYsuebl+mTvnzmnKrmjojmnYN85o6l5Y+j6Ziy55uXLy50ZXN0KHRleHQpJiZ3aW5kb3cuY291bnQ9PTEpe1xcbiAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHdpbmRvdy5jb3VudCsrO1xcbiAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50OicgKyB3aW5kb3cuY291bnQgKyAnLG1heF9jb3VudDonICsgbWF4X2NvdW50KTtcXG4gICAgICAgICAgICBpZiAod2luZG93LmNvdW50ID49IG1heF9jb3VudCkge1xcbiAgICAgICAgICAgICAgICBmYmEuY2xlYXJWYXIoJ3g1TGlzdCcpO1xcbiAgICAgICAgICAgICAgICBmYmEuaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgbGV0IGZtc2cgPSAn6YGT6ZW/5LuT5bqT6YCa5YWN6Kej5p6Q5aSx6LSlLOWOn+WboDrotoXml7YnK3g1VGltZW91dCsn5q+r56eSJztcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhmbXNnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrZm1zZztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxuICAgICAgICB9XFxuXFxuICAgICAgICBmdW5jdGlvbiBtdXRlTWUoZWxlbSkge1xcbi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jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gdXJscykge1xcbiAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcbiAgICAgICAgICAgICAgICAvL3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO1xcbiAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cFxcXCIrdS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coXFxcIuWFtuS7luWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXC8xXFxcXC5tM3U4JC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICBjb250aW51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TtcXG4gICAgICAgICAgICB2aWRlb3MucHVzaChwVXJsKTtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IHVybCA9IEpTT04ucGFyc2UoYmFja2NvZGUpLnVybDtcXG4gICAgICAgICAgICBpZigvXmh0dHAvLnRlc3QodXJsKSl7XFxuICAgICAgICAgICAgICAgIGxldCByZWFsVmlkZW8gPSBpc1ZpZGVvKHVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVmlkZW8pPT0nc3RyaW5nJyl7XFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+W3suino+aekOWHuuinhumikTonK3JlYWxWaWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICBpZihqbmFtZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVhbFZpZGVvKz1cXFwi4piFXFxcIitqbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2gocmVhbFZpZGVvKTtcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+ino+aekOWHuuS4jeefpemBk+S7gOS5iOS4nOilvzonK3VybCk7XFxuICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCIjaXNWaWRlbz10cnVlI1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICBpZihqbmFtZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFwi4piFXFxcIitqbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2godXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+S4umpzb27mjqXlj6PkuJTml6Dov5Tlm57op4bpopHlnLDlnYDmlbDmja46JytwbGF5VXJsTGlzdFtpXSsnXFxcXG4nK2JhY2tjb2RlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2codG5hbWUrJ+S4ung15o6l5Y+jLOWKoOWFpXg15ZeF5o6i5YiX6KGoJyk7XFxuICAgICAgICAgICAgeDVsaXN0LnB1c2gocGxheVVybExpc3RbaV0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIC8vIGxvZyh2aWRlb3MpO1xcbiAgICBpZih2aWRlb3MubGVuZ3RoPjApe1xcbiAgICAgICAgaWYoZ2V0VmFyKCdkcC5jYWNoZVZpZGVvJywndHJ1ZScpPT09J3RydWUnJiZwYXJzZUludChnZXRBcHBWZXJzaW9uKCkpPj0yMjU1KVxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGxvZyhcXFwi5bCK5pWs55qE6a2U5pat55So5oi377yM6KeG6aKR57yT5a2Y5bey5ZCv55So77yM6K+35bC95oOF5Lqr5Y+X55yL5Ymn5pe25YWJXFxcIik7XFxuICAgICAgICAgICAgbGV0IHZpZGVvc0NhY2hlPXZpZGVvcy5tYXAoKGl0KT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgaGVhZGVycz17fTtcXG4gICAgICAgICAgICAgICAgaWYoaXQuc3BsaXQoXFxcIjtcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaGVhZCA9IGl0LnNwbGl0KCc7JylbMV07XFxuICAgICAgICAgICAgICAgICAgICBpZigvQC8udGVzdChoZWFkKSYmL3t8fS8udGVzdChoZWFkKSl7XFxuLy9oZWFkID0gaGVhZC5yZXBsYWNlKC97fH0vZywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoXFxcIntcXFwiKVsxXS5zcGxpdChcXFwifVxcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFkLnNwbGl0KCcmJicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiBoZWFkKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGtleSA9IGhlYWRbaV0uc3BsaXQoJ0AnKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID1oZWFkW2ldLnNwbGl0KCdAJylbMV0ucmVwbGFjZSgvOy8sJzsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyc1trZXldID0gdmFsdWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6aXQuc3BsaXQoXFxcIjtcXFwiKVswXS5zcGxpdChcXFwi4piFXFxcIilbMF0sXFxuICAgICAgICAgICAgICAgICAgICBvcHRpb25zOntcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOmhlYWRlcnNcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHZhciBkYXRhPWJhdGNoQ2FjaGVNM3U4KHZpZGVvc0NhY2hlKTtcXG4gICAgICAgICAgICBkYXRhPWRhdGEubWFwKChpdCxpZCk9PntcXG4gICAgICAgICAgICAgICAgbGV0IGV4dHJhPVxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICBpZih2aWRlb3NbaWRdLnNwbGl0KFxcXCI7XFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcIjtcXFwiK3ZpZGVvc1tpZF0uc3BsaXQoXFxcIjtcXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYodmlkZW9zW2lkXS5zcGxpdChcXFwi4piFXFxcIikubGVuZ3RoPjEpe1xcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE9XFxcIuKYhVxcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFwi4piFXFxcIilbMV07XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgaWYoaXQrXFxcIlxcXCIhPVxcXCJudWxsXFxcIil7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXQrZXh0cmFcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdmlkZW9zW2lkXVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgLy9sb2coZGF0YSk7XFxuICAgICAgICAgICAgcmV0dXJuIGRhdGFcXG4gICAgICAgICAgICAvL3JldHVybiB2aWRlb3NcXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHJldHVybiB2aWRlb3NcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBsb2coJ+WFseaciScreDVsaXN0Lmxlbmd0aCsn5LiqeDXlnLDlnYDov5vooYzova7mtYHll4XmjqInKTtcXG4gICAgLy/msqHmnInnmoTor53lsLHlvIDlp4vkvp3mrKF4NeWXheaOolxcbiAgICBzaG93TG9hZGluZygn5ZeF5o6i5Lit77yM6Iul5aSx6LSl5bCx5YiH5o2id2Vi5ZeF5o6iLi4uJyk7XFxuICAgIHJldHVybiB4NVBhcnNlUHJvKHg1bGlzdCx4NVRpbWVvdXQsaXNWaWRlbyk7XFxufVxcbnZhciBsYXp5PSQoJycpLmxhenlSdWxlKCgpPT57XFxuICAgIHRyeXtcXG4gICAgICAgIHJlYWxVcmw9aW5wdXQ7XFxuICAgICAgICBldmFsKFxcXCJ2YXIgY29uZmlnX2RwID1cXFwiICsgZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcIikpO1xcbiAgICAgICAg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a2VyOi8vcGFnZS91dGlsaXk/cnVsZT3pgZPplb/ku5PlupNQcm9cXFwiKTtcXG4gICAgbGV0IGhvdXNlRmlsZSA9IGdldEZpbGV8fGZhbHNlO1xcbiAgICBpZighaG91c2VGaWxlKXtcXG4gICAgICAgIHNldEl0ZW0oJ2lzX2hvdXNlX3ZpcCcsICdmYWxzZScpO1xcbiAgICB9XFxuICAgIGxldCBob3VzZV9kYXRhID0gaG91c2VGaWxlKCk7XFxuICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KHRhc2tfYXBpLCB7XFxuICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgfSxcXG4gICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiZGF0YVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ0eXBlXFxcIjogdGFzay5tb2RlfHwncnVuJyxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJmdW5jXFxcIjogdGFzay5mdW5jfHwnJyxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB0YXNrLnBhcmFtc3x8W11cXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgXFxcImF1dGhcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGhvdXNlX2RhdGEudXNlcm5hbWV8fFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogaG91c2VfZGF0YS5wYXNzd29yZHx8XFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pLFxcbiAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgfSk7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SBnZXRNeVZhcihcXFwiZGV2X3NldF9pbmZvXFxcIikuc3BsaXQoJyQkJyk7XFxuICAgICAgICBsZXQgaW5wdXRfdGV4dCA9IGdldE15VmFyKCdkZXZJbmZvJywgJycpO1xcbiAgICAgICAgaWYoaW5wdXRfdGV4dC5sZW5ndGggPj0gNCl7XFxuICAgICAgICAgICAgbGV0IGluZm9fc2V0X3VybD0gZGV2X3NldF9pbmZvWzJdO1xcbiAgICAgICAgICAgIGxldCBzZW5kX2RhdGEgPSB7XFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICB7XFxcImRhdGFcXFwiOiB7XFxcImluZm9cXFwiOiBpbnB1dF90ZXh0fSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IGRldl9zZXRfaW5mb1swXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBkZXZfc2V0X2luZm9bMV19XFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAvLyBsb2coc2VuZF9kYXRhKTtcXG4gICAgICAgICAgICBsZXQgcGFyMiA9IHtoZWFkZXJzOnsnY29udGVudC10eXBlJzonYXBwbGljYXRpb24vanNvbjtjaGFyc2V0PVVURi04JywnVXNlci1BZ2VudCc6ZGV2X3NldF9pbmZvWzNdfSxib2R5OkpTT04uc3RyaW5naWZ5KHNlbmRfZGF0YSksbWV0aG9kOidQT1NUJ307XFxuICAgICAgICAgICAgLy8gcGFyMiA9IEpTT04uc3RyaW5naWZ5KHBhcjIpOyAvL3g16YeM6Z2i6K+35rGC5omN6ZyA6KaB57yW56CBXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfcmV0ID0gcmVxdWVzdChpbmZvX3NldF91cmwsIHBhcjIpO1xcbiAgICAgICAgICAgICAgICBiYWNrX3JldCA9IEpTT04ucGFyc2UoYmFja19yZXQpLnJlc3VsdDtcXG4gICAgICAgICAgICAgICAgaWYoYmFja19yZXQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgICAgICAgICAvLyByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/neWtmOaIkOWKn1xcXFxuJytiYWNrX3JldC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S/neWtmOWksei0pVxcXFxuJytiYWNrX3JldC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr1xcXFxuJytlLm1lc3NhZ2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgY29uZmlybSh7dGl0bGU6J+mBk+mVv+aPkOekuicsY29udGVudDon6Jm954S25L2g5b6I5oeS77yM5L2G5piv5YWs5ZGK6Iez5bCR5YaZNOS4quWtl+WQp++8gSd9KTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9XFxuICAgIH0pXFxufSk7XFxuXFxuc2V0UmVzdWx0KGQpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6aKE5aSE55CG5L6d6LWW5paH5Lu2XCIsXCJwYXRoXCI6XCJsaWJzXCIsXCJydWxlXCI6XCJpZihnZXRBcHBWZXJzaW9uKCk+PTMyMDApe1xcbiAgICB0cnl7XFxuICAgICAgICByYyhcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9qcy8kaGlrZXIuanNcXFwiLCAtMSk7XFxuICAgICAgICAvLyQuc2V0Um9vdCgnaHR0cHM6Ly9oamRobnguY29kaW5nLm5ldC9wdWJsaWMvaGlrZXIvaGlrZXIvZ2l0L2ZpbGVzL21hc3Rlci9qc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gLy/lhpnpobXmupDnpZ7lmajlsI/nqIvluo9cXG4gICAgICAgICAgICBob3VzZUxhenk6IFxcXCJob3VzZUxhenkuanNcXFwiLCAvL+S7k+W6k+mAmuWFjVxcbiAgICAgICAgICAgIGxhenk6IFxcXCJsYXp5LmpzXFxcIiwgLy/pppnlhY1cXG4gICAgICAgICAgICBzdWI6IFxcXCJzdWIuanNcXFwiLCAvL+mBk+W+t+e7j+iuoumYhVxcbiAgICAgICAgICAgIGhpa2VyVWk6IFxcXCJoaWtlclVpLmpzXFxcIiwgLy/mtbfpmJTnu4Tku7bkvp3otZZcXG4gICAgICAgICAgICBoaWtlckxpYnM6IFxcXCJoaWtlckxpYnMuanNcXFwiLCAvL+a1t+mYlOWFqOiDveS+nei1llxcbiAgICAgICAgfSk7XFxuICAgIH1jYXRjaChlKXtcXG4gICAgICAgIC8vdG9hc3QoJ+ivt+WwneivleeCueWHu+S7k+W6k+S4u+mhteeahOWNh+e6p+S7k+W6k+aXgei+ueeahOaMiemSruWNh+e6pyTmianlsZXvvIzlkKbliJnmn5Dkupvlip/og73kuI3og73mraPluLjkvb/nlKgnKTtcXG4gICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgIHRpdGxlOiAn5o+Q56S6LeeCueWHu+ehruWumuWPr+S7peWvvOWFpScsXFxuICAgICAgICAgICAgY29udGVudDogJ+ivt+WwneivleeCueWHu+S7k+W6k+S4u+mhteeahOWNh+e6p+S7k+W6k+aXgei+ueeahOaMiemSruWNh+e6pyTmianlsZXvvIzlkKbliJnmn5Dkupvlip/og73kuI3og73mraPluLjkvb/nlKgnLFxcbiAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKCk9PntcXG4gICAgICAgICAgICAgICAgY29uc3Qge2dldEFwaX0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS91dGlsaXk/cnVsZT3pgZPplb/ku5PlupNQcm9cXFwiKTtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVI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FxuXFxuJC5leHBvcnRzLnNob3cgPSBmdW5jdGlvbihhcnIsIHRleHQsIGNvbG9yLCB1cmwsIGNvbnRlbnQpIHtcXG4gICAgdmFyIGh0bWwgPSBnZXRIdG1sKHRleHQgfHwgJ+i/meaYr+i3kemprOeBr+m7mOiupOeahOaWh+Wtl++8jOWPr+S7peiHquihjOabv+aNouOAgicsIGNvbG9yIHx8ICdyZWQnKTtcXG4gICAgYXJyLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ4NV93ZWJ2aWV3X3NpbmdsZVxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJhYm91dDpibGFua1xcXCIsXFxuICAgICAgICBkZXNjOiBcXFwiNTAmJmxpc3RcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygoaCwgdXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIHZhciBodG1sID0gZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50O1xcbiAgICAgICAgICAgICAgICBodG1sLmlubmVySFRNTCA9IGg7XFxuXFxuICAgICAgICAgICAgICAgIGNvbnN0IHRleHRDb250YWluZXIgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgndGV4dENvbnRhaW5lcicpO1xcbiAgICAgICAgICAgICAgICBjb25zdCB0ZXh0ID0gdGV4dENvbnRhaW5lci5pbm5lckhUTUw7XFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIub25jbGljaz1mdW5jdGlvbigpe1xcbiAgICAgICAgICAgICAgICAgICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSB1cmx8fFxcXCJhYm91dDpibGFuay9ub3RpY2VcXFwiO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vIOiuvue9ruaWh+acrOWuueWZqOWuveW6puS4uuaWh+acrOWGheWuueeahOWuveW6plxcbiAgICAgICAgICAgICAgICB0ZXh0Q29udGFpbmVyLnN0eWxlLndpZHRoID0gYCR7dGV4dENvbnRhaW5lci5vZmZzZXRXaWR0aH1weGA7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOWkjeWItuaWh+acrOWGheWuueW5tui/veWKoOWIsOaWh+acrOWuueWZqOWQjumdolxcbiAgICAgICAgICAgICAgICB0ZXh0Q29udGFpbmVyLmlubmVySFRNTCArPSAnICcgKyB0ZXh0O1xcblxcbiAgICAgICAgICAgICAgICAvLyDliqjmgIHorqHnrpfliqjnlLvmjIHnu63ml7bpl7RcXG4gICAgICAgICAgICAgICAgY29uc3QgZHVyYXRpb24gPSAodGV4dENvbnRhaW5lci5vZmZzZXRXaWR0aCAvIHRleHRDb250YWluZXIucGFyZW50RWxlbWVudC5vZmZzZXRXaWR0aCkgKiAxMDtcXG5cXG4gICAgICAgICAgICAgICAgdmFyIHN0eWxlRWxlbWVudHMgPSBkb2N1bWVudC5oZWFkLmdldEVsZW1lbnRzQnlUYWdOYW1lKCdzdHlsZScpO1xcblxcblxcbiAgICAgICAgICAgICAgICBzdHlsZUVsZW1lbnRzWzJdLmlubmVySFRNTCA9IGAubWFycXVlZSBzcGFuIHtcXG4gICAgICAgICAgICAgICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcXG4gICAgICAgICAgICAgICAgICAgIHBhZGRpbmctbGVmdDogMTAwJTtcXG4gICAgICAgICAgICAgICAgICAgIGFuaW1hdGlvbjogbWFycXVlZSAke2R1cmF0aW9ufXMgbGluZWFyIGluZmluaXRlXFxuICAgICAgICAgICAgICAgIH1gO1xcblxcbiAgICAgICAgICAgIH0sIGh0bWwsIHVybCksXFxuICAgICAgICAgICAgdXJsSW50ZXJjZXB0b3I6ICQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0PT09XFxcImFib3V0OmJsYW5rL25vdGljZVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKChjb250ZW50KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmJhLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWFrOWRilxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHkjbm9SZWNvcmRIaXN0b3J5IyNub0hpc3RvcnkjJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmluZFJ1bGU6IFxcXCJqczpcXFwiICsgJCQkLnRvU3RyaW5nKChjb250ZW50KSA9PiBzZXRSZXN1bHQoW3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBjb250ZW50LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XSksY29udGVudClcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBjb250ZW50KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sIGNvbnRlbnQgfHwgdGV4dCksXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn1cIn1dIiwiaWNvbiI6Imh0dHBzOi8vZ2l0Y29kZS5uZXQvcXFfMzIzOTQzNTEvZHIvLS9yYXcvbWFzdGVyL2ltZy/pgZPplb/ku5PlupMuc3ZnIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment