/** Базовый URL демо-стрима из `.env` (`VITE_STREAM_DEMO_ORIGIN`). */
export const STREAM_DEMO_ORIGIN =
  import.meta.env.VITE_STREAM_DEMO_ORIGIN?.replace(/\/$/, "") ??
  "https://stream.graff.tech";

export function streamDemoUrlFromBuild(buildFilename: string): string {
  const build = buildFilename.trim();
  const params = new URLSearchParams({ location: "a1" });
  if (build) params.set("build", build);
  return `${STREAM_DEMO_ORIGIN}/?${params.toString()}`;
}
