Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥详情页面@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIumhtemdolwiLFwicGF0aFwiOlwiY29uZmlnLmh0bWxcIixcInJ1bGVcIjpcImNvbnN0IGVtcHR5ID0gJ2hpa2VyOi8vZW1wdHknXFxuY29uc3QgcGFnZSA9IE1ZX1BBR0U7XFxuXFxuY29uc3QgQ29sb3IgPSAodGVzdCkgPT4ge1xcbiAgICByZXR1cm4gJzxmb250IGNvbG9yPVxcXCIjRkE3Mjk4XFxcIj4nICsgdGVzdCArICc8L2Zyb250Pic7XFxufVxcblxcbmNvbnN0IFNwcmluZ0dyZWVuID0gKHRlc3QpID0+IHtcXG4gICAgcmV0dXJuICc8Zm9udCBjb2xvcj1cXFwiIzNDQjM3MVxcXCI+JyArIHRlc3QgKyAnPC9mcm9udD4nO1xcbn1cXG5cXG5jb25zdCBTdHJvbmcgPSAodGVzdCkgPT4ge1xcbiAgICByZXR1cm4gJzxzdHJvbmc+JyArIHRlc3QgKyAnPC9zdHJvbmc+JztcXG59XFxuXFxuY29uc3QgU21hbGwgPSAodGVzdCkgPT4ge1xcbiAgICByZXR1cm4gJzxzbWFsbD4nICsgdGVzdCArICc8L3NtYWxsPic7XFxuf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AgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+WIhuexuycsIGkpO1xcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+exu0lEJywgaWQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcbiAgICAgICAgICAgICAgICB9LCBlbXB0eSwgaSwgaWQpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3Njcm9sbF9idXR0b24nXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICBjb250bGlzdFtpXSA9IFtdO1xcbiAgICAgICAgY29udHMgPSB0YWIudGFncztcXG4gICAgICAgIGNvbnRzLmZvckVhY2goY29udCA9PiB7XFxuICAgICAgICAgICAgY29udGxpc3RbaV0ucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjb250Lm5hbWUsXFxuICAgICAgICAgICAgICAgIHVybDogY29udC5JRFxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG4gICAgY29uc3QgY2F0ZWdvcnkgPSBnZXRNeVZhcign57G7SUQnLCAnJyArIHRhYnNbMF0uY2F0ZWdvcnlJRCArICcnKVxcbiAgICBjb25zdCBpbmRleCA9IGdldE15VmFyKCfliIbnsbsnLCAnMCcpXFxuICAgIGlmIChjb250bGlzdFtpbmRleF0ubGVuZ3RoKSB7XFxuICAgICAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIGNvbnRsaXN0W2luZGV4XS5mb3JFYWNoKChjb250c2xpc3QsIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBnZXRNeVZhcihpbmRleCwgJzAnKSA9PSBpID8gUmljaChTdHJvbmcoQ29sb3IoY29udHNsaXN0LnRpdGxlKSkpIDogY29udHNsaXN0LnRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpbmRleCwgZW1wdHksIGkpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcihpbmRleCwgaSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpbmRleCwgZW1wdHksIGkpLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgaWQgPSBjb250bGlzdFtpbmRleF1bZ2V0TXlWYXIoaW5kZXgsICcwJyldLnVybFxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgaWQgPSAnJ1xcbiAgICB9XFxuICAgIHNvcnRUeXBlUGFyc2UoZClcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgZ2V0SWNvblNlYXJjaChkKVxcbiAgICAgICAgcGF0aCA9ICcvcG9zdC9saXN0L0FORFJPSUQvNC4xLjgnXFxuICAgICAgICBib2R5ID0gJyZzdGFydD0wJmNvdW50PTIwJmNhdF9pZD0nICsgY2F0ZWdvcnkgKyAnJnRhZ19pZD0nICsgaWQgKyAnJnNvcnRfYnk9JyArIHNvcnRUeXBlXFxuICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxuICAgICAgICBsYXlvdXRQYXJzZShkLCBkYXRlLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KVxcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKVxcbn1cXG5cXG5jb25zdCBzb3J0VHlwZVBhcnNlID0gKGQpID0+IHtcXG4gICAg5o6S5bqPID0gWyfmjInlm57lpI3ml7bpl7QnLCAn5oyJ5pys54mI57K+5Y2OJywgJ+aMieWPkeW4g+aXtumXtCddO1xcbiAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgICAgICB9KVxcbiAgICAgICAg5o6S5bqPLmZvckVhY2goaXRlbSA9PiB7XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0gPT0gZ2V0TXlWYXIoJ+aOkuW6jycsIOaOkuW6j1swXSkgPyBSaWNoKFN0cm9uZyhDb2xvcihpdGVtKSkpIDogaXRlbSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpdGVtLCBlbXB0eSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign5o6S5bqPJywgaXRlbSk7XFxuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBlbXB0eSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnc2Nyb2xsX2J1dHRvbidcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgfVxcbiAgICBzd2l0Y2ggKGdldE15VmFyKCfmjpLluo8nLCDmjpLluo9bMF0pKSB7XFxuICAgICAgICBjYXNlIOaOkuW6j1swXTpcXG4gICAgICAgICAgICBzb3J0VHlwZSA9IDBcXG4gICAgICAgICAgICBicmVhaztcXG4gICAgICAgIGNhc2Ug5o6S5bqPWzFdOlxcbiAgICAgICAgICAgIHNvcnRUeXBlID0gMlxcbiAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgY2FzZSDmjpLluo9bMl06XFxuICAgICAgICAgICAgc29ydFR5cGUgPSAxXFxuICAgICAgICAgICAgYnJlYWs7XFxuICAgIH1cXG59XFxuXFxuY29uc3QgbGF5b3V0UGFyc2UgPSAoZCwgZGF0YSwgaWQsIHNvcnRUeXBlLCBjYXRlZ29yeSkgPT4ge1xcbiAgICBhZGRMaXN0ZW5lcignb25SZWZyZXNoJywgKCkgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxuICAgIH0pXFxuICAgIGlmIChkYXRhLnBvc3RzLmxlbmd0aCkge1xcbiAgICAgICAgZGF0YS5wb3N0cy5mb3JFYWNoKGRhdGUgPT4ge1xcbiAgICAgICAgICAgIHVzZXJJRCA9IGRhdGUudXNlci51c2VySURcXG4gICAgICAgICAgICBuaWNrID0gZGF0ZS51c2VyLm5pY2tcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmljayArICdcXFxcdFxcXFx0JyArIFNtYWxsKENvbG9yKGdldEZvcm1hdChkYXRlLmNyZWF0ZVRpbWUpKSksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGRhdGUudXNlci5hdmF0YXIsXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSkucnVsZSgodXNlcklELCBuaWNrKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcbiAgICAgICAgICAgICAgICAgICAgc29ydFR5cGUgPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcnkgPSAnJ1xcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxuICAgICAgICAgICAgICAgICAgICBzZXRQYWdlVGl0bGUobmljaylcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxuICAgICAgICAgICAgICAgICAgICBwYXRoID0gJy9wb3N0L2NyZWF0ZS9saXN0L0FORFJPSUQvNC4xLjgnXFxuICAgICAgICAgICAgICAgICAgICBib2R5ID0gJyZzdGFydD0wJmNvdW50PTIwJnVzZXJfaWQ9JyArIHVzZXJJRFxcbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxuICAgICAgICAgICAgICAgICAgICBsYXlvdXRQYXJzZShkLCBkYXRlLCB1c2VySUQsIHNvcnRUeXBlLCBjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKVxcbiAgICAgICAgICAgICAgICB9LCB1c2VySUQsIG5pY2spLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcidcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHBvc3RJRCA9IGRhdGUucG9zdElEXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goR3JheShkYXRlLnRpdGxlKSksXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSArICdmeXBhZ2UnICsgJyNhdXRvQ2FjaGUjI2dhbWVUaGVtZSMnKS5ydWxlKChwb3N0SUQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkID0gW11cXG4gICAgICAgICAgICAgICAgICAgIHBsYXlVcmxQYXJzZShkLCBwb3N0SUQpXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgICAgICAgICAgfSwgcG9zdElEKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGRhdGUuZGV0YWlsLm1hdGNoKC88aW1hZ2U+KC4qPyk8XFxcXC9pbWFnZT4vZylcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gaW1hZ2VzLm1hcChpdGVtID0+IGl0ZW0ubWF0Y2goLzxpbWFnZT4oLio/KSwuKj88XFxcXC9pbWFnZT4vKVsxXSlcXG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGRhdGUuaW1hZ2VzXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChpbWFnZXMubGVuZ3RoKSB7XFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMzsgaSsrKSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW1hZ2VzW2ldICE9IG51bGwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWFnZXNbaV0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2VzW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2NhcmRfcGljXzMnXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgICAgICBpZiAoZ2V0TXlWYXIoJ1BhZ2UnLCAnJykgPT0gJycpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChTcHJpbmdHcmVlbign772e772e772e5Yqg6L295pu05aSa772e772e772eJykpKSxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKFxcXCIjbm9Mb2FkaW5nI1xcXCIpLmxhenlSdWxlKChkYXRhLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2NvbmZpZy5odG1sJylcXG4gICAgICAgICAgICAgICAgICAgIGlmIChzb3J0VHlwZSA9PSAnJyAmJiBjYXRlZ29yeSA9PSAnJykge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvY3JlYXRlL2xpc3QvQU5EUk9JRC80LjEuOCdcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gJyZzdGFydD0nICsgZ2V0TXlWYXIoJ1BhZ2UnLCBkYXRhLnN0YXJ0KSArICcmY291bnQ9MjAmdXNlcl9pZD0nICsgaWRcXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvbGlzdC9BTkRST0lELzQuMS44J1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSAnJnN0YXJ0PScgKyBnZXRNeVZhcignUGFnZScsIGRhdGEuc3RhcnQpICsgJyZjb3VudD0yMCZjYXRfaWQ9JyArIGNhdGVnb3J5ICsgJyZ0YWdfaWQ9JyArIGlkICsgJyZzb3J0X2J5PScgKyBzb3J0VHlwZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHB1dE15VmFyKCdQYWdlJywgZGF0ZS5zdGFydClcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgaWQsIHNvcnRUeXBlLCBjYXRlZ29yeSlcXG4gICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUoJ1BhZ2UnICsgaWQsIGQpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRlLnBvc3RzLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW1CeUNscygnUGFnZUNscycgKyBpZClcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbXB0eVxcbiAgICAgICAgICAgICAgICB9LCBkYXRhLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiAnUGFnZScgKyBpZCxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ1BhZ2VDbHMnICsgaWQsXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBSaWNoKFNtYWxsKEdyYXkoJ++9nu+9nu+9nuaIkeaYr+acieW6lee6v+eahO+9nu+9nu+9nicpKSksXFxuICAgICAgICAgICAgdXJsOiBlbXB0eSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgIH1cXG59XFxuXFxuY29uc3QgbGF5b3V0U2VhcmNoUGFyc2UgPSAoZCwgZGF0YSkgPT4ge1xcbiAgICBpZiAoZGF0YS5sZW5ndGgpIHtcXG4gICAgICAgIGRhdGEuZm9yRWFjaChkYXRlID0+IHtcXG4gICAgICAgICAgICB1c2VySUQgPSBkYXRlLnVzZXIudXNlcklEXFxuICAgICAgICAgICAgbmljayA9IGRhdGUudXNlci5uaWNrXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IG5pY2sgKyAnXFxcXHRcXFxcdCcgKyBTbWFsbChDb2xvcihnZXRGb3JtYXQoZGF0ZS5jcmVhdGVUaW1lKSkpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkYXRlLnVzZXIuYXZhdGFyLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkpLnJ1bGUoKHVzZXJJRCwgbmljaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgTVlfUEFHRSA9IDFcXG4gICAgICAgICAgICAgICAgICAgIHNvcnRUeXBlID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5ID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKG5pY2spXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9ICcvcG9zdC9jcmVhdGUvbGlzdC9BTkRST0lELzQuMS44J1xcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9ICcmc3RhcnQ9MCZjb3VudD0yMCZ1c2VyX2lkPScgKyB1c2VySURcXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgdXNlcklELCBzb3J0VHlwZSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgICAgICAgICAgfSwgdXNlcklELCBuaWNrKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICBwb3N0SUQgPSBkYXRlLnBvc3RJRFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKEdyYXkoZGF0ZS50aXRsZSkpLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkgKyAnZnlwYWdlJyArICcjYXV0b0NhY2hlIyNnYW1lVGhlbWUjJykucnVsZSgocG9zdElEKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxuICAgICAgICAgICAgICAgICAgICBwbGF5VXJsUGFyc2UoZCwgcG9zdElEKVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxuICAgICAgICAgICAgICAgIH0sIHBvc3RJRCksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF8xJyxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBkYXRlLmRldGFpbC5tYXRjaCgvPGltYWdlPiguKj8pPFxcXFwvaW1hZ2U+L2cpXFxuICAgICAgICAgICAgICAgIGltYWdlcyA9IGltYWdlcy5tYXAoaXRlbSA9PiBpdGVtLm1hdGNoKC88aW1hZ2U+KC4qPyksLio/PFxcXFwvaW1hZ2U+LylbMV0pXFxuICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBkYXRlLmltYWdlc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoaW1hZ2VzLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDM7IGkrKykge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGltYWdlc1tpXSAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1hZ2VzW2ldLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGltYWdlc1tpXSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICdjYXJkX3BpY18zJ1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lX2JsYW5rJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KVxcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChHcmF5KCfvvZ7vvZ7vvZ7miJHmmK/mnInlupXnur/nmoTvvZ7vvZ7vvZ4nKSkpLFxcbiAgICAgICAgICAgIHVybDogZW1wdHksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxufVxcblxcbmNvbnN0IHBsYXlVcmxQYXJzZSA9IChkLCBwb3N0SUQpID0+IHtcXG4gICAgc2V0UGFnZVRpdGxlKCfor6bmg4XpobXpnaInKVxcbiAgICBwYXRoID0gJy9wb3N0L2RldGFpbC9BTkRST0lELzQuMS44J1xcbiAgICBib2R5ID0gJyZwb3N0X2lkPScgKyBwb3N0SUQgKyAnJnBhZ2Vfbm89JyArIHBhZ2UgKyAnJnBhZ2Vfc2l6ZT0yMCZkb2M9MSdcXG4gICAgZGF0YSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcbiAgICBpZiAocGFnZSA9PSAxKSB7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDYwOyBpKyspIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9XFxuICAgICAgICBjZW50ZXJzID0gUmVnRXhwUGFyc2UoZGF0YS5wb3N0LmRldGFpbClcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6ICc8aDE+JyArIGRhdGEucG9zdC50aXRsZSArICc8L2gxPicgKyBTbWFsbChHcmF5KGNlbnRlcnMpKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXG4gICAgICAgIH0pXFxuICAgICAgICB2b2ljZSA9IGRhdGEucG9zdC52b2ljZVxcbiAgICAgICAgaWYgKHZvaWNlLmxlbmd0aCkge1xcbiAgICAgICAgICAgIHZvaWNlID0gSlNPTi5wYXJzZSh2b2ljZSlcXG4gICAgICAgICAgICB2aWRlbyA9IHZvaWNlLnZpZGVvaG9zdCArIHZvaWNlLnZpZGVvZmlkXFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6ICc8cD48YSBocmVmPVxcXCInICsgdmlkZW8gKyAnI2lzVmlkZW89dHJ1ZSNcXFwiPlvngrnlh7vmn6XnnIvop4bpopFdPC9hPjwvcD4nLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCdcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgaW1hZ2VzID0gZGF0YS5wb3N0LmltYWdlc1xcbiAgICAgICAgaWYgKGltYWdlcy5sZW5ndGgpIHtcXG4gICAgICAgICAgICBpbWFnZXMuZm9yRWFjaChpbWFnZSA9PiB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnXFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgMjA7IGkrKykge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBpZiAoZGF0YS5jb21tZW50cy5sZW5ndGgpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogUmljaChTdHJvbmcoQmlnKCflhajpg6jor4TorrojJyArIGRhdGEucG9zdC5jb21tZW50Q291bnQgKyAn5p2hJykpKSxcXG4gICAgICAgICAgICAgICAgdXJsOiBlbXB0eSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfVxcbiAgICAgICAgZGF0YS5jb21tZW50cy5mb3JFYWNoKGRhdGUgPT4ge1xcbiAgICAgICAgICAgIHJlZkNvbW1lbnQgPSBkYXRlLnJlZkNvbW1lbnRcXG4gICAgICAgICAgICBpZiAocmVmQ29tbWVudCAhPSBudWxsKSB7XFxuICAgICAgICAgICAgICAgIG5pY2tDb21tZW50ID0gcmVmQ29tbWVudC5uaWNrXFxuICAgICAgICAgICAgICAgIHJlZkNvbW1lbnQgPSAn5Zue5aSNXFxcXHQnICsgbmlja0NvbW1lbnQgKyAn77yaPGJyPicgKyBSZWdFeHBQYXJzZShyZWZDb21tZW50LnRleHQpXFxuICAgICAgICAgICAgICAgIHJlZkNvbW1lbnQgPSBcXFwiPGJsb2NrcXVvdGU+XFxcIiArIFNtYWxsKEdyYXkocmVmQ29tbWVudCkpICsgXFxcIjwvYmxvY2txdW90ZT5cXFwiXFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmVmQ29tbWVudCA9ICcnXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlzVG9wID0gJ+mhtue9ridcXG4gICAgICAgICAgICBpZiAoZGF0ZS5pc1RvcCAhPSAxKSBpc1RvcCA9IGRhdGUuc2VxICsgJ+alvCdcXG4gICAgICAgICAgICBjZW50ZXJzID0gUmVnRXhwUGFyc2UoZGF0ZS50ZXh0KVxcbiAgICAgICAgICAgIHVzZXJJRCA9IGRhdGUudXNlci51c2VySURcXG4gICAgICAgICAgICBuaWNrID0gZGF0ZS51c2VyLm5pY2tcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogbmljayArICdcXFxcdFxcXFx0JyArIFNtYWxsKFNwcmluZ0dyZWVuKGlzVG9wKSkgKyAnXFxcXHRcXFxcdCcgKyBTbWFsbChDb2xvcihnZXRGb3JtYXQoZGF0ZS5jcmVhdGVUaW1lKSkpLFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkYXRlLnVzZXIuYXZhdGFyLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoZW1wdHkpLnJ1bGUoKHVzZXJJRCwgbmljaykgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgTVlfUEFHRSA9IDFcXG4gICAgICAgICAgICAgICAgICAgIHNvcnRUeXBlID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5ID0gJydcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKG5pY2spXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcbiAgICAgICAgICAgICAgICAgICAgcGF0aCA9ICcvcG9zdC9jcmVhdGUvbGlzdC9BTkRST0lELzQuMS44J1xcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9ICcmc3RhcnQ9MCZjb3VudD0yMCZ1c2VyX2lkPScgKyB1c2VySURcXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgdXNlcklELCBzb3J0VHlwZSwgY2F0ZWdvcnkpXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXG4gICAgICAgICAgICAgICAgfSwgdXNlcklELCBuaWNrKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInXFxuICAgICAgICAgICAgfSwge1xcbiAgICAgICAgICAgICAgICB0aXRsZTogcmVmQ29tbWVudCArIFNtYWxsKEdyYXkoY2VudGVycykpLFxcbiAgICAgICAgICAgICAgICB1cmw6IGVtcHR5LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgaWYgKGRhdGUuaW1hZ2VzLmxlbmd0aCkge1xcbiAgICAgICAgICAgICAgICBkYXRlLmltYWdlcy5mb3JFYWNoKGltYWdlID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1hZ2UsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbWFnZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3BpY18xX2Z1bGwnXFxuICAgICAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH0pXFxuICAgIH0gZWxzZSB7XFxuICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgIHRpdGxlOiBSaWNoKFNtYWxsKEdyYXkoJ++9nu+9nu+9nuaIkeaYr+acieW6lee6v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QoZW1wdHkpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICBNWV9QQUdFID0gMVxcbiAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxuICAgICAgICAgICAgcmV0dXJuIGdldExvZ2luVXJsKClcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxuICAgICAgICB9XFxuICAgIH0pXFxufVxcblxcbmNvbnN0IGdldFNlYXJjaFBhcnNlID0gKGQpID0+IHtcXG4gICAgc2V0UGFnZVRpdGxlKCfokavoiqbkvqDCt+aQnOe0oicpXFxuICAgIGFkZExpc3RlbmVyKCdvbkNsb3NlJywgKCkgPT4ge1xcbiAgICAgICAgY2xlYXJNeVZhcihcXFwi5pCc57Si5YWz6ZSu6K+NXFxcIilcXG4gICAgfSlcXG4gICAgaWYgKHBhZ2UgPT0gMSkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogZ2V0SXRlbSgn6JGr6Iqm5L6gbmljaycpLFxcbiAgICAgICAgICAgIHBpY191cmw6IGdldEl0ZW0oJ+iRq+iKpuS+oGF2YXRhcicpLFxcbiAgICAgICAgICAgIHVybDogJChlbXB0eSkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6YCA5Ye655m75b2VXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ6IFxcXCLnoa7lrprlpb3kuoblkJfvvJ/lvZPliY3otKblj7flsIbkvJrpgIDlh7p+XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbGVhckl0ZW0oJ+iRq+iKpuS+oFRPS0VOJyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0b2FzdCgn6YCA5Ye65oiQ5YqfficpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXRcXG4gICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2F2YXRhcidcXG4gICAgICAgIH0sIHtcXG4gICAgICAgICAgICB0aXRsZTogJ/CflI0nLFxcbiAgICAgICAgICAgIGRlc2M6ICfor7fovpPlhaXluJblrZDlkI3np7Av5YWz6ZSu6K+NJyxcXG4gICAgICAgICAgICB1cmw6ICQudG9TdHJpbmcoKGdldFNlYXJjaFVybCwgZW1wdHkpID0+IHtcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScsIGlucHV0KTtcXG4gICAgICAgICAgICAgICAgaWYgKGlucHV0ICE9ICcnKSBnZXRTZWFyY2hVcmwoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgfSwgZ2V0U2VhcmNoVXJsLCBlbXB0eSksXFxuICAgICAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcign5pCc57Si5YWz6ZSu6K+NJylcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxuICAgIGlmIChnZXRNeVZhcign5pCc57Si5YWz6ZSu6K+NJykgPT0gJycpIHtcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXG4gICAgICAgICAgICBsZXQgbWVtID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwi6JGr6Iqm5L6gXFxcIiwgW10pO1xcbiAgICAgICAgICAgIGlmIChtZW0ubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goQmlnKCfwn5OdIOaQnOe0ouWOhuWPsicpKSxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoZW1wdHksIGdldENvbmZpcm0pID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRDb25maXJtKClcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBlbXB0eSwgZ2V0Q29uZmlybSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogUmljaChDZW50ZXIoXFxcIuWWguWWgn7ov5jmsqHmkJzntKLlkaLvvZ4o77+j4pa977+j772eKX5cXFwiKSksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IGVtcHR5LFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IG1lbS5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBtZW1baV07XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGl0LCBnZXRTZWFyY2hVcmwsIGVtcHR5KSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScsIGl0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBnZXRTZWFyY2hVcmwoaXQpXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxuICAgICAgICAgICAgICAgICAgICB9LCBpdCwgZ2V0U2VhcmNoVXJsLCBlbXB0eSksXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIlxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSBlbHNlIHtcXG4gICAgICAgIHBhdGggPSAnL3Bvc3Qvc2VhcmNoL0FORFJPSUQvNC4xLjgnXFxuICAgICAgICBib2R5ID0gJyZzdGFydD0nICsgKHBhZ2UgLSAxKSAqIDIwICsgJyZjb3VudD0yMCZjYXRfaWQ9NDMma2V5d29yZD0nICsgZ2V0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScpICsgJyZmbGFnPTAnXFxuICAgICAgICBkYXRlID0gZ2V0Q29uZmlnVXJsKHBhdGgsIGJvZHkpXFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGxheW91dFNlYXJjaFBhcnNlKGQsIGRhdGUucG9zdHMpXFxuIC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uICAgIGNvbnN0IGQgPSBbXVxcXFxuICAgIGNvbnN0IGNvbnRsaXN0ID0gW107XFxcXG4gICAgY29uc3QgdGFicyA9IGlUYWcuc2xpY2UoMywgaVRhZy5sZW5ndGggLSAzKVxcXFxuICAgIHRhYnMuZm9yRWFjaCgodGFiLCBpKSA9PiB7XFxcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXFxcbiAgICAgICAgICAgIG5hbWUgPSB0YWIudGl0bGVcXFxcbiAgICAgICAgICAgIGlkID0gdGFiLmNhdGVnb3J5SURcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGdldE15VmFyKCfliIbnsbsnLCAnMCcpID09IGkgPyBSaWNoKFN0cm9uZyhDb2xvcihuYW1lKSkpIDogbmFtZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGVtcHR5LCBpLCBpZCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+WIhuexuycsIGkpO1xcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign57G7SUQnLCBpZCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVtcHR5O1xcXFxuICAgICAgICAgICAgICAgIH0sIGVtcHR5LCBpLCBpZCksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcXFxuICAgICAgICAgICAgfSk7XFxcXG4gICAgICAgIH1cXFxcbiAgICAgICAgY29udGxpc3RbaV0gPSBbXTtcXFxcbiAgICAgICAgY29udHMgPSB0YWIudGFncztcXFxcbiAgICAgICAgY29udHMuZm9yRWFjaChjb250ID0+IHtcXFxcbiAgICAgICAgICAgIGNvbnRsaXN0W2ldLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBjb250Lm5hbWUsXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBjb250LklEXFxcXG4gICAgICAgICAgICB9KTtcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9KVxcXFxuICAgIGNvbnN0IGNhdGVnb3J5ID0gZ2V0TXlWYXIoJ+exu0lEJywgJycgKyB0YWJzWzBdLmNhdGVnb3J5SUQgKyAnJylcXFxcbiAgICBjb25zdCBpbmRleCA9IGdldE15VmFyKCfliIbnsbsnLCAnMCcpXFxcXG4gICAgaWYgKGNvbnRsaXN0W2luZGV4XS5sZW5ndGgpIHtcXFxcbiAgICAgICAgaWYgKHBhZ2UgPT0gMSkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2JsYW5rX2Jsb2NrJ1xcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGNvbnRsaXN0W2luZGV4XS5mb3JFYWNoKChjb250c2xpc3QsIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogZ2V0TXlWYXIoaW5kZXgsICcwJykgPT0gaSA/IFJpY2goU3Ryb25nKENvbG9yKGNvbnRzbGlzdC50aXRsZSkpKSA6IGNvbnRzbGlzdC50aXRsZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChpbmRleCwgZW1wdHksIGkpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoaW5kZXgsIGkpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgIC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ZTogJ2JsYW5rX2Jsb2NrJ1xcXFxuICAgICAgICB9KVxcXFxuICAgICAgICDmjpLluo8uZm9yRWFjaChpdGVtID0+IHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IGl0ZW0gPT0gZ2V0TXlWYXIoJ+aOkuW6jycsIOaOkuW6j1swXSkgPyBSaWNoKFN0cm9uZyhDb2xvcihpdGVtKSkpIDogaXRlbSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoJyNub0xvYWRpbmcjJykubGF6eVJ1bGUoKGl0ZW0sIGVtcHR5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcign5o6S5bqPJywgaXRlbSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbXB0eTtcXFxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLCBlbXB0eSksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdzY3JvbGxfYnV0dG9uJ1xcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfSlcXFxcbiAgICB9XFxcXG4gICAgc3dpdGNoIChnZXRNeVZhcign5o6S5bqPJywg5o6S5bqPWzBdKSkge1xcXFxuICAgICAgICBjYXNlIOaOkuW6j1swXTpcXFxcbiAgICAgICAgICAgIHNvcnRUeXBlID0gMFxcXFxuICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgIGNhc2Ug5o6S5bqPWzFdOlxcXFxuICAgICAgICAgICAgc29ydFR5cGUgPSAyXFxcXG4gICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgY2FzZSDmjpLluo9bMl06XFxcXG4gICAgICAgICAgICBzb3J0VHlwZSA9IDFcXFxcbiAgICAgICAgICAgIGJyZWFrO1xcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuY29uc3QgbGF5b3V0UGFyc2UgPSAoZCwgZGF0YSwgaWQsIHNvcnRUeXBlLCBjYXRlZ29yeSkgPT4ge1xcXFxuICAgIGFkZExpc3RlbmVyKCdvblJlZnJlc2gnLCAoKSA9PiB7XFxcXG4gICAgICAgIGNsZWFyTXlWYXIoJ1BhZ2UnKVxcXFxuICAgIH0pXFxcXG4gICAgaWYgKGRhdGEucG9zdHMubGVuZ3RoKSB7XFxcXG4gICAgICAgIGRhdGEucG9zdHMuZm9yRWFjaChkYXRlID0+IHtcXFxcbiAgICAgICAgICAgIHVzZXJJRCA9IGRhdGUudXNlci51c2VySURcXFxcbiAgICAgICAgICAgIG5pY2sgPSBkYXRlLnVzZXIubmlja1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbmljayArICdcXFxcXFxcXHRcXFxcXFxcXHQnICsgU21hbGwoQ29sb3IoZ2V0Rm9ybWF0KGRhdGUuY3JlYXRlVGltZSkpKSxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkYXRlLnVzZXIuYXZhdGFyLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSkucnVsZSgodXNlcklELCBuaWNrKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIE1ZX1BBR0UgPSAxXFxcXG4gICAgICAgICAgICAgICAgICAgIHNvcnRUeXBlID0gJydcXFxcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcnkgPSAnJ1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKG5pY2spXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxcXG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvY3JlYXRlL2xpc3QvQU5EUk9JRC80LjEuOCdcXFxcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9ICcmc3RhcnQ9MCZjb3VudD0yMCZ1c2VyX2lkPScgKyB1c2VySURcXFxcbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgdXNlcklELCBzb3J0VHlwZSwgY2F0ZWdvcnkpXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKVxcXFxuICAgICAgICAgICAgICAgIH0sIHVzZXJJRCwgbmljayksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcG9zdElEID0gZGF0ZS5wb3N0SURcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goR3JheShkYXRlLnRpdGxlKSksXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGVtcHR5ICsgJ2Z5cGFnZScgKyAnI2F1dG9DYWNoZSMjZ2FtZVRoZW1lIycpLnJ1bGUoKHBvc3RJRCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgcGxheVVybFBhcnNlKGQsIHBvc3RJRClcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxcXG4gICAgICAgICAgICAgICAgfSwgcG9zdElEKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gZGF0ZS5kZXRhaWwubWF0Y2goLzxpbWFnZT4oLio/KTxcXFxcXFxcXC9pbWFnZT4vZylcXFxcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBpbWFnZXMubWFwKGl0ZW0gPT4gaXRlbS5tYXRjaCgvPGltYWdlPiguKj8pLC4qPzxcXFxcXFxcXC9pbWFnZT4vKVsxXSlcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBkYXRlLmltYWdlc1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKGltYWdlcy5sZW5ndGgpIHtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDM7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW1hZ2VzW2ldICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1hZ2VzW2ldLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2VzW2ldLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgICAgIGlmIChnZXRNeVZhcignUGFnZScsICcnKSA9PSAnJykge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChTcHJpbmdHcmVlbign772e772e772e5Yqg6L295pu05aSa772e772e772eJykpKSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoXFxcXFxcXCIjbm9Mb2FkaW5nI1xcXFxcXFwiKS5sYXp5UnVsZSgoZGF0YSwgaWQsIHNvcnRUeXBlLCBjYXRlZ29yeSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICBNWV9QQUdFID0gMVxcXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoc29ydFR5cGUgPT0gJycgJiYgY2F0ZWdvcnkgPT0gJycpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvY3JlYXRlL2xpc3QvQU5EUk9JRC80LjEuOCdcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHkgPSAnJnN0YXJ0PScgKyBnZXRNeVZhcignUGFnZScsIGRhdGEuc3RhcnQpICsgJyZjb3VudD0yMCZ1c2VyX2lkPScgKyBpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0aCA9ICcvcG9zdC9saXN0L0FORFJPSUQvNC4xLjgnXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBib2R5ID0gJyZzdGFydD0nICsgZ2V0TXlWYXIoJ1BhZ2UnLCBkYXRhLnN0YXJ0KSArICcmY291bnQ9MjAmY2F0X2lkPScgKyBjYXRlZ29yeSArICcmdGFnX2lkPScgKyBpZCArICcmc29ydF9ieT0nICsgc29ydFR5cGVcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignUGFnZScsIGRhdGUuc3RhcnQpXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGQgPSBbXVxcXFxuICAgICAgICAgICAgICAgICAgICBsYXlvdXRQYXJzZShkLCBkYXRlLCBpZCwgc29ydFR5cGUsIGNhdGVnb3J5KVxcXFxuICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQmVmb3JlKCdQYWdlJyArIGlkLCBkKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRlLnBvc3RzLmxlbmd0aCkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKCdQYWdlQ2xzJyArIGlkKVxcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBlbXB0eVxcXFxuICAgICAgICAgICAgICAgIH0sIGRhdGEsIGlkLCBzb3J0VHlwZSwgY2F0ZWdvcnkpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6ICdQYWdlJyArIGlkLFxcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdQYWdlQ2xzJyArIGlkLFxcXFxuICAgICAgICAgICAgICAgICAgICBsaW5lVmlzaWJsZTogZmFsc2VcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBSaWNoKFNtYWxsKEdyYXkoJ++9nu+9nu+9nuaIkeaYr+acieW6lee6v+eahO+9nu+9nu+9nicpKSksXFxcXG4gICAgICAgICAgICB1cmw6IGVtcHR5LFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxufVxcXFxuXFxcXG5jb25zdCBsYXlvdXRTZWFyY2hQYXJzZSA9IChkLCBkYXRhKSA9PiB7XFxcXG4gICAgaWYgKGRhdGEubGVuZ3RoKSB7XFxcXG4gICAgICAgIGRhdGEuZm9yRWFjaChkYXRlID0+IHtcXFxcbiAgICAgICAgICAgIHVzZXJJRCA9IGRhdGUudXNlci51c2VySURcXFxcbiAgICAgICAgICAgIG5pY2sgPSBkYXRlLnVzZXIubmlja1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogbmljayArICdcXFxcXFxcXHRcXFxcXFxcXHQnICsgU21hbGwoQ29sb3IoZ2V0Rm9ybWF0KGRhdGUuY3JlYXRlVGltZSkpKSxcXFxcbiAgICAgICAgICAgICAgICBwaWNfdXJsOiBkYXRlLnVzZXIuYXZhdGFyLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJChlbXB0eSkucnVsZSgodXNlcklELCBuaWNrKSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgICAgIE1ZX1BBR0UgPSAxXFxcXG4gICAgICAgICAgICAgICAgICAgIHNvcnRUeXBlID0gJydcXFxcbiAgICAgICAgICAgICAgICAgICAgY2F0ZWdvcnkgPSAnJ1xcXFxuICAgICAgICAgICAgICAgICAgICBjbGVhck15VmFyKCdQYWdlJylcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0UGFnZVRpdGxlKG5pY2spXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9jb25maWcuaHRtbCcpXFxcXG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSAnL3Bvc3QvY3JlYXRlL2xpc3QvQU5EUk9JRC80LjEuOCdcXFxcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9ICcmc3RhcnQ9MCZjb3VudD0yMCZ1c2VyX2lkPScgKyB1c2VySURcXFxcbiAgICAgICAgICAgICAgICAgICAgZGF0ZSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgbGF5b3V0UGFyc2UoZCwgZGF0ZSwgdXNlcklELCBzb3J0VHlwZSwgY2F0ZWdvcnkpXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFJlc3VsdChkKVxcXFxuICAgICAgICAgICAgICAgIH0sIHVzZXJJRCwgbmljayksXFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdhdmF0YXInXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgcG9zdElEID0gZGF0ZS5wb3N0SURcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goR3JheShkYXRlLnRpdGxlKSksXFxcXG4gICAgICAgICAgICAgICAgdXJsOiAkKGVtcHR5ICsgJ2Z5cGFnZScgKyAnI2F1dG9DYWNoZSMjZ2FtZVRoZW1lIycpLnJ1bGUoKHBvc3RJRCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcXFxuICAgICAgICAgICAgICAgICAgICBjb25zdCBkID0gW11cXFxcbiAgICAgICAgICAgICAgICAgICAgcGxheVVybFBhcnNlKGQsIHBvc3RJRClcXFxcbiAgICAgICAgICAgICAgICAgICAgc2V0UmVzdWx0KGQpXFxcXG4gICAgICAgICAgICAgICAgfSwgcG9zdElEKSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgaW1hZ2VzID0gZGF0ZS5kZXRhaWwubWF0Y2goLzxpbWFnZT4oLio/KTxcXFxcXFxcXC9pbWFnZT4vZylcXFxcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBpbWFnZXMubWFwKGl0ZW0gPT4gaXRlbS5tYXRjaCgvPGltYWdlPiguKj8pLC4qPzxcXFxcXFxcXC9pbWFnZT4vKVsxXSlcXFxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgICAgICBpbWFnZXMgPSBkYXRlLmltYWdlc1xcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgaWYgKGltYWdlcy5sZW5ndGgpIHtcXFxcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDM7IGkrKykge1xcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoaW1hZ2VzW2ldICE9IG51bGwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1hZ2VzW2ldLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2VzW2ldLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnY2FyZF9waWNfMydcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSBlbHNlIHtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBSaWNoKFNtYWxsKEdyYXkoJ++9nu+9nu+9nuaIkeaYr+acieW6lee6v+eahO+9nu+9nu+9nicpKSksXFxcXG4gICAgICAgICAgICB1cmw6IGVtcHR5LFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pXFxcXG4gICAgfVxcXFxufVxcXFxuXFxcXG5jb25zdCBwbGF5VXJsUGFyc2UgPSAoZCwgcG9zdElEKSA9PiB7XFxcXG4gICAgc2V0UGFnZVRpdGxlKCfor6bmg4XpobXpnaInKVxcXFxuICAgIHBhdGggPSAnL3Bvc3QvZGV0YWlsL0FORFJPSUQvNC4xLjgnXFxcXG4gICAgYm9keSA9ICcmcG9zdF9pZD0nICsgcG9zdElEICsgJyZwYWdlX25vPScgKyBwYWdlICsgJyZwYWdlX3NpemU9MjAmZG9jPTEnXFxcXG4gICAgZGF0YSA9IGdldENvbmZpZ1VybChwYXRoLCBib2R5KVxcXFxuICAgIGlmIChwYWdlID09IDEpIHtcXFxcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCA2MDsgaSsrKSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYmxhbmtfYmxvY2snXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGNlbnRlcnMgPSBSZWdFeHBQYXJzZShkYXRhLnBvc3QuZGV0YWlsKVxcXFxuICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgdGl0bGU6ICc8aDE+JyArIGRhdGEucG9zdC50aXRsZSArICc8L2gxPicgKyBTbWFsbChHcmF5KGNlbnRlcnMpKSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcXFxuICAgICAgICB9KVxcXFxuICAgICAgICB2b2ljZSA9IGRhdGEucG9zdC52b2ljZVxcXFxuICAgICAgICBpZiAodm9pY2UubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICB2b2ljZSA9IEpTT04ucGFyc2Uodm9pY2UpXFxcXG4gICAgICAgICAgICB2aWRlbyA9IHZvaWNlLnZpZGVvaG9zdCArIHZvaWNlLnZpZGVvZmlkXFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiAnPHA+PGEgaHJlZj1cXFxcXFxcIicgKyB2aWRlbyArICcjaXNWaWRlbz10cnVlI1xcXFxcXFwiPlvngrnlh7vmn6XnnIvop4bpopFdPC9hPjwvcD4nLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncmljaF90ZXh0J1xcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBpbWFnZXMgPSBkYXRhLnBvc3QuaW1hZ2VzXFxcXG4gICAgICAgIGlmIChpbWFnZXMubGVuZ3RoKSB7XFxcXG4gICAgICAgICAgICBpbWFnZXMuZm9yRWFjaChpbWFnZSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaW1hZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogaW1hZ2UsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzFfZnVsbCdcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IDIwOyBpKyspIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6ICdibGFua19ibG9jaydcXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG4gICAgaWYgKGRhdGEuY29tbWVudHMubGVuZ3RoKSB7XFxcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXFxcbiAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFJpY2goU3Ryb25nKEJpZygn5YWo6YOo6K+E6K66IycgKyBkYXRhLnBvc3QuY29tbWVudENvdW50ICsgJ+adoScpKSksXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBlbXB0eSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMScsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgfVxcXFxuICAgICAgICBkYXRhLmNvbW1lbnRzLmZvckVhY2goZGF0ZSA9PiB7XFxcXG4gICAgICAgICAgICByZWZDb21tZW50ID0gZGF0ZS5yZWZDb21tZW50XFxcXG4gICAgICAgICAgICBpZiAocmVmQ29tbWVudCAhPSBudWxsKSB7XFxcXG4gICAgICAgICAgICAgICAgbmlja0NvbW1lbnQgPSByZWZDb21tZW50Lm5pY2tcXFxcbiAgICAgICAgICAgICAgICByZWZDb21tZW50ID0gJ+Wb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SA9ICcnXFxcXG4gICAgICAgICAgICAgICAgICAgIGNhdGVnb3J5ID0gJydcXFxcbiAgICAgICAgICAgICAgICAgICAgY2xlYXJNeVZhcignUGFnZScpXFxcXG4gICAgICAgICAgICAgICAgICAgIHNldFBhZ2VUaXRsZShuaWNrKVxcXFxuICAgICAgICAgICAgICAgICAgICByZXF1aXJlKCdoaWtlcjovL3BhZ2UvY29uZmlnLmh0bWwnKVxcXFxuICAgICAgICAgICAgICAgICAgICBwYXRoID0gJy9wb3N0L2NyZWF0ZS9saXN0L0FORFJPSUQvNC4xLjgnXFxcXG4gICAgICAgICAgICAgICAgICAgIGJvZHkgPSAnJnN0YXJ0PTAmY291bnQ9MjAmdXNlcl9pZD0nICsgdXNlcklEXFxcXG4gICAgICAgICAgICAgICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXFxcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZCA9IFtdXFxcXG4gICAgICAgICAgICAgICAgICAgIGxheW91dFBhcnNlKGQsIGRhdGUsIHVzZXJJRCwgc29ydFR5cGUsIGNhdGVnb3J5KVxcXFxuICAgICAgICAgICAgICAgICAgICBzZXRSZXN1bHQoZClcXFxcbiAgICAgICAgICAgICAgICB9LCB1c2VySUQsIG5pY2spLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xcXFxuICAgICAgICAgICAgfSwge1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiByZWZDb21tZW50ICsgU21hbGwoR3JheShjZW50ZXJzKSksXFxcXG4gICAgICAgICAgICAgICAgdXJsOiBlbXB0eSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3JpY2hfdGV4dCcsXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgIGlmIChkYXRlLmltYWdlcy5sZW5ndGgpIHtcXFxcbiAgICAgICAgICAgICAgICBkYXRlLmltYWdlcy5mb3JFYWNoKGltYWdlID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGltYWdlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpbWFnZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiAncGljXzFfZnVsbCdcXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmVfYmxhbmsnXFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9KVxcXFxuICAgIH0gZWxzZSB7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogUmljaChTbWFsbChHcmF5KCfvvZ7vvZ7vvZ7miJHmmK/mnInlupXnur/nmoTvvZ7vvZ7vvZ4nKSkpLFxcXFxuICAgICAgICAgICAgdXJsOiBlbXB0eSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAndGV4dF9jZW50ZXJfMScsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuY29uc3QgZ2V0TG9naW5QYXJzZSA9IChkKSA9PiB7XFxcXG4gICAgc2V0UGFnZVRpdGxlKCfokavoiqbkvqDCt+eZu+W9lScpXFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgZGVzYzogXFxcXFxcXCLor7fovpPlh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kOWKn34nKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0XFxcXG4gICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnYXZhdGFyJ1xcXFxuICAgICAgICB9LCB7XFxcXG4gICAgICAgICAgICB0aXRsZTogJ/CflI0nLFxcXFxuICAgICAgICAgICAgZGVzYzogJ+ivt+i+k+WFpeW4luWtkOWQjeensC/lhbPplK7or40nLFxcXFxuICAgICAgICAgICAgdXJsOiAkLnRvU3RyaW5nKChnZXRTZWFyY2hVcmwsIGVtcHR5KSA9PiB7XFxcXG4gICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScsIGlucHV0KTtcXFxcbiAgICAgICAgICAgICAgICBpZiAoaW5wdXQgIT0gJycpIGdldFNlYXJjaFVybChpbnB1dCk7XFxcXG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxcXG4gICAgICAgICAgICB9LCBnZXRTZWFyY2hVcmwsIGVtcHR5KSxcXFxcbiAgICAgICAgICAgIGNvbF90eXBlOiAnaW5wdXQnLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBkZWZhdWx0VmFsdWU6IGdldE15VmFyKCfmkJzntKLlhbPplK7or40nKVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbiAgICBpZiAoZ2V0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScpID09ICcnKSB7XFxcXG4gICAgICAgIGlmIChwYWdlID09IDEpIHtcXFxcbiAgICAgICAgICAgIGxldCBtZW0gPSBzdG9yYWdlMC5nZXRJdGVtKFxcXFxcXFwi6JGr6Iqm5L6gXFxcXFxcXCIsIFtdKTtcXFxcbiAgICAgICAgICAgIGlmIChtZW0ubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBSaWNoKEJpZygn8J+TnSDmkJzntKLljoblj7InKSksXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChlbXB0eSwgZ2V0Q29uZmlybSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Q29uZmlybSgpXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGVtcHR5LCBnZXRDb25maXJtKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogUmljaChDZW50ZXIoXFxcXFxcXCLlloLlloJ+6L+Y5rKh5pCc57Si5ZGi772eKO+/o+KWve+/o++9nil+XFxcXFxcXCIpKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBlbXB0eSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgZm9yIChsZXQgaSA9IG1lbS5sZW5ndGggLSAxOyBpID49IDA7IGktLSkge1xcXFxuICAgICAgICAgICAgICAgIGxldCBpdCA9IG1lbVtpXTtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQsXFxcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFxcXFxcIiNub0xvYWRpbmcjXFxcXFxcXCIpLmxhenlSdWxlKChpdCwgZ2V0U2VhcmNoVXJsLCBlbXB0eSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScsIGl0KTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdldFNlYXJjaFVybChpdClcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZW1wdHk7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0LCBnZXRTZWFyY2hVcmwsIGVtcHR5KSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgIH0pXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9IGVsc2Uge1xcXFxuICAgICAgICBwYXRoID0gJy9wb3N0L3NlYXJjaC9BTkRST0lELzQuMS44J1xcXFxuICAgICAgICBib2R5ID0gJyZzdGFydD0nICsgKHBhZ2UgLSAxKSAqIDIwICsgJyZjb3VudD0yMCZjYXRfaWQ9NDMma2V5d29yZD0nICsgZ2V0TXlWYXIoJ+aQnOe0ouWFs+mUruivjScpICsgJyZmbGFnPTAnXFxcXG4gICAgICAgIGRhdGUgPSBnZXRDb25maWdVcmwocGF0aCwgYm9keSlcXFxcbiAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgIGxheW91dFNlYXJjaFBhcnNlKGQsIGRhdGUucG9zdHMpXFxcXG4gICAgICAgIH0gY2F0Y2ggKGUpIHtcXFxcbiAgICAgICAgICAgIGlmIChwYWdlID09IDEpIHtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogUmljaChDZW50ZXIoZGF0ZS5tc2cpKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBlbXB0eSxcXFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzEnLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGluZVZpc2libGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9XFxcXG4gICAgfVxcXFxufVxcXCJ9XVwifSIsInRpdGxlIjoi6K+m5oOF6aG16Z2iIn0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement