Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@影猫仓库@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi5b2x54yr5LuT5bqTIiwiYXV0aG9yIjoiIiwidXJsIjoiaGlrZXI6Ly9lbXB0eSIsInZlcnNpb24iOjIwLCJjb2xfdHlwZSI6Im1vdmllXzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6InZpZGVvIiwiY2xhc3NfdXJsIjoiIiwiYXJlYV9uYW1lIjoiIiwiYXJlYV91cmwiOiIiLCJzb3J0X25hbWUiOiIiLCJ5ZWFyX25hbWUiOiIiLCJzb3J0X3VybCI6IiIsInllYXJfdXJsIjoiIiwiZmluZF9ydWxlIjoianM6XG52YXIg572R56uZID0gJ2h0dHBzOi8veW1jay5tZSc7XG5ldmFsKEpTT04ucGFyc2UoZmV0Y2goJ2hpa2VyOi8vcGFnZS9ob21lJykpLnJ1bGUpIiwic2VhcmNoX3VybCI6IiIsImdyb3VwIjoi5o6o6I2QIiwic2VhcmNoRmluZCI6IiIsImRldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJkZXRhaWxfZmluZF9ydWxlIjoiIiwic2RldGFpbF9jb2xfdHlwZSI6Im1vdmllXzEiLCJzZGV0YWlsX2ZpbmRfcnVsZSI6IiIsInVhIjoibW9iaWxlIiwicHJlUnVsZSI6IiIsInBhZ2VzIjoiW3tcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCJ5c2Z4XCIsXCJwYXRoXCI6XCJ5c2Z4XCIsXCJydWxlXCI6XCJqczpcXG52YXIgZCA9IFtdO1xcbmxldCBydWxlID0gZ2V0UGFyYW0oXFxcInJcXFwiKS5zcGxpdChcXFwiIyNcXFwiKVswXTtcXG5sZXQgdXJsID0gTVlfVVJMLnNwbGl0KFxcXCIjI1xcXCIpWzFdO1xcbmxldCBpdGUgPSAkLnJlcX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y+v5Lul5aSN5Yi26ZO+5o6lXFxcIixcXG4gICAgICAgICAgICAgICAgY29uZmlybTogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbWFnO1xcbiAgICAgICAgICAgICAgICB9LCBpbnB1dCksXFxuICAgICAgICAgICAgICAgIGNhbmNlbDogJC50b1N0cmluZygobWFnKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcImNvcHk6Ly9cXFwiICsgbWFnXFxuICAgICAgICAgICAgICAgIH0sIGlucHV0KVxcbiAgICAgICAgICAgIH0pXFxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XFxuICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluY2x1ZGVzKFxcXCJhbGl5dW5kcml2ZS5jb21cXFwiKSkge1xcbiAgICAgICAgICAgIGxvZyhpbnB1dCk7XFxuICAgICAgICAgICAgbGV0IHIxID0gZmV0Y2goXFxcImhpa2VyOi8vaG9tZUDkupHnm5jmsYflvbFcXFwiKTtcXG4gICAgICAgICAgICBpZiAoIXIxIHx8IHIxLmxlbmd0aCA8PSA1KSB7XFxuICAgICAgICAgICAgICAgIGxldCBydSA9ICQudG9TdHJpbmcoKCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCLmtbfpmJTop4bnlYzop4TliJnliIbkuqvvvIzlvZPliY3liIbkuqvnmoTmmK/vvJrlsI/nqIvluo/vv6Vob21lX3J1bGVfdjLvv6ViYXNlNjQ6Ly9A5LqR55uY5rGH5b2xQGV5SnNZWE4wWDJOb1lYQjBaWEpmY25Wc1pTSTZJaUlzSW5ScGRHeGxJam9pNUxxUjU1dVk1ckdINWIyeElpd2lZWFYwYUc5eUlqb2lUWEpHYkhraUxDSjFjbXdpT2lKb2FXdGxjam92TDJWdGNIUjVKQ1FrWm5sd1lXZGxJaXdpZG1WeWMybHZiaUk2Tml3aVkyOXNYM1I1Y0dVaU9pSjBaWGgwWHp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m75b2V6Zi/6YeM5LqR55uY6LSm5Y+377yM5ZCm5YiZ5LiN6IO955SoJyxcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06IHJ1LFxcbiAgICAgICAgICAgICAgICAgICAgY2FuY2VsOiBydVxcbiAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsb2coXFxcImlucHV0XFxcIik7XFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLpmL/ph4zkupHnm5hcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL2RldGFpbD9ydWxlPeS6keebmOaxh+W9sSZ1cmw9XFxcIiArIHVybCArICc/P2Z5cGFnZScsXFxuICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgIH0sIGlucHV0LCBydWxlKVxcbiAgICAgICAgfSBlbHNlIGlmICgvXFxcXC4obXAzfGZsYWN8bTRhKSQvLnRlc3QoaW5wdXQpKSB7XFxuICAgICAgICAgICAgbG9nKGlucHV0KTtcXG4gICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgIGZ5X2JyaWRnZV9hcHAucGxheVZpZGVvKHVybCk7XFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpXFxuICAgICAgICB9IGVsc2UgaWYgKCFpbnB1dC5pbmNsdWRlcyhob3N0KSAmJiBpbnB1dC5zdGFydHNXaXRoKFxcXCJodHRwXFxcIikpIHtcXG4gICAgICAgICAgICBsb2coaW5wdXQpO1xcbiAgICAgICAgICAgIHJldHVybiAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgbGV0IHdoaXRlID0gW1xcbiAgICAgICAgICAgICAgICAgICAgXFxcImRvdXlpblxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiZG91YmFuXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJpeGlndWEuY29tXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJrdWFpc2hvdVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwiYmlsaWJpbGlcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIndlaWJvXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ3ZWl4aW5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImJhaWR1XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJ6bWsuXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJzdWJoZFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwidGh1bmRlclxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwieGluanVjXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJncmFiNGtcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcIi9idFxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBcXFwianNyMTBcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgXFxcImFzc3J0XFxcIixcXG4gICAgICAgICAgICAgICAgICAgIFxcXCJxdWFya1xcXCJcXG4gICAgICAgICAgICAgICAgXTtcXG4gICAgICAgICAgICAgICAgbGV0IGluV2hpdGUgPSB3aGl0ZS5maWx0ZXIoaXQgPT4gdXJsLmluY2x1ZGVzKGl0KSkubGVuZ3RoID4gMDtcXG4gICAgICAgICAgICAgICAgaWYgKGluV2hpdGUpIHtcXG4gICAgICAgICAgICAgICAgICAgIC8v6Lez572R6aG1XFxuICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6K+m5oOFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UveXNmeD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZyPVxcXCIgKyBydWxlICsgXFxcIiMjXFxcIiArIHVybCxcXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgLy9BSeino+aekFxcbiAgICAgICAgICAgICAgICAgICAgZnlfYnJpZGdlX2FwcC5vcGVuKEpTT04uc3RyaW5naWZ5KHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB0aXRsZTogZG9jdW1lbnQudGl0bGUsXFxuICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiBcXFwiaGlrZXI6Ly9wYWdlL3A/cnVsZT1cXFwiICsgcnVsZSArIFxcXCImcj1cXFwiICsgcnVsZSArIFxcXCImdT1cXFwiICsgZnlfYnJpZGdlX2FwcC5iYXNlNjRFbmNvZGUodXJsKSxcXG4gICAgICAgICAgICAgICAgICAgIH0pKVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpO1xcbiAgICAgICAgfSBlbHNlIGlmICghaW5wdXQuc3RhcnRzV2l0aChcXFwiaHR0cFxcXCIpKSB7XFxuICAgICAgICAgICAgbG9nKGlucHV0KTtcXG4gICAgICAgICAgICAvL+iDveWUpOi1t0FQUOeahOeZveWQjeWNlVxcbiAgICAgICAgICAgIGxldCB3aGl0ZSA9IFtcXG4gICAgICAgICAgICAgICAgXFxcInFrbGlua1xcXCIsXFxuICAgICAgICAgICAgICAgIFxcXCJiZG5ldGRpc2tcXFwiLFxcbiAgICAgICAgICAgICAgICBcXFwieHVubGVpYXBwXFxcIlxcbiAgICAgICAgICAgIF07XFxuICAgICAgICAgICAgbGV0IGluV2hpdGUgPSB3aGl0ZS5maWx0ZXIoaXQgPT4gaW5wdXQuc3RhcnRzV2l0aChpdCkpLmxlbmd0aCA+IDA7XFxuICAgICAgICAgICAgaWYgKCFpbldoaXRlKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgcmV0dXJuICQudG9TdHJpbmcoKHVybCwgcnVsZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW5UaGlyZEFwcCAmJiBmeV9icmlkZ2VfYXBwLm9wZW5UaGlyZEFwcCh1cmwpO1xcbiAgICAgICAgICAgIH0sIGlucHV0LCBydWxlKVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBsZXQgd2hpdGUgPSBbXFxuICAgICAgICAgICAgICAgIFxcXCJ1cmw9XFxcIixcXG4gICAgICAgICAgICAgICAgXFxcImZzb3UuY29tXFxcIixcXG4gICAgICAgICAgICAgICAgXFxcImJpbmcuXFxcIiwgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgXTtcXG4gICAgICAgICAgICBsZXQgaW5XaGl0ZSA9IHdoaXRlLmZpbHRlcihpdCA9PiBpbnB1dC5pbmNsdWRlcyhpdCkpLmxlbmd0aCA+IDA7XFxuICAgICAgICAgICAgaWYgKGluV2hpdGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgcmVnID0gbmV3IFJlZ0V4cChcXFwiW1xcXFx1NGUwMC1cXFxcdTlmYTVdK1xcXCIsIFxcXCJnXFxcIik7XFxuICAgICAgICAgICAgbGV0IHIgPSBkZWNvZGVVUklDb21wb25lbnQoaW5wdXQpO1xcbiAgICAgICAgICAgIGlmIChyZWcudGVzdChyKSB8fCAoaW5wdXQuc3RhcnRzV2l0aChvcmlnaW4pICYmIGlucHV0Lmxlbmd0aCAtIG9yaWdpbi5sZW5ndGggPiAyKSkge1xcbiAgICAgICAgICAgICAgICAvL+acieS4reaWh++8jOW6lOivpeaYr+WcqOaQnOe0ou+8jOi3s+aWsOmhtemdolxcbiAgICAgICAgICAgICAgICByZXR1cm4gJC50b1N0cmluZygodXJsLCBydWxlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBmeV9icmlkZ2VfYXBwLm9wZW4oSlNPTi5zdHJpbmdpZnkoe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBcXFwi6K+m5oOFXFxcIixcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UveXNmeD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZyPVxcXCIgKyBydWxlICsgXFxcIiMjXFxcIiArIHVybCxcXG4gICAgICAgICAgICAgICAgICAgIH0pKTtcXG4gICAgICAgICAgICAgICAgfSwgaW5wdXQsIHJ1bGUpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH1cXG4gICAgfSwgcnVsZSwgb3JpZ2luKTtcXG59XCJ9LHtcImNvbF90eXBlXCI6XCJtb3ZpZV8zXCIsXCJuYW1lXCI6XCLkuoznuqfop6PmnpBcIixcInBhdGhcIjpcInBcIixcInJ1bGVcIjpcImpzOlxcbnZhciBkID0gW107XFxubGV0IHVybCA9IGJhc2U2NERlY29kZShnZXRQYXJhbShcXFwidVxcXCIpKTtcXG5sZXQgbGlzdCA9IHN0b3JhZ2UwLmdldEl0ZW0oXFxcIndoaXRlXFxcIiwgW10pO1xcbmxldCBpbldoaXRlID0gbGlzdC5pbmNsdWRlcyh1cmwpO1xcbmxldCBkID0gW107XFxuaWYgKCFpbldoaXRlKSB7XFxuICAgIGxldCBodG1sID0gcmVxdWVzdCh1cmwpO1xcbiAgICBsZXQgd2ViID0gZ2V0SXRlbSgnd2ViJywgJzAnKSA9PSBcXFwiMVxcXCI7XFxuICA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gIHJldHVybiAtMTtcXG4gICAgICAgIH1cXG4gICAgICAgIGl0ID0gaXQudGV4dCB8fCBcXFwiXFxcIjtcXG4gICAgICAgIGlmIChpdCA9PSBcXFwiXFxcIikge1xcbiAgICAgICAgICAgIHJldHVybiAtMTtcXG4gICAgICAgIH1cXG4gICAgICAgIGl0ID0gY2xlYXJUZXh0KGl0KTtcXG4gICAgICAgIGxldCByZWcgPSAvXlswLTldKiQvO1xcbiAgICAgICAgaWYgKCFyZWcudGVzdChpdCkpIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICBpdCA9IHBhcnNlSW50KGl0KTtcXG4gICAgICAgIGlmIChpc05hTihpdCkpIHtcXG4gICAgICAgICAgICByZXR1cm4gLTE7XFxuICAgICAgICB9XFxuICAgICAgICBpZiAoaXQgPiAxOTAwICYmIGl0IDwgMjEwMCkge1xcbiAgICAgICAgICAgIHJldHVybiAtMTtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBpdDtcXG4gICAgfVxcblxcbiAgICBmdW5jdGlvbiBpc0NoYXB0ZXIwKGl0LCBicm90aGVyKSB7XFxuICAgICAgICAvKmlmIChkZWJ1Zykge1xcbiAgICAgICAgICAgIGxvZyh7XFxuICAgICAgICAgICAgICAgIGl0OiBpdCxcXG4gICAgICAgICAgICAgICAgYnJvdGhlcjogYnJvdGhlclxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSovXFxuICAgICAgICBpdCA9IGdldENoYXB0ZXJOdW0oaXQpO1xcbiAgICAgICAgLy9pZiAoZGVidWcpIGxvZyhpdCk7XFxuICAgICAgICBpZiAoaXQgPCAwKSB7XFxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xcbiAgICAgICAgfVxcbiAgICAgICAgYnJvdGhlciA9IGdldENoYXB0ZXJOdW0oYnJvdGhlcik7XFxuICAgICAgICAvL2lmIChkZWJ1ZykgbG9nKGJyb3RoZXIpO1xcbiAgICAgICAgaW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hcnJbaSArIDFdO1xcbiAgICAgICAgaWYgKGlzQ2hhcHRlcihpdCwgcHJlLCBuZXh0KSkge1xcbiAgICAgICAgICAgIGlmICh3ZWIpIHtcXG4gICAgICAgICAgICAgICAgdmFyIHVybHggPSBcXFwid2ViUnVsZTovL1xcXCIgKyBpdC5ocmVmICsgXFxcIkBcXFwiICsgX3dlYjtcXG4gICAgICAgICAgICAgICAgdmFyIGV4dHJheCA9IHtcXG4gICAgICAgICAgICAgICAgICAgIGpzTG9hZGluZ0luamVjdDogdHJ1ZSxcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdC5ocmVmLFxcbiAgICAgICAgICAgICAgICAgICAgYmxvY2tSdWxlczogWycubTRhJywgJy5tcDMnLCAnLmZsdicsICcuYXZpJywgJy4zZ3AnLCAnLm1wZWcnLCAnLndtdicsICcubW92JywgJy5ybXZiJywgJy5naWYnLCAnLmpwZWcnLCAnLnBuZycsICcuaWNvJywgJy5zdmcnXVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHZhciB1cmx4ID0gXFxcInZpZGVvOi8vXFxcIiArIGl0LmhyZWY7XFxuICAgICAgICAgICAgICAgIHZhciBleHRyYXggPSB7XFxuICAgICAgICAgICAgICAgICAgICBpZDogaXQuaHJlZlxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogdCxcXG4gICAgICAgICAgICAgICAgdXJsOiB1cmx4LFxcbiAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfM1xcXCIsXFxuICAgICAgICAgICAgICAgIGV4dHJhOiBleHRyYXhcXG4gICAgICAgICAgICB9KTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBpZiAoZC5sZW5ndGggPT0gMCkge1xcbiAgICAgICAgcmV0dXJuIGQ7XFxuICAgIH0gZWxzZSB7XFxuXFxuICAgICAgICBkLnNwbGljZSgwLCAwLCB7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLwn5SXXFxcIiArIHVybCxcXG4gICAgICAgICAgICB1cmw6IFxcXCJoaWtlcjovL3BhZ2UveXNmeD9ydWxlPVxcXCIgKyBydWxlICsgXFxcIiZyPVxcXCIgKyBydWxlICsgXFxcIiMjXFxcIiArIHVybCxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcInRleHRfMVxcXCIsXFxuICAgICAgICAgICAgZGVzYzogXFxcIlxcXCIsXFxuICAgICAgICAgICAgcGljX3VybDogXFxcIlxcXCJcXG4gICAgICAgIH0pO1xcblxcblxcbiAgICAgICAgLy/kuLrnur/ot6/liqDliIblibLnur9cXG4gICAgICAgIGxldCBkMiA9IFtdO1xcbiAgICAgICAgZm9yIChsZXQgaSA9IDA7IGkgPCBkLmxlbmd0aDsgaSsrKSB7XFxuICAgICAgICAgICAgZDIucHVzaChkW2ldKTtcXG4gICAgICAgICAgICBpZiAoaSA8IGQubGVuZ3RoIC0gMSkge1xcbiAgICAgICAgICAgICAgICBsZXQgaXQgPSBkW2ldO1xcbiAgICAgICAgICAgICAgICBsZXQgdDEgPSBwYXJzZUludChjbGVhclRleHQoaXQudGl0bGUpKTtcXG4gICAgICAgICAgICAgICAgbGV0IG5leHQgPSBkW2kgKyAxXTtcXG4gICAgICAgICAgICAgICAgbGV0IHQyID0gcGFyc2VJbnQoY2xlYXJUZXh0KG5leHQudGl0bGUpKTtcXG4gICAgICAgICAgICAgICAgaWYgKHQyIC0gdDEgPiAxIHx8IHQxIC0gdDIgPiAxKSB7XFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgICAgICAgICAgICAgY29sX3R5cGU6IFxcXCJsaW5lX2JsYW5rXFxcIlxcbiAgICAgICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgICAgICAgICBkMi5wdXNoKHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogXFxcImJpZ19ibGFua19ibG9ja1xcXCJcXG4gICAgICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgZDIucHVzaCh7XFxuICAgICAgICAgICAgdGl0bGU6IFxcXCLljLnphY3mnInor6/vvJ/ngrnmiJHkuI3lho3ljLnphY3mraTpobXpnaJcXFwiLFxcbiAgICAgICAgICAgIHVybDogJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgodXJsKSA9PiB7XFxuICAgICAgICAgICAgICAgIGNvbmZpcm0oe1xcbiAgICAgICAgICAgICAgICAgICAgdGl0bGU6IFxcXCLmuKnppqjmj5DnpLpcXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgY29udGVudDogXFxcIuWmguaenOWPquaYr+WNleasoeWMuemFjeWksei0pe+8jOeCueWHu+S4i+aWueWPlua2iOaMiemSruWIt+aWsOmhtemdoumHjeaWsOWMuemFje+8jOWmguaenOehruiupOaXoOazleWMuemFje+8jOeCueWHu+S4i+aWueehruWumuaMiemSruWKoOWFpeeZveWQjeWNlVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICBjYW5jZWw6IFxcXCJyZWZyZXNoUGFnZSgpXFxcIixcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpcm06ICQudG9TdHJpbmcoKHVybCkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBsaXN0ID0gc3RvcmFnZTAuZ2V0SXRlbShcXFwid2hpdGVcXFwiLCBbXSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGlzdC5wdXNoKHVybCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmFnZTAuc2V0SXRlbShcXFwid2hpdGVcXFwiLCBsaXN0KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/lt7LliqDlhaXnmb3lkI3ljZVcXFwiXFxuICAgICAgICAgICAgICAgICAgICB9LCB1cmwpXFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcImhpa2VyOi8vZW1wdHlcXFwiXFxuICAgICAgICAgICAgfSwgdXJsKSxcXG4gICAgICAgICAgICBjb2xfdHlwZTogXFxcImF2YXRhclxcXCIsXFxuICAgICAgICAgICAgaW1nOiBcXFwiaGlrZXI6Ly9pbWFnZXMvYWNjb3VudFxcXCJcXG4gICAgICAgIH0pO1xcbiAgICAgICAgcmV0dXJuIGQyO1xcbiAgICB9XFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwieDVBSVwiLFwicGF0aFwiOlwieDVhaVwiLFwicnVsZVwiOlwiJC5leHBvcnRzID0gZnVuY3Rpb24ocnVsZSwgYW5jaG9ySWQpIHtcXG4gICAgcmV0dXJuICQudG9TdHJpbmcoKHJ1bGUsIGFuY2hvcklkLCB3aGl0ZSkgPT4ge1xcbiAgICAgICAgaWYgKHdpbmRvdy5jaGVjazAgPT0gbnVsbCkge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrMCgpIHtcXG4gICAgICAgICAgICAgICAgdHJ5IHtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gZG9jdW1lbnQucXVlcnlTZWxlY3RvcihcXFwiaHRtbFxcXCIpLmlubmVySFRNTDtcXG4gICAgICAgICAgICAgICAgICAgIGZiYS5wdXRWYXIoXFxcImh0bWwwXFxcIiwgaHRtbCk7XFxuICAgICAgICAgICAgICAgICAgICBmYmEucGFyc2VMYXp5UnVsZUFzeW5jKCQkJCgpLmxhenlSdWxlKChydWxlLCB1cmwsIGFuY2hvcklkLCB3aGl0ZSkgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkID0gW107XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBodG1sID0gZ2V0VmFyKFxcXCJodG1sMFxcXCIsIFxcXCJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJWYXIoXFxcImh0bWwwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB3ZWIgPSBmYWxzZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHdoaXRlMiA9IFtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxcXCJmc291LmNvbVxcXCIsXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcXFwiYmluZy5cXFwiLFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5XaGl0ZSA9IHdoaXRlMi5maWx0ZXIoaXQgPT4gdXJsLmluY2x1ZGVzKGl0KSkubGVuZ3RoID4gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaW5XaGl0ZSAmJiAhd2hpdGUuaW5jbHVkZXModXJsKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHBhcnNlID0gJC5yZXF1aXJlKFxcXCJoaWtlcjovL3BhZ2UvcGFyc2U/cnVsZT1cXFwiICsgcnVsZSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gcGFyc2UocnVsZSwgd2ViLCB1cmwsIGh0bWwpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaW5XaGl0ZSAmJiBkLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFyciA9IHBkZmEoaHRtbCwgXFxcImJvZHkmJmlmcmFtZVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcnIubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgc3JjID0gcGRmaChhcnJbMF0sIFxcXCJpZnJhbWUmJnNyY1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coXFxcIuiOt+WPluWIsGlmcmFtZe+8mlxcXCIgKyBzcmMpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXdoaXRlLmluY2x1ZGVzKHNyYykpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcmMgJiYgc3JjLnN0YXJ0c1dpdGgoXFxcImh0dHBcXFwiKSAmJiAhc3JjLm1hdGNoKC9cXFxcLm1wNHxcXFxcLm0zdTh8XFxcXC5tcDN8XFxcXC5mbHZ8XFxcXC5ta3YvKSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGh0bWwgPSByZXF1ZXN0KHNyYyk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9IHBhcnNlKHJ1bGUsIHdlYiwgc3JjLCBodG1sKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb2coXFxcIuWwneivleiOt+WPlmlmcmFtZeWksei0pVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkLmxlbmd0aCA+IDApIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRbMF0udXJsID0gJChcXFwiI25vTG9hZGluZyNcXFwiKS5sYXp5UnVsZSgoYW5jaG9ySWQpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVzYyA9IGdldFZhcihhbmNob3JJZCwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVzYyA9PSBcXFwiMFxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFg1RGVzYyhcXFwiZmxvYXQmJnNjcmVlbi0xNzBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0VmFyKGFuY2hvcklkLCBcXFwiMVxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZnJlc2hYNURlc2MoXFxcImZsb2F0JiYwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihhbmNob3JJZCwgXFxcIjBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJoaWtlcjovL2VtcHR5XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sIGFuY2hvcklkICsgXFxcIng1XFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkWzBdLnRpdGxlID0gXFxcIuWxleW8gC/mlLbotbdcXFwiICsgZFswXS50aXRsZTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB1dFZhcihhbmNob3JJZCArIFxcXCJ4NVxcXCIsIFxcXCIwXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZyZXNoWDVEZXNjKFxcXCJmbG9hdCYmMFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgaXQgb2YgZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBleHRyYSA9IGl0LmV4dHJhIHx8IHt9O1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhLmNscyA9IFxcXCJ4NWFpXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpdC5leHRyYSA9IGV4dHJhO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlSXRlbUJ5Q2xzKFxcXCJ4NWFpXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGRJdGVtQWZ0ZXIoYW5jaG9ySWQsIGQpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9hc3QoXFxcIkFJ5Yy56YWN5oiQ5YqfXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQubGVuZ3RoID4gMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKFxcXCJwYXJzZUxhenlSdWxlQXN5bmM6XFxcIiArIGQubGVuZ3RoKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZC5sZW5ndGggPiAwID8gXFxcIjFcXFwiIDogXFxcIjBcXFwiO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSwgcnVsZSwgbG9jYXRpb24uaHJlZiwgYW5jaG9ySWQsIHdoaXRlKSwgJCQkLnRvU3RyaW5nKCgpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoXFxcIjBcXFwiID09IGlucHV0KSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja2MgPSB3aW5kb3cuY2hlY2tjICsgMTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyppZiAod2luZG93LmNoZWNrYyA+IDEyMCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmJhLmxvZyhcXFwi5omn6KGM6LaF6L+HMzDnp5LvvIzml6Dms5Xop6PmnpBcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsqL1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KHdpbmRvdy5jaGVjazAsIDI1MCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vfVxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5jaGVja3VybCA9IGxvY2F0aW9uLmhyZWY7XFxuXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGNoZWNrdTAoKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2luZG93LmNoZWNrdXJsICE9IGxvY2F0aW9uLmhyZWYpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2hhc2jlj5HnlJ/kuoblj5jljJZcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuY2hlY2tjID0gMDtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hlY2swKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgMjAwMCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoY2hlY2t1MCwgMjUwKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGVja3UwKCk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICAgICAgfSkpO1xcbiAgICAgICAgICAgICAgICB9IGNhdGNoIChlKSB7XFxuICAgICAgICAgICAgICAgICAgICBmYmEubG9nKGUudG9TdHJpbmcoKSk7XFxuICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KHdpbmRvdy5jaGVjazAsIDI1MCk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgd2luZG93LmNoZWNrYyA9IDA7XFxuICAgICAgICAgICAgd2luZG93LmNoZWNrMCA9IGNoZWNrMDtcXG4gICAgICAgICAgICBjaGVjazAoKTtcX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