Advertisement
xiaomianao666

邀您一起看:夏日重现

Apr 24th, 2022
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥夏日重现@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcInRleHRfMVwiLFwibmFtZVwiOlwiQ2xhc3NUYWJcIixcInBhdGhcIjpcIkNsYXNzVGFiXCIsXCJydWxlXCI6XCJmdW5jdGlvbiBDbGFzc1RhYihjbGFzc0FycmF5LCBwYXJhbXMpIHtcXG4gICAgT2JqZWN0LmFzc2lnbih0aGlzLCBwYXJhbXMpXFxuICAgIHRoaXMuYXJyID0gY2xhc3NBcnJheS5tYXAodiA9PiB0aGlzLmluaXQodikpXFxuICAgIHRoaXMuc2lnbiA9ICckJyArIE1ZX1JVTEUudGl0bGUgKyAnXycgKyAodGhpcy5uYW1lIHx8ICcnKSArICdfJ1xcbiAgICB0aGlzLmNvbG9yID0gdGhpcy5jb2xvciB8fCAnIzEyYjY2OCdcXG4gICAgdGhpcy5ib3VuZGFyeSA9IHRoaXMuYm91bmRhcnkgfHwgJ2JsYW5rX2Jsb2NrJ1xcbn1cXG5DbGFzc1RhYi5wcm90b3R5cGUgPSB7XFxuICAgIGNvbnN0cnVjdG9yOiBDbGFzc1RhYixcXG4gICAgbG9hZChlbCkge1xcbiAgICAgICAgbGV0IGZvbGRlZCA9IGdldFZhcignZm9sZF8nICsgdGhpcy5zaWduLCAnJylcXG4gICAgICAgIGlmICh0aGlzLmZvbGQpIGVsLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiAn4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcImNvbG9yOiMwNDllZmZcXFwiPicgKyAoZm9sZGVkID8gJ+KWticgOiAn4pa8JyksXFxuICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBmb2xkZWQpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0VmFyKCdmb2xkXycgKyBzaWduLCB7ICcnOiAnVCcsICdUJzogJycgfSBbZm9sZGVkXSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCB0aGlzLnNpZ24sIGZvbGRlZCksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgfSlcXG4gICAgICAgIGxldCBhcnIgPSBmb2xkZWQgPyBbdGhpcy5hcnJbMF1dIDogdGhpcy5hcnJcXG4gICAgICAgIGFyci5mb3JFYWNoKCh2KSA9PiB7XFxuICAgICAgICAgICAgbGV0IHsgaWQsIGNsYXNzX25hbWUsIGNsYXNzX3VybCB9ID0gdixcXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXG4gICAgICAgICAgICBjbGFzc19uYW1lLmZvckVhY2goKG5hbWUsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHVybCA9IGNsYXNzX3VybFtpXSxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXG4gICAgICAgICAgICAgICAgZWwucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogKHNlbGVjdGVkID09IG5vdyA/ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cXFwiY29sb3I6JyArIHRoaXMuY29sb3IgKyAnXFxcIj48Yj4nIDogJycpICsgbmFtZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoc2lnbiwgaWQsIG5vdykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihzaWduICsgaWQsIG5vdylcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiwgbm93KVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBlbC5wdXNoKHsgY29sX3R5cGU6IHRoaXMuYm91bmRhcnkgfSlcXG4gICAgICAgIH0pXFxuICAgIH0sXFxuICAgIGluaXQoY2xhc3NPYmplY3QpIHtcXG4gICAgICAgIGlmICh0eXBlb2YgY2xhc3NPYmplY3QuY2xhc3NfbmFtZSA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc19uYW1lID0gY2xhc3NPYmplY3QuY2xhc3NfbmFtZS5zcGxpdCgnJicpXFxuICAgICAgICBpZiAodHlwZW9mIGNsYXNzT2JqZWN0LmNsYXNzX3VybCA9PSAnc3RyaW5nJylcXG4gICAgICAgICAgICBjbGFzc09iamVjdC5jbGFzc191cmwgPSBjbGFzc09iamVjdC5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QuaW52b2tlKGphdmFDb250ZXh0LCBteUNvbGxlY3Rpb25fZWwsIHBhcmFtMSwgcGFyYW0yLCBwYXJhbTMpXFxuICAgIH1cXG4gICAgc2V0SG9tZVJlc3VsdCA9IHNldFJlc3VsdFxcbiAgICBzZXRTZWFyY2hSZXN1bHQgPSBzZXRSZXN1bHRcXG5cXG4gICAgZXZhbChNWV9SVUxFLmZpbmRfcnVsZS5zbGljZSgzKSlcXG59IGVsc2Uge1xcbiAgICBsZXQgZmluZFJ1bGUgPSBNWV9SVUxFLmZpbmRfcnVsZS5zcGxpdCgnOycpXFxuICAgIHBhcnNlRG9tRm9yQXJyYXkoaW5kZXhIdG1sLCBmaW5kUnVsZS5zaGlmdCgpKS5mb3JFYWNoKChkYXRhKSA9PiB7XFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAg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q29sbGVjdGlvbl9lbCwgcGFyYW0xLCBwYXJhbTIsIHBhcmFtMylcXG4gICAgfVxcbiAgICBzZXRIb21lUmVzdWx0ID0gc2V0UmVzdWx0XFxuICAgIHNldFNlYXJjaFJlc3VsdCA9IHNldFJlc3VsdFxcblxcbiAgICBldmFsKE1ZX1JVTEUuZmluZF9ydWxlLnNsaWNlKDMpKVxcbn0gZWxzZSB7XFxuICAgIGxldCBbXywgZmluZFJ1bGUsIGRldGFpbEZpbmRSdWxlXSA9IE1ZX1JVTEUuZmluZF9ydWxlLm1hdGNoKC9eKC4qPykoPzo9PT4oLiopKT8kLylcXG4gICAgZmluZFJ1bGUgPSBmaW5kUnVsZS5zcGxpdCgnOycpXFxuICAgIHBhcnNlRG9tRm9yQXJyYXkoaW5kZXhIdG1sLCBmaW5kUnVsZS5zaGlmdCgpKS5mb3JFYWNoKChkYXRhKSA9PiB7XFxuICAgICAgICBsZXQgW3RpdGxlLCBpbWcsIGRlc2MsIHVybF0gPSBmaW5kUnVsZS5tYXAoKHYsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgIC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ZWwucHVzaChyZXMpXFxuICAgIH0pXFxuICAgIHNldFJlc3VsdChteUNvbGxlY3Rpb25fZWwpXFxufVxcblwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5bel5YW36ZuGXCIsXCJwYXRoXCI6XCJ1dGlsaXR5XCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSB7XFxuICAgIGRhdGFMb2FkOiBmdW5jdGlvbihzaG93QWxsKSB7XFxuICAgICAgICAvL+ajgOafpemXtOmalO+8jOm7mOiupOS4gOWkqVxcbiAgICAgICAgbGV0IG1pbiA9IDYwICogMjQgKiAxLFxcbiAgICAgICAgICAgIGRhdGEgPSBbXSxcXG4gICAgICAgICAgICB0aW1lID0gcGFyc2VJbnQocmVhZEZpbGUoJ3VwZGF0ZXRpbWUnKSkgfHwgMCxcXG4gICAgICAgICAgICBub3cgPSBuZXcgRGF0ZSgpLmdldFRpbWUoKVxcbiAgICAgICAgaWYgKG5vdyAtIHRpbWUgPiAxMDAwICogNjAgKiBtaW4pIHtcXG4gICAgICAgICAgICBsb2coJ+abtOaWsOS6huaVsOaNricpXFxuICAgICAgICAgICAgLy8g6I635Y+W6L+c56iL5pWw5o2uXFxuICAgICAgICAgICAgbGV0IHVybCA9IGdldEl0ZW0oJ3JlbW90ZVVybCcpXFxuICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgZGF0YSA9IGZldGNoKHVybClcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5zdGFydHNXaXRoKCdoaWtlcjovL3BhZ2UvJykpXFxuICAgICAgICAgICAgICAgICAgICBkYXRhID0gSlNPTi5wYXJzZShkYXRhKS5ydWxlXFxuICAgICAgICAgICAgICAgIGRhdGEgPSBKU09OLnBhcnNlKGRhdGEpXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBkYXRhID0gW11cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZGF0YSA9I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ICAgIHVybFswXSA9IHJ1bkNvZGUodXJsWzBdWzJdICYmIHBhZ2VOdW0gPT0gMSA/IHVybFswXVsyXSA6IHVybFswXVsxXSlcXG4gICAgICAgIGxldCBvcHRpb25zID0geyBoZWFkZXJzOiBoZWFkZXJzLCBtZXRob2Q6IHVybFsxXSB9XFxuICAgICAgICAvLyBwb3N05pa55rOV5pe26L2s5o2i5Y+C5pWwXFxuICAgICAgICBpZiAoL15wb3N0JC9pLnRlc3Qob3B0aW9uc1snbWV0aG9kJ10pKSB7XFxuICAgICAgICAgICAgbGV0IFtvcmlVcmwsIGJvZHldID0gdXJsWzBdLnNwbGl0KCc/JylcXG4gICAgICAgICAgICB1cmxbMF0gPSBvcmlVcmwucmVwbGFjZSgv77yf77yfL2csICc/JylcXG4gICAgICAgICAgICBpZiAoYm9keS5zdGFydHNXaXRoKCdKc29uQm9keT0nKSkgYm9keSA9IGJvZHkuc2xpY2UoOSlcXG4gICAgICAgICAgICBvcHRpb25zWydib2R5J10gPSBib2R5XFxuICAgICAgICB9XFxuICAgICAgICBpZiAodXJsWzJdKSBvcHRpb25zLmhlYWRlcnNbJ0NvbnRlbnQtVHlwZSddID0gJ3RleHQvcGxhaW47Y2hhcnN0PScgKyB1cmxbMl1cXG4gICAgICAgIGlmICh1cmxbM10pIHVybFszXS5tYXRjaCgveyguKil9LylbMV0uc3BsaXQoJyYmJykuZm9yRWFjaCgodikgPT4ge1xcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB2LnNwbGl0KCdAJylcXG4gICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNba2V5XSA9IHJ1bkNvZGUodmFsdWUpXFxuICAgICAgICB9KVxcbiAgICAgICAgLy8g5re75Yqg5YWo5bGAVUFcXG4gICAgICAgIGlmICghb3B0aW9ucy5oZWFkZXJzWydVc2VyLUFnZW50J10pIHtcXG4gICAgICAgICAgICBpZiAoTVlfUlVMRS51YSA9PSAncGMnKVxcbiAgICAgICAgICAgICAgICBvc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gaWYgKHYudXJsLmluY2x1ZGVzKCdAcnVsZT0nKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgW18sIHVybCwgcnVsZV0gPSB2LnVybC5tYXRjaCgvXihbXFxcXHNcXFxcU10qPylAcnVsZT0oW1xcXFxzXFxcXFNdKikkLylcXG4gICAgICAgICAgICAgICAgdi51cmwgPSB1cmxcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSA9IHJ1bGVcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2NvbF90eXBlID0gTVlfUlVMRS5jb2xfdHlwZVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodi51cmwuc3RhcnRzV2l0aCgnaGlrZXI6Ly9wYWdlLycpKSB7XFxuICAgICAgICAgICAgICAgIGlmICh2LnVybC5pbmNsdWRlcygncnVsZT0nKSB8fCAodi5leHRyYSB8fCB7fSkucnVsZSlcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB2XFxuICAgICAgICAgICAgICAgIGxldCBbXywgcGF0aCwgcGFyYW1zXSA9IHYudXJsLnNwbGl0KCcjJylbMF0ubWF0Y2goL15oaWtlcjpcXFxcL1xcXFwvcGFnZVxcXFwvKC4rPykoPzpcXFxcPyguKikpPyQvKSxcXG4gICAgICAgICAgICAgICAgICAgIHN1YlBhZ2UgPSBNWV9SVUxFLnBhZ2VMaXN0LmZpbmQoKHYpID0+IHYucGF0aCA9PSBwYXRoKSxcXG4gICAgICAgICAgICAgICAgICAgIHN1YlVybCA9IChwYXJhbXMgfHwgJycpLnNwbGl0KCcmJykuZmluZCgodikgPT4gdi5zdGFydHNXaXRoKCd1cmw9JykpXFxuICAgICAgICAgICAgICAgIHYudXJsID0gc3ViVXJsID8gc3ViVXJsLnNsaWNlKDQpLnJlcGxhY2UoL++8n++8ny9nLCAnPycpLnJlcGxhY2UoL++8hu+8hi9nLCAnJicpIDogKHYuZXh0cmEgfHwge30pLnVybCB8fCAnaG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hlbWUjJykpIHYudXJsICs9ICcmI2ltbWVyc2l2ZVRoZW1lIydcXG4gICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgfSkpXFxuICAgICAgICBtZXRob2Rfc2V0UmVzdWx0Lmludm9rZShqYXZhQ29udGV4dCwgbXlDb2xsZWN0aW9uX2VsLCBwYXJhbTEsIHBhcmFtMiwgcGFyYW0zKVxcbiAgICB9XFxuICAgIHNldEhvbWVSZXN1bHQgPSBzZXRSZXN1bHRcXG4gICAgc2V0U2VhcmNoUmVzdWx0ID0gc2V0UmVzdWx0XFxuXFxuICAgIGV2YWwoTVlfUlVMRS5maW5kX3J1bGUuc2xpY2UoMykpXFxufSBlbHNlIHtcXG4gICAgbGV0IGZpbmRSdWxlID0gTVlfUlVMRS5maW5kX3J1bGUuc3BsaXQoJzsnKVxcbiAgICBwYXJzZURvbUZvckFycmF5KGluZGV4SHRtbCwgZmluZFJ1bGUuc2hpZnQoKSkuZm9yRWFjaCgoZGF0YSkgPT4ge1xcbiAgICAgICAgbGV0IFt0aXRsZSwgdXJsLCBkZXNjLCBjb250ZW50LCBpbWddID0gZmluZFJ1bGUubWFwKCh2LCBpKSA9PiB7XFxuICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAodiA9PSAnKicpIHJldHVybiAnJ1xcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDQpID9cXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbShkYXRhLCB2KSA6XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VEb21Gb3JIdG1sKGRhdGEsIHYpXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAxKSB2ID0gcnVuQ29kZSh2KVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkgeyByZXR1cm4gJycgfVxcbiAgICAgICAgICAgIH0pLF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ykpXFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgfSwgdilcXG4gICAgICAgICAgICBicmVha1xcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXG4gICAgICAgICAgICBsZXQgc29ydEZsYWcgPSBwYXJzZUludChnZXRWYXIoJ215Q29sbGVjdGlvbi1zb3J0RmxhZycsICctMScpKVxcbiAgICAgICAgICAgIGQudGl0bGUgPSAoc29ydEZsYWcgPT0gaSA/ICfwn5SEICAnIDogJycpICsgZC50aXRsZVxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoJ215Q29sbGVjdGlvbi1zb3J0RmxhZycsIGkudG9TdHJpbmcoKSlcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICd0b2FzdDovL+mAieaLqeimgeenu+WKqOWIsOeahOS9jee9ridcXG4gICAgICAgICAgICAgICAgfSwgaSlcXG4gICAgICAgICAgICBlbHNlXFxuICAgICAgICAgICAgICAgIGQudXJsID0gJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgob2xkSW5kZXgsIG5ld0luZGV4KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJylcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzLnNwbGljZShuZXdJbmRleCwgMCwgcnVsZXMuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXG4gICAgICAgICAgICAgICAgICAgIHNhdmVGaWxlKCdjdXN0b21EYXRhJywgSlNPTi5zdHJpbmdpZnkocnVsZXMpKVxcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdteUNvbGxlY3Rpb24tc29ydEZsYWcnLCAnLTEnKVxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICAgICAgICAgIH0sIHNvcnRGbGFnLCBpKVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICfmm7TmlLnlm77moIcnOlxcbiAgICAgICAgICAgIGQudXJsID0gJCh2Lmljb24gfHwgJycsICfovpPlhaXmlrDlm77moIflnLDlnYDmiJbpopzoibLku6PnoIHvvJonKS5pbnB1dCgocnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJyksXFxuICAgICAgICAgICAgICAgICAgICBpbmRleCA9IHJ1bGVzLmZpbmRJbmRleCgodikgPT4gdi50aXRsZSA9PSBydWxlLnRpdGxlKVxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQpXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpbmRleF0uaWNvbiA9IGlucHV0XFxuICAgICAgICAgICAgICAgIGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBydWxlc1tpbmRleF0uaWNvblxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxuICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXG4gICAgICAgICAgICB9LCB2KVxcbiAgICAgICAgICAgIGJyZWFrXFxuICAgICAgICBjYXNlICflr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ub0hpc3RvcnkjaGlrZXI6Ly9lbXB0eSdgLFxcXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnXFxcXG4gICAgfSlcXFxcbiAgICB2YXIgbGlzdCA9IGxpc3RzW2luZGV4XTtcXFxcblxcXFxuICAgIGlmIChnZXRWYXIoJ3Noc29ydCcpID09ICcxJykge1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IGxpc3QubGVuZ3RoIC0gMTsgaiA+PSAwOyBqLS0pIHtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGFyc2VEb21Gb3JIdG1sKGxpc3Rbal0sICdhJiZUZXh0JykucmVwbGFjZSgv56ysfOmbhnzor51854mIfOacny9nLCAnJyksXFxcXG4gICAgICAgICAgICAgICAgICAgIFxcXFx0dXJsOiBmZnRxKHBhcnNlRG9tKGxpc3Rbal0sICdhJiZocmVmJykpLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogbGlzdC5sZW5ndGggPiA0ID8gJ3RleHRfNScgOiAndGV4dF8yJ1xcXFxuICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9IGNhdGNoIChlKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAn5rKh5pyJ6YCJ6ZuG5ZOf77yM5LiN5L+h54K55Zu+54mH5Y6755yL55yL8J+RgCcsXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgZm9yICh2YXIgaiA9IDA7IGogPCBsaXN0Lmxlbmd0aDsgaisrKSB7XFxcXG4g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ICAgICAgICAgIGlmICh2ID09ICcqJykgcmV0dXJuICcnXFxuICAgICAgICAgICAgICAgICAgICBlbHNlIHYgPSAoaSA9PSAxIHx8IGkgPT0gMykgP1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZURvbUZvckh0bWwoZGF0YSwgdilcXG4gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IDMpIHYgPSBydW5Db2RlKHYpXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7IHJldHVybiAnJyB9XFxuICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgcmVzID0ge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgIHVybDogdXJsLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcbiAgICAgICAgICAgICAgICBpbWc6IGltZyxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IE1ZX1JVTEUuY29sX3R5cGVcXG4gICAgICAgICAgICB9XFxuICAgICAgICBpZiAocmVzLnVybCkge1xcbiAgICAgICAgICAgIGlmIChyZXMudXJsLmluY2x1ZGVzKCdAbGF6eVJ1bGU9JykpIHtcXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9IHJlcy51cmwucmVwbGFjZSgnLmpzOicsICcuanM6XFxcXG5pZihNWV9SVUxFKU9iamVjdC5hc3NpZ24oTVlfUlVMRSwnICsgJC5zdHJpbmdpZnkoeyBwYWdlczogTVlfUlVMRS5wYWdlcywgcGFnZUxpc3Q6IE1ZX1JVTEUucGFnZUxpc3QsIGZpbmRfcnVsZTogJycsIHBhcmFtczogJycgfSkgKyAnKTtNWV9VUkw9XFxcIicgKyBNWV9VUkwgKyAnXFxcIjsnKVxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoZGV0YWlsRmluZFJ1bG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nIgPSBmb2xkZWQgPyBbdGhpcy5hcnJbMF1dIDogdGhpcy5hcnJcXFxcbiAgICAgICAgYXJyLmZvckVhY2goKHYpID0+IHtcXFxcbiAgICAgICAgICAgIGxldCB7IGlkLCBjbGFzc19uYW1lLCBjbGFzc191cmwgfSA9IHYsXFxcXG4gICAgICAgICAgICAgICAgc2VsZWN0ZWQgPSBKU09OLnN0cmluZ2lmeSh0aGlzLmdldENsYXNzKGlkKSlcXFxcbiAgICAgICAgICAgIGNsYXNzX25hbWUuZm9yRWFjaCgobmFtZSwgaSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSBjbGFzc191cmxbaV0sXFxcXG4gICAgICAgICAgICAgICAgICAgIG5vdyA9IEpTT04uc3RyaW5naWZ5KHsgbmFtZTogbmFtZSwgdXJsOiB1cmwgfSlcXFxcbiAgICAgICAgICAgICAgICBlbC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IChzZWxlY3RlZCA9PSBub3cgPyAn4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjonICsgdGhpcy5jb2xvciArICdcXFxcXFxcIj48Yj4nIDogJycpICsgbmFtZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChzaWduLCBpZCwgbm93KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiArIGlkLCBub3cpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRWYXIoc2lnbiwgbm93KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIHRoaXMuc2lnbiwgaWQsIG5vdyksXFxcXG4gICAgICAgICAgICA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JsID0gdXJsXFxcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSA9IHJ1bGVcXFxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfY29sX3R5cGUgPSBNWV9SVUxFLmNvbF90eXBlXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xcXFxuICAgICAgICAgICAgICAgIGlmICh2LnVybC5pbmNsdWRlcygncnVsZT0nKSB8fCAodi5leHRyYSB8fCB7fSkucnVsZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXFxcbiAgICAgICAgICAgICAgICBsZXQgW18sIHBhdGgsIHBhcmFtc10gPSB2LnVybC5zcGxpdCgnIycpWzBdLm1hdGNoKC9eaGlrZXI6XFxcXFxcXFwvXFxcXFxcXFwvcGFnZVxcXFxcXFxcLyguKz8pKD86XFxcXFxcXFw/KC4qKSk/JC8pLFxcXFxuICAgICAgICAgICAgICAgICAgICBzdWJQYWdlID0gTVlfUlVMRS5wYWdlTGlzdC5maW5kKCh2KSA9PiB2LnBhdGggPT0gcGF0aCksXFxcXG4gICAgICAgICAgICAgICAgICAgIHN1YlVybCA9IChwYXJhbXMgfHwgJycpLnNwbGl0KCcmJykuZmluZCgodikgPT4gdi5zdGFydHNXaXRoKCd1cmw9JykpXFxcXG4gICAgICAgICAgICAgICAgdi51cmwgPSBzdWJVcmwgPyBzdWJVcmwuc2xpY2UoNCkucmVwbGFjZSgv77yf77yfL2csICc/JykucmVwbGFjZSgv77yG77yGL2csICcmJykgOiAodi5leHRyYSB8fCB7fSkudXJsIHx8ICdoaWtlcjovL2VtcHR5PycgKyAocGFyYW1zIHx8ICcnKVxcXFxuICAgICAgICAgICAgICAgIE1ZX19SVUxFLmRldGFpbF9maW5kX3J1bGUgPSBzdWJQYWdlLnJ1bGVcXFxcbiAgICAgICAgICAgICAgICB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LCBlbC5tYXAoKHYpID0+IHtcXFxcbiAgICAgICAgICAgIGxldCBNWV9fUlVMRSA9IE9iamVjdC5hc3NpZ24oe30sIE1ZX1JVTEUpXFxcXG4gICAgICAgICAgICB2LmNvbF90eXBlID0gdi5jb2xfdHlwZSB8fCBNWV9SVUxFLmNvbF90eXBlXFxcXG5cXFxcbiAgICAgICAgICAgIGlmICghdi51cmwpIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdlxcXFxuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnVybC5pbmNsdWRlcygnQHJ1bGU9JykpIHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgW18sIHVybCwgcnVsZV0gPSB2LnVybC5tYXRjaCgvXihbXFxcXFxcXFxzXFxcXFxcXFxTXSo/KUBydWxlPShbXFxcXFxcXFxzXFxcXFxcXFxTXSopJC8pXFxcXG4gICAgICAgICAgICAgICAgdi51cmwgPSB1cmxcXFxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfZmluZF9ydWxlID0gcnVsZVxcXFxuICAgICAgICAgICAgICAgIE1ZX19SVUxFLmRldGFpbF9jb2xfdHlwZSA9IE1ZX1JVTEUuY29sX3R5cGVcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodi51cmwuc3RhcnRzV2l0aCgnaGlrZXI6Ly9wYWdlLycpKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHYudXJsLmluY2x1ZGVzKCdydWxlPScpIHx8ICh2LmV4dHJhIHx8IHt9KS5ydWxlKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcXFxuICAgICAgICAgICAgICAgIGxldCBbXywgcGF0aCwgcGFyYW1zXSA9IHYudXJsLnNwbGl0KCcjJylbMF0ubWF0Y2goL15oaWtlcjpcXFxcXFxcXC9cXFxcXFxcXC9wYWdlXFxcXFxcXFwvKC4rPykoPzpcXFxcXFxcXD8oLiopKT8kLyksXFxcXG4gICAgICAgICAgICAgICAgICA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XFxcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHYgPT0gJyonKSByZXR1cm4gJydcXFxcbiAgICAgICAgICAgICAgICAgICAgZWxzZSB2ID0gKGkgPT0gMSB8fCBpID09IDMpID9cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tKGRhdGEsIHYpIDpcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcnNlRG9tRm9ySHRtbChkYXRhLCB2KVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSAzKSB2ID0gcnVuQ29kZSh2KVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdlxcXFxuICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHsgcmV0dXJuICcnIH1cXFxcbiAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgcmVzID0ge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IHVybCxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiBkZXNjLFxcXFxuICAgICAgICAgICAgICAgIGltZzogaW1nLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBNWV9SVUxFLmNvbF90eXBlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIGlmIChyZXMudXJsKSB7XFxcXG4gICAgICAgICAgICBpZiAocmVzLnVybC5pbmNsdWRlcygnQGxhenlSdWxlPScpKSB7XFxcXG4gICAgICAgICAgICAgICAgcmVzLnVybCA9IHJlcy51cmwucmVwbGFjZSgnLmpzOicsICcuanM6XFxcXFxcXFxuaWYoTVlfUlVMRSlPYmplY3QuYXNzaWduKE1ZX1JVTEUsJyArICQuc3RyaW5naWZ5KHsgcGFnZXM6IE1ZX1JVTEUucGFnZXMsIHBhZ2VMaXN0OiBNWV9SVUxFLnBhZ2VMaXN0LCBmaW5kX3J1bGU6ICcnLCBw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55rOV5pe26L2s5o2i5Y+C5pWwXFxcXG4gICAgICAgIGlmICgvXnBvc3QkL2kudGVzdChvcHRpb25zWydtZXRob2QnXSkpIHtcXFxcbiAgICAgICAgICAgIGxldCBbb3JpVXJsLCBib2R5XSA9IHVybFswXS5zcGxpdCgnPycpXFxcXG4gICAgICAgICAgICB1cmxbMF0gPSBvcmlVcmwucmVwbGFjZSgv77yf77yfL2csICc/JylcXFxcbiAgICAgICAgICAgIGlmIChib2R5LnN0YXJ0c1dpdGgoJ0pzb25Cb2R5PScpKSBib2R5ID0gYm9keS5zbGljZSg5KVxcXFxuICAgICAgICAgICAgb3B0aW9uc1snYm9keSddID0gYm9keVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGlmICh1cmxbMl0pIG9wdGlvbnMuaGVhZGVyc1snQ29udGVudC1UeXBlJ10gPSAndGV4dC9wbGFpbjtjaGFyc3Q9JyArIHVybFsyXVxcXFxuICAgICAgICBpZiAodXJsWzNdKSB1cmxbM10ubWF0Y2goL3soLiopfS8pWzFdLnNwbGl0KCcmJicpLmZvckVhY2goKHYpID0+IHtcXFxcbiAgICAgICAgICAgIGxldCBba2V5LCB2YWx1ZV0gPSB2LnNwbGl0KCdAJylcXFxcbiAgICAgICAgICAgIG9wdGlvbnMuaGVhZGVyc1trZXldID0gcnVuQ29kZSh2YWx1ZSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICAgICAgLy8g5re75Yqg5YWo5bGAVUFcXFxcbiAgICAgICAgaWYgKCFvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSkge1xcXFxuICAgICAgICAgICAgaWYgKE1ZX1JVTEUudWEgPT0gJ3BjJylcXFxcbiAgICAgICAgICAgICAgICBvcHRpb25zLmhlYWRlcnNbJ1VzZXItQWdlbnQnXSA9IFBDX1VBXFxcXG4gICAgICAgICAgICBlbHNlIGlmIChNWV9SVUxFLnVhID09ICdtb2JpbGUnKVxcXFxuICAgICAgICAgICAgICAgIG9wdGlvbnMua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XG4gICAgICAgICAgICAgICAgcmV0dXJuIHZcXFxcbiAgICAgICAgICAgIH0gZWxzZSBpZiAodi51cmwuaW5jbHVkZXMoJ0BydWxlPScpKSB7XFxcXG4gICAgICAgICAgICAgICAgbGV0IFtfLCB1cmwsIHJ1bGVdID0gdi51cmwubWF0Y2goL14oW1xcXFxcXFxcc1xcXFxcXFxcU10qPylAcnVsZT0oW1xcXFxcXFxcc1xcXFxcXFxcU10qKSQvKVxcXFxuICAgICAgICAgICAgICAgIHYudXJsID0gdXJsXFxcXG4gICAgICAgICAgICAgICAgTVlfX1JVTEUuZGV0YWlsX2ZpbmRfcnVsZSA9IHJ1bGVcXFxcbiAgICAgICAgICAgICAgICBNWV9fUlVMRS5kZXRhaWxfY29sX3R5cGUgPSBNWV9SVUxFLmNvbF90eXBlXFxcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudXJsLnN0YXJ0c1dpdGgoJ2hpa2VyOi8vcGFnZS8nKSkge1xcXFxuICAgICAgICAgICAgICAgIGlmICh2LnVybC5pbmNsdWRlcygncnVsZT0nKSB8fCAodi5leHRyYSB8fCB7fSkucnVsZSlcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHZcXFxcbiAgICAgICAgICAgICAgICBsZXQgW18sIHBhdGgsIHBhcmFtc10gPSB2LnVybC5zcGxpdCgnIycpWzBdLm1hdGNoKC9eaGlrZXI6XFxcXFxcXFwvXFxcXFxcXFwvcGFnZVxcXFxcXFxcLyguKz8pKD86XFxcXFxcXFw/KC4qKSk/JC8pLFxcXFxuICAgICAgICAgICAgICAgICAgICBzdWJQYWdlID0gTVlfUlVMRS5wYWdlTGlzdC5maW5kKCh2KSA9PiB2LnBhdGggPT0gcGF0aCksXFxcXG4gICAgICAgICAgICAgICAgICAgIHN1YlVybCA9IChwYXJhbXMgfHwgJycpLnNwbGl0KCcmJykuZmluZCgodikgPT4gdi5zdGFydHNXaXRoKCd1cmw9JykpXFxcXG4gICAgICAgICAgICAgICAgdi51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AgICBjYXNlICflkK/nlKgv56aB55SoJzpcXFxcbiAgICAgICAgICAgIGQudGl0bGUgPSAodi52aXNpYmxlID8gJ/Cfn6IgICcgOiAn8J+UtCAgJykgKyBkLnRpdGxlXFxcXG4gICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKHJ1bGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJyksXFxcXG4gICAgICAgICAgICAgICAgICAgIGluZGV4ID0gcnVsZXMuZmluZEluZGV4KCh2KSA9PiB2LnRpdGxlID09IHJ1bGUudGl0bGUpXFxcXG4gICAgICAgICAgICAgICAgcnVsZXNbaW5kZXhdLnZpc2libGUgPSAhcnVsZXNbaW5kZXhdLnZpc2libGVcXFxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICB9LCB2KVxcXFxuICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgY2FzZSAn6YeN5paw5o6S5bqPJzpcXFxcbiAgICAgICAgICAgIGxldCBzb3J0RmxhZyA9IHBhcnNlSW50KGdldFZhcignbXlDb2xsZWN0aW9uLXNvcnRGbGFnJywgJy0xJykpXFxcXG4gICAgICAgICAgICBkLnRpdGxlID0gKHNvcnRGbGFnID09IGkgPyAn8J+UhCAgJyA6ICcnKSArIGQudGl0bGVcXFxcbiAgICAgICAgICAgIGlmIChzb3J0RmxhZyA9PSAtMSlcXFxcbiAgICAgICAgICAgICAgICBkLnVybCA9ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0VmFyKCdteUNvbGxlY3Rpb24tc29ydEZsYWcnLCBpLnRvU3RyaW5nKCkpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKGZhbHNlKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ3RvYXN0Oi8v6YCJ5oup6KaB56e75Yqo5Yiw55qE5L2N572uJ1xcXFxuICAgICAgICAgICAgICAgIH0sIGkpXFxcXG4gICAgICAgICAgICBlbHNlXFxcXG4gICAgICAgICAgICAgICAgZC51cmwgPSAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChvbGRJbmRleCwgbmV3SW5kZXgpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHJ1bGVzID0gSlNPTi5wYXJzZShyZWFkRmlsZSgnY3VzdG9tRGF0YScpIHx8ICdbXScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJ1bGVzLnNwbGljZShuZXdJbmRleCwgMCwgcnVsZXMuc3BsaWNlKG9sZEluZGV4LCAxKVswXSlcXFxcbiAgICAgICAgICAgICAgICAgICAgc2F2ZUZpbGUoJ2N1c3RvbURhdGEnLCBKU09OLnN0cmluZ2lmeShydWxlcykpXFxcXG4gICAgICAgICAgICAgICAgICAgIHB1dFZhcignbXlDb2xsZWN0aW9uLXNvcnRGbGFnJywgJy0xJylcXFxcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpXFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcXFxcbiAgICAgICAgICAgICAgICB9LCBzb3J0RmxhZywgaSlcXFxcbiAgICAgICAgICAgIGJyZWFrXFxcXG4gICAgICAgIGNhc2UgJ+abtOaUueWbvuaghyc6XFxcXG4gICAgICAgICAgICBkLnVybCA9ICQodi5pY29uIHx8ICcnLCAn6L6T5YWl5paw5Zu+5qCH5Zyw5Z2A5oiW6aKc6Imy5Luj56CB77yaJykuaW5wdXQoKHJ1bGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBsZXQgcnVsZXMgPSBKU09OLnBhcnNlKHJlYWRGaWxlKCdjdXN0b21EYXRhJykgfHwgJ1tdJyksXFxcXG4gICAgICAgICAgICAgICAgICAgIGluZGV4ID0gcnVsZXMuZmluZEluZGV4KCh2KSA9PiB2LnRpdGxlID09IHJ1bGUudGl0bGUpXFxcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0KVxcXFxuICAgICAgICAgICAgICAgICAgICBydWxlc1tpbmRleF0uaWNvbiA9IGlucHV0XFxcXG4gICAgICAgICAgICAgICAgZWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGUgcnVsZXNbaW5kZXhdLmljb25cXFxcbiAgICAgICAgICAgICAgICBzYXZlRmlsZSgnY3VzdG9tRGF0YScsIEpTT04uc3RyaW5naWZ5KHJ1bGVzKSlcXFxcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZShmYWxzZSlcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxcXG4gICAgICAgICAgICB9LCB2KVxcXFxuICAgICAgICAgICAgYnJlYWtcXFxcbiAgICAgICAgY2FzZSAn5a+85YWl5rW36ZiUJzpcXFxcbiAgICAgICAgICAgIGQudXJsID0gJ3J1bGU6Ly8nICsgYmFzZTY0RW5jb2RlKEpTT04uc3RyaW5naWZ5KGRhdGFbaV0pKVxcXFxuICAgICAgICAgICAgYnJlYWtcXFxcbiAgICB9XFxcXG4gICAgZWwucHVzaChkKVxcXFxufSlcXFxcbnNldFJlc3VsdChlbClcXFxcblxcXCJ9XVwifSIsInBpY1VybCI6Imh0dHBzOi8vd29sb25nenl3Y2RuLmNvbTo2NS91cGxvYWQvdm9kLzIwMjIwNDE2LTEvOTZhNzUxMmQwY2E5MmE5YzA2MjRkYzRlYTFmNjkyNjkud2VicCIsInRpdGxlIjoi5aSP5pel6YeN546wIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement