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+KAnOKAnOKAneKAnTxzcGFuPicgKyAocGFyc2VJbnQoaSkgKyAxKS50b1N0cmluZygpICsgJzwvc3Bhbj4nICsgXCJcXHRcXHRcXHRcIiArIG5hbWUsXG4gICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChuYW1lKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIG5hbWUgPSBuYW1lLnNwbGl0KCcgICAgKCcpWzBdO1xuICAgICAgICAgICAgICAgICAgICBwdXRNeVZhcigncycsIG5hbWUpO1xuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vZW1wdHknXG4gICAgICAgICAgICAgICAgfSwgbmFtZSksXG4gICAgICAgICAgICAgICAgZGVzYzogZGVzLFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcInRleHRfMVwiXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBzZXRSZXN1bHQoZCk7XG59Iiwic2VhcmNoX3VybCI6Imhpa2VyOi8vZW1wdHkjIyoqIiwiZ3JvdXAiOiLnvZHnm5giLCJzZWFyY2hGaW5kIjoianM6XG52YXIgZCA9IFtdO1xubGV0IGt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gICAgICAgICAgICAgdXJsOiAkKHUpLmxhenlSdWxlKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCwge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIkNvb2tpZVxcXCI6IFxcXCJub19zaG93X2RvbmF0ZT0xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxcIlJlZmVyZXJcXFwiOiBpbnB1dC5yZXBsYWNlKFxcXCIvY3YvXFxcIiwgXFxcIi9zL1xcXCIpXFxuICAgICAgICAgICAgICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWRpcmVjdDogZmFsc2VcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgdmFyIF9saW5rcyA9IGh0bWwubWF0Y2goL2h0dHBzOlxcXFwvXFxcXC8od3d3XFxcXC5hbGl5dW5kcml2ZVxcXFwuY29tXFxcXC9zfGFseXdwXFxcXC5uZXQpXFxcXC9cXFxcdyovZykgfHwgW107XFxuICAgICAgICAgICAgICAgICAgICAvL2xvZyhfbGlua3MpO1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKF9saW5rcy5sZW5ndGggPiAwKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL3BhZ2UvZGV0YWlsP3J1bGU95LqR55uY5rGH5b2xJnVybD0nICsgX2xpbmtzWzBdICsgJz8/ZnlwYWdlJztcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KSxcXG4gICAgICAgICAgICAgICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnTxmb250IGNvbG9yPSNmMTNiNjZhPueMq+eLuOebmOaQnDwvZm9udD4mbmJzcDtcXFwiICsgcGRmaChpdCwgXFxcInRlbXBsYXRlLDEmJlRleHRcXFwiKSxcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBkO1xcbiAgICB9XFxufSwge1xcbiAgICBuYW1lOiBcXFwi5piT5pCcXFxcIixcXG4gICAgcGFnZTogdHJ1ZSxcXG4gICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgbGV0IGh0bWwgPSByZXF1ZXN0KFxcXCJodHRwczovL3lpc28uZnVuL2FwaS9zZWFyY2g/bmFtZT1cXFwiICsgcyArIFxcXCImcGFnZU5vPVxcXCIgKyBwYWdlLCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICBcXFwiUmVmZXJlclxcXCI6IFxcXCJodHRwczovL3lpc28uZnVuL2luZm8/c2VhcmNoS2V5PVxcXCIgKyBzXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSk7XFxuICAgICAgICBsZXQgYXJyID0gSlNPTi5wYXJzZShodG1sKS5kYXRhLmxpc3Q7XFxuICAgICAgICBsb2coYXJyKTtcXG4gICAgICAgIGxldCBkID0gW107XFxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGFyci5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgICAgIGxldCBpdCA9IGFycltpXTtcXG4gICAgICAgICAgICBsZXQgdSA9IGl0LnVybDtcXG4gICAgICAgICAgICBpZiAodSA9PSBudWxsIHx8ICF1LmluY2x1ZGVzKFxcXCJhbGl5dW5cXFwiKSkge1xcbiAgICAgICAgICAgICAgICBjb250aW51ZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgZC5wdXNoKHtcXG4gICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLigJzigJzigJ3igJ1cXFwiICsgaXQubmFtZSxcXG4gICAgICAgICAgICAgICAgdXJsOiAnaG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KyspXFxuICAgICAgICAgICAgICAgIGlmIChjW2RdID09IGEpIHJldHVybiBiW2RdO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGQgPSBbXTtcXG4gICAgICAgIGxldCBodG1sID0gcG9zdChcXFwiaHR0cHM6Ly9naXRjYWZlLm5ldC90b29sL2FsaXBhcGVyL1xcXCIsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vdS5naXRjYWZlLm5ldC8nXFxuICAgICAgICAgICAgfSxcXG4gICAgICAgICAgICBib2R5OiB7XFxuICAgICAgICAgICAgICAgIGFjdGlvbjogXFxcInNlYXJjaFxcXCIsXFxuICAgICAgICAgICAgICAgIGtleXdvcmQ6IHNcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKGh0bWwpO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgbGV0IGl0ID0gbGlzdFtpXVxcbiAgICAgICAgICAgIGxldCB0aXRsZSA9IGl0LnRpdGxlO1xcbiAgICAgICAgICAgIGxldCBtdXJsID0gaXQua2V5XFxuICAgICAgICAgICAgaWYgKHRpdGxlLmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgIGQucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICB0aXRsZTogdGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICBkZXNjOiBcXFwi4oCc4oCc4oCd4oCdPGZvbnQgY29sb3I9I2YxM2I2NmE+5bCP57q45p2hPC9mb250PiZuYnNwO1xcXCIgKyBjYXRfY29kZShpdC5jYXQpLFxcbiAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBkZXM6IGl0LmRlc1xcbiAgICAgICAgICAgICAgICAgICAgf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Z25lZC1leGNoYW5nZTt2PWIzO3E9MC45XFxcIlxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcbiAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJmFcXFwiKTtcXG4gICAgICAgIC8vbG9nKGFycik7XFxuICAgICAgICBsZXQgZCA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBsZXQgaXQgPSBhcnJbaV07XFxuICAgICAgICAgICAgbGV0IHUgPSBwZChpdCwgXFxcImEmJmhyZWZcXFwiLCB1cmwpO1xcbiAgICAgICAgICAgIGxldCB0ID0gcGRmaChpdCwgXFxcImEmJlRleHRcXFwiKTtcXG4gICAgICAgICAgICBpZiAoaXQuaW5jbHVkZXMoXFxcIk5leHQgcGFnZVxcXCIpIHx8IGl0LmluY2x1ZGVzKFxcXCLkuIvkuIDpobVcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBsZXQgdTIgPSBwZChpdCwgXFxcImEmJmhyZWZcXFwiLCB1cmwpO1xcbiAgICAgICAgICAgICAgICBsb2coXFxcIm5leHQgcGFnZVxcXCIpO1xcbiAgICAgICAgICAgICAgICBsb2codTIpO1xcbiAgICAgICAgICAgICAgICBwdXRNeVZhcihcXFwiYmluZ1xcXCIsIHUyKTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHUgPT0gbnVsbCB8fCB0ID09IG51bGwgfHwgIWl0LmluY2x1ZGVzKHMpKSB7XFxuICAgICAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoIWl0LmluY2x1ZGVzKFxcXCLnvZHnm5hcXFwiKSAmJiAhaXQuaW5jbHVkZXMoXFxcIuS6keebmFxcXCIpICYmXFxuICAgICAgICAgICAgICAgICFpdC5pbmNsdWRlcyhcXFwiYWxpeXVuZHJpdmVcXFwiK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lKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gcmVxdWVzdChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICB2YXIgX2xpbmtzID0gaHRtbC5tYXRjaCgvaHR0cHM6XFxcXC9cXFxcLyh3d3dcXFxcLmFsaXl1bmRyaXZlXFxcXC5jb21cXFxcL3N8YWx5d3BcXFxcLm5ldClcXFxcL1xcXFx3Ki9nKSB8fCBbXTtcXG4gICAgICAgICAgICAgICAgICAgIC8vbG9nKF9saW5rcyk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoX2xpbmtzLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJ2hpa2VyOi8vcGFnZS9kZXRhaWw/cnVsZT3kupHnm5jmsYflvbEmdXJsPScgKyBfbGlua3NbMF0gKyAnPz9meXBhZ2UnO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgcnVsZSA9IE1ZX1JVTEUudGl0bGU7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL3BhZ2UveXNmeD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZyPVxcXCIgKyBydWxlICsgXFxcIiMjXFxcIiArIGlucHV0O1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9KVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfVxcbiAgICAgICAgcmV0dXJuIGQ7XFxuICAgIH1cXG59XTtcXG5cXG5sZXQgY2NvZiA9ICQucmVxdWlyZSgnaGlrZXI6Ly9wYWdlL2Njb2YnKVxcbnJ1bGVzLnB1c2goY2NvZilcXG4vL+W5tuWPkeinhOWImeaVsFxcbmxldCBzaXplID0gMTA7XFxuXFxuJC5leHBvcnRzID0gZnVuY3Rpb24ocGFnZSwgcnVsZSkge1xcbiAgICBpZiAoIXBhZ2U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LvvIzmnKzop4TliJnku6PnoIHlrozlhajlvIDmupDvvIzku4XkvpvlrabkuaDlkoznoJTnqbbvvJvngrnlh7vkuIvmlrnnoa7lrprmjInpkq7ot7PovazkupHnm5jmsYflvbHlsI/nqIvluo9cXFwiLFxcbiAgICAgICAgICAgICAgICBjb25maXJtOiBcXFwiJ2hpa2VyOi8vaG9tZUDkupHnm5jmsYflvbEnXFxcIlxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiaGlrZXI6Ly9lbXB0eVxcXCJcXG4gICAgICAgIH0sIHRpcCksXFxuICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICBkZXNjOiBcXFwiXFxcIixcXG4gICAgICAgIHBpY191cmw6IFxcXCJoaWtlcjovL2ltYWdlcy9hY2NvdW50XFxcIlxcbiAgICB9KTtcXG5cXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiAn5pCc57SiJyxcXG4gICAgICAgIGRlc2M6ICfor7fovpPlhaXlhbPplK7or40nLFxcbiAgICAgICAgY29sX3R5cGU6ICdpbnB1dCcsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgIHB1dE15VmFyKCdzJywgaW5wdXQpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgcmV0dXJuICdoaWtlcjovL2VtcHR5J1xcbiAgICAgICAgfSksXFxuICAgICAgICBleHRyYToge1xcbiAgICAgICAgICAgIGRlZmF1bHRWYWx1ZTogZ2V0TXlWYXIoJ3MnLCAnJylcXG4gICAgICAgIH1cXG4gICAgfSk7XFxuICAgIGxldCBydWxlcyA9ICQucmVxdWlyZShcXFwiaGlrZXI6Ly9wYWdlL2RhdGFcXFwiKSgpO1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IFxcXCJcXFwiID09IHIgPyBcXFwi4oCc4oCc5YWo6Y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gICAgIGZ1bmM6IGZ1bmN0aW9uKHJ1bGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBydWxlLmZpbmQocywgcmVhbFBhZ2UpO1xcbiAgICAgICAgICAgICAgICB9LFxcbiAgICAgICAgICAgICAgICBwYXJhbTogaXQsXFxuICAgICAgICAgICAgICAgIGlkOiBcXFwicnVsZUBcXFwiICsgaXQubmFtZVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0pO1xcblxcbiAgICAgICAgYmF0Y2hFeGVjdXRlKHRhc2tzLCB7XFxuICAgICAgICAgICAgZnVuYzogZnVuY3Rpb24ocGFyYW0sIGlkLCBlcnJvciwgcmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgIC8vbG9nKFxcXCJsaXN0ZW5lcjogXFxcIiArIChyZXN1bHQgfHwgW10pLmxlbmd0aClcXG4gICAgICAgICAgICAgICAgcGFyYW0uaSA9IHBhcmFtLmkgKyAxO1xcbiAgICAgICAgICAgICAgICBpZiAocmVzdWx0KSB7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAobGV0IGl0IG9mIHJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbS5qID0gcGFyYW0uaiArIDE7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFkZEl0ZW1CZWZvcmUocGFnZWlkLCB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogaXQudGl0bGUuaW5jbHVkZXMoXFxcIuKAnOKAnOKAneKAnVxcXCIpID8gaXQudGl0bGUgOiBcXFwi4oCc4oCc4oCd4oCdXFxcIiArIGl0LnRpdGxlLnJlcGxhY2UobmV3IFJlZ0V4cChcXFwiPGVtPnw8L2VtPlxcXCIsIFxcXCJnXFxcIiksIFxcXCJcXFwiKS5yZXBsYWNlKG5ldyBSZWdFeHAocywgXFxcImdcXFwiKSwgXFxcIjxzdHJvbmc+PHNwYW4gc3R5bGU9XFxcXFxcXCJjb2xvcjogIzFFOTBGRlxcXFxcXFwiPlxcXCIgKyBzICsgXFxcIjwvc3Bhbj48L3N0cm9uZz5cXFwiKSxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlc2M6IGl0LmRlc2MsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IGl0LnVybCxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpY191cmw6IGl0LnBpY191cmwsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogaXQucGljX3VybCA/ICdtb3ZpZV8xX3ZlcnRpY2FsX3BpYycgOiBcXFwidGV4dF8xXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IFxcXCJfX2FwcFxcXCIgKyBNWV9QQUdFICsgXFxcIkBcXFwiICsgcGFyYW0uaixcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmhlcml0VGl0bGU6IGZhbHNlXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge31cXG5cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBpZiAocGFyYW0uaSA+PSBwYXJhbS5hbGwpIHtcXG4gICAgICAgICAgICAgICAgICAgIGRlbGV0ZUl0ZW0ocGFnZWlkKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdXBkYXRlSXRlbSh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLliqDovb3nrKxcXFwiICsgTVlfUEFHRSArIFxcXCLpobXkuK3vvIzov5vluqbvvJpcXFwiICsgKHBhcmFtLmkgKyAxKSArIFxcXCIvXFxcIiArIHBhcmFtLmFsbCxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbF90eXBlOiBcXFwidGV4dF9jZW50ZXJfMVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQ6IHBhZ2VpZFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIHBhcmFtOiB7XFxuICAgICAgICAgICAgICAgIGFsbDogZGF0YS5sZW5ndGgsXFxuICAgICAgICAgICAgICAgIGk6IDAsXFxuICAgICAgICAgICAgICAgIGo6IC0xXFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSlcXG4gICAgfVxcbn1cIn0se1wiY29sX3R5cGVcIjpcIm1vdmllXzNcIixcIm5hbWVcIjpcIuaQnOe0oumhtemdolwiLFwicGF0aFwiOlwic291cFwiLFwicnVsZVwiOlwianM6XFxudmFyIGQgPSBbXTtcXG5pZiAoTVlfUEFSQU1TLmtleSkge1xcbiAgICBwdXRNeVZhcihcXFwic1xcXCIsIE1ZX1BBUkFNUy5rZXkpO1xcbn1cXG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goXFxcImhpa2VyOi8vcGFnZS9zb3VcXFwiKSkucnVsZSk7XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJDQ09GXCIsXCJwYXRoXCI6XCJjY29mXCIsXCJydWxlXCI6XCIkLmV4cG9ydHMgPSB7XFxuICAgIG5hbWU6ICdDQ09GJyxcXG4gICAgcGFnZTogdHJ1ZSxcXG4gICAgZmluZDogZnVuY3Rpb24ocywgcGFnZSkge1xcbiAgICAgICAgbGV0IGQgPSBbXVxcbiAgICAgICAgY29uc3Qge1xcbiAgICAgICAgICAgIGJ5dGVzVG9TaXplLFxcbiAgICAgICAgICAgIGNvbG9yXFxuICAgICAgICB9ID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvdG9vbHMnKTtcXG4gICAgICAgIGxldCBodG1sID0gZmV0Y2goJ2h0dHBzOi8vcGFuLmNjb2YuY2MvYXBpL3NlYXJjaCcsIHtcXG4gICAgICAgICAgICBoZWFkZXJzOiB7XFxuICAgICAgICAgICAgICAgIFxcXCJjb250ZW50LXR5cGVcXFwiOiAnYXBwbGljYXRpb24vanNvbicsXFxuICAgICAgICAgICAgICAgICdSZWZlcmVyJzogJ2h0dHBzOi8vcGFuLmNjb2YuY2Mvc2VhcmNoP2tleXdvcmQ9JyArIHNcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIGJvZHk6IHtcXG4gICAgICAgICAgICAgICAgXFxcInBhZ2VTaXplXFxcIjogMjAsXFxuICAgICAgICAgICAgICAgIFxcXCJwYWdlTnVtXFxcIjogcGFnZSxcXG4gICAgICAgICAgICAgICAgXFxcImtleXdvcmRcXFwiOiBzLFxcbiAgICAgICAgICAgICAgICBcXFwiZnJvbU1vYmlsZVxcXCI6IHRydWVcXG4gICAgICAgICAgICB9LFxcbiAgICAgICAgICAgIG1ldGhvZDogJ1BPU1QnXFxuICAgICAgICB9KVxcbiAgICAgICAgbGV0IGxpc3QgPSBKU09OLnBhcnNlKGh0bWwpXFxuICAgICAgICAgICAgLmRhdGEucm93c1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaXN0Lmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgbGV0IGl0ID0gbGlzdFtpX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mXtOeahOebuOS8vOW6plxcbiAgICBpZiAoIXMgfHwgIXQpIHtcXG4gICAgICAgIHJldHVybiAwXFxuICAgIH1cXG4gICAgaWYocyA9PT0gdCl7XFxuICAgICAgICByZXR1cm4gMTAwO1xcbiAgICB9XFxuICAgIHZhciBsID0gcy5sZW5ndGggPiB0Lmxlbmd0aCA/IHMubGVuZ3RoIDogdC5sZW5ndGhcXG4gICAgdmFyIG4gPSBzLmxlbmd0aFxcbiAgICB2YXIgbSA9IHQubGVuZ3RoXFxuICAgIHZhciBkID0gW11cXG4gICAgZiA9IGYgfHwgMlxcbiAgICB2YXIgbWluID0gZnVuY3Rpb24gKGEsIGIsIGMpIHtcXG4gICAgICAgIHJldHVybiBhIDwgYiA/IChhIDwgYyA/IGEgOiBjKSA6IChiIDwgYyA/IGIgOiBjKVxcbiAgICB9XFxuICAgIHZhciBpLCBqLCBzaSwgdGosIGNvc3RcXG4gICAgaWYgKG4gPT09IDApIHJldHVybiBtXFxuICAgIGlmIChtID09PSAwKSByZXR1cm4gblxcbiAgICBmb3IgKGkgPSAwOyBpIDw9IG47IGkrKykge1xcbiAgICAgICAgZFtpXSA9IFtdXFxuICAgICAgICBkW2ldWzBdID0gaVxcbiAgICB9XFxuICAgIGZvciAoaiA9IDA7IGogPD0gbTsgaisrKSB7XFxuICAgICAgICBkWzBdW2pdID0galxcbiAgICB9XFxuICAgIGZvciAoaSA9IDE7IGkgPD0gbjsgaSsrKSB7XFxuICAgICAgICBzaSA9IHMuY2hhckF0KGkgLSAxKVxcbiAgICAgICAgZm9yIChqID0gMTsgaiA8PSBtOyBqKyspIHtcXG4gICAgICAgICAgICB0aiA9IHQuY2hhckF0KGogLSAxKVxcbiAgICAgICAgICAgIGlmIChzaSA9PT0gdGopIHtcXG4gICAgICAgICAgICAgICAgY29zdCA9IDBcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBjb3N0ID0gMVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgIC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uKnppqjmj5DnpLpcXFwiLFxcbiAgICAgICAgICAgICAgICBjb250ZW50OiBcXFwi5qOA5rWL5Yiw5paw55qE56OB6ZO+5Zyw5Z2A77yM54K55Ye756Gu5a6a5oyJ6ZKu5Y2z5Y+v5pKt5pS+77yM54K55Ye75Y+W5raI5oyJ6ZKu5Y+v5Lul5aSN5Yi26ZO+5o6lXFxcIixcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWFnO1xcbiAgICAgICAgICAgICAgICB9LCBpbnB1dCksXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgbWFnXFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJhbGl5dW5kcml2ZS5jb21cXFwiKSkge1xcbiAgICAgICAgICAgIGxvZyhpbnB1dCk7XFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpmL/ph4zkupHnm5hcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9XFxcIiArIHVybCArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgIH0sIGlucHV0LCBydWxlKVxcbiAgICAgICAgfSBlbHNlIGlmICgvXFxcXC4obXAzfGZsYWN8bTRhKSQvLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgbG9nKGlucHV0KTtcXG4gICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAucGxheVZpZGVvKHVybCk7XFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxuICAgICAgICB9IGVsc2UgaWYgKCFpbnB1dC5pbmNsdWRlcyhob3N0KSAmJiBpbnB1dC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICBsb2coaW5wdXQpO1xcbiAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6K+m5oOFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIHVybDogXFxcImhpa2VyOi8vcGFnZS95c2Z4P3J1bGU9XFxcIiArIHJ1bGUgKyBcXFwiJnI9XFxcIiArIHJ1bGUgKyBcXFwiIyNcXFwiICsgdXJsLFxcbiAgICAgICAgICAgICAgICB9KSlcXG4gICAgICAgICAgICB9LCBpbnB1dCwgcnVsZSk7XFxuICAgICAgICB9IGVsc2UgaWYgKCFpbnB1dC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICBsb2coaW5wdXQpO1xcbiAgICAgICAgICAgIC8v6IO95ZSk6LW3QVBQ55qE55m95ZCN5Y2VXFxuICAgICAgICAgICAgbGV0IHdoaXRlID0gW1xcbiAgICAgICAgICAgICAgICBcXFwicWtsaW5rXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcImJkbmV0ZGlza1xcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJ4dW5sZWlh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VRpdGxlKHQpO1xcbiAgICAgICAgICAgIH0sIGRvY3VtZW50LnRpdGxlKTtcXG4gICAgICAgICAgICBmeV9icmlkZ2VfYXBwLnBhcnNlTGF6eVJ1bGUocik7XFxuICAgICAgICB9XFxuICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgIGZ5X2JyaWRnZV9hcHAubG9nKGUudG9TdHJpbmcoKSk7XFxuICAgIH1cXG59KTtcXG5kLnB1c2goe1xcbiAgICB0aXRsZTogXFxcIlxcXCIsXFxuICAgIHVybDogdXJsLFxcbiAgICBjb2xfdHlwZTogXFxcIng1X3dlYnZpZXdfc2luZ2xlXFxcIixcXG4gICAgZGVzYzogXFxcIjEwMCUmJmZsb2F0XFxcIixcXG4gICAgcGljX3VybDogXFxcIlxcXCIsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICB1cmxJbnRlcmNlcHRvcjogaXRlLFxcbiAgICAgICAganM6IGpzLFxcbiAgICAgICAgY2FuQmFjazogdHJ1ZSxcXG4gICAgICAgIGpzTG9hZGluZ0luamVjdDogdHJ1ZSxcXG4gICAgICAgIGZsb2F0VmlkZW86IHRydWVcXG4gICAgfVxcbn0pO1xcbmQucHVzaCh7XFxuICAgIGNvbF90eXBlOiBcXFwibGluZVxcXCIsXFxuICAgIGV4dHJhOiB7XFxuICAgICAgICBpZDogdXJsXFxuICAgIH1cXG59KTtcXG5zZXRSZXN1bHQoZCk7XCJ9XSIsImljb24iOiIiLCJwcm94eSI6IiJ9
Add Comment
Please, Sign In to add comment