function m(o, a) {
  const n = new Error().stack?.split(`
`);
  if (!n)
    return;
  const s = n.reduceRight((t, l, g, d) => t !== -1 ? t : l.includes("assets.oneweb.mercedes-benz.com/plugin") ? g : -1, -1);
  if (s < 0)
    return;
  const i = n[s]?.match(/https?:\/\/[^\s)]+/);
  if (!i)
    return;
  const e = i[0];
  if (!e || e.includes("localhost"))
    return;
  const r = new URL(e).pathname.split("/").filter(Boolean), c = r.at(1), u = r.at(2);
  if (c) {
    const t = new CustomEvent("api-tracking", {
      detail: {
        owner: o,
        tenant: c,
        version: u,
        method: a
      }
    });
    document.dispatchEvent(t);
  }
}
export {
  m as identifyTenant
};
//# sourceMappingURL=identify-tenant.mjs.map
