xiaomianao666

小程序:道长仓库Pro

Oct 25th, 2024
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@道长仓库Pro@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi6YGT6ZW/5LuT5bqTUHJvIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IiwidmVyc2lvbiI6MTU3LCJjb2xfdHlwZSI6Imljb25fMl9yb3VuZCIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidG9vbCIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxuICAgIGNvbnN0IHtcbiAgICAgICAgZ2V0QXBpLFxuICAgICAgICBjb2xvcixcbiAgICAgICAgc21hbGwsXG4gICAgICAgIGdldEZpbGUsXG4gICAgICAgIGh0bWxUYWcsXG4gICAgICAgIGFwaSxcbiAgICAgICAgbWRcbiAgICB9ID0gJC5yZXF1aXJlKFwiaGlrZXI6Ly9wYWdlL3V0aWxpeVwiKTtcblxuY29uc3QgbHNnPSQucmVxdWlyZShcImhpa2VyOi8vcGFnZS9sb2NhbFN0b3JhZ2U/cnVsZT3pgZPplb/ku5PlupNQcm9cIik7XG5sZXQgY2xhc3NBID0gZ2V0VmFyKFwiV2FyZWhvdXNlLmNsYXNzXCIsIFwiMFwiKTtcbmxldCBsaXN0VXJsID0gZ2V0QXBpKFwidXNlcnNVcmxcIikgKyBjbGFzc0EsXG4gICAgbXlVcmwgPSBnZXRBcGkoXCJkZXZTZWxmXCIpO1xuLy8gbXlVcmwgPSBnZXRBcGkoXCJydWxlc0FsbFVybFwiKTtcbnB1dFZhcihcIldhcmVob3VzZS5maWx0ZXJcIiwgXCJcIik7XG52YXIgbm9XYWl0PXRydWU7Ly/ml6DpnIDph43or5VcbnZhciB0aW1lb3V0PTUwMDtcbnZhciB0bXBfaGVhZGVycz17XG4gICAgdGltZW91dDp0aW1lb3V0XG59O1xudHJ5e1xuICAgIHZhciB1c2VyTGlzdCA9IEpTT04ucGFyc2UocmVxdWVzdChsaXN0VXJsLHRtcF9oZWFkZXJzKSkucmVzdWx0LFxuICAgICAgICBub3dDb24gPSAwLFxuICAgICAgICBydWxlQ291bnQgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0QXBpKFwicnVsZUNvdW50VXJsXCIpLHRtcF9oZWFkZXJzKSkucmVzdWx0O1xufWNhdGNoKGUpe1xuICAgIG5vV2FpdD1mYWxzZTtcbiAgICBzZXRSZXN1bHQoW3tcbiAgICAgICAgdGl0bGU6J+S7k+W6k+WQjOaXtuiuv+mXrumHj+i/h+Wkp+aIlue9kee7nOW3ru+8jOe5geW/meS4rS4uLlxcbuivt+iAkOW/g+etieW+heeojeWQjuWGjeivlScsXG4gICAgICAgIGRlc2M6J+eCueWHu+WwneivlemHjeaWsOiuv+mXricsXG4gICAgICAgIGNvbF90eXBlOid0ZXh0XzEnLFxuICAgICAgICB1cmw6JCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoKT0+e1xuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWIt+aWsCdcbiAgICAgICAgfSlcbiAgICB9XSk7XG59XG5pZihub1dhaXQpe1xuICAgIGxldCBkYXRhID0gW107XG4gICAgbGV0IGNsYXNzVGFiID0gW1xuICAgICAgICBbXCLkuIrmrKHmtLvot4NcIiwgXCIwXCJdLFxuICAgICAgICBbXCLop4TliJnmlbBcIiwgXCIxXCJdLFxuICAgICAgICBbXCLms6jlhozml7bpl7RcIiwgXCItMVwiXVxuICAgIF1cbiAgICBmb3IgKGxldCBpdGVtIG9mIGNsYXNzVGFiKSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogaXRlbVsxXSA9PT0gY2xhc3NBID8gXCLigJzigJxcIiArIGl0ZW1bMF0gKyBcIuKAneKAnVwiIDogaXRlbVswXSxcbiAgICAgICAgICAgIHVybDogJChcIiNub0xvYWRpbmcjXCIpLmxhenlSdWxlKChrZXkpID0+IHtcbiAgICAgICAgICAgICAgICBwdXRWYXIoXCJXYXJlaG91c2UuY2xhc3NcIiwga2V5KTtcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIFwiaGlrZXI6Ly9lbXB0eVwiO1xuICAgICAgICAgICAgfSwgaXRlbVsxXSksXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICAgICAgfSk7XG4gICAgfVxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOiBcIuWFqOmDqOinhOWImVwiLFxuICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL0FsbFB1YmxpY1J1bGU/dXJsPWhpa2VyOi8vZW1wdHkjZnlwYWdlI25vSGlzdG9yeSMjbm9SZWNvcmRIaXN0b3J5I1wiLFxuICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCJcbiAgICB9KTtcbiAgICBkYXRhLnB1c2goe1xuICAgICAgICB0aXRsZTogXCLliLfmlrDkvp3otZZcIixcbiAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChqc29uVXJsKT0+e1xuICAgICAgICAgICAganNvblVybCA9IGpzb25VcmwrJzI1MDUnO1xuICAgICAgICAgICAgLy8gbG9nKGpzb25VcmwpO1xuICAgICAgICAgICAgbGV0IHRleHQgPSByZXF1ZXN0KGpzb25VcmwpO1xuICAgICAgICAgICAgaWYoIS92ZXJzaW9uLy50ZXN0KHRleHQpKXtcbiAgICAgICAgICA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HQ7XG4gICAgICAgIH0sY29sb3IpLFxuICAgICAgICBleHRyYTp7XG4gICAgICAgICAgICBpZDonc29ydCdcbiAgICAgICAgfVxuICAgIH0pO1xuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOmNvbG9yKFwi5LuT5bqT5YWs5ZGKXCIsXCIjZmY3MDAwXCIpLFxuICAgICAgICBjb2xfdHlwZTpcInNjcm9sbF9idXR0b25cIixcbiAgICAgICAgdXJsOiQoJ2hpa2VyOi8vZW1wdHkjbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjJykucnVsZSgobWQpPT57XG4gICAgICAgICAgICByZXF1aXJlKG1kKTtcbiAgICAgICAgICAgIGxldCBkID0gW107XG4gICAgICAgICAgICBsZXQg5LuT5bqT5YWs5ZGKPVwi5pqC5peg5YWs5ZGKXCI7XG4gICAgICAgICAgICB0cnl7XG4gICAgICAgICAgICAgICAg5LuT5bqT5YWs5ZGKPWZldGNoKCdodHRwczovL2dpdGNvZGUubmV0L3FxXzMyMzk0MzUxL2RyLy0vcmF3L21hc3Rlci9qcy/ku5PlupPlhazlkYoubWQnKTtcbiAgICAgICAgICAgIH1jYXRjaChlKXt9XG4gICAgICAgICAgICBpZijku5PlupPlhazlkYopIHtcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICB0aXRsZTogbWFya2VkLnBhcnNlKOS7k+W6k+WFrOWRiiksXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0JyxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHNldFJlc3VsdChkKTtcbiAgICAgICAgfSxtZClcbiAgICB9KTtcblxuICAgIGRhdGEucHVzaCh7XG4gICAgICAgIHRpdGxlOmNvbG9yKFwi5Y2H57qn5LuT5bqTXCIsXCIjMTVhYjIxXC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XG4gICAgICAgICAgICByZXR1cm4gaW1wb3J0VXJsXG4gICAgICAgIH0pXG4gICAgfSk7XG5cbiAgICBhZGRMaXN0ZW5lcignb25DbG9zZScsICQudG9TdHJpbmcoKCkgPT4ge1xuICAgICAgICBjbGVhclZhcihcIldhcmVob3VzZS5jbGFzc1wiKTtcbiAgICB9KSk7XG4gICAgbGV0IHtcbiAgICAgICAgdXNlcm5hbWUsXG4gICAgICAgIHBhc3N3b3JkLFxuICAgICAgICB1c2VyXG4gICAgfSA9IGdldEZpbGUoKTtcblxuICAgIGxldCBpc19sb2dpbiA9IGZhbHNlO1xuICAgIGxldCBpc19tYW5hZ2VyID0gZmFsc2U7XG4gICAgaWYgKHVzZXJuYW1lICE9PSB2b2lkIDAgJiYgcGFzc3dvcmQgIT09IHZvaWQgMCkge1xuICAgICAgICBteVVybCArPSAnP3FxPScgKyB1c2VybmFtZSArICcmcGFzc3dvcmQ9JyArIHBhc3N3b3JkO1xuICAgICAgICBsZXQgY29kZV9zdHIgPSByZXF1ZXN0KG15VXJsLHRtcF9oZWFkZXJzKTtcbiAgICAgICAgbGV0IGNvZGUgPSB7fTtcbiAgICAgICAgdHJ5e1xuICAgICAgICAgICAgY29kZT1KU09OLnBhcnNlKGNvZGVfc3RyKTtcbiAgICAgICAgfWNhdGNoKGUpe31cbiAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwJiYgY29kZS5yZXN1bHQuYWN0aXZlKSB7XG4gICAgICAgICAgICBpc19sb2dpbiA9IHRydWU7XG4gICAgICAgICAgICBpZihjb2RlLnJlc3VsdC5pc19tYW5hZ2VyKXtcbiAgICAgICAgICAgICAgICBpc19tYW5hZ2VyID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLmlzX21hbmFnZXInLCfnnJ8nKTtcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyx1c2VybmFtZSk7XG4gICAgICAgICAgICAgICAgcHV0V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xuICAgICAgICAgICAgdXJsOiBcImhpa2VyOi8vcGFnZS9kZXZMb2dpblwiXG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBpZiAoQXJyYXkuaXNBcnJheSh1c2VyKSAmJiB1c2VyLmxlbmd0aCA9PT0gMikge1xuICAgICAgICBsZXQgdXNlcmxvZ2luID0gcmVxdWVzdChhcGkuZGlzX2xvZ2luLCB7XG4gICAgICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICBcInBhcmFtc1wiOiB7XG4gICAgICAgICAgICAgICAgICAgIFwicXFcIjogdXNlclswXSxcbiAgICAgICAgICAgICAgICAgICAgXCJhdXRoX2NvZGVcIjogdXNlclsxXVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCcsXG4gICAgICAgICAgICB0aW1lb3V0OnRpbWVvdXRcbiAgICAgICAgfSk7XG4gICAgICAgIHVzZXJsb2dpbiA9IEpTT04ucGFyc2UodXNlcmxvZ2luKS5yZXN1bHQ7XG4gICAgICAgIGlmICh1c2VybG9naW4uc3RhdHVzID09PSAwKSB7XG4gICAgICAgICAgICB1c2VybG9naW4gPSB1c2VybG9naW4ucmVzdWx0XG4gICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgIHRpdGxlOiB1c2VybG9naW4ubmFtZSArIFwiJm5ic3A7Jm5ic3A7XCIgKyB1c2VybG9naW4ucXEgKyBcIiZuYnNwOyZuYnNwOyZuYnNwOyZuYnNwOzxzbWFsbD48dT7mm7TmjaLotKblj7cgPjwvdT48L3NtYWxsPlwiLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJyxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiB1c2VybG9naW4uYXZhdGFyX3VybCxcbiAgICAgICAgICAgICAgICB1cmw6IFwiaGlrZXI6Ly9wYWdlL1VzZXJyZWdpc3RyYXRpb25cIlxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICBkYXRhLnNwbGljZSgzLDAse1xuICAgICAgICAgICAgICAgIHRpdGxlOiB1c2VybG9naW4uaGFzX3JlcGx5P1wi8J+GleWbnuWkjVwiOlwi8J+UlOWbnuWkjVwiLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvTXlSZXBseT91cmw9aGlrZXI6Ly9lbXB0eSNmeXBhZ2Ujbm9IaXN0b3J5IyNub1JlY29yZEhpc3RvcnkjXCIsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICAgICAgICAgIGV4dHJhOntcbiAgICAgICAgICAgICAgICAgICAgYXV0aF9jb2RlOnVzZXJbMV0sXG4gICAgICAgICAgICAgICAgICAgIHFxOnVzZXJbMF1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgdGl0bGU6IHVzZXJsb2dpbi5kZXRhaWwsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcbiAgICAgICAgICAgICAgICBkZXNjOiBcIuKAnOKAnOKAneKAnTxzbWFsbD48dT7ph43mlrDojrflj5bpqozor4HnoIEgPjwvdT48L3NtYWxsPlwiLFxuICAgICAgICAgICAgICAgIHVybDogXCJoaWtlcjovL3BhZ2UvVXNlcnJlZ2lzdHJhdGlvblwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICB0aXRsZTogXCLor4Torr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mYWxzZSwvL+emgeeUqOW5tuWPkeabtOaWsFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGxldCBzaGFyZVRleHQgPSBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoc3ViT2JqKSk7XFxuICAgICAgICAgICAgICAgIHZhciBwYXN0ZXMgPSBnZXRQYXN0ZXMoKTtcXG4gICAgICAgICAgICAgICAgdmFyIHVybCA9IHNoYXJlUGFzdGUoc2hhcmVUZXh0LHBhc3Rlcy5zbGljZSgtMSlbMF0pO1xcbiAgICAgICAgICAgICAgICBsZXQgaW1wb3J0X3J1bGU9IFxcXCLovbvlkIjpm4borqLpmIXvvJpcXFwiK3RpdGxlKydcXFxcbicrdXJsO1xcbiAgICAgICAgICAgICAgICBjb3B5KGltcG9ydF9ydWxlKTtcXG4gICAgICAgICAgICAgICAgY29uc3QgcGF0aCA9ICdoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvcnVsZUNhY2hlL3N1Yi5qc29uJztcXG4gICAgICAgICAgICAgICAgJC5yYyhjb25maWcubGliLnN1Yik7XFxuICAgICAgICAgICAgICAgIHJldHVybiDorqLpmIXlr7zlhaUocGF0aClcXG4gICAgICAgICAgICB9LGRhdGFJdGVtLHN1YlVybCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgICAgICB9KTtcXG4gICAgfVxcbn1cXG5pZiAocnVsZUNvZGUpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5YiG5Lqr6KeE5YiZXFxcIixcXG4gICAgICAgIHVybDogXFxcImNvcHk6Ly9cXFwiICsgcnVsZUNvZGUsXFxuICAgICAgICBjb2xfdHlwZTogbXlfY29sX3R5cGVcXG4gICAgfSk7XFxufVxcblxcbmZ1bmN0aW9uIHNldFNldHRpbmdJdGVtKGJhc2ljLCBwYXR0ZXJuKSB7XFxuICAgIGxldCB0ZW1wID0ge1xcbi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3QoaW5wdXQpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5bey6K6+5Li65YWs5byAXFxcIjtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlXFxuICAgIH0sIHtcXG4gICAgICAgIHRpdGxlOiBcXFwi6ZqP5py65a+G6ZKlXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZSxcXG4gICAgICAgIHVybDogJChnZXRBcGkoXFxcImdlbkF1dGhcXFwiKSArIHJlcUJ5R2V0ICsgXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGxldCBiYWNrID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgbGV0IHJldCA9IEpTT04ucGFyc2UoYmFjayk7XFxuICAgICAgICAgICAgaWYgKHJldC5zdGF0dXMgPT0gMCkge1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7LnlJ/miJDpmo/mnLrlr4bnoIFcXFxcblxcXCIgKyByZXQucmVzdWx0XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/pmo/mnLrlr4bnoIHnlJ/miJDlpLHotKVcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfSk7XFxuICAgIGxldCB0aW1lT3ZlciA9IHtcXG4gICAgICAgIGNvbF90eXBlOiBteV9jb2xfdHlwZVxcbiAgICB9O1xcbiAgICBpZiAoZGF0YUl0ZW0udGltZV9vdmVyKSB7XFxuICAgICAgICB0aW1lT3Zlci50aXRsZSA9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Nlcm5hbWU6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICByZXBseUlkOml0ZW0uaWRcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcbiAgICAgICAgfSk7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBpdGVtLmRpc2N1c3NfdGV4dCxcXG4gICAgICAgICAgICBkZXNjOiBSZXBseStpdGVtLmNyZWF0ZV9kYXRlICsgXFxcIsK3XFxcIiArIGljb25baXRlbS5kaXNjdXNzX3R5cGVdLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvaW5mb1xcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgbmFtZTogaXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICB0eXBlOiBcXFwibG9uZ190ZXh0XFxcIixcXG4gICAgICAgICAgICAgICAgdGV4dDogaXRlbS5kaXNjdXNzX3RleHRcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBpY191cmw6IGl0ZW0uYXZhdGFyX3VybFxcbiAgICAgICAgfSk7XFxuICAgIH1cXG59XFxuZGF0YS5wdXNoKHtcXG4gICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbn0pO1xcbnNldFJlc3VsdChkYXRhKTtcIn0se1wiY29sX3R5cGVcIjpcImljb25fMl9yb3VuZFwiLFwibmFtZVwiOlwi6KeE5YiZ5YiX6KGoXCIsXCJwYXRoXCI6XCJydWxlc1wiLFwicnVsZVwiOlwianM6XFxuICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywkLnRvU3RyaW5nKCgpPT57XFxuICAgICAgICBjbGVhclZhcihcXFwiV2FyZWhvdXNlLmJhY2tcXFwiKTtcXG4gICAgICAgIGNs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gICBcXFwicGFzc3dvcmRcXFwiOiBnZXRWYXIoJ2hvdXNlLnBhc3N3b3JkJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjYW5fdXBsb2FkXFxcIjogISFmbGFnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgY29kZSA9IEpTT04ucGFyc2UoY29kZSkucmVzdWx0O1xcbiAgICAgICAgICAgIGlmIChjb2RlLnN0YXR1cyA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgY29kZS5kZXRhaWxcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGUubWVzc2FnZVxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon8J+aq+emgeatouS4iuS8oCcsXFxuICAgICAgICBjb2xfdHlwZTonc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICB1cmw6JCgn56aB5q2i6K+l5byA5Y+R6ICF5LiK5Lyg6KeE5YiZP+S9oOeahOaTjeS9nOWwhuiiq+ezu+e7n+iusOW9lScpLmNvbmZpcm0oKGlkLGNhbl91cGxvYWRfYXBpLHNldFVwbG9hZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0VXBsb2FkKGZhbHNlLGNhbl91cGxvYWRfYXBpKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdXYXJlaG91c2UuY2FuX3VwbG9hZCcsJ+WQpicpO1xcbiAgICAgICAgICAgICAgICBy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1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBzdWJVcmwsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3J1bGVDYWNoZS9cXFwiK3RpdGxlK1xcXCIuanNvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2RlOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGFjdGl2ZTogZmFsc2UsLy/npoHnlKjlubblj5Hmm7TmlrBcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgc2hhcmVUZXh0ID0gYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KHN1Yk9iaikpO1xcbiAgICAgICAgICAgICAgICB2YXIgcGFzdGVzID0gZ2V0UGFzdGVzKCk7XFxuICAgICAgICAgICAgICAgIHZhciB1cmwgPSBzaGFyZVBhc3RlKHNoYXJlVGV4dCxwYXN0ZXMuc2xpY2UoLTEpWzBdKTtcXG4gICAgICAgICAgICAgICAgbGV0IGltcG9ydF9ydWxlPSBcXFwi6L275ZCI6ZuG6K6i6ZiF77yaXFxcIit0aXRsZSsnXFxcXG4nK3VybDtcXG4gICAgICAgICAgICAgICAgY29weShpbXBvcnRfcnVsZSk7XFxuICAgICAgICAgICAgICAgIGNvbnN0IHBhdGggPSAnaGlrZXI6Ly9maWxlcy9ydWxlcy9kekhvdXNlL3J1bGVDYWNoZS9zdWIuanNvbic7XFxuICAgICAgICAgICAgICAgICQucmMoY29uZmlnLmxpYi5zdWIpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4g6K6i6ZiF5a+85YWlKHBhdGgpXFxuICAgICAgICAgICAgfSxkYXRhSXRlbSxydWxlTGlzdEpzb24gKyBkYXRhSXRlbS5pZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6IG15X2NvbF90eXBlMlxcbiAgICAgICA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HtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXCJVc2VyLUFnZW50XFxcIjogTU9CSUxFX1VBfSxcXG4gICAgICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwidXNlcm5hbWVcXFwiOiBnZXRWYXIoJ2hvdXNlLnVzZXJuYW1lJyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IGdldFZhcignaG91c2UucGFzc3dvcmQnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImlzX3NhZmVcXFwiOiAhIWZsYWdcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBjb2RlID0gSlNPTi5wYXJzZShjb2RlKS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKGNvZGUuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBjb2RlLmRldGFpbFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICByZXR1cm4gJ+aTjeS9nOWksei0pTonICsgZS5tZXNzYWdlXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgZnVuY3Rpb24gc2V0SXNHb29kKGZsYWcsbWFuX3J1bGVfZ29vZCkge1xcbiAgICAgICAgZmxhZyA9IGZsYWcgfHwgJyc7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxldCBjb2RlID0gZmV0Y2gobWFuX3J1bGVfZ29vZCwge1xcbiAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBNT0JJTEVfVUF9LFxcbiAgICAgICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ1c2VybmFtZVxcXCI6IGdldFZhcignaG91c2UudXNlcm5hbWUnKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogZ2V0VmFyKCdob3VzZS5wYXNzd29yZCcpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiaXNfZ29vZFxcXCI6ICEhZmxhZ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGNvZGUgPSBKU09OLnBhcnNlKGNvZGUpLnJlc3VsdDtcXG4gICAgICAgICAgICBpZiAoY29kZS5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICfmk43kvZzlpLHotKU6JyArIGNvZGUuZGV0YWlsXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIHJldHVybiAn5pON5L2c5aSx6LSlOicgKyBlLm1lc3NhZ2VcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/Cfmqvpo47pmaknLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uumjjumZqT/po47pmanop4TliJnml6Dms5Xooqvlr7zlhaUnKS5jb25maXJtKChpZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNTYWZlKGZhbHNlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pyF5q2j5bi4JyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrmraPluLg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfc2FmZSxzZXRJc1NhZmUpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzU2FmZSh0cnVlLG1hbl9ydWxlX3NhZmUpO1xcbiAgICAgICAgICAgIGlmKCEv5pON5L2c5aSx6LSlLy50ZXN0KHJldCkpe1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly8nK3JldFxcbiAgICAgICAgfSxkYXRhSXRlbS5pZCxtYW5fcnVsZV9zYWZlLHNldElzU2FmZSlcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTon4pml6Z2e5LyY6LSoJyxcXG4gICAgICAgIGNvbF90eXBlOidzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgIHVybDokKCfmoIforrDor6Xop4TliJnkuLrpnZ7kvJjotKg/JykuY29uZmlybSgoaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpPT57XFxuICAgICAgICAgICAgbGV0IHJldCA9IHNldElzR29vZChmYWxzZSxtYW5fcnVsZV9nb29kKTtcXG4gICAgICAgICAgICBpZighL+aTjeS9nOWksei0pS8udGVzdChyZXQpKXtcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8vJytyZXRcXG4gICAgICAgIH0sZGF0YUl0ZW0uaWQsbWFuX3J1bGVfZ29vZCxzZXRJc0dvb2QpXFxuICAgIH0pO1xcbiAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgdGl0bGU6J/CfkpbkvJjotKgnLFxcbiAgICAgICAgY29sX3R5cGU6J3Njcm9sbF9idXR0b24nLFxcbiAgICAgICAgdXJsOiQoJ+agh+iusOivpeinhOWImeS4uuS8mOi0qD8nKS5jb25maXJtKChpZCxtYW5fcnVsZV9nb29kLHNldElzR29vZCk9PntcXG4gICAgICAgICAgICBsZXQgcmV0ID0gc2V0SXNHb29kKHRydWUsbWFuX3J1bGVfZ29vZCk7XFxuICAgICAgICAgICAgaWYoIS/mk43kvZzlpLHotKUvLnRlc3QocmV0KSl7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrcmV0XFxuICAgICAgICB9LGRhdGFJdGVtLmlkLG1hbl9ydWxlX2dvb2Qsc2V0SXNHb29kKVxcbiAgICB9KTtcXG59XFxuXFxuZGF0YS5wdXNoKHtcXG4gICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbn0pO1xcbmRhdGEucHVzaCh7XFxuICAgIHRpdGxlOiBkYXRhSXRlbS5nb29kX251bSxcXG4gICAgcGljX3VybDogXFxcImhpa2VyOi8vZmlsZXMvaWNvbi/otZ4uc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B9LFxcbiAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgXFxcInBhcmFtc1xcXCI6IHtcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJyZWFzb25cXFwiOiBkZXNjcmlwdGlvbixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJuYW1lXFxcIjogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJwYXNzd29yZFxcXCI6IHBhc3N3b3JkLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogdXNlcm5hbWVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIG1ldGhvZDogJ3Bvc3QnXFxuICAgICAgICB9KTtcXG4gICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgIT09IDApIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgaWRyZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QoZ2V0SWQgKyBcXFwiP3FxPVxcXCIgKyB1c2VybmFtZSkpO1xcbiAgICAgICAgaWYgKGlkcmVzdWx0LnN0YXR1cyAhPT0gMCkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgaWRyZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgfVxcbiAgICAgICAgXFxuICAgICAgICByZXR1cm4gJChcXFwiXFxcIiwgXFxcIui+k+WFpemCrueusemqjOivgeeggVxcXFxuXFxcIiArIHJlc3VsdC5kZXRhaWwpLmlucHV0KChjb25maXJtLCBpZCwgYWNjb3VudCkgPT4ge1xcbiAgICAgICAgICAgIHNob3dMb2FkaW5nKFxcXCLor7fogJDlv4PnrYnlvoVcXFwiKTtcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChjb25maXJtLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHk6IEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwicmVnaXN0X2lkXFxcIjogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJ5em1cXFwiOiBpbnB1dFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQuc3RhdHVzICE9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VVc2VybmFtZVxcXCIsIGFjY291bnRbMF0pO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKFxcXCJXYXJlaG91c2VQYXNzd29yZFxcXCIsIGFjY291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ICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBcXFwi5L+d5a2YXFxcIixcXG4gICAgICAgIHVybDogJChnZXRBcGkoXFxcIm1vZGlmeV9hdmFcXFwiKSArIHBhdGgpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBsZXQgbmV3QXZhdGFyID0gZ2V0VmFyKCdXYXJlaG91c2UubS5hdmF0YXInLCAnJyk7XFxuICAgICAgICAgICAgXFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJmF2YXRhcl91cmw9XFxcIiArIGVuY29kZVVSSUNvbXBvbmVudChuZXdBdmF0YXIpKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgYmFjaygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L+u5pS55oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxuICAgIH0pO1xcbn1cXG5cXG5mdW5jdGlvbiBtX3B3ZCgpIHtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi5Y6f5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeWOn+WvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQueScsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0uUGFzc3dvcmQueVxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgfSk7XFxuICAgIGRhdGEucHVzaCh7XFxuICAgICAgICB0aXRsZTpcXFwi5paw5a+G56CBXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeaWsOWvhueggVxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHR5cGU6XFxcInBhc3N3b3JkXFxcIixcXG4gICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldFZhcignV2FyZWhvdXNlLm0uUGFzc3dvcmQueCcsICcnKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJ3B1dFZhcihcXFwiV2FyZWhvdXNlLm0uUGFzc3dvcmQueFxcXCIsaW5wdXQpJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgZGF0YS5wdXNoKHtcXG4gICAgICAgIHRpdGxlOlxcXCLph43lpI3mlrDlr4bnoIFcXFwiLFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICBkZXNjOiBcXFwi6K+36YeN5aSN5paw5a+G56CBXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgdHlwZTpcXFwicGFzc3dvcmRcXFwiLFxcbiAgICAgICAgICAgIHRpdGxlVmlzaWJsZTogZmFsc2UsXFx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hc3N3b3JkIT09bmV3X3Bhc3N3b3JkX2FnYWluKXtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4pOasoeWvhueggeS4jeWQjFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHJlcXVlc3QoaW5wdXQgKyBcXFwiJm5ld19wYXNzd29yZD1cXFwiICsgbmV3X3Bhc3N3b3JkK1xcXCImbmV3X3Bhc3N3b3JkX3JlPVxcXCIrbmV3X3Bhc3N3b3JkX2FnYWluKTtcXG4gICAgICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCk7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKFxcXCJoaWtlcjovL2ZpbGVzL1dhcmVob3VzZVVTRVIuanNvblxcXCIsSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdXNlcm5hbWU6dXNlcm5hbWUsXFxuICAgICAgICAgICAgICAgICAgICBwYXNzd29yZDpuZXdfcGFzc3dvcmRcXG4gICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICBiYWNrKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/kv67mlLnmiJDlip9cXFwiO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9cXFwiICsgcmVzdWx0LmRldGFpbDtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LHBhc3N3b3JkLHVzZXJuYW1lKSxcXG4gICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG4gICAgfSk7XFxufVxcblxcbnN3aXRjaCAoUGF0dGVybikge1xcbiAgICBjYXNlIDA6XFxuICAgICAgICBzZXRQYWdlVGl0bGUoXFxcIuS/ruaUueW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xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGljX3VybDogaXRlbS5hdmF0YXJfdXJsXFxuICAgICAgICB9KTtcXG4gICAgICAgIGRhdGEucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ZW0uZGlzY3Vzc190ZXh0LFxcbiAgICAgICAgICAgIGRlc2M6IFJlcGx5K2l0ZW0uY3JlYXRlX2RhdGUgKyBcXFwiwrdcXFwiICsgaWNvbltpdGVtLmRpc2N1c3NfdHlwZV0sXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9pbmZvXFxcIixcXG4gICAgICAgICAgICBleHRyYTp7XFxuICAgICAgICAgICAgICAgIG5hbWU6aXRlbS5uYW1lLFxcbiAgICAgICAgICAgICAgICB0eXBlOlxcXCJsb25nX3RleHRcXFwiLFxcbiAgICAgICAgICAgICAgICB0ZXh0Oml0ZW0uZGlzY3Vzc190ZXh0XFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBwaWNfdXJsOiBpdGVtLmF2YXRhcl91cmxcXG4gICAgICAgIH0pO1xcbiAgICAgICAgY29udHJvbChpdGVtLmlkLGl0ZW0uYWN0aXZlKTtcXG4gICAgfVxcbiAgICBpZiAoY29tbWVudExpc3QubGVuZ3RoID09PSAwKSB7XFxuICAgICAgICBkYXRhLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxufVxcblxcbnNldFJlc3VsdChkYXRhKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Y+R6KGo6K+E6K66XCIsXCJwYXRoXCI6XCJNYWtlQWNvbW1lbnRcIixcInJ1bGVcIjpcImpzOlxcbmxldCBkYXRhID0gW107XFxuY29uc3Qge1xcbiAgICBhcGksXFxuICAgI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dpZnkocCksXFxuICAgICAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcCA9IHtcXG4gICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190ZXh0XFxcIjogdGV4dCxcXG4gICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgIFxcXCJkaXNjdXNzX3R5cGVcXFwiOiB0eXBlLFxcbiAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogYXV0aF9jb2RlXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHJlc3VsdCA9IHIocCk7XFxuICAgICAgICBpZihyZXN1bHQuc3RhdHVzPT09MCl7XFxuICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIityZXN1bHQuZGV0YWlsO1xcblxcbiAgICB9LHVzZXIpXFxufSk7XFxuXFxuc2V0UmVzdWx0KGRhdGEpO1wifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Lyq55So5oi35rOo5YaMXCIsXCJwYXRoXCI6XCJVc2VycmVnaXN0cmF0aW9uXCIsXCJydWxlXCI6XCJqczpcXG5jb25zdCB7XFxuICAgIGFwaSxcXG4gICAgZ2V0RmlsZSxcXG4gICAgZ2V0VXNlckRhdGVcXG59ID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvdXRpbGl5XFxcIik7XFxubGV0IGRhdGEgPSBbXTtcXG5kYXRhLnB1c2goe1xcbiAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxufSk7XFxuc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CByZXN1bHQgPSByZXF1ZXN0KGEsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHFxXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlc3VsdCA9IEpTT04ucGFyc2UocmVzdWx0KS5yZXN1bHQ7XFxuICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICAgICAgaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL1xcXCIgKyByZXN1bHQuZGV0YWlsO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGxldCByZXN1bHQyID0gSlNPTi5wYXJzZShyZXF1ZXN0KGIgKyBcXFwiP3FxPVxcXCIgKyBxcSkpO1xcbiAgICAgICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdDIuZGV0YWlsO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBoaWRlTG9hZGluZygpO1xcbiAgICAgICAgICAgIHRocm93IGU7XFxuICAgICAgICB9XFxuICAgICAgICB9LCBxcSwgYSwgYik7XFxuXFxuICAgIH0sIG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B1c2goe1xcbiAgICB0aXRsZTogXFxcIumqjOivgS/nmbvlvZVcXFwiLFxcbiAgICB1cmw6ICQoXFxcIuehruWumuS/neWtmO+8jOmqjOivgeeggeWhq+mUme+8jOaXoOazleivhOiuuuWTplxcXCIpLmNvbmZpcm0oKGYsIGwsIGxvZ2luKSA9PiB7XFxuICAgICAgICBsZXQgcXEgPSBnZXRWYXIoJ1dhcmVob3VzZS5tLnFxJywgJycpO1xcbiAgICAgICAgbGV0IHl6bSA9IGdldFZhcignV2FyZWhvdXNlLm0ueXptJywgJycpO1xcbiAgICAgICAgaWYgKHFxID09IFxcXCJcXFwiIHx8IHl6bSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly9xceaIlumqjOivgeeggeS4uuepulxcXCI7XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgcmVzdWx0ID0gcmVxdWVzdChsb2dpbiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ2NvbnRlbnQtdHlwZSc6ICdhcHBsaWNhdGlvbi9qc29uJ1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keTogSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICBcXFwicGFyYW1zXFxcIjoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcInFxXFxcIjogcXEsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYXV0aF9jb2RlXFxcIjogeXptXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBtZXRob2Q6ICdQT1NUJ1xcbiAgICAgICAgfSk7XFxuICAgICAgICByZXN1bHQgPSBKU09OLnBhcnNlKHJlc3VsdCkucmVzdWx0O1xcbiAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT09IDApIHtcXG4gICAgICAgICAgICBmLnVzZXIgPSBbcXEsIHl6bV07XFxuICAgICAgICAg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cIiB8fCB1c2VybmFtZSA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mnKrnmbvlvZXotKblj7dcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRleHQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v5L2g6L+Y5LuA5LmI6YO95rKh5YaZ5ZWKXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCByZXN1bHQgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnY29udGVudC10eXBlJzogJ2FwcGxpY2F0aW9uL2pzb24nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgIFxcXCJwYXJhbXNcXFwiOiB7XFxuICAgICAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc190ZXh0XFxcIjogdGV4dCxcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxcVxcXCI6IHVzZXJuYW1lLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcInBhc3N3b3JkXFxcIjogcGFzc3dvcmQsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZGlzY3Vzc19pZFxcXCI6IHJ1bGVJZFxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXN1bHQpLnJlc3VsdDtcXG4gICAgICAgIGlmIChyZXN1bHQuc3RhdHVzID09PSAwKSB7XFxuICAgICAgICAgICAgYmFjayhmYWxzZSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vXFxcIiArIHJlc3VsdC5kZXRhaWw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mxfYXJyWzJdLnRvVXBwZXJDYXNlKCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7aGVhZGVyczpoZWFkZXJzLHdpdGhIZWFkZXJzOmZhbHNlLHJlZGlyZWN0OmZhbHNlfTtcXG4gICAgICAgICAgICBpZih3ZWJfdXJsX2Fyci5sZW5ndGg+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+mimOmTvuaOpScpO1xcbiAgICAgICAgICAgIGxldCB3ZWJfdXJsX2FyciA9IGlucHV0LnNwbGl0KCfvv6UnKTtcXG4gICAgICAgICAgICBsZ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lnLmxpYi5maWxlU2VsZWN0O1xcbiAgICAgICAgbGV0IGY9JC5yYyhmcCk7XFxuICAgICAgICByZXR1cm4gZi5maWxlU2VsZWN0aW9uVXJpKHtcXG4gICAgICAgICAgICBjYWxsYmFjazogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0YXJnZXQgPSBmaW5kSXRlbShcXFwiZmlsZVBhdGhcXFwiKS5leHRyYTtcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbShcXFwiZmlsZVBhdGhcXFwiLCB7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYTogT2JqZWN0LmFzc2lnbih0YXJnZXQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IFBBVEhcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwdXRWYXIoJ2hvdXNlLndlYl91cmwnLFBBVEgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBvbkNsaWNrVHlwZTonY29uZmlybScsXFxuICAgICAgICAgICAgZmlsZVR5cGU6IFxcXCIuanN8LnR4dHwuaGlrZXJ8Lmpzb258Lmh0bWxcXFwiLFxcbiAgICAgICAgICAgIHBhdHRlcm46IDAsXFxuICAgICAgICAgICAgcmVxdWlyZVVybDpmcCxcXG4gICAgICAgICAgICBpbml0aWFsUGF0aDpnZXRQYXRoKCdoaWtlcjovL2ZpbGVzL3J1bGVzL2R6SG91c2UvJykuc2xpY2UoNyksXFxuICAgICAgICAgICAgbWVtb3J5Oid0cnVlJyxcXG4gICAgICAgIH0pO1xcbiAgICB9KSxcXG4gICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTon5LiK5Lyg57G75Z6LJyxcXG4gICAgZG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iZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGVsc2UgaWYoL21ndHZcXFxcLmNvbXxieXRlYW1vbmUvLnRlc3QocGxheVVybCkpe1xcbiAgICAgICAgICAgICAgICBwbGF5VXJsKz1cXFwiO3tVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgfWVsc2UgaWYoL3B0d29cXFxcLndrZmlsZVxcXFwuY29tLy50ZXN0KHBsYXlVcmwpJiYvdXJsPS8udGVzdChwbGF5VXJsKSl7XFxuICAgICAgICAgICAgICAgIHBsYXlVcmw9cGxheVVybC5zcGxpdChcXFwidXJsPVxcXCIpWzFdK1xcXCI7e1JlZmVyZXJAaHR0cHM6Ly9mYW50dWFuLnR2fVxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8g5aSE55CG5aSn5biI5YWE5LmL57G755qEYXBwXFxuICAgICAgICAgICAgLy8gZWxzZXtcXG4gICAgICAgICAgICAvLyAgICAgcGxheVVybCs9XFxcIjt7VXNlci1BZ2VudEBNb3ppbGxhLzUuMH1cXFwiO1xcbiAgICAgICAgICAgIC8vIH1cXG4gICAgICAgIH1cXG4gICAgICAgIHBsYXlVcmw9cmVjaGFuZ2UocGxheVVybCk7XFxuICAgICAgICBpZighLyNpc1ZpZGVvPXRydWUjLy50ZXN0KHBsYXlVcmwpKXtcXG4gICAgICAgICAgICBwbGF5VXJsKz1cXFwiI2lzVmlkZW89dHJ1ZSNcXFwiO1xcbiAgICAgICAgfVxcbiAgICAgICAgLy8gbGV0IHQyID0gbmV3IERhdGUoKS5nZXRUaW1lKCk7XFxuICAgICAgICAvLyBwcmludCgn5Yik5pataXNWaWRlb+iAl+aXtjonKyh0Mi10MSkpO1xcbiAgICAgICAgcmV0dXJuIHBsYXlVcmw7XFxuICAgIH1lbHNle1xcbiAgICAgICAgLy8gbGV0IHQyID0gbmV3IERhdGUoKS5n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xpc3RbaV0sdFsyXSk6Jyc7XFxuICAgICAgICAgICAgaWYoaXNQaWMoX3BpYykmJiEvQFJlZmVyZXI9Ly50ZXN0KF9waWMpKXtcXG4gICAgICAgICAgICAgICAgX3BpYys9J0BSZWZlcmVyPSdcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbGV0IGl0PXtcXG4gICAgICAgICAgICAgICAgdGl0bGU6cGRmaChsaXN0W2ldLHRbMV0pLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOl9waWMsXFxuICAgICAgICAgICAgICAgIGRlc2M6cGRmaChsaXN0W2ldLHRbM10pLFxcbiAgICAgICAgICAgICAgICB1cmw6ZWo/cGQobGlzdFtpXSx0WzRdKTpwZChsaXN0W2ldLHRbNF0pK2xhenlcXG4gICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIGlmKHQubGVuZ3RoPjUpey8v5YaF5a6577yM55So5LqO5pCc57SiXFxuICAgICAgICAgICAgICAgIGl0LmNvbnRlbnQ9cGRmaChsaXN0W2ldLHRbNV0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaChpdCk7XFxuICAgICAgICB9XFxuICAgICAgICBpZihvbmx5YmFjayl7XFxuICAgICAgICAgICAgcmV0dXJuIGRcXG4gICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgIHNldFJlc3VsdChkKVxcbiAgICAgICAgfVxcbiAgICB9LHBhclN0cixlaixvbmx5YmFjayxodG1sLGlzUGljKVxcbn1cXG5cXG5mdW5jdGlvbiBpc0JhZFZpZGVvKHZpZGVvVXJsKSB7Ly/mmK/lnY/nmoTop4bpopFcXG4gICAgbGV0IGRtUGF0aCA9ICdoaWtlcjovL2ZpbGVzL2NhY2hlL2RpYW9tYW8udHh0JzsvL+WQiuavm+aooeW8j+i/h+a7pOaWh+S7tui3r+W+hFxcbiAgICBsZXQgZG1VcmxzO1xcbiAgICB0cnkge1xcbiAgICAgICAgZG1VcmxzID0gcmVxdWVzdChkbVBhdGg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VvLHJlY2hhbmdlLHBsYXlVcmwsbWF4X2NvdW50LFBDX1VBLGlzQmFkVmlkZW8pPT57XFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgaWYodHlwZW9mKGZiYSk9PSd1bmRlZmluZWQnfHwhZmJhKXtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBmYmEgPSBmeV9icmlkZ2VfYXBwO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBpZih0eXBlb2YocmVxdWVzdCk9PSd1bmRlZmluZWQnfHwhcmVxdWVzdCl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXZhbChmYmEuZ2V0SW50ZXJuYWxKcygpKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUubWVzc2FnZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZmJhLnB1dFZhcihcXFwiX3g1anhVcmxcXFwiLHBsYXlVcmwpO1xcbiAgICAgICAgICAgICAgICBpZih3aW5kb3cuY291bnQgPT0gbnVsbCl7XFxuICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY291bnQ9MTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBsZXQgdGV4dD0nJztcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICAgICAgfWNhdGNoIChlKSB7ZmJhLmxvZyhlLm1lc3NhZ2UpfVxcbiAgICAgICAgICAgICAgICBpZigv6Kem5Y+R5LqG6Ziy55uX6ZO+fOacquaOiOadg3zmjqXlj6PpmLLnm5cvLnRlc3QodGV4dCkmJndpbmRvdy5jb3VudD09PTEpe1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvY2F0aW9uLnJlbG9hZCgpO1xcbiAgICAgICAgICAgICAgICAgICAgbG9jYXRpb24uaHJlZj1mYmEuZ2V0VmFyKFxcXCJfeDVqeFVybFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHdpbmRvdy5jb3VudCsrO1xcbiAgICAgICAgICAgICAgICAvLyBmYmEubG9nKCdjb3VudDonK3dpbmRvdy5jb3VudCsnLG1heF9jb3VudDonK21heF9jb3VudCk7XFxuICAgICAgICAgICAgICAgIGlmKCB3aW5kb3cuY291bnQgPj0gbWF4X2NvdW50KXtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5sb2coXFxcIui2hei/h1xcXCIrbWF4X2NvdW50KjI1MCtcXFwi5q+r56eS5pyq6I635Y+W5Yiw6LWE5rqQ5Zyw5Z2A77yM6Lez5Yiw5rqQ572R6aG1LOS7peS4i+aYr+WKoOi9vei/h+eahOWcsOWdgFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGV4dD1kb2N1bWVudC5xdWVyeVNlbGVjdG9yKFxcXCJib2R5XFxcIikuaW5uZXJUZXh0O1xcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2codGV4dCk7XFxuICAgICAgICAgICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKEpTT04uc3RyaW5naWZ5KF9nZXRVcmxzKCkpKTtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYmEuZ2V0VmFyKFxcXCJfeDVqeFVybFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG11dGVNZShlbGVtKSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsZW0ucGF1c2UoKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgdmFyIHZpZGVvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcInZpZGVvXFxcIiksIGF1ZGlvcyA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoXFxcImF1ZGlvXFxcIiksIHYyID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbChcXFwiZW1iZWRcXFwiKSwgdjMgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKFxcXCIjcGxheWVyXFxcIik7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodmlkZW9zLCBmdW5jdGlvbiAodmlkZW8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUodmlkZW8pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwoYXVkaW9zLCBmdW5jdGlvbiAoYXVkaW8pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBtdXRlTWUoYXVkaW8pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjIsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBbXS5mb3JFYWNoLmNhbGwodjMsIGZ1bmN0aW9uICh2KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbXV0ZU1lKHYpO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgICAgIHZhciB1cmxzID0gX2dldFVybHMoKTtcXG4gICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhKU09OLnN0cmluZ2lmeSh1cmxzKSk7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBmb3IobGV0IGkgaW4gdXJscykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1PXVybHNbaV07XFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5e3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO31jYXRjaChlKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy9cXG4gICAgICAgICAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidXJsPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZyhcXFwidXJs5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3VybD1cXFxcLy8udGVzdCh1KSYmL1xcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0ID0gdS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSBob3N0K3Uuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUgPSB1LnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKFxcXCJ2aWTliIblibI6XFxcIit1KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdmlkPVxcXFwvLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGhvc3QgPSB1Lm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IGhvc3QrdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwidmlk5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUpJiYvXFxcXC5tM3U4Ly50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdSA9IFxcXCJodHRwXFxcIit1LnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5YW25LuW5YiG5YmyOlxcXCIrdSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vfGluZGV4XFxcXC5tM3U4JFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFwvMVxcXFwubTN1OC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB1PXUucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcmVhbFVybCA9IGlzVmlkZW8odSxyZWNoYW5nZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYodHlwZW9mKHJlYWxVcmwpPT0nc3RyaW5nJyYmIWlzQmFkVmlkZW8odSkpey8v6L+H5ruk5ZCK5q+b6KeG6aKRXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZnlfYnJpZGdlX2FwcC5zZXRXZWJVYShQQ19VQSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHR5cGVvZihmYmEuZ2V0SGVhZGVyVXJsKSE9PSd1bmRlZmluZWQnJiZ0eXBlb2YocmVjaGFuZ2UpIT09J2Z1bmN0aW9uJyl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodS5yZXBsYWNlKFxcXCI7e1xcXCIsXFxcIiNpc1ZpZGVvPXRydWUjO3tcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgYmFja1VybCA9IGZiYS5nZXRIZWFkZXJVcmwodXJsc1tpXSkucmVwbGFjZSgnO3snLCcjaWdub3JlSW1nPXRydWUjI2lzVmlkZW89dHJ1ZSM7eycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUxID0gYmFja1VybC5zcGxpdCgnI2lnbm9yZUltZycpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHUyID0gJyNpZ25vcmVJbWcnK2JhY2tVcmwuc3BsaXQoJyNpZ25vcmVJbWcnKVsxXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEucmVwbGFjZSgvJmZyb209Lip8Jm5leHQ9Lip8Jmp1bXA9LiovLCcnKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKC91cmw9aHR0cC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gdTEuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZSBpZigvdXJsPVxcXFwvLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBob3N0MSA9IHUxLm1hdGNoKC8oLiopXFxcXC9cXFxcLyguKj8pXFxcXC8vKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IGhvc3QxK3UxLnNwbGl0KFxcXCJ1cmw9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGZiYS5sb2coXFxcInVybOWIhuWJsjpcXFwiK3UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZigvdmlkPWh0dHAvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1MSA9IHUxLnNwbGl0KFxcXCJ2aWQ9XFxcIikuc2xpY2UoLTEpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2UgaWYoL3ZpZD1cXFxcLy8udGVzdCh1MSkmJi9cXFxcLm0zdTgvLnRlc3QodTEpKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaG9zdDEgPSB1MS5tYXRjaCgvKC4qKVxcXFwvXFxcXC8oLio/KVxcXFwvLylbMF07XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTEgPSBob3N0MSt1MS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUxKSYmL1xcXFwubTN1OC8udGVzdCh1MSkpe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUxID0gXFxcImh0dHBcXFwiK3UxLnNwbGl0KC9cXFxcPyguKik9aHR0cC8pLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhY2tVcmwgPSB1MSArIHUyO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZmJhLmxvZygn6L+U5Zue6Ieq5Yqo5YqgY29va2ll6ZO+5o6lOicrYmFja1VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYmEubG9nKCfov5Tlm57pk77mjqU6Jyt1Kyflubboh6rliqjliqDkuoZjb29raWUs5YW35L2TY29va2ll5Zyo6KeG6aKR5pKt5pS+5aSE5p+l55yLJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYmFja1VybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNle1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi6L+U5Zue5LuT5bqTeDXlhY3ll4Xnu5Pmnpw6XFxcIityZWFsVXJsKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiByZWFsVXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1jYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhlLm1lc3NhZ2UpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgLy8gZnlfYnJpZGdlX2FwcC5sb2coJ3g15aSn6IyD5Zu06ZSZ6K+vOicrZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgYWxlcnQoJ3g15aSn6IyD5Zu06ZSZ6K+vOicrZS5tZXNzYWdlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+aKpemUmee7k+adn3g1J1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0saXNWaWRlbyxyZWNoYW5nZSxwbGF5VXJsLG1heF9jb3VudCxQQ19VQSxpc0JhZFZpZGVvKTtcXG4gICAgICAgIGxldCB1c2VXZWI9bHNnLmdldEl0ZW0oXFxcIumAmuWFjVxcXCIsXFxcIlg1XFxcIik9PT1cXFwiV0VCXFxcIjtcXG4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AgICAgICAgIHdpbmRvdy5jb3VudCA9IDE7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCB0ZXh0PScnO1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIHRleHQ9ZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiYm9keVxcXCIpLmlubmVyVGV4dDtcXG4gICAgICAgICAgICB9Y2F0Y2ggKGUpIHtmYmEubG9nKGUubWVzc2FnZSl9XFxuICAgICAgICAgICAgaWYoL+inpuWPkeS6humYsuebl+mTvnzmnKrmjojmnYN85o6l5Y+j6Ziy55uXLy50ZXN0KHRleHQpJiZ3aW5kb3cuY291bnQ9PTEpe1xcbiAgICAgICAgICAgICAgICBsb2NhdGlvbi5yZWxvYWQoKTtcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5qOA5rWL5Yiw5pyJ5o6I5p2D77yM5byA5aeL6L+H5o6I5p2DXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHdpbmRvdy5jb3VudCsrO1xcbiAgICAgICAgICAgIC8vIGZiYS5sb2coJ2NvdW50OicgKyB3aW5kb3cuY291bnQgKyAnLG1heF9jb3VudDonICsgbWF4X2NvdW50KTtcXG4gICAgICAgICAgICBpZiAod2luZG93LmNvdW50ID49IG1heF9jb3VudCkge1xcbiAgICAgICAgICAgICAgICBmYmEuY2xlYXJWYXIoJ3g1TGlzdCcpO1xcbiAgICAgICAgICAgICAgICBmYmEuaGlkZUxvYWRpbmcoKTtcXG4gICAgICAgICAgICAgICAgbGV0IGZtc2cgPSAn6YGT6ZW/5LuT5bqT6YCa5YWN6Kej5p6Q5aSx6LSlLOWOn+WboDrotoXml7YnK3g1VGltZW91dCsn5q+r56eSJztcXG4gICAgICAgICAgICAgICAgZmJhLmxvZyhmbXNnKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovLycrZm1zZztcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9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2KTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgW10uZm9yRWFjaC5jYWxsKHYzLCBmdW5jdGlvbiAodikge1xcbiAgICAgICAgICAgICAgICBtdXRlTWUodik7XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgdXJscyA9IF9nZXRVcmxzKCk7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGZvciAobGV0IGkgaW4gdXJscykge1xcbiAgICAgICAgICAgICAgICBsZXQgdT11cmxzW2ldO1xcbiAgICAgICAgICAgICAgICAvL3U9ZGVjb2RlVVJJQ29tcG9uZW50KHUpO1xcbiAgICAgICAgICAgICAgICB0cnl7dT1kZWNvZGVVUklDb21wb25lbnQodSk7fWNhdGNoKGUpe1xcbiAgICAgICAgICAgICAgICAgICAgdT11bmVzY2FwZSh1KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZigvdXJsPWh0dHAvLnRlc3QodSkpe1xcbiAgICAgICAgICAgICAgICAgICAgdSA9IHUuc3BsaXQoXFxcInVybD1cXFwiKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgIH1lbHNlIGlmKC92aWQ9aHR0cC8udGVzdCh1KSl7XFxuICAgICAgICAgICAgICAgICAgICB1ID0gdS5zcGxpdChcXFwidmlkPVxcXCIpLnNsaWNlKC0xKVswXTtcXG4gICAgICAgICAgICAgICAgfWVsc2UgaWYoL1xcXFw/KC4qKT1odHRwLy50ZXN0KHUpKXtcXG4gICAgICAgICAgICAgICAgICAgIHUgPSBcXFwiaHR0cFxcXCIrdS5zcGxpdCgvXFxcXD8oLiopPWh0dHAvKS5zbGljZSgtMSlbMF07XFxuICAgICAgICAgICAgICAgICAgICAvL2ZiYS5sb2coXFxcIuWFtuS7lu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GaWxlKGxjYWNoZSxiYWNrY29kZSk7XFxuICAgICAgICAgICAgLy92aWRlb3MucHVzaChsY2FjaGUpO1xcbiAgICAgICAgICAgIGxldCBwVXJsPWNhY2hlTTN1OCh0dXJsKTtcXG4gICAgICAgICAgICB2aWRlb3MucHVzaChwVXJsKTtcXG4gICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgIH1cXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgbGV0IHVybCA9IEpTT04ucGFyc2UoYmFja2NvZGUpLnVybDtcXG4gICAgICAgICAgICBpZigvXmh0dHAvLnRlc3QodXJsKSl7XFxuICAgICAgICAgICAgICAgIGxldCByZWFsVmlkZW8gPSBpc1ZpZGVvKHVybCk7XFxuICAgICAgICAgICAgICAgIGlmKHR5cGVvZihyZWFsVmlkZW8pPT0nc3RyaW5nJyl7XFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+W3suino+aekOWHuuinhumikTonK3JlYWxWaWRlbyk7XFxuICAgICAgICAgICAgICAgICAgICBpZihqbmFtZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVhbFZpZGVvKz1cXFwi4piFXFxcIitqbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2gocmVhbFZpZGVvKTtcXG4gICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+ino+aekOWHuuS4jeefpemBk+S7gOS5iOS4nOilvzonK3VybCk7XFxuICAgICAgICAgICAgICAgICAgICB1cmwrPVxcXCIjaXNWaWRlbz10cnVlI1xcXCI7XFxuICAgICAgICAgICAgICAgICAgICBpZihqbmFtZSl7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsKz1cXFwi4piFXFxcIitqbmFtZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdmlkZW9zLnB1c2godXJsKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBsb2codG5hbWUrJ+S4umpzb27mjqXlj6PkuJTml6Dov5Tlm57op4bpopHlnLDlnYDmlbDmja46JytwbGF5VXJsTGlzdFtpXSsnXFxcXG4nK2JhY2tjb2RlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9Y2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICBsb2codG5hbWUrJ+S4ung15o6l5Y+jLOWKoOWFpXg15ZeF5o6i5YiX6KGoJyk7XFxuICAgICAgICAgICAgeDVsaXN0LnB1c2gocGxheVVybExpc3RbaV0pO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIC8vIGxvZyh2aWRlb3MpO1xcbiAgICBpZih2aWRlb3MubGVuZ3RoPjApe1xcbiAgICAgICAgaWYoZ2V0VmFyKCdkcC5jYWNoZVZpZGVvJywndHJ1ZScpPT09J3RydWUnJiZwYXJzZUludChnZXRBcHBWZXJzaW9uKCkpPj0yMjU1KVxcbiAgICAgICAge1xcbiAgICAgICAgICAgIGxvZyhcXFwi5bCK5pWs55qE6a2U5pat55So5oi377yM6KeG6aKR57yT5a2Y5bey5ZCv55So77yM6K+35bC95oOF5Lqr5Y+X55yL5Ymn5pe25YWJXFxcIik7XFxuICAgICAgICAgICAgbGV0IHZpZGVvc0NhY2hlPXZpZGVvcy5tYXAoKGl0KT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgaGVhZGVycz17fTtcXG4gICAgICAgICAgICAgICAgaWYoaXQuc3BsaXQoXFxcIjtcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgaGVhZCA9IGl0LnNwbGl0KCc7JylbMV07XFxuICAgICAgICAgICAgICAgICAgICBpZigvQC8udGVzdChoZWFkKSYmL3t8fS8udGVzdChoZWFkKSl7XFxuLy9oZWFkID0gaGVhZC5yZXBsYWNlKC97fH0vZywnJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZCA9IGhlYWQuc3BsaXQoXFxcIntcXFwiKVsxXS5zcGxpdChcXFwifVxcXCIpWzBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWQgPSBoZWFkLnNwbGl0KCcmJicpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvcihsZXQgaSBpbiBoZWFkKXtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGtleSA9IGhlYWRbaV0uc3BsaXQoJ0AnKVswXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHZhbHVlID1oZWFkW2ldLnNwbGl0KCdAJylbMV0ucmVwbGFjZSgvOy8sJ++8m++8mycpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzW2tleV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgICAgIHVybDppdC5zcGxpdChcXFwiO1xcXCIpWzBdLnNwbGl0KFxcXCLimIVcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6e1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6aGVhZGVyc1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgdmFyIGRhdGE9YmF0Y2hDYWNoZU0zdTgodmlkZW9zQ2FjaGUpO1xcbiAgICAgICAgICAgIGRhdGE9ZGF0YS5tYXAoKGl0LGlkKT0+e1xcbiAgICAgICAgICAgICAgICBsZXQgZXh0cmE9XFxcIlxcXCI7XFxuICAgICAgICAgICAgICAgIGlmKHZpZGVvc1tpZF0uc3BsaXQoXFxcIjtcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYT1cXFwiO1xcXCIrdmlkZW9zW2lkXS5zcGxpdChcXFwiO1xcXCIpWzFdO1xcbiAgICAgICAgICAgICAgICB9ZWxzZSBpZih2aWRlb3NbaWRdLnNwbGl0KFxcXCLimIVcXFwiKS5sZW5ndGg+MSl7XFxuICAgICAgICAgICAgICAgICAgICBleHRyYT1cXFwi4piFXFxcIit2aWRlb3NbaWRdLnNwbGl0KFxcXCLimIVcXFwiKVsxXTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBpZihpdCtcXFwiXFxcIiE9XFxcIm51bGxcXFwiKXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBpdCtleHRyYVxcbiAgICAgICAgICAgICAgICB9ZWxzZXtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2aWRlb3NbaWRdXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAvL2xvZyhkYXRhKTtcXG4gICAgICAgICAgICByZXR1cm4gZGF0YVxcbiAgICAgICAgICAgIC8vcmV0dXJuIHZpZGVvc1xcbiAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgcmV0dXJuIHZpZGVvc1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIGxvZygn5YWx5pyJJyt4NWxpc3QubGVuZ3RoKyfkuKp4NeWcsOWdgOi/m+ihjOi9rua1geWXheaOoicpO1xcbiAgICAvL+ayoeacieeahOivneWwseW8gOWni+S+neasoXg15ZeF5o6iXFxuICAgIHNob3dMb2FkaW5nKCfll4XmjqLkuK3vvIzoi6XlpLHotKXlsLHliIfmjaJ3ZWLll4XmjqIuLi4nKTtcXG4gICAgcmV0dXJuIHg1UGFyc2VQcm8oeDVsaXN0LHg1VGltZW91dCxpc1ZpZGVvKTtcXG59XFxudmFyIGxhenk9JCgnJykubGF6eVJ1bGUoKCk9PntcXG4gICAgdHJ5e1xcbiAgICAgICAgcmVhbFV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jovL2ZpbGVzL3J1bGVzL2pzLyRoaWtlci5qc1xcXCIsIC0xKTtcXG4gICAgICAgIC8vJC5zZXRSb290KCdodHRwczovL2hqZGhueC5jb2RpbmcubmV0L3B1YmxpYy9oaWtlci9oaWtlci9naXQvZmlsZXMvbWFzdGVyL2pzLycpO1xcbiAgICAgICAgJC5zZXRSb290KCk7XFxuICAgICAgICAkLnNldExpYih7XFxuICAgICAgICAgICAgbHNnOiBcXFwibHNnLmpzXFxcIiwgLy/mnKzlnLDlgqjlrZhcXG4gICAgICAgICAgICBmaWxlOiBcXFwiZmlsZS5qc1xcXCIsIC8v5paH5Lu2b3NcXG4gICAgICAgICAgICBmaWxlU2VsZWN0OiBcXFwiZmlsZVNlbGVjdC5qc1xcXCIsIC8v5paH5Lu26YCJ5oup5ZmoXFxuICAgICAgICAgICAgZHQ6IFxcXCJkdC5qc1xcXCIsIC8v5Yqo5oCB5YiG57G7XFxuICAgICAgICAgICAgZHI6IFxcXCJkci5qc1xcXCIsIC8vZHLmqKHmnb/kvp3otZZcXG4gICAgICAgICAgICBkcnByZTogXFxcImRycHJlLmpzXFxcIiwgLy9kcuaooeadv+mihOWkhOeQhlxcbiAgICAgICAgICAgIGRydXA6IFxcXCJkcnVwLmpzXFxcIiwgLy9kcuaooeadv+iHquWKqOabtOaWsFxcbiAgICAgICAgICAgIGRybWF0Y2g6IFxcXCJkcm1hdGNoLmpzXFxcIiwgLy9kcuaooeadv+iHquWKqOaooeadv+WMuemFjVxcbiAgICAgICAgICAgIGRybTogXFxcImRybS5qc1xcXCIsIC8vZHLmqKHmnb/lsI/nqIvluo9cXG4gICAgICAgICAgICBjbXM6IFxcXCJjbXMuanNcXFwiLCAvL2Ntc+aooeadv+S+nei1llxcbiAgICAgICAgICAgIGNtc3ByZTogXFxcImNtc3ByZS5qc1xcXCIsIC8vY21z6aKE5aSE55CGXFxuICAgICAgICAgICAgY21zbTogXFxcImNtc20uanNcXFwiLCAvL2Ntc+aooeadv+Wwj+eoi+W6j1xcbiAgICAgICAgICAgIGxpYmNoZWNrOiBcXFwibGliY2hlY2suanNcXFwiLCAvL2Ry5qOA5rWL5L6d6LWWXFxuICAgICAgICAgICAgcnVsZUVkaXRvcjogXFxcInJ1bGVFZGl0b3IuanNcXFwiLCAvL+WGmemhtea6kOelnuWZqOWwj+eoi+W6j1xcbiAgICAgICAgICAgIGhvdXNlTGF6eTogXFxcImhvdXNlTGF6eS5qc1xcXCIsIC8v5LuT5bqT6YCa5YWNXFxuICAgICAgICAgICAgbGF6eTogXFxcImxhenkuanNcXFwiLCAvL+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+lJGhpa2VyQCc7XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBnZXRBcGkoJ2ltcG9ydFVybCcpK1xcXCI1MTExXFxcIjtcXG4gICAgICAgICAgICAgICAgbGV0IGltcG9ydFVybCA9ICdydWxlOi8vJytiYXNlNjRFbmNvZGUocnVsZUhlYWQrdXJsKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGltcG9ydFVybFxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygoKT0+e1xcblxcbiAgICAgICAgICAgIH0pLFxcbiAgICAgICAgfSlcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIkltcG9ydOivpue7hlwiLFwicGF0aFwiOlwicnVsZURldGFpbEltcG9ydFwiLFwicnVsZVwiOlwianM6XFxuJC5leHBvcnRzID0gXFxcImhpa2VyOi8vcGFnZS9ydWxlRGV0YWlsP3J1bGU96YGT6ZW/5LuT5bqTUHJvJmlkPVxcXCIgKyAkLmltcG9ydFBhcmFtO1xcblwifV0iLCJpY29uIjoiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL290aGVyLzMwLnN2ZyIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment