"use strict";
/**
 * Centralized configuration for Rivet services
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.POSTHOG_HOST = exports.SUPPORT_TICKET_WEBHOOK_URL = exports.PROTOTYPE_HOST_URL = exports.GATEWAY_URL = exports.PROXY_URL = void 0;
// Rivet Proxy - OAuth and auth endpoints only
const DEFAULT_PROXY_URL = 'https://rivet-proxy.onrender.com';
const envProxyUrl = process.env.RIVET_PROXY_URL?.trim();
exports.PROXY_URL = envProxyUrl && envProxyUrl.length > 0 ? envProxyUrl : DEFAULT_PROXY_URL;
// Rivet Gateway - LLM requests with Supabase JWT auth and usage tracking
const DEFAULT_GATEWAY_URL = 'https://rivet-core-production.up.railway.app';
const envGatewayUrl = process.env.RIVET_GATEWAY_URL?.trim();
exports.GATEWAY_URL = envGatewayUrl && envGatewayUrl.length > 0
    ? envGatewayUrl
    : DEFAULT_GATEWAY_URL;
// Rivet Prototype Preview Host - serves deployed prototype bundles at public
// share URLs. Holds hosting credentials server-side; the client only ever sends
// the user's Rivet JWT (same trust model as the Gateway).
const DEFAULT_PROTOTYPE_HOST_URL = 'https://rivet-prototype-host.onrender.com';
const envPrototypeHostUrl = process.env.RIVET_PROTOTYPE_HOST_URL?.trim();
exports.PROTOTYPE_HOST_URL = envPrototypeHostUrl && envPrototypeHostUrl.length > 0
    ? envPrototypeHostUrl
    : DEFAULT_PROTOTYPE_HOST_URL;
// Support ticket webhook - Supabase Edge Function that handles Resend delivery
exports.SUPPORT_TICKET_WEBHOOK_URL = process.env.SUPPORT_TICKET_WEBHOOK_URL ??
    'https://vdonwyzxpnsrihtrrvza.supabase.co/functions/v1/send-support-ticket';
// PostHog ingest host. Defaults to PostHog direct; can be set to a reverse-proxy
// path (e.g. `https://rivet-proxy.onrender.com/ingest`) so DNS/network blocklists
// that target *.posthog.com don't drop telemetry from blocked users.
const DEFAULT_POSTHOG_HOST = 'https://us.i.posthog.com';
const envPosthogHost = process.env.RIVET_POSTHOG_HOST?.trim();
exports.POSTHOG_HOST = envPosthogHost && envPosthogHost.length > 0
    ? envPosthogHost
    : DEFAULT_POSTHOG_HOST;
//# sourceMappingURL=proxy.js.map