
        return localStorage.getItem(name)
      }

      function validateRegion (regionId, regionDomain) {
        if (!regionId || !regionDomain) return false
        return REGION_MAP[regionId] === regionDomain
      }

      function buildTargetUrl (targetRegion, pathname, url) {
        let targetUrl = `https://${targetRegion}${pathname}`

        const params = url.search
        if (params) {
          targetUrl += params
        }

        return targetUrl
      }

      function redirect () {
    