xiaomianao666

小程序:番·仓

Apr 28th, 2024
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@番·仓@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6ImpzOlxudmFyIGNocCA9IFtdO1xudHJ5IHtcbiAgICB2YXIgaHRtbCA9IGdldFJlc0NvZGUoKTtcbiAgICB2YXIgY29udHMgPSBwYXJzZURvbUZvckFycmF5KGh0bWwsICdib2R5JiYuc29ydC1pdGVtJyk7XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjb250cy5sZW5ndGg7IGkrKykge1xuICAgICAgICB2YXIgbGlzdCA9IHBkZmEoY29udHNbaV0sICdib2R5JiZhJyk7XG4gICAgICAgIGNocC5wdXNoKGxpc3QubGVuZ3RoKTtcbiAgICB9ICAgICBcbn0gY2F0Y2ggKGUpIHt9XG5zZXRSZXN1bHQoJ+abtOaWsOiHszonICsgKE1hdGgubWF4LmFwcGx5KG51bGwsIGNocCkpKTsiLCJ0aXRsZSI6IueVqsK35LuTIiwiYXV0aG9yIjoiUiIsInVybCI6Imhpa2VyOi8vZW1wdHkjIy9mb3J1bS0xLmh0bSMjZnlwYWdlIiwidmVyc2lvbiI6MjAyMzExMDgsImNvbF90eXBlIjoibW92aWVfMiIsImNsYXNzX25hbWUiOiIiLCJ0eXBlIjoidmlkZW8iLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbnZhciBkID0gW107XG5ldmFsKEpTT04ucGFyc2UocmVxdWVzdCgnaGlrZXI6Ly9wYWdlL3JlcGFpcicpKS5ydWxlKTtcbmFkZExpc3RlbmVyKFwib25DbG9zZVwiLCAkLnRvU3RyaW5nKCgpID0+IHtcbiAgICBsZXQ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MDsgaiA8IE1hdGgubWluKGFyci5sZW5ndGgsIG5hbWVzLmxlbmd0aCk7IGorKykge1xuaWYoYXJyW2pdPT0n6Lez6aG1Jyl7XG4gICAgICAgICAgICAgZC5wdXNoKHtcclxuICAgICAgICAgICAgdGl0bGU6bm93ID09bmFtZXNbal0/ICfigJzigJzigJ3igJ0nICsgbmFtZXNbal0uZm9udGNvbG9yKCdyZWQnKSA6IG5hbWVzW2pdLFxyXG4gICAgICAgICAgICBjb2xfdHlwZTogXCJzY3JvbGxfYnV0dG9uXCIsXHJcbiAgICAgICAgICAgIHVybDogJCgyMywgJ+ivt+i+k+WFpeimgei3s+i9rOWIsOeahOmhteaVsCcpLmlucHV0KCh0cnVlX3VybCxrLG5hbWVzLGopID0+IHtcclxuICAgICAgICAgICAgICAgIGlmIChpc05hTihwYXJzZUludChpbnB1dCkpKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i+k+WFpeacieivryzor7fovpPlhaXkuIDkuKoxficgKyBrICsgJ+eahOaVsOWtlydcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGxldCB0b1BhZ2UgPSBwYXJzZUludChpbnB1dCk7XHJcbiAgICAgICAgICAgICAgICBpZiAodG9QYWdlIDwgMSB8fCB0b1BhZ2UgPiBrKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i+k+WFpeacieivryzor7fovpPlhaXkuIDkuKoxficgKyBrICsgJ+eahOaVsOWtlydcclxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICBpZigvZm9ydW1cXC1cXGQrXFwtXFxkKy8udGVzdCh0cnVlX3VybCkpe1xudmFyIHVybCA9IHRydWVfdXJsLnJlcGxhY2UoL1xcZCtcXC5odG0vLCB0b1BhZ2UgKyAnLmh0bScpO1xuICAgICAgICAgICAgICB9ZWxzZXtcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXC5odG0vLCAnLScgKyB0b1BhZ2UgKyAnLmh0bScpO1xuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBzZXRJdGVtKFwibm93XCIsIG5hbWVzW2pdKTtcbiAgICAgICAgICAgICAgICBwdXRWYXIoTVlfUlVMRS51cmwsIHVybCk7XG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3lpX2ZpcnN0cGFnZScsIHVybCk7XG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6Lez6LaK5Yiw5LqG56ysJyArIHRvUGFnZSArICfpobUnXHJcbiAgICAgICAgICAgIH0sdHJ1ZV91cmwsIGssbmFtZXMsaiksXHJcbiAgICAgICAgfSk7XG5cbn1lbHNle1xuXG5pZihhcnJbal09PSfpmo/mnLonKXtcbiAgICAgICAgICAgICAgYXJyW2pdID0gTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogaykgKzEgICBcbn1lbHNlIGlmKGFycltqXT09J+WwvumhtScrayl7XG4gICAgICAgICAgICAgIGFycltqXSA9IGtcbn1lbHNlIGlmKGFycltqXT09MSl7XG4gICAgICAgICAgICAgIG5hbWVzW2pdID0gXCLpppbpobVcIlxufWVsc2UgaWYoYXJyW2pdPT0n6Lez6aG1Jyl7XG4gICAgICAgICAgICAgYXJyW2pdID0gMjIzXG59XG5cbiAgICAgICAgICBpZigvZm9ydW1cXC1cXGQrXFwtXFxkKy8udGVzdCh0cnVlX3VybCkpe1xudmFyIHVybCA9IHRydWVfdXJsLnJlcGxhY2UoL1xcZCtcXC5odG0vLCBhcnJbal0gKyAnLmh0bScpO1xuICAgICAgICAgICAgICB9ZWxzZXtcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXC5odG0vLCAnLScgKyBhcnJbal0gKyAnLmh0bScpO1xuICAgICAgICAgICAgICB9XG5cbiAgICBkLnB1c2goe1xuICAgICAgICB0aXRsZTpub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cbiAgICAgIH1cXG4gICAgICBpZiAodHlwZW9mIGNhdGVnb3J5LumTvuaOpeWkhOeQhiA9PSBcXFwiZnVuY3Rpb25cXFwiKSB7XFxuICAgICAgICB1cmwgPSBjYXRlZ29yeS7pk77mjqXlpITnkIYodXJsKTtcXG4gICAgICB9XFxuICAgICAgcmV0dXJuIHVybCB8fCBcXFwiXFxcIjtcXG4gICAgfSxcXG4gICAgaXNOdWxsKHBhcmFtKSB7XFxuICAgICAgaWYgKHBhcmFtID09IG51bGwpIHtcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICAgIH1cXG4gICAgICByZXR1cm4gZmFsc2U7XFxuICAgIH0sXFxuICAgIGlzQm9vbGVhbih2YXJpYWJsZSkge1xcbiAgICAgIGlmICh0eXBlb2YgdmFyaWFibGUgIT09IFxcXCJib29sZWFuXFxcIikge1xcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLlvIDlkK/mipjlj6Dor7fkvKDlhaXluIPlsJTlgLxcXFwiKTtcXG4gICAgICB9XFxuICAgIH0sXFxuICAgIOa4hemZpChsaXN0KSB7XFxuICAgICAgaWYgKHRoaXMuaXNOdWxsKGxpc3QpKSB7XFxuICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgICB9XFxuICAgICAgaWYgKGxpc3QuY29uc3RydWN0b3IgPT0gU3RyaW5nKSB7XFxuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIua4hemZpOaKpemUmTror7fkvKDliJfooahcXFwiKTtcXG4gICAgICB9XFxuICAgICAgdGhpcy5jbGVhcnMgPSBsaXN0O1xcbiAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICDlhajmuIUobGlzdCkge1xcbiAgICAgIGlmICh0aGlzLmlzTnVsbChsaXN0KSkge1xcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgICAgfVxcbiAgICAgIHZhciBjID0gdGhpcy5jbGVhcmFsbDtcXG4gICAgICBsaXN0ID0gYy5jb25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ogXFxcIua4hemZpOeKtuaAgVxcXCIsXFxuICAgICAgICAgIGpzOiAkLnRvU3RyaW5nKChvYmopID0+IHtcXG4gICAgICAgICAgICBsb2cob2JqKTtcXG4gICAgICAgICAgICBjbGVhck15VmFyKG9iai5zdGF0ZSk7XFxuICAgICAgICAgICAgY2xlYXJNeVZhcihcXFwiaGVhZC5jYXRlXFxcIik7XFxuICAgICAgICAgICAgb2JqLmFsbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIG9iai5jbC5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgIH0sIG9iaiksXFxuICAgICAgICB9LFxcbiAgICAgIF07XFxuICAgIH0sXFxuICAgIGNoZWNrUGFyYW0oKSB7XFxuICAgICAgdmFyIG9iaiA9IHt9O1xcbiAgICAgIGlmICh0aGlzLnBhZ2UgPT0gMCAmJiB0eXBlb2YgcGFnZSA9PSBcXFwidW5kZWZpbmVkXFxcIikge1xcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLor7fkvKDlhaXpobXnoIFcXFwiKTtcXG4gICAgICB9IGVsc2Uge1xcbiAgICAgICAgaWYgKHR5cGVvZiBwYWdlID09IFxcXCJ1bmRlZmluZWRcXFwiKSB7XFxuICAgICAgICAgIG9ialtcXFwi6aG156CBXFxcIl0gPSB0aGlzLnBhZ2U7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICBvYmpbXFxcIumhteeggVxcXCJdID0gcGFnZTtcXG4gICAgICAgIH1cXG4gICAgICB9XFxuICAgICAgaWYgKHRoaXMuaHRtbCA9PSBcXFwiZW1wdHlcXFwiICYmIHR5cGVvZiBodG1sID09IFxc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+NXFxcIixcXG4gICAgICAgICAgY29sX3R5cGU6IFxcXCJpbnB1dFxcXCIsXFxuICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcihcXFwia2V5d29yZFxcXCIsIFxcXCJcXFwiKSxcXG4gICAgICAgICAgICBvbkNoYW5nZTogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICBwdXRNeVZhcihcXFwia2V5d29yZFxcXCIsIGlucHV0KTtcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgfSxcXG4gICAgICAgIH0pO1xcbiAgICAgIH1cXG4gICAgICBjb25zdCBjYXRlZ29yaWVzID0gW107XFxuICAgICAgcnVsZU9iai5mb3JFYWNoKCh4KSA9PiB7XFxuICAgICAgICB2YXIgbGlzdCA9IFtdO1xcbiAgICAgICAgaWYoeC7kuIDnuqflrprkvY0pe1xcbiAgICAgICAgICBpZiAoeC7kuIDnuqflrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7kuIDnuqflrprkvY0pO1xcbiAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIGxpc3QgPSBwZGZhKGh0bWwsIHgu5LiA57qn5a6a5L2NKTtcXG4gICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYoeC7lpKfnsbvlrprkvY0pe1xcbiAgICAgICAgICBpZiAoeC7lpKfnsbvlrprkvY0uc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgIGxpc3QgPSB0aGlzLmV2YWxKU1J1bGUoaHRtbCwgeC7lpKfnsbvlrprkvY0pO1xcbiAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIGxpc3QgPSBbcGRmYShodG1sLCB4LuWkp+exu+WumuS9jSkuam9pbignXFxcXG4nKV07XFxuICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgdmFyIOS4gOe6pyA9IGxpc3QubWFwKChzKSA9PiB7XFxuICAgICAgICAgIHZhciBzbGlzdCA9IFtdO1xcbiAgICAgICAgICBpZiAoIShcXFwi5bCP57G7XFxcIiBpbiB4KSkge1xcbiAgICAgICAgICAgIHgu5bCP57G7ID0gXFxcImJvZHkmJmE6bm90KDptYXRjaGVzKOmmlumhtSkpOm5vdChhOm5vdChbaHJlZl0pKVxcXCI7XFxuICAgICAgICAgIH1cXG4gICAgICAgICAgaWYgKHgu5bCP57G7LnN0YXJ0c1dpdGgoXFxcIkBqczpcXFwiKSkge1xcbiAgICAgICAgICAgIHNsaXN0ID0gdGhpcy5ldmFsSlNSdWxlKHMsIHgu5bCP57G7KTtcXG4gICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBzbGlzdCA9IHBkZmEocywgeC7lsI/nsbspO1xcbiAgICAgICAgICB9XFxuICAgICAgICAgIHZhciDlrprkvY0gPSBzbGlzdC5tYXAoKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICB2YXIgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIHgu5qCH6aKYKTtcXG4gICAgICAgICAgICB2YXIgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgeCk7XFxuICAgICAgICAgICAgdmFyIG9iaiA9IHsgdGl0bGU6IHRpdGxlLCB1cmw6IHVybCB9O1xcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShvYmopO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgcmV0dXJuIOWumuS9jTtcXG4gICAgICAgIH0pO1xcbiAgICAgICAgLy9sb2co5LiA57qnKVxcbiAgICAgICAgLy9sb2co5LiA57qnLmxlbmd0aClcXG4gICAgICAgIGlmICjkuIDnuqcubGVuZ3RoID09IDEpIHtcXG4gICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKOS4gOe6py5qb2luKFxcXCJcXFxcblxcXCIpKTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgIOS4gOe6py5mb3JFYWNoKChpdGVtKSA9PiB7XFxuICAgICAgICAgICAgY2F0ZWdvcmllcy5wdXNoKGl0ZW0uam9pbihcXFwiLFxcXCIpKTtcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICAvL2xvZyhjYXRlZ29yaWVzKVxcbiAgICAgIH0pO1xcbiAgICAgIGlmICjmipjlj6DnirbmgIEpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZm9sZCA9PT0gXFxcIjFcXFwiID8g5oqY5Y+gIDog5bGV5byALFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZShcXG4gICAgICAgICAgICAgIChmb2xkLCB1LCBhbGwpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS5ncm91cCwgZm9sZCA9PT0gXFxcIjFcXFwiID8gXFxcIjBcXFwiIDogXFxcIjFcXFwiKTtcXG4gICAgICAgICAgICAgICAgLyphbGwuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pOyovXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICBmb2xkLFxcbiAgICAgICAgICAgICAg54q25oCBLFxcbiAgICAgICAgICAgICAg5YWo5riFXFxuICAgICAgICAgICAgKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuIC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0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG5cXG4gICAgICAgICAgICAvL2xldCB0aXRsZSA9IHBkZmgoaXRlbSwgX+Wkp+exu+agh+mimCk7XFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICBpZiAodHlwZW9mIOaOkumZpCAhPSBcXFwidW5kZWZpbmVkXFxcIiAmJiDmjpLpmaQgIT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXdSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBqc29uPScnXFxuICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgIFxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGNsZWFyczog5riF6ZmkLFxcbiAgICAgICAgICAgICAganNvbjoganNvbixcXG4gICAgICAgICAgICAgIHN0YXRlOiDnirbmgIEsXFxuICAgICAgICAgICAgICBhbGxjbGVhcnM6IOWFqOa4hSxcXG4gICAgICAgICAgICB9O1xcblxcbiAgICAgICAgICAgIC8vbGV0IHVybCA9IHBkKGl0ZW0sIF/lpKfnsbvpk77mjqUpO1xcbiAgICAgICAgICAgIGxldCB1cmwgPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAvKmlmICjlpKfnsbvlpITnkIYpIHtcXG4gICAgICAgICAgICAgIHVybCA9IOS4gOe6p+WIhuexu+WkhOeQhih1cmwpO1xcbiAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgIC8vbG9nKHVybClcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgICB1cmw6ICQoXFxcImhpa2VyOi8vZW1wdHkjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW107XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5jbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuYWxsY2xlYXJzLmZvckVhY2goKGl0ZW0pID0+IHtcXG4gICAgICAgICAgICAgICAgICBjbGVhck15VmFyKGl0ZW0pO1xcbiAgICAgICAgICAgICAgICB9KTtcXG5cXG4gICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFwiMFxcXCIpO1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImhlYWQuY2F0ZVxcXCIsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCI7XFxuICAgICAgICAgICAgICB9LCBwYXJhbXMpLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09IFxcXCIxXFxcIiB8fCDmipjlj6DnirbmgIEgPT0gZmFsc2UpIHtcXG4gICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgdmFyIGV4dHJhcG9zID0gZmFsc2U7XFxuICAgICAgICAgICAgLyppZiAoaXRlbS5pbmNsdWRlcygndHlwZT1cXFwiQGV4dHJhXFxcIicpKSB7XFxuICAgICAgICAgICAgICBleHRyYXBvcyA9IHRydWU7XFxuICAgICAgICAgICAgICAvL2xvZygn6ZmE5Yqg5a6a5L2NJylcXG4gICAgICAgICAgICB9Ki9cXG5cXG4gICAgICAgICAgICBpZiAoZXh0cmFwb3MpIHtcXG4gICAgICAgICAgICAgIHZhciB0aXRsZSA9IHBkZmgoaXRlbSwgXFxcImEmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgIHZhciBqc29uID0ge1xcbiAgICAgICAgICAgICAgICB0eXBlOiBwZGZoKGl0ZW0sIFxcXCJhJiZzdGF0ZVxcXCIpLFxcbiAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCBcXFwiYSYmdmFsdWVcXFwiKSxcXG4gICAgICAgICAgICAgIH07XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgIC8vdmFyIHRpdGxlID0gcGRmaChpdGVtLCDliIbnsbvmoIfpopgpO1xcbiAgICAgICAgICAgICAgdmFyIHRpdGxlID0gaXRlbS50aXRsZTtcXG4gICAgICAgICAgICAgIGlmICh0eXBlb2Yg5o6S6ZmkICE9IFxcXCJ1bmRlZmluZWRcXFwiICYmIOaOkumZpCAhPSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgIH1cXG5cXG4gICAgICAgICAgICAgIHZhciBqc29uID0gXFxcIlxcXCI7XFxuICAgICAgICAgICAgICAvKnN3aXRjaCAodHJ1ZSkge1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBAXFxcIik6XFxuICAgICAgICAgICAgICAgICAganNvbiA9IHtcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQEBcXFwiKVswXSksXFxuICAgICAgICAgICAgICAgICAgICB2YWx1ZTogcGRmaChpdGVtLCDliIbnsbvpk77mjqUuc3BsaXQoXFxcIkBAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlIOWIhuexu+mTvuaOpS5pbmNsdWRlcyhcXFwiQEBcXFwiKTpcXG4gICAgICAgICAgICAgICAgICBqc29uID0ge1xcbiAgICAgICAgICAgICAgICAgICAgdHlwZTog5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6IHBkZmgoaXRlbSwg5YiG57G76ZO+5o6lLnNwbGl0KFxcXCJAQFxcXCIpWzFdKSxcXG4gICAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgIGpzb24gPSBpdGVtLnVybDtcXG4gICAgICAgICAgICAgICAgICAvLyBqc29uID0gcGQoaXRlbSwg5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgIH0qL1xcbiAgICAgICAgICAgICAganNvbiA9IGl0ZW0udXJsO1xcbiAgICAgICAgICAgICAgLyp2YXIganNvbj3liIbnsbvpk77mjqUuaW5jbHVkZXMoJ0BAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMF0pLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEBAJylbMV0pLFxcbiAgICAgICAgICAgICAgICB9OnBkKGl0ZW0s5YiG57G76ZO+5o6lKTtcXG4gICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgIGpzb2495YiG57G76ZO+5o6lLmluY2x1ZGVzKCdAQCcpP3tcXG4gICAgICAgICAgICAgICAgICAgIHR5cGU65YiG57G76ZO+5o6lLnNwbGl0KCdAQCcpWzBdLFxcbiAgICAgICAgICAgICAgICAgICAgdmFsdWU6cGRmaChpdGVtLOWIhuexu+mTvuaOpS5zcGxpdCgnQEAnKVsxXSksXFxuICAgICAgICAgICAgICAgIH06cGQoaXRlbSzliIbnsbvpk77mjqUpOyovXFxuICAgICAgICAgICAgfVxcblxcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB7XFxuICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgIGpzb246IGpzb24sXFxuICAgICAgICAgICAgICBzdGF0ZTog54q25oCBLFxcbiAgICAgICAgICAgICAgYWxsY2xlYXJzOiDlhajmuIUsXFxuICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgdGl0bGU6IHRoaXMuc2V0VGl0bGUoa2V5LnRvU3RyaW5nKCksIGNhdGVfdGVtcFtpbmRleF0sIHRpdGxlKSxcXG4gICAgICAgICAgICAgIHVybDogJChcXFwiaGlrZXI6Ly9lbXB0eVxcXCIgKyBcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgIHBhcmFtcy5hbGxjbGVhcnMuZm9yRWFjaCgoaXRlbSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoaXRlbSk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKCk7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJoZWFkLmNhdGVcXFwiLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSk7XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbXMuanNvbi5jb25zdHJ1Y3RvciA9PT0gT2JqZWN0KSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImR0X1xcXCIgKyBwYXJhbXMuanNvbi50eXBlLCBwYXJhbXMuanNvbi52YWx1ZSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnN0YXRlLCBwYXJhbXMuanNvbik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgIH0sIHBhcmFtcyksXFxuICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICB9KTtcXG4gICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIixcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgfSk7XFxuICAgIH1cXG4gICAgfSxcXG4gIH07XFxuICBvYmou6aKE6K6+KG9wdGlvbnMpO1xcbiAgcmV0dXJuIG9iajtcXG59XFxuXFxuICAvLy7nirbmgIEoXFxcInVybFxcXCIpXFxuICAvLy7nlYzpnaIoZClcXG4gIC8vLua6kOeggSh4aHRtbClcXG4gIC8vLuWFqOa4hShbXFxcIjFcXFwiLCBcXFwiMlxcXCJdKVxcbiAgLy8u5riF6ZmkKClcXG4gIC8vLuW8gOWQr+aKmOWPoCgpXFxuICAvLy7pobXnoIEocGFnZSlcXG4gIC8vLuWIm+W7uuWKqOaAgeWIhuexuyjlrprkvY3liJfooagpO1xcblxcbmZ1bmN0aW9uIGdldE9iamZ1YyhvYm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FxcXCJoaWtlcjovL3BhZ2UvZXI/dXJsPVxcXCIgKyB1cmwsXFxuICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXFxuICAgICAgICAgIGNvbF90eXBlOiBydWxlLmNvbF90eXBlLFxcbiAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICBpZDogaWQsXFxuICAgICAgICAgICAgY2xzOiBjbHMsXFxuICAgICAgICAgIH0sXFxuICAgICAgICB9KTtcXG4gICAgICAgIGlmIChpID09IGxpc3QubGVuZ3RoIC0gMSAmJiBzaG93KSB7XFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgaWQ6IFxcXCJwYWdlbGluZVxcXCIsXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuXFxuICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ08c21hbGw+5Yqg6L295LitLi4uPC9zbWFsbD5cXFwiLFxcbiAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vZW1wdHlcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgIGlkOiBcXFwicGFnZW51bVxcXCIsXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgfSk7XFxuICAgIH0gZWxzZSB7XFxuICAgICAgdXBkYXRlSXRlbShcXFwicGFnZW51bVxcXCIsIHtcXG4gICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9XFxcImdyZXlcXFwiPjxzbWFsb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HtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL3RoaXNhdi5jb20vY24vXFxcIiArIOeVquWPtzsgXFxuLy9sb2coYXYpXFxuICAgICAgICAgICAgICB0cnl7XFxuICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGF2LCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgJ1VzZXItQWdlbnQnOiAnTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMCknXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgfSx0aW1lb3V0OjUwMDBcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgIGV2YWwoaHRtbC5tYXRjaCgvZXZhbC4qP1xcXFxuLylbMF0pXFxuICAgICAgICAgICAgICAgICB2YXIgc291cmNlMTkyMCA9IHNvdXJjZTEyODAucmVwbGFjZShcXFwiMTI4MHg3MjBcXFwiLFxcXCIxOTIweDEwODBcXFwiKVxcbiAgICAgICAgICAgICAgICAgdmFyIGNvZGUgPSBKU09OLnBhcnNlKGZldGNoKHNvdXJjZTE5MjAse29ubHlIZWFkZXJzOnRydWUsdGltZW91dDozMDAwfSkpLnN0YXR1c0NvZGU7XFxuICAgICAgICAgICAgICAgICBpZihjb2RlICE9PSAyMDApe1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIHNvdXJjZTEyODAgXFxuLy8rICc7e1JlZmVyZXJAaHR0cHM6Ly90aGlzYXYuY29tfSdcXG59ZWxzZXtcXG4gICAgICAgICAgICAgICAgIHJldHVybiBzb3VyY2UxOTIwIFxcbi8vKyAnO3tSZWZlcmVyQGh0dHBzOi8vdGhpc2F2LmNvbX0nXFxuICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgIH1jYXRjaHtyZXR1cm4gXFxcInRvYXN0Oi8v5oyC5qKv5oiW5rKh5pyJ5q2k5b2x54mHXFx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iAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB2YXIgcGxheXMgPSBiZih1cmxzKS5tYXAoaD0+aC5tYXRjaCgvc3JjPVxcXCIoLio/KVxcXCIvKVsxXS5zcGxpdChcXFwiJlxcXCIpWzBdLnJlcGxhY2UoXFxcIj9pZD1cXFwiLFxcXCJobHMvXFxcIikgKyBcXFwiLm0zdThcXFwiKSAgIFxcbiAgICAgICAgICAgICByZXR1cm4ge3VybHM6cGxheXN9XFxuICAgICAgIH1jYXRjaHtcXG4gICAgICAgICB0cnl7XFxuICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL21pc3Nhdi50by9zZWFyY2gvbW92aWUvXFxcIiArIOeVquWPty5yZXBsYWNlKC9cXFxcLXxcXFxcXy8sXFxcIiUyMFxcXCIpOyAgXFxuICAgICAgICAgICAgIHZhciB1cmxzID0gW107ICAgIFxcbiAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoZmV0Y2goYXYse3RpbWVvdXQ6NTAwMH0pLFxcXCIudmlkZW9zLWxpc3QmJmFydGljbGVcXFwiKTtcXG4gICAgICAgICAgICBmb3IodmFyIGogaW4gbGlzdCl7XFxuICAgICAgICAgICAgICB1cmxzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBwZGZoKGxpc3Rbal0sXFxcImEmJmhyZWZcXFwiKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHZhciBwbGF5cyA9IGJmKHVybHMpLm1hcChoPT5oLm1hdGNoKC9zcmM9XFxcIiguKj8pXFxcIi8pWzFdLnNwbGl0KFxcXCImXFxcIilbMF0ucmVwbGFjZShcXFwiP2lkPVxcXCIsXFxcImhscy9cXFwiKSArIFxcXCIubTN1OFxcXCIpICAgXFxuICAgICAgICAgICAgIHJldHVybiB7dXJsczpwbGF5c31cXG4gICAgICAgICAgfWNhdGNoe3JldHVybiBcXFwidG9hc3Q6Ly/msqHmnInmraTlvbHniYdcXFwifVxcbiAgICAgICB9ICAgXFxuICAgICAgICAgICAgICAgICAgfSznlarlj7cpLFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxuICAgIGV4dHJhOiB7IGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjnlarlj7cpPT57IHJldHVybiBcXFwiaHR0cHM6Ly9taXNzYXYudG8vc2VhcmNoL21vdmllL1xcXCIgKyDnlarlj7d9LOeVquWPtyl9XSB9XFxufSk7XFxuXFxuLy9uamF2XFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjMUU5MEZGXFxcIj4gbkphdi50djwvZm9udD48L21pZGRsZT4nLFxcbiAgICBwaWNfdXJsOiAnaHR0cHM6Ly9jZG4yLmljb25maW5kZXIuY29tL2RhdGEvaWNvbnMvc29jaWFsLWljb25zLTMzLzEyOC9GYWNlYm9va19NZXNzZW5nZXItMTI4LnBuZycsXFxuICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOeVquWPtykgPT4ge1xcbiAgICAgICAgICAgICAgICAgdmFyIGF2ID0gXFxcImh0dHBzOi8vbmphdi50di96aC92L1xcXCIgKyDnlarlj7c7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXG4gICAgICAgICAgICAgICAgIGlmKCFodG1sIHx8IGh0bWwuaW5jbHVkZXMoXFxcIuivt+ajgOafpeWcsOWdgOagj+S4reeahOe9keWdgFxcXCIpKXsgICAgICAgICBcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwiXFxuICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBhdjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICB9LOeVquWPtyksXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnKi5kb3BwaW9jZG4uKiddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJ2RtbS5jby5qcCddLFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sXFxuICAgICAgICAgICAgICAgIGNhY2hlTTN1ODogdHJ1ZSxcXG4gICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7dGl0bGU6ICfmn6XnnIvnvZHlnYAnLCBqczogJC50b1N0cmluZygo55Wq5Y+3KT0+eyByZXR1cm4gXFxcImh0dHBzOi8vbmphdi50di96aC92L1xcXCIgKyDnlarlj7c7fSznlarlj7cpfV1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxufSk7XFxuXFxuLy9hdjAxXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjNzUxMjdBXFxcIj4gQVYwMTwvZm9udD48L21pZGRsZT4nLFxcbiAgICBwaWNfdXJsOiAnaHR0cHM6Ly9jZG4yLmljb25maW5kZXIuY29tL2RhdGEvaWNvbnMvb3dsLTEwLzUwMC9uaW01MzJfMTFfcHVycGxlX293bF9raWRfYmlydGhkYXlfZmFjZV9leWUtMTI4LnBuZycsXFxuICAgIHVybDogJCgnJykubGF6eVJ1bGUoKOeVquWPtykgPT4ge1xcbiAgICAgICAgICAgICAgICAgdmFyIGF2ID0gXFxcImh0dHBzOi8vd3d3LmF2MDEudHYvXFxcIiArIOeVquWPtzsgXFxuLy9sb2coYXYpXFxuICAgICAgICAgICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGF2LHt0aW1lb3V0OjUwMDB9KVxcbiAgICAgICAgICAgICAgICAgdmFyIGNvZGUgPSBwZGZoKGh0bWwsJyNwbHlyX3ZpZGVvJiZwb3N0ZXInKVxcbmxvZyhjb2RlKVxcbiAgICAgICAgICAgICAgICAgaWYoIWNvZGUpeyAgICAgICAgIFxcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+aMguair+aIluayoeacieatpOW9seeJh1xcXCJcXG4gICAgICAgICAgICAgICAgICAgfWVsc2V7XFxuICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInZpZGVvOi8vXFxcIiArIGF2O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgIH0s55Wq5Y+3KSxcXG4gICAgY29sX3R5cGU6ICdpY29uXzUnLFxcbiAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICB2aWRlb0V4Y2x1ZGVSdWxlczogWydkb3BwaW9jZG4nXSxcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxuICAgICAgICAgICAgICAgIHZpZGVvRXhjbHVkZVJ1bGVzOiBbJzQ4MCddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJy5kb3BwaW9jZG4uJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnZG1tLmNvLmpwJ10sXFxuICAgICAgICAgICAgICAgIC8vdmlkZW9SdWxlczogWycqbTN1OConXSxcXG4gICAgICAgICAgICAgICAgY2FjaGVNM3U4OiB0cnVlLFxcbiAgICAgICAgICAgICAgIGxvbmdDbGljazogW3t0aXRsZTogJ+afpeeci+e9keWdgCcsIGpzOiAkLnRvU3RyaW5nKCjnlarlj7cpPT57IHJldHVybiBcXFwiaHR0cHM6Ly93d3cuYXYwMS50di9cXFwiICsg55Wq5Y+3O30s55Wq5Y+3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kcvMTI4L2JsdWVfbW9uc3Rlci5wbmcnLFxcbiAgICB1cmw6ICQoJycpLmxhenlSdWxlKCjnlarlj7cpID0+IHtcXG4gICAgICAgICAgICAgICAgIHZhciBhdiA9IFxcXCJodHRwczovL25qYXYudHYvemgvdi9cXFwiICsg55Wq5Y+3ICsgXFxcIi11bmNlbnNvcmVkLWxlYWtlZFxcXCI7IFxcbi8vbG9nKGF2KVxcbiAgICAgICAgICAgICAgICAgdmFyIGh0bWwgPSBmZXRjaChhdix7dGltZW91dDo1MDAwfSlcXG4gICAgICAgICAgICAgICAgIGlmKCFodG1sIHx8IGh0bWwuaW5jbHVkZXMoXFxcIuivt+ajgOafpeWcsOWdgOagj+S4reeahOe9keWdgFxcXCIpKXsgICAgICAgICBcXG4gICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mjILmoq/miJbmsqHmnInmraTlvbHniYdcXFwiXFxuICAgICAgICAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ2aWRlbzovL1xcXCIgKyBhdjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICB9LOeVquWPtyksXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgdmlkZW9FeGNsdWRlUnVsZXM6IFsnMjQwJ10sXFxuICAgICAgICAgICAgICAgIGJsb2NrUnVsZXM6IFsnKi5kb3BwaW9jZG4uKiddLFxcbiAgICAgICAgICAgICAgICBibG9ja1J1bGVzOiBbJ2RtbS5jby5qcCddLFxcbiAgICAgICAgICAgICAgICAvL3ZpZGVvUnVsZXM6IFsnKm0zdTgqJ10sXFxuICAgICAgICAgICAgICAgIGNhY2hlTTN1ODogdHJ1ZSxcXG4gICAgICAgICAgICAgICBsb25nQ2xpY2s6IFt7dGl0bGU6ICfmn6XnnIvnvZHlnYAnLCBqczogJC50b1N0cmluZygo55Wq5Y+3KT0+eyByZXR1cm4gXFxcImh0dHBzOi8vbmphdi50di96aC92L1xcXCIgKyDnlarlj7cgKyBcXFwiLXVuY2Vuc29yZWQtbGVha2VkXFxcIjt9LOeVquWPtyl9XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG59KTtcXG5cXG4vL1N1cGphdlxcbmQucHVzaCh7XFxuICAgIHRpdGxlOiAn4oCY4oCY4oCZ4oCZPGI+PG1pZGRsZT48Zm9udCBjb2xvcj1cXFwiI0EzMjk4NlxcXCI+U3VwamF2PC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjMuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9sb2dvcy1icmFuZHMtMy8yNC9sb2dvX2JyYW5kX2JyYW5kc19sb2dvc19za3JpbGwtMTI4LnBuZycsXFxuICAgIHVybDogXFxcIng1Oi8vaHR0cHM6Ly9zdXBqYXYuY29tL3poLz9zPVxcXCIgKyDnlarlj7csXFxuICAgIGNvbF90eXBlOiAnaWNvbl81JyxcXG4gICAgZXh0cmE6e1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTpmYWxzZSxcXG4gICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn5Y+s5ZSk6Zuo6KeBJywganM6ICQudG9TdHJpbmcoKOeVquWPtyk9PnsgXFxub3BlbkFwcEludGVudCgnY29tLnl1amlhbi5SZXNpZGVNZW51RGVtbycsICdjbi55dWppYW4uTWFpbkFjdGl2aXR5Jywge2ludGVudERhdGE6ICdodHRwczovL3N1cGphdi5jb20vemgvP3M9JyArIOeVquWPt30pXFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iwg+eUqOmbqOingea1j+iniOWZqFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgIH0s55Wq5Y+3KX0se3RpdGxlOiAn5p+l55yL572R5Z2AJywganM6ICQudG9TdHJpbmcoKOeVquWPtyk9PnsgXFxuICAgICAgICByZXR1cm4gXFxcImh0dHBzOi8vc3VwamF2LmNvbS96aC8/cz1cXFwiICsg55Wq5Y+3XFxuICAgICAgICAgICAgICAgICAgICAgICB9LOeVquWPtyl9XVxcbiAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgfSk7XFxuXFxuLy/no4HlipvlkJsu566AXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6ICfigJjigJjigJnigJk8Yj48bWlkZGxlPjxmb250IGNvbG9yPVxcXCIjRUY0ODIzXFxcIj7no4HlipvlkJsu566APC9mb250PjwvbWlkZGxlPicsXFxuICAgIHBpY191cmw6ICdodHRwczovL2NkbjQuaWNvbmZpbmRlci5jb20vZGF0YS9pY29ucy9zaG9wcGluZy1kb29kbGUvNTEyL1Nob3BwaW5nLTMxLTEyOC5wbmcnLFxcbiAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2Uvc291P3J1bGU956OB5Yqb5ZCbLueugCZwPWZ5cGFnZSZzZWFyY2hUZXJtcz1cXFwiICsg55Wq5Y+3LFxcbiAgICBjb2xfdHlwZTogJ2ljb25fNScsXFxuICAgIGV4dHJhOiB7ICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgbG9uZ0NsaWNrOiBbe3RpdGxlOiAn6LC35q2M5pCc57SiJywganM6ICQudG9TdHJpbmcoKOeVquWPtyk9PnsgcmV0dXJuIFxcXCJodHRwczovL3d3dy5nb29nbGUuY29tL3NlYXJjaD9xPVxcXCIgKyDnlarlj7c7fSznlarlj7cpfSx7dGl0bGU6ICdZYW5kZXjmkJzntKInLCBqczogJC50b1N0cmluZygo55Wq5Y+3KT0+eyByZXR1cm4gXFxcImh0dHBzOi8veWFuZGV4LmNvbS9zZWFyY2gvdG91Y2gvP3RleHQ9XFxcIiArIOeVquWPtzt9LOeVquWPtyl9XVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG59KTtcXG5cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbW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9idXR0b25cXFwiLFxcclxcbiAgICAgICAgICAgIHVybDogJCgyMywgJ+ivt+i+k+WFpeimgei3s+i9rOWIsOeahOmhteaVsCcpLmlucHV0KCh0cnVlX3VybCxrLG5hbWVzLGopID0+IHtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKGlzTmFOKHBhcnNlSW50KGlucHV0KSkpIHtcXHJcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/ovpPlhaXmnInor68s6K+36L6T5YWl5LiA5LiqMX4nICsgayArICfnmoTmlbDlrZcnXFxyXFxuICAgICAgICAgICAgICAgIH1cXHJcXG4gICAgICAgICAgICAgICAgbGV0IHRvUGFnZSA9IHBhcnNlSW50KGlucHV0KTtcXHJcXG4gICAgICAgICAgICAgICAgaWYgKHRvUGFnZSA8IDEgfHwgdG9QYWdlID4gaykge1xcclxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+i+k+WFpeacieivryzor7fovpPlhaXkuIDkuKoxficgKyBrICsgJ+eahOaVsOWtlydcXHJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICBpZigvZm9ydW1cXFxcLVxcXFxkK1xcXFwtXFxcXGQrLy50ZXN0KHRydWVfdXJsKSl7XFxudmFyIHVybCA9IHRydWVfdXJsLnJlcGxhY2UoL1xcXFxkK1xcXFwuaHRtLywgdG9QYWdlICsgJy5odG0nKTtcXG4gICAgICAgICAgICAgIH1lbHNle1xcbnZhciB1cmwgPSB0cnVlX3VybC5yZXBsYWNlKC9cXFxcLmh0bS8sICctJyArIHRvUGFnZSArICcuaHRtJyk7XFxuICAgICAgICAgICAgICB9XFxyXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcIm5vd1xcXCIsIG5hbWVzW2pdKTtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKE1ZX1JVTEUudXJsLCB1cmwpO1xcbiAgICAgICAgICAgICAgICAvL3B1dE15VmFyKCd5aV9maXJzdHBhZ2Un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