Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 海阔视界规则分享,当前分享的是:小程序¥home_rule_v2¥base64://@用心直播@eyJsYXN0X2NoYXB0ZXJfcnVsZSI6IiIsInRpdGxlIjoi55So5b+D55u05pKtIiwiYXV0aG9yIjoi5bCP5qOJ6KKE8J+MniZKb2tlcibniLHmmK/nlKjlv4MiLCJ1cmwiOiJoaWtlcjovL2VtcHR5I2Z5QWxsIiwidmVyc2lvbiI6MCwiY29sX3R5cGUiOiJ0ZXh0XzMiLCJjbGFzc19uYW1lIjoiIiwidHlwZSI6ImxpdmUiLCJjbGFzc191cmwiOiIiLCJhcmVhX25hbWUiOiIiLCJhcmVhX3VybCI6IiIsInNvcnRfbmFtZSI6IiIsInllYXJfbmFtZSI6IiIsInNvcnRfdXJsIjoiIiwieWVhcl91cmwiOiIiLCJmaW5kX3J1bGUiOiJqczpcbmxldCBkYXRhID0gW10sXG4gICAgY29uZmlnUGF0aCA9IFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXCI7XG5pZiAoIWZpbGVFeGlzdChjb25maWdQYXRoKSkge1xuICAgIHdyaXRlRmlsZShjb25maWdQYXRoLCBcIlwiKTtcbn1cbmxldCBjb25maWcgPSBmZXRjaChjb25maWdQYXRoKSxcbiAgICByZW5kZXJTZXR0aW5nID0gJC5yZXF1aXJlKCdoaWtlcjovL3BhZ2UvcmVuZGVyU2V0dGluZycpLnJlbmRlclNldHRpbmc7XG5cbmV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFwiaGlrZXI6Ly9wYWdlL2NvbmZpZ1wiKSkucnVsZSk7XG5VUkwgPSBcImhpa2VyOi8vZW1wdHlcIiArIGdldFZhcignc2V0Jyk7XG5pZiAoY29uZmlnID09IFwiXCIgfHwgVVJMLmluZGV4T2YoJ3NldHRpbmcnKSA+IDApIHtcbiAgICBkYXRhID0gcmVuZGVyU2V0dGluZygpO1xufSBlbHNlIHtcbiAgICBjb25maWcg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l0bGU6IHNvdXJjZS5uYW1lID09IHNlbGVjdCA/IFwi4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9J2NvbG9yOiAjMTlCODlEJz5cIiArIHNlbGVjdCArIFwiPC9zcGFuPlwiIDogc291cmNlLm5hbWUsXG4gICAgICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICAgICAgICAgIHVybDogJCgnI25vTG9hZGluZyMnKS5sYXp5UnVsZSgoYSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBwdXRWYXIoXCJsaXZlLXNlbGVjdFwiLCBhKTtcbiAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlbGVjdEdyb3VwJywgJycpO1xuICAgICAgICAgICAgICAgICAgICByZWZyZXNoUGFnZSgpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gXCJoaWtlcjovL2VtcHR5XCJcbiAgICAgICAgICAgICAgICB9LCBzb3VyY2UubmFtZSlcbiAgICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIHRpdGxlOiBcIuiuvue9rlwiLFxuICAgICAgICAgICAgY29sX3R5cGU6IFwic2Nyb2xsX2J1dHRvblwiLFxuICAgICAgICAgICAgdXJsOiAkKFwiXCIpLmxhenlSdWxlKCgpID0+IHtcbiAgICAgICAgICAgICAgICBwdXRWYXIoXCJzZXRcIiwgJyNzZXR0aW5nJyk7XG4gICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoZmFsc2UpO1xuICAgICAgICAgICAgICAgIHJldHVybiBcImhpa2VyOi8vZW1wdHlcIlxuICAgICAgICAgICAgfSlcbiAgICAgICAgfSlcbiAgICAgICAgZGF0YS5wdXNoKHtcbiAgICAgICAgICAgIGNvbF90eXBlOiAnbGluZSdcbiAgICAgICAgfSlcbiAgICAgICAgZm9yIChzb3VyY2Ugb2YgY29uZmlnLmRhdGEpIHtcbiAgICAgICAgICAgIGlmIChzb3VyY2UubmFtZSA9PSBzZWxlY3QpIHtcbiAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgaXRlbXMgPSAkLnJlcXVpcmUoJ2hpa2VyOi8vcGFnZS9yZW5kZXJEYXRhJykucmVuZGVyTGl2ZURhdGEoc291cmNlLnVybCk7XG4gICAgICAgICAgICAgICAgICAgIGxldCBncm91cHMgPSBPYmplY3Qua2V5cyhpdGVtcyk7XG4gICAgICAgICAgICAgICAgICAgIGdyb3Vwcy5wdXNoKGdyb3Vwcy5zcGxpY2UoZ3JvdXBzLmluZGV4T2YoMCksIDEpWzBdKTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHNlbGVjdEdyb3VwID0gZ2V0TXlWYXIoJ3NlbGVjdEdyb3VwJywgZ3JvdXBzWzBdKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHNlbGVjdEdyb3VwID09IFwiXCIpIHNlbGVjdEdyb3VwID0gZ3JvdXBzWzBdO1xuICAgICAgICAgICAgICAgICAgICBncm91cHMuZm9yRWFjaCgoZ3JvdXApID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChncm91cCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiBncm91cCA9PSBzZWxlY3RHcm91cCA/IFwi4oCc4oCc4oCd4oCdPHNwYW4gc3R5bGU9J2NvbG9yOiAjMTlCODlEJz5cIiArIGdyb3VwICsgXCI8L3NwYW4+XCIgOiBncm91cCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsOiAkKCcjbm9Mb2FkaW5nIycpLmxhenlSdWxlKChncm91cCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHV0TXlWYXIoJ3NlbGVjdEdyb3VwJywgZ3JvdXApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmcmVzaFBhZ2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAnaGlrZXI6Ly9lbXB0eSdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSwgZ3JvdXApLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xfdHlwZTogJ2ZsZXhfYnV0dG9uJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmE6IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVWaXNpYmxlOiBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgdGl0bGUgaW4gaXRlbXNbc2VsZWN0R3JvdXBdKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLnB1c2goe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpdGxlOiB0aXRsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmw6IEpTT04uc3RyaW5naWZ5KHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXJsczogaXRlbXNbc2VsZWN0R3JvdXBdW3RpdGxlXVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuY29sX3R5cGU6ICdpY29uXzJfcm91bmQnLFxuICAgICAgICAgICAgICAgICAgICBpbWc6IFwiaHR0cHM6Ly9sYW5tZWlndW9qaWFuZy5jb20vdHViaWFvL21vcmUvMjI4LnBuZ1wiXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgICAgICAgICBkYXR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AgICAgICAgICAgICAgICBmb3IgKGxldCB0aXRsZSBpbiBpdGVtc1tncm91cF0pIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRpdGxlLmluZGV4T2Yoa2V5KSA+PSAwIHx8IHRpdGxlLnRvTG93ZXJDYXNlKCkuaW5kZXhPZihrZXkpID49IDApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGQucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGl0bGU6IHRpdGxlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVybDogSlNPTi5zdHJpbmdpZnkoe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cmxzOiBpdGVtc1tncm91cF1bdGl0bGVdXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBzZXRSZXN1bHQoZCk7XG4gICAgICAgIH0sIHNvdXJjZS51cmwsIGdldE15VmFyKCd0aXRsZScpKVxuICAgIH07XG59KVxuc2V0UmVzdWx0KFt7XG4gICAgdGl0bGU6IFwi54K55oiR5byA5aeL6IGa5pCcXCIsXG4gICAgdXJsOiBcImhpa2VyOi8vc2VhcmNoP3M9XCIgKyBnZXRQYXJhbShcImtleVwiKSxcbiAgICBleHRyYToge1xuICAgICAgICBydWxlczogJC50b1N0cmluZygocnVsZXMpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBKU09OLnN0cmluZ2lmeShydWxlcylcbiAgICAgICAgfSwgcnVsZXMpXG4gICAgfVxufV0pIiwiZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsImRldGFpbF9maW5kX3J1bGUiOiIiLCJzZGV0YWlsX2NvbF90eXBlIjoibW92aWVfMSIsInNkZXRhaWxfZmluZF9ydWxlIjoiIiwidWEiOiJtb2JpbGUiLCJwcmVSdW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ArIHVybC5zcGxpdChcXFwiOi8vXFxcIilbMV0uc3BsaXQoXFxcIi9cXFwiKVswXTtcXG4gICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgcmV0dXJuIG51bGxcXG4gICAgICAgIH1cXG4gICAgfVxcbiAgICB2YXIgdHh0cyA9IGZldGNoQ2FjaGUodXJsLDI0LCB7XFxuICAgICAgICAgICAgaGVhZGVyczoge1xcbiAgICAgICAgICAgICAgICBSZWZlcmVyOiBnZXRSZWZlcmVyKHVybClcXG4gICAgICAgICAgICB9XFxuICAgICAgICB9KS5yZXBsYWNlKC8jRVhUSU5GOi0xICwvZywgJycpXFxuICAgICAgICAucmVwbGFjZSgvI0VYVElORjotMSwvZywgJycpXFxuICAgICAgICAucmVwbGFjZSgvXFxcXG4jZ2VucmUjL2csICcsI2dlbnJlIycpXFxuICAgICAgICAucmVwbGFjZSgvI0VYVElORjotMS9nLCAnJylcXG4gICAgICAgIC5yZXBsYWNlKC9ncm91cC10aXRsZT1cXFwiL2csICcnKVxcbiAgICAgICAgLnJlcGxhY2UoL1xcXFxuaHR0cC9nLCAnLGh0dHAnKVxcbiAgICAgICAgLnJlcGxhY2UoLz0vZywgJycpXFxuICAgICAgICAucmVwbGFjZSgv77yMIy9nLCAnLCMnKVxcbiAgICAgICAgLnJlcGxhY2UoL1xcXCIsL2csICcvJylcXG4gICAgICAgIC5yZXBsYWNlKC8gL2csICcnKVxcbiAgICAgICAgLnNwbGl0KCdcXFxcbicpO1xcbiAgICBjb25zdCBkMSA9IFtdXFxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgdHh0cy5sZW5ndGg7IGkrKykge1xcbiAgICAgICAgdmFyIHIgPSB7fTtcXG4gICAgICAgIHZhciBqID0gdHh0c1tpXS5zcGxpdCgnLCcpO1xcbiAgICAgICAgaWYgKHR4dHNbaV0uaW5kZXhPZihcXFwiI0VYVElORlxcXCIpID09IDAgJiZcXG4gICAgICAgICAgICBqLmxlbmd0aCA9PSAzICYmIGpbMl0uaW5kZXhPZihcXFwiaHR0cFxcXCIpID09IDApIHtcXG4gICAgICAgICAgICByLnRpdGxlID0galsxXS5zcGxpdCgnLycpW2pbMF0uc3BsaXQoJy8nKS5sZW5ndGggLSAxXTtcXG4gICAgICAgICAgICByLnVybCA9IGpbMl0ucmVwbGFjZShgXFxcXG5gLCAnJykucmVwbGFjZSgnXFxcXHInLCAnJyk7XFxuICAgICAgICAgICAgaWYgKHIudXJsLmluZGV4T2YoXFxcImh0dHBcXFwiKSA9PSAwKSB7XFxuICAgICAgICAgICAgICAgIHIudXJsID0gci51cmwgKyBcXFwiI2lzVmlkZW89dHJ1ZSNcXFwiO1xcbiAgICAgICAgICAgIH1cXG4gICAgICAgICAgICBkMS5wdXNoKHIpO1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcblxcbiAgICAgICAgaWYgKGoubGVuZ3RoIDwgMikge1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcbiAgICAgICAgci50aXRsZSA9IGpbMF0uc3BsaXQoJy8nKVtqWzBdLnNwbGl0KCcvJykubGVuZ3RoIC0gMV07XFxuICAgICAgICByLnVybCA9IGpbMV0ucmVwbGFjZShgXFxcXG5gLCAnJykucmVwbGFjZSgnXFxcXHInLCAnJyk7XFxuICAgICAgICBpZiAoci51cmwuaW5kZXhPZihcXFwiaHR0cFxcXCIpID09IDApIHtcXG4gICAgICAgICAgICByLnVybCA9IHIudXJsICsgXFxcIiNpc1ZpZGVvPXRydWUjXFxcIjtcXG4gICAgICAgIH1cXG4gICAgICAgIGQxLnB1c2gocik7XFxuICAgIH1cXG4gICAgLy/lpJrnur/ot69cXG4gICAgY29uc3QgZDIgPSB7fVxcbiAgICBmb3IgKGxldCBpdCBvZiBkMSkge1xcbiAgICAgICAgaWYgKGQyW2l0LnRpdGxlXSA9PSBudWxsKSB7XFxuICAgICAgICAgICAgZDJbaXQudGl0bGVdID0gW11cXG4gICAgICAgIH1cXG4g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nXSlbMV07XFxuICAgICAgICB9IGVsc2UgaWYgKGlbM10gPT0gJyNnZW5yZSMnKSB7XFxuICAgICAgICAgICAgZ3JvdXAgPSBpWzJdO1xcbiAgICAgICAgICAgIGNvbnRpbnVlO1xcbiAgICAgICAgfVxcbiAgICAgICAgbGV0IHRpdGxlID0gaVsyXSxcXG4gICAgICAgICAgICB1cmwgPSBpWzNdLnRyaW0oKSArICcjaXNWaWRlbz10cnVlIyc7XFxuICAgICAgICBpZiAoaXRlbXNbZ3JvdXBdKSB7XFxuICAgICAgICAgICAgaWYgKGl0ZW1zW2dyb3VwXVt0aXRsZV0pIHtcXG4gICAgICAgICAgICAgICAgaXRlbXNbZ3JvdXBdW3RpdGxlXSA9IGl0ZW1zW2dyb3VwXVt0aXRsZV0uY29uY2F0KFt1cmxdKTtcXG4gICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICBpdGVtc1tncm91cF1bdGl0bGVdID0gW3VybF07XFxuICAgICAgICAgICAgfVxcbiAgICAgICAgfSBlbHNlIHtcXG4gICAgICAgICAgICBpdGVtc1tncm91cF0gPSB7fTtcXG4gICAgICAgICAgICBpdGVtc1tncm91cF1bdGl0bGVdID0gW3VybF07XFxuICAgICAgICB9O1xcbiAgICB9XFxuICAgIHJldHVybiBpdGVtcztcXG59XFxuXFxuJC5leHBvcnRzID0ge1xcbiAgICByZW5kZXJMaXZlRGF0YTogcmVuZGVyTGl2ZURhdGEyXFxufVwifSx7XCJjb2xfdHlwZVwiOlwibW92aWVfM1wiLFwibmFtZVwiOlwi6K6+572u6aG1XCIsXCJwYXRoXCI6XCJyZW5kZXJTZXR0aW5nXCIsXCJydWxlXCI6XCJmdW5jdGlvbiByZW5kZXJTZXR0aW5nKCkge1xcbiAgICBjb25zdCBkID0gW3tcXG4gICAgICAgIHRpdGxlOiBcXFwi5a+85YWlXFxcIixcXG4gICAgICAgIGNvbF90eXBlOiBcXFwiaW5wdXRcXFwiLFxcbiAgICAgICAgZGVzYzogXFxcIuivt+i+k+WFpeebtOaSrea6kOiuoumYheWcsOWdgFxcXCIsXFxuICAgICAgICB1cmw6ICQudG9TdHJpbmcoKHJ1bGUpID0+IHtcXG4gICAgICAgICAgICBpZiAoaW5wdXQgPT0gXFxcIlxcXCIpIHtcXG4gICAgICAgICAgICAgICAgcmV0dXJuIFxcXCJ0b2FzdDovL+S4jeiDveS4uuepulxcXCJcXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlucHV0LmluZGV4T2YoXFxcImh0dHBcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImZpbGVcXFwiKSAhPSAwICYmIGlucHV0LmluZGV4T2YoXFxcImhpa2VyXFxcIikgIT0gMCkge1xcbiAgICAgICAgICAgICAgICByZXR1cm4gXFxcInRvYXN0Oi8v6ZO+5o6l5qC85byP5pyJ6K+vXFxcIlxcbiAgICAgICAgICAgIH0gZWxzZSB7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwiaW5wdXQ6Ly8vLy8v6K+36L6T5YWl6K6i6ZiF5qCH6aKYLmpzOlxcXCIgKyAkLnRvU3RyaW5nKCh1cmwsIHJ1bGUpID0+IHtcXG4gICAgICAgICAgICAgICAgICAgIGV2YWwoSlNPTi5wYXJzZShyZXF1ZXN0KFxcXCJoaWtlcjovL3BhZ2UvY29uZmlnP3J1bGU9XFxcIiArIHJ1bGUpKS5ydWxlKTtcXG4gICAgICAgICAgICAgICAgICAgIGxldCBjb25maWcgPSBnZXRDb25maWcoKTtcXG4gICAgICAgICAgICAgICAgICAgIGNvbmZpZy5kYXRhLnB1c2goe1xcbiAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGlucHV0LFxcbiAgICAgICAgICAgICAgICAgICAgICAgIHVybDogdXJsXFxuICAgICAgICAgICAgICAgICAgICB9KTtcXG4gICAgICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcI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+ehruiupOWIoOmZpOatpOiuoumYhe+8ny5qczpcXFwiICsgJC50b1N0cmluZygobmFtZSkgPT4ge1xcbiAgICAgICAgICAgICAgICBsZXQgY29uZmlnID0gZmV0Y2goXFxcImhpa2VyOi8vZmlsZXMvcnVsZXMvbGl2ZS9jb25maWcuanNvblxcXCIpO1xcbiAgICAgICAgICAgICAgICBpZiAoY29uZmlnID09IFxcXCJcXFwiKSB7XFxuICAgICAgICAgICAgICAgICAgICBjb25maWcgPSB7XFxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTogW10sXFxuICAgICAgICAgICAgICAgICAgICAgICAgdmVyc2lvbjogMFxcbiAgICAgICAgICAgICAgICAgICAgfVxcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xcbiAgICAgICAgICAgICAgICAgICAgY29uZmlnID0gSlNPTi5wYXJzZShjb25maWcpXFxuICAgICAgICAgICAgICAgIH1cXG4gICAgICAgICAgICAgICAgY29uZmlnLmRhdGEgPSBjb25maWcuZGF0YS5maWx0ZXIoaSA9PiBpLm5hbWUgIT0gbmFtZSk7XFxuXFxuICAgICAgICAgICAgICAgIHdyaXRlRmlsZShcXFwiaGlrZXI6Ly9maWxlcy9ydWxlcy9saXZlL2NvbmZpZy5qc29uXFxcIiwgSlNPTi5zdHJpbmdpZnkoY29uZmlnKSk7XFxuICAgICAgICAgICAgICAgIHJlZnJlc2hQYWdlKCk7XFxuICAgICAgICAgICAgICAgIHJldHVybiBcXFwidG9hc3Q65bey5Yig6ZmkXFxcIjtcXG4gICAgICAgICAgICB9LCBzb3VyY2UubmFtZSlcXG4gICAgICAgIH0pXFxuICAgIH1cXG4gICAgcmV0dXJuIGRcXG59XFxuXFxuJC5leHBvcnRzID0ge1xcbiAgICByZW5kZXJTZXR0aW5nOiByZW5kZXJTZXR0aW5nXFxufVwifV0iLCJpY29uIjoiaHR0cDovL3ExLnFsb2dvLmNuL2c/Yj1xcSZuaz0xMzAyNDA3MjE2JnM9NjQwIiwicHJveHkiOiIifQ==
Add Comment
Please, Sign In to add comment