Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥立刻播放快乐再出发第二季@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZmllbGRzVG9TZXRUb0RlZmF1bHRcIjpbXSxcImlkXCI6MCxcImxhc3RfY2hhcHRlcl9ydWxlXCI6XCJcIixcImxpc3RUb0NsZWFyQXNzb2NpYXRlZEZLXCI6W10sXCJsaXN0VG9DbGVhclNlbGZGS1wiOltdLFwicGFnZUxpc3RcIjpbe1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuS6jOe6p+ino+aekFwiLFwicGF0aFwiOlwicFwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG5sZXQgdXJsID0gYmFzZTY0RGVjb2RlKGdldFBhcmFtKFxcXCJ1XFxcIikpO1xcbmxldCBodG1sID0gcmVxdWVzdCh1cmwpO1xcbmxldCBhbGlzdCA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJmFcXFwiKTtcXG5sZXQgYXJyID0gYWxpc3QubWFwKGl0ID0+IHtcXG4gICAgcmV0dXJuIHtcXG4gICAgICAgIC8vaHRtbDogaXQsXFxuICAgICAgICB0ZXh0OiBwZGZoKGl0LCBcXFwiYSYmVGV4dFxcXCIpLFxcbiAgICAgICAgdGl0bGU6IHBkZmgoaXQsIFxcXCJhJiZ0aXRsZVxcXCIpLFxcbiAgICAgICAgaHJlZjogcGQoaXQsIFxcXCJhJiZocmVmXFxcIiwgdXJsKVxcbiAgICB9XFxufSk7XFxuLy9sb2coYXJyKTtcXG5sZXQgZGVidWcgPSBmYWxzZTtcXG5cXG5mdW5jdGlvbiBjbGVhclRleHQoaXQp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Vidmlld19zaW5nbGVcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcImZsb2F0JiYxMDAlXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBjYW5CYWNrOiB0cnVlXFxuICAgICAgICB9XFxuICAgIH0pO1xcbiAgICB0b2FzdChcXFwiQUnljLnphY3lpLHotKXvvIzlt7Lkvb/nlKhYNeWKoOi9vVxcXCIpO1xcbiAgICBzZXRSZXN1bHQoZCk7XFxufSBlbHNlIHtcXG4gICAgLy/kuLrnur/ot6/liqDliIblibLnur9cXG4gICAgbGV0IGQyID0gW107XFxuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZC5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgZDIucHVzaChkW2ldKTtcXG4gICAgICAgIGlmIChpIDwgZC5sZW5ndGggLSAxKSB7XFxuICAgICAgICAgICAgbGV0IGl0ID0gZFtpXTtcXG4gICAgICAgICAgICBsZXQgdDEgPSBwYXJzZUludChjbGVhclRleHQoaXQudGl0bGUpKTtcXG4gICAgICAgICAgICBsZXQgbmV4dCA9IGRbaSArIDFdO1xcbiAgICAgICAgICAgIGxldCB0MiA9IHBhcnNlSW50KGNsZWFyVGV4dChuZXh0LnRpdGxlKSk7XFxuICAgICAgICAgICAgaWYgKHQyIC0gdDEgPiAxIHx8IHQxIC0gdDIgPiAxKSB7XFxuICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJiaWdfYmxhbmtfYmxvY2tcXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwibGluZV9ibGFua1xcXCJcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgIGQyLnB1c2goe1xcbiAgICAgICAgICAgIC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IgKyBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChkKTtcXG4gICAgbG9nKGRhdGEubGVuZ3RoKTtcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgLy/lpJrnur/nqIvliqDovb0gICAgICAgIFxcbiAgICAgICAgbGV0IHJlYWxQYWdlID0gXFxcIlxcXCIgPT0gciA/IDEgOiBwO1xcbiAgICAgICAgbGV0IHRhc2tzID0gZGF0YS5tYXAoaXQgPT4ge1xcbiAgICAgICAgICAgIHJldHVybiB7XFxuICAgICAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHJ1bGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmZpbmQocywgcmVhbFBhZ2UpO1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBwYXJhbTogaXQsXFxuICAgICAgICAgICAgICAgIGlkOiBcXFwicnVsZUBcXFwiICsgaXQubmFtZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgIC8vbG9nKFxcXCJsaXN0ZW5lcjogXFxcIiArIChyZXN1bHQgfHwgW10pLmxlbmd0aClcXG4gICAgICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5qID0gcGFyYW0uaiArIDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUocGFnZWlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogd3JhcChpdC50aXRsZSwgcyksXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBpdC5kZXNjLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBpdC5waWNfdXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LnBpY191cmwgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYTogaXQuZXh0cmFcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcblxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYWdlaWQpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBNWV9QQUdFICsgXFxcIumhteS4re+8jOi/m+W6pu+8mlxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcIi9cXFwiICsgcGFyYW0uYWxsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgaTogMCxcXG4gICAgICAgICAgICAgICAgajogLTFcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxufSBlbHNlIHtcXG4gICAgbGV0IHtcXG4gICAgICAgIGxvYWRcXG4gICAgfSA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2RhdGFcXFwiKTtcXG4gICAgbGV0IGRhdGEgPSBsb2FkKC0xLCBudWxsKTtcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIkFJ5oqA5pyvXFxcIixcXG4gICAgICAgICAgICB1cmw6IFxcXCJjb25maXJtOi8v5Z+65LqOQUnor4bniYfoh6rliqjliIbmnpDmupDnoIHmioDmnK/vvIzku6PnoIHlrozlhajlvIDmupDvvIzmlbDmja7mnaXmupDkuo7ljp/nvZHnq5nvvIzova/ku7blkozop4TliJnkuI3mj5Dkvpvku7vkvZXlhoXlrrkuanM6JydcXFwiLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiXFxuICAgICAgICB9KTtcXG4gICAgICAgIGZvciAobGV0IGl0IG9mIGRhdGEpIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiBcXFwic2VsZWN0Oi8vXFxcIiArIEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6K+36YCJ5oup5pON5L2cXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbDogMSxcXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IFtcXFwi6K6/6Zeu6aaW6aG1XFxcIiwgXFxcIuaQnOe0ouatpOermVxcXCJdLFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpbnB1dCA9PSBcXFwi6K6/6Zeu6aaW6aG1XFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9VUkwgPSB1cmw7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwieDU6Ly9cXFwiICsgZ2V0SG9tZSh1cmwpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2Uvc2luZ2xlc1xcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9LCBpdC51cmwpXFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBj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dWVzdCh1cmwpO1xcbiAgICAgICAgLy/oh6rliqjov4fpqozor4HnoIHlkozpopHnuYHorr/pl67pmZDliLZcXG4gICAgICAgIGxldCB7XFxuICAgICAgICAgICAgY2hlY2ssIHRlc3RcXG4gICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS95em1cXFwiKTtcXG4gICAgICAgIGlmIChjaGVjayh1cmwsIGh0bWwsIGQpKSB7XFxuICAgICAgICAgICAgbG9nKFxcXCLph43or5XkuoZcXFwiKTtcXG4gICAgICAgICAgICBodG1sID0gcmVxdWVzdCh1cmwsIHtcXG4gICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiB1cmxcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pOyAgICAgICAgICAgXFxuICAgICAgICB9ICAgICAgICAgXFxuICAgICAgICB0ZXN0KHVybCwgaHRtbCwgZCwgb2xkLCBrZXksIHJ1bGUpO1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgLy/oh6rliqjor4bliKtwb3N06K+35rGCXFxuICAgICAgICBodG1sID0gcmVxdWVzdCh1cmwpO1xcbiAgICAgICAgbGV0IGZvcm0gPSBwZGZoKGh0bWwsIFxcXCJib2R5JiZmb3JtJiZIdG1sXFxcIik7XFxuICAgICAgICBsZXQgYWN0aW9uID0gcGQoaHRtbCwgXFxcImZvcm0mJmFjdGlvblxcXCIsIHVybCk7XFxuICAgICAgICBsZXQgaW5wdXRzID0gcGRmYShodG1sLCBcXFwiYm9keSYmZm9ybSYmaW5wdXRcXFwiKTtcXG4gICAgICAgIGxldCBib2R5ID0ge307XFxuICAgICAgICBmb3IgKGxldCBpdCBvZiBpbnB1dHMpIHtcXG4gICAgICAgICAgICBsZXQgbmFtZSA9IHBkZmgoaXQsIFxcXCJpbnB1dCYmbmFtZVxcXCIpO1xcbiAgICAgICAgICAgIGlmIChuYW1lICYmIG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AgICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpee9keermeWQjeensFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCduYW1lJywgaW5wdXQpXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJhaWFkZFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpee9keermeaQnOe0ouWcsOWdgFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImlucHV0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGVWaXNpYmxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgICAgICBvbkNoYW5nZTogXFxcInB1dE15VmFyKCdzdXJsJywgaW5wdXQpXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBjbHM6IFxcXCJhaWFkZFxcXCJcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAge1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmj5DkuqTkv53lrZhcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1cmwgPSBnZXRNeVZhcihcXFwic3VybFxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IGdldE15VmFyKFxcXCJuYW1lXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdXJsID09IFxcXCJcXFwiIHx8IG5hbWUgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+ivt+i+k+WFpeWujOaVtOWGheWuuVxcXCJcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHIgPSBkZWNvZGVVUklDb21wb25lbnQoc3VybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgciA9IHIucmVwbGFjZShuZXcgUmVnRXhwKFxcXCJbXFxcXHU0ZTAwLVxcXFx1OWZhNV0rXFxcIiwgXFxcImdcXFwiKSwgXFxcIioqXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkUnVsZVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kYXRhXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgYWRkUnVsZShuYW1lLCByKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7Lkv53lrZhcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgfSksXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcImFpYWRkXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgXSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSwgTVlfUlVMRS50aXRsZSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImZsZXhfYnV0dG9uXFxcIixcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIiAtIFxcXCIsXFxuICAgICAgICB1cmw6IFxcXCJzZWxlY3Q6Ly9cXFwiICsgSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgIG9wdGlvbnM6IG5hbWVzLFxcbiAgICAgICAgICAgIHRpdGxlOiBcXFwi6K+36YCJ5oup6KaB5Yig6Zmk55qE56uZ54K5XFxcIixcXG4gICAgICAgICAgICBqczogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgICAgIGxldCB7XFxuICAgICAgICAgICAgICAgICAgICByZW1vdmVSdWxlXFxuICAgICAgICAgICAgICAgIH0gPSAkLnJlcXVpcmUoXFxcImhpa2VyOi8vcGFnZS9kYXRhXFxcIik7XFxuICAgICAgICAgICAgICAgIHJlbW92ZVJ1bGUoaW5wdXQpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vT0tcXFwiO1xcbiAgICAgICAgICAgIH0pXFxuICAgICAgICB9KSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiZmxleF9idXR0b25cXFwiLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogTVlfUlVMRS50aXRsZSArIFxcXCJhaXNkZWxcXFwiXFxuICAgICAgICB9XFxuICAgIH0pO1xcbn1cIn0se1wiY29sX3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CIsXFxuICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgY2FuQmFjazogdHJ1ZVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgdG9hc3QoXFxcIkFJ5Yy56YWN5aSx6LSl77yM5bey5L2/55SoWDXliqDovb1cXFwiKTtcXG4gICAgc2V0UmVzdWx0KGQpO1xcbn0gZWxzZSB7XFxuICAgIC8v5Li657q/6Lev5Yqg5YiG5Ymy57q/XFxuICAgIGxldCBkMiA9IFtdO1xcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IGQubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgIGQyLnB1c2goZFtpXSk7XFxuICAgICAgICBpZiAoaSA8IGQubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgIGxldCBpdCA9IGRbaV07XFxuICAgICAgICAgICAgbGV0IHQxID0gcGFyc2VJbnQoY2xlYXJUZXh0KGl0LnRpdGxlKSk7XFxuICAgICAgICAgICAgbGV0IG5leHQgPSBkW2kgKyAxXTtcXG4gICAgICAgICAgICBsZXQgdDIgPSBwYXJzZUludChjbGVhclRleHQobmV4dC50aXRsZSkpO1xcbiAgICAgICAgICAgIGlmICh0MiAtIHQxID4gMSB8fCB0MSAtIHQyID4gMSkge1xcbiAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImxpbmVfYmxhbmtcXFwiXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwiYmlnX2JsYW5rX2Jsb2NrXFxcIlx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gICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgZXh0cmE6IHtcXFxcbiAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH0pO1xcXFxuICAgIH1cXFxcbiAgICBzZXRSZXN1bHQoZCk7XFxcXG4gICAgbG9nKGRhdGEubGVuZ3RoKTtcXFxcbiAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgIC8v5aSa57q/56iL5Yqg6L29ICAgICAgICBcXFxcbiAgICAgICAgbGV0IHJlYWxQYWdlID0gXFxcXFxcXCJcXFxcXFxcIiA9PSByID8gMSA6IHA7XFxcXG4gICAgICAgIGxldCB0YXNrcyA9IGRhdGEubWFwKGl0ID0+IHtcXFxcbiAgICAgICAgICAgIHJldHVybiB7XFxcXG4gICAgICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcXFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcnVsZS5maW5kKHMsIHJlYWxQYWdlKTtcXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHBhcmFtOiBpdCxcXFxcbiAgICAgICAgICAgICAgICBpZDogXFxcXFxcXCJydWxlQFxcXFxcXFwiICsgaXQubmFtZVxcXFxuICAgICAgICAgICAgfVxcXFxuICAgICAgICB9KTtcXFxcblxcXFxuICAgICAgICBiYXRjaEV4ZWN1dGUodGFza3MsIHtcXFxcbiAgICAgICAgICAgIGZ1bmM6IGZ1bmN0aW9uKHBhcmFtLCBpZCwgZXJyb3IsIHJlc3VsdCkge1xcXFxuICAgICAgICAgICAgICAgIC8vbG9nKFxcXFxcXFwibGlzdGVuZXI6IFxcXFxcXFwiICsgKHJlc3VsdCB8fCBbXSkubGVuZ3RoKVxcXFxuICAgICAgICAgICAgICAgIHBhcmFtLmkgPSBwYXJhbS5pICsgMTtcXFxcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBpdCBvZiByZXN1bHQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5qID0gcGFyYW0uaiArIDE7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHdyYXAoaXQudGl0bGUsIHMpLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBpdC5kZXNjLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaXQucGljX3VybCxcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IGl0LnBpY191cmwgPyAnbW92aWVfMV92ZXJ0aWNhbF9waWMnIDogXFxcXFxcXCJ0ZXh0XzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IGl0LmV4dHJhXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXFxcblxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0uaSA+PSBwYXJhbS5hbGwpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYWdlaWQpXFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcXFxcXCLliqDovb3nrKxcXFxcXFxcIiArIE1ZX1BBR0UgKyBcXFxcXFxcIumhteS4re+8jOi/m+W6pu+8mlxcXFxcXFwiICsgKHBhcmFtLmkgKyAxKSArIFxcXFxcXFwiL1xcXFxcXFwiICsgcGFyYW0uYWxsLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFxcXFxcIlxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwidGV4dF9jZW50ZXJfMVxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBwYWdlaWRcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfSlcXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgcGFyYW06IHtcXFxcbiAgICAgICAgICAgICAgICBhbGw6IGRhdGEubGVuZ3RoLFxcXFxuICAgICAgICAgICAgICAgIGk6IDAsXFxcXG4gICAgICAgICAgICAgICAgajogLTFcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSlcXFxcbiAgICB9XFxcXG59IGVsc2Uge1xcXFxuICAgIGxldCB7XFxcXG4gICAgICAgIGxvYWRcXFxcbiAgICB9ID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2RhdGFcXFxcXFxcIik7XFxcXG4gICAgbGV0IGRhdGEgPSBsb2FkKC0xLCBudWxsKTtcXFxcbiAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxcXG4gICAgICAgIGQucHVzaCh7XFxcXG4gICAgICAgICAgICB0aXRsZTogXFxcXFxcXCJBSeaKgOacr1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgdXJsOiBcXFxcXFxcImNvbmZpcm06Ly/ln7rkuo5BSeivhueJh+iHquWKqOWIhuaekOa6kOeggeaKgOacr++8jOS7o+eggeWujOWFqOW8gOa6kO+8jOaVsOaNruadpea6kOS6juWOn+e9keerme+8jOi9r+S7tuWSjOinhOWImeS4jeaPkOS+m+S7u+S9leWGheWuuS5qczonJ1xcXFxcXFwiLFxcXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXFxcXFwiZmxleF9idXR0b25cXFxcXFxcIlxcXFxuICAgICAgICB9KTtcXFxcbiAgICAgICAgZm9yIChsZXQgaXQgb2YgZGF0YSkge1xcXFxuICAgICAgICAgICAgZC5wdXNoKHtcXFxcbiAgICAgICAgICAgICAgICB0aXRsZTogaXQubmFtZSxcXFxcbiAgICAgICAgICAgICAgICB1cmw6IFxcXFxcXFwic2VsZWN0Oi8vXFxcXFxcXCIgKyBKU09OLnN0cmluZ2lmeSh7XFxcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFxcXFxcIuivt+mAieaLqeaTjeS9nFxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgICAgICBjb2w6IDEsXFxcXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IFtcXFxcXFxcIuiuv+mXrummlumhtVxcXFxcXFwiLCBcXFxcXFxcIuaQnOe0ouatpOermVxcXFxcXFwiXSxcXFxcbiAgICAgICAgICAgICAgICAgICAganM6ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlucHV0ID09IFxcXFxcXFwi6K6/6Zeu6aaW6aG1XFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBNWV9VUkwgPSB1cmw7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwieDU6Ly9cXFxcXFxcIiArIGdldEhvbWUodXJsKVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcXFxcXCJoaWtlcjovL3BhZ2Uvc2luZ2xlc1xcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICAgICAgICAgIH0sIGl0LnVybClcXFxcbiAgICAgICAgICAgICAgICB9KSxcXFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcXFxcXCJmbGV4X2J1dHRvblxcXFxcXFwiLFxcXFxuICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgcGljX3VybDogXFxcXFxcXCJcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICBSVUxFOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBpdC5uYW1lLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBpdC51cmxcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgIH0pO1xcXFxuICAgICAgICB9XFxcXG4gICAgICAgICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9tYW5hZ2VcXFxcXFxcIikoZCwgZGF0YS5tYXAoaXQgPT4gaXQubmFtZSkpO1xcXFxuICAgIH1cXFxcbn1cXFxcblxcXFxuc2V0UmVzdWx0KGQpO1xcXCJ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ICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwiXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXFxcXFwi6K+36L6T5YWl572R56uZ5pCc57Si5Zyw5Z2AXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcImlucHV0XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZVZpc2libGU6IGZhbHNlLFxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgb25DaGFuZ2U6IFxcXFxcXFwicHV0TXlWYXIoJ3N1cmwnLCBpbnB1dClcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNsczogXFxcXFxcXCJhaWFkZFxcXFxcXFwiXFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9LFxcXFxuICAgICAgICAgICAgICAgIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXFxcXFwi5o+Q5Lqk5L+d5a2YXFxcXFxcXCIsXFxcXG4gICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFxcXFxcInRleHRfY2VudGVyXzFcXFxcXFxcIixcXFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiAkKFxcXFxcXFwiI25vTG9hZGluZyNcXFxcXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN1cmwgPSBnZXRNeVZhcihcXFxcXFxcInN1cmxcXFxcXFxcIiwgXFxcXFxcXCJcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbmFtZSA9IGdldE15VmFyKFxcXFxcXFwibmFtZVxcXFxcXFwiLCBcXFxcXFxcIlxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdXJsID09IFxcXFxcXFwiXFxcXFxcXCIgfHwgbmFtZSA9PSBcXFxcXFxcIlxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly/or7fovpPlhaXlrozmlbTlhoXlrrlcXFxcXFxcIlxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHIgPSBkZWNvZGVVUklDb21wb25lbnQoc3VybCk7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICByID0gci5yZXBsYWNlKG5ldyBSZWdFeHAoXFxcXFxcXCJbXFxcXFxcXFx1NGUwMC1cXFxcXFxcXHU5ZmE1XStcXFxcXFxcIiwgXFxcXFxcXCJnXFxcXFxcXCIpLCBcXFxcXFxcIioqXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRSdWxlXFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9ID0gJC5yZXF1aXJlKFxcXFxcXFwiaGlrZXI6Ly9wYWdlL2RhdGFcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICBhZGRSdWxlKG5hbWUsIHIpO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFxcXFxcInRvYXN0Oi8v5bey5L+d5a2YXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH0pLFxcXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgY2xzOiBcXFxcXFxcImFpYWRkXFxcXFxcXCJcXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICA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IgKyBydWxlICsgXFxcXFxcXCI8L2ZvbnQ+XFxcXFxcXCIsXFxcXG4gICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgodXJsLCBvbGQsIGtleSwgcnVsZSkgPT4ge1xcXFxuICAgICAgICAgICAgICAgIGxldCBzcCA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS9zcFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQgZCA9IHNwKG9sZCwga2V5LCBydWxlKTtcXFxcbiAgICAgICAgICAgICAgICBsZXQge1xcXFxuICAgICAgICAgICAgICAgICAgICB3cmFwXFxcXG4gICAgICAgICAgICAgICAgfSA9ICQucmVxdWlyZShcXFxcXFxcImhpa2VyOi8vcGFnZS90b29sXFxcXFxcXCIpO1xcXFxuICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIGQpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaXQudGl0bGUgPSB3cmFwKGl0LnRpdGxlLCBrZXkpO1xcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIodXJsLCBkKTtcXFxcbiAgICAgICAgICAgICAgICBkZWxldGVJdGVtKHVybCk7XFxcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXFxcXFwidG9hc3Q6Ly9PS1xcXFxcXFwiO1xcXFxuICAgICAgICAgICAgfSwgdXJsLCBvbGQsIGtleSwgcnVsZSksXFxcXG4gICAgICAgICAgICBleHRyYToge1xcXFxuICAgICAgICAgICAgICAgIGlkOiB1cmxcXFxcbiAgICAgICAgICAgIH1cXFxcbiAgICAgICAgfSk7XFxcXG4gICAgfVxcXFxufVxcXFxuXFxcXG4kLmV4cG9ydHMgPSB7XFxcXG4gICAgY2hlY2s6IGNoZWNrLFxcXFxuICAgIHRlc3Q6IHRlc3RcXFxcbn1cXFwifSx7XFxcImNvbF90eXBlXFxcIjpcXFwibW92aWVfM1xcXCIsXFxc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