/**
 * PRUDENTIA legal configuration.
 *
 * Fill these in with the REAL legal entity and contact details before publishing
 * to the App Store / Google Play or to the public PRUDENTIA website.
 * Anything left blank renders as an explicit "to be configured" marker so no
 * fake company name, email or URL ever ships.
 */
export const LEGAL_CONFIG = {
  appName: "PRUDENTIA",

  /** Registered legal entity operating PRUDENTIA, e.g. "Example Technologies Pvt. Ltd." */
  legalEntity: "Prudentia",
  /** Registered business address (single line or multi-line). */
  businessAddress: "India",
  /** Country / state whose law governs the Terms, e.g. "India". */
  governingLaw: "India",

  /** General + legal contact mailbox. */
  contactEmail: "prudentia.financeapp@gmail.com",
  /** Privacy / data-protection mailbox (falls back to contactEmail). */
  privacyEmail: "",
  /** Customer support mailbox (falls back to contactEmail). */
  supportEmail: "",

  /** Public marketing site, e.g. "https://aura.example.com". */
  websiteUrl: "",

  /** Date these documents took effect. */
  effectiveDate: "2026-08-19",
} as const;

export const CONFIG_PENDING = "[to be configured before launch]";

/** Returns the configured value, or a clearly marked placeholder. */
export function cfg(value: string | undefined, fallback?: string): string {
  const v = (value ?? "").trim();
  if (v) return v;
  const f = (fallback ?? "").trim();
  return f || CONFIG_PENDING;
}

export const legal = {
  entity: () => cfg(LEGAL_CONFIG.legalEntity),
  address: () => cfg(LEGAL_CONFIG.businessAddress),
  law: () => cfg(LEGAL_CONFIG.governingLaw),
  contact: () => cfg(LEGAL_CONFIG.contactEmail),
  privacy: () => cfg(LEGAL_CONFIG.privacyEmail, LEGAL_CONFIG.contactEmail),
  support: () => cfg(LEGAL_CONFIG.supportEmail, LEGAL_CONFIG.contactEmail),
  website: () => cfg(LEGAL_CONFIG.websiteUrl),
  effective: () => LEGAL_CONFIG.effectiveDate,
};

export function isPending(value: string) {
  return value === CONFIG_PENDING;
}

/** Short disclaimer reused across AI surfaces. */
export const FINANCIAL_DISCLAIMER_SHORT =
  "PRUDENTIA provides informational and educational insights only. It is not financial, investment, tax or legal advice, results are not guaranteed, and it does not replace a qualified professional.";
