xiaomianao666

小程序:道长仓库Pro

Nov 10th, 2024
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJmaXJzdEhlYWRlciI6InNvcnQiLCJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6YGT6ZW/5LuT5bqTUHJvIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTY0LCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuY29uc3Qge1xuICAgIGdldEFwaSxcbiAgICBjb2xvcixcbiAgICBzbWFsbCxcbiAgICBnZXRGaWxlLFxuICAgIGh0bWxUYWcsXG4gICAgYXBpLFxuICAgIG1kXG59ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVwiKTtcbnZhciByID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2Uvbm90aWNlJyk7XG5cblxuY29uc3QgbHNnID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL2xvY2FsU3RvcmFnZT9ydWxlPemBk+mVv+S7k+W6k1Byb1wiKTtcbmxldCBjbGFzc0EgPSBnZXRWYXIoXCJXYXJlaG91c2UuY2xhc3NcIiwgXCIwXCIpO1xubGV0IGxpc3RVcmwgPSBnZXRBcGkoXCJ1c2Vyc1VybFwiKSArIGNsYXNzQSxcbiAgICBteVVybCA9IGdldEFwaShcImRldlNlbGZcIiksXG4gICAgbm90aWNlVXJsID0gZ2V0QXBpKFwibm90a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AgIF1cbiAgICBmb3IgKGxldCBpdGVtIG9mIGNsYXNzVGFiKSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogaXRlbVsxXSA9PT0gY2xhc3NBID8gXCLigJzigJxcIiArIGl0ZW1bMF0gKyBcIuKAneKAnVwiIDogaXRlbVswXSxcbiAgICAgICAgICAgIHVybDogJChcIiNub0xvYWRpbmcjXCIpLmxhenlSdWxlKChrZXkpID0+IHtcbiAgICAgICAgICAgICAgICBwdXRWYXIoXCJXYXJlaG91c2UuY2xhc3NcIiwga2V5KTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9lbXB0eVwiO1xuICAgICAgICAgICAgfSwgaXRlbVsxXSksXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiBcIuWFqOmDqOinhOWImVwiLFxuICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL0FsbFB1YmxpY1J1bGU/dXJsPWhpa2VyOi8vZW1wdHkjZnlwYWdlI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1wiLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogXCLliLfmlrDkvp3otZZcIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChqc29uVXJsKSA9PiB7XG4gICAgICAgICAgICBqc29uVXJsID0ganNvblVybCArICcyNTA1JztcbiAgICAgICAgICAgIC8vIGxvZyhqc29uVXJsKTtcbiAgICAgICAgICAgIGxldCB0ZXh0ID0gcmVxdWVzdChqc29uVXJsKTtcbiAgICAgICAgICAgIGl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NlKTtcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oJ3NvcnQnLCB7XG4gICAgICAgICAgICAgICAgdGl0bGU6IFwi5o6S5bqPOlwiICsgY29sb3IobmV4dCwgXCIjZmY3MDAwXCIpXG4gICAgICAgICAgICB9KVxuICAgICAgICAgICAgcmV0dXJuIFwidG9hc3Q6Ly/lt7Lorr7nva7ku5PlupPlvIDlj5HogIXop4TliJnmjpLluo/mqKHlvI/kuLo6XCIgKyBuZXh0O1xuICAgICAgICB9LCBjb2xvciksXG4gICAgICAgIGV4dHJhOiB7XG4gICAgICAgICAgICBpZDogJ3NvcnQnXG4gICAgICAgIH1cbiAgICB9KTtcbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogY29sb3IoXCLku5PlupPlhazlkYpcIiwgXCIjZmY3MDAwXCIpLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCIsXG4gICAgICAgIHVybDogJCgnaGlrZXI6Ly9lbXB0eSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSMnKS5ydWxlKChtZCkgPT4ge1xuICAgICAgICAgICAgcmVxdWlyZShtZCk7XG4gICAgICAgICAgICBsZXQgZCA9IFtdO1xuICAgICAgICAgICAgbGV0IOS7k+W6k+WFrOWRiiA9IFwi5pqC5peg5YWs5ZGKXCI7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIOS7k+W6k+WFrOWRiiA9IGZldGNoKCdodHRwczovL2dpdGNvZGUubmV0L3FxXzMyMzk0MzUxL2RyLy0vcmF3L21hc3Rlci9qcy/ku5PlupPlhazlkYoubWQnKTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgICAgICBpZiAo5LuT5bqT5YWs5ZGKKSB7XG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IG1hcmtlZC5wYXJzZSjku5PlupPlhazlkYopLFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXG4gICAgICAgICAgICAgICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZXRSZXN1bHQoZCk7XG4gICAgICAgIH0sIG1kKVxuICAgIH0pO1xuXG4gICAgZGF0YS5wdXNoKHtcbiAgICAgICAgdGl0bGU6IGNvbG9yKFwi5Y2H57qn5LuT5bqTXCIsIFwiIzE1YWIyMVwiKSxcbiAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgICAgIGdldEFwaVxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS91dGlsaXlcIik7XG4gICAgICAgICAgICBsZXQgcnVsZUhlYWQgPSAn5rW36ZiU6KeG55WM6aaW6aG16aKR6YGT6KeE5YiZ44CQ6YGT6ZW/5LuT5bqTUHJv44CR77+laG9tZV9ydWxlX3VybO+/pSc7XG4gICAgICAgICAgICBsZXQgdXJsID0gZ2V0QXBpKCdpbXBvcnRVcmwnKSArIFwiMTA5NFwiO1xuICAgICAgICAgICAgbGV0IGltcG9ydFVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShydWxlSGVhZCArIHVybCk7XG4gICAgICAgICAgICByZXR1cm4gaW1wb3J0VXJsXG4gICAgICAgIH0pXG4gICAgfSk7XG5cbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogY29sb3IoXCLljYfnuqck5omp5bGVXCIsIFwiIzE1YWIyMVwiKSxcbiAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKCkgPT4ge1xuICAgICAgICAgICAgY29uc3Qge1xuICAgICAgICAgICAgICAgIGdldEFwaVxuICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcImhpa2VyOi8vcGFnZS91dGlsaXlcIik7XG4gICAgICAgICAgICBsZXQgcnVsZUhlYWQgPSAn5rW36ZiU6KeG55WM77yM572R6aG15o+S5Lu277+lanNfdXJs77+lJGhpa2VyQCc7XG4gICAgICAgICAgICBsZXQgdXJsID0gZ2V0QXBpKCdpbXBvcnRVcmwnKSArIFwiNTExMVwiO1xuICAgICAgICAgICAgbGV0IGltcG9ydFVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShydWxlSGVhZCArIHVybCk7XG4gICAgICAgICAgICByZXR1cm4gaW1wb3J0VXJsXG4gICAgICAgIH0pXG4gICAgfSk7XG5cbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKCkgPT4ge1xuICAgICAgICBjbGVhclZhcihcIldhcmVob3VzZS5jbGFzc1wiKTtcbiAgICB9KSk7XG4gICAgbGV0IHtcbiAgICAgICAgdXNlcm5hbWUsXG4gICAgICAgIHBhc3N3b3JkLFxuICAgICAgICB1c2VyXG4gICAgfSA9IGdldEZpbGUoKTtcblxuICAgIGxldCBpc19sb2dpbiA9IGZhbHNlO1xuICAgIGxldCBpc19tYW5hZ2VyID0gZmFsc2U7XG4gICAgaWYgKHVzZXJuYW1lICE9PSB2b2lkIDAgJiYgcGFzc3dvcmQgIT09IHZvaWQgMCkge1xuICAgICAgICBteVVybCArPSAnP3FxPScgKyB1c2VybmFtZSArICcmcGFzc3dvcmQ9JyArIHBhc3N3b3JkO1xuICAgICAgICBsZXQgY29kZV9zdHIgPSByZXF1ZXN0KG15VXJsLCB0bXBfaGVhZGVycyk7XG4gICAgICAgIGxldCBjb2RlID0ge307XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlX3N0cik7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHt9XG4gICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCAmJiBjb2RlLnJlc3VsdC5hY3RpdmUpIHtcbiAgICAgICAgICAgIGlzX2xvZ2luID0gdHJ1ZTtcbiAgICAgICAgICAgIGlmIChjb2RlLnJlc3VsdC5pc19tYW5hZ2VyKSB7XG4gICAgICAgICAgICAgICAgaXNfbWFuYWdlciA9IHRydWU7XG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS5pc19tYW5hZ2VyJywgJ+ecnycpO1xuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2UudXNlcm5hbWUnLCB1c2VybmFtZSk7XG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS5wYXNzd29yZCcsIHBhc3N3b3JkKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgcHV0VmFyKCdob3VzZS5pc19tYW5hZ2VyJywgJycpO1xuICAgICAgICAgICAgICAgIGNsZWFyVmFyKCdob3VzZS51c2VybmFtZScpO1xuICAgICAgICAgICAgICAgIGNsZWFyVmFyKCdob3VzZS5wYXNzd29yZCcpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIGlmIChpc19sb2dpbikge1xuICAgICAgICB0cnkge1xuICAgICAgICAgICAgbm93Q29uID0gSlNPTi5wYXJzZShyZXF1ZXN0KGdldEFwaShcIm5vd0NvblVybFwiKSwgdG1wX2hlYWRlcnMpKS5yZXN1bHQ7XG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIG5vd0NvbiA9ICfmnKrnn6UnO1xuICAgICAgICB9XG4gICAgICAgIGxldCBkZXZEYXRhID0gdXNlckxpc3QuZmluZChpdGVtID0+IGl0ZW0ucXEgPT09IHVzZXJuYW1lKTtcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiAnPHN0cm9uZz48c3BhbiBzdHlsZT1cIm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xlOiBzbWFsbChjb2xvcihcIuW8gOWPkeiAheeZu+W9lVwiLCBcIiMwMEJGRkZcIikpLFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcbiAgICAgICAgICAgIGRlc2M6IHNtYWxsKFwi546w5pyJXCIgKyBjb2xvcih1c2VyTGlzdC5sZW5ndGgsIFwiI2ZmNzAwMFwiKSArIFwi5ZCN5byA5Y+R6ICF77yMXCIgKyBjb2xvcihydWxlQ291bnRbMF0sIFwiI2ZmNzAwMFwiKSArIFwi5p2h5YWs5byA6KeE5YiZ77yMXCIgKyBjb2xvcigwLCBcIiNmZjcwMDBcIikgKyBcIuadoembhuiKs+mYgeinhOWImeOAglwiKSxcbiAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvZGV2TG9naW5cIlxuICAgICAgICB9KTtcbiAgICB9XG4gICAgaWYgKEFycmF5LmlzQXJyYXkodXNlcikgJiYgdXNlci5sZW5ndGggPT09IDIpIHtcbiAgICAgICAgbGV0IHVzZXJsb2dpbiA9IHJlcXVlc3QoYXBpLmRpc19sb2dpbiwge1xuICAgICAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XG4gICAgICAgICAgICAgICAgXCJwYXJhbXNcIjoge1xuICAgICAgICAgICAgICAgICAgICBcInFxXCI6IHVzZXJbMF0sXG4gICAgICAgICAgICAgICAgICAgIFwiYXV0aF9jb2RlXCI6IHVzZXJbMV1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KSxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnLFxuICAgICAgICAgICAgdGltZW91dDogdGltZW91dFxuICAgICAgICB9KTtcbiAgICAgICAgdXNlcmxvZ2luID0gSlNPTi5wYXJzZSh1c2VybG9naW4pLnJlc3VsdDtcbiAgICAgICAgaWYgKHVzZXJsb2dpbi5zdGF0dXMgPT09IDApIHtcbiAgICAgICAgICAgIHVzZXJsb2dpbiA9IHVzZXJsb2dpbi5yZXN1bHRcbiAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJsb2dpbi5uYW1lICsgXCImbmJzcDsmbmJzcDtcIiArIHVzZXJsb2dpbi5xcSArIFwiJm5ic3A7Jm5ic3A7Jm5ic3A7Jm5ic3A7PHNtYWxsPjx1PuabtOaNoui0puWPtyA+PC91Pjwvc21hbGw+XCIsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInLFxuICAgICAgICAgICAgICAgIHBpY191cmw6IHVzZXJsb2dpbi5hdmF0YXJfdXJsLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvVXNlcnJlZ2lzdHJhdGlvblwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIGRhdGEuc3BsaWNlKDMsIDAsIHtcbiAgICAgICAgICAgICAgICB0aXRsZTogdXNlcmxvZ2luLmhhc19yZXBseSA/IFwi8J+GleWbnuWkjVwiIDogXCLwn5SU5Zue5aSNXCIsXG4gICAgICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9NeVJlcGx5P3VybD1oaWtlcjovL2VtcHR5I2Z5cGFnZSNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSNcIixcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCIsXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgYXV0aF9jb2RlOiB1c2VyWzFdLFxuICAgICAgICAgICAgICAgICAgICBxcTogdXNlclswXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgICAgICB0aXRsZTogdXNlcmxvZ2luLmRldGFpbCxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxuICAgICAgICAgICAgICAgIGRlc2M6IFwi4oCc4oCc4oCd4oCdPHNtYWxsPjx1PumHjeaWsOiOt+WPlumqjOivgeeggSA+PC91Pjwvc21hbGw+XCIsXG4gICAgICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9Vc2VycmVnaXN0cmF0aW9uXCJcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBcIuivhOiuuueZu+W9lS/ms6jlhoxcIixcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXG4gICAgICAgICAgICBkZXNjOiBcIlwiLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9Vc2VycmVnaXN0cmF0aW9uXCJcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGZvciAodmFyIGl0ZW0gb2YgdXNlckxpc3QpIHtcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLm5hbWUgKyBcIihcIiArIGl0ZW0ucnVsZV9udW0gKyBcIilcIixcbiAgICAgICAgICAgIGRlc2M6IGl0ZW0uaWQgKyAnOicgKyBpdGVtLm5pY2tfbmFtZSxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyLFxuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9ydWxlcyNub0hpc3RvcnkjXCIsXG4gICAgICAgICAgICBleHRyYToge1xuICAgICAgICAgICAgICAgIGF2YXRhclVybDogaXRlbS5hdmF0YXIsXG4gICAgICAgICAgICAgICAgcXE6IGl0ZW0ucXEsXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0uaWQsXG4gICAgICAgICAgICAgICAgY2FuX3VwbG9hZDogaXRlbS5jYW5fdXBsb2FkXG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIGNvbF90eXBlOiAnbG9uZ190ZXh0J1xuICAgIH0pO1xuICAgIHNldFJlc3VsdChkYXRhKTtcbiAgICB0cnkge1xuICAgICAgICBsZXQgaW1nID0gW1xuICAgICAgICAgICAgW1xuICAgICAgICAgICAgICAgIFwiaGlrZXI6Ly9maWxlcy9pY29uL+i1ni5zdmdcIiwgXCJodHRwOi8vaGlrZXIubm9raWEucHJlc3MvaGlrZXJ1bGUvcnVsZWxpc3QuanNvbj9pZD02NzU2XCJcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBbXG4gICAgICAgICAgICAgICAgXCJoaWtlcjovL2ZpbGVzL2ljb24v6LipLnN2Z1wiLCBcImh0dHA6Ly9oaWtlci5ub2tpYS5wcmVzcy9oaWtlcnVsZS9ydWxlbGlzdC5qc29uP2lkPTY3NTdcIlxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIFtcbiAgICAgICAgICAgICAgICBcImhpa2VyOi8vZmlsZXMvaWNvbi/or4Torrouc3ZnXCIsIFwiaHR0cDovL2hpa2VyLm5va2lhLnByZXNzL2hpa2VydWxlL3J1bGVsaXN0Lmpzb24/aWQ9Njc1OFwiXG4gICAgICAgICAgICBdXG4gICAgICAgIF07XG4gICAgICAgIGZvciAobGV0IGl0ZW0gb2YgaW1nKSB7XG4gICAgICAgICAgICBpZiAoIWZpbGVFeGlzdChpdGVtWzBdKSkge1xuICAgICAgICAgICAgICAgIGRvd25sb2FkRmlsZShpdGVtWzFdLCBpdGVtWzBdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gY2F0Y2ggKGUpIHtcblxuICAgIH1cbn0iLCJzZWFyY2hfdXJsIjoiaGlrZXI6Ly9lbXB0eSMqKiIsImdyb3VwI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b25kcyA9IGRhdGUuZ2V0U2Vjb25kcygpKzE7XFxuICAgICAgICAgICAgaWYgKG1vbnRoID49IDEgJiYgbW9udGggPD0gOSkge1xcbiAgICAgICAgICAgICAgICBtb250aCA9IFxcXCIwXFxcIiArIG1vbnRoXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJEYXRlID49IDAgJiYgc3RyRGF0ZSA8PSA5KSB7XFxuICAgICAgICAgICAgICAgIHN0ckRhdGUgPSBcXFwiMFxcXCIgKyBzdHJEYXRlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChzdHJIb3VycyA+PSAwICYmIHN0ckhvdXJzIDw9IDkpIHtcXG4gICAgICAgICAgICAgICAgc3RySG91cnMgPSBcXFwiMFxcXCIgKyBzdHJIb3Vyc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyTWludXRlcyA+PSAwICYmIHN0ck1pbnV0ZXMgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJNaW51dGVzID0gXFxcIjBcXFwiICsgc3RyTWludXRlc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoc3RyU2Vjb25kcyA+PSAwICYmIHN0clNlY29uZHMgPD0gOSkge1xcbiAgICAgICAgICAgICAgICBzdHJTZWNvbmRzID0gXFxcIjBcXFwiICsgc3RyU2Vjb25kc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAvL2xldCBjdXJyZW50ZGF0ZSA9IGRhdGUuZ2V0RnVsbFllYXIoKSArIHNlcGVyYXRvcjEgKyBtb250aCArIHNlcGVyYXRvcjEgKyBzdHJEYXRlICsgXFxcIiBcXFwiICsgc3RySG91cnMgKyBzZXBlcmF0b3IyICsgc3RyTWludXRlcyArIHNlcGVyYXRvcjIgKyBzdHJTZWNvbmRzO1xcbiAgICAgICAgICAgIGxldCBjdXJyZW50ZGF0ZSA9IChkYXRlLmdldEZ1bGxZZWFyKCktMjAyMCkrJyc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ICAgdXJsOiBzdWJVcmwsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3J1bGVDYWNoZS9cXFwiK3RpdGxlK1xcXCIuanNvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2RlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGFjdGl2ZTogZmFsc2UsLy/npoHnlKjlubblj5Hmm7TmlrBcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgc2hhcmVUZXh0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHN1Yk9iaikpO1xcbiAgICAgICAgICAgICAgICB2YXIgcGFzdGVzID0gZ2V0UGFzdGVzKCk7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBzaGFyZVBhc3RlKHNoYXJlVGV4dCxwYXN0ZXMuc2xpY2UoLTEpWzBdKTtcXG4gICAgICAgICAgICAgICAgbGV0IGltcG9ydF9ydWxlPSBcXFwi6L275ZCI6ZuG6K6i6ZiF77yaXFxcIit0aXRsZSsnXFxcXG4nK3VybDtcXG4gICAgICAgICAgICAgICAgY29weShpbXBvcnRfcnVsZSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSAnaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3J1bGVDYWNoZS9zdWIuanNvbic7XFxuICAgICAgICAgICAgICAgICQucmMoY29uZmlnLmxpYi5zdWIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4g6K6i6ZiF5a+85YWlKHBhdGgpXFxuICAgICAgICAgICAgfSxkYXRhSXRlbSxzdWJVcmwpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuaWYgKHJ1bGVDb2RlKSB7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogX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XFxuICAgICAgICAgICAgICAgIHBhc3N3b3JkOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgdXNlcm5hbWU6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICByZXBseUlkOml0ZW0uaWRcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLmRpc2N1c3NfdGV4dCxcXG4gICAgICAgICAgICBkZXNjOiBSZXBseStpdGVtLmNyZWF0ZV9kYXRlICsgXFxcIsK3XFxcIiArIGljb25baXRlbS5kaXNjdXNzX3R5cGVdLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvaW5mb1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICB0eXBlOiBcXFwibG9uZ190ZXh0XFxcIixcXG4gICAgICAgICAgICAgICAgdGV4dDogaXRlbS5kaXNjdXNzX3RleHRcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuZGF0YS5wdXNoKHtcXG4gICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbn0pO1xcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcImljb25fMl9yb3VuZFwiLFwibmFtZVwiOlwi6KeE5YiZ5YiX6KGoXCIsXCJwYXRoXCI6XCJydWxlc1wiLFwicnVsZVwiOlwianM6XFxuYWRkTGlzdGVuZXIoJ29uQ2xvc2UnLCAkLnRvU3RyaW5nKCgpID0+IH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gYXZhdGFyVXJsKSxcXG4gICAgY29sX3R5cGU6ICd0ZXh0XzInXFxufSk7XFxubGV0IGNhbl91cGxvYWRfYXBpID0gZ2V0QXBpKFxcXCJtYW5DYW5VcGxvYWRcXFwiKSArIGlkO1xcbmlmIChnZXRWYXIoJ2hvdXNlLmlzX21hbmFnZXInKSkge1xcbiAgICBsZXQgdGlwcyA9IGNhbl91cGxvYWQgPyAn6IO9JyA6ICflkKYnO1xcbiAgICAvLyBsb2coJ3RpcHM6Jyt0aXBzKTtcXG4gICAgLy8gbG9nKCdjYW5fdXBsb2FkOicrY2FuX3VwbG9hZCk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KaoOiDveWQpuS4iuS8oDonICsgKGdldFZhcignV2FyZWhvdXNlLmNhbl91cGxvYWQnKSB8fCB0aXBzKSxcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5J1xcbiAgICB9KTtcXG5cXG4gICAgZnVuY3Rpb24gc2V0VXBsb2FkKGZsYWcsIGNhbl91cGxvYWRfYXBpKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChjYW5fdXBsb2FkX2FwaSwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNhbl91cGxvYWRcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfwn5qr56aB5q2i5LiK5LygJyxcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6ICQoJ+emgeatouivpeW8gOWPkeiAheS4iuS8oOinhOWImT/kvaDnmoTmk43kvZzlsIbooqvns7vnu5/orrDlvZUnKS5jb25maXJtKChpZCwgY2FuX3VwbG9hZF9hcGksIHNldFVwbG9hZCkgPT4ge1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRVcGxvYWQoZmFsc2UsIGNhbl91cGxvYWRfYXBpKTtcXG4gICAgICAgICAgICBpZiAoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSkge1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJywgJ+WQpicpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgcmV0XFxuICAgICAgICB9LCBpZCwgY2FuX3VwbG9hZF9hcGksIHNldFVwbG9hZClcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTogJ+KcheWFgeiuuOS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiAkKCflhYHorrjor6XlvIDlj5HogIXkuIrkvKDop4TliJk/5L2g55qE5pON5L2c5bCG6KKr57O757uf6K6w5b2VJykuY29uZmlybSgoaWQsIGNhbl91cGxvYWRfYXBpLCBzZXRVcGxvYWQpID0+IHtcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0VXBsb2FkKHRydWUsIGNhbl91cGxvYWRfYXBpKTtcXG4gICAgICAgICAgICBpZiAoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSkge1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ1dhcmVob3VzZS5jYW5fdXBsb2FkJywgJ+aYrycpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nICsgcmV0XFxuICAgICAgICB9LCBpZCwgY2FuX3VwbG9hZF9hcGksIHNldFVwbG9hZClcXG4gICAgfSk7XFxufVxcbmRhdGEucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwiPHNtYWxsPuaPkOekuu+8muW8gOWPkeiAheWNleeLrOWIhuS6q+eahOWQiOmbhuaWh+S7tuWPquiDveWNleeLrOWvvOWFpeOAgjwvc21hbGw+XFxcIixcXG4gICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiXFxufSk7XFxuZGF0YS5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCI8Ymln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Yk9iaiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc3ViVXJsLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvXFxcIit0aXRsZStcXFwiLmpzb25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29kZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBhY3RpdmU6IGZhbHNlLC8v56aB55So5bm25Y+R5pu05pawXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgbGV0IHNoYXJlVGV4dCA9IGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShzdWJPYmopKTtcXG4gICAgICAgICAgICAgICAgdmFyIHBhc3RlcyA9IGdldFBhc3RlcygpO1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gc2hhcmVQYXN0ZShzaGFyZVRleHQscGFzdGVzLnNsaWNlKC0xKVswXSk7XFxuICAgICAgICAgICAgICAgIGxldCBpbXBvcnRfcnVsZT0gXFxcIui9u+WQiOmbhuiuoumYhe+8mlxcXCIrdGl0bGUrJ1xcXFxuJyt1cmw7XFxuICAgICAgICAgICAgICAgIGNvcHkoaW1wb3J0X3J1bGUpO1xcbiAgICAgICAgICAgICAgICBjb25zdCBwYXRoID0gJ2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS9ydWxlQ2FjaGUvc3ViLmpzb24nO1xcbiAgICAgICAgICAgICAgICAkLnJjKGNvbmZpZy5saWIuc3ViKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIOiuoumYheWvvOWFpShwYXRoKVxcbiAgICAgICAgICAgIH0sZGF0YUl0ZW0scnVsZUxpc3RKc29uICsgZGF0YUl0ZW0uaWQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZTJcXG4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AgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfc2FmZVxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBmdW5jdGlvbiBzZXRJc0dvb2QoZmxhZyxtYW5fcnVsZV9nb29kKSB7XFxuICAgICAgICBmbGFnID0gZmxhZyB8fCAnJztcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IGNvZGUgPSBmZXRjaChtYW5fcnVsZV9nb29kLCB7XFxuICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXFwiVXNlci1BZ2VudFxcXCI6IE1PQklMRV9VQX0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInVzZXJuYW1lXFxcIjogZ2V0VmFyKCdob3VzZS51c2VybmFtZScpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJpc19nb29kXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+mjjumZqScsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn5qCH6K6w6K+l6KeE5YiZ5Li66aOO6ZmpP+mjjumZqeinhOWImeaXoOazleiiq+WvvOWFpScpLmNvbmZpcm0oKGlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKT0+e1xcbiAgICAgICAgICAgIGxldCByZXQgPSBzZXRJc1NhZmUoZmFsc2UsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifinIXmraPluLgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuato+W4uD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKHRydWUsbWFuX3J1bGVfc2FmZSk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX3NhZmUsc2V0SXNTYWZlKVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOifimaXpnZ7kvJjotKgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumdnuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNHb29kKGZhbHNlLG1hbl9ydWxlX2dvb2QpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldC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ICAgICAgICAgXFxcIm5hbWVcXFwiOiBuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAncG9zdCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBpZHJlc3VsdCA9IEpTT04ucGFyc2UocmVxdWVzdChnZXRJZCArIFxcXCI/cXE9XFxcIiArIHVzZXJuYW1lKSk7XFxuICAgICAgICBpZiAoaWRyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyBpZHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBcXG4gICAgICAgIHJldHVybiAkKFxcXCJcXFwiLCBcXFwi6L6T5YWl6YKu566x6aqM6K+B56CBXFxcXG5cXFwiICsgcmVzdWx0LmRldGFpbCkuaW5wdXQoKGNvbmZpcm0sIGlkLCBhY2NvdW50KSA9PiB7XFxuICAgICAgICAgICAgc2hvd0xvYWRpbmcoXFxcIuivt+iAkOW/g+etieW+hVxcXCIpO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGNvbmZpcm0sIHtcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJyZWdpc3RfaWRcXFwiOiBpZCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInl6bVxcXCI6IGlucHV0XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZVVzZXJuYW1lXFxcIiwgYWNjb3VudFswXSk7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXFxcIldhcmVob3VzZVBhc3N3b3JkXFxcIiwgYWNjb3VudFsxXSk7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aIkOWKn+aPkOS6pOazqOWGjOazqOWGjFxcXFxuX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S5QYXNzd29yZC55JywgJycpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiAncHV0VmFyKFxcXCJXYXJlaG91c2UubS5QYXNzd29yZC55XFxcIixpbnB1dCknXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOlxcXCLmlrDlr4bnoIFcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36L6T5YWl5paw5a+G56CBXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdHlwZTpcXFwicGFzc3dvcmRcXFwiLFxcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0VmFyKCdXYXJlaG91c2UubS5QYXNzd29yZC54JywgJycpLFxcbiAgICAgICAgICAgIG9uQ2hhbmdlOiAncHV0VmFyKFxcXCJXYXJlaG91c2UubS5QYXNzd29yZC54XFxcIixpbnB1dCknXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6XFxcIumHjeWkjeaWsOWvhueggVxcXCIsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIGRlc2M6IFxcXCLor7fph43lpI3mlrDlr4bnoIFcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICB0eXBlOlxcXCJwYXNzd29yZFxcXCIsXFxuICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQuYycsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2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91c2UucnVsZS5ub3RlcycsICcnKXx8bm90ZXN8fFxcXCJcXFwiLFxcbiAgICAgICAgdHlwZTogXFxcInRleHRhcmVhXFxcIixcXG4gICAgICAgIGhlaWdodDotMSxcXG4gICAgICAgIG9uQ2hhbmdlOiAncHV0VmFyKFxcXCJXYXJlaG91c2UucnVsZS5ub3Rlc1xcXCIsaW5wdXQpJ1xcbiAgICB9XFxufSk7XFxuXFxuZGF0YS5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLkv53lrZhcXFwiLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICB1cmw6ICQoZ2V0QXBpKFxcXCJzZXRfcnVsZV9ub3RlXFxcIikgKyBpZCkubGF6eVJ1bGUoKHVzZXJuYW1lLCBwYXNzd29yZCkgPT4ge1xcbiAgICAgICAgbGV0IG5vdGVzID0gZ2V0VmFyKCdXYXJlaG91c2UucnVsZS5ub3RlcycsICcnKTtcXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiB1c2VybmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIm5vdGVcXFwiOm5vdGVzXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBh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yXzFcXFwiLFxcbiAgICB1cmw6ICQoYXBpLmRpc19uZXcgKyBpZCkubGF6eVJ1bGUoKEFjY291bnQpID0+IHtcXG4gICAgICAgIGxldCB0ZXh0ID0gZ2V0VmFyKCdXYXJlaG91c2UuY29tbWVudC50ZXh0JywgJycpO1xcbiAgICAgICAgbGV0IFtxcSxhdXRoX2NvZGVdID0gQWNjb3VudDtcXG4gICAgICAgIGxldCB0eXBlID0gZ2V0VmFyKCdXYXJlaG91c2UuY29tbWVudC50eXBlJykgfHwgJ2dvb2QnO1xcbiAgICAgICAgcXE9cXF8fFxcXCJcXFwiO1xcbiAgICAgICAgYXV0aF9jb2RlPWF1dGhfY29kZXx8XFxcIlxcXCI7XFxuICAgICAgICBpZihxcT09XFxcIlxcXCJ8fGF1dGhfY29kZT09XFxcIlxcXCIpe1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mnKrnmbvlvZXotKblj7dcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYodGV4dD09XFxcIlxcXCIpe1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHlhpnllYpcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgZnVuY3Rpb24gcihwKSB7XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeShwKSxcXG4gICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIH1c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b24nXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXFcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlc3VsdDIgPSBKU09OLnBhcnNlKHJlcXVlc3QoYiArIFxcXCI/cXE9XFxcIiArIHFxKSk7XFxuICAgICAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0Mi5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGhpZGVMb2FkaW5nKCk7XFxuICAgICAgICAgICAgdGhyb3cgZTtcXG4gICAgICAgIH1cXG4gICAgICAgIH0sIHFxLCBhLCBiKTtcXG5cXG4gICAgfSwgYXBpLmRpc19uZXdfdXNlciwgYXBpLmRpc192ZXJpZnkpLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgdHlwZTogXFxcIm51bWJlclxcXCIsXFxuICAgICAgICBkZWZhdWx0VmFsdWU6IGd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+E6K665ZOmXFxcIikuY29uZmlybSgoZiwgbCwgbG9naW4pID0+IHtcXG4gICAgICAgIGxldCBxcSA9IGdldFZhcignV2FyZWhvdXNlLm0ucXEnLCAnJyk7XFxuICAgICAgICBsZXQgeXptID0gZ2V0VmFyKCdXYXJlaG91c2UubS55em0nLCAnJyk7XFxuICAgICAgICBpZiAocXEgPT0gXFxcIlxcXCIgfHwgeXptID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL3Fx5oiW6aqM6K+B56CB5Li656m6XFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGxvZ2luLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicXFcXFwiOiBxcSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJhdXRoX2NvZGVcXFwiOiB5em1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBpZiAocmVzdWx0LnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgIGYudXNlciA9IFtxcSwgeXptXTtcXG4gICAgICAgICAgICB3cml0ZUZpbGUoXFxcImhpa2VyOi8vZmlsZXMvV2FyZWhvdXNlVVNFUi5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoZikpO1xcbiAgICAgICAgICAgIGxldCBpbmRleCA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biAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kvaDov5jku4DkuYjpg73msqHlhpnllYpcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX3RleHRcXFwiOiB0ZXh0LFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBwYXNzd29yZCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX2lkXFxcIjogcnVsZUlkXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBiYWNrKGZhbHNlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG5cXG4gICAgfSwgcGFzc3dvcmQsIHVzZXJuYW1lLCByZXBseUlkKVxcbn0pO1xcblxcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaIkeeahOWbnuWkjVwiLFwicGF0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WdlL3J1bGVEZXRhaWwjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsdmVyOiBcXFwi5Zue5aSN6L+b5YWl5LiN5pSv5oyB5p+l55yLXFxcIixcXG4gICAgICAgICAgICAgICAgaWQ6IGl0ZW0ucnVsZV9pZFswXVxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGlzY3Vzc190ZXh0LFxcbiAgICAgICAgICAgIGRlc2M6IGl0ZW0uY3JlYXRlX2RhdGUgKyBcXFwiwrdcXFwiK2l0ZW0ucnVsZV9pZFsxXStcXFwiwrdcXFwiK1xcXCLlvIDlj5HogIXwn5ejXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2luZm9cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOntcXG4gICAgICAgICAgICAgICAgbmFtZTppdGVtLm5hbWUsXFxuICAgICAgICAgICAgICAgIHR5cGU6XFxcImxvbmdfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgIHRleHQ6aXRlbS5kaXNjdXNzX3RleHRcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgXFxufVxcbnNldFJlc3VsdChkYXRhKTtcXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuabtOWkmuWIhuS6q1wiLFwicGF0aFwiOlwibW9yZVNoYXJlXCIsXCJydWxlXCI6XCJqczpcXG4gICAgYWRkTGlzdGVu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uZ3RoPjIpeyAvLyDorr7nva7or7fmsYLmlrnms5VcXG4gICAgICAgICAgICAgICAgcGFyYW1zWydtZXRob2QnXSA9IHdlYl91cmxfYXJyWzFdLnRvVXBwZXJDYXNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxvZygn5byA5aeL6I635Y+W5rqQ56CBJyk7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgLypcXG4gICAgICAgICAgICAgICAgcmVxdWVzdEFzeW5jKHdlYl91cmwscGFyYW1zLGZ1bmN0aW9uIChrZXksY29kZSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IGNvZGU7XFxuICAgICAgICAgICAgICAgICAgICBpZihiYWNrX2NvZGUubGVuZ3RoPjIwKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHlt7Lojrflj5Ys5bm26YOo5YiG5o+S5YWl5Yiw5paH5pys5Yy65Z+fJ1xcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mUmeivr++8jOacrOasoeiOt+WPluWIsOepuuaWh+acrO+8jOeWkeS8vOS9oOayoeacieatpOaWh+S7tiEnO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICAgICAgbGV0IGJhY2tfY29kZSA9IGdldEl0ZW0oJ2hvdXNlLmZpbGVfdWEnKT09PSfnlLXohJEnP2ZldGNoKHdlYl91cmwscGFyYW1zKTpyZXF1ZXN0KHdlYl91cmwscGFyYW1zKTtcXG4gICAgICAgICAgICAgICAgaWYoYmFja19jb2RlLmxlbmd0aD4yMCl7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJyxiYWNrX2NvZGUpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5rqQ56CB5bey6I635Y+WLOW5tumDqOWIhuaPkuWFpeWIsOaWh+acrOWMuuWfnydcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6ZSZ6K+v77yM5pys5qyh6I635Y+W5Yiw56m65paH5pys77yM55aR5Ly85L2g5rKh5pyJ5q2k5paH5Lu2ISc7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgbG9nKGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lj5HnlJ/kuobplJnor686XFxcXG4nK2UubWVzc2FnZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxvZygn5Li76aKY6ZO+5o6lJyk7XFxuICAgICAgICAgICAgbGV0IHdlYl91cmxfYXJyID0gaW5wdXQuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGxldCB3ZWJfdXJsID0gd2ViX3VybF9hcnJbd2ViX3VybF9hcnIubGVuZ3RoLTFdO1xcbiAgICAgICAgICAgIGxldCBiYWNrX2NvZGUgPSBwYXJzZVBhc3RlKHdlYl91cmwpO1xcbiAgICAgICAgICAgIGlmKGJhY2tfY29kZS5sZW5ndGg+MjApIHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKC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IGZpbmRJdGVtKFxcXCJmaWxlUGF0aFxcXCIpLmV4dHJhO1xcbiAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKFxcXCJmaWxlUGF0aFxcXCIsIHtcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiBPYmplY3QuYXNzaWduKHRhcmdldCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogUEFUSFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHB1dFZhcignaG91c2Uud2ViX3VybCcsUEFUSCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlO1xcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG9uQ2xpY2tUeXBlOidjb25maXJtJyxcXG4gICAgICAgICAgICBmaWxlVHlwZTogXFxcIi5qc3wudHh0fC5oaWtlcnwuanNvbnwuaHRtbFxcXCIsXFxuICAgICAgICAgICAgcGF0dGVybjogMCxcXG4gICAgICAgICAgICByZXF1aXJlVXJsOmZwLFxcbiAgICAgICAgICAgIGluaXRpYWxQYXRoOmdldFBhdGgoJ2hpa2VyOi8vZmlsZXMvcnVsZXMvZHpIb3VzZS8nKS5zbGljZSg3KSxcXG4gICAgICAgICAgICBtZW1vcnk6J3RydWUnLFxcbiAgICAgICAgfSk7XFxuICAgIH0pLFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOifkuIrkvKDnsbvlnosnLFxcbiAgICBkZXNjOifkuIrkvKDmlofku7bnmoTnsbvlnoss5b2T5YmN5Li6OicrY29sb3IoZ2V0SXRlbSgnaG91c2UuZmlsZV90eXBlJywn6Z2Z5oCB5paH5Lu2JyksJyNmZjcwMDAnKSxcXG4gICAgY29sX3R5cGU6J3RleHRfMScsXFxuICAgIHVybDokKGZpbGVfdHlwZV90aXRsZSwyK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VybiAndG9hc3Q6Ly/lt7Lorr7nva7npLrkvovlnLDlnYAnXFxuICAgIH0pXFxufSk7XFxuXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6J/Cfk6TkuIrkvKAnLFxcbiAgICBjb2xfdHlwZTonZmxleF9idXR0b24nLFxcbiAgICB1cmw6JCgpLmxhenlSdWxlKChjYW51cCxob3VzZV9kYXRhLHB1dF91cmwsZmlsZV90eXBlKSA9PntcXG4gICAgICAgIGZ1bmN0aW9uIGNvbXBhcmUobmFtZSkge1xcbiAgICAgICAgICAgIHJldHVybiBmdW5jdGlvbihpdGVtKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBpdGVtLm5hbWUgPT09IG5hbWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgY29uc3Qge2dldE5vd0Zvcm1hdERhdGV9PSQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVxcXCIpO1xcbiAgICAgICAgbGV0IHVwX2NvZGUgPSBnZXRWYXIoJ2hvdXNlLnVwbG9hZF9jb2RlJywnJyk7XFxuICAgICAgICBpZih1cF9jb2RlLmxlbmd0aCA8IDIpe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/mupDnoIHljLrml6DlhoXlrrnvvIzor7flhYjorr/pl67kuIDkuKrpnZnmgIHpobXpnaInXFxuICAgICAgICB9XFxuICAgICAgICBpZighY2FudXApe1xcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/kvaDkuI3mmK/lvIDlj5HogIXvvIzmsqHmnInmj5DkuqTliLDku5PlupPnmoTmnYPliKkhJ1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGlucHV0ID0gZ2V0VmFyKCdob3VzZS53ZWJfdXJsJywnJyk7XFxuICAgICAgICBsZXQgd2ViX3VybCA9IGlucHV0LnNwbGl0KCc7JylbMF07XFxuICAgICAgICBsZXQgZmlsZU5hbWUgPSAnJztcXG4gICAgICAgIGlmKC9eaGlrZXI6fF5maWxlOnxeaHR0cDp8Xmh0dHBzOnxeXFxcXC9zdG9yYWdlXFxcXC98XlxcXFwvc2RjYXJkXFxcXC8vLnRlc3Qod2ViX3VybCkpe1xcbiAgICAgICAgICAgIGZpbGVOYW1lID0gd2ViX3VybC5zcGxpdCgnLycpW3dlYl91cmwuc3BsaXQoJy8nKS5sZW5ndGgtMV07XFxuICAgICAgICB9ZWxzZSBpZigv5Li76aKY77+lfOWFg+e0oO+/pS8udGVzdChpbnB1dCkpe1xcbiAgICAgICAgICAgIGxldCBia2FyciA9IHVwX2NvZGUuc3BsaXQoJ++/pScpO1xcbiAgICAgICAgICAgIGlmKGJrYXJyLmxlbmd0aDwzKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+S6keWJqui0tOadv+WGheWuueacieivrydcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgc3dpdGNoIChia2FyclsxXSkge1xcbiAgICAgICAgICAgICAgICBjYXNlICdteV9ob21lX3RoZW1lJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ215X2hvbWVfc2luZ2xlJzpcXG4gICAgICAgICAgICAgICAgICAgIGZpbGVOYW1lID0gdXBfY29kZS5zcGxpdCgn44CMJylbMV0uc3BsaXQoJ+OAjScpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ2pzX3VybCc6XFxuICAgICAgICAgICAgICAgICAgICBmaWxlTmFtZSA9IHVwX2NvZGUuc3BsaXQoJ++/pScpWzJdLnNwbGl0KCdAJylbMF07XFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9ZWxzZXtcXG4gICAgIC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OWdgOaYr+WQpuS4uuWQiuavm+inhumikVxcbiAgICAgICAgaWYgKGRtVXJscy5sZW5ndGggPCAxKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlXFxuICAgICAgICB9XFxuICAgICAgICBmdW5jdGlvbiBwcmludChzdHIpe1xcbiAgICAgICAgICAgIGlmKHR5cGVvZihsb2cpIT09J3VuZGVmaW5lZCcpe1xcbiAgICAgICAgICAgICAgICBsb2coc3RyKTtcXG4gICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhzdHIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGRtVXJsIG9mIGRtVXJscykge1xcbiAgICAgICAgICAgIGlmICgobmV3IFJlZ0V4cChkbVVybCkpLnRlc3QodmlkZW9VcmwpKSB7Ly/mkq3mlL7lnLDlnYDljIXlkKvlkIrmr5vmoIflv5fnmoTlnLDlnYBcXG4gICAgICAgICAgICAgICAgcHJpbnQoJ+WQiuavm+inhumikSzoh6rliqjov4fmu6Q6Jyt2aWRlb1VybCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgcHJpbnQoJ+mdnuWQiuavm+inhumikSzlj6/mkq3mlL46Jyt2aWRlb1VybCk7XFxuICAgICAgICByZXR1cm4gZmFsc2VcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBpc0RtKHJldCkge1xcbiAgICAgICAgaWYgKCFyZXQpIHtcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGhhc0RtKHJldC5zcGxpdCgnIycpWzBdLnNwbGl0KCc7JylbMF0sIGRtVXJscylcXG4gICAgfVxcbiAgICByZXR1cm4gaXNEbSh2aWRlb1VybClcXG59XFxuXFxuZnVuY3Rpb24gbGF6eVBhcnNlKHBsYXlVcmwsbX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IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZXF1ZXN0KT09J3VuZGVmaW5lZCd8fCFyZXF1ZXN0KXtcXG4gICAgICAgICAgICAgICAgICAgICAgICBldmFsKGZiYS5nZXRJbnRlcm5hbEpzKCkpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBmYmEucHV0VmFyKFxcXCJfeDVqeFVybFxcXCIscGxheVVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHdpbmRvdy5jb3VudCA9PSBudWxsKXtcXG4gICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudD0xO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgIGlmKC/op6blj5HkuobpmLLnm5fpk7585pyq5o6I5p2DfOaOpeWPo+mYsuebly8udGVzdCh0ZXh0KSYmd2luZG93LmNvdW50PT09MSl7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9jYXRpb24ucmVsb2FkKCk7XFxuICAgICAgICAgICAgICAgICAgICBsb2NhdGlvbi5ocmVmPWZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50Oicrd2luZG93LmNvdW50KycsbWF4X2NvdW50OicrbWF4X2NvdW50KTtcXG4gICAgICAgICAgICAgICAgaWYoIHdpbmRvdy5jb3VudCA+PSBtYXhfY291bnQpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6LaF6L+HXFxcIittYXhfY291bnQqMjUwK1xcXCLmr6vnp5LmnKrojrflj5bliLDotYTmupDlnLDlnYDvvIzot7PliLDmupDnvZHpobUs5Lul5LiL5piv5Yqg6L296L+H55qE5Zyw5Z2AXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0ZXh0PWRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXFxcImJvZHlcXFwiKS5pbm5lclRleHQ7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyh0ZXh0KTtcXG4gICAgICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge2ZiYS5sb2coZS5tZXNzYWdlKX1cXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coSlNPTi5zdHJpbmdpZnkoX2dldFVybHMoKSkpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZiYS5nZXRWYXIoXFxcIl94NWp4VXJsXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZnVuY3Rpb24gbXV0ZU1lKGVsZW0pIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSwgdjIgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCJlbWJlZFxcXCIpLCB2MyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcIiNwbGF5ZXJcXFwiKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2aWRlb3MsIGZ1bmN0aW9uICh2aWRlbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZSh2aWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbChhdWRpb3MsIGZ1bmN0aW9uIChhdWRpbykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MywgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgICAgICAgICAgICAgdmFyIHVybHMgPSBfZ2V0VXJscygpO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKEpTT04uc3RyaW5naWZ5KHVybHMpKTtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHU9dXJsc1tpXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAvL1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKFxcXCJ1cmzliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcInZpZOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9XFxcXC8vLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdCA9IHUubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gaG9zdCt1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkmJi9cXFxcLm0zdTgvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gXFxcImh0dHBcXFwiK3Uuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLlhbbku5bliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy98aW5kZXhcXFxcLm0zdTgkXFxuICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXC8xXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCByZWFsVXJsID0gaXNWaWRlbyh1LHJlY2hhbmdlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVhbFVybCk9PSdzdHJpbmcnJiYhaXNCYWRWaWRlbyh1KSl7Ly/ov4fmu6TlkIrmr5vop4bpopFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9meV9icmlkZ2VfYXBwLnNldFdlYlVhKFBDX1VBKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYS5nZXRIZWFkZXJVcmwpIT09J3VuZGVmaW5lZCcmJnR5cGVvZihyZWNoYW5nZSkhPT0nZnVuY3Rpb24nKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1LnJlcGxhY2UoXFxcIjt7XFxcIixcXFwiI2lzVmlkZW89dHJ1ZSM7e1xcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBiYWNrVXJsID0gZmJhLmdldEhlYWRlclVybCh1cmxzW2ldKS5yZXBsYWNlKCc7eycsJyNpZ25vcmVJbWc9dHJ1ZSMjaXNWaWRlbz10cnVlIzt7Jyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTEgPSBiYWNrVXJsLnNwbGl0KCcjaWdub3JlSW1nJylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdTIgPSAnI2lnbm9yZUltZycrYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoL3VybD1odHRwLy50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSB1MS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIGlmKC91cmw9XFxcXC8vLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QxID0gdTEubWF0Y2goLyguKilcXFxcL1xcXFwvKC4qPylcXFxcLy8pWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gaG9zdDErdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInZpZD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodTEpJiYvXFxcXC5tM3U4Ly50ZXN0KHUxKSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBcXFwiaHR0cFxcXCIrdTEuc3BsaXQoL1xcXFw/KC4qKT1odHRwLykuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFja1VybCA9IHUxICsgdTI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCfov5Tlm57oh6rliqjliqBjb29raWXpk77mjqU6JytiYWNrVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZiYS5sb2coJ+i/lOWbnumTvuaOpTonK3UrJ+W5tuiHquWKqOWKoOS6hmNvb2tpZSzlhbfkvZNjb29raWXlnKjop4bpopHmkq3mlL7lpITmn6XnnIsnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBiYWNrVXJsO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2V7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLov5Tlm57ku5PlupN4NeWFjeWXhee7k+aenDpcXFwiK3JlYWxVcmwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlYWxVcmxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAvLyBmeV9icmlkZ2VfYXBwLmxvZygneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICBhbGVydCgneDXlpKfojIPlm7TplJnor686JytlLm1lc3NhZ2UpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5oql6ZSZ57uT5p2feDUnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSxpc1ZpZGVvLHJlY2hhbmdlLHBsYXlVcmwsbWF4X2NvdW50LFBDX1VBLGlzQmFkVmlkZW8pO1xcbiAgICAgICAgbGV0IHVzZVdlYj1sc2cuZ2V0SXRlbShcXFwi6YCa5YWNXFxcIixcXFwiWDVcXFwiKT09PVxcXCJXRUJcXFwiO1xcbiAgICAgICAgLy9sb2coXFxcIuS7k+W6k+S9v+eUqHdlYumAmuWFjeabv+S7o3g1OlxcXCIrdXNlV2ViKTtcXG4gICAgICAgIGxldCBydWxlSGVhZD11c2VXZWImJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIzMzk/XFxcIndlYlJ1bGU6Ly9cXFwiOlxcXCJ4NVJ1bGU6Ly9cXFwiO1xcbiAgICAgICAgbGV0IHg1VXJsID0gcnVsZUhlYWQrcGxheVVybCsgJ0AnICtfeDU7XFxuICAgICAgICByZXR1cm4geDVVcmxcXG4gICAgfVxcbn1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jqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09MSl7XFxuICAgICAgICAgICAgICAgIGxvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCLmo4DmtYvliLDmnInmjojmnYPvvIzlvIDlp4vov4fmjojmnYNcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd2luZG93LmNvdW50Kys7XFxuICAgICAgICAgICAgLy8gZmJhLmxvZygnY291bnQ6JyArIHdpbmRvdy5jb3VudCArICcsbWF4X2NvdW50OicgKyBtYXhfY291bnQpO1xcbiAgICAgICAgICAgIGlmICh3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KSB7XFxuICAgICAgICAgICAgICAgIGZiYS5jbGVhclZhcigneDVMaXN0Jyk7XFxuICAgICAgICAgICAgICAgIGZiYS5oaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICBsZXQgZm1zZyA9ICfpgZPplb/ku5PlupPpgJrlhY3op6PmnpDlpLHotKUs5Y6f5ZugOui2heaXticreDVUaW1lb3V0Kyfmr6vnp5InO1xcbiAgICAgICAgICAgICAgICBmYmEubG9nKGZtc2cpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytmbXNnO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGZiYS5sb2coZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZWxlbS5wYXVzZSgpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuXFxuICAgICAgICB2YXIgdmlkZW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwidmlkZW9cXFwiKSwgYXVkaW9zID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiYXVkaW9cXFwiKSxcXG4gICAgICAgICAgICB2MiA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImVtYmVkXFxcIiksIHYzID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiI3BsYXllclxcXCIpO1xcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHZpZGVvKTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKGF1ZGlvcywgZnVuY3Rpb24gKGF1ZGlvKSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZShhdWRpbyk7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIFtdLmZvckVhY2guY2FsbCh2MiwgZnVuY3Rpb24gKHYpIHtcXG4gICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgfVxcbiAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgIG11dGVNZSh2KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgZm9yIChsZXQgaSBpbiB1cmxzKSB7XFxuICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgIC8vdT1kZWNvZGVVUklDb21wb25lbnQodSk7XFxuICAgICAgICAgICAgICAgIHRyeXt1PWRlY29kZVVSSUNvbXBvbmVudCh1KTt9Y2F0Y2goZSl7XFxuICAgICAgICAgICAgICAgICAgICB1PXVuZXNjYXBlKHUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZigvXFxcXD8oLiopPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vZmJhLmxvZyhcXFwi5YW25LuW5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC9cXFxcLzFcXFxcLm0zdTgkLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHU9dS5yZXBsYWNlKC8mZnJvbT0uKnwmbmV4dD0uKnwmanVtcD0uKi8sJycpO1xcbiAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSk7XFxuICAgICAgICAgICAgICAgIGlmIChyZWFsVXJ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eaHR0cC8udGVzdCh1cmwpKXtcXG4gICAgICAgICAgICAgICAgbGV0IHJlYWxWaWRlbyA9IGlzVmlkZW8odXJsKTtcXG4gICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlYWxWaWRlbyk9PSdzdHJpbmcnKXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5bey6Kej5p6Q5Ye66KeG6aKROicrcmVhbFZpZGVvKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWFsVmlkZW8rPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaChyZWFsVmlkZW8pO1xcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn6Kej5p6Q5Ye65LiN55+l6YGT5LuA5LmI5Lic6KW/OicrdXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIHVybCs9XFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIGlmKGpuYW1lKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCLimIVcXFwiK2puYW1lXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB2aWRlb3MucHVzaCh1cmwpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6anNvbuaOpeWPo+S4lOaXoOi/lOWbnuinhumikeWcsOWdgOaVsOaNrjonK3BsYXlVcmxMaXN0W2ldKydcXFxcbicrYmFja2NvZGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgIGxvZyh0bmFtZSsn5Li6eDXmjqXlj6Ms5Yqg5YWleDXll4XmjqLliJfooagnKTtcXG4gICAgICAgICAgICB4NWxpc3QucHVzaChwbGF5VXJsTGlzdFtpXSk7XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgLy8gbG9nKHZpZGVvcyk7XFxuICAgIGlmKHZpZGVvcy5sZW5ndGg+MCl7XFxuICAgICAgICBpZihnZXRWYXIoJ2RwLmNhY2hlVmlkZW8nLCd0cnVlJyk9PT0ndHJ1ZScmJnBhcnNlSW50KGdldEFwcFZlcnNpb24oKSk+PTIyNTUpXFxuICAgICAgICB7XFxuICAgICAgICAgICAgbG9nKFxcXCLlsIrmlaznmoTprZTmlq3nlKjmiLfvvIzop4bpopHnvJPlrZjlt7LlkK/nlKjvvIzor7flsL3mg4Xkuqvlj5fnnIvliafml7blhYlcXFwiKTtcXG4gICAgICAgICAgICBsZXQgdmlkZW9zQ2FjaGU9dmlkZW9zLm1hcCgoaXQpPT57XFxuICAgICAgICAgICAgICAgIGxldCBoZWFkZXJzPXt9O1xcbiAgICAgICAgICAgICAgICBpZihpdC5zcGxpdChcXFwiO1xcXCIpLmxlbmd0aD4xKXtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBoZWFkID0gaXQuc3BsaXQoJzsnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgIGlmKC9ALy50ZXN0KGhlYWQpJiYve3x9Ly50ZXN0KGhlYWQpKXtcXG4vL2hlYWQgPSBoZWFkLnJlcGxhY2UoL3t8fS9nLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkID0gaGVhZC5zcGxpdChcXFwie1xcXCIpWzFdLnNwbGl0KFxcXCJ9XFxcIilbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoJyYmJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGxldCBpIGluIGhlYWQpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQga2V5ID0gaGVhZFtpXS5zcGxpdCgnQCcpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdmFsdWUgPWhlYWRbaV0uc3BsaXQoJ0AnKVsxXS5yZXBsYWNlKC87LywnOycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW2tleV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybDppdC5zcGxpdChcXFwiO1xcXCIpWzBdLnNwbGl0KFxcXCLimIVcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6aGVhZGVyc1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdmFyIGRhdGE9YmF0Y2hDYWNoZU0zdTgodmlkZW9zQ2FjaGUpO1xcbiAgICAgICAgICAgIGRhdGE9ZGF0YS5tYXAoKGl0LGlkKT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgZXh0cmE9XFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIjtcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYT1cXFwiO1xcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZih2aWRlb3NbaWRdLnNwbGl0KFxcXCLimIVcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYT1cXFwi4piFXFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCLimIVcXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBpZihpdCtcXFwiXFxcIiE9XFxcIm51bGxcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdCtleHRyYVxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2aWRlb3NbaWRdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAvL2xvZyhkYXRhKTtcXG4gICAgICAgICAgICByZXR1cm4gZGF0YVxcbiAgICAgICAgICAgIC8vcmV0dXJuIHZpZGVvc1xcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxvZygn5YWx5pyJJyt4NWxpc3QubGVuZ3RoKyfkuKp4NeWcsOWdgOi/m+ihjOi9rua1geWXheaOoicpO1xcbiAgICAvL+ayoeacieeahOivneWwseW8gOWni+S+neasoXg15ZeF5o6iXFxuICAgIHNob3dMb2FkaW5nKCfll4XmjqLkuK3vvIzoi6XlpLHotKXlsLHliIfmjaJ3ZWLll4XmjqIuLi4nKTtcXG4gICAgcmV0dXJuIHg1UGFyc2VQcm8oeDVsaXN0LHg1VGltZW91dCxpc1ZpZGVvKTtcXG59XFxudmFyIGxhenk9JCgnJykubGF6eVJ1bGUoKCk9PntcXG4gICAgdHJ5e1xcbiAgICAgICAgcmVhbFVybD1pbnB1dDtcXG4gICAgICAgIGV2YWwoXFxcInZhciBjb25maWdfZHAgPVxcXCIgKyBmZXRjaChcXFwiaGlrZXI6Ly9maWxlcy9jYWNoZS9NeVBhcnNlU2V0Lmpzb25cXFwiKSk7XFxuICAgICAgICBldmFsKGZldGNoKGNvbmZpZ19kcC5jaikpO1xcbiAgICAgICAgbG9nKGlucHV0KyctPuato+WcqOaWreaPkumtlOaUueeJiOino+aekC4uLicpO1xcbiAgICAgICAgLy8g5Yqg5YWl6LaF5pe26K6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SXRlbSgnaXNfaG91c2VfdmlwJywgJ2ZhbHNlJyk7XFxuICAgIH1cXG4gICAgbGV0IGhvdXNlX2RhdGEgPSBob3VzZUZpbGUoKTtcXG4gICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QodGFza19hcGksIHtcXG4gICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICB9LFxcbiAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJkYXRhXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInR5cGVcXFwiOiB0YXNrLm1vZGV8fCdydW4nLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImZ1bmNcXFwiOiB0YXNrLmZ1bmN8fCcnLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHRhc2sucGFyYW1zfHxbXVxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aFxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaG91c2VfZGF0YS51c2VybmFtZXx8XFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFzc3dvcmRcXFwiOiBob3VzZV9kYXRhLnBhc3N3b3JkfHxcXFwiXFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICB9KTtcXG4gICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxufVxcblxcbmZ1bmN0aW9uIHRhc2tfdXBsb2FkKHRhc2speyAvLyDpgJrnlKjku7vliqHlj5HluIPmlrDlop7lj4rkv67mlLnlip/og71cXG4gICAgY29uc3Qge2FwaSxnZXRGaWxlfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3V0aWxpeT9ydWxlPemBk+mVv+S7k+W6k1Byb1xcXCIpO1xcbiAgICBsZXQgaG91c2VGaWxlID0gZ2V0RmlsZXx8ZmFsc2U7XFxuICAgIGlmKCFob3VzZUZpbGUpe1xcbiAgICAgICAgc2V0SXRlbSgnaXNfaG91c2VfdmlwJywgJ2ZhbHNlJyk7XFxuICAgIH1cXG4gICAgbGV0IGFwaV91cmwgPSBhcGkuaG9zdCsnL2hpa2VydWxlL3Rhc2svYWRkJztcXG4gICAgbGV0IGhvdXNlX2RhdGEgPSBob3VzZUZpbGUoKTtcXG4gICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoYXBpX3VybCwge1xcbiAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICdjb250ZW50LXR5cGUnOiAnYXBwbGljYXRpb24vanNvbidcXG4gICAgICAgIH0sXFxuICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcImRhdGFcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwibmFtZVxcXCI6IHRhc2submFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJweWNvZGVcXFwiOiB0YXNrLnB5Y29kZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJub3RlXFxcIjogdGFzay5ub3RlLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInRlc3RfY29kZVxcXCI6IHRhc2sudGVzdF9jb2RlLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aFxcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogaG91c2VfZGF0YS51c2VybmFtZXx8XFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB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0Lmxlbmd0aCA+PSA0KXtcXG4gICAgICAgICAgICBsZXQgaW5mb19zZXRfdXJsPSBkZXZfc2V0X2luZm9bMl07XFxuICAgICAgICAgICAgbGV0IHNlbmRfZGF0YSA9IHtcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgIHtcXFwiZGF0YVxcXCI6IHtcXFwiaW5mb1xcXCI6IGlucHV0X3RleHR9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogZGV2X3NldF9pbmZvWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGRldl9zZXRfaW5mb1sxXX1cXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIC8vIGxvZyhzZW5kX2RhdGEpO1xcbiAgICAgICAgICAgIGxldCBwYXIyID0ge2hlYWRlcnM6eydjb250ZW50LXR5cGUnOidhcHBsaWNhdGlvbi9qc29uO2NoYXJzZXQ9VVRGLTgnLCdVc2VyLUFnZW50JzpkZXZfc2V0X2luZm9bM119LGJvZHk6SlNPTi5zdHJpbmdpZnkoc2VuZF9kYXRhKSxtZXRob2Q6J1BPU1QnfTtcXG4gICAgICAgICAgICAvLyBwYXIyID0gSlNPTi5zdHJpbmdpZnkocGFyMik7IC8veDXph4zpnaLor7fmsYLmiY3pnIDopoHnvJbnoIFcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgYmFja19yZXQgPSByZXF1ZXN0KGluZm9fc2V0X3VybCwgcGFyMik7XFxuICAgICAgICAgICAgICAgIGJhY2tfcmV0ID0gSlNPTi5wYXJzZShiYWNrX3JldCkucmVzdWx0O1xcbiAgICAgICAgICAgICAgICBpZihiYWNrX3JldC5zdGF0dXM9PT0wKXtcXG4gICAgICAgICAgICAgICAgICAgIC8vIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5L+d5a2Y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ogXFxcImxhenkuanNcXFwiLCAvL+mmmeWFjVxcbiAgICAgICAgICAgIHN1YjogXFxcInN1Yi5qc1xcXCIsIC8v6YGT5b6357uP6K6i6ZiFXFxuICAgICAgICAgICAgaGlrZXJVaTogXFxcImhpa2VyVWkuanNcXFwiLCAvL+a1t+mYlOe7hOS7tuS+nei1llxcbiAgICAgICAgICAgIGhpa2VyTGliczogXFxcImhpa2VyTGlicy5qc1xcXCIsIC8v5rW36ZiU5YWo6IO95L6d6LWWXFxuICAgICAgICB9KTtcXG4gICAgfWNhdGNoKGUpe1xcbiAgICAgICAgLy90b2FzdCgn6K+35bCd6K+V54K55Ye75LuT5bqT5Li76aG155qE5Y2H57qn5LuT5bqT5peB6L6555qE5oyJ6ZKu5Y2H57qnJOaJqeWxle+8jOWQpuWImeafkOS6m+WKn+iDveS4jeiDveato+W4uOS9v+eUqCcpO1xcbiAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgdGl0bGU6ICfmj5DnpLot54K55Ye756Gu5a6a5Y+v5Lul5a+85YWlJyxcXG4gICAgICAgICAgICBjb250ZW50OiAn6K+35bCd6K+V54K55Ye75LuT5bqT5Li76aG155qE5Y2H57qn5LuT5bqT5peB6L6555qE5oyJ6ZKu5Y2H57qnJOaJqeWxle+8jOWQpuWImeafkOS6m+WKn+iDveS4jeiDveato+W4uOS9v+eUqCcsXFxuICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygoKT0+e1xcbiAgICAgICAgICAgICAgICBjb25zdCB7Z2V0QXBpfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3V0aWxpeT9ydWxlPemBk+mVv+S7k+W6k1Byb1xcXCIpO1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZUhlYWQgPSAn5rW36ZiU6KeG55WM77yM572R6aG15o+S5Lu277+lanNfdXJs77+lJGhpa2VyQCc7XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBnZXRBcGkoJ2ltcG9ydFVybCcpK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v6LeR6ams54Gv6buY6K6k55qE5paH5a2X77yM5Y+v5Lul6Ieq6KGM5pu/5o2i44CCJywgY29sb3IgfHwgJ3JlZCcpO1xcbiAgICBhcnIucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcIixcXG4gICAgICAgIHVybDogXFxcImFib3V0OmJsYW5rXFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCI1MCYmbGlzdFxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChoLCB1cmwpID0+IHtcXG4gICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQ7XFxuICAgICAgICAgICAgICAgIGh0bWwuaW5uZXJIVE1MID0gaDtcXG5cXG4gICAgICAgICAgICAgICAgY29uc3QgdGV4dENvbnRhaW5lciA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd0ZXh0Q29udGFpbmVyJyk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHRleHQgPSB0ZXh0Q29udGFpbmVyLmlubmVySFRNTDtcXG4gICAgICAgICAgICAgICAgdGV4dENvbnRhaW5lci5vbmNsaWNrPWZ1bmN0aW9uKCl7XFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cubG9jYXRpb24uaHJlZiA9IHVybHx8XFxcImFib3V0OmJsYW5rL25vdGljZVxcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgLy8g6K6+572u5paH5pys5a655Zmo5a695bqm5Li65paH5pys5YaF5a6555qE5a695bqmXFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIuc3R5bGUud2lkdGggPSBgJHt0ZXh0Q29udGFpbmVyLm9mZnNldFdpZHRofXB4YDtcXG5cXG4gICAgICAgICAgICAgICAgLy8g5aSN5Yi25paH5pys5YaF5a655bm26L+95Yqg5Yiw5paH5pys5a655Zmo5ZCO6Z2iXFxuICAgICAgICAgICAgICAgIHRleHRDb250YWluZXIuaW5uZXJIVE1MICs9ICcgJyArIHRleHQ7XFxuXFxuICAgICAgICAgICAgICAgIC8vIOWKqOaAgeiuoeeul+WKqOeUu+aMgee7reaXtumXtFxcbiAgICAgICAgICAgICAgICBjb25zdCBkdXJhdGlvbiA9ICh0ZXh0Q29udGFpbmVyLm9mZnNldFdpZHRoIC8gdGV4dENvbnRhaW5lci5wYXJlbnRFbGVtZW50Lm9mZnNldFdpZHRoKSAqIDEwO1xcblxcbiAgICAgICAgICAgICAgICB2YXIgc3R5bGVFbGVtZW50cyA9IGRvY3VtZW50LmhlYWQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoJ3N0eWxlJyk7XFxuXFxuXFxuICAgICAgICAgICAgICAgIHN0eWxlRWxlbWVudHNbMl0uaW5uZXJIVE1MID0gYC5tYXJxdWVlIHNwYW4ge1xcbiAgICAgICAgICAgICAgICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xcbiAgICAgICAgICAgICAgICAgICAgcGFkZGluZy1sZWZ0OiAxMDAlO1xcbiAgICAgICAgICAgICAgICAgICAgYW5pbWF0aW9uOiBtYXJxdWVlICR7ZHVyYXRpb259cyBsaW5lYXIgaW5maW5pdGVcXG4gICAgICAgICAgICAgICAgfWA7XFxuXFxuICAgICAgICAgICAgfSwgaHRtbCwgdXJsKSxcXG4gICAgICAgICAgICB1cmxJbnRlcmNlcHRvcjogJC50b1N0cmluZygoY29udGVudCkgPT4ge1xcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQ9PT1cXFwiYWJvdXQ6Ymxhbmsvbm90aWNlXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBmYmEub3BlbihKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5YWs5ZGKXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSNub1JlY29yZEhpc3RvcnkjI25vSGlzdG9yeSMnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaW5kUnVsZTogXFxcImpzOlxcXCIgKyAkJCQudG9TdHJpbmcoKGNvbnRlbnQpID0+IHNldFJlc3VsdChbe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInJpY2hfdGV4dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1dKSxjb250ZW50KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgICAgIH0sIGNvbnRlbnQpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgY29udGVudCB8fCB0ZXh0KSxcXG4gICAgICAgIH1cXG4gICAgfSk7XFxufVwifV0iLCJpY29uIjoiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL290aGVyLzMwLnN2ZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment