xiaomianao666

小程序:小女16

Oct 28th, 2024
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@小女16@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5bCP5aWzMTYiLCJhdXRob3IiOiJSIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSMjaHR0cHM6Ly94bnYxNnNwYS5zYnMvIyNmeXBhZ2UiLCJ2ZXJzaW9uIjoyMDI0MDIwNCwiY29sX3R5cGUiOiJtb3ZpZV8yIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxudmFyIGQgPSBbXTtcbmFkZExpc3RlbmVyKFwib25DbG9zZVwiLCAkLnRvU3RyaW5nKCgpID0+IHtcbiAgICBsZXQga2V5cyA9IGxpc3RNeVZhcktleXMoKTtcbiAgICBmb3IgKGxldCBpdCBvZiBrZXlzKSB7XG4gICAgICAgIGNsZWFyTXlWYXIoaXQpO1xuICAgIH1cbn0pKTsvKlxuYWRkTGlzdGVuZXIoXCJvblJlZnJlc2hcIiwgJC50b1N0cmluZygoKSA9PiB7XG4gICAgbGV0IGtleXMgPSBsaXN0TXlWYXJLZXlzKCk7XG4gICAgZm9yIChsZXQgaXQgb2Yga2V5cykge1xuICAgICAgICBjbGVhck15VmFyKGl0KTtcbiAgICB9XG59KSk7Ki9cbnZhciBnZXRSYW5nZUNvbG9ycyA9IGZ1bmN0aW9uKCkge8KgwqDCoMKgwqDCoMKgXG4gICAgcmV0dXJuICcjJyArICgnMDAwMDAnICsgKE1hdGgucmFuZG9tKCkgKiAweDEwMDAwMDAgPDwgMCkudG9TdHJp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biAgICAgICAg5bGV5byAOiBcXFwi4oCc4oCc4oCd4oCdPGI+XFxcIiArIFxcXCLiiKhcXFwiLmZvbnRjb2xvcihcXFwiI0ZGMDAwMFxcXCIpICsgXFxcIjwvYj5cXFwiLFxcbiAgICAgICAgb3BlbjogdHJ1ZSxcXG4gICAgICAgIHN0YXRlOiBNWV9SVUxFLnVybCxcXG4gICAgICAgIHNlYXJjaDogZmFsc2UsXFxuICAgICAgICBjbGVhcnM6IFtdLFxcbiAgICAgICAgY2xlYXJhbGw6IFtcXFwieWlfZmlyc3RwYWdlXFxcIl0sXFxuICAgICAgICBkZWJ1ZzogZmFsc2UsXFxuXFxuICAgICAgICDpooTorr4ocGFyYW0pIHtcXG4gICAgICAgICAgICBpZiAocGFyYW0gPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIHBhcmFtID0gW107XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKHBhcmFtKS5mb3JFYWNoKChwcm9wZXJ0eSkgPT4ge1xcbiAgICAgICAgICAgICAgICAvLyDlr7nmr4/kuKrlsZ7mgKflkI3miafooYzmk43kvZxcXG4gICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgPSBwYXJhbVtwcm9wZXJ0eV07IC8vIOiOt+WPluWxnuaAp+WAvFxcbiAgICAgICAgICAgICAgICAvLyDlnKjov5nph4zmiafooYzmgqjnmoTmk43kvZxcXG4gICAgICAgICAgICAgICAgdGhpc1twcm9wZXJ0eV0gPSB2YWx1ZTtcXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKHByb3BlcnR5ICsgXFxcIjpcXFwiICsgdmFsdWUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9LFxcbiAgICAgICAgZXZhbEpTUnVsZShpdGVtLFxcbiAgICAgICAgICAgIGpzUnVsZSkge1xcbiAgICAgICAgICAgIGxldCBydWxlID0ganNSdWxlLnJlcGxhY2UoXFxcIkBqczpcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiXFxcIik7XFxuICAgICAgICAgICAgcnVsZSA9IHJ1bGUudHJpbSgpO1xcbiAgICAgICAgICAgIC8vbG9nKCQuc3RyaW5naWZ5KHJ1bGUpKVxcbiAgICAgICAgICAgIGxldCBpbnB1dCA9IGl0ZW07XFxuICAgICAgICAgICAgaWYgKHJ1bGUuc3RhcnRzV2l0aChcXFwiKFxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGV2YWwoXFxcInJlc3VsdCA9IFxcXCIgKyBydWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAvKipcXG4gICAgICAgICAgICAgICAgICog6L+Y5Y6f5oiQICQudG9TdHJpbmcoLi4uKSDnmoTmnIDnu4jnu5PmnpzvvIzovr7liLDmnIDnu4jlpITnkIbmlrnlvI/ot5/kuIrpnaLnmoQgaWYg5LiA6Ie055qE55uu55qEXFxuICAgICAgICAgICAgICAgICAqL1xcbiAgICAgICAgICAgICAgICBldmFsKFxcXCJyZXN1bHQgPSBcXFwiICsgXFxcIigoKSA9PiB7XFxcIiArIHJ1bGUgKyBcXFwifSkoKVxcXCIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gcmVzdWx0IHx8IFxcXCJcXFwiO1xcbiAgICAgICAgfSxcXG4gICAgICAgIGdldFRpdGxlKHNyYywgY2F0ZWdvcnkpIHtcXG4gICAgICAgICAgICBsZXQgdGl0bGUgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBsZXQgdGl0bGVSdWxlID0gY2F0ZWdvcnkgfHwgXFxcImEmJlRleHRcXFwiO1xcbiAgICAgICAgICAgIGlmICh0aXRsZVJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlID0gdGhpcy5ldmFsSlNSdWxlKHNyYywgdGl0bGVSdWxlKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHBhcnNlRG9tRm9ySHRtbChzcmMsIHRpdGxlUnVsZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB0aXRsZSB8fCBcXFwiXFxcIjtcXG4gICAgICAgIH0sXFxuICAgICAgICBnZXRVcmwoc3JjLCBjYXRlZ29yeSkge1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBcXFwiXFxcIjtcXG4gICAgICAgICAgICBsZXQgdXJsUnVsZSA9IGNhdGVnb3J5LumTvuaOpSB8fCBcXFwiYSYmaHJlZlxcXCI7XFxuICAgICAgICAgICAgaWYgKHVybFJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIHVybFJ1bGUpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHBkKHNyYywgdXJsUnVsZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh0eXBlb2YgY2F0ZWdvcnku6ZO+5o6l5aSE55CGID09IFxcXCJmdW5jdGlvblxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gY2F0ZWdvcnku6ZO+5o6l5aSE55CGKHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiB1cmwgfHwgXFxcIlxcXCI7XFxuICAgICAgICB9LFxcbiAgICAgICAgaXNOdWxsKHBhcmFtKSB7XFxuICAgICAgICAgICAgaWYgKHBhcmFtID09IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgIH0sXFxuICAgICAgICBpc0Jvb2xlYW4odmFyaWFibGUpIHtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIHZhcmlhYmxlICE9PSBcXFwiYm9vbGVhblxcXCIpIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAg5riF6ZmkKGxpc3QpIHtcXG4gICAgICAgICAgICBpZiAodGhpcy5pc051bGwobGlzdCkpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChsaXN0LmNvbnN0cnVjdG9yID09IFN0cmluZykge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFwiKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgdGhpcy5jbGVhcnMgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWFqOa4hShsaXN0KSB7XFxuICAgICAgICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgYyA9IHRoaXMuY2xlYXJhbGw7XFxuICAgICAgICAgICAgbGlzdCA9IGMuY29uY2F0KGxpc3QpO1xcbiAgICAgICAgICAgIHRoaXMuY2xlYXJhbGwgPSBsaXN0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOa6kOeggShpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMuaHRtbCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOeVjOmdoihpbnB1dCkge1xcbiAgICAgICAgICAgIHRoaXMubGF5b3V0ID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg6aG156CBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5wYWdlID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAg54q25oCBKGlucHV0KSB7XFxuICAgICAgICAgICAgdGhpcy5zdGF0ZSA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aQnOe0oihpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLnNlYXJjaCA9IGlucHV0O1xcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOW8gOWQr+aKmOWPoChpbnB1dCkge1xcbiAgICAgICAgICAgIGlmIChpbnB1dCA9PSB1bmRlZmluZWQpIHtcXG4gICAgICAgICAgICAgICAgaW5wdXQgPSB0cnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0aGlzLmlzQm9vbGVhbihpbnB1dCk7XFxuICAgICAgICAgICAgdGhpcy5vcGVuID0gaW5wdXQ7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgICB9LFxcbiAgICAgICAgc2V0VGl0bGUoaywgaSwgdCkge1xcbiAgICAgICAgICAgIHJldHVybiBrID09IGkgPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHQuZm9udGNvbG9yKHRoaXMu5YiG57G76aKc6ImyKSA6IHQ7XFxuICAgICAgICB9LFxcbiAgICAgICAgYWN0aW9uKG9iaikge1xcbiAgICAgICAgICAgIHJldHVybiBbe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhvYmopO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihvYmouc3RhdGUpO1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdjYXRlX2J1dHRvbicpO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgb2JqLmNsLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICB9LCBvYmopLFxcbiAgICAgICAgICAgIH0sIF07XFxuICAgICAgICB9LFxcbiAgICAgICAgY2hlY2tQYXJhbSgpIHtcXG4gICAgICAgICAgICB2YXIgb2JqID0ge307XFxuICAgICAgICAgICAgaWYgKHRoaXMucGFnZSA9PSAwICYmIHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl6aG156CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gdGhpcy5wYWdlO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLpobXnoIFcXFwiXSA9IHBhZ2U7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMuaHRtbCA9PSBcXFwiZW1wdHlcXFwiICYmIHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5rqQ56CBXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBodG1sID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIua6kOeggVxcXCJdID0gdGhpcy5odG1sO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgb2JqW1xcXCLmupDnoIFcXFwiXSA9IGh0bWw7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMubGF5b3V0ID09IFxcXCJ1bmRlZmluZWRcXFwiICYmIHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl55WM6Z2iXFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBkID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gdGhpcy5sYXlvdXQ7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBvYmpbXFxcIueVjOmdolxcXCJdID0gZDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZXR1cm4gb2JqO1xcbiAgICAgICAgfSxcXG4gICAgICAgIOWIm+W7uuWKqOaAgeWIhuexuyhydWxlT2JqKSB7XFxuICAgICAgICAgICAgbGV0IGl0ZW1zID0gW107XFxuICAgICAgICAgICAgbGV0IGNhdGVzID0gW107XFxuICAgICAgICAgICAgaWYgKHJ1bGVPYmogPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgICAgIHJ1bGVPYmogPSBbXTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy/liJ3lp4vljJblj5jph4/lvIDlp4tcXG4gICAgICAgICAgICBjb25zdCBwYXJhbSA9IHRoaXMuY2hlY2tQYXJhbSgpO1xcbiAgICAgICAgICAgIGNvbnN0IHBhZ2UgPSBwYXJhbS7pobXnoIE7XFxuICAgICAgICAgICAgY29uc3QgaHRtbCA9IHBhcmFtLua6kOeggTtcXG4gICAgICAgICAgICBjb25zdCBkID0gcGFyYW0u55WM6Z2iO1xcbiAgICAgICAgICAgIGNvbnN0IOeKtuaAgSA9IHRoaXMuc3RhdGU7XFxuICAgICAgICAgICAgY29uc3Qgc2VhcmNoID0gdGhpcy5zZWFyY2g7XFxuICAgICAgICAgICAgY29uc3QgZW1wdHkgPSBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgY29uc3Qg5oqY5Y+g54q25oCBID0gdGhpcy5vcGVuO1xcbiAgICAgICAgICAgIHZhciDlsZXlvIAgPSB0aGlzLuWxleW8gDtcXG4gICAgICAgICAgICB2YXIg5oqY5Y+gID0gdGhpcy7mipjlj6A7XFxuICAgICAgICAgICAgdmFyIOWFqOa4hSA9IHRoaXMuY2xlYXJhbGw7XFxuICAgICAgICAgICAgdmFyIOa4hemZpCA9IHRoaXMuY2xlYXJzO1xcbiAgICAgICAgICAgIC8v5Yid5aeL5YyW5Y+Y6YeP57uT5p2fXFxuICAgICAgICAgICAgbGV0IGluaXRfY2F0ZSA9IG5ldyBBcnJheSgyMCkuZmlsbChcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgIGNvbnN0IGZvbGQgPSBnZXRNeVZhcihNWV9SVUxFLmdyb3VwLCBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgIGNvbnN0IGNhdGVfdGVtcCA9IEpTT04ucGFyc2UoXFxuICAgICAgICAgICAgICAgIGdldE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShpbml0X2NhdGUpKVxcbiAgICAgICAgICAgICk7XFxuICAgICAgICAgICAgaWYgKHNlYXJjaCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIvCflI5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiJ2hpa2VyOi8vc2VhcmNoP3J1bGU9XFxcIiArIE1ZX1JVTEUudGl0bGUgKyBcXFwiJnM9JytpbnB1dFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi5pCc57Si5YWz6ZSu6K+NXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKFxcXCJrZXl3b3JkXFxcIiwgXFxcIlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIG9uQ2hhbmdlOiAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImtleXdvcmRcXFwiLCBpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgY29uc3QgY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgIHJ1bGVPYmouZm9yRWFjaCgoeCkgPT4ge1xcbiAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgICAgICAgICAvL2xvZyh4KVxcbiAgICAgICAgICAgICAgICBpZiAoeC5qc29uICE9IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgICAgICAgICAgeC5qc29uLm1hcChrID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLnB1c2goSlNPTi5zdHJpbmdpZnkoaykucmVwbGFjZSgvXlxcXFxbfFxcXFxdJC9nLCAnJykpXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgLy9jYXRlZ29yaWVzLnB1c2goeC5qc29uKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICh4LuS4gOe6p+WumuS9jSkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHgu5LiA57qn5a6a5L2NLnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7kuIDnuqflrprkvY0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gcGRmYShodG1sLCB4LuS4gOe6p+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKHgu5aSn57G75a6a5L2NKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCB4LuWkp+exu+WumuS9jSk7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBbcGRmYShodG1sLCB4LuWkp+exu+WumuS9jSkuam9pbignXFxcXG4nKV07XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgLy8tLemineWkluWkhOeQhi0tXFxuICAgICAgICAgICAgICAgIHZhciDkuIDnuqcgPSBsaXN0Lm1hcCgocykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHNsaXN0ID0gW107XFxuICAgICAgICAgICAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBpZiAoeC7lsI/nsbsuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc2xpc3QgPSB0aGlzLmV2YWxKU1J1bGUocywgeC7lsI/nsbspO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgLy8tLemineWkluWkhOeQhi0tXFxuICAgICAgICAgICAgICAgIGlmICgoJ+WinuWKoCcgaW4geCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh4LuWinuWKoC5jb25zdHJ1Y3RvciA9PSBTdHJpbmcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB4LuWinuWKoCA9IGV2YWwoeC7lop7liqApO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgc2xpc3QgPSB4LuWinuWKoC5jb25jYXQoc2xpc3QpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmICgoJ+ihpeWFhScgaW4geCkpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh4LuihpeWFhS5jb25zdHJ1Y3RvciA9PSBTdHJpbmcpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB4LuihpeWFhSA9IGV2YWwoeC7ooaXlhYUpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgc2xpc3QgPSBzbGlzdC5jb25jYXQoeC7ooaXlhYUpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIOWumuS9jSA9IHNsaXN0Lm1hcCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgeC7moIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhciB1cmwgPSB0aGlzLmdldFVybChpdGVtLCB4KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgb2JqID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkob2JqKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIC8vbG9nKOS4gOe6pylcXG4gICAgICAgICAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgICAgICAgICAgaWYgKOS4gOe6py5sZW5ndGggPT0gMSkge1xcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3JpZXMpXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgaWYgKOaKmOWPoOeKtuaAgSkge1xcbiAgICAgICAgICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBpdGVtcy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRpdGxlLCBmb2xkLCB1LCBhbGwsIGV4cHMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBmb2xkID0gZ2V0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgW+WxleW8gCwg5oqY5Y+gXSA9IGV4cHM7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZm9sZCA9PSAxKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGN4ID0gZmluZEl0ZW1zQnlDbHModGl0bGUgKyAnY2F0ZV9idXR0b24nKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjeCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKHRpdGxlICsgJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBjeCA9IHN0b3JhZ2UwLmdldE15VmFyKCdjYXRlX2J1dHRvbicsIFtdKS5tYXAoeCA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhbJ2NvbF90eXBlJ10gPSB4Wydjb2xfdHlwZSddID8geFsnY29sX3R5cGUnXSA6IHhbJ3R5cGUnXTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUFmdGVyKHRpdGxlICsgJ2NhdGVfbGluZScsIGN4KVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0odGl0bGUgKyAnY2F0ZV9leHAnLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGZvbGQgPT0gMSA/IOWxleW8gCA6IOaKmOWPoCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLmdyb3VwLCBmb2xkID09PSBcXFwiMVxcXCIgPyBcXFwiMFxcXCIgOiBcXFwiMVxcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9yZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9SVUxFLnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIOWFqOa4hSwgW+WxleW8gCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIOaKmOWPoFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICksXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJzY3JvbGxfYnV0dG9uXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogTVlfUlVMRS50aXRsZSArICdjYXRlX2V4cCcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmdDbGljazogdGhpcy5hY3Rpb24oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGU6IOeKtuaAgSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbDog5YWo5riFLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2w6IOa4hemZpCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICAgICAgY2F0ZWdvcmllcy5mb3JFYWNoKChjYXRlZ29yeSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN1Yl9jYXRlZ29yaWVzID0gW107XFxuICAgICAgICAgICAgICAgICAgICAvKmlmICjlsI/nsbvlrprkvY0uaW5jbHVkZXMoXFxcIjtcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHBkZmEoY2F0ZWdvcnksIOWwj+exu+WumuS9jS5zcGxpdChcXFwiO1xcXCIpWzBdKTtcXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKHN1Yl9jYXRlZ29yaWVzLmxlbmd0aCA9PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0uc3BsaXQoXFxcIjtcXFwiKVsxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ki9cXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKGluZGV4KVxcbiAgICAgICAgICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMgPSBKU09OLnBhcnNlKGBbJHtjYXRlZ29yeX1dYCk7XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhzdWJfY2F0ZWdvcmllcylcXG4gICAgICAgICAgICAgICAgICAgIC8vIHN1Yl9jYXRlZ29yaWVzID0gcGRmYShjYXRlZ29yeSwg5bCP57G75a6a5L2NKTtcXG4gICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgLy/lpKfnsbtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIF/lpKfnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBpdGVtLnRpdGxlO1xcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGpzb24gPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9sZXQgdXJsID0gcGQoaXRlbSwgX+Wkp+exu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAo5aSn57G75aSE55CGKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsID0g5LiA57qn5YiG57G75aSE55CGKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2xvZyh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1zLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcihpdGVtKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ2NhdGVfYnV0dG9uJyk7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiZHRfXFxcIiArIHBhcmFtcy5qc29uLnR5cGUsIHBhcmFtcy5qc29uLnZhbHVlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5zdGF0ZSwgcGFyYW1zLmpzb24pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaXRlbXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUudGl0bGUgKyAnY2F0ZV9saW5lJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAvL+Wwj+exu1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgZXh0cmFwb3MgPSBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAoaXRlbS5pbmNsdWRlcygndHlwZT1cXFwiQGV4dHJhXFxcIicpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFwb3MgPSB0cnVlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vbG9nKCfpmYTliqDlrprkvY0nKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGV4dHJhcG9zKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIFxcXCJhJiZUZXh0XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwgXFxcImEmJnN0YXRlXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwgXFxcImEmJnZhbHVlXFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy92YXIgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgdGl0bGUgPSBpdGVtLnRpdGxlO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiDmjpLpmaQgIT0gXFxcInVuZGVmaW5lZFxcXCIgJiYg5o6S6ZmkICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNvbiA9IFxcXCJcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLypzd2l0Y2ggKHRydWUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAQFxcXCIpOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBAXFxcIilbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSDliIbnsbvpk77mjqUuaW5jbHVkZXMoXFxcIkBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU6IOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVswXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwZGZoKGl0ZW0sIOWIhuexu+mTvuaOpS5zcGxpdChcXFwiQEBcXFwiKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc29uID0gaXRlbS51cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8ganNvbiA9IHBkKGl0ZW0sIOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ki9cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qdmFyIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQEAnKT97XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzBdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOnBkZmgoaXRlbSzliIbnsbvpk77mjqUuc3BsaXQoJ0BAQCcpWzFdKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTpwZChpdGVtLOWIhuexu+mTvuaOpSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcmFtcyA9IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZXMucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGhpcy5zZXRUaXRsZShrZXkudG9TdHJpbmcoKSwgY2F0ZV90ZW1wW2luZGV4XSwgdGl0bGUpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXCJoaWtlcjovL2VtcHR5XFxcIiArIFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmFsbGNsZWFycy5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignY2F0ZV9idXR0b24nKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiaGVhZC5jYXRlXFxcIiwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFyYW1zLmpzb24uY29uc3RydWN0b3IgPT09IE9iamVjdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMuc3RhdGUsIHBhcmFtcy5qc29uKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfUlVMRS50aXRsZSArICdjYXRlX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsczogTVlfUlVMRS50aXRsZSArICdjYXRlX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChmb2xkID09PSBcXFwiMVxcXCIgfHwg5oqY5Y+g54q25oCBID09IGZhbHNlKSB7XFxuICAgICAgICAgICAgICAgIGl0ZW1zID0gaXRlbXMuY29uY2F0KGNhdGVzKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKGZvbGQgPT09IFxcXCIwXFxcIikge1xcbiAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcignY2F0ZV9idXR0b24nLCBjYXRlcylcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiBzZXRQcmVSZXN1bHQgIT0gJ3VuZGVmaW5lZCcpIHtcXG4gICAgICAgICAgICAgICAgaXRlbXMgPSBkLmNvbmNhdChpdGVtcyk7XFxuICAgICAgICAgICAgICAgIC8v5riF56m657un5om/5pWw57uEXFxuICAgICAgICAgICAgICAgIGQubGVuZ3RoID0gMDtcXG4gICAgICAgICAgICAgICAgc2V0UHJlUmVzdWx0KGl0ZW1zKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpdGVtcy5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0sXFxuICAgIH07XFxuICAgIG9iai7pooTorr4ob3B0aW9ucyk7XFxuICAgIHJldHVybiBvYmo7XFxufVxcblxcbnZhciDnirbmgIEgPVxcbiAgICB0eXBlb2Yg54q25oCB5qCH6K6wICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOeKtuaAgeagh+iusCAhPSBcXFwiXFxcIiA/IOeKtuaAgeagh+iusCA6IE1ZX1JVTEUudXJsO1xcblxcbmxldCBkdF9kZWJ1ZyA9IGZhbHNlO1xcblxcbmFkZExpc3RlbmVyKFxcbiAgICBcXFwib25DbG9zZVxcXCIsXFxuICAgICQudG9TdHJpbmcoKCkgPT4ge30pXFxuKTtcXG5cXG52YXIgQ3JlYXRlID0ge1xcbiAgICBuZXh0UGFnZTogZnVuY3Rpb24oKSB7XFxuICAgICAgICB2YXIgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIHZhciBuZXh0ID0gZXZhbCjkuIvkuIDpobUpO1xcbiAgICAgICAgICAgIC8vbG9nKCduOicrbmV4dClcXG4gICAgICAgICAgICBpZiAobmV4dCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ+S4i+S4gOmhtemTvuaOpeS4uuepuicpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlc3VsdCA9IHRydWU7XFxuICAgICAgICAgICAgaWYgKHRydWVfdXJsID09IG5leHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgIC8vbG9nKFxcXCLlj6/og73kuI3lrZjlnKjkuIvkuIDpobXmiJbogIXkuIvkuIDpobXlrprkvY3mnInpl67pophcXFwiKTtcXG4gICAgICAgICAgICBsb2coXFxcIumUmeivr+S/oeaBrzpcXFwiICsgZS5tZXNzYWdlKTtcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICgobmV4dCA9PSBcXFwiXFxcIiB8fCBuZXh0ID09IHVuZGVmaW5lZCkgJiYgcGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgbmV4dCA9IHRydWVfdXJsO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvL3Jlc3VsdD1mYWxzZTtcXG4gICAgICAgICAgICBuZXh0ID0gZ2V0TXlWYXIo54q25oCBKTtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vbG9nKCdsJyt0cnVlX3VybClcXG4gICAgICAgIC8vbG9nKCduJytuZXh0KVxcbiAgICAgICAgaWYgKHBhZ2UgIT0gMSkge1xcbiAgICAgICAgICAgIGlmICh0cnVlX3VybCA9PSBuZXh0ICYmICFyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gZmFsc2U7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmVzdWx0ID0gdHJ1ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICAgICAgLy9wdXRNeVZhcijnirbmgIEsIG5leHQpO1xcbiAgICB9LFxcbiAgICBnZXRCYWNrSW1hZ2U6IGZ1bmN0aW9uKGltZ3VybCkge1xcbiAgICAgICAgdmFyIHJlc3VsdCA9IGltZ3VybDtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgcmVzdWx0ID0gL3VybCg/OlxcXFxzKyk/XFxcXCgoLio/KVxcXFwpL2dcXG4gICAgICAgICAgICAgICAgLmV4ZWMoaW1ndXJsKVsxXVxcbiAgICAgICAgICAgICAgICAucmVwbGFjZSgvKCd8XFxcInwmcXVvdDspL2dtLCBcXFwiXFxcIik7XFxuICAgICAgICB9IGNhdGNoIHt9XFxuICAgICAgICByZXR1cm4gcmVzdWx0O1xcbiAgICB9LFxcbiAgICBodHRwSGFuZGxlOiBmdW5jdGlvbihpbnB1dCkge1xcbiAgICAgICAgaWYgKGlucHV0LnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgIHJldHVybiBpbnB1dDtcXG4gICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwiLy9cXFwiKSkge1xcbiAgICAgICAgICAgIHJ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FxcIikpIHtcXG4gICAgICAgICAgICBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGhyZWYgPSBwZChpdGVtLCBydWxlLnVybCk7XFxuICAgICAgICB9XFxuICAgICAgICBocmVmID0gcnVsZS5pbXQgPyBocmVmICsgXFxcIiNpbW1lcnNpdmVUaGVtZSNcXFwiIDogaHJlZjtcXG4gICAgICAgIHJldHVybiBocmVmO1xcbiAgICB9LFxcbiAgICBzZXRDb250ZW50OiBmdW5jdGlvbihpdGVtLCBpbnB1dCkge1xcbiAgICAgICAgbGV0IG91dHB1dCA9IFxcXCJcXFwiO1xcbiAgICAgICAgaWYgKGlucHV0ID09IHVuZGVmaW5lZCkge1xcbiAgICAgICAgICAgIHJldHVybiBvdXRwdXQ7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaW5wdXQuc3RhcnRzV2l0aChcXFwicGRcXFwiKSkge1xcbiAgICAgICAgICAgIG91dHB1dCA9IGV2YWwoaW5wdXQpO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBvdXRwdXQgPSBwZGZoKGl0ZW0sIGlucHV0KTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBvdXRwdXQ7XFxuICAgIH0sXFxuICAgIHJlZnJlc2g6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgYWRkTGlzdGVuZXIoXFxuICAgICAgICAgICAgXFxcIm9uUmVmcmVzaFxcXCIsXFxuICAgICAgICAgICAgJC50b1N0cmluZygodSkgPT4ge1xcbiAgICAgICAgICAgICAgICBjbGVhck15VmFyKFxcXCJ5aWxpc3RcXFwiKTtcXG4gICAgICAgICAgICAgICAgLy92YXIgcCA9IHN0b3JhZ2UwLmdldE15VmFyKCdzcGFnZScsICcnKTtcXG4gICAgICAgICAgICAgICAgLy9wdXRNeVZhcih1LCBwKTtcXG4gICAgICAgICAgICB9LCDnirbmgIEpXFxuICAgICAgICApO1xcbiAg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AgICAgYFxcXFxuXFxcXHR1cmzlrprkvY06ICAke3J1bGUudXJsfSAgLS0tPiDnu5Pmnpw6ICAke29iai51cmx9YFxcbiAgICAgICAgKTtcXG4gICAgICAgIGxvZygnLS0tLS0tLS0tLScgKyAoaSArIDEpICsgJzrosIPor5Xnu5PmnZ8tLS0tLS0tLS0tJyk7XFxuICAgIH0sXFxuICAgIGpzb25MaXN0OiBmdW5jdGlvbihhcnIsIGpzb24sIHJ1bGUpIHtcXG4gICAgICAgIGlmIChqc29uLmNvbnN0cnVjdG9yICE9IE9iamVjdCkge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGpzb24gPSBKU09OLnBhcnNlKGpzb24pO1xcbiAgICAgICAgICAgIH0gY2F0Y2gge31cXG4gICAgICAgIH1cXG4gICAgICAgIGlmIChqc29uW3J1bGUubGlzdF0gPT0gdW5kZWZpbmVkKSB7XFxuICAgICAgICAgICAgYXJyLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPVxcXCJncmV5XFxcIj48c21hbGw+5peg5YaF5a65PC9zbWFsbD48L2ZvbnQ+JyxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCIsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7fSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm47XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgZGVidWcgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmRlYnVnLCBmYWxzZSk7XFxuICAgICAgICB2YXIgZW1wdHkgPSB0aGlzLmdldEJvb2xlYW5WYWx1ZShydWxlLmVtcHR5KTtcXG4gICAgICAgIGlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgIGxvZygn5a6a5L2N5YiX6KGoOicgKyBydWxlLmxpc3QpO1xcbiAgICAgICAgfVxcbiAgICAgICAganNvbltydWxlLmxpc3RdLmZvckVhY2goKGl0ZW0sIGkpID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSBldmFsKHJ1bGUudGl0bGUpO1xcbiAgICAgICAgICAgIHZhciBkZXNjID0gZXZhbChydWxlLmRlc2MpO1xcbiAgICAgICAgICAgIHZhciBjb250ZW50ID0gZXZhbChydWxlLmNvbnRlbnQpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSBldmFsKHJ1bGUuaW1nKSArIHJ1bGUucmVmO1xcbiAgICAgICAgICAgIHZhciBocmVmID0gZXZhbChydWxlLnVybCk7XFxuICAgICAgICAgICAgdmFyIHVybCA9IHJ1bGUuaW10ID8gaHJlZiArIFxcXCIjaW1tZXJzaXZlVGhlbWUjXFxcIiA6IGhyZWY7XFxuICAgICAgICAgICAgdmFyIGxhenkgPSBydWxlLmxhenkgPyBydWxlLmxhenkgOiBcXFwiXFxcIjtcXG5cXG4gICAgICAgICAgICB2YXIgZGQgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzYyxcXG4gICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogcnVsZS5jb2xfdHlwZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGltZzogaW1nLFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIH07XFxuXFxuICAgICAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgICAgIHZhciByeCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgIGltZyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICAgICAgdGhpcy5kZWJ1Z2xvZyhpLCBpdGVtLCBydWxlLCByeCk7XFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGlmIChsYXp5ICE9IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgIGRkW1xcXCJ1cmxcXFwiXSA9IGhyZWYgKyBsYXp5O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnIucHVzaChkZCk7XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgcnVsZUxpc3Q6IGZ1bmN0aW9uKGFyciwgaHRtbCwgcnVsZSkge1xcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsXFxuICAgICAgICAgICAgcnVsZS5saXN0KTtcXG4gICAgICAgIHZhciBkZWJ1ZyA9IHRoaXMuZ2V0Qm9vbGVhblZhbHVlKHJ1bGUuZGVidWcsXFxuICAgICAgICAgICAgZmFsc2UpO1xcbiAgICAgICAgdmFyIGVtcHR5ID0gdGhpcy5nZXRCb29sZWFuVmFsdWUocnVsZS5lbXB0eSk7XFxuICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICBsb2coJ+WumuS9jeWIl+ihqDonICsgcnVsZS5saXN0KTtcXG4gICAgICAgIH1cXG4gICAgICAgIGxpc3QuZm9yRWFjaCgoaXRlbSwgaSkgPT4ge1xcbiAgICAgICAgICAgIHZhciB0aXRsZSA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLnRpdGxlKTtcXG4gICAgICAgICAgICB2YXIgZGVzYyA9IHRoaXMuc2V0Q29udGVudChpdGVtLCBydWxlLmRlc2MpO1xcbiAgICAgICAgdmFyIGRlc2MwID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYzApO1xcbiAgICAgICAgdmFyIGRlc2MxID0gdGhpcy5zZXRDb250ZW50KGl0ZW0sIHJ1bGUuZGVzYzEpO1xcbiAgICAgICAgICAgIHZhciBpbWcgPSB0aGlzLmltZ0hhbmRsZShpdGVtLCBydWxlKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy51cmxIYW5kbGUoaXRlbSwgcnVsZSk7XFxuICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5jb250ZW50KTtcXG5cXG4gICAgICAgICAgICBpZiAoZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHJ4ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgaW1nLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIHVybFxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICB9XFxuICAgIC8vZGVzYzAgKyAnXFxcXHRcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXFx0XFxcXHQnICsgZGVzYzEgKyAnXFxcXHRcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXFx0XFxcXHQnICsgXFxuICAgICAgICAgICAgLy92YXIgbGF6eSA9IHJ1bGUubGF6eSA/IHJ1bGUubGF6eSA6IFxcXCJcXFwiO1xcbiAgICAgICAgICAgIHZhciBkZCA9IHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjMCArICdcXFxcdFxcXFx0XFxcXHRcXFxcdFxcXFx0XFxcXHQnICsgZGVzYyxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogaW1nLFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCArIGxhenksXFxuICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaW1nOiBpbWcsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBpZiAobGF6eSAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICBkZFtcXFwidXJsXFxcIl0gPSB1cmwgKyBsYXp5O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBhcnIucHVzaChkZCk7XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgTGlzdDogZnVuY3Rpb24oYXJyLCBodG1sLCBydWxlLCBwYXJhbSkge1xcbiAgICAgICAgcGFyYW0gPSBwYXJhbSA/IHBhcmFtIDoge307XFxuICAgICAgICB2YXIgYXV0byA9IHBhcmFtLmF1dG8gPyBwYXJhbS5hdXRvIDogZmFsc2U7XFxuICAgICAgICB2YXIgc2hvdyA9IHBhcmFtLnNob3cgPyBwYXJhbS5zaG93IDogZmFsc2U7XFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgLy90aGlzLnNwYWdlLnNldCh0cnVlX3VybCk7XFxuICAgICAgICB9XFxuICAgICAgICB0aGlzLnJlZnJlc2goKTtcXG4gICAgICAgIHZhciBkZWJ1ZyA9IHRoaXMuZ2V0Qm9vbGVhblZhbHVlKHJ1bGUuZGVidWcsIGZhbHNlKTtcXG4gICAgICAgIHZhciBlbXB0eSA9IHRoaXMuZ2V0Qm9vbGVhblZhbHVlKHJ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4gICAgICAgICAgICAgICAgdmFyIGNvbnRlbnQgPSB0aGlzLnNldENvbnRlbnQoaXRlbSwgcnVsZS5jb250ZW50KTtcXG5cXG4gICAgICAgICAgICAgICAgaWYgKGRlYnVnKSB7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcnggPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmxcXG4gICAgICAgICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRlYnVnbG9nKGksIGl0ZW0sIHJ1bGUsIHJ4KTtcXG4gICAgICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgICAgICBpZiAoaSA9PSBsaXN0Lmxlbmd0aCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGlkID0gXFxcImxhc3RpZF9cXFwiICsgcGFnZTtcXG4gICAgICAgICAgICAgICAgICAgIGNscyA9IFxcXCJsYXN0bWFya1xcXCI7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsXFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWcsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IChlbXB0eSA/IFxcXCJoaWtlcjovL2VtcHR5IyNcXFwiIDogJycpICsgdXJsICsgJyMjZnlwYWdlQHJ1bGU9anM6JC5yZXF1aXJlKFxcXCJ5aWppXFxcIiknLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogY29udGVudCxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgaWYgKGkgPT0gbGlzdC5sZW5ndGggLSAxICYmIHNob3cpIHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcInBhZ2VsaW5lXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi4oCc4oCc4oCd4oCdPHNtYWxsPuWKoOi9veS4rS4uLjwvc21hbGw+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBcXFwicGFnZW51bVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oXFxcInBhZ2VudW1cXFwiLCB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7liLDlupXkuoY8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBcXFwibGFzdFxcXCIsXFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAobGlzdC5sZW5ndGggPT0gMCAmJiBwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVcXFwiLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsbD7ml6DlhoXlrrk8L3NtYWxsPjwvZm9udD4nLFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL2VtcHR5XFxcIixcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHt9LFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHRoaXMubmV4dFBhZ2UoKSkge1xcbiAgICAgICAgICAgIC8vbG9nKCd0Jyk7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ3lpX2lzbmV4dCcsICd0Jyk7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIC8vbG9nKCdmJyk7XFxuICAgICAgICAgICAgc3RvcmFnZTAucHV0TXlWYXIoJ3lpX2lzbmV4dCcsICdmJyk7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoYXV0bykge1xcbiAgICAgICAgICAgIC8vY3JlYXRlTmV4dFBhZ2UoKTtcXG4gICAgICAgICAgICBhdXRvUGFnZSgpO1xcbiAgICAgICAgfVxcbiAgICB9LFxcbn07XFxuXFxudmFyIGV4dE1ldGhvZCA9IHtcXG4gICAgVG9QYXJhbXM6IGZ1bmN0aW9uKCkge1xcbiAgICAgICAgdmFyIGpzb24gPSBhcmd1bWVudHNbMF07XFxuICAgICAgICByZXR1cm4gT2JqZWN0LmtleXMoanNvbilcXG4gICAgICAgICAgICAubWFwKChrZXkpID0+IGtleSArIFxcXCI9XFxcIiArIGpzb25ba2V5XSlcXG4gICAgICAgICAgICAuam9pbihcXFwiJlxcXCIpO1xcbiAgICB9LFxcbiAgICB1cmxQYXJzZTogZnVuY3Rpb24odSkge1xcbiAgICAgICAgdmFyIGRpY3QgPSB7fTtcXG4gICAgICAgIGRpY3QuU291cmNlID0gdTtcXG4gICAgICAgIGxldCBwYXJhbXMgPSAodXJsKSA9PiB7XFxuICAgICAgICAgICAgbGV0IHF1ZXJ5UGFyYW1zID0ge307XFxuICAgICAgICAgICAgbGV0IHJlZyA9IC8oW14/PSZdKyk9KFtePz0mXSspL2c7XFxuICAgICAgICAgICAgdXJsLnJlcGxhY2UocmVnLCBmdW5jdGlvbigpIHtcXG4gICAgICAgICAgICAgICAgcXVlcnlQYXJhbXNbYXJndW1lbnRzWzFdXSA9IGFyZ3VtZW50c1syXTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICByZXR1cm4gcXVlcnlQYXJhbXM7XFxuICAgICAgICB9O1xcbiAgICAgICAgdmFyIGphdmFVcmwgPSBKYXZhSW1wb3J0ZXIoamF2YS5uZXQuV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ICAgICAgIGNvbnN0IGRpZmZDaGFycyA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBzdHIyLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgaWYgKHN0cjFbaV0gIT09IHN0cjJbaV0pIHtcXG4gICAgICAgICAgICAgICAgZGlmZkNoYXJzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGksXFxuICAgICAgICAgICAgICAgICAgICBzMTogc3RyMVtpXSxcXG4gICAgICAgICAgICAgICAgICAgIHMyOiBzdHIyW2ldLFxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gZGlmZkNoYXJzO1xcbiAgICB9LFxcbiAgICByZXBsYWNlQ2hhckF0OiBmdW5jdGlvbihzdHIsIGluZGV4LCByZXBsYWNlbWVudCkge1xcbiAgICAgICAgaWYgKGluZGV4IDwgMCB8fCBpbmRleCA+PSBzdHIubGVuZ3RoKSB7XFxuICAgICAgICAgICAgcmV0dXJuIHN0cjtcXG4gICAgICAgIH1cXG4gICAgICAgIC8vbG9nKGluZGV4KVxcbiAgICAgICAgY29uc3QgYXJyID0gc3RyLnNwbGl0KFxcXCJcXFwiKTtcXG4gICAgICAgIGFycltpbmRleF0gPSByZXBsYWNlbWVudDtcXG4gICAgICAgIHJldHVybiBhcnIuam9pbihcXFwiXFxcIik7XFxuICAgIH0sXFxuICAgIGdldE9iamVjdEtleXNEaWZmOiBmdW5jdGlvbihvYmoxLCBvYmoyKSB7XFxuICAgICAgICBjb25zdCBkaWZmZXJlbnRLZXlzID0gW107XFxuICAgICAgICBmb3IgKGxldCBrZXkgaW4gb2JqMSkge1xcbiAgICAgICAgICAgIGlmICghb2JqMi5oYXNPd25Qcm9wZXJ0eShrZXkpIHx8IG9iajFba2V5XSAhPT0gb2JqMltrZXldKSB7XFxuICAgICAgICAgICAgICAgIGRpZmZlcmVudEtleXMucHVz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gICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpZiAodGhpcy5pc0VxdWFsKHUxLlBhcmFtcywgdTIuUGFyYW1zKSkge1xcbiAgICAgICAgICAgICAgICBpZiAoZHRfZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1MS5QYXRoKTtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1Mi5QYXRoKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgZGYgPSB0aGlzLmZpbmREaWZmZXJlbnRJbmRleChTdHJpbmcodTEuUGF0aCksIFN0cmluZyh1Mi5QYXRoKSk7XFxuICAgICAgICAgICAgICAgIGlmIChkdF9kZWJ1Zykge1xcbiAgICAgICAgICAgICAgICAgICAgbG9nKGRmKTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAoZGYubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHZhciByZSA9IGRmWzBdLmluZGV4O1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGYgPSBkZi5maWx0ZXIoKHgpID0+IC9cXFxcZCsvLnRlc3QoeC5zMikpO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlID0gZlswXS5pbmRleDtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB2YXIgZXEgPSB0aGlzLnJlcGxhY2VDaGFyQXQoU3RyaW5nKHUyLlBhdGgpLCByZSwgXFxcImZ5cGFnZVxcXCIpO1xcbiAgICAgICAgICAgICAgICBuZXh0dXJsID0gdTIuSG9zdHMgKyBlcSArIGNhICsgdGhpcy5Ub1BhcmFtcyh1Mi5QYXJhbXMpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciBlcCA9IHRoaXMuZ2V0T2JqZWN0S2V5c0RpZmYodTEuUGFyYW1zLCB1Mi5Q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ICdoaWtlcjovL2VtcHR5JyxcXG4gICAgICAgIC8vdXJsOiBwZCh0YWJzW2ldLCdhJiZocmVmJykgKyAnIyNmeXBhZ2VAcnVsZT1qczokLnJlcXVpcmUoXFxcInN4XFxcIiknLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJhdmF0YXJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtsaW5lVmlzaWJsZTpmYWxzZX1cXG4gICAgfSk7XFxuXFxuICAgICAgICBmb3IgKHZhciBqID0gMDsgaiA8IChsaXN0Lmxlbmd0aC1saXN0Lmxlbmd0aCUyKTsgaisrKSB7ICAgICAgIFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBwZGZoKGxpc3Rbal0sICcudm9kLXR4dCYmVGV4dCcpLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBwZGZoKGxpc3Rbal0sICcudGltZSYmVGV4dCcpLFxcbiAgICAgICAgICAgICAgICBpbWc6IHBkKGxpc3Rbal0sJ2ltZ3x8YSYmc3JjJyksXFxuICAgICAgICAgICAgICAgIHVybDogcGQobGlzdFtqXSwgJ2EmJmhyZWYnKS5yZXBsYWNlKFxcXCJpbmZvXFxcIixcXFwicGxheVxcXCIpICsgbGF6eSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdtb3ZpZV8yJywgICAgICAgICAgICAgIFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9XCJ9XSIsImljb24iOiJodHRwczovL2NkbjIuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9qYXBhbi1mbGF0LTIvMzQwL2phcGFuX2lkb2xfamFwYW5lc2VfY3V0ZV9hc2lhbl9wcmV0dHlfZmVtYWxlLTEyOC5wbmciLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment