"use client";
const e = {}, f = {};
function u(t, c) {
  try {
    const n = (e[t] ||= new Intl.DateTimeFormat("en-US", {
      timeZone: t,
      timeZoneName: "longOffset"
    }).format)(c).split("GMT")[1];
    return n in f ? f[n] : o(n, n.split(":"));
  } catch {
    if (t in f) return f[t];
    const s = t?.match(a);
    return s ? o(t, s.slice(1)) : NaN;
  }
}
const a = /([+-]\d\d):?(\d\d)?/;
function o(t, c) {
  const s = +(c[0] || 0), n = +(c[1] || 0), r = +(c[2] || 0) / 60;
  return f[t] = s * 60 + n > 0 ? s * 60 + n + r : s * 60 - n - r;
}
export {
  u as tzOffset
};
