const trustPageData = {
  privacy: {
    current: '',
    file: 'privacy.html',
    kicker: 'privacy',
    title: 'Privacy at MomentIQ.dev.',
    sub: 'A practical summary of what MomentIQ.dev stores while processing media, metering API usage, and running AI-agent workflows.',
    sections: [
      ['What MomentIQ.dev is', 'MomentIQ.dev is a media timeline API for developers, AI agents, and creators. The service processes video and audio so it can return timestamps, clips, frames, scores, labels, timeline segments, and related job metadata.'],
      ['Uploaded media', 'Source media and generated clips are stored to process jobs, return outputs, support short-term retries or downloads, and help debug failed requests. Default behavior is temporary storage, not permanent customer media hosting.'],
      ['Account and billing data', 'Accounts, API keys, connector tokens, usage records, credits, billing state, spend caps, and job metadata are stored so MomentIQ.dev can authenticate requests, meter usage, enforce caps, and show dashboard history.'],
      ['API and agent usage data', 'We keep endpoint, job status, media seconds, estimated price, final price, request id, error metadata, and operational timing. Users should avoid sending secrets or sensitive personal data in filenames, prompts, settings, or media URLs.'],
      ['Subprocessors', 'MomentIQ.dev currently uses hosted services for the website, API, workers, database, object storage, analytics, and billing. Those providers are used to operate the product, store outputs, meter usage, process payments, and keep the service reliable.'],
      ['AI and detection limits', 'MomentIQ.dev returns machine-generated media analysis. Results can be wrong, incomplete, or approximate. Users should review clips, transcripts, labels, scores, and timestamps before relying on them.'],
      ['Deletion and retention', 'See the data retention page for default storage windows and deletion request handling. During beta, deletion requests can be sent through the contact page with account email, request_id, job_id, and output URL when available.'],
      ['Contact', 'For privacy, deletion, or data handling questions, contact MomentIQ at support@momentiq.dev.'],
    ],
    ctas: [
      ['Data retention', 'data-retention.html'],
      ['Contact support', 'contact.html'],
    ],
  },
  retention: {
    current: '',
    file: 'data-retention.html',
    kicker: 'data retention',
    title: 'Data retention and deletion.',
    sub: 'How MomentIQ.dev treats uploaded media, generated outputs, account records, API logs, and deletion requests during beta.',
    sections: [
      ['Default media retention', 'Source uploads and generated outputs are temporary by default. A practical beta default is up to 24 hours for signed output URLs and short-term storage for processing, retries, and downloads. The product should not be used as unrestricted public file hosting.'],
      ['Generated outputs', 'Generated clips, frames, CSV/JSON exports, and other artifacts may be stored in object storage so users can preview or download them. Output URLs are signed and can expire; regenerate URLs instead of rerunning paid jobs when possible.'],
      ['Job and usage records', 'Job metadata, endpoint usage, request ids, status, media seconds, prices, billing records, and error summaries may be kept longer than media files because they are needed for billing, support, fraud prevention, reliability, and dashboard history.'],
      ['Deletion requests', 'During beta, users can request deletion of media artifacts by contacting support with the account email, request_id, job_id, endpoint, and output URL if available. MomentIQ.dev should delete customer media artifacts when reasonably identifiable and no longer needed for legal, billing, abuse-prevention, or security purposes.'],
      ['Account deletion', 'Account deletion is not fully self-serve yet. Until it is automated, users can contact support to request account closure, API key revocation, connector token revocation, and deletion of media artifacts tied to their account.'],
      ['Backups and provider logs', 'Some infrastructure providers may retain backups, access logs, or security logs for their own limited retention windows. MomentIQ.dev should not promise instant removal from every backup system.'],
      ['Copyright and uploaded content', 'Users are responsible for only uploading or linking media they have rights to process. MomentIQ.dev does not provide copyright clearance or guarantee that uploaded media is safe to publish.'],
      ['Roadmap', 'Before full public launch, MomentIQ.dev should add automated media expiration, self-serve artifact deletion where practical, clearer dashboard controls, and production retention values verified against actual storage cleanup jobs.'],
    ],
    ctas: [
      ['Privacy policy', 'privacy.html'],
      ['Terms', 'terms.html'],
      ['Contact support', 'contact.html'],
    ],
  },
  terms: {
    current: '',
    file: 'terms.html',
    kicker: 'terms',
    title: 'Terms for beta API use.',
    sub: 'Plain-language beta terms for using MomentIQ.dev APIs, Moment Lab, SDKs, dashboard, and AI-agent connectors before final legal review.',
    sections: [
      ['Beta service', 'MomentIQ.dev is a beta media intelligence API. Endpoints, prices, limits, SDKs, dashboard screens, connector behavior, and preview features may change while the product is being tested.'],
      ['Usage-based billing', 'MomentIQ.dev is usage-based. Signup credits are consumed first. After credits are gone, billing must be active before additional paid processing can run. Successful processing jobs may consume credits or create metered usage. Failed jobs should not be billed. Keep spend caps enabled while testing.'],
      ['API keys and connectors', 'Users are responsible for API keys, connector tokens, account access, and spend caps. Do not expose secrets in browser code, public prompts, screenshots, repositories, or shared documents. Revoke keys or connector tokens immediately if they are exposed.'],
      ['Your media', 'Only submit, upload, link, or process media you have the right to use. MomentIQ.dev does not grant rights to third-party videos, music, transcripts, faces, voices, brands, or copyrighted works.'],
      ['Acceptable use', 'Do not use the service to host public files, bypass platform restrictions, attack infrastructure, evade billing, overload workers, process unlawful content, or violate another service provider’s terms.'],
      ['No legal or copyright guarantee', 'MomentIQ.dev can help detect, clip, score, and structure media, but it does not provide legal advice, copyright clearance, music clearance, identity verification, or publication approval.'],
      ['No accuracy guarantee', 'Detection outputs are probabilistic. Review clips, timestamps, frames, labels, scores, speaker labels, transcript matches, and generated timelines before relying on them.'],
      ['Service availability', 'MomentIQ.dev may rely on Vercel, Railway, Neon, Cloudflare R2, Stripe, and other hosted providers. Beta availability may be affected by worker capacity, provider outages, queue delays, storage limits, or unsupported media formats.'],
      ['Termination and abuse prevention', 'MomentIQ.dev may block requests, revoke keys, suspend accounts, or require billing setup when necessary to prevent abuse, protect infrastructure, enforce spend caps, or comply with legal/security obligations.'],
      ['Formal review', 'These are practical beta terms and should be reviewed before broader paid public launch.'],
    ],
    ctas: [
      ['Privacy policy', 'privacy.html'],
      ['Data retention', 'data-retention.html'],
      ['Contact support', 'contact.html'],
    ],
  },
  contact: {
    current: '',
    file: 'contact.html',
    kicker: 'contact',
    title: 'Contact MomentIQ.dev.',
    sub: 'Get help with beta access, billing, endpoints, workers, or AI-agent integrations.',
    sections: [
      ['Support email', 'Email support@momentiq.dev for beta access, billing issues, deletion requests, API errors, connector setup, account questions, and production readiness questions.'],
      ['Company and owner', 'MomentIQ is operated by owner Matt Wojcik while the product is in beta. Use this page as the public support contact for MomentIQ.dev, the API, Moment Lab, dashboard, SDK, and MCP connector.'],
      ['What to include', 'Include your request_id, job_id, endpoint, whether you used Moment Lab, API, SDK, or MCP, and whether the issue involved uploads, billing, worker status, or output URLs.'],
      ['Billing help', 'For billing questions, include your account email, Stripe customer email if different, approximate time of the charge or usage, endpoint name, and job_id when available. Do not include full card numbers or secret API keys.'],
      ['Privacy or deletion help', 'For deletion requests, include account email, request_id, job_id, output URL, and any upload id if available. Do not send private API keys or connector tokens.'],
      ['Developer help', 'Start with the quickstart, AI agent setup page, OpenAPI file, and llms.txt if you are integrating MomentIQ.dev into another app.'],
    ],
    ctas: [
      ['Read docs', 'docs.html'],
      ['AI agent setup', 'docs-ai-agents.html'],
      ['GitHub', 'https://github.com/wojoBro/moment-iq'],
    ],
  },
  status: {
    current: '',
    file: 'status.html',
    kicker: 'status',
    title: 'MomentIQ.dev status.',
    sub: 'Operational links and what to check when jobs are slow, queued, or failing.',
    sections: [
      ['Website', 'The public website is served from Vercel at momentiq.dev. If pages do not update after a push, check the latest Vercel deployment for the main branch.'],
      ['API and workers', 'The hosted API and CPU worker services run on Railway. If jobs stay queued, check API health, worker logs, and worker restart status.'],
      ['Storage and database', 'Uploads and outputs use Cloudflare R2. Accounts, jobs, usage, billing, and dashboard data use Neon Postgres.'],
      ['Output URLs', 'Generated output URLs are signed and may expire. Regenerate an output URL rather than rerunning a paid job when possible.'],
    ],
    ctas: [
      ['API health', 'https://momentiq-production-7fdd.up.railway.app/health'],
      ['Docs: async jobs', 'docs-async-jobs.html'],
    ],
  },
  changelog: {
    current: '',
    file: 'changelog.html',
    kicker: 'changelog',
    title: 'MomentIQ.dev changelog.',
    sub: 'Recent beta product milestones for the site, API, workers, dashboard, and MCP setup.',
    sections: [
      ['June 2026', 'Added remote MCP discovery files, AI-agent setup docs, workflow-oriented MCP tools, hosted upload flow, R2 output storage, and worker-backed job processing.'],
      ['June 2026', 'Added dashboard billing, usage, spend caps, admin reporting, API key management, and clearer Moment Lab no-code testing paths.'],
      ['June 2026', 'Added production positioning updates for MomentIQ.dev, crawler metadata, trust links, and setup guides for no-code users, developers, and AI agents.'],
    ],
    ctas: [
      ['Start here', 'docs-setup.html'],
      ['Pricing', 'pricing.html'],
    ],
  },
};

