xiaomianao666

小程序:Quark.简

Nov 5th, 2024
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@Quark.简@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoiUXVhcmsu566AIiwiYXV0aG9yIjoiQExveURnSWsiLCJ1cmwiOiJoaWtlcjovL2VtcHR5IyMiLCJ2ZXJzaW9uIjoyMSwiY29sX3R5cGUiOiJtb3ZpZV8zIiwiY2xhc3NfbmFtZSI6IiIsInR5cGUiOiJ2aWRlbyIsImNsYXNzX3VybCI6IiIsImFyZWFfbmFtZSI6IiIsImFyZWFfdXJsIjoiIiwic29ydF9uYW1lIjoiIiwieWVhcl9uYW1lIjoiIiwic29ydF91cmwiOiIiLCJ5ZWFyX3VybCI6IiIsImZpbmRfcnVsZSI6ImpzOlxubGV0IGQgPSBbXTtcblxubGV0IGNvb2tpZSA9IGdldEl0ZW0oXCJxdWFya0Nvb2tpZVwiLCBcIlwiKTtcblxuaWYgKCEkLnJlcXVpcmUoXCJ0b29sXCIpLmlzTG9naW5Db29raWUoY29va2llKSkge1xuICAgIGNsZWFySXRlbShcInF1YXJrQ29va2llXCIpO1xuICAgIGQucHVzaCh7XG4gICAgICAgIHRpdGxlOiAnPGZvbnQgY29sb3I9XCIjMTNCNjFCXCI+4paQIDwvZm9udD48Yj7muKnppqjmj5DnpLo8Yj4nLFxuICAgICAgICBjb2xfdHlwZTogXCJyaWNoX3RleHRcIixcbiAgICB9KTtcbiAgICBkLnB1c2goe1xuICAgICAgICB1cmw6ICQucmVxdWlyZShcImFjY291bnRcIiwgdHJ1ZSksXG4gICAgICAgIGNvbF90eXBlOiBcInRleHRfMVwiLFxuICAgICAgICB0aXRsZTogXCLmnKrmo4DmtYvliLDnmbvlvZXkv6Hmga/vvIzngrnmiJHot7PovaznmbvlvZXotKblj7fpobXpnaLvvIzojrflj5ZRdWFyayBDb29raWXlkI7mlrnl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9wdGlvbnMpO1xcbiAgICAgICAgaWYgKHR5cGVvZiBvcHRpb25zLmJvZHkgPT09IFxcXCJvYmplY3RcXFwiICYmIHRoaXMuX2JvZHlUb1N0cmluZykge1xcbiAgICAgICAgICAgIG9wdGlvbnMuYm9keSA9IEpTT04uc3RyaW5naWZ5KG9wdGlvbnMuYm9keSk7XFxuICAgICAgICB9XFxuICAgICAgICB2YXIgcmVzID0gSlNPTi5wYXJzZSh0aGlzLnN0YXJ0UmVxdWVzdCh0aGlzLmJ1aWxkUGFyYW0/YnVpbGRVcmwodGhpcy51cmwsIHRoaXMuYnVpbGRQYXJhbSk6dGhpcy51cmwsIG9wdGlvbnMpKTtcXG4gICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgaWYgKHJlcy5zdGF0dXNDb2RlID49IDIwMCAmJiByZXMuc3RhdHVzQ29kZSA8PSAzMDApIHtcXG4gICAgICAgICAgICAgICAgbGV0IGJvZHkgPSByZXMuYm9keTtcXG4gICAgICAgICAgICAgICAgaWYgKHRvSnNvbikge1xcbiAgICAgICAgICAgICAgICAgICAgYm9keSA9IEpTT04ucGFyc2UoYm9keSk7XFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuc3VjY2Vzc0NhbGxiYWNrKGJvZHksIHJlcyk7XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFN0cmluZyhyZXMuc3RhdHVzQ29kZSkpO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgIH0gY2F0Y2ggKGVycikge1xcbiAgICAgICAgICAgIHRyeSB7XFxuICAgICAgICAgICAgICAgIGVyciA9IHRoaXMuZXJyb3JUeXBlQ2FsbGJhY2soZXJyLCByZXMpO1xcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG5cXG4gICAgICAgICAgICB9XFxuICAgICAgICAgICAgaWYgKHRoaXMucmV0cnlDb3VudCkge1xcbiAgICAgICAgICAgICAgICBsZXQgdHJ5UmVzdWx0ID0gdGhpcy5lcnJvckNhbGxiYWNrV2l0aFJldHJ5KGVyciwgcmVzLCB0aGlzKTtcXG4gICAgICAgICAgICAgICAgaWYgKHRyeVJlc3VsdCkge1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXRyeUNvdW50LS07XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5zdGFydCh0b0pzb24pO1xcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZXRyeUNvdW50ID0gMDtcXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmVycm9yQ2FsbGJhY2soZXJyLCByZXMpO1xcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRoaXMuZXJyb3JDYWxsYmFjayhlcnIsIHJlcyk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfVxcbiAgICB9LFxcbiAgICBzZXRPcHRpb25zKG9wdGlvbnMpIHtcXG4gICAgICAgIHRoaXMub3B0aW9ucyA9IE9iamVjdC5hc3NpZ24oe30sIG9wdGlvbnMsIHtcXG4gICAgICAgICAgICB3aXRoSGVhZGVyczogdHJ1ZVxcbiAgICAgICAgfSk7XFxuICAgICAgICByZXR1cm4gdGhpcztcXG4gICAgfSxcXG4gICAgbWVyZ2VIZWFkQW5kQm9keShvcHRpb25zKSB7XFxuICAgICAgICBvcHRpb25zID0gb3B0aW9ucyB8fCB7fTtcXG4gICAgICAgIE9iamVjdC5hc3NpZ24odGhpcy5vcHRpb25zLmhlYWRlcnN8fHt9LCBvcHRpb25zLmhlYWRlcnMpO1xcbiAgICAgICAgaWYgKHR5cGVvZiB0aGlzLm9wdGlvbnMuYm9keSA9PT0gXFxcIm9iamVjdFxcXCIgJiYgdHlwZW9mIG9wdGlvbnMuYm9keSA9PT0gXFxcI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ljb25fa3Vha2VcXFwiLFxcbiAgICAgICAgdXJsOiAkKFxcXCLngrnlh7vlip/og73mjInpkq49PuS4quS6uui0puWPt+euoeeQhuWNs+WPr+eZu+W9lei0puWPt1xcXCIpLmNvbmZpcm0oKCkgPT4ge30pLFxcbiAgICB9KTtcXG4gICAgZC5wdXNoKHtcXG4gICAgICAgIHRpdGxlOiBzdHlsZSxcXG4gICAgICAgIHVybDogJChzdHlsZXMsIDEsICfor7fpgInmi6knKS5zZWxlY3QoKCkgPT4ge1xcbiAgICAgICAgICAgIHNldEl0ZW0oJ3N0eWxlJywgaW5wdXQpO1xcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIHBpY191cmw6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vaW1nL2FsaV9pY29uLnN2Z1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fNVxcXCJcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0SXRlbShcXFwic29ydEtleVxcXCIsIFxcXCLlkI3np7DmraPluo9cXFwiKSxcXG4gICAgICAgIHVybDogJChPYmplY3Qua2V5cyhzb3J0KSwgMSwgJ+ivt+mAieaLqScpLnNlbGVjdCgoKSA9PiB7XFxuICAgICAgICAgICAgc2V0SXRlbShcXFwic29ydEtleVxcXCIsIGlucHV0KVxcbiAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICB9KSxcXG4gICAgICAgIHBpY191cmw6IFxcXCJodHRwczovL2hpa2VyZmFucy5jb20vaW1nL2FsaV9zb3J0LnN2Z1xcXCIsXFxuICAgICAgICBjb2xfdHlwZTogXFxcImljb25fNVxcXCJcXG4gICAgfSk7XFxuICAgIGQucHVzaCh7XFxuICAgICAgICB0aXRsZTogZ2V0SXRlbShcXFwicXVhcmtfcGxheU1vZGVcXFwiLCBcXFwi6L2s56CBXFxcIiksXFxuICAgICAgICB1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m5Y+3566h55CGXFxcIikge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gJC5yZXF1aXJlKFxcXCJhY2NvdW50XFxcIik7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gXFxcIuWOn+eUu+S4i+i9vee6v+eoi1xcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQoZ2V0SXRlbShcXFwic3BlZWRUaHJlYWRcXFwiLCBcXFwiMTBcXFwiKSwgXFxcIuivt+i+k+WFpTMtMzLkuYvpl7TnmoTmlbTmlbBcXFwiKS5pbnB1dCgoKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgc3BlZWRUaHJlYWQgPSBwYXJzZUludChpbnB1dCk7XFxuICAgICAgICAgICAgICAgICAgICBpZiAoc3BlZWRUaHJlYWQgPCAzIHx8IHNwZWVkVGhyZWFkID4gMzIpIHtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5LiN5ZCI5rOVXFxcIjtcXG4gICAgICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgU3RyaW5nKHNwZWVkVGhyZWFkKSk7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICAgICAgfSk7XFxuICAgICAgICAgICAgfSBlbHNlIGlmIChpbnB1dCA9PT0gXFxcIuWkjeWItuWIhuS6q+mTvuaOpVxcXCIpIHtcXG4gICAgICAgICAgICAgICAgaWYgKGZyb21Ecml2ZSA9PT0gXFxcInVjXFxcIikge1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIGJ1aWxkVXJsKFxcXCJodHRwczovL2RyaXZlLnVjLmNuL3MvXFxcIiArIHNoYXJlSWQgKyBcXFwiP3B1Ymx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YToge1xcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVJZCxcXG4gICAgICAgICAgICAgICAgICAgIHNoYXJlUHdkLFxcbiAgICAgICAgICAgICAgICAgICAgc2hhcmVUb2tlbjogcXVhcmtTaGFyZUFwaS5nZXRUb2tlbigpLFxcbiAgICAgICAgICAgICAgICAgICAgZmlsZUlkOiBpdGVtLmZpZCxcXG4gICAgICAgICAgICAgICAgICAgIGluaGVyaXRUaXRsZTogZmFsc2UsXFxuICAgICAgICAgICAgICAgICAgICBmcm9tRHJpdmVcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0pO1xcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBkLnB1c2goe1xcbiAgICAgICAgICAgICAgICB0aXRsZTogZ2V0SGVhZChpdGVtLm9ial9jYXRlZ29yeSkgKyBpdGVtLmZpbGVfbmFtZSxcXG4gICAgICAgICAgICAgICAgZGVzYzogJC5kYXRlRm9ybWF0KGl0ZW0udXBkYXRlZF9hdCwgJ3l5eXktTU0tZGQnKSArICcgICcgKyBmb3JtYXRTaXplKGl0ZW0uc2l6ZSksXFxuICAgICAgICAgICAgICAgIHBpY191cmw6IGl0ZW0udGh1bWJuYWlsLFxcbiAgICAgICAgICAgICAgICB1cmw6ICQoKS5sYXp5UnVsZSgoZmlkLCBmaWRfdG9rZW4sIHB3ZF9pZCwgc3Rva2VuLCBjYXRlZ29yeSwgZnJvbURyaXZlKSA9PiB7XFxuICAgICAgICAgICAgICAgICAgICBsZXQgcGxheVVybENhY2hlID0gc3RvcmFnZTAuZ2V0TXlWYXIoXFxcInBsYXlVcmxDYWNoZVxcXCIsIHt9KTtcXG4gICAgICAgICAgICAgICAgICAgIGlmIChwbGF5VXJsQ2FjaGVbZmlkXSkge1xcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwbGF5VXJsQ2FjaGVbZmlkXTtcXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHVybCA9ICQucmVxdWlyZShcXFwicGxheVxcXCIsIGZyb21Ecml2ZSkuZ2V0UGxheVVybChmaWQsIGZpZF90b2tlbiwgcHdkX2lkLCBzdG9rZW4sIGNhdGVnb3J5KTtcXG4gICAgICAgICAgICAgICAgICAgICAgICBwbGF5VXJsQ2FjaGVbZmlkXSA9IHVybDtcXG4gICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlMC5wdXRNeVZhcihcXFwicGxheVVybENhY2hlXFxcIiwgcGxheVVybENhY2hlKTtcXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXJsO1xcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9LCBpdGVtLmZpZCwgaXRlbS5zaGFyZV9maWRfdG9rZW4sIHNoYXJlSWQsIHF1YXJrU2hhcmVBcGkuZ2V0VG9rZW4oKSwgaXRlbS5vYmpfY2F0ZWdvcnksIGZyb21Ecml2ZSksXFxuICAgICAgICAgICAgICAgIGNvbF90eXBlOiBzdHlsZSxcXG4gICAgICAgICAgICAgICAgZXh0cmE6IHtcXG4gICAgICAgICAgICAgICAgICAgIGlkOiBpdGVtLmZpZCxcXG4gICAgICAgICAgICAgICAgICAgIC8vaW5oZXJpdFRpdGxlOiBmYWxzZSxcXG4gICAgICAgICAgICAgICAgICAgIGNsczogJ3BsYXlsaXN0ICcgKyBpdGVtLm9ial9jYXRlZ29yeVxcbiAgICAgICAgICAgICAgICB9XFxuICAgICAgICAgICAgfSlcXG4gICAgICAgIH1cXG5cXG4gICAgfSk7XFxufSBjYXRjaCAoZSkge1xcbiAgICBkLnB1c2goe1xcbiAgICAgICAgdGl0bGU6IGUubWVzc2FnZSxcXG4gICAgICAgIHVybDogJ2hpa2VyOi8vZW1wdHknLFxcbiAgICAgICAgY29sX3R5cGU6ICd0ZXh0X2NlbnRlcl8xJyxcXG4gICAgICAgIGV4dHJhOiB7XFxuICAgICAgICAgICAgbGluZVZpc2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2Uge1xcbiAgICBob21lVXJsID0gXFxcImh0dHBzOi8vZHJpdmUucXVhcmsuY24vXFxcIjtcXG4gICAgcHIgPSBcXFwidWNwcm9cXFwiO1xcbiAgICBhcGkgPSBcXFwiaHR0cHM6Ly9kcml2ZS5xdWFyay5jblxcXCI7XFxuICAgIGNvb2tpZSA9IGdldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgXFxcIlxcXCIpO1xcbn1cXG5cXG5mdW5jdGlvbiBDb29raWVNYW5hZ2UoY29va2llKSB7XFxuICAgIHRoaXMuY29va2llID0ge307XFxuICAgIHRoaXMuYWRkKGNvb2tpZSk7XFxufVxcbk9iamVjdC5hc3NpZ24oQ29va2llTWFuYWdlLnByb3RvdHlwZSwge1xcbiAgICBhZGQoY29va2llKSB7XFxuICAgICAgICBsZXQgY29va2llcyA9IFtdO1xcbiAgICAgICAgaWYgKHR5cGVvZiBjb29raWUgPT09IFxcXCJzdHJpbmdcXFwiKSB7XFxuICAgICAgICAgICAgY29va2llcyA9IGNvb2tpZS5zcGxpdChcXFwiO1xcXCIpO1xcbiAgICAgICAgfSBlbHNlIGlmIChBcnJheS5pc0FycmF5KGNvb2tpZSkpIHtcXG4gICAgICAgICAgICBjb29raWVzID0gY29va2llO1xcbiAgICAgICAgfVxcbiAgICAgICAgY29va2llcy5mb3JFYWNoKHYgPT4ge1xcbiAgICAgICAgICAgIHYgPSB2LnNwbGl0KFxcXCI9XFxcIik7XFxuICAgICAgICAgICAgaWYgKHYubGVuZ3RoIDwgMikgcmV0dXJuO1xcbiAgICAgICAgICAgIGxldCBrZXkgPSB2LnNoaWZ0KCkudHJpbSgpO1xcbiAgICAgICAgICAgIHRoaXMuY29va2llW2tleV0gPSB2LmpvaW4oXFxcIj1cXFwiKS50cmltKCk7XFxuICAgICAgICB9KTtcXG4gICAgfSxcXG4gICAgZ2V0KCkge1xcbiAgICAgICAgcmV0dXJuIE9iamVjdC5lbnRyaWVzKHRoaXMuY29va2llKS5tYXAodiA9P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1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtdLFxcbiAgICAgICAgICAgICAgICAgICAgdXJsczogW10sXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBbXVxcbiAgICAgICAgICAgICAgICB9O1xcbiAgICAgICAgICAgICAgICB2aWRlb0xpc3QuZmlsdGVyKHYgPT4gdi5hY2Nlc3NhYmxlKS5mb3JFYWNoKHYgPT4ge1xcbiAgICAgICAgICAgICAgICAgICAgcGxheUxpc3QubmFtZXMucHVzaCh2LnJlc29sdXRpb24pO1xcbiAgICAgICAgICAgICAgICAgICAgcGxheUxpc3QudXJscy5wdXNoKHYudmlkZW9faW5mby51cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiKTtcXG4gICAgICAgICAgICAgICAgICAgIHBsYXlMaXN0LmhlYWRlcnMucHVzaChwbGF5SGVhZGVycyk7XFxuICAgICAgICAgICAgICAgIH0pO1xcbiAgICAgICAgICAgICAgICBjcmVhdGVEZWxldGVUYXNrKGFzZmlkKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHBsYXlMaXN0KTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcblxcbiAgICAgICAgICAgICAgICBsZXQgcGxheVVybCA9IGdldERvd25sb2FkVXJsKGFzZmlkKS5kYXRhWzBdLmRvd25sb2FkX3VybDtcXG4gICAgICAgICAgICAgICAgcGxheUhlYWRlcnMuY29va2llPWNvb2tpZU1hbmFnZS5nZXQoKTtcXG4gICAgICAgICAgICAgICAgbGV0IHBsYXlMaXN0ID0ge1xcbiAgICAgICAgICAgICAgICAgICAgbmFtZXM6IFtwbGF5TW9kZV0sXFxuICAgICAgICAgICAgICAgICAgICB1cmxzOiBbcGxheVVybCArIFxcXCIjaXNWaWRlbz10cnVlI1xcXCIrKHBsYXlNb2RlPT09XFxcIuWOn+eUu1xcXCI/XFxcIiNmYXN0UGxheU1vZGUjI3RocmVhZHM9XFxcIiArIGdldEl0ZW0oXFxcInNwZWVkVGhyZWFkXFxcIiwgXFxcIjEwXFxcIikgKyBcXFwiI1xcXCI6XFxcIlxcXCIpXSxcXG4gICAgICAgICAgICAgICAgICAgIGhlYWRlcnM6IFtwbGF5SGVhZGVyc11cXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICBjcmVhdGVEZWxldGVUYXNrKGFzZmlkKTtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIEpTT04uc3RyaW5naWZ5KHBsYXlMaXN0KTtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIGxldCBwbGF5VXJsID0gZ2V0RG93bmxvYWRVcmwoYXNmaWQpLmRhdGFbMF0uZG93bmxvYWRfdXJsO1xcblxcbiAgICAgICAgICAgIGNyZWF0ZURlbGV0ZVRhc2soYXNmaWQpO1xcbiAgICAgICAgICAgIGlmIChjYXRlZ29yeSA9PT0gJ2F1ZGlvJykge1xcbiAgICAgICAgICAgICAgICBsZXQgcGxheUxpc3QgPSB7XFxuICAgICAgICAgICAgICAgICAgICBuYW1lczogW1xcXCLpn7PpopFcXFwiXSxcXG4gICAgICAgICAgICAgICAgICAgIHVybHM6IFtwbGF5VXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIl0sXFxuICAgICAgICAgICAgICAgICAgICBoZWFkZXJzOiBbcGxheUhlYWRlcl0sXFxuICAgICAgICAgICAgICAgICAgICBseXJpYzogXFxcIlxcXCJcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICByZXR1cm4gSlNPTi5zdHJpbmdpZnkocGxheUxpc3QpO1xcbiAgICAgICAgICAgIH0gZWxzZSBpZiAoY2F0ZWdvcnkgPT09ICdpbWFnZScpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuICQocGxheVVybCwgcGxheUhlYWRlcikuaW1hZ2UoKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBwb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dldFBhcmFtKFxcXCJmcm9tXFxcIixcXFwiXFxcIik7XFxuXFxuZC5wdXNoKHtcXG4gICAgdGl0bGU6IFxcXCLigJzigJznoa7orqTnmbvlvZXigJ3igJ1cXFwiLFxcbiAgICB1cmw6ICQoXFxcIiNub0xvYWRpbmcjXFxcIikubGF6eVJ1bGUoKGZyb20pID0+IHtcXG4gICAgICAgIC8vbGV0IGNtID0gYW5kcm9pZC53ZWJraXQuQ29va2llTWFuYWdlci5nZXRJbnN0YW5jZSgpO1xcbiAgICAgICAgLy9sZXQgY20gPSBjb20udGVuY2VudC5zbXR0LnNkay5Db29raWVNYW5hZ2VyLmdldEluc3RhbmNlKCk7XFxuICAgICAgICAvL2xldCBjb29raWUgPSBTdHJpbmcoY20uZ2V0Q29va2llKFxcXCJodHRwczovL3Bhbi5xdWFyay5jblxcXCIpIHx8IFxcXCJcXFwiKTtcXG4gICAgICAgIGxldCBjb29raWUgPSBnZXRNeVZhcihcXFwiY29va2llXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgaWYgKCQucmVxdWlyZShcXFwidG9vbFxcXCIpLmlzTG9naW5Db29raWUoY29va2llKSkge1xcbiAgICAgICAgICAgIGlmKGZyb209PT1cXFwidWNcXFwiKXtcXG4gICAgICAgICAgICAgICAgc2V0SXRlbShcXFwidWNDb29raWVcXFwiLCBjb29raWUpO1xcbiAgICAgICAgICAgIH1lbHNle1xcbiAgICAgICAgICAgICAgICBzZXRJdGVtKFxcXCJxdWFya0Nvb2tpZVxcXCIsIGNvb2tpZSk7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIGJhY2soKTtcXG4gICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v55m75b2V5oiQ5YqfXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mnKrnmbvlvZVcXFwiO1xcbiAgICB9LCBmcm9tKSxcXG4gICAgZGVzYzogXFxcIuKAnOKAnOKAneKAnT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pO1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6K6+572u5oiQ5YqfXFxcIjtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9LCBpc3IpO1xcbiAgICB9IGVsc2UgaWYgKGlucHV0ID09PSBcXFwi5LuOVFZCT1jojrflj5ZDb29raWVcXFwiKSB7XFxuICAgICAgICBsZXQgcGF0aCA9IFxcXCIvc3RvcmFnZS9lbXVsYXRlZC8wL1RWLy5xdWFya191c2VyXFxcIjtcXG4gICAgICAgIGlmIChmaWxlRXhpc3QoXFxcImZpbGU6Ly9cXFwiICsgcGF0aCkpIHtcXG4gICAgICAgICAgICBpZiAoIW5ldyBqYXZhLmlvLkZpbGUocGF0aCkuY2FuUmVhZCgpKSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiAkKFxcXCLmsqHmnInmnYPpmZDor7vlj5ZDb29raWXmlofku7bvvIzor7fmiZPlvIDmiYDmnInmlofku7bmnYPpmZBcXFxcbua1t+mYlOiuvue9ri0+5pu05aSa5Yqf6IO9LT7lhoXpg6jmlofku7bnrqHnkIYtPuWPs+S4iuinklxcXCIpLmNvbmZpcm0oKCkgPT4ge30pO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICB0cnkge1xcbiAgICAgICAgICAgICAgICBsZXQganNvbiA9IEpTT04ucGFyc2UoZmV0Y2goXFxcImZpbGU6Ly9cXFwiICsgcGF0aCkpO1xcbiAgICAgICAgICAgICAgICBsZXQgY29va2llID0ganNvbi5jb29raWU7XFxuICAgICAgICAgICAgICAgIGlmICgkLnJlcXVpcmUoXFxcInRvb2xcXFwiKS5pc0xvZ2luQ29va2llKGNvb2tpZSkpIHtcXG4gICAgICAgICAgICAgICAgICAgIHNldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgY29va2llKTtcXG4gICAgICAgICAgICAgICAgICAgIGlzciAmJiByZWZyZXNoUGFnZSgpO1xcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iuvue9ruaIkOWKn1xcXCI7XFxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8vQ29va2ll5qC85byP6ZSZ6K+vXFxcIjtcXG4gICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+iOt+WPluWksei0peWFseS6q+aWh+S7tuaNn+Wdj1xcXCI7XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICByZXR1cm4gJChcXFwi5pyq5qOA5rWL5YiwVFZCT1jnmoRDb29raWXmlofku7ZcXFxcbuivt+S9v+eUqOi/h+WQjuWGjeWwneivlVxcXCIpLmNvbmZpcm0oKCkgPT4ge30pO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2UgaWYgKGlucHV0ID09PSBcXFwi5aSN5Yi2Q29va2llXFxcIikge1xcbiAgICAgICAgbGV0IGNvb2tpZSA9IGdldEl0ZW0oXFxcInF1YXJrQ29va2llXFxcIiwgXFxcIlxcXCIpO1xcbiAgICAgICAgaWYgKGNvb2tpZSkge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwiY29weTovL1xcXCIgKyBjb29raWU7XFxuICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q6Ly/mnKrnmbvlvZVcXFwiO1xcbiAgICAgICAgfVxcbiAgICB9IGVsc2UgaWYoaW5wdXQ9PT1cXFwi5riF6ZmkQ29va2llXFxcIil7XFxuICAgICAgICBjbGVhckl0ZW0oXFxcInF1YXJrQ29va2llXFxcIik7XFxuICAgICAgICBpc3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0dXJuIFxcXCJjb3B5Oi8vXFxcIiArIGNvb2tpZTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+acqueZu+W9lVxcXCI7XFxuICAgICAgICB9XFxuICAgIH0gZWxzZSBpZihpbnB1dD09PVxcXCLmuIXpmaRVQ0Nvb2tpZVxcXCIpe1xcbiAgICAgICAgY2xlYXJJdGVtKFxcXCJ1Y0Nvb2tpZVxcXCIpO1xcbiAgICAgICAgaXNyICYmIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6YCA5Ye655m75b2VXFxcIjtcXG4gICAgfVxcbn0sICQuaW1wb3J0UGFyYW0pO1wifV0iLCJpY29uIjoiaGlrZXI6Ly9pbWFnZXMvaWNvbl9rdWFrZSIsInByb3h5IjoiIn0=
Add Comment
Please, Sign In to add comment