Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:二级页面详情¥page_detail¥愿与你不负光年@@eyJkYXRhIjoie1wiYXNzb2NpYXRlZE1vZGVsc01hcEZvckpvaW5UYWJsZVwiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhGS1wiOnt9LFwiYXNzb2NpYXRlZE1vZGVsc01hcFdpdGhvdXRGS1wiOnt9LFwiZGlzcGxheU5hbWVcIjpcIkRD5b2x6KeGXCIsXCJmaWVsZHNUb1NldFRvRGVmYXVsdFwiOltdLFwiaWRcIjowLFwibGFzdF9jaGFwdGVyX3J1bGVcIjpcImpzOihcXG5mdW5jdGlvbiAoYXBwdHlwZSwgYXBwVXJsKSB7XFxuICAgIGxldCBjaHAgPSBbXTtcXG4gICAgdHJ5IHtcXG4gICAgICAgIGxldCBjb250cyA9IFtdLCBodG1sID0gSlNPTi5wYXJzZShmZXRjaChNWV9VUkwuc3BsaXQoXFxcIiMjXFxcIilbMV0sIHtoZWFkZXJzOiB7XFxcIlVzZXItQWdlbnRcXFwiOiBcXFwiRGFydC8yLjEzIChkYXJ0OmlvKVxcXCJ9fSkpO1xcbiAgICAgICAgaWYgKGFwcHR5cGUuaW5jbHVkZXMoXFxcIlRWXFxcIikpIHtcXG4gICAgICAgICAgICBjb250cyA9IE9iamVjdC5rZXlzKGh0bWwudmlkZW9saXN0KTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgaWYgKGFwcFVybC5pbmNsdWRlcyhcXFwiYXBpLnBocC9hcHAvXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgY29udHMgPSBodG1sLmRhdGEudm9kX3VybF93aXRoX3BsYXllcjtcXG4gICAgICAgICAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhLnZvZF9wbGF5X3VybC5zcGxpdChcXFwiJCQkXFxcIik7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpZiAoYXBwVXJsLmluY2x1ZGVzKFxcXCJ4Z2FwcC5waHAvdjEvXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhLnZvZF9pbmZvLnZvZF91cmxfd2l0aF9wbGF5ZXI7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoY29udHMubGVuZ3RoIDwgMSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRzID0gaHRtbC5kYXRhLnZvZF9pbmZvLnZvZF9wbGF5X3VybC5zcGxpdChcXFwiJCQkXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV9saXN0O1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNvbnRzLmxlbmd0aCA8IDEpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBjb250cyA9IGh0bWwuZGF0YS52b2RfcGxheV91cmwuc3BsaXQoXFxcIiQkJFxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IGxpc3QgPSBbXTtcXG4gICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgY29udHMubGVuZ3RoOyBpKyspIHtcXG4gICAgICAgICAgICBpZiAoYXBwdHlwZS5pbmNsdWRlcyhcXFwiVFZcXFwiKSkge1xcbiAgICAgICAgICAgICAgICBsaXN0ID0gaHRtbC52aWRlb2xpc3RbY29udHNbaV1dO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmIChjb250c1tpXS51cmxzKSB7XFxuICAgICAgICAgICAgICAgICAgICBsaXN0ID0gY29udHNbaV0udXJscztcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChjb250c1tpXS51cmwpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsaXN0ID0gY29udHNbaV0udXJsLnNwbGl0KFxcXCIjXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QgPSBjb250c1tpXS5zcGxpdChcXFwiI1xcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGNocC5wdXNoKGxpc3QubGVuZ3RoKTtcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICBjYXRjaCAoZSkge1xcbiAgICB9XFxuICAgIHNldFJlc3VsdChcXFwiXFxcXHU2NmY0XFxcXHU2NWIwXFxcXHU4MWYzOlxcXCIgKyAoTWF0aC5tYXguYXBwbHkoTWF0aCwgY2hwKSkpO1xcbn1cXG4pKFxcXCLkvJjotKhcXFwiLFxcXCJodHRwOi8vY2hhb3JlbmJiLmNvbS9hcGkucGhwL3YxLnZvZFxcXCIpXCIsXCJsaXN0VG9DbGVhckFzc29jaWF0ZWRGS1wiOltdLFwibGlzdFRvQ2xlYXJTZWxmRktcIjpbXSxcInBhZ2VMaXN0XCI6W3tcIm5hbWVcIjpcIkFQUOWIhuexu+WIl+ihqFwiLFwicGF0aFwiOlwiYXBwbGlzdGRhdGFcIixcInJ1bGVcIjpcIihcXG5mdW5jdGlvbiAoKSB7XFxuICAgIGxldCBsaXN0ID0gW107XFxuICAgIGlmIChhcHBVcmwuaW5jbHVkZXMoXFxcImFwaS5waHAvYXBwL1xcXCIpKSB7XFxuICAgICAgICBsaXN0ID0gaHRtbC5saXN0O1xcbiAgICB9IGVsc2Uge1xcbiAgICAgICAgaWYgKGFwcFVybC5pbmNsdWRlcyhcXFw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jpcIihcXG5mdW5jdGlvbiAoKSB7XFxuICAgIHJldHVybiAkKFxcXCJcXFwiKS5sYXp5UnVsZSgocHRhYiwgdmxpbmssIGp4VXJsLCBhcHBVcmwpID0+IHtcXG4gICAgICAgIGxvZyhcXFwiXFxcXHU4OWM2XFxcXHU5ODkxXFxcXHU5NGZlXFxcXHU2M2E1OlxcXCIgKyB2bGluayk7XFxuICAgICAgICB0cnkge1xcbiAgICAgICAgICAgIGZ1bmN0aW9uIGNoYW5nZVZpZGVvVXJsKHVybCkge1xcbiAgICAgICAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKFxcXCJ3a2ZpbGVcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgdXJsID0gdXJsICsgXFxcIjt7UmVmZXJlckBodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS99XFxcIjtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwdGFiID09IFxcXCJiaWxpYmlsaVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFwiO3tSZWZlcmVyQGh0dHBzOi8vd3d3LmJpbGliaWxpLmNvbS8mJlVzZXItQWdlbnRATW96aWxsYS81LjB9XFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gXFxcIm1ndHZcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArIFxcXCI7e1JlZmVyZXJAd3d3Lm1ndHYuY29tJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFwib2pia1xcXCIpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFwiO3tSZWZlcmVyQGh0dHBzOi8vYmFrLm9qYmtqeC5jb20vfVxcXCI7XFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgaWYgKCF1cmwuaW5jbHVkZXMoXFxcImh0dHBcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXCJcXFxcdTk0ZmVcXFxcdTYzYTVcXFxcdTRlMGRcXFxcdTY2MmZcXFxcdTRlZTVodHRwXFxcXHU1ZjAwXFxcXHU1OTM0XFxcIik7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoL1xcXFwubTN1OC8udGVzdCh1cmwpKSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGNhY2hlTTN1OCh1cmwpO1xcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBpZiAoL1xcXFwubTN1OHxcXFxcLm1wNHxvYmpcXFxcL3Rvc3xuZXRlYXNlXFxcXC5jb20vLnRlc3QodmxpbmspICYmIC9odHRwLy50ZXN0KHZsaW5rKSAmJiAhL1xcXFwuaHRtbC8udGVzdCh2bGluaykpIHtcXG4gICAgICAgICAgICAgICAgbGV0IHB1cmwgPSB2bGluaztcXG4gICAgICAgICAgICAgICAgaWYgKHB0YWIuaW5jbHVkZXMoXFxcImR1b2R1b3p5XFxcIikgfHwgdmxpbmsuaW5jbHVkZXMoXFxcIm0zdTguY2FjaGUuc3VveW8uY2NcXFwiKSkge1xcbiAgICAgICAgICAgICAgICAgICAgZXZhbChnZXRDcnlwdG9KUygpKTtcXG4gICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIERlKHdvcmQpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICB2YXIgYSA9IENyeXB0b0pTLmVuYy5VdGY4LnBhcnNlKG1kNShcXFwiclhqV3ZYbDZcXFwiKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgdmFyIHQgPSBDcnlwdG9KUy5lbmMuVXRmOC5wYXJzZShcXFwiTlhiSG9XSmJwc0VPaW44YlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBDcnlwdG9KUy5BRVMuZGVjcnlwdCh3b3JkLCBhLCB7aXY6IHQsIG1vZGU6IENyeXB0b0pTLm1vZGUuQ0JDLCBwYWRkaW5nOiBDcnlwdG9KUy5wYWQuUGtjczd9KS50b1N0cmluZyhDcnlwdG9KUy5lbmMuVXRmOCk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgICAgICBwdXJsID0gRGUoSlNPTi5wYXJzZShmZXRjaChcXFwiaHR0cHM6Ly9qaHBjLm1hbmR1aHUuY29tL2R1b2R1by9hcGkucGhwP3VybD1cXFwiICsgdmxpbmspKS51cmwpO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIuaW5jbHVkZXMoXFxcIkNMNEtcXFwiKSB8fCB2bGluay5pbmNsdWRlcyhcXFwicnVpZmVuZ2xiXFxcIikpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaHRtbCA9IGZldGNoKFxcXCJodHRwczovL3R2LnlqaGFuLmNvbTo0NDMzL0NMNEsvP3VybD1cXFwiICsgdmxpbmspLCB0b2tlbiA9IGh0bWwubWF0Y2goL2xlX3Rva2VuLio9LipcXFwiKC4qKVxcXCIvKVsxXSwgdXJsID0gaHRtbC5tYXRjaCgvXFxcInVybFxcXCIuKjouKlxcXCIoLiopXFxcIi8pWzFdO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoZ2V0Q3J5cHRvSlMoKSk7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gRGUod29yZCkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIga2V5ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UoXFxcIkE0MkVBQzBDMkI0MDg0NzJcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyIGl2ID0gQ3J5cHRvSlMuZW5jLlV0ZjgucGFyc2UodG9rZW4pO1xcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQ3J5cHRvSlMuQUVTLmRlY3J5cHQod29yZCwga2V5LCB7aXY6IGl2LCBtb2RlOiBDcnlwdG9KUy5tb2RlLkNCQywgcGFkZGluZzogQ3J5cHRvSlMucGFkLlBrY3M3fSkudG9TdHJpbmcoQ3J5cHRvSlMuZW5jLlV0ZjgpO1xcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgICAgICBwdXJsID0gRGUodXJsKTtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gY2hhbmdlVmlkZW9VcmwocHVybCk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGlmIChwdGFiLmluY2x1ZGVzKFxcXCJuZXRmbGl4bW9tXFxcIikgfHwgL15uZXRmbGl4bW9tLy50ZXN0KHZsaW5rKSkge1xcbiAgICAgICAgICAgICAgICBqeFVybCA9IFxcXCJodHRwczovL2RwLmtvbmdidXlhLmNvbS9qc29uLnBocD91cmw9XFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgbG9nKFxcXCJcXFxcdTRmN2ZcXFxcdTc1M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XCIpICsgMSk7XFxuICAgICAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNoYW5nZVZpZGVvVXJsKHB1cmwpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBsZXQgaHRtbCA9IHNjb2RlLmJvZHk7XFxuICAgICAgICAgICAgaWYgKC80MDQgTm90IEZvdW5kfOWkh+ahiOWQjuWPr+e7p+e7reiuv+mXri8udGVzdChodG1sKSkge1xcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXFxcIjQwNFxcXFx1NGU4NlxcXCIpO1xcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIGlmICgvXFxcXDxib2R5Ly50ZXN0KGh0bWwpKSB7XFxuICAgICAgICAgICAgICAgICAgICBsb2coXFxcIlxcXFx1NWMxZFxcXFx1OGJkNVxcXFx1NGVjZVxcXFx1N2Y1MVxcXFx1OTg3NVxcXFx1NTVjNVxcXFx1NjNhMlxcXCIpO1xcbiAgICAgICAgICAgICAgICAgICAgcmVxdWlyZUNhY2hlKFxcXCJodHRwczovL2NvZGUuYWxpeXVuLmNvbS9semsyMzU1OS9QdWJsaWNSdWxlL3Jhdy9tYXN0ZXIveDVydWxlLmpzXFxcIiwgMjQpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHg1cnVsZShsaW5rLCBsaW5rKTtcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgICAgIGxvZyhcXFwiXFxcXHU1YzFkXFxcXHU4YmQ1XFxcXHU0ZWNlXFxcXHU5NzVlXFxcXHU3ZjUxXFxcXHU5ODc1XFxcXHU1NWM1XFxcXHU2M2EyXFxcIik7XFxuICAgICAgICAgICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBwdXJsID0gSlNPTi5wYXJzZShodG1sKS51cmw7XFxuICAgICA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gIHJldHVybiAkKFxcXFxcXFwiXFxcXFxcXCIpLmxhenlSdWxlKChwdGFiLCB2bGluaywganhVcmwsIGFwcFVybCkgPT4ge1xcXFxuICAgICAgICBsb2coXFxcXFxcXCJcXFxcXFxcXHU4OWM2XFxcXFxcXFx1OTg5MVxcXFxcXFxcdTk0ZmVcXFxcXFxcXHU2M2E1OlxcXFxcXFwiICsgdmxpbmspO1xcXFxuICAgICAgICB0cnkge1xcXFxuICAgICAgICAgICAgZnVuY3Rpb24gY2hhbmdlVmlkZW9VcmwodXJsKSB7XFxcXG4gICAgICAgICAgICAgICAgaWYgKHVybC5pbmNsdWRlcyhcXFxcXFxcIndrZmlsZVxcXFxcXFwiKSkge1xcXFxuICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFxcXFxcIjt7UmVmZXJlckBodHRwczovL2ZhbnR1YW4ud2tmaWxlLmNvbS99XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gXFxcXFxcXCJiaWxpYmlsaVxcXFxcXFwiKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFxcXFxcIjt7UmVmZXJlckBodHRwczovL3d3dy5iaWxpYmlsaS5jb20vJiZVc2VyLUFnZW50QE1vemlsbGEvNS4wfVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHB0YWIgPT0gXFxcXFxcXCJtZ3R2XFxcXFxcXCIpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmwgPSB1cmwgKyBcXFxcXFxcIjt7UmVmZXJlckB3d3cubWd0di5jb20mJlVzZXItQWdlbnRATW96aWxsYS81LjB9XFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1cmwuaW5jbHVkZXMoXFxcXFxcXCJvamJrXFxcXFxcXCIpKSB7XFxcXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybCA9IHVybCArIFxcXFxcXFwiO3tSZWZlcmVyQGh0dHBzOi8vYmFrLm9qYmtqeC5jb20vfVxcXFxcXFwiO1xcXFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICAgICAgfVxcXFxuICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICBpZiAoIXVybC5pbmNsdWRlcyhcXFxcXFxcImh0dHBcXFxcXFxcIikpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFxcXFxcXFwiXFxcXFxcXFx1OTRmZVxcXFxcXFxcdTYzYTVcXFxcXFxcXHU0ZTBkXFxcXFxcXFx1NjYyZlxcXFxcXFxcdTRlZTVodHRwXFxcXFxcXFx1NWYwMFxcXFxcXFxcdTU5MzRcXFxcXFxcIik7XFxcXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgaWYgKC9cXFxcXFxcXC5tM3U4Ly50ZXN0KHVybCkpIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBjYWNoZU0zdTgodXJsKTtcXFxcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmwgKyBcXFxcXFxcIiNpc1ZpZGVvPXRydWUjXFxcXFxcXCI7XFxcXG4gICAgICAgICAgICAgICAgICAgIH1cXFxcbiAgICAgICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgICAgICBpZiAoL1xcXFxcXFxcLm0zdTh8XFxcXFxcXFwubXA0fG9ialxcXFx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XFxcXFxcXFwtfHhmeVxcXFxcXFxcLS8pICE9IC0xO1xcXFxuICAgICAgICAgICAgaWYgKCh0ZXN0MSB8fCB0ZXN0MikgJiYgZW5EbiA9PSBcXFxcXFxcIjFcXFxcXFxcIikge1xcXFxuICAgICAgICAgICAgICAgIGxvZyhcXFxcXFxcIlxcXFxcXFxcdThjMDNcXFxcXFxcXHU3NTI4XFxcXFxcXFx1NjVhZFxcXFxcXFxcdTYzZDJcXFxcXFxcXHU4OWUzXFxcXFxcXFx1Njc5MFxcXFxcXFwiKTtcXFxcbiAgICAgICAgICAgICAgICBldmFsKFxcXFxcXFwibGV0IGNvbmZpZyA9XFxcXFxcXCIgKyBmZXRjaChcXFxcXFxcImhpa2VyOi8vZmlsZXMvY2FjaGUvTXlQYXJzZVNldC5qc29uXFxcXFxcXCIpKTtcXFxcbiAgICAgICAgICAgICAgICBldmFsKGZldGNoKGNvbmZpZy5jaikpO1xcXFxuICAgICAgICAgICAgICAgIHJldHVybiBheXRtUGFyc2UodmxpbmspO1xcXFxuICAgICAgICAgICAgfSBlbHNlIHtcXFxcbiAgICAgICAgICAgICAgICByZXR1cm4gdmxpbms7XFxcXG4gICAgICAgICAgICB9XFxcXG4gICAgICAgIH1cXFxcbiAgICB9XFxcXG4gICAgLCBwdGFiLCB2bGluaywganhVcmwsIGFwcFVybCk7XFxcXG59XFxcXG4pKClcXFwifV1cIn0iLCJwaWNVcmwiOiJodHRwOi8vdHUuaG5tai52aXAvdHUvdXBsb2FkL3ZvZC8yMDIxMTIxMi0xLzJkYTRkNDc4ZTk0M2Q0Njg4ZGNiNzBhNjg3ZDM5ZTI5LmpwZ0BSZWZlcmVyPSIsInRpdGxlIjoi5oS/5LiO5L2g5LiN6LSf5YWJ5bm0In0=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement