Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@MV合集@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiTVblkIjpm4YiLCJhdXRob3IiOiLlsI/mo4noooTwn4yeJuawuOi/nOOBruaYjuaXpSIsInVybCI6Imhpa2VyOi8vZW1wdHkiLCJ2ZXJzaW9uIjo3NiwiY29sX3R5cGUiOiJpY29uXzJfcm91bmQiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6Im90aGVyIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG5jb25zdCB7IGRhdGFMb2FkIH0gPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS91dGlsaXR5P3J1bGU9JyArIGdldEl0ZW0oJ215Q29sbGVjdGlvbicpKVxubGV0IGVsID0gW3tcbiAgICB0aXRsZTogJyAnICsgZ2V0SXRlbSgnbXlDb2xsZWN0aW9uJykuYm9sZCgpICsgJyAmbmJzcCAmbmJzcCAnICsgJ+KamSDovbvlkIjpm4borr7nva4g4pqZJy5zbWFsbCgpLFxuICAgIHVybDogJ2hpa2VyOi8vcGFnZS9Db25maWc/cnVsZT0nICsgZ2V0SXRlbSgnbXlDb2xsZWN0aW9uJyksXG4gICAgaW1nOiBNWV9SVUxFLmljb24gfHwgJ2hpa2VyOi8vaW1hZ2VzL2ljb24xJyxcbiAgICBjb2xfdHlwZTogJ2F2YXRhcidcbn0sIHtcbiAgICB1cmw6ICdcImhpa2VyOi8vc2VhcmNoP3M9XCIraW5wdXQrXCImcnVsZT0nICsgZ2V0SXRlbSgnbXlDb2xsZWN0aW9uJykgKyAnXCInLFxuICAgIGRlc2M6ICfmkJzkvaDmg7Pop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HkobXlDb2xsZWN0aW9uX2VsLCBlbC5tYXAoKHYpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IE1ZX19SVUxFID0gT2JqZWN0LmFzc2lnbih7fSwgTVlfUlVMRSwgeyB0aXRsZTogUlVMRS50aXRsZSB9KVxuICAgICAgICAgICAgICAgICAgICB2LmRlc2MgPSBSVUxFLnRpdGxlICsgJyDilqogJyArICh2LmRlc2MgfHwgJycpXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCF2LnVybCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQHJ1bGU9JykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBbXywgdXJsLCBydWxlXSA9IHYudXJsLm1hdGNoKC9eKFtcXHNcXFNdKj8pQHJ1bGU9KFtcXHNcXFNdKikkLylcbiAgICAgICAgICAgICAgICAgICAgICAgIHYudXJsID0gdXJsXG4gICAgICAgICAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gcnVsZVxuICAgICAgICAgICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2NvbF90eXBlID0gTVlfUlVMRS5jb2xfdHlwZVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHYudXJsLmluY2x1ZGVzKCdydWxlPScpIHx8ICh2LmV4dHJhIHx8IHt9KS5ydWxlKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgW18sIHBhdGgsIHBhcmFtc10gPSB2LnVybC5zcGxpdCgnIycpWzBdLm1hdGNoKC9eaGlrZXI6XFwvXFwvcGFnZVxcLyguKz8pKD86XFw/KC4qKSk/JC8pLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1YlBhZ2UgPSBNWV9SVUxFLnBhZ2VMaXN0LmZpbmQoKHYpID0+IHYucGF0aCA9PSBwYXRoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWJVcmwgPSAocGFyYW1zIHx8ICcnKS5zcGxpdCgnJicpLmZpbmQoKHYpID0+IHYuc3RhcnRzV2l0aCgndXJsPScpKVxuICAgICAgICAgICAgICAgICAgICAgICAgdi51cmwgPSBzdWJVcmwgPyBzdWJVcmwuc2xpY2UoNCkucmVwbGFjZSgv77yf77yfL2csICc/JykucmVwbGFjZSgv77yG77yGL2csICcmJykgOiAodi5leHRyYSB8fCB7fSkudXJsIHx8ICdoaWtlcjovL2VtcHR5PycgKyAocGFyYW1zIHx8ICcnKVxuICAgICAgICAgICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSA9IHN1YlBhZ2UucnVsZVxuICAgICAgICAgICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2NvbF90eXBlID0gc3ViUGFnZS5jb2xfdHlwZVxuICAgICAgICAgICAgICAgICAgICAgICAgTVlfX1JVTEUucGFyYW1zID0gdi5leHRyYSB8fCB7fVxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYudXJsID0gdi51cmwucmVwbGFjZSgnLmpzOicsICcuanM6XFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsJyArICQuc3RyaW5naWZ5KHsgcGFnZXM6IE1ZX1JVTEUucGFnZXMsIHBhZ2VMaXN0OiBNWV9SVUxFLnBhZ2VMaXN0LCBmaW5kX3J1bGU6ICcnLCBwYXJhbXM6ICcnIH0pICsgJyk7TVlfVVJMPVwiJyArIE1ZX1VSTCArICdcIjsnKVxuICAg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jLCBjb250ZW50LCBpbWddID0gZmluZFJ1bGUubWFwKCh2LCBpKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDQpID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb20oZGF0YSwgdikgOlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAxKSB2ID0gcnVuQ29kZSh2KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB2XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XG4gICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICByZXMgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IHVybCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IFJVTEUudGl0bGUgKyAnIOKWqiAnICsgZGVzYyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IGNvbnRlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBpbWc6IGltZ1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKHJlcy51cmwpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IE1ZX19SVUxFID0gT2JqZWN0LmFzc2lnbih7fSwgTVlfUlVMRSwgeyB0aXRsZTogUlVMRS50aXRsZSB9KVxuICAgICAgICAgICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7X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G9yOiMwNDllZmZcXFwiPicgKyAoZm9sZGVkID8gJ+KWticgOiAn4pa8JyksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBmb2xkZWQpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdmb2xkXycgKyBzaWduLCB7ICcnOiAnVCcsICdUJzogJycgfSBbZm9sZGVkXSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGZvbGRlZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgICAgIGxldCBhcnIgPSBmb2xkZWQgPyBbdGhpcy5hcnJbMF1dIDogdGhpcy5hcnJcXG4gICAgICAgIGFyci5mb3JFYWNoKCh2KSA9PiB7XFxuICAgICAgICAgICAgbGV0IHsgaWQsIGNsYXNzX25hbWUsIGNsYXNzX3VybCB9ID0gdixcXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogKHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6JyArIHRoaXMuY29sb3IgKyAnXFxcIj48Yj4nIDogJycpICsgbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBlbC5wdXNoKHsgY29sX3R5cGU6IHRoaXMuYm91bmRhcnkgfSlcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIGluaXQoY2xhc3NPYmplY3QpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc19uYW1lID0gY2xhc3NPYmplY3QuY2xhc3NfbmFtZS5zcGxpdCgnJicpXFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX3VybCA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc191cmwgPSBjbGFzc09iamVjdC5jbGFzc191cmwuc3BsaXQoJyYnKS5tYXAoKHYpID0+IHYudHJpbSgpKVxcbiAgICAgICAgcmV0dXJuIGNsYXNzT2JqZWN0XFxuICAgIH0sXFxuICAgIHB1c2goY2xhc3NPYmplY3QpIHtcXG4gICAgICAgIHRoaXMuYXJy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1bHQgPSBzZXRSZXN1bHRcXG5cXG4gICAgZXZhbChNWV9SVUxFLmZpbmRfcnVsZS5zbGljZSgzKSlcXG59IGVsc2Uge1xcbiAgICBsZXQgZmluZFJ1bGUgPSBNWV9SVUxFLmZpbmRfcnVsZS5zcGxpdCgnOycpXFxuICAgIHBhcnNlRG9tRm9yQXJyYXkoaW5kZXhIdG1sLCBmaW5kUnVsZS5zaGlmdCgpKS5mb3JFYWNoKChkYXRhKSA9PiB7XFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJs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ldmFsKE1ZX1JVTEUuZmluZF9ydWxlLnNsaWNlKDMpKVxcbn0gZWxzZSB7XFxuICAgIGxldCBbXywgZmluZFJ1bGUsIGRldGFpbEZpbmRSdWxlXSA9IE1ZX1JVTEUuZmluZF9ydWxlLm1hdGNoKC9eKC4qPykoPzo9PT4oLiopKT8kLylcXG4gICAgZmluZFJ1bGUgPSBmaW5kUnVsZS5zcGxpdCgnOycpXFxuICAgIHBhcnNlRG9tRm9yQXJyYXkoaW5kZXhIdG1sLCBmaW5kUnVsZS5zaGlmdCgpKS5mb3JFYWNoKChkYXRhKSA9PiB7XFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICA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1dGlsaXR5XCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSB7XFxuICAgIGRhdGFMb2FkOiBmdW5jdGlvbihzaG93QWxsKSB7XFxuICAgICAgICAvL+ajgOafpemXtOmalO+8jOm7mOiupOS4gOWkqVxcbiAgICAgICAgbGV0IG1pbiA9IDYwICogMjQgKiAxLFxcbiAgICAgICAgICAgIGRhdGEgPSBbXSxcXG4gICAgICAgICAgICB0aW1lID0gcGFyc2VJbnQocmVhZEZpbGUoJ3VwZGF0ZXRpbWUnKSkgfHwgMCxcXG4gICAgICAgICAgICBub3cgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKVxcbiAgICAgICAgaWYgKG5vdyAtIHRpbWUgPiAxMDAwICogNjAgKiBtaW4pIHtcXG4gICAgICAgICAgICBsb2coJ+abtOaWsOS6huaVsOaNricpXFxuICAgICAgICAgICAgLy8g6I635Y+W6L+c56iL5pWw5o2uXFxuICAgICAgICAgICAgbGV0IHVybCA9IGdldEl0ZW0oJ3JlbW90ZVVybCcpXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZGF0YSA9IGZldGNoKHVybClcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5zdGFydHNXaXRoKCdoaWtlcjovL3BhZ2UvJykpXFxuICAgICAgICAgICAgICAgICAgICBkYXRhID0gSlNPTi5wYXJzZShkYXRhKS5ydWxlXFxuICAgICAgICAgICAgICAgIGRhdGEgPSBKU09OLnBhcnNlKGRhdGEpXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBkYXRhID0gW11cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZGF0YSA9IGRhdGEuZmlsdGVyKCh2KSA9PiB7IHJldHVybiB2LnRpdGxlICE9IGdldEl0ZW0oJ215Q29sbGVjdGlvbicpICYmICF2LmF1dGhvci5pbmNsdWRlcygn6L275ZCI6ZuG55Sf5oiQ5ZmoJykgfSlcXG4gICAgICAgICAgIC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VhZGVyczogaGVhZGVycywgbWV0aG9kOiB1cmxbMV0gfVxcbiAgICAgICAgLy8gcG9zdOaWueazleaXtui9rOaNouWPguaVsFxcbiAgICAgICAgaWYgKC9ecG9zdCQvaS50ZXN0KG9wdGlvbnNbJ21ldGhvZCddKSkge1xcbiAgICAgICAgICAgIGxldCBbb3JpVXJsLCBib2R5XSA9IHVybFswXS5zcGxpdCgnPycpXFxuICAgICAgICAgICAgdXJsWzBdID0gb3JpVXJsLnJlcGxhY2UoL++8n++8ny9nLCAnPycpXFxuICAgICAgICAgICAgaWYgKGJvZHkuc3RhcnRzV2l0aCgnSnNvbkJvZHk9JykpIGJvZHkgPSBib2R5LnNsaWNlKDkpXFxuICAgICAgICAgICAgb3B0aW9uc1snYm9keSddID0gYm9keVxcbiAgICAgICAgfVxcbiAgICAgICAgaWYgKHVybFsyXSkgb3B0aW9ucy5oZWFkZXJzWydDb250ZW50LVR5cGUnXSA9ICd0ZXh0L3BsYWluO2NoYXJzdD0nICsgdXJsWzJdXFxuICAgICAgICBpZiAodXJsWzNdKSB1cmxbM10ubWF0Y2goL3soLiopfS8pWzFdLnNwbGl0KCcmJicpLmZvckVhY2goKHYpID0+IHtcXG4gICAgICAgICAgICBsZXQgW2tleSwgdmFsdWVdID0gdi5zcGxpdCgnQCcpXFxuICAgICAgICAgICAgb3B0aW9ucy5oZWFkZXJzW2tleV0gPSBydW5Db2RlKHZhbHVlKVxcbiAgICAgICAgfSlcXG4gICAgICAgIC8vIOa3u+WKoOWFqOWxgFVBXFxuICAgICAgICBpZiAoIW9wdGlvbnMuaGVhZGVyc1snVXNlci1BZ2VudCddKSB7XFxuICAgICAgICAgICAgaWYgKE1ZX1JVTEUudWEgPT0gJ3BjJylcXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5oZWFkZXJzWydVc2VyLUFnZW50J10gPSBQQ19VQVxcbiAgICAgICAgICAgIGVsc2UgaWYgKE1ZX1JVTEUudWEgPT0gJ21vYmlsZScpXFxuICAgICAgIC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dC5pbnZva2UoamF2YUNvbnRleHQsIG15Q29sbGVjdGlvbl9lbCwgcGFyYW0xLCBwYXJhbTIsIHBhcmFtMylcXG4gICAgfVxcbiAgICBzZXRIb21lUmVzdWx0ID0gc2V0UmVzdWx0XFxuICAgIHNldFNlYXJjaFJlc3VsdCA9IHNldFJlc3VsdFxcblxcbiAgICBldmFsKE1ZX1JVTEUuZmluZF9ydWxlLnNsaWNlKDMpKVxcbn0gZWxzZSB7XFxuICAgIGxldCBmaW5kUnVsZSA9IE1ZX1JVTEUuZmluZF9ydWxlLnNwbGl0KCc7JylcXG4gICAgcGFyc2VEb21Gb3JBcnJheShpbmRleEh0bWwsIGZpbmRSdWxlLnNoaWZ0KCkpLmZvckVhY2goKGRhdGEpID0+IHtcXG4gICAgICAgIGxldCBbdGl0bGUsIHVybCwgZGVzYywgY29udGVudCwgaW1nXSA9IGZpbmRSdWxlLm1hcCgodiwgaSkgPT4ge1xcbiAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgPT0gJyonKSByZXR1cm4gJydcXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgdiA9IChpID09IDEgfHwgaSA9PSA0KSA/XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb20oZGF0YSwgdikgOlxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tRm9ySHRtbChkYXRhLCB2KVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGkgIT0gMSkgdiA9IHJ1bkNvZGUodilcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsgcmV0dXJuICcnIH1cXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICByZXMgPSB7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSArICfigJzigJzigJ3igJ08YnI+JyArIChSVUxFLnRpdGxlLmZvbnRjb2xvcignIzEyYjY2OCcpIC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xuZWwucHVzaCh7XFxuICAgIHRpdGxlOiAn8J+UjSDmkJzntKLmqKHlvI86ICcgKyAoc2VhcmNoVGhkID09IDAgPyAn5YiXJyA6ICfogZonICsgc2VhcmNoVGhkKSxcXG4gICAgdXJsOiAkKFsn5YiX6KGo5pCc57SiJywgJ+iBmuWQiOaQnOe0oiddLCAxKS5zZWxlY3QoKHNlYXJjaFRoZCkgPT4ge1xcbiAgICAgICAgaWYgKGlucHV0ID09ICfliJfooajmkJzntKInKSB7XFxuICAgICAgICAgICAgc2F2ZUZpbGUoJ3NlYXJjaFRoZCcsICcwJylcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGlmIChzZWFyY2hUaGQgPT0gMCkgc2VhcmNoVGhkID0gNVxcbiAgICAgICAgICAgIHJldHVybiAkKHNlYXJjaFRoZCwgJ+i+k+WFpeaQnOe0oue6v+eoi++8jOacgOWlveS4jeimgei2hei/hzE2JykuaW5wdXQoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnc2VhcmNoVGhkJywgaW5wdXQpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICB9LCBzZWFyY2hUaGQpLFxcbiAgICBjb2xfdHlwZTogJ3RleHRfMidcXG59LCB7XFxuICAgIHRpdGxlOiAn8J+WpSDni6znq4vpppbpobU6ICcgKyAobmV3V2luZG93ID8gJ+aYrycgOiAn5ZCmJyksXFxuICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgobmV3V2luZG93KSA9PiB7XFxuICAgICAgICBzYXZlRmlsZSgnbmV3V2luZG93JywgbmV3V2luZG93ID8gJycgOiAnMScpXFxuICAgICAgICByZWZyZXNoUGFnZSgpXFxuICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgIH0sIG5ld1dpbmRvdy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FxuICAgICAgICAgICAgYnJlYWtcXG4gICAgICAgIGNhc2UgJ+mHjeaWsOaOkuW6jyc6XFxuICAgICAgICAgICAgbGV0IHNvcnRGbGFnID0gcGFyc2VJbnQoZ2V0VmFyKCdteUNvbGxlY3Rpb24tc29ydEZsYWcnLCAnLTEnKSlcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UhCAgJyA6ICcnKSArIGQudGl0bGVcXG4gICAgICAgICAgICBpZiAoc29ydEZsYWcgPT0gLTEpXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoaSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdteUNvbGxlY3Rpb24tc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAndG9hc3Q6Ly/pgInmi6nopoHnp7vliqjliLDnmoTkvY3nva4nXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxuICAgICAgICAgICAgZWxzZVxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKG9sZEluZGV4LCBuZXdJbmRleCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxuICAgICAgICAgICAgICAgICAgICBydWxlcy5zcGxpY2UobmV3SW5kZXgsIDAsIHJ1bGVzLnNwbGljZShvbGRJbmRleCwgMSlbMF0pXFxuICAgICAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcignbXlDb2xsZWN0aW9uLXNvcnRGbGFnJywgJy0xJylcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgICAgICAgICB9LCBzb3J0RmxhZywgaSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5pu05pS55Zu+5qCHJzpcXG4gICAgICAgICAgICBkLnVybCA9ICQodi5pY29uIHx8ICcnLCAn6L6T5YWl5paw5Zu+5qCH5Zyw5Z2A5oiW6aKc6Imy5Luj56CB77yaJykuaW5wdXQoKHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpLFxcbiAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBydWxlcy5maW5kSW5kZXgoKHYpID0+IHYudGl0bGUgPT0gcnVsZS50aXRsZSlcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcbiAgICAgICAgICAgICAgICAgICAgcnVsZXNbaW5kZXhdLmljb24gPSBpbnB1dFxcbiAgICAgICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcnVsZXNbaW5kZXhdLmljb25cXG4gICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgdilcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXG4gICAgICAgICAgICBkLnVybCA9ICdydWxlOi8vJyArIGJhc2U2NEVuY29kZShKU09OLnN0cmluZ2lmeShkYXRhW2ldKSlcXG4gICAgICAgICAgICBicmVha1xcbiAgICB9XFxuICAgIGVsLnB1c2goZClcXG59KVxcbnNldFJlc3VsdChlbClcXG5cIn1dIiwiaWNvbiI6Imh0dHBzOi8vbGFubWVpZ3VvamlhbmcuY29tL3R1Ymlhby9tdXNpYy8yMy5zdmcifQ==
Add Comment
Please, Sign In to add comment