const TrustPage = ({ page }) => {
  const data = trustPageData[page] || trustPageData.contact;
  React.useEffect(() => applyRouteMeta(data.file), []);
  return (
    <Page current={data.current}>
      <PageHero kicker={data.kicker} title={data.title} sub={data.sub} />
      <div style={{ maxWidth: 920, margin: '0 auto', padding: '40px 28px 64px' }}>
        {data.sections.map(([title, body]) => (
          <section key={title} style={{ background: wf.card, border: `1px solid ${wf.line}`, borderRadius: 10, padding: 18, marginBottom: 12 }}>
            <h2 style={{ fontFamily: wf.sans, fontSize: 18, fontWeight: 700, margin: 0, color: wf.ink }}>{title}</h2>
            <p style={{ fontFamily: wf.sans, fontSize: 14.5, lineHeight: 1.65, color: wf.ink2, margin: '8px 0 0' }}>{body}</p>
          </section>
        ))}
        {data.ctas && (
          <div style={{ display: 'flex', gap: 10, flexWrap: 'wrap', marginTop: 20 }}>
            {data.ctas.map(([label, href], i) => (
              <Btn key={label} href={href} primary={i === 0} size={14}>{label}</Btn>
            ))}
          </div>
        )}
      </div>
    </Page>
  );
};

Object.assign(window, { TrustPage, trustPageData });
