Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@云盘君@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5LqR55uY5ZCbIiwiYXV0aG9yIjoi5bCP5qOJ6KKE8J+MniIsInVybCI6Imhpa2VyOi8vZW1wdHkjI2Z5cGFnZSIsInZlcnNpb24iOjEzLCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIgZCA9IFtdO1xuYWRkTGlzdGVuZXIoXG4gICAgJ29uUmVmcmVzaCcsICQudG9TdHJpbmcoKCkgPT4ge1xuICAgICAgICBjbGVhck15VmFyKCdzJylcbiAgICB9KVxuKVxuZXZhbChKU09OLnBhcnNlKGZldGNoKFwiaGlrZXI6Ly9wYWdlL3NvdVwiKSkucnVsZSk7XG5sZXQgcyA9IGdldE15VmFyKCdzJywgJycpO1xuaWYgKHMgPT0gXCJcIikge1xuICAgIGlmIChNWV9QQUdFID09IDEpIHtcblxuICAgICAgICBoZWFkZXIgPSB7XG4gICAgICAgICAgICAnVXNlci1BZ2VudCc6ICdNb3ppbGxhLzUuMCAoTGludXg7IEFuZHJvaWQgNi4wOyBOZXh1cyA1IEJ1aWxkL01SQTU4TikgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC41MSBNb2JpbGUgU2FmYXJpLzUzNy4zNicsXG4gICAgICAgICAgICAnSG9zdCc6ICd0b3AuYmFpZHUuY29tJyxcbiAgICAgICAgICAgICdBY2NlcHQnOiAnYXBwb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ArICc8L3NwYW4+JyArIFwiXFx0XFx0XFx0XCIgKyBuYW1lIDogaSA9PSBcIjFcIiA/ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cImNvbG9yOiNmZjY2MDBcIj4nICsgKHBhcnNlSW50KGkpICsgMSkudG9TdHJpbmcoKSArICc8L3NwYW4+JyArIFwiXFx0XFx0XFx0XCIgKyBuYW1lIDogaSA9PSBcIjJcIiA/ICfigJzigJzigJ3igJ08c3BhbiBzdHlsZT1cImNvbG9yOiNmZjk5MDBcIj4nICsgKHBhcnNlSW50KGkpICsgMSkudG9TdHJpbmcoKSArICc8L3NwYW4+JyArIFwiXFx0XFx0XFx0XCIgKyBuYW1lIDogJ+KAnOKAnOKAneKAnTxzcGFuPicgKyAocGFyc2VJbnQoaSkgKyAxKS50b1N0cmluZygpICsgJzwvc3Bhbj4nICsgXCJcXHRcXHRcXHRcIiArIG5hbWUsXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChuYW1lKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBuYW1lLnNwbGl0KCcgICAgKCcpWzBdO1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncycsIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgfSwgbmFtZSksXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcInRleHRfMVwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBzZXRSZXN1bHQoZCk7XG59Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHkjIyoqIiwiZ3JvdXAiOiIjI+mmlumhtSIsInNlYXJjaEZpbmQiOiJqczpcbnZhciBkID0gW107XG5sZXQga2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VJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0LCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiQ29va2llXFxcIjogXFxcIm5vX3Nob3dfZG9uYXRlPTFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IGlucHV0LnJlcGxhY2UoXFxcIi9jdi9cXFwiLCBcXFwiL3MvXFxcIilcXG4gICAgICAgICAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlZGlyZWN0OiBmYWxzZVxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgX2xpbmtzID0gaHRtbC5tYXRjaCgvaHR0cHM6XFxcXC9cXFxcLyh3d3dcXFxcLmFsaXl1bmRyaXZlXFxcXC5jb21cXFxcL3N8YWx5d3BcXFxcLm5ldClcXFxcL1xcXFx3Ki9nKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyBfbGlua3NbMF0gKyAnPz9meXBhZ2UnO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pLFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+54yr54u455uY5p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0aDsgZSA+IGQ7IGQrKylcXG4gICAgICAgICAgICAgICAgaWYgKGNbZF0gPT0gYSkgcmV0dXJuIGJbZF07XFxuICAgICAgICB9XFxuICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgbGV0IGh0bWwgPSBwb3N0KFxcXCJodHRwczovL2dpdGNhZmUubmV0L3Rvb2wvYWxpcGFwZXIvXFxcIiwge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly91LmdpdGNhZmUubmV0LydcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgYWN0aW9uOiBcXFwic2VhcmNoXFxcIixcXG4gICAgICAgICAgICAgICAga2V5d29yZDogc1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pXFxuICAgICAgICBsZXQgbGlzdCA9IEpTT04ucGFyc2UoaHRtbCk7XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gaXQudGl0bGU7XFxuICAgICAgICAgICAgbGV0IG11cmwgPSBpdC5rZXlcXG4gICAgICAgICAgICBpZiAodGl0bGUuaW5jbHVkZXMocykpIHtcXG4gICAgICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcXG4gICAgICAgICAgICAgICAgICAgIGRlc2M6IFxcXCLigJzigJzigJ3igJ08Zm9udCBjb2xvcj0jZjEzYjY2YT7lsI/nurjmnaE8L2ZvbnQ+Jm5ic3A7XFxcIiArIGNhdF9jb2RlKGl0LmNhdCksXFxuICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlczogaXQuZGVzXFxuICAgICA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YXBwbGljYXRpb24vc2lnbmVkLWV4Y2hhbmdlO3Y9YjM7cT0wLjlcXFwiXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgYXJyID0gcGRmYShodG1sLCBcXFwiYm9keSYmYVxcXCIpO1xcbiAgICAgICAgLy9sb2coYXJyKTtcXG4gICAgICAgIGxldCBkID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICBsZXQgdSA9IHBkKGl0LCBcXFwiYSYmaHJlZlxcXCIsIHVybCk7XFxuICAgICAgICAgICAgbGV0IHQgPSBwZGZoKGl0LCBcXFwiYSYmVGV4dFxcXCIpO1xcbiAgICAgICAgICAgIGlmIChpdC5pbmNsdWRlcyhcXFwiTmV4dCBwYWdlXFxcIikgfHwgaXQuaW5jbHVkZXMoXFxcIuS4i+S4gOmhtVxcXCIpKSB7XFxuICAgICAgICAgICAgICAgIGxldCB1MiA9IHBkKGl0LCBcXFwiYSYmaHJlZlxcXCIsIHVybCk7XFxuICAgICAgICAgICAgICAgIGxvZyhcXFwibmV4dCBwYWdlXFxcIik7XFxuICAgICAgICAgICAgICAgIGxvZyh1Mik7XFxuICAgICAgICAgICAgICAgIHB1dE15VmFyKFxcXCJiaW5nXFxcIiwgdTIpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAodSA9PSBudWxsIHx8IHQgPT0gbnVsbCB8fCAhaXQuaW5jbHVkZXMocykpIHtcXG4gICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICghaXQuaW5jbHVkZXMoXFxcIue9keebmFxcXCIpICYmICFpdC5pbmNsdWRlcyhcXFwi5LqR55uYXFxcIikgJiZcXG4gICAgICAgICAgICAgICAgIWl0LmluY2x1ZGVzKFxcXCJhbGl5dW5kcml2ZVxcXCIpICYmICFpdC5pbmNsdWRlcyhcXFwieXVucGFuXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmICh1LnN0YXJ0c1dpdGgoXFxcImh0dHBzOi8vY24uYmluZy5jb20vXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgY29udGludWU7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGxldCBkb20gPSBnZXRIb21lKHUpLnJlcGxhY2UoXFxcImh0dHA6Ly9cXFwiLCBcXFwiXFxcIikucmVwbGFjZShcXFwiaHR0cHM6Ly9cXFwiLCBcXFwiXFxcIik7XFxuICAgICAgICAgICAgbGV0IF9saW5rcyA9IHQubWF0Y2goL2h0dHBzOlxcXFwvXFxcXC8od3d3XFxcXC5hbGl5dW5kcml2ZVxcXFwuY29tXFxcXC9zfGFseXdwXFxcXC5uZXQpXFxcXC9cXFxcdyovZykgfHwgW107XFxuICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXG4gICAgICAgICAgICBsZXQgYyA9IG51bGw7XFxuICAgICAgICAgICAgbG9nKF9saW5rcyk7XFxuICAgICAgICAgICAgaWYgKF9saW5rcy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgIGMgPSAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiB0LFxcbiAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5b+F5bqUPC9mb250PiZuYnNwO1xcXCIgKyBkb20sXFxuICAgICAgICAgICAgICAgIHVybDogYyAhPSBudWxsID8gYyA6ICQodSkubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KGlucHV0KTtcXG4gICAgICAgICAgICAgICAgICAgIHZhciBfbGlua3MgPSBodG1sLm1hdGNoKC9odHRwczpcXFxcL1xcXFwvKHd3d1xcXFwuYWxpeXVuZHJpdmVcXFxcLmNvbVxcXFwvc3xhbHl3cFxcXFwubmV0KVxcXFwvXFxcXHcqL2cpIHx8IFtdO1xcbiAgICAgICAgICAgICAgICAgICAgLy9sb2coX2xpbmtzKTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChfbGlua3MubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9JyArIF9saW5rc1swXSArICc/P2Z5cGFnZSc7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBydWxlID0gTVlfUlVMRS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnI9XFxcIiArIHJ1bGUgKyBcXFwiIyNcXFwiICsgaW5wdXQ7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gZDtcXG4gICAgfVxcbn1dO1xcblxcbmxldCBjY29mID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvY2NvZicpXFxucnVsZXMucHVzaChjY29mKVxcbi8v5bm25Y+R6KeE5YiZ5pWwXFxubGV0IHNpemUgPSAxMDtcXG5cXG4kLmV4cG9ydHMgPSBmdW5jdGlvbihwYWdlLCBydWxlKSB7XFxuICAgIGlmICghcGFnZSAmJiAhcnVsZSkge1xcbiAgICAgICAg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1d2JtY2lmUT09XFxcIlxcbiAgICAgICAgfSk7XFxuICAgICAgICBjb25maXJtKHtcXG4gICAgICAgICAgICB0aXRsZTogTVlfUlVMRS50aXRsZSArICfmj5DnpLonLFxcbiAgICAgICAgICAgIGNvbnRlbnQ6ICfmnKzop4TliJnkvp3otZbkupHnm5jmsYflvbHop4TliJnvvIzngrnlh7vkuIvpnaLnmoTnoa7lrprmjInpkq7lr7zlhaXvvIzms6jmhI/lr7zlhaXlkI7kuIDlrpropoHlnKjkupHnm5jmsYflvbHnmbvlvZXpmL/ph4zkupHnm5jotKblj7fvvIzlkKbliJnkuI3og73nlKgnLFxcbiAgICAgICAgICAgIGNvbmZpcm06IHJ1LFxcbiAgICAgICAgICAgIGNhbmNlbDogcnVcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgYWRkTGlzdGVuZXIoXFxcIm9uQ2xvc2VcXFwiLCAkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgIGNsZWFyTXlWYXIoXFxcInNcXFwiKTtcXG4gICAgfSkpO1xcbiAgICBsZXQgdGlwID0gXFxcIuS6keebmOaQnOe0ouWQmyDmo4DntKLlip/og73nlLHlr7nlupTnvZHnq5nmj5DkvpvvvIzmnKzop4TliJnkuI3mj5Dkvpvku7vkvZXlhoXlrrlcXFwiO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IHRpcCxcXG4gICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgodGlwKSA9PiB7XFxuICAgICAgICAgICAgY29uZmlybSh7XFxuICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi5L2/55So6K+05piOXFxcIixcXG4gICAgICAgICAgICAgICAgY29udGVudDogdGlwICsgXFxcIu+8jOacrOinhOWImeS7o+eggeWujOWFqOW8gOa6kO+8jOS7heS+m+WtpuS5oOWSjOeglOeptu+8m+eCueWHu+S4i+aWueehruWumuaMiemSrui3s+i9rOS6keebmOaxh+W9seWwj+eoi+W6j1xcXCIsXFxuICAgICAgICAgICAgICAgIGNvbmZpcm06IFxcXCInaGlrZXI6Ly9ob21lQOS6keebmOaxh+W9sSdcXFwiXFxuICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSwgdGlwKSxcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiYXZhdGFyXFxcIixcXG4gICAgICAgIGRlc2M6IFxcXCJcXFwiLFxcbiAgICAgICAgcGljX3VybDogXFxcImhpa2VyOi8vaW1hZ2VzL2FjY291bnRcXFwiXFxuICAgIH0pO1xcblxcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6ICfmkJzntKInLFxcbiAgICAgICAgZGVzYzogJ+ivt+i+k+WFpeWFs+mUruivjScsXFxuICAgICAgICBjb2xfdHlwZTogJ2lucHV0JyxcXG4gICAgICAgIHVybDogJC50b1N0cmluZygoKSA9PiB7XFxuICAgICAgICAgICAgcHV0TXlWYXIoJ3MnLCBpbnB1dCk7XFxuICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcXG4gICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXFxuICAgICAgICB9KSxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgZGVmYXVsdFZhbHVlOiBnZXRNeVZhcigncycsICcnKVxcbiAgICAgICAgfVxcbiAgICB9KTtcXG4gICAgbGV0IHJ1bGVzID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpKCk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogXFxcIlxcXCIgPT0gciA/IFxcXCLigJzigJzlhajpg6jigJ3igJ1cXFwiIDogXFxcIuWFqOmDqFxcXCIsXFxuICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKCkgPT4ge1xcbiAgICAgICAgICAgIGNsZWFySXRlbShcXFwiclxcXCIpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIlxcbiAgICAgICAgfSksXFxuICAgICAgICBjb2xfdHlwZTogXFxcInNjcm9sbF9idXR0b25cXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIlxcbiAgICB9KTtcXG4gICAgZm9yIChsZXQgaXQgb2YgcnVsZXMpIHtcXG4gICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IGl0ID09IHIgPyBcXFwi4oCc4oCcXFxcIiArIGl0ICsgXFxcIuKAneKAnVxcXCIgOiBpdCxcXG4gICAgICAgICAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKHIpID0+IHtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFwiclxcXCIsIHIpO1xcbiAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgaXQpLFxcbiAgICAgICAgICAgIGNvbF90eXBlOiBcXFwic2Nyb2xsX2J1dHRvblxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCJcXG4gICAgICAgIH0pO1xcbiAgICB9XFxuICAgIGQucHVzaCh7XFxuICAgICAgICBjb2xfdHlwZTogJ2xpbmUnLFxcbiAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICBpZDogJ3lwai1sJ1xcbiAgICAgICAgfVxcbiAgICB9KTtcXG59XFxubGV0IHMgPSBnZXRNeVZhcigncycsICcnKTtcXG5pZiAocyAhPSBcXFwiXFxcIikge1xcbiAgICBsZXQgcCA9IE1ZX1BBR0U7XFxuICAgIGxldCBkYXRhID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvZGF0YVxcXCIpKHAsIHIgIT0gXFxcIlxcXCIgPyByIDogbnVsbCk7XFxuXFxuICAgIGxldCBwYWdlaWQgPSBcXFwieXBqLXBhZ2VcXFwiICsgcDtcXG4gICAgaWYgKGRhdGEubGVuZ3RoID4gMCkge1xcbiAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBwICsgXFxcIumhteS4re+8jOi/m+W6pu+8mjEvXFxcIiArIGRhdGEubGVuZ3RoLFxcbiAgICAgICAgICAgIHVybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgIH1cXG4gICAgc2V0UmVzdWx0KGQpO1xcbiAgICBsb2coZGF0YS5sZW5ndGgpO1xcbiAgICBpZiAoZGF0YS5sZW5ndGggPiAwKSB7XFxuICAgICAgICAvL+Wkmue6v+eoi+WKoOi9vSAgICAgICAgXFxuICAgICAgICBsZXQgcmVhbFBhZ2UgPSBcXFwiXFxcIiA9PSByID8gMSA6IHA7XFxuICAgICAgICBsZXQgdGFza3MgPSBkYXRhLm1hcChpdCA9PiB7XFxuICAgICAgICAgICAgcmV0dXJuIHtcXG4gICAgICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocnVsZSkge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJ1bGUuZmluZChzLCByZWFsUGFnZSk7XFxuICAgICAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgICAgIHBhcmFtOiBpdCxcXG4gICAgICAgICAgICAgICAgaWQ6IFxcXCJydWxlQFxcXCIgKyBpdC5uYW1lXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuXFxuICAgICAgICBiYXRjaEV4ZWN1dGUodGFza3MsIHtcXG4gICAgICAgICAgICBmdW5jOiBmdW5jdGlvbihwYXJhbSwgaWQsIGVycm9yLCByZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgLy9sb2coXFxcImxpc3RlbmVyOiBcXFwiICsgKHJlc3VsdCB8fCBbXSkubGVuZ3RoKVxcbiAgICAgICAgICAgICAgICBwYXJhbS5pID0gcGFyYW0uaSArIDE7XFxuICAgICAgICAgICAgICAgIGlmIChyZXN1bHQpIHtcXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLmogPSBwYXJhbS5qICsgMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRkSXRlbUJlZm9yZShwYWdlaWQsIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBpdC50aXRsZS5pbmNsdWRlcyhcXFwi4oCc4oCc4oCd4oCdXFxcIikgPyBpdC50aXRsZSA6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgaXQudGl0bGUucmVwbGFjZShuZXcgUmVnRXhwKFxcXCI8ZW0+fDwvZW0+XFxcIiwgXFxcImdcXFwiKSwgXFxcIlxcXCIpLnJlcGxhY2UobmV3IFJlZ0V4cChzLCBcXFwiZ1xcXCIpLCBcXFwiPHN0cm9uZz48c3BhbiBzdHlsZT1cXFxcXFxcImNvbG9yOiAjMUU5MEZGXFxcXFxcXCI+XFxcIiArIHMgKyBcXFwiPC9zcGFuPjwvc3Ryb25nPlxcXCIpLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogaXQuZGVzYyxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogaXQudXJsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogaXQucGljX3VybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBpdC5waWNfdXJsID8gJ21vdmllXzFfdmVydGljYWxfcGljJyA6IFxcXCJ0ZXh0XzFcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogXFxcIl9fYXBwXFxcIiArIE1ZX1BBR0UgKyBcXFwiQFxcXCIgKyBwYXJhbS5qLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7fVxcblxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIGlmIChwYXJhbS5pID49IHBhcmFtLmFsbCkge1xcbiAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbShwYWdlaWQpXFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICB1cGRhdGVJdGVtKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIuWKoOi9veesrFxcXCIgKyBNWV9QQUdFICsgXFxcIumhteS4re+8jOi/m+W6pu+8mlxcXCIgKyAocGFyYW0uaSArIDEpICsgXFxcIi9cXFwiICsgcGFyYW0uYWxsLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJ0ZXh0X2NlbnRlcl8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZDogcGFnZWlkXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgcGFyYW06IHtcXG4gICAgICAgICAgICAgICAgYWxsOiBkYXRhLmxlbmd0aCxcXG4gICAgICAgICAgICAgICAgaTogMCxcXG4gICAgICAgICAgICAgICAgajogLTFcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5pCc57Si6aG16Z2iXCIsXCJwYXRoXCI6XCJzb3VwXCIsXCJydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbmlmIChNWV9QQVJBTVMua2V5KSB7XFxuICAgIHB1dE15VmFyKFxcXCJzXFxcIiwgTVlfUEFSQU1TLmtleSk7XFxufVxcbmV2YWwoSlNPTi5wYXJzZShmZXRjaChcXFwiaGlrZXI6Ly9wYWdlL3NvdVxcXCIpKS5ydWxlKTtcIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIkNDT0ZcIixcInBhdGhcIjpcImNjb2ZcIixcInJ1bGVcIjpcIiQuZXhwb3J0cyA9IHtcXG4gICAgbmFtZTogJ0NDT0YnLFxcbiAgICBwYWdlOiB0cnVlLFxcbiAgICBmaW5kOiBmdW5jdGlvbihzLCBwYWdlKSB7XFxuICAgICAgICBsZXQgZCA9IFtdXFxuICAgICAgICBjb25zdCB7XFxuICAgICAgICAgICAgYnl0ZXNUb1NpemUsXFxuICAgICAgICAgICAgY29sb3JcXG4gICAgICAgIH0gPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS90b29scycpO1xcbiAgICAgICAgbGV0IGh0bWwgPSBmZXRjaCgnaHR0cHM6Ly9wYW4uY2NvZi5jYy9hcGkvc2VhcmNoJywge1xcbiAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgXFxcImNvbnRlbnQtdHlwZVxcXCI6ICdhcHBsaWNhdGlvbi9qc29uJyxcXG4gICAgICAgICAgICAgICAgJ1JlZmVyZXInOiAnaHR0cHM6Ly9wYW4uY2NvZi5jYy9zZWFyY2g/a2V5d29yZD0nICsgc1xcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgYm9keToge1xcbiAgICAgICAgICAgICAgICBcXFwicGFnZVNpemVcXFwiOiAyMCxcXG4gICAgICAgICAgICAgICAgXFxcInBhZ2VOdW1cXFwiOiBwYWdlLFxcbiAgICAgICAgICAgICAgICBcXFwia2V5d29yZFxcXCI6IHMsXFxuICAgICAgICAgICAgICAgIFxcXCJmcm9tTW9iaWxlXFxcIjogdHJ1ZVxcbiAgICAgICAgICAgIH0sXFxuICAgICAgICAgICAgbWV0aG9kOiAnUE9TVCdcXG4gICAgICAgIH0pXFxuICAgICAgICBsZXQgbGlzdCA9IEpTT04ucGFyc2UoaHRtbClcXG4gICAgICAgICAgICAuZGF0YS5yb3dzXFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGxpc3QubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgaXQgPSBsaXN0W2ldXFxuICAgICAgICAgICAgbGV0IHRpdGxlID0gaXQuZmlsZU5hbWVcXG4gICAgICAgICAgICBsZXQgbXVybCA9IGl0LnVybFxcbiAgICAgICAgICAgIGxldCB0eXBlID0gaXQudHlwZS5yZXBsYWNlKC9mb2xkZXIvLCAn5paH5Lu25aS5JykucmVwbGFjZSgvZmlsZS8sICfmlofku7YnKVxcbiAgICAgICAgICAgIGlmICh0aXRsZS5pbmNsdWRlcyhzKSkge1xcbiAgICAgICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxcbiAgICAgICAgICAgICAgICAgICAgZGVzYzogJ+KAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPkNDT0Y8L2ZvbnQ+Jm5ic3A7JyArICfmlofku7bnsbvlnovvvJonICsgdHlwZSArICfvvIzmlofku7blpKflsI/vvJonICsgYnl0ZXNUb1NpemUoaXQuc2l6ZSksXFxuICAgICAgICAgICAgICAgICAgICB1cmw6ICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgbXVybCArICc/P2Z5cGFnZSdcXG4gICAgICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9XFxuICAgICAgICByZXR1cm4gZFxcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi5bel5YW3XCIsXCJwYXRoXCI6XCJ0b29sc1wiLFwicnVsZVwiOlwiZnVuY3Rpb24gYnl0ZXNUb1NpemUoc2l6ZSkge1xcbiAgICBpZiAoc2l6ZSA8IDAuMSAqIDEwMjQpIHtcXG4gICAgICAgIC8v5bCP5LqOMC4xS0LvvIzliJnovazljJbmiJBCXFxuICAgICAgICBzaXplID0gc2l6ZS50b0ZpeGVkKDIpICsgXFxcIkJcXFwiO1xcbiAgICB9IGVsc2UgaWYgKHNpemUgPCAwLjEgKiAxMDI0ICogMTAyNCkge1xcbiAgICAgICAgLy8g5bCP5LqOMC4xTULvvIzliJnovazljJbmiJBLQlxcbiAgICAgICAgc2l6ZSA9IChzaXplIC8gMTAyNCkudG9GaXhlZCgyKSArIFxcXCJLQlxcXCI7XFxuICAgIH0gZWxzZSBpZiAoc2l6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ydWVcXG4gICAgfSxcXG4gICAg5Lq/OiB7XFxuICAgICAgICB2YWx1ZTogMTAwMDAwMDAwLFxcbiAgICAgICAgc2VjVW5pdDogdHJ1ZVxcbiAgICB9XFxufVxcblxcbmZ1bmN0aW9uIENoaW5lc2VUb051bWJlcihjaG5TdHIpIHtcXG4gICAgbGV0IHJ0biA9IDA7XFxuICAgIGxldCBzZWN0aW9uID0gMDtcXG4gICAgbGV0IG51bWJlciA9IDA7XFxuICAgIGxldCBzZWNVbml0ID0gZmFsc2U7XFxuICAgIGxldCBzdHIgPSBjaG5TdHIuc3BsaXQoJycpO1xcblxcbiAgICBmb3IgKGxldCBpID0gMDsgaSA8IHN0ci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgbGV0IG51bSA9IGNobk51bUNoYXJbc3RyW2ldXTtcXG4gICAgICAgIGlmICh0eXBlb2YgbnVtICE9PSAndW5kZWZpbmVkJykge1xcbiAgICAgICAgICAgIG51bWJlciA9IG51bTtcXG4gICAgICAgICAgICBpZiAoaSA9PT0gc3RyLmxlbmd0aCAtIDEpIHtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiArPSBudW1iZXI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsZXQgdW5pdCA9IGNobk5hbWVWYWx1ZVtzdHJbaV1dLnZhbHVlO1xcbiAgICAgICAgICAgIHNlY1VuaXQgPSBjaG5OYW1lVmFsdWVbc3RyW2ldXS5zZWNVbml0O1xcbiAgICAgICAgICAgIGlmIChzZWNVbml0KSB7XFxuICAgICAgICAgICAgICAgIHNlY3Rpb24gPSAoc2VjdGlvbiArIG51bWJlcikgKiB1bml0O1xcbiAgICAgICAgICAgICAgICBydG4gKz0gc2VjdGlvbjtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiA9IDA7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgc2VjdGlvbiArPSAobnVtYmVyICogdW5pdCk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3RoID8gcy5sZW5ndGggOiB0Lmxlbmd0aFxcbiAgICB2YXIgbiA9IHMubGVuZ3RoXFxuICAgIHZhciBtID0gdC5sZW5ndGhcXG4gICAgdmFyIGQgPSBbXVxcbiAgICBmID0gZiB8fCAyXFxuICAgIHZhciBtaW4gPSBmdW5jdGlvbiAoYSwgYiwgYykge1xcbiAgICAgICAgcmV0dXJuIGEgPCBiID8gKGEgPCBjID8gYSA6IGMpIDogKGIgPCBjID8gYiA6IGMpXFxuICAgIH1cXG4gICAgdmFyIGksIGosIHNpLCB0aiwgY29zdFxcbiAgICBpZiAobiA9PT0gMCkgcmV0dXJuIG1cXG4gICAgaWYgKG0gPT09IDApIHJldHVybiBuXFxuICAgIGZvciAoaSA9IDA7IGkgPD0gbjsgaSsrKSB7XFxuICAgICAgICBkW2ldID0gW11cXG4gICAgICAgIGRbaV1bMF0gPSBpXFxuICAgIH1cXG4gICAgZm9yIChqID0gMDsgaiA8PSBtOyBqKyspIHtcXG4gICAgICAgIGRbMF1bal0gPSBqXFxuICAgIH1cXG4gICAgZm9yIChpID0gMTsgaSA8PSBuOyBpKyspIHtcXG4gICAgICAgIHNpID0gcy5jaGFyQXQoaSAtIDEpXFxuICAgICAgICBmb3IgKGogPSAxOyBqIDw9IG07IGorKykge1xcbiAgICAgICAgICAgIHRqID0gdC5jaGFyQXQoaiAtIDEpXFxuICAgICAgICAgICAgaWYgKHNpID09PSB0aikge1xcbiAgICAgICAgICAgICAgICBjb3N0ID0gMFxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGNvc3QgPSAxXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGRbaV1bal0gPSBtaW4oZFtpIC0gMV1bal0gKyAxLCBkW2ldW2ogLSAxXSArIDEsIGRbaSAtIDFdW2ogLSAxXSArIGNvc3QpXFxuICAgICAgICB9XFxuICAgIH1cXG4gICAgbGV0IHJlcyA9ICgxIC0gZFtuXVttXSAvIGwpICoxMDBcXG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5bmtojmjInpkq7lj6/ku6XlpI3liLbpk77mjqVcXFwiLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiAkLnRvU3RyaW5nKChtYWcpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBtYWc7XFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KSxcXG4gICAgICAgICAgICAgICAgY2FuY2VsOiAkLnRvU3RyaW5nKChtYWcpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyBtYWdcXG4gICAgICAgICAgICAgICAgfSwgaW5wdXQpXFxuICAgICAgICAgICAgfSlcXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcXG4gICAgICAgIH0gZWxzZSBpZiAoaW5wdXQuaW5jbHVkZXMoXFxcImFsaXl1bmRyaXZlLmNvbVxcXCIpKSB7XFxuICAgICAgICAgICAgbG9nKGlucHV0KTtcXG4gICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAub3BlbihKU09OLnN0cmluZ2lmeSh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogXFxcIumYv+mHjOS6keebmFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD1cXFwiICsgdXJsICsgJz8/ZnlwYWdlJyxcXG4gICAgICAgICAgICAgICAgfSkpXFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxuICAgICAgICB9IGVsc2UgaWYgKC9cXFxcLihtcDN8ZmxhY3xtNGEpJC8udGVzdChpbnB1dCkpIHtcXG4gICAgICAgICAgICBsb2coaW5wdXQpO1xcbiAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5wbGF5VmlkZW8odXJsKTtcXG4gICAgICAgICAgICB9LCBpbnB1dCwgcnVsZSlcXG4gICAgICAgIH0gZWxzZSBpZiAoIWlucHV0LmluY2x1ZGVzKGhvc3QpICYmIGlucHV0LnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgIGxvZyhpbnB1dCk7XFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLor6bmg4VcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3lzZng/cnVsZT1cXFwiICsgcnVsZSArIFxcXCImcj1cXFwiICsgcnVsZSArIFxcXCIjI1xcXCIgKyB1cmwsXFxuICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgIH0sIGlucHV0LCBydWxlKTtcXG4gICAgICAgIH0gZWxzZSBpZiAoIWlucHV0LnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgIGxvZyhpbnB1dCk7XFxuICAgICAgICAgICAgLy/og73llKTotbdBUFDnmoTnmb3lkI3ljZVcXG4gICAgICAgICAgICBsZXQgd2hpdGUgPSBbXFxuICAgICAgICAgICAgICAgIFxcXCJxa2xpbmtcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwiYmRuZXRkaXNrXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcInh1bmxlaWFwcFxcXCJcXG4gICAgICAgICAgICBdO1xcbiAgICAgICAgICAgIGxldCBpbldoaXRlID0gd2hpdGUuZmlsdGVyKGl0ID0+IGlucHV0LnN0YXJ0c1dpdGgoaXQpKS5sZW5ndGggPiAwO1xcbiAgICAgICAgICAgIGlmICghaW5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ZSkge1xcbiAgICAgICAgZnlfYnJpZGdlX2FwcC5sb2coZS50b1N0cmluZygpKTtcXG4gICAgfVxcbn0pO1xcbmQucHVzaCh7XFxuICAgIHRpdGxlOiBcXFwiXFxcIixcXG4gICAgdXJsOiB1cmwsXFxuICAgIGNvbF90eXBlOiBcXFwieDVfd2Vidmlld19zaW5nbGVcXFwiLFxcbiAgICBkZXNjOiBcXFwiMTAwJSYmZmxvYXRcXFwiLFxcbiAgICBwaWNfdXJsOiBcXFwiXFxcIixcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIHVybEludGVyY2VwdG9yOiBpdGUsXFxuICAgICAgICBqczoganMsXFxuICAgICAgICBjYW5CYWNrOiB0cnVlLFxcbiAgICAgICAganNMb2FkaW5nSW5qZWN0OiB0cnVlLFxcbiAgICAgICAgZmxvYXRWaWRlbzogdHJ1ZVxcbiAgICB9XFxufSk7XFxuZC5wdXNoKHtcXG4gICAgY29sX3R5cGU6IFxcXCJsaW5lXFxcIixcXG4gICAgZXh0cmE6IHtcXG4gICAgICAgIGlkOiB1cmxcXG4gICAgfVxcbn0pO1xcbnNldFJlc3VsdChkKTtcIn1dIiwiaWNvbiI6IiIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment