Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥孤注一掷@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImdtdE1vZGlmaWVkXCI6MCxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuiwg+eUqFwiLFwicGF0aFwiOlwic2hhcmVcIixcInJ1bGVcIjpcImpzOlxcbnZhciByZXMgPSB7fTtcXG52YXIgZCA9IFtdXFxuaWYgKE1ZX1BBR0UgPT0gMSkge1xcbiAgICB2YXIg5o6S5bqPID0gW1xcXCLih4XlkI3np7DmraPluo9cXFwiLCBcXFwi4oeF5ZCN56ew5YCS5bqPXFxcIiwgXFxcIuKHheaXtumXtOato+W6j1xcXCIsIFxcXCLih4Xml7bpl7TlgJLluo9cXFwiLCBdO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGdldEl0ZW0oJ+aOkuW6j+WQjeensCcsIOaOkuW6j1swXSksXFxuICAgICAgICB1cmw6ICQo5o6S5bqPLCAxLCAn6K+36YCJ5oupJykuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBzZXRJdGVtKCfmjpLluo/lkI3np7AnLCBpbnB1dCk7XFxuICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICBjYXNlICflkI3np7DmraPluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ2ZpbGVfbmFtZTphc2MnKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICflkI3np7DlgJLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ2ZpbGVfbmFtZTpkZXNjJylcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICfml7bpl7TmraPluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ3VwZGF0ZWRfYXQ6YXNjJylcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICfml7bpl7TlgJLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ3VwZGF0ZWRfYXQ6ZGVzYycpXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInXFxuICAgIH0pXFxuICAgIHZhciDmoLflvI8gPSBbXFxcIuWIl+ihqOaooeW8j1xcXCIsIFxcXCLmlofku7blkI3mqKHlvI9cXFwiXTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBnZXRJdGVtKCfmoLflvI/lkI3np7AnLCDmoLflvI9bMF0pLFxcbiAgICAgICAgdXJsOiAkKOagt+W8jywgMSwgJ+ivt+mAieaLqScpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgc2V0SXRlbSgn5qC35byP5ZCN56ewJywgaW5wdXQpO1xcbiAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAn5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ZSgoZmlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZmlkJywgZmlkKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2hhcmU/PycgKyBmaWQgKyAnPz9meXBhZ2UnXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uZmlkKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IGdldEl0ZW0oJ+agt+W8jycsICdhdmF0YXInKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLmZpbGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogJC5kYXRlRm9ybWF0KGl0ZW0udXBkYXRlZF9hdCwgJ3l5eXktTU0tZGQnKSArICcgICcgKyBzaXplKGl0ZW0uc2l6ZSksXFxuICAgICAgICAgICAgICAgIGltZzogaXRlbS50aHVtYm5haWwsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChmaWQsIHRva2VuLCBwd2RfaWQsIGNhdGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3Rvb2xzJykpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICdodHRwczovL3Bhbi5xdWFyay5jbi8xL2Nsb3VkZHJpdmUvZmlsZS9zaGFyZS9kb3dubG9hZCc7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcXogPSAnJztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjYXRlLm1hdGNoKC9kb2N8aW1hZ2UvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArICc/cHI9dWNwcm8mZnI9aDUnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHF6ID0gJ2Rvd25sb2FkOi8vJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhdGUubWF0Y2goL3ZpZGVvLykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYnMgPSAnI2lzVmlkZW89dHJ1ZSMnXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjYXRlLm1hdGNoKC9tdXNpYy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJzID0gJyNpc011c2ljPXRydWUjJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJvZHkgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlkczogW2ZpZF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHdkX2lkOiBwd2RfaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3Rva2VuOiBkZWNvZGVVUklDb21wb25lbnQoZ2V0TXlWYXIoJ3N0b2tlbicpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWRzX3Rva2VuOiBbdG9rZW5dXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gSlNPTi5wYXJzZShwb3N0KHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IGJvZHlcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhWzBdLmRvd25sb2FkX3VybDtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBxeiArIGRhdGEgKyBic1xcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV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ixcXG4gICAgICAgICAgICAgICAgXFxcInZhbGlkaWRcXFwiOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInNlYXJjaHRleHRcXFwiOiBzXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBcXFwicGFnZVxcXCI6IHtcXG4gICAgICAgICAgICAgICAgXFxcInBhZ2VTaXplXFxcIjogMTAsXFxuICAgICAgICAgICAgICAgIFxcXCJwYWdlSW5kZXhcXFwiOiBwYWdlXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBcXFwib3JkZXJcXFwiOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJwcm9wXFxcIjogXFxcImlkXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcIm9yZGVyXFxcIjogXFxcImRlc2NcXFwiXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBcXFwibWVzc2FnZVxcXCI6IFxcXCLor7fmsYLotYTmupDliJfooajmlbDmja5cXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIEpTT04ucGFyc2UocG9zdCgnaHR0cHM6Ly92LmZ1bmxldHUuY29tL3NlYXJjaCcsIHtcXG4gICAgICAgICAgICBib2R5OiBib2R5XFxuICAgICAgICB9KSkuZGF0YS5mb3JFYWNoKGl0ZW0gPT4ge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLnRpdGxlLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+6Laj55uY5pCcPC9mb250PiZuYnNwO1xcXCIgKyBpdGVtLmNhdGVnb3J5ICsgJyAnICsgaXRlbS5maWxldHlwZSArICcgJyArIGl0ZW0udXBkYXRldGltZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBpdGVtLnVybCArICc/P2Z5cGFnZUBydWxlPWpzOiQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3NoYXJlXFxcIiknLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ3RleHRfMSdcXG4gICAgICAgICAgICB9KVxcbiAgICAgICAgfSlcXG4gICAgICAgIHJldHVybiBkO1xcbiAgICB9XFxufSwge1xcbiAgICBuYW1lOiBcXFwi54ix55uY5pCcXFxcIixcXG4gICAgcGFnZTogdHJ1ZSxcXG4gICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgdmFyIGQgPSBbXTtcXG4gICAgICAgIHZhciBodG1sID0gZmV0Y2goYGh0dHBzOi8vYWlwYW5zby5jb20vc2VhcmNoP3BhZ2U9JHtwYWdlfSZrPSR7c30mcz0wJnQ9LTFgKTtcXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnI2FwcCYmYTpoYXModmFuLWNhcmQpJyk7XFxuICAgICAgICBsaXN0LmZvckVhY2goaXRlbSA9PiB7wqBcXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJ2h0dHBzOi8vYWlwYW5zby5jb20nICsgcGRmaChpdGVtLCAnYSYmaHJlZicpO1xcbiAgICAgICAgICAgICAgICB1cmwgPSBKU09OLnBhcnNlKGZldGNoKHVybC5yZXBsYWNlKCcvcy8nLCAnL2N2LycpLCB7XFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgUmVmZXJlcjogdXJsXFxuICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgcmVkaXJlY3Q6IGZhbHNlLFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXG4gICAgICAgICAgICAgICAgfSkpLmhlYWRlcnMubG9jYXRpb25bMF07XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7wqDCoMKgXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCAndGVtcGxhdGUmJlRle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ICAubWFwKGRpdiA9PiB7XFxuICAgICAgICAgICAgICAgIGlmIChwZGZoKGRpdiwgXFxcImEmJlRleHRcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChkaXYsIFxcXCJhJiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPuWwj+S6keaQnOe0ojwvZm9udD4mbmJzcDtcXFwiICsgcGRmaChkaXYsIFxcXCIubGF5dWktY2FyZC1ib2R5JiZUZXh0XFxcIiksXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBiYXNlNjREZWNvZGUocGRmaChkaXYsIFxcXCJkaXYmJnVybFxcXCIpKSArICc/P2Z5cGFnZUBydWxlPWpzOiQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL3NoYXJlXFxcIiknLFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICByZXR1cm4gZFxcbiAgICB9XFxufSwge1xcbiAgICBuYW1lOiBcXFwiS0vnvZHnm5jotYTmupBcXFwiLFxcbiAgICBwYWdlOiB0cnVlLFxcbiAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICB2YXIgZCA9IFtdO1xcbiAgICAgICAgdmFyIGhhc2ggPSBwZGZoKGZldGNoUEMoJ2h0dHBzOi8vd3d3LmtrcGFucy5jb20nKSwgJ2lucHV0W25hbWU9Zm9ybWhhc2hdJiZ2YWx1ZScpO1xcbiAgICAgICAgdmFyIHVybCA9ICdodHRwczovL3d3dy5ra3BhbnMuY29tLycgKyBKU09OLnBhcnNlKHBvc3QoJ2h0dHBzOi8vd3d3LmtrcGFucy5jb20vc2VhcmNoLnBocD9tb2Q9Zm9ydW0nLCB7X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ysXFxcIiArIHAgKyBcXFwi6aG15Lit77yM6L+b5bqm77yaMS9cXFwiICsgZGF0YS5sZW5ndGgsXFxuICAgICAgICAgICAgdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfY2VudGVyXzFcXFwiLFxcbiAgICAgICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KTtcXG4gICAgfVxcbiAgICBzZXRSZXN1bHQoZCk7XFxuICAgIC8vbG9nKGRhdGEubGVuZ3RoKTtcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgLy/lpJrnur/nqIvliqDovb0gICAgICAgIFxcbiAgICAgICAgbGV0IHJlYWxQYWdlID0gXFxcIlxcXCIgPT0gciA/IDEgOiBwO1xcbiAgICAgICAgbGV0IHRhc2tzID0gZGF0YS5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHJ1bGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmZpbmQocywgcmVhbFBhZ2UpO1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBwYXJhbTogaXQsXFxuICAgICAgICAgICAgICAgIGlkOiBcXFwicnVsZUBcXFwiICsgaXQubmFtZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgIC8vbG9nKFxcXCJsaXN0ZW5lcjogXFxcIiArIChyZXN1bHQgfHwgW10pLmxlbmd0aClcXG4gICAgICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5qID0gcGFyYW0uaiArIDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUocGFnZWlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUuaW5jbHVkZXMoXFxcIuKAnOKAnOKAneKAnVxcXCIpID8gaXQudGl0bGUgOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIGl0LnRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiPGVtPnw8L2VtPlxcXCIsIFxcXCJnXFxcIiksIFxcXCJcXFwiKS5yZXBsYWNlKG5ldyBSZWdFeHAocywgXFxcImdcXFwiKSwgXFxcIjxzdHJvbmc+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjogIzFFOTBGRlxcXFxcXFwiPlxcXCIgKyBzICsgXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCA/ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycgOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJfX2FwcFxcXCIgKyBNWV9QQUdFICsgXFxcIkBcXFwiICsgcGFyYW0uaixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG5cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0uaSA+PSBwYXJhbS5hbGwpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliqDovb3nrKxcXFwiICsgTVlfUEFHRSArIFxcXCLpobXkuK3vvIzov5vluqbvvJpcXFwiICsgKHBhcmFtLmkgKyAxKSArIFxcXCIvXFxcIiArIHBhcmFtLmFsbCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcbiAgICAgICAgICAgICAgICAg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Lluo9cXFwiLCBdO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGdldEl0ZW0oJ+aOkuW6j+WQjeensCcsIOaOkuW6j1swXSksXFxuICAgICAgICB1cmw6ICQo5o6S5bqPLCAxLCAn6K+36YCJ5oupJykuc2VsZWN0KCgpID0+IHtcXG4gICAgICAgICAgICBzZXRJdGVtKCfmjpLluo/lkI3np7AnLCBpbnB1dCk7XFxuICAgICAgICAgICAgc3dpdGNoIChpbnB1dCkge1xcbiAgICAgICAgICAgICAgICBjYXNlICflkI3np7DmraPluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ2ZpbGVfbmFtZTphc2MnKTtcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICflkI3np7DlgJLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ2ZpbGVfbmFtZTpkZXNjJylcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICfml7bpl7TmraPluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ3VwZGF0ZWRfYXQ6YXNjJylcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgICAgICBjYXNlICfml7bpl7TlgJLluo8nOlxcbiAgICAgICAgICAgICAgICAgICAgc2V0SXRlbSgn5o6S5bqPJywgJ3VwZGF0ZWRfYXQ6ZGVzYycpXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgIH0pLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInXFxuICAgIH0pXFxuICAgIHZhciDmoLflvI8gPSBbXFxcIuWIl+ihqOaooeW8j1xcXCIsIFxcXCLmlofku7blkI3mqKHlvI9cXFwiXTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBnZXRJdGVtKCfmoLflvI/lkI3np7AnLCDmoLflvI9bMF0pLFxcbiAgICAgICAgdXJsOiAkKOagt+W8jywgMSwgJ+ivt+mAieaLqScpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgc2V0SXRlbSgn5qC35byP5ZCN56ewJywgaW5wdXQpO1xcbiAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXG4gICAgICAgICAgICAgICAgY2FzZSAn5YiX6KGo5qih5byPJzpcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oJ+agt+W8jycsICdhdmF0YXInKVxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxuICAgICAgICAgICAgICAgIGNhc2UgJ+aWh+S7tuWQjeaooeW8jyc6XFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCfmoLflvI8nLCAndGV4dF8xJylcXG4gICAgICAgICAgICAgICAgICAgIGJyZWFrO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfMidcXG4gICAgfSlcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIGNvbF90eXBlOiAnbGluZV9ibGFuaydcXG4gICAgfSlcXG59XFxuXFxuZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdG9vbHMnKSkucnVsZSk7XFxuXFxuLy/liKTmlq3mnaXot69cXG5pZiAoTVlfVVJMLmluY2x1ZGVzKCdodHRwJykpIHtcXG4gICAgdmFyIHB3ZF9pZCA9IE1ZX1VSTC5tYXRjaCgvWzAtOWEtekEtWl17MTIsMTN9LylbMF07XFxuICAgIHB1dE15VmFyKCdwd2RfaWQnLCBwd2RfaWQpXFxuICAgIHZhciBmaWQgPSAnJztcXG4gICAgaWYgKE1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AgICAgICAgICB0aXRsZTogaXRlbS5maWxlX25hbWUsXFxuICAgICAgICAgICAgICAgIGRlc2M6ICQuZGF0ZUZvcm1hdChpdGVtLnVwZGF0ZWRfYXQsICd5eXl5LU1NLWRkJykgKyAnICAnICsgaXRlbS5pbmNsdWRlX2l0ZW1zICsgJ+mhuSAgJyxcXG4gICAgICAgICAgICAgICAgaW1nOiAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8yNy5zdmcnLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoZmlkKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcignZmlkJywgZmlkKVxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2hhcmU/PycgKyBmaWQgKyAnPz9meXBhZ2UnXFxuICAgICAgICAgICAgICAgIH0sIGl0ZW0uZmlkKSxcXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IGdldEl0ZW0oJ+agt+W8jycsICdhdmF0YXInKSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLmZpbGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogJC5kYXRlRm9ybWF0KGl0ZW0udXBkYXRlZF9hdCwgJ3l5eXktTU0tZGQnKSArICcgICcgKyBzaXplKGl0ZW0uc2l6ZSksXFxuICAgICAgICAgICAgICAgIGltZzogaXRlbS50aHVtYm5haWwsXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChmaWQsIHRva2VuLCBwd2RfaWQsIGNhdGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShmZXRjaCgnaGlrZXI6Ly9wYWdlL3Rvb2xzJykpLnJ1bGUpO1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICdodHRwczovL3Bhbi5xdWFyay5jbi8xL2Nsb3VkZHJpdmUvZmlsZS9zaGFyZS9kb3dubG9hZCc7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgcXogPSAnJztcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjYXRlLm1hdGNoKC9kb2N8aW1hZ2UvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArICc/cHI9dWNwcm8mZnI9aDUnO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHF6ID0gJ2Rvd25sb2FkOi8vJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhdGUubWF0Y2goL3ZpZGVvLykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYnMgPSAnI2lzVmlkZW89dHJ1ZSMnXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2VcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjYXRlLm1hdGNoKC9tdXNpYy8pKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJzID0gJyNpc011c2ljPXRydWUjJ1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgbGV0IGJvZHkgPSBKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlkczogW2ZpZF0sXFxuICAgICAgICAgICAgICAgICAgICAgICAgcHdkX2lkOiBwd2RfaWQsXFxuICAgICAgICAgICAgICAgICAgICAgICAgc3Rva2VuOiBkZWNvZGVVUklDb21wb25lbnQoZ2V0TXlWYXIoJ3N0b2tlbicpKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWRzX3Rva2VuOiBbdG9rZW5dXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBkYXRhID0gSlNPTi5wYXJzZShwb3N0KHVybCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IGJvZHlcXG4gICAgICAgICAgICAgICAgICAgIH0pKS5kYXRhWzBdLmRvd25sb2FkX3VybDtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBxeiArIGRhdGEgKyBic1xcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV9maWRfdG9rZW4sIGdldE15VmFyKCdwd2RfaWQnKSwgaXRlbS5vYmpfY2F0ZWdvcnkpLFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogZ2V0SXRlbSgn5qC35byPJywgJ2F2YXRhcicpLFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZmlkLFxcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlsaXN0ICcgKyBpdGVtLm9ial9jYXRlZ29yeVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgY29sX3R5cGU6ICdsaW5lJ1xcbiAgICAgICAgfSlcXG4gICAgfSlcXG59IGVsc2Uge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfigJzigJwnICsgKGdldE15VmFyKCdtc2cnLCAnJykgPT0gJycgPyBjb2RlLm1lc3NhZ2UgOiBnZXRNeVZhcignbXNnJywgJycpKSArICfigJ3igJ0nLFxcbiAgICAgICAgdXJsOiAnaGlrZXI6Ly9lbXB0eScsXFxuICAgICAgICBjb2xfdHlwZTogJ3RleHRfY2VudGVyXzEnLFxcbiAgICAgICAgZX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gICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICBjYXNlICflkI3np7DlgJLluo8nOlxcXFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCfmjpLluo8nLCAnZmlsZV9uYW1lOmRlc2MnKVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICBjYXNlICfml7bpl7TmraPluo8nOlxcXFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCfmjpLluo8nLCAndXBkYXRlZF9hdDphc2MnKVxcXFxuICAgICAgICAgICAgICAgICAgICBicmVhaztcXFxcbiAgICAgICAgICAgICAgICBjYXNlICfml7bpl7TlgJLluo8nOlxcXFxuICAgICAgICAgICAgICAgICAgICBzZXRJdGVtKCfmjpLluo8nLCAndXBkYXRlZF9hdDpkZXNjJylcXFxcbiAgICAgICAgICAgICAgICAgICAgYnJlYWs7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcXFxuICAgICAgICB9KSxcXFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0XzInXFxcXG4gICAgfSlcXFxcbiAgICB2YXIg5qC35byPID0gW1xcXFxcXFwi5YiX6KGo5qih5byPXFxcXFxcXCIsIFxcXFxcXFwi5paH5Lu25ZCN5qih5byPXFxcXFxcXCJdO1xcXFxuICAgIGQucHVzaCh7XFxcXG4gICAgICAgIHRpdGxlOiBnZXRJdGVtKCfmoLflvI/lkI3np7AnLCDmoLflvI9bMF0pLFxcXFxuICAgICAgICB1cmw6ICQo5qC35byPLCAxLCAn6K+36YCJ5oupJykuc2VsZWN0KCgpID0+IHtcXFxcbiAgICAgICAgICAgIHNldEl0ZW0oJ+agt+W8j+WQjeensCcsIGlucHV0KTtcXFxcbiAgICAgICAgICAgIHN3aXRjaCAoaW5wdXQpIHtcXFxcbiAgICAgICAgICAgICAgICBjYXNlICfliJfooajmqKHlvI8nOlxcXFxuICAgICAgICAgICAgICAgICAgICBz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iAnaHR0cHM6Ly9oaWtlcmZhbnMuY29tL3R1Ymlhby9tZXNzeS8yNy5zdmcnLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChmaWQpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ2ZpZCcsIGZpZClcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2Uvc2hhcmU/PycgKyBmaWQgKyAnPz9meXBhZ2UnXFxcXG4gICAgICAgICAgICAgICAgfSwgaXRlbS5maWQpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBnZXRJdGVtKCfmoLflvI8nLCAnYXZhdGFyJyksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaW5oZXJpdFRpdGxlOiBmYWxzZVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pXFxcXG4gICAgICAgIH0gZWxzZSB7XFxcXG4gICAgICAgICAgICBkLnB1c2goe1xcXFxuICAgICAgICAgICAgICAgIHRpdGxlOiBpdGVtLmZpbGVfbmFtZSxcXFxcbiAgICAgICAgICAgICAgICBkZXNjOiAkLmRhdGVGb3JtYXQoaXRlbS51cGRhdGVkX2F0LCAneXl5eS1NTS1kZCcpICsgJyAgJyArIHNpemUoaXRlbS5zaXplKSxcXFxcbiAgICAgICAgICAgICAgICBpbWc6IGl0ZW0udGh1bWJuYWlsLFxcXFxuICAgICAgICAgICAgICAgIHVybDogJCgpLmxhenlSdWxlKChmaWQsIHRva2VuLCBwd2RfaWQsIGNhdGUpID0+IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZXZhbChKU09OLnBhcnNlKGZldGNoKCdoaWtlcjovL3BhZ2UvdG9vbHMnKSkucnVsZSk7XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCB1cmwgPSAnaHR0cHM6Ly9wYW4ucXVhcmsuY24vMS9jbG91ZGRyaXZlL2ZpbGUvc2hhcmUvZG93bmxvYWQnO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgcXogPSAnJztcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNhdGUubWF0Y2goL2RvY3xpbWFnZS8pKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyAnP3ByPXVjcHJvJmZyPWg1JztcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHF6ID0gJ2Rvd25sb2FkOi8vJztcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjYXRlLm1hdGNoKC92aWRlby8pKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYnMgPSAnI2lzVmlkZW89dHJ1ZSMnXFxcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZVxcXFxuICAgICAgICAgICAgICAgICAgICBpZiAoY2F0ZS5tYXRjaCgvbXVzaWMvKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGJzID0gJyNpc011c2ljPXRydWUjJ1xcXFxuICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIGxldCBib2R5ID0gSlNPTi5zdHJpbmdpZnkoe1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlkczogW2ZpZF0sXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBwd2RfaWQ6IHB3ZF9pZCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0b2tlbjogZGVjb2RlVVJJQ29tcG9uZW50KGdldE15VmFyKCdzdG9rZW4nKSksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWRzX3Rva2VuOiBbdG9rZW5dXFxcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICAgICAgICAgICAgICB2YXIgZGF0YSA9IEpTT04ucGFyc2UocG9zdCh1cmwsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGJvZHk6IGJvZHlcXFxcbiAgICAgICAgICAgICAgICAgICAgfSkpLmRhdGFbMF0uZG93bmxvYWRfdXJsO1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcXogKyBkYXRhICsgYnNcXFxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV9maWRfdG9rZW4sIGdldE15VmFyKCdwd2RfaWQnKSwgaXRlbS5vYmpfY2F0ZWdvcnkpLFxcXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBnZXRJdGVtKCfmoLflvI8nLCAnYXZhdGFyJyksXFxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWQ6IGl0ZW0uZmlkLFxcXFxuICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICBjbHM6ICdwbGF5bGlzdCAnICsgaXRlbS5vYmpfY2F0ZWdvcnlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9KVxcXFxuICAgICAgICB9XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICBjb2xfdHlwZTogJ2xpbmUnXFxcXG4gICAgICAgIH0pXFxcXG4gICAgfSlcXFxcbn0gZWxzZSB7XFxcXG4gICAgZC5wdXNoKHtcXFxcbiAgICAgICAgdGl0bGU6ICfigJzigJwnICsgKGdldE15VmFyKCdtc2cnLCAnJykgPT0gJycgPyBjb2RlLm1lc3NhZ2UgOiBnZXRNeVZhcignbXNnJywgJycpKSArICfigJ3igJ0nLFxcXFxuICAgICAgICB1cmw6ICdoaWtlcjovL2VtcHR5JyxcXFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXFxcbiAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgIGxpbmVWaX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HVybiBkO1xcXFxuICAgIH1cXFxcbn0sIHtcXFxcbiAgICBuYW1lOiBcXFxcXFxcIueIseebmOaQnFxcXFxcXFwiLFxcXFxuICAgIHBhZ2U6IHRydWUsXFxcXG4gICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcXFxuICAgICAgICB2YXIgZCA9IFtdO1xcXFxuICAgICAgICB2YXIgaHRtbCA9IGZldGNoKGBodHRwczovL2FpcGFuc28uY29tL3NlYXJjaD9wYWdlPSR7cGFnZX0maz0ke3N9JnM9MCZ0PS0xYCk7XFxcXG4gICAgICAgIHZhciBsaXN0ID0gcGRmYShodG1sLCAnI2FwcCYmYTpoYXModmFuLWNhcmQpJyk7XFxcXG4gICAgICAgIGxpc3QuZm9yRWFjaChpdGVtID0+IHvCoFxcXFxuICAgICAgICAgICAgdHJ5IHtcXFxcbiAgICAgICAgICAgICAgICB2YXIgdXJsID0gJ2h0dHBzOi8vYWlwYW5zby5jb20nICsgcGRmaChpdGVtLCAnYSYmaHJlZicpO1xcXFxuICAgICAgICAgICAgICAgIHVybCA9IEpTT04ucGFyc2UoZmV0Y2godXJsLnJlcGxhY2UoJy9zLycsICcvY3YvJyksIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgUmVmZXJlcjogdXJsXFxcXG4gICAgICAgICAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZSxcXFxcbiAgICAgICAgICAgICAgICAgICAgd2l0aEhlYWRlcnM6IHRydWVcXFxcbiAgICAgICAgICAgICAgICB9KSkuaGVhZGVycy5sb2NhdGlvblswXTtcXFxcbiAgICAgICAgICAgICAgICBkLnB1c2goe8KgwqDCoFxcXFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogcGRmaChpdGVtLCAndGVtcGxhdGUmJlRleHQnKSxcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxc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GlmIChkYXRhLmxlbmd0aCA+IDApIHtcXFxcbiAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgcCArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaMS9cXFxcXFxcIiArIGRhdGEubGVuZ3RoLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZGVzYzogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxuICAgIHNldFJlc3VsdChkKTtcXFxcbiAgICAvL2xvZyhkYXRhLmxlbmd0aCk7XFxcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcXFxuICAgICAgICAvL+Wkmue6v+eoi+WKoOi9vSAgICAgICAgXFxcXG4gICAgICAgIGxldCByZWFsUGFnZSA9IFxcXFxcXFwiXFxcXFxcXCIgPT0gciA/IDEgOiBwO1xcXFxuICAgICAgICBsZXQgdGFza3MgPSBkYXRhLm1hcChpdCA9PiB7XFxcXG4gICAgICAgICAgICByZXR1cm4ge1xcXFxuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHJ1bGUpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuZmluZChzLCByZWFsUGFnZSk7XFxcXG4gICAgICAgICAgICAgICAgfSxcXFxcbiAgICAgICAgICAgICAgICBwYXJhbTogaXQsXFxcXG4gICAgICAgICAgICAgICAgaWQ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UU5MEZGXFxcXFxcXFxcXFxcXFxcIj5cXFxcXFxcIiArIHMgKyBcXFxcXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFxcXFxcIiksXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCA/ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycgOiBcXFxcXFxcInRleHRfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXFxcXFwiX19hcHBcXFxcXFxcIiArIE1ZX1BBR0UgKyBcXFxcXFxcIkBcXFxcXFxcIiArIHBhcmFtLmosXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcXFxuXFxcXG4gICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcXFxuICAgICAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHBhZ2VpZClcXFxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuWKoOi9veesrFxcXFxcXFwiICsgTVlfUEFHRSArIFxcXFxcXFwi6aG15Lit77yM6L+b5bqm77yaXFxcXFxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcXFxcXCIvXFxcXFxcXCIgKyBwYXJhbS5hbGwsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJ0ZXh0X2NlbnRlcl8xXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICB9KVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0sXFxcXG4gICAgICAgICAgICBwYXJhbToge1xcXFxuICAgICAgICAgICAgICAgIGFsbDogZGF0YS5sZW5ndGgsXFxcXG4gICAgICAgICAgICAgICAgaTogMCxcXFxcbiAgICAgICAgICAgICAgICBqOiAtMVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KVxcXFxuICAgIH1cXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxcIm5hbWVcXFwiOlxcXCLmkJzntKLpobXpnaJcXFwiLFxcXCJwYXRoXFxcIjpcXFwic291cFxcXCIsXFxcInJ1bGVcXFwiOlxcXCJqczpcXFxcbnZhciBkID0gW107XFxcXG5pZiAoTVlfUEFSQU1TLmtleSkge1xcXFxuICAgIHB1dE15VmFyKFxcXFxcXFwic1xcXFxcXFwiLCBNWV9QQVJBTVMua2V5KTtcXFxcbn1cXFxcbmV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFxcXFxcImhpa2VyOi8vcGFnZS9zb3VcXFxcXFxcIikpLnJ1bGUpO1xcXCJ9XVwifSIsInBpY1VybCI6Imh0dHBzOi8vaGlrZXJmYW5zLmNvbS90dWJpYW8vbWVzc3kvMjcuc3ZnIiwidGl0bGUiOiLlraTms6jkuIDmjrcifQ==
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement