Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥⚙ 聚漫🔮设置 ⚙@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwiQ2xhc3NUYWJcIixcInBhdGhcIjpcIkNsYXNzVGFiXCIsXCJydWxlXCI6XCJ2YXIge1xcbiAgICBRSU5HX1RJVExFLCB0aXRsZSwgdXJsLFxcbiAgICBjbGFzc19uYW1lLCBjbGFzc191cmwsXFxuICAgIGFyZWFfbmFtZSwgYXJlYV91cmwsXFxuICAgIHllYXJfbmFtZSwgeWVhcl91cmwsXFxuICAgIHNvcnRfbmFtZSwgc29ydF91cmxcXG59ID0gJC5pbXBvcnRQYXJhbVxcbmNvbnN0IENsYXNzVGFiID0gZnVuY3Rpb24oY2xhc3NBcnJheSwgcGFyYW1zKSB7XFxuICAgIE9iamVjdC5hc3NpZ24odGhpcywgcGFyYW1zKVxcbiAgICB0aGlzLmFyciA9IGNsYXNzQXJyYXkubWFwKHYgPT4gdGhpcy5pbml0KHYpKVxcbiAgICB0aGlzLnNpZ24gPSAnJCcgKyBRSU5HX1RJVExFICsgJ18nICsgKHRoaXMubmFtZSB8fCAnJykgKyAnXydcXG4gICAgdGhpcy5jb2xvciA9IHRoaXMuY29sb3I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yhpZCkpXFxuICAgICAgICAgICAgY2xhc3NfbmFtZS5mb3JFYWNoKChuYW1lLCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBjbGFzc191cmxbaV0sXFxuICAgICAgICAgICAgICAgICAgICBub3cgPSBKU09OLnN0cmluZ2lmeSh7IG5hbWU6IG5hbWUsIHVybDogdXJsIH0pXFxuICAgICAgICAgICAgICAgIGVsLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ0nICsgbmFtZS5mb250Y29sb3IodGhpcy5jb2xvcikuYm9sZCgpIDogbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogc2VsZWN0ZWQgPT0gbm93ID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGlkLCBub3cpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgZWwucHVzaCh7IGNvbF90eXBlOiB0aGlzLmJvdW5kYXJ5IH0pXFxuICAgICAgICB9KVxcbiAgICB9LFxcbiAgICBpbml0KGNsYXNzT2JqZWN0KSB7XFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPT0gJ3N0cmluZycpXFxuICAgICAgICAgICAgY2xhc3NPYmplY3QuY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YnVzZXJjb250ZW50LmNvbS8nXVxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVxdWlyZWxpc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHsgLy/ov5znqIvkvp3otZbntKLlvJVcXG4gICAgICAgICAgICAgICAgICAgIGxldCByZXMgPSByZXF1ZXN0KHJlcXVpcmVsaXN0W2ldICsgJ0RyZWFtT3pPL0pNL21haW4vSk0nLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICBpZiAoSlNPTi5wYXJzZShyZXMpLnN0YXR1c0NvZGUgPT0gMjAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdCh1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUZpbGUodXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlRG93bmxvYWQocmVxdWlyZWxpc3RbaV0gKyAnRHJlYW1Pek8vSk0vbWFpbi9KTScsdXJsKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVEb3dubG9hZChyZXF1aXJlbGlzdFtpXSArICdEcmVhbU96Ty9KTS9tYWluL0pNJyx1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgIGJhY2soZmFsc2U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lbGVjdCgoKSA9PiB7XFxuICAgICAgICBzd2l0Y2ggKGlucHV0LnNsaWNlKDAsIDIpKSB7XFxuICAgICAgICAgICAgY2FzZSAn5riF6ZmkJzpcXG4gICAgICAgICAgICAgICAgZGVsZXRlRmlsZSgnY3VzdG9tRGF0YScpXFxuICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgY2FzZSAn5ZCv55SoJzpcXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2Rpc2FibGVDdXN0b20nLCAnJylcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICfnpoHnlKgnOlxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnZGlzYWJsZUN1c3RvbScsICdUJylcXG4gICAgICAgICAgICAgICAgaW5wdXQgKz0gJ1xcXFxu5bCP56iL5bqP5ZCv55SoL+emgeeUqOOAgemHjeaWsOaOkuW6j+etieaTjeS9nOWdh+S4jeS8muS9k+eOsOWcqOmmlumhteWwj+eoi+W6j+WIl+ihqOS4rSdcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICfnvJbovpEnOlxcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gZ2V0TXlWYXIoJ3JlbW90ZVVybCcpXFxuICAgICAgICAgICAgICAgIGlmICghdXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vZmlsZXMvJykgJiYgIXVybC5zdGFydHNXaXRoKCdmaWxlOi8vJykpXFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSAnaGlrZXI6Ly9maWxlcy9saWJzLycgKyBtZDUodXJsKSArICcuanMnXFxuICAgICAgICAgICAgICAgIHJldHVybiAgJ2hpa2VyOi8vcGFnZS9pbnRlcmZhY2Ujbm9SZWZyZXNoIyNub0hpc3RvcnkjI25vUmVjb3JkSGlzdG9yeSM/cnVsZT1KU09O57yW6L6R5ZmoJkpzb249JytiYXNlNjRFbmNvZGUodXJsKVxcbiAgICA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gICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpXS5pY29uXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+WvvOWFpea1t+mYlCc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBkYXRhID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvZGF0YUxvYWQ/cnVsZT0nICsgZ2V0TXlWYXIoJ215Q29sbGVjdGlvbicpLCB0cnVlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ3J1bGU6Ly8nICsgYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGRhdGFbaV0pKVxcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgfVxcbiAgICBlbC5wdXNoKGQpXFxufSkqL1xcbl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JzZUludChnZXRNeVZhcignc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UgyAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcbiAgICAgICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpXS5pY29uXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+WvvOWFpea1t+mYlCc6XFxuICAgICAgICAgICAgZC51cmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoZGF0YVtpXSkpO1xcbiAgICAgICAgICAgIGJyZWFrXFxuICAgIH1cXG4gICAgZWwucHVzaChkKVxcbn0pXFxuc2V0UmVzdWx0KGVsKVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6aG16Z2i6L295YWlXCIsXCJwYXRoXCI6XCJmcmFtZUxvYWRcIixcInJ1bGVcIjpcImpzOlxcbmNvbnN0IFFJTkdfVElUTEUgPSBnZXRNeVZhcignbXlDb2xsZW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IChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLCBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHJlSW5kZXggPSByZXMudXJsLmluZGV4T2YoJy5qczonKVxcbiAgICAgICAgICAgICAgICBpZiAocmVJbmRleCA+PSAwKSByZXMudXJsID0gcmVzLnVybC5zbGljZSgwLCByZUluZGV4KSArICcuanM6JyArIGhpamFja0xhenlSdWxlICsgJzsnICsgcmVzLnVybC5zbGljZShyZUluZGV4ICsgNClcXG4gICAgICAgICAgICB9IGVsc2UgIGlmIChkZXRhaWxGaW5kUnVsZSkge1xcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGdlbkV4VXJsKHVybCksXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoT2JqZWN0LmFzc2lnbihnZW5NeVJ1bGUoKSwgeyBkZXRhaWxfZmluZF9ydWxlOiBkZXRhaWxGaW5kUnVsZSB9KSkpLFxcbiAgICAgICAgICAgICAgICAgICAgcGFnZVRpdGxlOiBpc0luZGV4ICYmIHRpdGxlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9ICdoaWtlcjovL3BhZ2UvZnJhbWVMb2FkP3J1bGU9JyArIFFJTkdfVElUTEVcXG4gICAgICAgICAgICB9IGVsc2Ug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XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoXFxcImpqc1xcXCIsIFxcXCLlsZXlvIBcXFwiKTtcXG5cXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBqamlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJ+eugOS7iyA8c21hbGw+PHNtYWxsPjxzcGFuIHN0eWxlPVxcXCJjb2xvcjojMTlCODlEXFxcIj7mlLbotbc+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nXFxuICAgICAgICAgICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lU3BhY2luZzogMyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGRlY2lkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogJzxzcGFuIHN0eWxlPVxcXCJjb2xvcjojODA4MDgwXFxcIj4nICsgZGVzX2Rlc2MgKyAnLi4uPC9zcGFuPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiampzXFxcIiwgXFxcIuaUtui1t1xcXCIpO1xcblxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGpqaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5LuLIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuWxleW8gD48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcImNvbG9yOiM4MDgwODBcXFwiPicgKyBkZXNfZGVzYy5zdWJzdHIoMCwgMzApICsgJy4uLjwvc3Bhbj4nXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgfSwgTVlfUlVMRSArIFxcXCJfamppZFxcXCIsIE1ZX1JVTEUgKyBcXFwiX2RlY2lkXFxcIiwgZGVzX2Rlc2MpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogTVlfUlVMRSArIFxcXCJfamppZFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG5cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjLnN1YnN0cigwLCAzMCkgKyAnLi4uPC9zcGFuPicsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJyaWNoX3RleHRcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHRleHRTaXplOiAxNCxcXG4gICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgIGlkOiBNWV9SVUxFICsgXFxcIl9kZWNpZFxcXCJcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSlcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSlcXG4gICAgfSBjYXRjaCAoZSkge31cXG59XFxuXFxuZnVuY3Rpb24gZG93bihUaXRsZSwgY2hhcHRlclBpYywgbGlzdCwgY2hhcHRlclRpdGxlLCBjaGFwdGVyTGluZSwgZG93bmxvYWRsYXp5KSB7XFxuICAgIHRyeSB7XFxuICAgICAgICBsZXQgZG9MaXN0ID0gbGlzdC5tYXAoKGl0ZW0pID0+ICh7XFxuICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXRlbSwgY2hhcHRlclRpdGxlKSxcXG4gICAgICAgICAgICB1cmw6IHBkKGl0ZW0sIGNoYXB0ZXJMaW5lKSxcXG4gICAgICAgIH0pKTtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICfigJzigJzigJ3igJ08Yj48c3BhbiBzdHlsZT1cXFwiY29sb3I6ICMxYWFkMTlcXFwiPuS4i+i9vea8q+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xcXCIgKyBsaW5lVGl0bGUgKyBcXFwiXFxcIiA6IGxpbmVUaXRsZSArIFxcXCLigJjigJg65YiH5o2iXFxcIixcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCkubGF6eVJ1bGUoKHZhcktleSwgbGluZUluZGV4LCBsaW5lVGl0bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHZhcktleSwgbGluZUluZGV4LnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coTVlfUlVMRS51cmwpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigoTVlfUlVMRS50aXRsZSArICcjbGluZS10aXRsZScpLCBsaW5lVGl0bGUpXFxuICAgICAgICAgICAgICAgICAgICBsb2coTVlfUlVMRS50aXRsZSArIGdldE15VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJykpKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+W3suWIh+aNouiHs1xcXCIgKyBsaW5lVGl0bGVcXG4gICAgICAgICAgICAgICAgfSwgdmFyS2V5LCBpLCBsaW5lVGl0bGUpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJ1xcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBjYXRjaCAoZSkge31cXG4gICAgfVxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxuICAgICAgICAgICAgfSk7XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Yqo5oCBW+S6jF0qXCIsXCJwYXRoXCI6XCJkdGZsXCIsXCJydWxlXCI6XCJjb25zdCBlbXB0eSA9IFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcblxcbmlmICh0eXBlb2Yo5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4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9LCBmb2xkKSxcXG4gICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgIH0pXFxuICAgIGNhdGVnb3JpZXMuZm9yRWFjaCgoY2F0ZWdvcnksIGluZGV4KSA9PiB7XFxuICAgICAgICBsZXQgc3ViX2NhdGVnb3JpZXMgPSBwZGZhKGNhdGVnb3J5LCDlsI/nsbvlrprkvY0pO1xcbiAgICAgICAgaWYgKGluZGV4ID09PSAwKSB7XFxuICAgICAgICAgICAgc3ViX2NhdGVnb3JpZXMuZm9yRWFjaCgoaXRlbSwga2V5KSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXRlbSwg5YiG57G75qCH6aKYKVxcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mKOaOkumZpCkgIT0gJ3VuZGVmaW5lZCcgJiYg5o6S6ZmkICE9ICcnKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZSA9IHRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cCjmjpLpmaQsIFxcXCJnXFxcIiksIFxcXCJcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIHRpdGxlLmZvbnRjb2xvcijliIbnsbvpopzoibIpIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQocGQoaXRlbSwg5YiG57G76ZO+5o6lKSArICcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXCIwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKE1ZX1JVTEUudGl0bGUsIEpTT04uc3RyaW5naWZ5KG5ld19jYXRlKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogcGFnZSxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9IGVsc2UgaWYgKGZvbGQgPT09ICcxJykge1xcbiAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimClcXG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZijmjpLpmaQpICE9ICd1bmRlZmluZWQnICYmIOaOkumZpCAhPSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGUgPSB0aXRsZS5yZXBsYWNlKG5ldyBSZWdFeHAo5o6S6ZmkLCBcXFwiZ1xcXCIpLCBcXFwiXFxcIilcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gXFxcIuKAnOKAnOKAneKAnVxcXCIgKyB0aXRsZS5mb250Y29sb3Io5YiG57G76aKc6ImyKSA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS51cmwsIGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAg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biAgICAgKiDmipjlj6DmjInpkq7nmoTnlYzpnaJcXG4gICAgICpcXG4gICAgICogQHBhcmFtIGxheW91dCDkuI4gZC5wdXNoIOe7k+aehOS4gOiHtO+8jFxcbiAgICAgKiAgICAgICAg5L6L77yaeyB0aXRsZTpcXFwi5qCH6aKYMVxcXCIsIHVybDpcXFwieHh4XFxcIiwgY29sX3R5cGU6XFxcInNjcm9sbF9idXR0b25cXFwiIH07XFxuICAgICAqICAgICAgICDlj4LmlbDph4fnlKjlj6/pgInopobnm5bmqKHlvI/vvIzkuI3lhpnnmoTlj4LmlbDliJnkvb/nlKjpu5jorqQ7XFxuICAgICAqICAgICAgICDmr5TlpoLkvKDlhaUgeyBjb2xfdHlwZTpcXFwidGV4dF8xXFxcIiB977yM6YKj5pyA57uI57uT5p6c5bCx5pivIHsgdGl0bGU6XFxcIuagh+mimDFcXFwiLCB1cmw6XFxcInh4eFxcXCIsIGNvbF90eXBlOlxcXCJ0ZXh0XzFcXFwiIH1cXG4gICAgICogQHJldHVybnMge0NhdGVnb3JpZXNIZWFkZXJ9XFxuICAgICAqL1xcbiAgICBmb2xkTGF5b3V0KGxheW91dCkge1xcbiAgICAgICAgaWYgKHR5cGVvZiBsYXlvdXQgPT09ICdvYmplY3QnKSB7XFxuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyhsYXlvdXQpXFxuICAgICAgICAgICAgbGV0IGluamVjdEluZGV4ID0gbGF5b3V0LmluamVjdEluZGV4IHx8IGxheW91dFsn5oqY5Y+g5oyJ6ZKu5o+S5YWl6KGMJ11cXG4gICAgICAgICAgICBpZiAobGF5b3V0LnRpdGxlIHx8IGxheW91dC51cmwgfHwgbGF5b3V0LmNvbF90eXBlIHx8IGluamVjdEluZGV4KSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5ID0ga2V5c1tpXVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdW2tleV0gPSBsYXlvdXRba2V5XTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35Lyg5YWl5q2j56Gu55qE5oqY5Y+g55WM6Z2i5YWD57Sg77yBXFxcIilcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8gaW5qZWN0SW5kZXgg5oqY5Y+g5oyJ6ZKu5o+S5YWl56ysIGluamVjdEluZGV4IOihjFxcbiAgICAgICAgICAgIGlmIChpbmplY3RJbmRleCkge1xcbiAgICAgICAgICAgICAgICBpZiAoISh0eXBlb2YgKGluamVjdEluZGV4KSA9PT0gJ251bWJlcicpKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOivt+S8oOWFpeaVsOWtl++8gVxcXCIpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGluamVjdEluZGV4IDwgMSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLmipjlj6DmjInpkq7mj5LlhaXooYzor7fkvKDlhaXlpKfkuo4gMCDnmoTmlbTmlbDvvIFcXFwiKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChpbmplY3RJbmRleCA+IHRoaXNbc3ltYm9sTWFwLm1Gb2xkSW5kZXhdKSB7XFxuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIuaKmOWPoOaMiemSruaPkuWFpeihjOS4jeW+l+Wkp+S6juaYvuekuuaKmOWPoOihjOaVsO+8geivt+iwg+eUqCAuZm9sZEluZGV4KGluZGV4KSDmiJYgLuesrOWHoOihjOW8gOWni+aKmOWPoChp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3RyaW5naWZ5KHJ1bGVPYmopKVxcbiAgICAgICAgaWYgKHJ1bGVPYmouY29uc3RydWN0b3IgPT09IEFycmF5KSB7XFxuICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAucnVsZU9iakxpc3RdID0gdGhpc1tzeW1ib2xNYXAucnVsZU9iakxpc3RdLmNvbmNhdChydWxlT2JqKVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5ydWxlT2JqTGlzdF0ucHVzaChydWxlT2JqKVxcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIHRoaXM7XFxuICAgIH0sXFxuICAgIGV2YWxKU1J1bGUoaXRlbSwganNSdWxlKSB7XFxuICAgICAgICBsZXQgcnVsZSA9IGpzUnVsZS5yZXBsYWNlKFxcXCJAanM6XFxcIiwgXFxcIlxcXCIpXFxuICAgICAgICBydWxlID0gcnVsZS50cmltKClcXG4gICAgICAgIC8vIGxvZygkLnN0cmluZ2lmeShydWxlKSlcXG4gICAgICAgIGxldCBpbnB1dCA9IGl0ZW1cXG4gICAgICAgIGlmIChydWxlLnN0YXJ0c1dpdGgoXFxcIihcXFwiKSkge1xcbiAgICAgICAgICAgIGV2YWwoJ3Jlc3VsdCA9ICcgKyBydWxlKVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAvKipcXG4gICAgICAgICAgICAgKiDov5jljp/miJAgJC50b1N0cmluZyguLi4pIOeahOacgOe7iOe7k+aenO+8jOi+vuWIsOacgOe7iOWkhOeQhuaWueW8j+i3n+S4iumdoueahCBpZiDkuIDoh7TnmoTnm67nmoRcXG4gICAgICAgICAgICAgKi9cXG4gICAgICAgICAgICBldmFsKCdyZXN1bHQgPSAnICsgJygoKSA9PiB7JyArIHJ1bGUgKyAnfSkoKScpXFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gKHJlc3VsdCB8fCAnJylcXG4gICAgfSxcXG4gICAgZ2V0VGl0bGUoc3JjLCB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24pIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbVxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwYXJzZURvbUZvckh0bWxcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBkZmhcXFwiOlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tRm9ySHRtbDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDpcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh1cmxSdWxlW1xcXCLop6PmnpDmlrnms5VcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgc3dpdGNoICh1cmxSdWxlW1xcXCLop6PmnpDmlrnms5VcXFwiXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tXFxcIjpcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXCJwZFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcInBhcnNlRG9tRm9ySHRtbFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFwicGRmaFxcXCI6XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb21Gb3JIdG1sO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIHVybCA9IHBhcnNlKHNyYywgbVVybFJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5kZWFsVXJsKSB7XFxuICAgICAgICAgICAgICAgIHVybCA9IHVybFJ1bGUuZGVhbFVybCh1cmwpXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh1cmxSdWxlWyfkuozmrKHlpITnkIYnXSkge1xcbiAgICAgICAgICAgICAgICB1cmwgPSB1cmxSdWxlWyfkuozmrKHlpITnkIYnXSh1cmwpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gdGhpcy5ldmFsSlNSdWxlKHNyYywgdXJsUnVsZSk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2VEb20oc3JjLCB1cmxSdWxlKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdXJsIHx8IFxcXCJcXFwiO1xcbiAgICB9LFxcbiAgICBidWlsZCgpIHtcXG4gICAgICAgIC8vIOajgOa1i+aYr+WQpuS8oOWFpemcgOimgeeahOWPguaVsFxcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxuICAgICAgICAvLyDmr4/kuIDkuKrliIbnsbvnmoTllK/kuIDmoIfor4ZcXG4gICAgICAgIGxldCBtVGFnID0gdGhpc1tzeW1ib2xNYXAubVRhZ10gfHwgXFxcIlxcXCJcXG4gICAgICAgIC8v57+76aG1IOmcgOimgeagueaNruWunumZheabv+aNolxcbiAgICAgICAgY29uc3QgaHRtbCA9IHRoaXNbc3ltYm9sTWFwLnNyY10gfHwgcmVxdWVzdCh0aGlzW3N5bWJvbE1hcC50cnVlX3VybF0pXFxuICAgICAgICBjb25zdCBlbXB0eSA9IFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgLy/ojrflj5bliJfooahcXG4gICAgICAgIGNvbnN0IGNhdGVnb3JpZXMgPSBbXVxcbiAgICAgICAgdGhpc1tzeW1ib2xNYXAucnVsZU9iakxpc3RdLm1hcChydWxlT2JqID0+IHtcXG4gICAgICAgICAgICBsZXQgbGlzdCA9IFtdXFxuICAgICAgICAgICAgbGV0IGxpc3RSdWxlID0gcnVsZU9iai5saXN0UnVsZSB8fCBydWxlT2JqW1xcXCLkuIDnuqfliIbnsbtcXFwiXVxcbiAgICAgICAgICAgIGlmIChsaXN0UnVsZS5zdGFydHNXaXRoKFxcXCJAanM6XFxcIikpIHtcXG4gICAgICAgICAgICAgICAgLy8gbG9nKCQuc3RyaW5naWZ5KGxpc3RSdWxlKSlcXG4gICAgICAgICAgICAgICAgbGlzdCA9IHRoaXMuZXZhbEpTUnVsZShodG1sLCBsaXN0UnVsZSlcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gcGFyc2VEb21Gb3JBcnJheShodG1sLCBsaXN0UnVsZSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgLy8gbG9nKGxpc3QpXFxuICAgICAgICAgICAgbGlzdC5tYXAoY2F0ZWdvcnkgPT4ge1xcbiAgICAgICAgICAgICAgICBjYXRlZ29yaWVzLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgbGlzdDogY2F0ZWdvcnksXFxuICAgICAgICAgICAgICAgICA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ZWN0SW5kZXggPT09IChpbmRleCsxKSkge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZvbGRMYXlvdXQgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XS50aXRsZSB8fCAodGhpc1tzeW1ib2xNYXAubUZvbGRdID09PSAnMScgPyAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAjRkYwMDAwXFxcIj7iiKg8L3NwYW4+PC9iPicgOiAn4oCc4oCc4oCd4oCdPGI+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiAjMWFhZDE5XFxcIj7iiKc8L3NwYW4+PC9iPicpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdGhpc1tzeW1ib2xNYXAubUZvbGRMYXlvdXRdLnVybCB8fCAkKFxcXCJoaWtlcjovL2VtcHR5I25vSGlzdG9yeSNcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy5tVGFnICsgcGFyYW1zLlZBUk1BUC5GT0xELCBnZXRNeVZhcihwYXJhbXMubVRhZyArIHBhcmFtcy5WQVJNQVAuRk9MRCwgcGFyYW1zLmlzRm9sZCkgPT09ICcxJyA/ICcwJyA6ICcxJylcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFnOiBtVGFnLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc0ZvbGQ6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiB0aGlzW3N5bWJvbE1hcC5tRm9sZExheW91dF0uY29sX3R5cGUgfHwgXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgdGhpc1tzeW1ib2xNYXAubUxheW91dF0ucHVzaChmb2xkTGF5b3V0KVxcbiAgICAgICAgICAgICAgICB9XFxuXFxuICAgICAgICAgICAgICAgIC8v5YW35L2T5YiX6KGo5LiL55qE5YiG57G7XFxuICAgICAgICAgICAgICAgIGxldCBzdWJfY2F0ZWdvcmllcyA9IFtdO1xcbiAgICAgICAgICAgICAgICBpZiAoY2F0ZWdvcnkuc3ViTGlzdFJ1bGUuc3RhcnRzV2l0aChcXFwiQGpzOlxcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcyA9IHRoaXMuZXZhbEpTUnVsZShjYXRlZ29yeS5saXN0LCBjYXRlZ29yeS5zdWJMaXN0UnVsZSlcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzID0gcGFyc2VEb21Gb3JBcnJheShjYXRlZ29yeS5saXN0LCBjYXRlZ29yeS5zdWJMaXN0UnVsZSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKGluZGV4IDwgKHRoaXNbc3ltYm9sTWFwLm1Gb2xkSW5kZXhdIHx8IDEpKSB7XFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSB0aGlzLmdldFRpdGxlKGl0ZW0sIGNhdGVnb3J5KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSB0aGlzLmdldFVybChpdGVtLCBjYXRlZ29yeSlcXG5cXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IGtleS50b1N0cmluZygpID09PSBjYXRlX3RlbXBbaW5kZXhdID8gJ+KAnOKAnOKAneKAnTxiPjxmb250IGNvbG9yPScgKyB0aGlzW3N5bWJvbE1hcC5tQ29sb3JdICsgJz4nICsgdGl0bGUgKyAnIDwvZm9udD48L2I+JyA6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5pbmRleCA9PT0gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXAuZm9yRWFjaCgoY2F0ZSwgaW5kZXgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X2NhdGUucHVzaChpbmRleCA9PT0gMCA/IHBhcmFtcy5rZXkudG9TdHJpbmcoKSA6IFxcXCIwXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihwYXJhbXMudGFnICsgcGFyYW1zLlZBUk1BUC5DQVRFR09SWSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmluZGV4ID09PSAwID8gbmV3X2NhdGUgOiBwYXJhbXMuY2F0ZV90ZW1wKSlcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVAsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6IG1UYWcsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhZ2U6IHRoaXNbc3ltYm9sTWFwLm1QYWdlXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpc1tzeW1ib2xNYXAubUZvbGRdID09PSAnMCcpIHtcXG4gICAgICAgICAgICAgICAgICAgIHN1Yl9jYXRlZ29yaWVzLmZvckVhY2goKGl0ZW0sIGtleSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9IHRoaXMuZ2V0VXJsKGl0ZW0sIGNhdGVnb3J5KVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyAn4oCc4oCc4oCd4oCdPGI+PGZvbnQgY29sb3I9JyArIHRoaXNbc3ltYm9sTWFwLm1Db2xvcl0gKyAnPicgKyB0aXRsZSArICcgPC9mb250PjwvYj4nIDogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcblxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuQ0FURUdPUlksIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5jYXRlX3RlbXApKVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuVVJMLCBpbnB1dClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhZzogbVRhZyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICB9LFxcblxcbiAgICDnlYzpnaIobGF5b3V0KSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5sYXlvdXQobGF5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aW5zL1VybFByb2Nlc3Nvci5qc1xcbiAqL1xcbmZ1bmN0aW9uIFVybFByb2Nlc3NvcigpIHtcXG4gICAgdGhpcy5wYXJhbXMgPSB7fVxcbiAgICB0aGlzLnJlZ2V4TWFwID0gW1xcbiAgICAgICAge1xcbiAgICAgICAgICAgIHJlZzogJyh2b2R0eXBlfHZpZGVvdClcXFxcXFxcXC9cXFxcXFxcXHcrJyxcXG4gICAgICAgICAgICBleGVjOiAoKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnBhcmFtcy51cmxcXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8tXFxcXGQrLmh0bWwvLCAnLScgKyB0aGlzLnBhcmFtcy5wYWdlICsgJy5odG1sJylcXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oKHZvZHR5cGV8dmlkZW90KVxcXFwvXFxcXHcrKS5odG1sLywgJyQxLScgKyB0aGlzLnBhcmFtcy5wYWdlICsgJy5odG1sJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcbiAgICAgICAge1xcbiAgICAgICAgICAgIHJlZzogJ1xcXFxcXFxcLz9bXFxcXFxcXFx3XFxcXFxcXFxkXSstLio/LS4qPy0uKj8tLio/LS4qPy0uKj8tLio/LVxcXFxcXFxcZCotLS1cXFxcXFxcXGQqLmh0bWwnLFxcbiAgICAgICAgICAgIGV4ZWM6ICgpID0+IHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyYW1zLnVybFxcbiAgICAgICAgICAgICAgICAgICAgLnJlcGxhY2UoL1xcXFxkKigtLS0uaHRtbCkvLCB0aGlzLnBhcmFtcy5wYWdlICsgJyQxJylcXG4gICAgICAgICAgICAgICAgICAgIC5yZXBsYWNlKC8oLS0tXFxcXGQrLmh0bWwpLywgdGhpcy5wYXJhbXMucGFnZSArICckMScpOyAvLyDmi7zmjqXpobXnoIFcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LFxcb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gICBjb25zdHJ1Y3RvcjogVXJsUHJvY2Vzc29yLFxcbiAgICBjaGVja1BhcmFtcygpIHtcXG4gICAgICAgIGlmICghdGhpcy5wYXJhbXMudXJsKSB7XFxuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCLor7flhYjosIPnlKggLmJhc2VVcmwodXJsKSDkvKDlhaXpk77mjqXov5vooYzliJ3lp4vljJYhXFxcIilcXG4gICAgICAgIH1cXG4gICAgICAgIGlmICghdGhpcy5wYXJhbXMucGFnZSkge1xcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcXFwi6K+35YWI6LCD55SoIC5wYWdlKHBhZ2UpIOS8oOWFpemhteeggei/m+ihjOWIneWni+WMliFcXFwiKVxcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBiYXNlVXJsKHVybCl7XFxuICAgICAgICB0aGlzLnBhcmFtcy51cmwgPSB1cmxcXG4gICAgICAgIHJldHVybiB0aGlzXFxuICAgIH0sXFxuICAgIHBhZ2UocGFnZSl7XFxuICAgICAgICB0aGlzLnBhcmFtcy5wYWdlID0gcGFnZVxcbiAgICAgICAgcmV0dXJuIHRoaXNcXG4gICAgfSxcXG4gICAgYWRkRXh0cmEocmVnRXhwKSB7XFxuICAgICAgICBpZiAocmVnRXhwLmNvbnN0cnVjdG9yID09PSBBcnJheSkge1xcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAgPSB0aGlzLnJlZ2V4TWFwLmNvbmNhdChyZWdFeHApXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHRoaXMucmVnZXhNYXAucHVzaChyZWdFeHApXFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAgZGVidWcoKSB7XFxuICAgICAgICB0aGlzLnBhcmFtcy5kZWJ1ZyA9IHRydWVcXG4gICAgICAgIHJldHVybiB0aGlzO1xcbiAgICB9LFxcbiAgICBleGVjKCkge1xcbiAgICAgICAgdGhpcy5jaGVja1BhcmFtcygpXFxuICAgICAgICBsZXQgdHJ1ZV91cmwgPSAnJ1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCB0aGlzLnJlZ2V4TWFwLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgbGV0IHJlZ09iaiA9IHRoaXMucmVnZXhNYXBbaV07XFxuICAgICAgICAgICAgbGV0IHVybEV4cCA9IHJlZ09iai5yZWc7XFxuICAgICAgICAgICAgaWYgKHR5cGVvZiB1cmxFeHAgPT09ICdzdHJpbmcnKSB7XFxuICAgICAgICAgICAgICAgIHVybEV4cCA9IG5ldyBSZWdFeHAodXJsRXhwKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodXJsRXhwLnRlc3QodGhpcy5wYXJhbXMudXJsKSkge1xcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5wYXJhbXMuZGVidWcpIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1cmxFeHAudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB0cnVlX3VybCA9IHJlZ09iai5leGVjKCk7XFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgICAgIGlmICh0cnVlX3VybCkge1xcbiAgICAgICAgICAgIHJldHVybiB0cnVlX3VybDtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyYW1zLnVybFxcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICDojrflj5blpITnkIbnu5PmnpwoKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5leGVjKClcXG4gICAgfSxcXG4gICAg6ZO+5o6lKHVybCkge1xcbiAgICAgICAgcmV0dXJuIHRoaXMuYmFzZVVybCh1cmwpXFxuICAgIH0sXFxuICAgIOmhteeggShwYWdlKSB7XFxuICAgICAgICByZXR1cm4gdGhpcy5wYWdl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PSBjb252ZXJ0MShvYmou6KeE5YiZKVxcbiAgICAgICAgbWVyZ2UoYywgb2JqKVxcbiAgICB9XFxuICAgIGxldCBhcnIgPSBwZGZhKGdldFJlc0NvZGUoKSwgb2JqLuWIl+ihqCk7XFxuICAgICAgIGlmIChvYmou5YiX6KGo5aSE55CGICE9IG51bGwpIHtcXG4gICAgICAgICAgICBhcnIgPSBvYmou6ZO+5o6l5aSE55CGKGFycilcXG4gICAgICAgIH1cXG4gICAgZm9yIChsZXQgaXQgb2YgYXJyKSB7XFxuICAgICAgICBsZXQgdXJsID0gcGQoaXQsIG9iai7pk77mjqUpXFxuICAgICAgICBpZiAob2JqLumTvuaOpeWkhOeQhiAhPSBudWxsKSB7XFxuICAgICAgICAgICAgdXJsID0gb2JqLumTvuaOpeWkhOeQhih1cmwpXFxuICAgICAgICB9XFxuICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0LCBvYmou5qCH6aKYKVxcbiAgICAgICAgaWYgKG9iai7moIfpopjlpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIHRpdGxlID0gb2JqLuagh+mimOWkhOeQhih0aXRsZSlcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCBwaWMgPSBwZChpdCwgb2JqLuWbvueJhylcXG4gICAgICAgIGlmIChvYmou5Zu+54mH5aSE55CGICE9IG51bGwpIHtcXG4gICAgICAgICAgICBwaWMgPSBvYmou5Zu+54mH5aSE55CGKHBpYylcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IG9iai7moIfpopggPyBwZGZoKGl0LCBvYmou5qCH6aKYKSA6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIHVybDogdXJsKycjYXV0b0NhY2hlIycsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGRlc2M6IG9iai7mj4/ov7AgPyBwZGZoKGl0LCBvYmou5o+P6L+wKSA6IFxcXCJ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ZXQgaXQgb2Yg6ZuG5pWw57uEW2ldKSB7XFxuICAgICAgICAgICAgdmFyIGRvTGlzdHVybCA9IHBkZmgoaXQsIOmbhnVybClcXG4gICAgICAgICAgICBkb0xpc3R1cmwgPSBkb0xpc3R1cmwuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSA/IGRvTGlzdHVybCA6IOWJjee8gCArIGRvTGlzdHVybFxcbiAgICAgICAgICAgIGRvTGlzdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoaXQsIOmbhuWQjSksXFxuICAgICAgICAgICAgICAgIHVybDogZG9MaXN0dXJsXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG5cXG4gICAgICAgIHZhciBib29rTmFtZSA9ICHlpJrot6/nur/lkKYgPyDmoIfpopggOiDmoIfpopggKyAnLScgKyDliJfooajlkI1baV1cXG5cXG4gICAgICAgIOeroOiKgmpzb24ucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IOWIl+ihqOWQjVtpXSxcXG4gICAgICAgICAgICBsaXN0OiBkb0xpc3QsXFxuICAgICAgICAgICAgc2pzczoge1xcbiAgICAgICAgICAgICAgICBjaGFwdGVyTGlzdDogZG9MaXN0LFxcbiAgICAgICAgICAgICAgICBpbmZvOiB7XFxuICAgICAgICAgICAgICAgICAgICBib29rTmFtZTogYm9va05hbWUsIC8v5ryr55S75ZCN56ewLFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZU5hbWU6IE1ZX1JVTEUudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBib29rVG9wUGljOiDlm77niYcsXFxuICAgICAgICAgICAgICAgICAgICBwYXJzZUNvZGU6IGRvd25sb2FkbGF6eSxcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZpZXc6IFxcXCIxXFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgcmV0dXJuIOeroOiKgmpz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IGlkOiDlvZPliY1VUkwgKyBcXFwiX2J0XFxcIlxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgdGl0bGU6IOaUti5yZXBsYWNlKFxcXCLnroDku4vmlLZcXFwiLCBqailcXG4gICAgICAgIH0pXFxuXFxuICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDog5b2T5YmNVVJMICsgXFxcIl9telxcXCJcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHRpdGxlOiBqaiA9PSBcXFwi5bey5pS26LW3XFxcIiA/IOaUtuWGheWuuS5yZXBsYWNlKFxcXCLnroDku4tcXFwiLCDnroDku4vlhoXlrrnmlLYpIDog5pS25YaF5a65LnJlcGxhY2UoXFxcIueugOS7i1xcXCIsIOeugOS7i+WGheWuuSlcXG4gICAgICAgIH0pXFxuICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgIH0sIOeugOS7i+WGheWuuSwg566A5LuL5YaF5a655pS2LCBidHRpdGxlLCBtenRleHQsIOmhtVVSTClcXG5cXG5cXG4gICAgLy/moIfpophcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBidHRpdGxlLnJlcGxhY2UoXFxcIueugOS7i+aUtlxcXCIsIGpqKSxcXG4gICAgICAgIHVybDogamp1cmwsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICBwaWNfdXJsOiDlm77niYcsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiDpobVVUkwgKyBcXFwiX2J0XFxcIlxcbiAgICAgICAgfVxcbiAgICB9KTtcXG5cXG4gICAgLy/nroDku4tcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBqaiA9PSBcXFwi5bey5pS26LW3XFxcIiA/IG16dGV4dC5yZXBsYWNlKFxcXCLnroDku4tcXFwiLCDnroDku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OmhtVVSTCArIFxcXCLnq6DoioLmjpLluo9cXFwiLCBcXFwi5q2j5bqPXFxcIik7XFxuICAgIHZhciDmj5DnpLogPSDmjpLluo8gPT0gJ+WAkuW6jycgPyAn5q2j5bqPJyA6ICflgJLluo8nO1xcblxcbiAgICB2YXIg5o6S5bqPdXJsID0gJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgo5qCH6aKY5ZCNLCDmoIfpopjmlbDmja4sIOWIl+ihqOaVsOaNriwg6Kej5p6Q5Luj56CBLCDpobVVUkwpID0+IHtcXG4gICAgICAgIHZhciDmjpLluo8gPSBnZXRNeVZhcijpobVVUkwgKyBcXFwi56ug6IqC5o6S5bqPXFxcIiwgXFxcIuato+W6j1xcXCIpO1xcbiAgICAgICAgdmFyIOaPkOekuiA9IOaOkuW6jyA9PSAn5YCS5bqPJyA/ICfmraPluo8nIDogJ+WAkuW6jyc7XFxuICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcIl/mjpLluo9cXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICB0aXRsZTog5qCH6aKY5ZCNLnJlcGxhY2UoJ+i3r+e6vycsIOagh+mimOaVsOaNrikucmVwbGFjZSgn5o6S5bqPJywg5o+Q56S6KVxcbiAgICAgICAgfSlcXG5cXG5cXG4gICAgICAgIGlmICjmj5DnpLogPT0gJ+WAkuW6jycpIHtcXG4gICAgICAgICAgICDliJfooajmlbDmja4ucmV2ZXJzZSgpXFxuICAgICAgICB9XFxuICAgICAgICDliJfooajmlbDmja4uZm9yRWFjaChmdW5jdGlvbihkYXRhLCBzc2lkKSB7XFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBkYXRhLnRpdGxlLFxcbiAgICAgICAgICAgICAgICB1cmw6IGRhdGEudXJsICsg6Kej5p6Q5Luj56CBLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXCJf6YCJ6ZuGXFxcIiArIHNzaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuXFxuXFxuICAgICAgICBwdXRNeVZhcijpobVVUkwgKyBcXFwi56ug6IqC5o6S5bqPXFxcIiwg5o+Q56S6KVxcbiAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICB9LCDmoIfpopjlkI0sIOagh+mimOaVsOaNriwg5YiX6KGo5pWw5o2uLCDop6PmnpDku6PnoIEsIOmhtVVSTClcXG5cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiDmoIfpopjlkI0ucmVwbGFjZSgn6Lev57q/Jywg5qCH6aKY5pWw5o2uKS5yZXBsYWNlKCfmjpLluo8nLCDmjpLluo8pLFxcbiAgICAgICAgcGljX3VybDog5Zu+54mHLFxcbiAgICAgICAgdXJsOiDmjpLluo91cmwsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGlkOiDpobVVUkwgKyBcXFwiX+aOkuW6j1xcXCJcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuXFxuICAgIGlmICjmjpLluo8gPT0gJ+WAkuW6jycpIHtcXG4gICAgICAgIOWIl+ihqOaVsOaNri5yZXZlcnNlKClcXG4gICAgfVxcblxcbiAgICDliJfooajmlbDmja4uZm9yRWFjaChmdW5jdGlvbihkYXRhLCBpZCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZGF0YS50aXRsZSxcXG4gICAgICAgICAgICB1cmw6IGRhdGEudXJsICsg6Kej5p6Q5Luj56CBLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF8yXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcIl/pgInpm4ZcXFwiICsgaWRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuXFxufVxcblxcbi8qXFxuZnVuY3Rpb24g5re75Yqg6Ziy5q2i572R6aG1KOmhuXVybCwgVUEpIHtcXG5cXG4gICAgLy/kuIrnuqfot7PovazliLDlvZPliY3pobXnmoTpk77mjqXlv4XpobvmmK9oaWtlcjovL2VtcHR577yb5LiN54S25LiA5Yi35paw6L+Y5piv5Lya6YeN5aSN5Yqg6L29XFxuICAgIC8vVUEgJyfmiJZmYWxzZeaIlifmiYvmnLonIOm7mOiupOaYr+aJi+acuuerryA7IOeUteiEkSAnUEMnXFxuXFxuICAgIHZhciDliLfmlrDph43lpI0gPSBNWV9SVUxFLnRpdGxlICsgXFxcIue9kemhtea6kOeggVxcXCJcXG4gICAgdmFyIHBj6ZO+5o6lID0g6aG5dXJsLnJlcGxhY2UoXFxcIm0uXFxcIiwgXFxcInd3dy5cXFwiKVxcbiAgICB2YXIg5omL5py66ZO+5o6lID0g6aG5dXJsLnJlcGxhY2UoXFxcInd3dy5cXFwiLCBcXFwibS5cXFwiKVxcblxcbiAgICB2YXIgY29kZTtcXG4gICAgaWYgKGdldE15VmFyKOWIt+aWsOmHjeWkjSwgXFxcImZhbHNlXFxcIikgPT0gXFxcImZhbHNlXFxcIikge1xcblxcbiAgICAgICAgY29kZSA9IFVBID09ICdQQycgPyBmZXRjaChwY+mTvuaOpSkgOiByZXF1ZXN0KOaJi+acuumTvuaOpSk7XFxuICAgICAgICBwdXRNeVZhcijliLfmlrDph43lpI0sIGdldFBhcmFtKCd1cmwnKSArIFxcXCLvv6Um77+lXFxcIiArIGNvZGUpXFxuXFxuICAgIH0gZWxzZSB7XFxuXFxuICAgICAgICB2YXIgcG0gPSBnZXRNeVZhcijliLfmlrDph43lpI0pLnNwbGl0KFxcXCLvv6Um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IkeW5suWVpeWRolxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXG4gICAgICAgIH0pO1xcblxcblxcbiAgICAgICAg6Lev57q/5pWw5o2uLmZvckVhY2goZnVuY3Rpb24oZGF0YSwgaWQpIHtcXG5cXG4gICAgICAgICAgICB2YXIgamp1cmwgPSAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKCjpobVVUkwsaWQpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbSjpobVVUkwgKyAn6YCJ5oup5YiX6KGoJyxpZCsnJyk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICB9LOmhtVVSTCxpZCk7XFxuXFxuICAgICAgICAgICAgdmFyIOagh+mimOWQjSA9IGlkID09IOmAieaLqeWIl+ihqCA/IOi3r+e6v+mAieS4rS5yZXBsYWNlKCfpgInkuK0nLCBkYXRhLnRpdGxlKSA6IGRhdGEudGl0bGU7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IOagh+mimOWQjSxcXG4gICAgICAgICAgICAgICAgdXJsOiBqanVybCxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDog6aG1VVJMICsgXFxcIl/ot6/nur9cXFwiICsgaWRcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSk7XFxuXFxuICAgIH1cXG4gICAgcmV0dXJuIOmAieaLqeWIl+ihqFxcbn1cXG5cXG5cXG5mdW5jdGlvbiDmt7vliqDpgInmi6nkuIvovb0oZCwg6Lev57q/5pWw5o2uLCDlpJrot6/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NoZSMnLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibW92aWVfM1xcXCIsXFxuZXh0cmE6IHtcXG4gICAgICAgICAgICBuYW1lOiBwZGZoKGRhdGEsIOagh+mimCksXFxuICAgICAgICAgICAgdXJsOiBwZChkYXRhLCDpk77mjqUpLFxcbiAgICAgICAgICAgIHF6OiBNWV9IT01FXFxuICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfSk7XFxuICAgIHNldFJlc3VsdChkKTtcXG59XFxuXFxuXFxuXFxuZnVuY3Rpb24g5pCc57SiKOWIl+ihqCwg5qCH6aKYLCDpk77mjqUsIOaPj+i/sCwg6K+m5oOFLCDlm77niYcsIOiuv+mXruWktCkge1xcbiAgICB2YXIgZCA9IFtdO1xcbiAgICDorr/pl67lpLQgPSAh6K6/6Zeu5aS0ID8gJycgOiDorr/pl67lpLRcXG4gICAgcGRmYShnZXRSZXNDb2RlKCksIOWIl+ihqCkuZm9yRWFjaChmdW5jdGlvbihkYXRhKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBwZGZoKGRhdGEsIOagh+mimCksXFxuICAgICAgICAgICAgZGVzYzogcGRmaChkYXRhLCDmj4/ov7ApLFxcbiAgICAgICAgICAgIHBpY191cmw6IHBkKGRhdGEsIOWbvueJhykgKyBcXFwiQFJlZmVyZXI9XFxcIiArIOiuv+mXruWktCxcXG4gICAgICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5I2ltbWVyc2l2ZVRoZW1lIyNhdXRvQ2FjaGUjJyxcXG4gICAgICAgICAgICBjb250ZW50OiBwZGZoKGRhdGEsIOivpuaDhSksXFxuXFxuZXh0cmE6IHtcXG4gICAgICAgICAgICBuYW1lOiBwZGZoKGRhdGEsIOagh+mimCksXFxuICAgICAgICAgICAgdXJsOiBwZChkYXRhLCDpk77mjqUpLFxcbiAgICAgICAgICAgIHF6OiBNWV9IT01FXFxuICAgICAgICB9XFxuICAgICAgICB9KT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Oi3r+e6v1xcbi8vVUEgIOS4jeWhq+WImeS9v+eUqOaJi+acuuerryAgJ1BDJ+WImeaJi+acuuerr1xcblxcbmlmICjlvZPliY3pobXlkI0pIHtcXG4gICAgc2V0UGFnZVRpdGxlKOW9k+WJjemhteWQjSlcXG59XFxuXFxuaWYo6Ziy6YeN6L295ZCmKXtcXG4vL+e9kemhteWGheWuuSvpmLLmraLph43mi4lcXG4gICAgdmFyIGNvZGUgPSDmt7vliqDpmLLmraLnvZHpobUo5b2T5YmNVVJMLCBVQSlcXG59ZWxzZXtcXG4gICAgdmFyIGNvZGUgPSBnZXRDb2RlKClcXG59XFxuICAgIFxcblxcbiAgICAvL+WktOmDqOWIl+ihqOaVsOaNrlxcbiAgICB2YXIg5aS06YOoID0gIeWktOmDqOWIl+ihqCA/IGNvZGUgOiBwZGZhKGNvZGUsIOWktOmDqOWIl+ihqClbMF07XFxuICAgIOagh+mimCA9IHBkZmgo5aS06YOoLCDmoIfpopgpXFxuICAgIOWbvueJhyA9IHBkZmgo5aS06YOoLCDlm77niYcpfHzlm77niYdcXG4gICAgaWYgKOWbvueJhykge1xcbiAgICAgICAg5Zu+54mHID0g5Zu+54mHLmluY2x1ZGVzKCdodHRwJykgPyDlm77niYcgOiDliY3nvIAgKyDlm77niYdcXG4gICAgICAgIGlmICgh6K6/6Zeu5aS0KSB7fSBlbHNlIGlmICjorr/pl67lpLQuc3Vic3RyKDAsIDEpID09ICdAJykge1xcbiAgICAgICAgICAgIOWbvueJhyA9IOWbvueJhyArIOiuv+mXruWktFxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICDlm77niYcgPSDlm77niYcgKyBcXFwiQFJlZmVyZXI9XFxcIiArIOiuv+mXruWktFxcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIFxcblxcbuaPj+i/sCA9IOaPj+i/sC5pbmNsdWRlcygnJCcpID8g5o+P6L+wLnNwbGl0KCckJylbMV0gKyBwZGZoKOWktOmDqCwg5o+P6L+wLnNw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FxcXCJf57q/6LevXFxcIiArIHhsaWRcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBwdXRNeVZhcihNWV9VUkwsIGlkKVxcbiAgICAgICAgICAgIHZhciDnq6DoioIgPSBsaXN0c1tnZXRNeVZhcihNWV9VUkwsICcwJyldO1xcbiAgICAgICAgICAgIGlmICjmjpLluo8gPT0gJyNGRjAwMDBcXFwiPuWAkuW6jycpIHtcXG4gICAgICAgICAgICAgICAg56ug6IqCLnJldmVyc2UoKVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgY3AgPSDnq6DoioIubWFwKChkYXRhLCBzc2lkKSA9PiB7XFxuICAgICAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChkYXRhLCAnYSYmVGV4dCcpLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBwZChkYXRhLCAnYSYmaHJlZicpICsgbGF6eSxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8yJyxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBNWV9VUkwgKyBcXFwiX+mAiembhlxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfTtcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICBkZWxldGVJdGVtQnlDbHMoTVlfVVJMICsgXFxcIl/pgInpm4ZcXFwiKTtcXG4gICAgICAgICAgICBhZGRJdGVtQmVmb3JlKE1ZX1VSTCArIFxcXCJmb290ZXJcXFwiLCBjcCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSwgdGFicywgbGF6eSwgaWQpLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X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29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIua8q+eUu+ino+aekCpcIixcInBhdGhcIjpcImpzXCIsXCJydWxlXCI6XCJmdW5jdGlvbiDniLHnsbPmjqjnsbsoaW5wdXQpIHtcXG4gICAgdHJ5IHtcXG4gICAgICAgIHZhciB1cmwgPSBpbnB1dFxcbiAgICAgICAgICAgIC5yZXBsYWNlKCdtLicgfHwgJ21oLicgfHwgJ3dhcC4nLCAnd3d3LicpXFxuICAgICAgICAgICAgLnJlcGxhY2UoJ2lrci4nLCAnaWNla3IuJyk7XFxuICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3QodXJsLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAnVXNlci1BZ2VudCc6IFBDX1VBLFxcbiAgICAgICAgICAgICAgICAnUmVmZXJlcic6IHVybFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBldmFsKHBkZmgocGRmYShodG1sLCAnYm9keSYmc2NyaXB0Om5vdChbc3JjXSk6bm90KFt0eXBlXSknKVswXSwgJ3NjcmlwdCYmSHRtbCcpKTtcXG4gICAgICAgIHZhciBwaWNzID0gW107XFxuICAgICAgICBpZiAoY2hhcHRlckltYWdlcy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgdmFyIGhvc3QgPSByZXF1ZXN0KGlucHV0KS5tYXRjaCgvaW1nIHNyYz1cXFwiKC4qPylcXFxcL2ltYWdlLylbMV07XFxuICAgICAgICAgICAgY2hhcHRlckltYWdlcy5mb3JFYWNoKGltZyA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChpbWcuaW5kZXhPZihcXFwiaHR0cFxcXCIpID4gLTEpIHtcXG4gICAgICAgICAgICAgICAgICAgIHBpY3MucHVzaChpbWcgKyAnQFJlZmVyZXI9JyArIHVybClcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIHBpY3MucHVzaChob3N0ICsgaW1nICsgJ0BSZWZlcmVyPScgKyB1cmwpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICB2YXIgaHRtbCA9IHJlcXVlc3QoaW5wdXQpO1xcbiAgICAgICAgICAgIHZhciBwaWNzID0gW107XFxuICAgICAgICAgICAgaWYgKC9rX3RvdGFsLy50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgIHZhciBQYWdlID0gcGRmaChodG1sLCAnI2tfdG90YWwmJlRleHQnKTtcXG4gICAgICAgICAgICAgICAgaWYgKFBhZ2UubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGhvc3QgPSBodG1sLm1hdGNoKC9taXAtaW1nIHNyYz1cXFwiKC4qPylpbWFnZS8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBQYWdlOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNzLnB1c2goaG9zdCArICdpbWFnZS92aWV3LycgKyBpbnB1dC5tYXRjaCgvXFxcXGQrLylbMF0gKyAnLycgKyBpICsgJy53ZWJwJyArICdAUmVmZXJlcj0nKVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIHJlczEgPSB7fTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBkMSA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIGpzSHRtbCA9IGZldGNoKGlucHV0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiY29udGVudC10eXBlXFxcIjogXFxcIlVURi04XFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiTW9iaWxlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiBcXFwiR0VUXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljcyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgZm9yICh2YXIgayA9IDE7OyBrKyspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNIdG1sID0gZmV0Y2goaW5wdXQuc3BsaXQoXFxcIi5odG1sXFxcIilbMF0gKyBcXFwiLVxcXCIgKyBrICsgXFxcIi5odG1sXFxcIiwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJjb250ZW50LXR5cGVcXFwiOiBcXFwiVVRGLThcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJVc2VyLUFnZW50XFxcIjogXFxcIk1vYmlsZVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXCJHRVRcXFwiXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFnZSA9IHBkZmgoanNIdG1sLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwYWdlICYmIHBhZ2UuaW5jbHVkZXMoXFxcIi9cXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZSA9IHBhcnNlSW50KHBhZ2Uuc3BsaXQoXFxcIi9cXFwiKVsxXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNVcmwgPSBwYXJzZURvbUZvckh0bWwoanNIdG1sLCBcXFwiLmVyUGFnJiZtaXAtaW1nfHxpbWcmJnNyY1xcXCIpICsgJ0BSZWZlcmVyPSc7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoanNVcmwuaW5kZXhPZihcXFwicG5nXFxcIikgPiAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJscyA9IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDI7IGkgPD0gcGFnZTsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJscy5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dC5zcGxpdChcXFwiLmh0bWxcXFwiKVswXSArIFxcXCItXFxcIiArIGkgKyBcXFwiLmh0bWxcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcImNvbnRlbnQtdHlwZVxcXCI6IFxcXCJVVEYtOFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiTW9iaWxlXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGhvZDogXFxcIkdFVFxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbHMgPSBiZih1cmxzKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgaHRtbHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNVcmwgPSBwYXJzZURvbUZvckh0bWwoaHRtbHNbaV0sIFxcXCIuZXJQYWcmJm1pcC1pbWd8fGltZyYmc3JjXFxcIikgKyAnQFJlZmVyZXI9JztcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoanNVcmwuaW5kZXhPZihcXFwicG5nXFxcIikgPiAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY3MucHVzaChqc1VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGpzVXJsID0gcGFyc2VEb21Gb3JIdG1sKGpzSHRtbCwgXFxcIi5lclBhZyYmbWlwLWltZ3x8aW1nJiZzcmNcXFwiKSArICdAUmVmZXJlcj0nO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoanNVcmwuaW5kZXhPZihcXFwicG5nXFxcIikgPiAtMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY3MucHVzaChqc1VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICdib2R5JiYuc2Nyb2xsLWl0ZW18fC5pbWFnZS1jb250ZW50fHwjc2Nyb2xsLWltYWdlJyk7XFxuICAgICAgICAgICAgICAgIHZhciBmaXJzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJiNpbWFnZScpO1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gZmlyc3QuY29uY2F0KGxpc3QpO1xcbiAgICAgICAgICAgICAgICBsaXN0LmZvckVhY2goaW1nID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHBpY3MucHVzaChwZGZoKGltZywgJ2ltZyYmZGF0YS1zcmN8fHNyYycpICsgJ0BSZWZlcmVyPScgKyBpbnB1dClcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIHZhciBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICB2YXIgcGljcyA9IFtdO1xcbiAgICAgICAgdmFyIGxpc3QgPSBwZGZhKGh0bWwsICdib2R5JiYuc2Nyb2xsLWl0ZW18fC5pbWFnZS1jb250ZW50fHwjc2Nyb2xsLWltYWdlJyk7XFxuICAgICAgICB2YXIgZmlyc3QgPSBwZGZhKGh0bWwsICdib2R5JiYjaW1hZ2UnKTtcXG4gICAgICAgIGxpc3QgPSBmaXJzdC5jb25jYXQobGlzdCk7XFxuICAgICAgICBsaXN0LmZvckVhY2goaW1nID0+IHtcXG4gICAgICAgICAgICBwaWNzLnB1c2gocGRmaChpbWcsICdpbWcmJmRhdGEtc3JjfHxzcmMnKSArICdAUmVmZXJlcj0nICsgaW5wdXQpXFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIHJldHVybiBcXFwicGljczovL1xcXCIgKyBwaWNzLmpvaW4oXFxcIiYmXFxcIilcXG59XFxuJC5leHBvcnRzLmp4ID0g54ix57Gz5o6o57G7O1xcblxcbmZ1bmN0aW9uIOWMheWtkChpbnB1dCkge1xcbiAgICB2YXIgaWQgPSB0cnVlO1xcbiAgICB2YXIgY29kZSA9IHJlcXVlc3QoaW5wdXQpXFxuICAgIHZhciBwaWNzID0gW107XFxuICAgIHZhciB0b19SZXBlYXQgPSBmYWxzZTtcXG4gICAgdmFyIHdoTGlzdCA9IFtdO1xcbiAgICBcXG5cXG4gICAgd2hpbGUgKGlkKSB7XFxuICAgICAgICBwZGZhKGNvZGUsIFxcXCIuY2hhcHRlci1tYWluJiZhbXAtaW1nXFxcIilcXG4gICAgICAgICAgICAuZm9yRWFjaChkYXRhID0+IHtcXG4gICAgICAgICAgICAgICAgcGljcy5wdXNoKFxcbiAgICAgICAgICAgICAgICAgICAgcGRmaChkYXRhLCBcXFwiYW1wLWltZyYmc3JjXFxcIikgKyAnQFJlZmVyZXI9aHR0cHM6Ly93d3cua3VrdWMuY28vJ1xcbiAgICAgICAgICAgICAgICApXFxuICAgICAgICAgICAgICAgIHdoTGlzdC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHdpZHRoOiBwZGZoKGRhdGEsIFxcXCJhbXAtaW1nJiZ3aWR0aFxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiBwZGZoKGRhdGEsIFxcXCJhbXAtaW1nJiZoZWlnaHRcXFwiKVxcbiAgICAgICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIH0pO1xcblxcblxcbiAgICAgICAgLy9sb2cod2hMaXN0KVxcbiAgICAgICAgdmFyIG5leHRfUGFnZSA9IHBkZmgoY29kZSwgXFxcIi5uZXh0X2NoYXB0ZXIsLTEmJkh0bWxcXFwiKVxcbiAgICAgICAgaWYgKG5leHRfUGFnZS5pbmNsdWRlcygn5LiL5LiA6aG1JykpIHtcXG4gICAgICAgICAgICBjb2RlID0gcmVxdWVzdChwZGZoKG5leHRfUGFnZSwgXFxcImEmJmhyZWZcXFwiKSlcXG4gICAgICAgICAgICB0b19SZXBlYXQgPSB0cnVlO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpZCA9IGZhbHNlO1xcbiAgICAgICAgfVxcbiAgICB9XFxuICAgIC8vbG9nKHBpY3MpXFxuXFxuXFxuICAgIC8v5Y676Zmk6YeN5aSN5Zu+54mHXFxuICAgIGlmICh0b19SZXBlYXQpIHtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGljcy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIHdoaWxlIChwaWNzLmluZGV4T2YocGljc1tpXSwgaSArIDEpICE9IC0xKSB7XFxuICAgICAgICAgICAgICAgIHdoTGlzdC5zcGxpY2UocGljcy5pbmRleE9mKHBpY3NbaV0sIGkgKyAxKSwgMSlcXG4gICAgICAgICAgICAgICAgcGljcy5zcGxpY2UocGljcy5pbmRleE9mKHBpY3NbaV0sIGkgKyAxKSwgMSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgXFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcGljcy5sZW5ndGg7IGkrKyl7XFxuICAgICAgICBpZiAod2hMaXN0W2ldLndpZHRoID09IDEgJiYgd2hMaXN0W2ldLmhlaWdodCA9PSAxKSB7XFxuICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICB9XFxuICAgICAgICBwaWNzW2ldID0gcGlj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AgIHRpdGxlOiAn5pu05paw6K+m5oOFIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuaUtui1tz48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFwiY29sb3I6IzgwODA4MFxcXCI+JyArIGRlc19kZXNjICsgJzwvc3Bhbj4nXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHB1dE15VmFyKFxcXCJqanNcXFwiLCBcXFwi5pS26LW3XFxcIik7XFxuXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICB0aXRsZTogJ+abtOaWsOivpuaDhTxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcImNvbG9yOiMxOUI4OURcXFwiPuWxleW8gD48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXG4gICAgICAgICAgICB9KVxcblxcbiAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcbiAgICAgICAgICAgICAgICA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XG4gICAgZm9yIChsZXQgaSBpbiBrZXlzKSB7XFxuICAgICAgICB0YXJnZXRba2V5c1tpXV0gPSBzb3VyY2Vba2V5c1tpXV1cXG4gICAgfVxcbn1cXG5cXG5mdW5jdGlvbiDmkJzntKIob2JqKSB7XFxuICAgIHZhciBkID0gW107XFxuICAgIGlmICgkLnR5cGUob2JqKSA9PSBcXFwic3RyaW5nXFxcIikge1xcbiAgICAgICAgb2JqID0gY29udmVydDEob2JqKVxcbiAgICB9XFxuICAgIGlmIChvYmou6KeE5YiZKSB7XFxuICAgICAgICBsZXQgYyA9IGNvbnZlcnQxKG9iai7op4TliJkpXFxuICAgICAgICBtZXJnZShjLCBvYmopXFxuICAgIH1cXG4gICAgbGV0IGFyciA9IHBkZmEoZ2V0UmVzQ29kZSgpLCBvYmou5YiX6KGoKTtcXG4gICAgICAgaWYgKG9iai7liJfooajlpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIGFyciA9IG9iai7pk77mjqXlpITnkIYoYXJyKVxcbiAgICAgICAgfVxcbiAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgb2JqLumTvuaOpSlcXG4gICAgICAgIGlmIChvYmou6ZO+5o6l5aSE55CGICE9IG51bGwpIHtcXG4gICAgICAgICAgICB1cmwgPSBvYmou6ZO+5o6l5aSE55CGKHVybClcXG4gICAgICAgIH1cXG4gICAgICAgIGxldCB0aXRsZSA9IHBkZmgoaXQsIG9iai7moIfpopgpXFxuICAgICAgICBpZiAob2JqLuagh+mimOWkhOeQhiAhPSBudWxsKSB7XFxuICAgICAgICAgICAgdGl0bGUgPSBvYmou5qCH6aKY5aSE55CGKHRpdGxlKVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHBpYyA9IHBkKGl0LCBvYmou5Zu+54mHKVxcbiAgICAgICAgaWYgKG9iai7lm77niYflpITnkIYgIT0gbnVsbCkge1xcbiAgICAgICAgICAgIHBpYyA9IG9iai7lm77niYflpITnkIYocGljKVxcbiAgICAgICAgfVxcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogb2JqLuagh+mimCA/IHBkZmgoaXQsIG9iai7moIfpopgpIDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgdXJsOiB1cmwrJyNhdXRvQ2FjaGUjJyxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcIlxcXCIsXFxuICAgICAgICAgICAgZGVzYzogb2JqLuaPj+i/sCA/IHBkZmgoaXQsIG9iai7mj4/ov7ApIDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgY29udGVudDogb2JqLuivpuaDhSA/IHBkZmgoaXQsIG9iai7or6bmg4UpIDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogcGljLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIHl0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHlwaWM6IHBpYyxcXG4gICAgICAgICAgICAgICAgeXVybDogdXJsLnJlcGxhY2UoJ2hpa2VyOi8vZW1wdHkjIycsJycpXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpO1xcbn1cXG52YXIgdG9vbCA9IHtcXG4gICAg5pCc57SiOiDmkJzntKJcXG59XFxuJC5leHBvcnRzID0gdG9vbFwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5Zu+54mH6Kej5a+GKlwiLFwicGF0aFwiOlwiaW1nREVTXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMuaW1nRGVjcnlwdCA9IGZ1bmN0aW9uKCkge1xcbiAgICB2YXIgamF2YUltcG9ydCA9IG5ldyBKYXZhSW1wb3J0ZXIoKTtcXG4gICAgamF2YUltcG9ydC5pbXBvcnRQYWNrYWdlKFxcbiAgICAgICAgUGFja2FnZXMuY29tLmV4YW1wbGUua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ICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIGlmIChKU09OLnBhcnNlKHJlcykuc3RhdHVzQ29kZSA9PSAyMDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmlsZUV4aXN0KHVybCkpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVpcmVEb3dubG9hZChyZXF1aXJlbGlzdFtpXSArICdEcmVhbU96Ty9KTS9tYWluL0pNJyx1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHJlcXVpcmVsaXN0W2ldICsgJ0RyZWFtT3pPL0pNL21haW4vSk0nLHVybClcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHt9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxuICAgICAgICAgICAgYmFjayhmYWxzZSlcXG4gICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v5bey5pu05pawJ1xcbiAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgIGltZzogJ2hpa2VyOi8vaW1hZ2VzL2ljb240JyxcXG4gICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xcbiAgICB9XSxcXG4gICAgdXBkYXRlSW50ZXJ2YWwgPSByZWFkRmlsZSgndXBkYXRlSW50ZXJ2YWwnKSB8fCAnMScsXFxuICAgIG5ld1dpbmRvdyA9IHJlYWRGaWxlKCduZXdXaW5kb3cnKSxcXG4gICAgdGFiRm9sZCA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A9ICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgaWYgKGlucHV0ID09ICflpIfku70nKSByZXR1cm4gJCgnaGlrZXI6Ly9maWxlcy90bXAvJyArIFFJTkdfVElUTEUgKyAnX2JhY2t1cC5qc29uJywgJ+i+k+WFpeWkh+S7vei3r+W+hCcpXFxuICAgICAgICAgICAgLmlucHV0KCh1cmwsIHVwZGF0ZUludGVydmFsLCBuZXdXaW5kb3csIHRhYkZvbGQsIGRpc2FibGVDdXN0b20pID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gcmVxdWVzdCh1cmwpLFxcbiAgICAgICAgICAgICAgICAgICAgY3VzdG9tRGF0YSA9IHJlYWRGaWxlKCdjdXN0b21EYXRhJylcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGlucHV0LCBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJbnRlcnZhbDogdXBkYXRlSW50ZXJ2YWwsXFxuICAgICAgICAgICAgICAgICAgICBuZXdXaW5kb3c6IG5ld1dpbmRvdyxcXG4gICAgICAgICAgICAgICAgICAgIHRhYkZvbGQ6IHRhYkZvbGQsXFxuICAgICAgICAgICAgICAgICAgICBkaXNhYmxlQ3VzdG9tOiBkaXNhYmxlQ3VzdG9tLFxcbiAgICAgICAgICAgICAgICAgICAgY3VzdG9tRGF0YTogY3VzdG9tRGF0YSxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzOiBydWxlc1xcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+W3suWkh+S7ve+8jOazqOaEj+iLpeS7k+W6k+S4uuWtkOmhtemdouWImeS4jeWkh+S7vSdcXG4gICAgICAgICAgICB9LCB1cmwsIHVwZGF0ZUludGVydmFsLCBuZXdXaW5kb3csIHRhYkZvbGQsIGRpc2FibGVDdXN0b20pXFxuICAgICAgICBlbHNlIHJldHVybiAkKCdoaWt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bWFsbD7nibnliKvpuKPosKLvvIzlsI/nqIvluo/mj5DkvpvogIXvvJrwn4ia77iPXFxcXG4nXFxuICAgICAgICAvKmRhdGEucmVkdWNlKChzZWxmLCB2KSA9PiB2LmF1dGhvciA/IHNlbGYuY29uY2F0KHYuYXV0aG9yLnNwbGl0KCcmJykpIDogc2VsZiwgW10pXFxuICAgICAgICAuZmlsdGVyKCh2LCBpLCBhcnIpID0+IHYgJiYgYXJyLmluZGV4T2YodikgPT0gaSkuam9pbign44CBJykqLyxcXG4gICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMSdcXG59KVxcblxcbmVsLnB1c2goe1xcbiAgICB0aXRsZTogJ+KAnOKAnOKAneKAnScgKyAn8J+TnScuc21hbGwoKSArICcmbmJzcCDogZrmvKvwn5Su6Ieq5a6a5LmJICZuYnNwJy5ib2xkKCkuZm9udGNvbG9yKCcjNzU3NTc1JykgKyAoZGlzYWJsZUN1c3RvbSA/ICfinYwnIDogJ+KtlScpLnNtYWxsKCksXFxuICAgIHVybDogJChbKGRpc2FibGVDdXN0b20gPyAn5ZCv55SoJyA6ICfnpoHnlKgnKSArICflkIjpm4boh6rlrprkuYknLCAn5riF6Zmk6Ieq5a6a5LmJ5pWw5o2uJywgJ+e8lui+kUpTT04nXSwgMSkuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgIHN3aXRjaCAoaW5wdXQuc2xpY2UoMCwgMikpIHtcXG4gICAgICAgICAgICBjYXNlICfmuIXpmaQnOlxcbiAgICAgICAgICAgICAgICBkZWxldGVGaWxlKCdjdXN0b21EYXRhJylcXG4gICAgICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgICAgICBjYXNlICflkK/nlKgnOlxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnZGlzYWJsZUN1c3RvbScsICcnKVxcbiAgICAgICAgICAgICAgICBicmVha1xcbiAgICAgICAgICAgIGNhc2UgJ+emgeeUq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XG4gICAgc3dpdGNoIChlZGl0TW9kZSkge1xcbiAgICAgICAgY2FzZSAn5ZCv55SoL+emgeeUqCc6XFxuICAgICAgICAgICAgZC50aXRsZSA9ICh2LnZpc2libGUgPyAn8J+foiAgJyA6ICfwn5S0ICAnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgIHJ1bGVzW2ldLnZpc2libGUgPSAhcnVsZXNbaV0udmlzaWJsZVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGVzW2ldLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9kYXRhTG9hZD9ydWxlPScgKyBnZXRNeVZhcignbXlDb2xsZWN0aW9uJyksIHRydWUpXFxuICAgICAgICAgICAgICAgIHJldHVybiAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoZGF0YVtpXSkpXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICB9XFxuICAgIGVsLnB1c2goZClcXG59KSovXFxuXFxuZWwucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwi5pu05pawJuWPjemmiFxcXCIsXFxuICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS9VcCNub1JlZnJlc2gjI25vUmVjb3JkSGlzdG9yeSMjbm9IaXN0b3J5I1xcXCIsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICB2ZXJzaW9uOiBNWV9QQVJBTVMudmVyc2lvbiB8fCBcXFwi6I635Y+W54mI5pys5aSx6LSl77yM6Ieq6KGM5p+l55yLXFxcIlxcbiAgICB9LFxcbiAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiXFxufSk7XFxuXFxuKGRpc2FibGVDdXN0b20gPyBbJ+WvvOWFpea1t+mYlCddIDogWyflkK/nlKgv56aB55SoJywgJ+mHjeaWsOaOkuW6jycsICfmm7TmlLnlm77moIcnLCAn5a+85YWl5rW36ZiUJ10pLmZvckVhY2goKHYpID0+IHtcXG4gICAgZWwucHVzaCh7XFxuICAgICAgICB0aXRsZTogdiA9PSBlZGl0TW9kZSA/ICfigJzigJzigJ3igJ0nICsgdi5ib2xkKCkuZm9udGNvbG9yKCcjMTJiNjY4JykgOiB2LFxcbiAgICAgICAgdXJsOiB2ID09IGVkaXRNb2RlID8gJ2hpa2VyOi8vZW1wdHknIDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgodikgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdlZGl0TW9kZScsIHYpXFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSwgdiksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfNCdcXG4gICAgfSlcXG59KTtcXG5pZihlZGl0TW9kZSA9PT0gJ+WvvOWFpea1t+mYlCcpIHtcXG4gICAgZWwucHVzaCh7XFxuICAgICAgICB0aXRsZTon5pCc57SiJyxcXG4gICAgICAgIGRlc2M6J+i+k+WFpeWwj+eoi+W6j+agh+mimHzlnLDlnYDov5vooYzmkJzntKIuLi4nLFxcbiAgICAgICAgdXJsOiQudG9TdHJpbmcoKCk9PntcXG4gICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOidpbnB1dCcsXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIG9uQ2hhbmdlOiBcXFwicHV0TXlWYXIoJ2ltcG9ydFNlYXJjaEtleScsaW5wdXQpXFxcIixcXG4gICAgICAgICAgICB0aXRsZVZpc2libGU6IHRydWUsXFxuICA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gICAgc3dpdGNoIChlZGl0TW9kZSkge1xcbiAgICAgICAgY2FzZSAn5ZCv55SoL+emgeeUqCc6XFxuICAgICAgICAgICAgZC50aXRsZSA9ICh2LnZpc2libGUgPyAn8J+foiAgJyA6ICfwn5S0ICAnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgIHJ1bGVzW2ldLnZpc2libGUgPSAhcnVsZXNbaV0udmlzaWJsZVxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfph43mlrDmjpLluo8nOlxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SDICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsICctMScpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgfSwgc29ydEZsYWcsIGkpXFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxuICAgICAgICAgICAgZC51cmwgPSAkKHYuaWNvbiB8fCAnJywgJ+i+k+WFpeaWsOWbvuagh+WcsOWdgOaIluminOiJsuS7o+egge+8micpLmlucHV0KChpKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpXS5pY29uID0gaW5wdXRcXG4gICAgICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHJ1bGVzW2ldLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXG4gICAgICAgICAgICBkLnVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShkYXRhW2ldKSk7XFxuICAgICAgICAgICAgYnJlYWtcXG4gICAgfVxcbiAgICBlbC5wdXNoKGQpXFxufSlcXG5zZXRSZXN1bHQoZWwpXCIsXCJncm91cFwiOlwi6IGa5ZCIXCIsXCJ1YVwiOlwibW9iaWxlXCIsXCJwcmVSdWxlXCI6XCJwdXRNeVZhcignbXlDb2xsZWN0aW9uJywgTVlfUlVMRS50aXRsZSlcXG5wdXRNeVZhcigncmVtb3RlVXJsJywgJ2hpa2VyOi8vZmlsZXMvL3J1bGVzL1R6L0pNJylcXG5pZiAocmVxdWVzdCgnaGlrZXI6Ly9ob21lQOacrOWcsOi1hOa6kOeuoeeQhicpID09ICdudWxsJykge1xcbiAgICBjb25maXJtKHtcXG4gICAgICAgIHRpdGxlOiAn5L6d6LWW5qOA5rWLJyxcXG4gICAgICAgIGNvbnRlbnQ6ICfmo4DmtYvliLDnvLrlsJHmqKHmnb/kvp3otZYs6K+35a+85YWlIScsXFxuICAgICAgICBjb25maXJtOiAoKSA9PiB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCLmtbfpmJTop4bnlYzpppbpobXpopHpgZPop4TliJnjgJDmnKzlnLDotYTmupDnrqHnkIbjgJHvv6Vob21lX3J1bGVfdXJ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3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXFxcbiAgICAgICAgICAgICAgICBlbC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ0nICsgbmFtZS5mb250Y29sb3IodGhpcy5jb2xvcikuYm9sZCgpIDogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBzZWxlY3RlZCA9PSBub3cgPyAnaGlrZXI6Ly9lbXB0eScgOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBpZCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiArIGlkLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICAgICAgfSwgdGhpcy5zaWduLCBpZCwgbm93KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgZWwucHVzaCh7IGNvbF90eXBlOiB0aGlzLmJvdW5kYXJ5IH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSxcXFxcbiAgICBpbml0KGNsYXNzT2JqZWN0KSB7XFxcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9PSAnc3RyaW5nJylcXFxcbiAgICAgICAgICAgIGNsYXNzT2JqZWN0LmNsYXNzX25hbWUgPSBjbGFzc09iamVjdC5jbGFzc19uYW1lLnNwbGl0KCcmJylcXFxcbiAgICAgICAgaWYgKHR5cGVvZiBjbGFzc09iamVjdC5j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8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS8nLCAnaHR0cHM6Ly9jZG4uc3RhdGljYWx5LmNvbS9naC8nLCAnaHR0cHM6Ly9naXRodWIuamV2b25zLnZpcC9odHRwczovL3Jhdy5naXRodWJ1c2VyY29udGVudC5jb20vJ11cXFxcbiAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgcmVxdWlyZWxpc3QubGVuZ3RoOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICB0cnkgeyAvL+i/nOeoi+S+nei1lue0ouW8lVxcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcmVzID0gcmVxdWVzdChyZXF1aXJlbGlzdFtpXSArICdEcmVhbU96Ty9KTS9tYWluL0pNJywge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgd2l0aFN0YXR1c0NvZGU6IHRydWVcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKEpTT04ucGFyc2UocmVzKS5zdGF0dXNDb2RlID09IDIwMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZpbGVFeGlzdCh1cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlRmlsZSh1cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWlyZURvd25sb2FkKHJlcXVpcmVsaXN0W2ldICsgJ0RyZWFtT3pPL0pNL21haW4vSk0nLHVybClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXF1aXJlRG93bmxvYWQocmVxdWlyZWxpc3RbaV0gKyAnRHJlYW1Pek8vSk0vbWFpbi9KTScsdXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgICAgICAgIC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GF0YScpXFxcXG4gICAgICAgICAgICAgICAgd3JpdGVGaWxlKGlucHV0LCBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUludGVydmFsOiB1cGRhdGVJbnRlcnZhbCxcXFxcbiAgICAgICAgICAgICAgICAgICAgbmV3V2luZG93OiBuZXdXaW5kb3csXFxcXG4gICAgICAgICAgICAgICAgICAgIHRhYkZvbGQ6IHRhYkZvbGQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRpc2FibGVDdXN0b206IGRpc2FibGVDdXN0b20sXFxcXG4gICAgICAgICAgICAgICAgICAgIGN1c3RvbURhdGE6IGN1c3RvbURhdGEsXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzOiBydWxlc1xcXFxuICAgICAgICAgICAgICAgIH0pKVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/lt7LlpIfku73vvIzms6jmhI/oi6Xku5PlupPkuLrlrZDpobXpnaLliJnkuI3lpIfku70nXFxcXG4gICAgICAgICAgICB9LCB1cmwsIHVwZGF0ZUludGVydmFsLCBuZXdXaW5kb3csIHRhYkZvbGQsIGRpc2FibGVDdXN0b20pXFxcXG4gICAgICAgIGVsc2UgcmV0dXJuICQoJ2hpa2VyOi8vZmlsZXMvdG1wLycgKyBRSU5HX1RJVExFICsgJ19iYWNrdXAuanNvbicsICfovpPlhaXlpIfku73ot6/lvoQnKS5pbnB1dCgodXJsKSA9PiB7XFxcXG4gICAgICAgICAgICBsZXQgeyB1cGRhdGVJbnRlcnZhbCwgbmV3V2luZG93LCB0YWJGb2xkLCBkaXNhYmxlQ3VzdG9tLCBjdXN0b21EYXRhLCBydWxlcyB9ID0gSlNPTi5wYXJzZShyZXF1ZXN0KGlucHV0KSlcXFxcbiAgICAgICAgICAgIHNhdmVGaWxlKCd1cGRhdGVJbnRlcnZhbCcsIHVwZGF0ZUludGVydmFsKVxcXFxuICAgICAgICAgICAgc2F2ZUZp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xlXFxcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXFxcbiAgICAgICAgICAgICAgICBydWxlc1tpXS52aXNpYmxlID0gIXJ1bGVzW2ldLnZpc2libGVcXFxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICB9LCBpKVxcXFxuICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXFxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldE15VmFyKCdzb3J0RmxhZycsICctMScpKVxcXFxuICAgICAgICAgICAgZC50aXRsZSA9IChzb3J0RmxhZyA9PSBpID8gJ/CflIMgICcgOiAnJykgKyBkLnRpdGxlXFxcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdzb3J0RmxhZycsIGkudG9TdHJpbmcoKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxcXG4gICAgICAgICAgICAgICAgfSwgaSlcXFxcbiAgICAgICAgICAgIGVsc2VcXFxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXMuc3BsaWNlKG5ld0luZGV4LCAwLCBydWxlcy5zcGxpY2Uob2xkSW5kZXgsIDEpWzBdKVxcXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgJy0xJylcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICB9LCBzb3J0RmxhZywgaSlcXFxcbiAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxcXG4gICAgICAgICAgICBkLnVybCA9ICQodi5pY29uIHx8ICcnLCAn6L6T5YWl5paw5Zu+5qCH5Zyw5Z2A5oiW6aKc6Imy5Luj56CB77yaJykuaW5wdXQoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzW2ldLmljb24gPSBpbnB1dFxcXFxuICAgICAgICAgICAgICAgIGVsc2VcXFxcbiAgICAgICAgICAgICAgICA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FxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXFxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NvcnRGbGFnJywgaS50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeimgeenu+WKqOWIsOeahOS9jee9ridcXFxcbiAgICAgICAgICAgICAgICB9LCBpKVxcXFxuICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgob2xkSW5kZXgsIG5ld0luZGV4KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignc29ydEZsYWcnLCAnLTEnKVxcXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcXFxuICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgY2FzZSAn5pu05pS55Zu+5qCHJzpcXFxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgoaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBydWxlcyA9IEpTT04ucGFyc2UocmVhZEZpbGUoJ2N1c3RvbURhdGEnKSB8fCAnW10nKVxcXFxuICAgICAgICAgICAgICAgIGlmIChpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaV0uaWNvbiA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcnVsZXNbaV0uaWNvblxcXFxuICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgIH0sIGkpXFxcXG4gICAgICAgICAgICBicmVha1xcXFxuICAgICAgICBjYXNlICflr7zlhaXmtbfpmJQnOlxcXFxuICAgICAgICAgICAgZC51cmwgPSAncnVsZTovLycgKyBiYXNlNjRFbmNvZGUoSlNPTi5zdHJpbmdpZnkoZGF0YVtpXSkpO1xcXFxuICAgICAgICAgICAgYnJlYWtcXFxcbiAgICB9XFxcXG4gICAgZWwucHVzaChkKVxcXFxufSlcXFxcbnNldFJlc3VsdChlbClcXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLpobXpnaLovb3lhaVcXFwiLFxcXCJwYXRoXFxcIjpcXFwiZnJhbWVMb2FkXFxcIixcXFwicnVsZVxcXCI6XFxcImpzOlxcXFxuY29uc3QgUUlOR19USVRMRSA9IGdldE15VmFyKCdteUNvbGxlY3Rpb24nKVxcXFx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gICAgICAgICAgICAgICBwYXJzZURvbShkYXRhLCB2KSA6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgIT0gMykgdiA9IHJ1bkNvZGUodilcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXFxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIHJlcyA9IHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsIHVybDogdXJsLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IGRlc2MsIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIGlmIChyZXMudXJsKSB7XFxcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IHJlSW5kZXggPSByZXMudXJsLmluZGV4T2YoJy5qczonKVxcXFxuICAgICAgICAgICAgICAgIGlmIChyZUluZGV4ID49IDApIHJlcy51cmwgPSByZXMudXJsLnNsaWNlKDAsIHJlSW5kZXgpICsgJy5qczonICsgaGlqYWNrTGF6eVJ1bGUgKyAnOycgKyByZXMudXJsLnNsaWNlKHJlSW5kZXggKyA0KVxcXFxuICAgICAgICAgICAgfSBlbHNlICBpZiAoZGV0YWlsRmluZFJ1bGUpIHtcXFxcbiAgICAgICAgICAgICAgICByZXMuZXh0cmEgPSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogZ2VuRXhVcmwodXJsKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgUlVMRTogYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KE9iamVjdC5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jg5RFxcXFxcXFwiPuaUtui1tz48L3NwYW4+PC9zbWFsbD48L3NtYWxsPidcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFNpemU6IDE0LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBkZWNpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojODA4MDgwXFxcXFxcXCI+JyArIGRlc19kZXNjICsgJy4uLjwvc3Bhbj4nXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXFxcXFwiampzXFxcXFxcXCIsIFxcXFxcXFwi5pS26LW3XFxcXFxcXCIpO1xcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogamppZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiAn566A5LuLIDxzbWFsbD48c21hbGw+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojMTlCODlEXFxcXFxcXCI+5bGV5byAPjwvc3Bhbj48L3NtYWxsPjwvc21hbGw+J1xcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgIHVwZGF0ZUl0ZW0oe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZVNwYWNpbmc6IDMsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IGRlY2lkXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6ICc8c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiM4MDgwODBcXFxcXFxcIj4nICsgZGVzX2Rlc2Muc3Vic3RyKDAsIDMwKSArICcuLi48L3NwYW4+J1xcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgICAgIH0sIE1ZX1JVTEUgKyBcXFxcXFxcIl9qamlkXFxcXFxcXCIsIE1ZX1JVTEUgKyBcXFxcXFxcIl9kZWNpZFxcXFxcXFwiLCBkZXNfZGVzYyksXFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IE1ZX1JVTEUgKyBcXFxcXFxcIl9qamlkXFxcXFxcXCJcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG5cXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU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xpbmUtdGl0bGUnKSkpXFxcXG4gICAgZm9yIChsZXQgaSBpbiBsaXN0KSB7XFxcXG4gICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICBsZXQgbGluZVRpdGxlID0gcGRmaChsaXN0W2ldLCBsaW5lVGl0bGVSdWxlKTtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJyksIGxpbmUwVGl0bGUpID09PSBsaW5lVGl0bGUgPyBcXFxcXFxcIuWIh+aNojrigJjigJhcXFxcXFxcIiArIGxpbmVUaXRsZSArIFxcXFxcXFwiXFxcXFxcXCIgOiBsaW5lVGl0bGUgKyBcXFxcXFxcIuKAmOKAmDrliIfmjaJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgodmFyS2V5LCBsaW5lSW5kZXgsIGxpbmVUaXRsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcih2YXJLZXksIGxpbmVJbmRleC50b1N0cmluZygpKVxcXFxuICAgICAgICAgICAgICAgICAgICAvLyBsb2coTVlfUlVMRS51cmwpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKChNWV9SVUxFLnRpdGxlICsgJyNsaW5lLXRpdGxlJyksIGxpbmVUaXRsZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgbG9nKE1ZX1JVTEUudGl0bGUgKyBnZXRNeVZhcigoTVlfUlVMRS50aXRsZSArICcjbGluZS10aXRsZScpKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJ0b2FzdDovL+W3suWIh+aNouiHs1xcXFxcXFwiICsgbGluZVRpdGxlXFxcXG4gICAgICAgICAgICAgICAgfSwgdmFyS2V5LCBpL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+mimClcXFxcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mKOaOkumZpCkgIT0gJ3VuZGVmaW5lZCcgJiYg5o6S6ZmkICE9ICcnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyBcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiICsgdGl0bGUuZm9udGNvbG9yKOWIhuexu+minOiJsikgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmV3X2NhdGUgPSBbXVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFxcXFxcIjBcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLnRpdGxlLCBKU09OLnN0cmluZ2lmeShuZXdfY2F0ZSkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH0gZWxzZSBpZiAoZm9sZCA9PT0gJzEnKSB7XFxcXG4gICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0ZW0sIOWIhuexu+agh+mimClcXFxcbiAgICAgICAgICAgICAgICBpZiAodHlwZW9mKOaOkumZpCkgIT0gJ3VuZGVmaW5lZCcgJiYg5o6S6ZmkICE9ICcnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlID0gdGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKOaOkumZpCwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIlxcXFxcXFwiKVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZToga2V5LnRvU3RyaW5nKCkgPT09IGNhdGVfdGVtcFtpbmRleF0gPyBcXFxcXFxcIuKAnOKAnOKAneKAnVxcXFxcXFwiICsgdGl0bGUuZm9udGNvbG9yKOWIhuexu+minOiJsikgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKHBkKGl0ZW0sIOWIhuexu+mTvuaOpSkgKyAnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY2F0ZV90ZW1wW3BhcmFtcy5pbmRleF0gPSBwYXJhbXMua2V5LnRvU3RyaW5nKClcXFxcblxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoTVlfUlVMRS50aXRsZSwgSlNPTi5zdHJpbmdpZnkocGFyYW1zLmNhdGVfdGVtcCkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihNWV9SVUxFLnVybCwgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSh0cnVlKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhdGVfdGVtcDogY2F0ZV90ZW1wLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5OiBrZXksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiBwYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcbiAg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yB0aXRsZTpcXFxcXFxcIuagh+mimDFcXFxcXFxcIiwgdXJsOlxcXFxcXFwieHh4XFxcXFxcXCIsIGNvbF90eXBlOlxcXFxcXFwidGV4dF8xXFxcXFxcXCIgfVxcXFxuICAgICAqIEByZXR1cm5zIHtDYXRlZ29yaWVzSGVhZGVyfVxcXFxuICAgICAqL1xcXFxuICAgIGZvbGRMYXlvdXQobGF5b3V0KSB7XFxcXG4gICAgICAgIGlmICh0eXBlb2YgbGF5b3V0ID09PSAnb2JqZWN0Jykge1xcXFxuICAgICAgICAgICAgbGV0IGtleXMgPSBPYmplY3Qua2V5cyhsYXlvdXQpXFxcXG4gICAgICAgICAgICBsZXQgaW5qZWN0SW5kZXggPSBsYXlvdXQuaW5qZWN0SW5kZXggfHwgbGF5b3V0Wyfmipjlj6DmjInpkq7mj5LlhaXooYwnXVxcXFxuICAgICAgICAgICAgaWYgKGxheW91dC50aXRsZSB8fCBsYXlvdXQudXJsIHx8IGxheW91dC5jb2xfdHlwZSB8fCBpbmplY3RJbmRleCkge1xcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBrZXlzW2ldXFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XVtrZXldID0gbGF5b3V0W2tleV07XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcXFxcXCLor7fkvKDlhaXmraPnoa7nmoTmipjlj6DnlYzpnaLlhYPntKDvvIFcXFxcXFxcIilcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIC8vIGluamVjdEluZGV4IOaKmOWPoOaMiemSruaPkuWFpeesrCBpbmplY3RJbmRleCDooYxcXFxcbiAgICA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odXJsUnVsZS5wYXJzZU9wdGlvbikge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBhcnNlRG9tXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFxcXFxcXFwicGRcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBhcnNlRG9tRm9ySHRtbFxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBkZmhcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZSA9IHBhcnNlRG9tRm9ySHRtbDtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodXJsUnVsZVtcXFxcXFxcIuino+aekOaWueazlVxcXFxcXFwiXSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHVybFJ1bGVbXFxcXFxcXCLop6PmnpDmlrnms5VcXFxcXFxcIl0pIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwYXJzZURvbVxcXFxcXFwiOlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBcXFxcXFxcInBkXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwYXJzZURvbUZvckh0bWxcXFxcXFxcIjpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgXFxcXFxcXCJwZGZoXFxcXFxcXCI6XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2UgPSBwYXJzZURvbUZvckh0bWw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlID0gcGFyc2VEb207XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gcGFyc2Uoc3JjLCBtVXJsUnVsZSk7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5kZWFsVXJsKSB7XFxcXG4gICAgICAgICAgICAgICAgdXJsID0gdXJsUnVsZS5kZWFsVXJsKHVybClcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodXJsUnVsZVsn5LqM5qyh5aSE55CGJ10pIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSB1cmxSdWxlWyfkuozmrKHlpITnkIYnXSh1cmwpXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBpZiAodXJsUnVsZS5zdGFydHNXaXRoKFxcXFxcXFwiQGpzOlxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IHRoaXMuZXZhbEpTUnVsZShzcmMsIHVybFJ1bGUpO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB1cmwgPSBwYXJzZURvbShzcmMsIHVybFJ1bGUpO1xcXFxu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0b3J5I1xcXFxcXFwiKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLm1UYWcgKyBwYXJhbXMuVkFSTUFQLkZPTEQsIGdldE15VmFyKHBhcmFtcy5tVGFnICsgcGFyYW1zLlZBUk1BUC5GT0xELCBwYXJhbXMuaXNGb2xkKSA9PT0gJzEnID8gJzAnIDogJzEnKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFnOiBtVGFnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzRm9sZDogdGhpc1tzeW1ib2xNYXAubUZvbGRdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZBUk1BUDogdGhpcy5WQVJNQVBcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IHRoaXNbc3ltYm9sTWFwLm1Gb2xkTGF5b3V0XS5jb2xfdHlwZSB8fCBcXFxcXFxcInNjcm9sbF9idXR0b25cXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKGZvbGRMYXlvdXQpXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgLy/lhbfkvZPliJfooajkuIvnmoTliIbnsbtcXFxcbiAgICAgICAgICAgICAgICBsZXQgc3ViX2NhdGVnb3JpZXMgPSBbXTtcXFxcbiAg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AgICAgICAgIHVybDogJCh1cmwpLmxhenlSdWxlKChwYXJhbXMpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5ld19jYXRlID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBhcmFtcy5pbmRleCA9PT0gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcC5mb3JFYWNoKChjYXRlLCBpbmRleCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19jYXRlLnB1c2goaW5kZXggPT09IDAgPyBwYXJhbXMua2V5LnRvU3RyaW5nKCkgOiBcXFxcXFxcIjBcXFxcXFxcIilcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNhdGVfdGVtcFtwYXJhbXMuaW5kZXhdID0gcGFyYW1zLmtleS50b1N0cmluZygpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuQ0FURUdPUlksIEpTT04uc3RyaW5naWZ5KHBhcmFtcy5pbmRleCA9PT0gMCA/IG5ld19jYXRlIDogcGFyYW1zLmNhdGVfdGVtcCkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLlVSTCwgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKHRydWUpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2F0ZV90ZW1wOiBjYXRlX3RlbXAsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4OiBpbmRleCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVkFSTUFQOiB0aGlzLlZBUk1BUCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFnOiBtVGFnLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrZXk6IGtleSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFnZTogdGhpc1tzeW1ib2xNYXAubVBhZ2VdLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICB0aGlzW3N5bWJvbE1hcC5tTGF5b3V0XS5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImJsYW5rX2Jsb2NrXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh0aGlzW3N5bWJvbE1hcC5tRm9sZF0gPT09ICcwJykge1xcXFxuICAgICAgICAgICAgICAgICAgICBzdWJfY2F0ZWdvcmllcy5mb3JFYWNoKChpdGVtLCBrZXkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0aXRsZSA9IHRoaXMuZ2V0VGl0bGUoaXRlbSwgY2F0ZWdvcnkpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJsID0gdGhpcy5nZXRVcmwoaXRlbSwgY2F0ZWdvcnkpXFxcXG5cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBrZXkudG9TdHJpbmcoKSA9PT0gY2F0ZV90ZW1wW2luZGV4XSA/ICfigJzigJzigJ3igJ08Yj48Zm9udCBjb2xvcj0nICsgdGhpc1tzeW1ib2xNYXAubUNvbG9yXSArICc+JyArIHRpdGxlICsgJyA8L2ZvbnQ+PC9iPicgOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6ICQodXJsKS5sYXp5UnVsZSgocGFyYW1zKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jYXRlX3RlbXBbcGFyYW1zLmluZGV4XSA9IHBhcmFtcy5rZXkudG9TdHJpbmcoKVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKHBhcmFtcy50YWcgKyBwYXJhbXMuVkFSTUFQLkNBVEVHT1JZLCBKU09OLnN0cmluZ2lmeShwYXJhbXMuY2F0ZV90ZW1wKSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIocGFyYW1zLnRhZyArIHBhcmFtcy5WQVJNQVAuVVJMLCBpbnB1dClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UodHJ1ZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXRlX3RlbXA6IGNhdGVfdGVtcCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXg6IGluZGV4LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWQVJNQVA6IHRoaXMuVkFSTUFQLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0YWc6IG1UYWcsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleToga2V5LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlOiB0aGlzW3N5bWJvbE1hcC5tUGFnZV0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJyxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIHRoaXNbc3ltYm9sTWFwLm1MYXlvdXRdLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiYmxhbmtfYmxvY2tcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfVxcXFxuICAgIH0sXFxcXG5cXFxcbiAgICDnlYzpnaIobGF5b3V0KSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLmxheW91dChsYXlvdXQpXFxcXG4gICAgfSxcXFxcbiAgICDliIbnsbvpk77mjqUodHJ1ZVVybCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy50cnVlVXJsKHRydWVVcmwpO1xcXFxuICAgIH0sXFxcXG4gICAg6aG156CBKHBhZ2UpIHtcXFxcbi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ICBpZiAodHlwZW9mIHVybEV4cCA9PT0gJ3N0cmluZycpIHtcXFxcbiAgICAgICAgICAgICAgICB1cmxFeHAgPSBuZXcgUmVnRXhwKHVybEV4cClcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIGlmICh1cmxFeHAudGVzdCh0aGlzLnBhcmFtcy51cmwpKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMucGFyYW1zLmRlYnVnKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxvZyh1cmxFeHAudG9TdHJpbmcoKSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgdHJ1ZV91cmwgPSByZWdPYmouZXhlYygpO1xcXFxuICAgICAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmICh0cnVlX3VybCkge1xcXFxuICAgICAgICAgICAgcmV0dXJuIHRydWVfdXJsO1xcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgcmV0dXJuIHRoaXMucGFyYW1zLnVybFxcXFxuICAgICAgICB9XFxcXG4gICAgfSxcXFxcbiAgICDojrflj5blpITnkIbnu5PmnpwoKSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLmV4ZWMoKVxcXFxuICAgIH0sXFxcXG4gICAg6ZO+5o6lKHVybCkge1xcXFxuICAgICAgICByZXR1cm4gdGhpcy5iYXNlVXJsKHVybClcXFxcbiAgICB9LFxcXFxuICAgIOmhteeggShwYWdlKSB7XFxcXG4gICAgICAgIHJldHVybiB0aGlzLnBhZ2UocGFnZSlcXFxcbiAgICB9LFxcXFxuICAgIOaPkuWFpeaWsOWkhOeQhuinhOWImShyZWdFeHApIHtcXFxcbiAgICAgICAgcmV0dXJuIHRoaXMuYWRkRXh0cmEocmVnRXhwKVxcXFxuICAgIH0sXFxcXG4gICAg6LCD6K+V5qih5byPKCkge1xcXFxuICAgICAgICBy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FxuICAgICAgICBtZXJnZShjLCBvYmopXFxcXG4gICAgfVxcXFxuICAgIGxldCBhcnIgPSBwZGZhKGdldFJlc0NvZGUoKSwgb2JqLuWIl+ihqCk7XFxcXG4gICAgICAgaWYgKG9iai7liJfooajlpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgYXJyID0gb2JqLumTvuaOpeWkhOeQhihhcnIpXFxcXG4gICAgICAgIH1cXFxcbiAgICBmb3IgKGxldCBpdCBvZiBhcnIpIHtcXFxcbiAgICAgICAgbGV0IHVybCA9IHBkKGl0LCBvYmou6ZO+5o6lKVxcXFxuICAgICAgICBpZiAob2JqLumTvuaOpeWkhOeQhiAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICB1cmwgPSBvYmou6ZO+5o6l5aSE55CGKHVybClcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBsZXQgdGl0bGUgPSBwZGZoKGl0LCBvYmou5qCH6aKYKVxcXFxuICAgICAgICBpZiAob2JqLuagh+mimOWkhOeQhiAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICB0aXRsZSA9IG9iai7moIfpopjlpITnkIYodGl0bGUpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IHBpYyA9IHBkKGl0LCBvYmou5Zu+54mHKVxcXFxuICAgICAgICBpZiAob2JqLuWbvueJh+WkhOeQhiAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICBwaWMgPSBvYmou5Zu+54mH5aSE55CGKHBpYylcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6IG9iai7moIfpopggPyBwZGZoKGl0LCBvYmou5qCH6aKYKSA6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6IHVybCsnI2F1dG9DYWNoZSMnLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBkZX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FxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG5cXFxcbiAgICAgICAgdmFyIGJvb2tOYW1lID0gIeWkmui3r+e6v+WQpiA/IOagh+mimCA6IOagh+mimCArICctJyArIOWIl+ihqOWQjVtpXVxcXFxuXFxcXG4gICAgICAgIOeroOiKgmpzb24ucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTog5YiX6KGo5ZCNW2ldLFxcXFxuICAgICAgICAgICAgbGlzdDogZG9MaXN0LFxcXFxuICAgICAgICAgICAgc2pzczoge1xcXFxuICAgICAgICAgICAgICAgIGNoYXB0ZXJMaXN0OiBkb0xpc3QsXFxcXG4gICAgICAgICAgICAgICAgaW5mbzoge1xcXFxuICAgICAgICAgICAgICAgICAgICBib29rTmFtZTogYm9va05hbWUsIC8v5ryr55S75ZCN56ewLFxcXFxuICAgICAgICAgICAgICAgICAgICBydWxlTmFtZTogTVlfUlVMRS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgYm9va1RvcFBpYzog5Zu+54mHLFxcXFxuICAgICAgICAgICAgICAgICAgICBwYXJzZUNvZGU6IGRvd25sb2FkbGF6eSxcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIGRlZmF1bHRWaWV3OiBcXFxcXFxcIjFcXFxcXFxcIlxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbiAgICByZXR1cm4g56ug6IqCanNvblxcXFxufVxcXFxuXFxcXG5cXFxcbmZ1bmN0aW9uIOa3u+WKoOWktOmDqOWIl+ihqChkLCDmoIfpopgsIOWbvueJhywg5o+P6L+wLCDkvZzogIUsIOaXtumXtCwg5YiG57G7LOmhtVVSTCkge1xcXFxuXFxcXG4gICAg5qCH6aKYID0gIeagh+mimCA/ICcnIDog5qCH6aKYICsgJ1xcXFxcXFxcbidcXFxcbiAgICDlm77niYcgPSAh5Zu+54mHID8gJycgOiDlm77niYdcXFxcbi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gamopLFxcXFxuICAgICAgICB1cmw6IGpqdXJsLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJhdmF0YXJcXFxcXFxcIixcXFxcbiAgICAgICAgcGljX3VybDog5Zu+54mHLFxcXFxuICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXFxcXFwiX2J0XFxcXFxcXCJcXFxcbiAgICAgICAgfVxcXFxuICAgIH0pO1xcXFxuXFxcXG4gICAgLy/nroDku4tcXFxcbiAgICBkLnB1c2goe1xcXFxuICAgICAgICB0aXRsZTogamogPT0gXFxcXFxcXCLlt7LmlLbotbdcXFxcXFxcIiA/IG16dGV4dC5yZXBsYWNlKFxcXFxcXFwi566A5LuLXFxcXFxcXCIsIOeugOS7i+WGheWuueaUtikgOiBtenRleHQucmVwbGFjZShcXFxcXFxcIueugOS7i1xcXFxcXFwiLCDnroDku4vlhoXlrrkpLFxcXFxuICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJyaWNoX3RleHRcXFxcXFxcIixcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGlkOiDpobVVUkwgKyBcXFxcXFxcIl9telxcXFxcXFwiXFxcXG4gICAgICAgIH1cXFxcbiAgICB9KTtcXFxcblxcXFxufVxcXFxuXFxcXG5mdW5jdGlvbiDmt7vliqDliJfooajnq6DoioIoZCwg5qCH6aKY5pWw5o2uLCDliJfooajmlbDmja4sIOino+aekOS7o+eggSwg6aG1VVJMLCDlm77niYcpIHtcXFxcblxcXFxuXFxcXG4gICAgLy9k5LiO5aSW55WMZO+8jOS4uuWQjOWGheWtmOWcsOWdgO+8jOS4jeeUqOi/lOWbnlxcXFxuICAgIC8v5qCH6aKY5pWw5o2uICDljbPmoIfpopjlkI3lrZdcXFxcbiAgICAvL+WIl+ihqOaVsOaNruW/hemhu+aYr0pTT04gIOagvOW8j+aYr1t7dGl0bGU6JycsdXJsOicnLH0sLi4uLi5dICDkuJR1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An5q2j5bqPJyA6ICflgJLluo8nO1xcXFxuICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXFxcXFwiX+aOkuW6j1xcXFxcXFwiXFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgdGl0bGU6IOagh+mimOWQjS5yZXBsYWNlKCfot6/nur8nLCDmoIfpopjmlbDmja4pLnJlcGxhY2UoJ+aOkuW6jycsIOaPkOekuilcXFxcbiAgICAgICAgfSlcXFxcblxcXFxuXFxcXG4gICAgICAgIGlmICjmj5DnpLogPT0gJ+WAkuW6jycpIHtcXFxcbiAgICAgICAgICAgIOWIl+ihqOaVsOaNri5yZXZlcnNlKClcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICDliJfooajmlbDmja4uZm9yRWFjaChmdW5jdGlvbihkYXRhLCBzc2lkKSB7XFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogZGF0YS50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IGRhdGEudXJsICsg6Kej5p6Q5Luj56CBLFxcXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiDpobVVUkwgKyBcXFxcXFxcIl/pgInpm4ZcXFxcXFxcIiArIHNzaWRcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSk7XFxcXG5cXFxcblxcXFxuICAgICAgICBwdXRNeVZhcijpobVVUkwgKyBcXFxcXFxcIueroOiKguaOkuW6j1xcXFxcXFwiLCDmj5DnpLopXFxcXG4gICAgICAgIHJldHVybiBcXFxcXFxcImhpa2VyOi8vZW1wdHlcXFxcXFxcIlxcXFxuICAgIH0sIOagh+mimOWQjSwg5qCH6aKY5pWw5o2uLCDliJfooajml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kOWIl+ihqDwvZm9udD4g77yaJyxcXFxcbiAgICAgICAgICAgIHVybDogXFxcXFxcXCJ0b2FzdDovL+eCueaIkeW5suWVpeWRolxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbidcXFxcbiAgICAgICAgfSk7XFxcXG5cXFxcblxcXFxuICAgICAgICDot6/nur/mlbDmja4uZm9yRWFjaChmdW5jdGlvbihkYXRhLCBpZCkge1xcXFxuXFxcXG4gICAgICAgICAgICB2YXIgamp1cmwgPSAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKOmhtVVSTCxpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIHNldEl0ZW0o6aG1VVJMICsgJ+mAieaLqeWIl+ihqCcsaWQrJycpO1xcXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL2VtcHR5XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICB9LOmhtVVSTCxpZCk7XFxcXG5cXFxcbiAgICAgICAgICAgIHZhciDmoIfpopjlkI0gPSBpZCA9PSDpgInmi6nliJfooaggPyDot6/nur/pgInkuK0ucmVwbGFjZSgn6YCJ5LitJywgZGF0YS50aXRsZSkgOiBkYXRhLnRpdGxlO1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTog5qCH6aKY5ZCNLFxcXFxuICAgICAgICAgICAgICAgIHVybDogamp1cmwsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdmbGV4X2J1dHRvbicsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IOmhtVVSTCArIFxcXFxcXFwiX+i3r+e6v1xcXFxcXFwiICsgaWRcXFxcbiAgICAgICAgICAgICAgICB9XF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cXFwiPuWAkuW6jyc7XFxcXG5cXFxcbiAgICAgICAgICAgIOe6v+i3ry5mb3JFYWNoKChkYXRhLCB4bGlkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpZCA9PSB4bGlkID8gJ+KAnOKAnCcgKyBkYXRhICsgJ+KAneKAnScgOiBkYXRhLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IE1ZX1VSTCArIFxcXFxcXFwiX+e6v+i3r1xcXFxcXFwiICsgeGxpZFxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcHV0TXlWYXIoTVlfVVJMLCBpZClcXFxcbiAgICAgICAgICAgIHZhciDnq6DoioIgPSBsaXN0c1tnZXRNeVZhcihNWV9VUkwsICcwJyldO1xcXFxuICAgICAgICAgICAgaWYgKOaOkuW6jyA9PSAnI0ZGMDAwMFxcXFxcXFwiPuWAkuW6jycpIHtcXFxcbiAgICAgICAgICAgICAgICDnq6DoioIucmV2ZXJzZSgpXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBsZXQgY3AgPSDnq6DoioIubWFwKChkYXRhLCBzc2lkKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHBkZmgoZGF0YSwgJ2EmJlRleHQnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBwZChkYXRhLCAnYSYmaHJlZicpICsgbGF6eSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzO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gICAgICAgICAgICAnUmVmZXJlcic6IHVybFxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgICAgICBldmFsKHBkZmgocGRmYShodG1sLCAnYm9keSYmc2NyaXB0Om5vdChbc3JjXSk6bm90KFt0eXBlXSknKVswXSwgJ3NjcmlwdCYmSHRtbCcpKTtcXFxcbiAgICAgICAgdmFyIHBpY3MgPSBbXTtcXFxcbiAgICAgICAgaWYgKGNoYXB0ZXJJbWFnZXMubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgdmFyIGhvc3QgPSByZXF1ZXN0KGlucHV0KS5tYXRjaCgvaW1nIHNyYz1cXFxcXFxcIiguKj8pXFxcXFxcXFwvaW1hZ2UvKVsxXTtcXFxcbiAgICAgICAgICAgIGNoYXB0ZXJJbWFnZXMuZm9yRWFjaChpbWcgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGlmIChpbWcuaW5kZXhPZihcXFxcXFxcImh0dHBcXFxcXFxcIikgPiAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICBwaWNzLnB1c2goaW1nICsgJ0BSZWZlcmVyPScgKyB1cmwpXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGljcy5wdXNoKGhvc3QgKyBpbWcgKyAnQFJlZmVyZXI9JyArIHVybClcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KGlucHV0KTtcXFxcbiAgICAgICAgICAgIHZhciBwaWNzID0gW107XFxcXG4gICAgICAgICAgICBpZiAoL2tfdG90YWwvLnRlc3QoaHRtbCkpIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgUGFnZSA9IHBkZmgoaHRtbCwgJyNrX3RvdGFsJiZUZXh0Jyk7XFxcXG4gICAgICAgICAgICAgICAgaWYgKFBhZ2UubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgaG9zdCA9IGh0bWwubWF0Y2goL21pcC1pbWcgc3JjPVxcXFxcXFwiKC4qPylpbWFnZS8pWzFdO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBpID0gMDsgaSA8IFBhZ2U7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljcy5wdXNoKGhvc3QgKyAnaW1hZ2Uvdmlldy8nICsgaW5wdXQubWF0Y2goL1xcXFxcXFxcZCsvKVswXSArICcvJyArIGkgKyAnLndlYnAnICsgJ0BSZWZlcmVyPScpXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcmVzMSA9IHt9O1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZDEgPSBbXTtcXFxcbiAgICAgICAgICAgICAgICAgICAgdmFyIGpzSHRtbCA9IGZldGNoKGlucHV0LCB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjb250ZW50LXR5cGVcXFxcXFxcIjogXFxcXFxcXCJVVEYtOFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXFxcXFwiVXNlci1BZ2VudFxcXFxcXFwiOiBcXFxcXFxcIk1vYmlsZVxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiBcXFxcXFxcIkdFVFxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcGljcyA9IFtdO1xcXFxuICAgICAgICAgICAgICAgICAgICBmb3IgKHZhciBrID0gMTs7IGsrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNIdG1sID0gZmV0Y2goaW5wdXQuc3BsaXQoXFxcXFxcXCIuaHRtbFxcXFxcXFwiKVswXSArIFxcXFxcXFwiLVxcXFxcXFwiICsgayArIFxcXFxcXFwiLmh0bWxcXFxcXFxcIiwge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcImNvbnRlbnQtdHlwZVxcXFxcXFwiOiBcXFxcXFxcIlVURi04XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFxcXFxcIlVzZXItQWdlbnRcXFxcXFxcIjogXFxcXFxcXCJNb2JpbGVcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRob2Q6IFxcXFxcXFwiR0VUXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgcGFnZSA9IHBkZmgoanNIdG1sLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocGFnZSAmJiBwYWdlLmluY2x1ZGVzKFxcXFxcXFwiL1xcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWdlID0gcGFyc2VJbnQocGFnZS5zcGxpdChcXFxcXFxcIi9cXFxcXFxcIilbMV0pO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIganNVcmwgPSBwYXJzZURvbUZvckh0bWwoanNIdG1sLCBcXFxcXFxcIi5lclBhZyYmbWlwLWltZ3x8aW1nJiZzcmNcXFxcXFxcIikgKyAnQFJlZmVyZXI9JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGpzVXJsLmluZGV4T2YoXFxcXFxcXCJwbmdcXFxcXFxcIikgPiAtMSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgdXJscyA9IFtdO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMjsgaSA8PSBwYWdlOyBpKyspIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybHMucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbnB1dC5zcGxpdChcXFxcXFxcIi5odG1sXFxcXFxcXCIpWzBdICsgXFxcXFxcXCItXFxcXFxcXCIgKyBpICsgXFxcXFxcXCIuaHRtbFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJjb250ZW50LXR5cGVcXFxcXFxcIjogXFxcXFxcXCJVVEYtOFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcXFxcXCJVc2VyLUFnZW50XFxcXFxcXCI6IFxcXFxcXFwiTW9iaWxlXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0aG9kOiBcXFxcXFxcIkdFVFxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbHMgPSBiZih1cmxzKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBodG1scy5sZW5ndGg7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGpzVXJsID0gcGFyc2VEb21Gb3JIdG1sKGh0bWxzW2ldLCBcXFxcXFxcIi5lclBhZyYmbWlwLWltZ3x8aW1nJiZzcmNcXFxcXFxcIikgKyAnQFJlZmVyZXI9JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqc1VybC5pbmRleE9mKFxcXFxcXFwicG5nXFxcXFxcXCIpID4gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY3MucHVzaChqc1VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciBqc1VybCA9IHBhcnNlRG9tRm9ySHRtbChqc0h0bWwsIFxcXFxcXFwiLmVyUGFnJiZtaXAtaW1nfHxpbWcmJnNyY1xcXFxcXFwiKSArICdAUmVmZXJlcj0nO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqc1VybC5pbmRleE9mKFxcXFxcXFwicG5nXFxcXFxcXCIpID4gLTEpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNzLnB1c2goanNVcmwpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVha1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgbGlzdCA9IHBkZmEoaHRtbCwgJ2JvZHkmJi5zY3JvbGwtaXRlbXx8LmltYWdlLWNvbnRlbnR8fCNzY3JvbGwtaW1hZ2UnKTtcXFxcbiAgICAgICAgICAgICAgICB2YXIgZmlyc3QgPSBwZGZhKGh0bWwsICdib2R5JiYjaW1hZ2UnKTtcXFxcbiAgICAgICAgICAgICAgICBsaXN0ID0gZmlyc3QuY29uY2F0KGxpc3QpO1xcXFxuICAgICAgICAgICAgICAgIGxpc3QuZm9yRWFjaChpbWcgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBwaWNzLnB1c2gocGRmaChpbWcsICdpbWcmJmRhdGEtc3JjfHxzcmMnKSArICdAUmVmZXJlcj0nICsgaW5wdXQpXFxcXG4gICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfVxcXFxuICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgdmFyIGh0bWwgPSByZXF1ZXN0KGlucHV0KTtcXFxcb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dGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcXFxuICAgICAgICAgICAgICAgICAgICBpZDogZGVjaWRcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjojODA4MDgwXFxcXFxcXCI+JyArIGRlc19kZXNjICsgJzwvc3Bhbj4nXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwiaGlrZXI6Ly9lbXB0eVxcXFxcXFwiXFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBwdXRNeVZhcihcXFxcXFxcImpqc1xcXFxcXFwiLCBcXFxcXFxcIuaUtui1t1xcXFxcXFwiKTtcXFxcblxcXFxuICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGpqaWRcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5pu05paw6K+m5oOFPHNtYWxsPjxzbWFsbD48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiMxOUI4OURcXFxcXFxcIj7lsZXlvIA+PC9zcGFuPjwvc21hbGw+PC9zbWFsbD4nXFxcXG4gICAgICAgICAgICB9KVxcXFxuXFxcXG4gICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICB0ZXh0U2l6ZTogMTQsXFxcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVTcGFjaW5nOiAzLFxcXFxuICAgICAgICAgICAgICAgICA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HtcXFxcbiAgICAgICAg5YiX6KGoOiBjWzBdLFxcXFxuICAgICAgICDmoIfpopg6IGNbMV0sXFxcXG4gICAgICAgIOmTvuaOpTogY1syXSxcXFxcbiAgICAgICAg5o+P6L+wOiBjWzNdLFxcXFxuICAgICAgICDor6bmg4U6IGNbNF0sXFxcXG4gICAgICAgIOWbvueJhzogY1s1XVxcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuZnVuY3Rpb24gbWVyZ2Uoc291cmNlLCB0YXJnZXQpIHtcXFxcbiAgICBsZXQga2V5cyA9IE9iamVjdC5rZXlzKHNvdXJjZSlcXFxcbiAgICBmb3IgKGxldCBpIGluIGtleXMpIHtcXFxcbiAgICAgICAgdGFyZ2V0W2tleXNbaV1dID0gc291cmNlW2tleXNbaV1dXFxcXG4gICAgfVxcXFxufVxcXFxuXFxcXG5mdW5jdGlvbiDmkJzntKIob2JqKSB7XFxcXG4gICAgdmFyIGQgPSBbXTtcXFxcbiAgICBpZiAoJC50eXBlKG9iaikgPT0gXFxcXFxcXCJzdHJpbmdcXFxcXFxcIikge1xcXFxuICAgICAgICBvYmogPSBjb252ZXJ0MShvYmopXFxcXG4gICAgfVxcXFxuICAgIGlmIChvYmou6KeE5YiZKSB7XFxcXG4gICAgICAgIGxldCBjID0gY29udmVydDEob2JqLuinhOWImSlcXFxcbiAgICAgICAgbWVyZ2UoYywgb2JqKVxcXFxuICAgIH1cXFxcbiAgICBsZXQgYXJyID0gcGRmYShnZXRSZXNDb2RlKCksIG9iai7liJfooagpO1xcXFxuICAgICAgIGlmIChvYmou5YiX6KGo5aSE55CGICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgIGFyciA9IG9iai7pk77mjqXlpITnkIYoYXJyKVxcXFxuICAgICAgICB9XFxcXG4gICAgZm9yIChsZXQgaXQgb2YgYXJyKSB7XFxcXG4gICAgICAgIGxldCB1cmwgPSBwZChpdCwgb2JqLumTvuaOpSlcXFxcbiAgICAgICAgaWYgKG9iai7pk77mjqXlpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgdXJsID0gb2JqLumTvuaOpeWkhOeQhih1cmwpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgbGV0IHRpdGxlID0gcGRmaChpdCwgb2JqLuagh+mimClcXFxcbiAgICAgICAgaWYgKG9iai7moIfpopjlpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgdGl0bGUgPSBvYmou5qCH6aKY5aSE55CGKHRpdGxlKVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGxldCBwaWMgPSBwZChpdCwgb2JqLuWbvueJhylcXFxcbiAgICAgICAgaWYgKG9iai7lm77niYflpITnkIYgIT0gbnVsbCkge1xcXFxuICAgICAgICAgICAgcGljID0gb2JqLuWbvueJh+WkhOeQhihwaWMpXFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBvYmou5qCH6aKYID8gcGRmaChpdCwgb2JqLuagh+mimCkgOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiB1cmwrJyNhdXRvQ2FjaGUjJyxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZGVzYzogb2JqLuaPj+i/sCA/IHBkZmgoaXQsIG9iai7mj4/ov7ApIDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGNvbnRlbnQ6IG9iai7or6bmg4UgPyBwZGZoKGl0LCBvYmou6K+m5oOFKSA6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBwaWNfdXJsOiBwaWMsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIHl0aXRsZTogdGl0bGUsXFxcXG4gICAgICAgICAgICAgICAgeXBpYzogcGljLFxcXFxuICAgICAgICAgICAgICAgIHl1cmw6IHVybC5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