import { getQueryParam as i } from "./index-url-params.js";
import { PublicWidgetData as o } from "./index-public-widgets-data.store.js";
const f = (e) => {
  e || (e = window.location.href.toString());
  let t = localStorage.getItem("backupSiteId") || -1;
  if ((!t || t === -1) && (t = i("siteId")), typeof t == "string" && (t = parseInt(t), isNaN(t) && t))
    return -1;
  const a = o.getInstance(), {
    locationId: n
  } = a.get();
  if (n)
    return parseInt(n);
  const r = e.match(/(?:\/)(\d+)(?:$|[?#\/])/);
  return r ? parseInt(r[1]) ?? t : t;
};
export {
  f as getPathId
};
