mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
* chore(api): enforce sebuf contract via exceptions manifest (#3207) Adds api/api-route-exceptions.json as the single source of truth for non-proto /api/ endpoints, with scripts/enforce-sebuf-api-contract.mjs gating every PR via npm run lint:api-contract. Fixes the root-only blind spot in the prior allowlist (tests/edge-functions.test.mjs), which only scanned top-level *.js files and missed nested paths and .ts endpoints — the gap that let api/supply-chain/v1/country-products.ts and friends drift under proto domain URL prefixes unchallenged. Checks both directions: every api/<domain>/v<N>/[rpc].ts must pair with a generated service_server.ts (so a deleted proto fails CI), and every generated service must have an HTTP gateway (no orphaned generated code). Manifest entries require category + reason + owner, with removal_issue mandatory for temporary categories (deferred, migration-pending) and forbidden for permanent ones. .github/CODEOWNERS pins the manifest to @SebastienMelki so new exceptions don't slip through review. The manifest only shrinks: migration-pending entries (19 today) will be removed as subsequent commits in this PR land each migration. * refactor(maritime): migrate /api/ais-snapshot → maritime/v1.GetVesselSnapshot (#3207) The proto VesselSnapshot was carrying density + disruptions but the frontend also needed sequence, relay status, and candidate_reports to drive the position-callback system. Those only lived on the raw relay passthrough, so the client had to keep hitting /api/ais-snapshot whenever callbacks were registered and fall back to the proto RPC only when the relay URL was gone. This commit pushes all three missing fields through the proto contract and collapses the dual-fetch-path into one proto client call. Proto changes (proto/worldmonitor/maritime/v1/): - VesselSnapshot gains sequence, status, candidate_reports. - GetVesselSnapshotRequest gains include_candidates (query: include_candidates). Handler (server/worldmonitor/maritime/v1/get-vessel-snapshot.ts): - Forwards include_candidates to ?candidates=... on the relay. - Separate 5-min in-memory caches for the candidates=on and candidates=off variants; they have very different payload sizes and should not share a slot. - Per-request in-flight dedup preserved per-variant. Frontend (src/services/maritime/index.ts): - fetchSnapshotPayload now calls MaritimeServiceClient.getVesselSnapshot directly with includeCandidates threaded through. The raw-relay path, SNAPSHOT_PROXY_URL, DIRECT_RAILWAY_SNAPSHOT_URL and LOCAL_SNAPSHOT_FALLBACK are gone — production already routed via Vercel, the "direct" branch only ever fired on localhost, and the proto gateway covers both. - New toLegacyCandidateReport helper mirrors toDensityZone/toDisruptionEvent. api/ais-snapshot.js deleted; manifest entry removed. Only reduced the codegen scope to worldmonitor.maritime.v1 (buf generate --path) — regenerating the full tree drops // @ts-nocheck from every client/server file and surfaces pre-existing type errors across 30+ unrelated services, which is not in scope for this PR. Shape-diff vs legacy payload: - disruptions / density: proto carries the same fields, just with the GeoCoordinates wrapper and enum strings (remapped client-side via existing toDisruptionEvent / toDensityZone helpers). - sequence, status.{connected,vessels,messages}: now populated from the proto response — was hardcoded to 0/false in the prior proto fallback. - candidateReports: same shape; optional numeric fields come through as 0 instead of undefined, which the legacy consumer already handled. * refactor(sanctions): migrate /api/sanctions-entity-search → LookupSanctionEntity (#3207) The proto docstring already claimed "OFAC + OpenSanctions" coverage but the handler only fuzzy-matched a local OFAC Redis index — narrower than the legacy /api/sanctions-entity-search, which proxied OpenSanctions live (the source advertised in docs/api-proxies.mdx). Deleting the legacy without expanding the handler would have been a silent coverage regression for external consumers. Handler changes (server/worldmonitor/sanctions/v1/lookup-entity.ts): - Primary path: live search against api.opensanctions.org/search/default with an 8s timeout and the same User-Agent the legacy edge fn used. - Fallback path: the existing OFAC local fuzzy match, kept intact for when OpenSanctions is unreachable / rate-limiting. - Response source field flips between 'opensanctions' (happy path) and 'ofac' (fallback) so clients can tell which index answered. - Query validation tightened: rejects q > 200 chars (matches legacy cap). Rate limiting: - Added /api/sanctions/v1/lookup-entity to ENDPOINT_RATE_POLICIES at 30/min per IP — matches the legacy createIpRateLimiter budget. The gateway already enforces per-endpoint policies via checkEndpointRateLimit. Docs: - docs/api-proxies.mdx — dropped the /api/sanctions-entity-search row (plus the orphaned /api/ais-snapshot row left over from the previous commit in this PR). - docs/panels/sanctions-pressure.mdx — points at the new RPC URL and describes the OpenSanctions-primary / OFAC-fallback semantics. api/sanctions-entity-search.js deleted; manifest entry removed. * refactor(military): migrate /api/military-flights → ListMilitaryFlights (#3207) Legacy /api/military-flights read a pre-baked Redis blob written by the seed-military-flights cron and returned flights in a flat app-friendly shape (lat/lon, lowercase enums, lastSeenMs). The proto RPC takes a bbox, fetches OpenSky live, classifies server-side, and returns nested GeoCoordinates + MILITARY_*_TYPE_* enum strings + lastSeenAt — same data, different contract. fetchFromRedis in src/services/military-flights.ts was doing nothing sebuf-aware. Renamed it to fetchViaProto and rewrote to: - Instantiate MilitaryServiceClient against getRpcBaseUrl(). - Iterate MILITARY_QUERY_REGIONS (PACIFIC + WESTERN) in parallel — same regions the desktop OpenSky path and the seed cron already use, so dashboard coverage tracks the analytic pipeline. - Dedup by hexCode across regions. - Map proto → app shape via new mapProtoFlight helper plus three reverse enum maps (AIRCRAFT_TYPE_REVERSE, OPERATOR_REVERSE, CONFIDENCE_REVERSE). The seed cron (scripts/seed-military-flights.mjs) stays put: it feeds regional-snapshot mobility, cross-source signals, correlation, and the health freshness check (api/health.js: 'military:flights:v1'). None of those read the legacy HTTP endpoint; they read the Redis key directly. The proto handler uses its own per-bbox cache keys under the same prefix, so dashboard traffic no longer races the seed cron's blob — the two paths diverge by a small refresh lag, which is acceptable. Docs: dropped the /api/military-flights row from docs/api-proxies.mdx. api/military-flights.js deleted; manifest entry removed. Shape-diff vs legacy: - f.location.{latitude,longitude} → f.lat, f.lon - f.aircraftType: MILITARY_AIRCRAFT_TYPE_TANKER → 'tanker' via reverse map - f.operator: MILITARY_OPERATOR_USAF → 'usaf' via reverse map - f.confidence: MILITARY_CONFIDENCE_LOW → 'low' via reverse map - f.lastSeenAt (number) → f.lastSeen (Date) - f.enrichment → f.enriched (with field renames) - Extra fields registration / aircraftModel / origin / destination / firstSeenAt now flow through where proto populates them. * fix(supply-chain): thread includeCandidates through chokepoint status (#3207) Caught by tsconfig.api.json typecheck in the pre-push hook (not covered by the plain tsc --noEmit run that ran before I pushed the ais-snapshot commit). The chokepoint status handler calls getVesselSnapshot internally with a static no-auth request — now required to include the new includeCandidates bool from the proto extension. Passing false: server-internal callers don't need per-vessel reports. * test(maritime): update getVesselSnapshot cache assertions (#3207) The ais-snapshot migration replaced the single cachedSnapshot/cacheTimestamp pair with a per-variant cache so candidates-on and candidates-off payloads don't evict each other. Pre-push hook surfaced that tests/server-handlers still asserted the old variable names. Rewriting the assertions to match the new shape while preserving the invariants they actually guard: - Freshness check against slot TTL. - Cache read before relay call. - Per-slot in-flight dedup. - Stale-serve on relay failure (result ?? slot.snapshot). * chore(proto): restore // @ts-nocheck on regenerated maritime files (#3207) I ran 'buf generate --path worldmonitor/maritime/v1' to scope the proto regen to the one service I was changing (to avoid the toolchain drift that drops @ts-nocheck from 60+ unrelated files — separate issue). But the repo convention is the 'make generate' target, which runs buf and then sed-prepends '// @ts-nocheck' to every generated .ts file. My scoped command skipped the sed step. The proto-check CI enforces the sed output, so the two maritime files need the directive restored. * refactor(enrichment): decomm /api/enrichment/{company,signals} legacy edge fns (#3207) Both endpoints were already ported to IntelligenceService: - getCompanyEnrichment (/api/intelligence/v1/get-company-enrichment) - listCompanySignals (/api/intelligence/v1/list-company-signals) No frontend callers of the legacy /api/enrichment/* paths exist. Removes: - api/enrichment/company.js, signals.js, _domain.js - api-route-exceptions.json migration-pending entries (58 remain) - docs/api-proxies.mdx rows for /api/enrichment/{company,signals} - docs/architecture.mdx reference updated to the IntelligenceService RPCs Verified: typecheck, typecheck:api, lint:api-contract (89 files / 58 entries), lint:boundaries, tests/edge-functions.test.mjs (136 pass), tests/enrichment-caching.test.mjs (14 pass — still guards the intelligence/v1 handlers), make generate is zero-diff. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(leads): migrate /api/{contact,register-interest} → LeadsService (#3207) New leads/v1 sebuf service with two POST RPCs: - SubmitContact → /api/leads/v1/submit-contact - RegisterInterest → /api/leads/v1/register-interest Handler logic ported 1:1 from api/contact.js + api/register-interest.js: - Turnstile verification (desktop sources bypass, preserved) - Honeypot (website field) silently accepts without upstream calls - Free-email-domain gate on SubmitContact (422 ApiError) - validateEmail (disposable/offensive/typo-TLD/MX) on RegisterInterest - Convex writes via ConvexHttpClient (contactMessages:submit, registerInterest:register) - Resend notification + confirmation emails (HTML templates unchanged) Shared helpers moved to server/_shared/: - turnstile.ts (getClientIp + verifyTurnstile) - email-validation.ts (disposable/offensive/MX checks) Rate limits preserved via ENDPOINT_RATE_POLICIES: - submit-contact: 3/hour per IP (was in-memory 3/hr) - register-interest: 5/hour per IP (was in-memory 5/hr; desktop sources previously capped at 2/hr via shared in-memory map — now 5/hr like everyone else, accepting the small regression in exchange for Upstash-backed global limiting) Callers updated: - pro-test/src/App.tsx contact form → new submit-contact path - src-tauri/sidecar/local-api-server.mjs cloud-fallback rewrites /api/register-interest → /api/leads/v1/register-interest when proxying; keeps local path for older desktop builds - src/services/runtime.ts isKeyFreeApiTarget allows both old and new paths through the WORLDMONITOR_API_KEY-optional gate Tests: - tests/contact-handler.test.mjs rewritten to call submitContact handler directly; asserts on ValidationError / ApiError - tests/email-validation.test.mjs + tests/turnstile.test.mjs point at the new server/_shared/ modules Deleted: api/contact.js, api/register-interest.js, api/_ip-rate-limit.js, api/_turnstile.js, api/_email-validation.js, api/_turnstile.test.mjs. Manifest entries removed (58 → 56). Docs updated (api-platform, api-commerce, usage-rate-limits). Verified: npm run typecheck + typecheck:api + lint:api-contract (88 files / 56 entries) + lint:boundaries pass; full test:data (5852 tests) passes; make generate is zero-diff. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(pro-test): rebuild bundle for leads/v1 contact form (#3207) Updates the enterprise contact form to POST to /api/leads/v1/submit-contact (old path /api/contact removed in the previous commit). Bundle is rebuilt from pro-test/src/App.tsx source change in9ccd309d. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review): address HIGH review findings 1-3 (#3207) Three review findings from @koala73 on the sebuf-migration PR, all silent bugs that would have shipped to prod: ### 1. Sanctions rate-limit policy was dead code ENDPOINT_RATE_POLICIES keyed the 30/min budget under /api/sanctions/v1/lookup-entity, but the generated route (from the proto RPC LookupSanctionEntity) is /api/sanctions/v1/lookup-sanction-entity. hasEndpointRatePolicy / getEndpointRatelimit are exact-string pathname lookups, so the mismatch meant the endpoint fell through to the generic 600/min global limiter instead of the advertised 30/min. Net effect: the live OpenSanctions proxy endpoint (unauthenticated, external upstream) had 20x the intended rate budget. Fixed by renaming the policy key to match the generated route. ### 2. Lost stale-seed fallback on military-flights Legacy api/military-flights.js cascaded military:flights:v1 → military:flights:stale:v1 before returning empty. The new proto handler went straight to live OpenSky/relay and returned null on miss. Relay or OpenSky hiccup used to serve stale seeded data (24h TTL); under the new handler it showed an empty map. Both keys are still written by scripts/seed-military-flights.mjs on every run — fix just reads the stale key when the live fetch returns null, converts the seed's app-shape flights (flat lat/lon, lowercase enums, lastSeenMs) to the proto shape (nested GeoCoordinates, enum strings, lastSeenAt), and filters to the request bbox. Read via getRawJson (unprefixed) to match the seed cron's writes, which bypass the env-prefix system. ### 3. Hex-code casing mismatch broke getFlightByHex The seed cron writes hexCode: icao24.toUpperCase() (uppercase); src/services/military-flights.ts:getFlightByHex uppercases the lookup input: f.hexCode === hexCode.toUpperCase(). The new proto handler preserved OpenSky's lowercase icao24, and mapProtoFlight is a pass-through. getFlightByHex was silently returning undefined for every call after the migration. Fix: uppercase in the proto handler (live + stale paths), and document the invariant in a comment on MilitaryFlight.hex_code in military_flight.proto so future handlers don't re-break it. ### Verified - typecheck + typecheck:api clean - lint:api-contract (56 entries) / lint:boundaries clean - tests/edge-functions.test.mjs 130 pass - make generate zero-diff (openapi spec regenerated for proto comment) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review): restore desktop 2/hr rate cap on register-interest (#3207) Addresses HIGH review finding #4 from @koala73. The legacy api/register-interest.js applied a nested 2/hr per-IP cap when `source === 'desktop-settings'`, on top of the generic 5/hr endpoint budget. The sebuf migration lost this — desktop-source requests now enjoy the full 5/hr cap. Since `source` is an unsigned client-supplied field, anyone sending `source: 'desktop-settings'` skips Turnstile AND gets 5/hr. Without the tighter cap the Turnstile bypass is cheaper to abuse. Added `checkScopedRateLimit` to `server/_shared/rate-limit.ts` — a reusable second-stage Upstash limiter keyed on an opaque scope string + caller identifier. Fail-open on Redis errors to match existing checkRateLimit / checkEndpointRateLimit semantics. Handlers that need per-subscope caps on top of the gateway-level endpoint budget use this helper. In register-interest: when `isDesktopSource`, call checkScopedRateLimit with scope `/api/leads/v1/register-interest#desktop`, limit=2, window=1h, IP as identifier. On exceeded → throw ApiError(429). ### What this does not fix This caps the blast radius of the Turnstile bypass but does not close it — an attacker sending `source: 'desktop-settings'` still skips Turnstile (just at 2/hr instead of 5/hr). The proper fix is a signed desktop-secret header that authenticates the bypass; filed as follow-up #3252. That requires coordinated Tauri build + Vercel env changes out of scope for #3207. ### Verified - typecheck + typecheck:api clean - lint:api-contract (56 entries) - tests/edge-functions.test.mjs + contact-handler.test.mjs (147 pass) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review): MEDIUM + LOW + rate-limit-policy CI check (#3207) Closes out the remaining @koala73 review findings from #3242 that didn't already land in the HIGH-fix commits, plus the requested CI check that would have caught HIGH #1 (dead-code policy key) at review time. ### MEDIUM #5 — Turnstile missing-secret policy default Flip `verifyTurnstile`'s default `missingSecretPolicy` from `'allow'` to `'allow-in-development'`. Dev with no secret = pass (expected local); prod with no secret = reject + log. submit-contact was already explicitly overriding to `'allow-in-development'`; register-interest was silently getting `'allow'`. Safe default now means a future missing-secret misconfiguration in prod gets caught instead of silently letting bots through. Removed the now-redundant override in submit-contact. ### MEDIUM #6 — Silent enum fallbacks in maritime client `toDisruptionEvent` mapped `AIS_DISRUPTION_TYPE_UNSPECIFIED` / unknown enum values → `gap_spike` / `low` silently. Refactored to return null when either enum is unknown; caller filters nulls out of the array. Handler doesn't produce UNSPECIFIED today, but the `gap_spike` default would have mislabeled the first new enum value the proto ever adds — dropping unknowns is safer than shipping wrong labels. ### LOW — Copy drift in register-interest email Email template hardcoded `435+ Sources`; PR #3241 bumped marketing to `500+`. Bumped in the rewritten file to stay consistent. The `as any` on Convex mutation names carried over from legacy and filed as follow-up #3253. ### Rate-limit-policy coverage lint `scripts/enforce-rate-limit-policies.mjs` validates every key in `ENDPOINT_RATE_POLICIES` resolves to a proto-generated gateway route by cross-referencing `docs/api/*.openapi.yaml`. Fails with the sanctions-entity-search incident referenced in the error message so future drift has a paper trail. Wired into package.json (`lint:rate-limit-policies`) and the pre-push hook alongside `lint:boundaries`. Smoke-tested both directions — clean repo passes (5 policies / 175 routes), seeded drift (the exact HIGH #1 typo) fails with the advertised remedy text. ### Verified - `lint:rate-limit-policies` ✓ - `typecheck` + `typecheck:api` ✓ - `lint:api-contract` ✓ (56 entries) - `lint:boundaries` ✓ - edge-functions + contact-handler tests (147 pass) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(commit 5): decomm /api/eia/* + migrate /api/satellites → IntelligenceService (#3207) Both targets turned out to be decomm-not-migration cases. The original plan called for two new services (economic/v1.GetEiaSeries + natural/v1.ListSatellitePositions) but research found neither was needed: ### /api/eia/[[...path]].js — pure decomm, zero consumers The "catch-all" is a misnomer — only two paths actually worked, /api/eia/health and /api/eia/petroleum, both Redis-only readers. Zero frontend callers in src/. Zero server-side readers. Nothing consumes the `energy:eia-petroleum:v1` key that seed-eia-petroleum.mjs writes daily. The EIA data the frontend actually uses goes through existing typed RPCs in economic/v1: GetEnergyPrices, GetCrudeInventories, GetNatGasStorage, GetEnergyCapacity. None of those touch /api/eia/*. Building GetEiaSeries would have been dead code. Deleted the legacy file + its test (tests/api-eia-petroleum.test.mjs — it only covered the legacy endpoint, no behavior to preserve). Empty api/eia/ dir removed. **Note for review:** the Redis seed cron keeps running daily and nothing consumes it. If that stays unused, seed-eia-petroleum.mjs should be retired too (separate PR). Out of scope for sebuf-migration. ### /api/satellites.js — Learning #2 strikes again IntelligenceService.ListSatellites already exists at /api/intelligence/v1/list-satellites, reads the same Redis key (intelligence:satellites:tle:v1), and supports an optional country filter the legacy didn't have. One frontend caller in src/services/satellites.ts needed to switch from `fetch(toApiUrl('/api/satellites'))` to the typed IntelligenceServiceClient.listSatellites. Shape diff was tiny — legacy `noradId` became proto `id` (handler line 36 already picks either), everything else identical. alt/velocity/inclination in the proto are ignored by the caller since it propagates positions client-side via satellite.js. Kept the client-side cache + failure cooldown + 20s timeout (still valid concerns at the caller level). ### Manifest + docs - api-route-exceptions.json: 56 → 54 entries (both removed) - docs/api-proxies.mdx: dropped the two rows from the Raw-data passthroughs table ### Verified - typecheck + typecheck:api ✓ - lint:api-contract (54 entries) / lint:boundaries / lint:rate-limit-policies ✓ - tests/edge-functions.test.mjs 127 pass (down from 130 — 3 tests were for the deleted eia endpoint) - make generate zero-diff (no proto changes) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(commit 6): migrate /api/supply-chain/v1/{country-products,multi-sector-cost-shock} → SupplyChainService (#3207) Both endpoints were hand-rolled TS handlers sitting under a proto URL prefix — the exact drift the manifest guardrail flagged. Promoted both to typed RPCs: - GetCountryProducts → /api/supply-chain/v1/get-country-products - GetMultiSectorCostShock → /api/supply-chain/v1/get-multi-sector-cost-shock Handlers preserve the existing semantics: PRO-gate via isCallerPremium(ctx.request), iso2 / chokepointId validation, raw bilateral-hs4 Redis read (skip env-prefix to match seeder writes), CHOKEPOINT_STATUS_KEY for war-risk tier, and the math from _multi-sector-shock.ts unchanged. Empty-data and non-PRO paths return the typed empty payload (no 403 — the sebuf gateway pattern is empty-payload-on-deny). Client wrapper switches from premiumFetch to client.getCountryProducts/ client.getMultiSectorCostShock. Legacy MultiSectorShock / MultiSectorShockResponse / CountryProductsResponse names remain as type aliases of the generated proto types so CountryBriefPanel + CountryDeepDivePanel callsites compile with zero churn. Manifest 54 → 52. Rate-limit gateway routes 175 → 177. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(gateway): add cache-tier entries for new supply-chain RPCs (#3207) Pre-push tests/route-cache-tier.test.mjs caught the missing entries. Both PRO-gated, request-varying — match the existing supply-chain PRO cohort (get-country-cost-shock, get-bypass-options, etc.) at slow-browser tier. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(commit 7): migrate /api/scenario/v1/{run,status,templates} → ScenarioService (#3207) Promote the three literal-filename scenario endpoints to a typed sebuf service with three RPCs: POST /api/scenario/v1/run-scenario (RunScenario) GET /api/scenario/v1/get-scenario-status (GetScenarioStatus) GET /api/scenario/v1/list-scenario-templates (ListScenarioTemplates) Preserves all security invariants from the legacy handlers: - 405 for wrong method (sebuf service-config method gate) - scenarioId validation against SCENARIO_TEMPLATES registry - iso2 regex ^[A-Z]{2}$ - JOB_ID_RE path-traversal guard on status - Per-IP 10/min rate limit (moved to gateway ENDPOINT_RATE_POLICIES) - Queue-depth backpressure (>100 → 429) - PRO gating via isCallerPremium - AbortSignal.timeout on every Redis pipeline (runRedisPipeline helper) Wire-level diffs vs legacy: - Per-user RL now enforced at the gateway (same 10/min/IP budget). - Rate-limit response omits Retry-After header; retryAfter is in the body per error-mapper.ts convention. - ListScenarioTemplates emits affectedHs2: [] when the registry entry is null (all-sectors sentinel); proto repeated cannot carry null. - RunScenario returns { jobId, status } (no statusUrl field — unused by SupplyChainPanel, drop from wire). Gateway wiring: - server/gateway.ts RPC_CACHE_TIER: list-scenario-templates → 'daily' (matches legacy max-age=3600); get-scenario-status → 'slow-browser' (premium short-circuit target, explicit entry required by tests/route-cache-tier.test.mjs). - src/shared/premium-paths.ts: swap old run/status for the new run-scenario/get-scenario-status paths. - api/scenario/v1/{run,status,templates}.ts deleted; 3 manifest exceptions removed (63 → 52 → 49 migration-pending). Client: - src/services/scenario/index.ts — typed client wrapper using premiumFetch (injects Clerk bearer / API key). - src/components/SupplyChainPanel.ts — polling loop swapped from premiumFetch strings to runScenario/getScenarioStatus. Hard 20s timeout on run preserved via AbortSignal.any. Tests: - tests/scenario-handler.test.mjs — 18 new handler-level tests covering every security invariant + the worker envelope coercion. - tests/edge-functions.test.mjs — scenario sections removed, replaced with a breadcrumb pointer to the new test file. Docs: api-scenarios.mdx, scenario-engine.mdx, usage-rate-limits.mdx, usage-errors.mdx, supply-chain.mdx refreshed with new paths. Verified: typecheck, typecheck:api, lint:api-contract (49 entries), lint:rate-limit-policies (6/180), lint:boundaries, route-cache-tier (parity), full edge-functions (117) + scenario-handler (18). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(commit 8): migrate /api/v2/shipping/{route-intelligence,webhooks} → ShippingV2Service (#3207) Partner-facing endpoints promoted to a typed sebuf service. Wire shape preserved byte-for-byte (camelCase field names, ISO-8601 fetchedAt, the same subscriberId/secret formats, the same SET + SADD + EXPIRE 30-day Redis pipeline). Partner URLs /api/v2/shipping/* are unchanged. RPCs landed: - GET /route-intelligence → RouteIntelligence (PRO, slow-browser) - POST /webhooks → RegisterWebhook (PRO) - GET /webhooks → ListWebhooks (PRO, slow-browser) The existing path-parameter URLs remain on the legacy edge-function layout because sebuf's HTTP annotations don't currently model path params (grep proto/**/*.proto for `path: "{…}"` returns zero). Those endpoints are split into two Vercel dynamic-route files under api/v2/shipping/webhooks/, behaviorally identical to the previous hybrid file but cleanly separated: - GET /webhooks/{subscriberId} → [subscriberId].ts - POST /webhooks/{subscriberId}/rotate-secret → [subscriberId]/[action].ts - POST /webhooks/{subscriberId}/reactivate → [subscriberId]/[action].ts Both get manifest entries under `migration-pending` pointing at #3207. Other changes - scripts/enforce-sebuf-api-contract.mjs: extended GATEWAY_RE to accept api/v{N}/{domain}/[rpc].ts (version-first) alongside the canonical api/{domain}/v{N}/[rpc].ts; first-use of the reversed ordering is shipping/v2 because that's the partner contract. - vite.config.ts: dev-server sebuf interceptor regex extended to match both layouts; shipping/v2 import + allRoutes entry added. - server/gateway.ts: RPC_CACHE_TIER entries for /api/v2/shipping/ route-intelligence + /webhooks (slow-browser; premium-gated endpoints short-circuit to slow-browser but the entries are required by tests/route-cache-tier.test.mjs). - src/shared/premium-paths.ts: route-intelligence + webhooks added. - tests/shipping-v2-handler.test.mjs: 18 handler-level tests covering PRO gate, iso2/cargoType/hs2 coercion, SSRF guards (http://, RFC1918, cloud metadata, IMDS), chokepoint whitelist, alertThreshold range, secret/subscriberId format, pipeline shape + 30-day TTL, cross-tenant owner isolation, `secret` omission from list response. Manifest delta - Removed: api/v2/shipping/route-intelligence.ts, api/v2/shipping/webhooks.ts - Added: api/v2/shipping/webhooks/[subscriberId].ts (migration-pending) - Added: api/v2/shipping/webhooks/[subscriberId]/[action].ts (migration-pending) - Added: api/internal/brief-why-matters.ts (internal-helper) — regression surface from the #3248 main merge, which introduced the file without a manifest entry. Filed here to keep the lint green; not strictly in scope for commit 8 but unblocking. Net result: 49 → 47 `migration-pending` entries (one net-removal even though webhook path-params stay pending, because two files collapsed into two dynamic routes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review HIGH 1): SupplyChainServiceClient must use premiumFetch (#3207) Signed-in browser pro users were silently hitting 401 on 8 supply-chain premium endpoints (country-products, multi-sector-cost-shock, country-chokepoint-index, bypass-options, country-cost-shock, sector-dependency, route-explorer-lane, route-impact). The shared client was constructed with globalThis.fetch, so no Clerk bearer or X-WorldMonitor-Key was injected. The gateway's validateApiKey runs with forceKey=true for PREMIUM_RPC_PATHS and 401s before isCallerPremium is consulted. The generated client's try/catch collapses the 401 into an empty-fallback return, leaving panels blank with no visible error. Fix is one line at the client constructor: swap globalThis.fetch for premiumFetch. The same pattern is already in use for insider-transactions, stock-analysis, stock-backtest, scenario, trade (premiumClient) — this was an omission on this client, not a new pattern. premiumFetch no-ops safely when no credentials are available, so the 5 non-premium methods on this client (shippingRates, chokepointStatus, chokepointHistory, criticalMinerals, shippingStress) continue to work unchanged. This also fixes two panels that were pre-existing latently broken on main (chokepoint-index, bypass-options, etc. — predating #3207, not regressions from it). Commit 6 expanded the surface by routing two more methods through the same buggy client; this commit fixes the class. From koala73 review (#3242 second-pass, HIGH new #1): > Exact class PR #3233 fixed for RegionalIntelligenceBoard / > DeductionPanel / trade / country-intel. Supply-chain was not in > #3233's scope. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review HIGH 2): restore 400 on input-shape errors for 2 supply-chain handlers (#3207) Commit 6 collapsed all non-happy paths into empty-200 on `get-country-products` and `get-multi-sector-cost-shock`, including caller-bug cases that legacy returned 400 for: - get-country-products: malformed iso2 → empty 200 (was 400) - get-multi-sector-cost-shock: malformed iso2 / missing chokepointId / unknown chokepointId → empty 200 (was 400) The commit message for 6 called out the 403-for-non-pro → empty-200 shift ("sebuf gateway pattern is empty-payload-on-deny") but not the 400 shift. They're different classes: - Empty-payload-200 for PRO-deny: intentional contract change, already documented and applied across the service. Generated clients treat "you lack PRO" as "no data" — fine. - Empty-payload-200 for malformed input: caller bug silently masked. External API consumers can't distinguish "bad wiring" from "genuinely no data", test harnesses lose the signal, bad calling code doesn't surface in Sentry. Fix: `throw new ValidationError(violations)` on the 3 input-shape branches. The generated sebuf server maps ValidationError → HTTP 400 (see src/generated/server/.../service_server.ts and leads/v1 which already uses this pattern). PRO-gate deny stays as empty-200 — that contract shift was intentional and is preserved. Regression tests added at tests/supply-chain-validation.test.mjs (8 cases) pinning the three-way contract: - bad input → 400 (ValidationError) - PRO-gate deny on valid input → 200 empty - valid PRO input, no data in Redis → 200 empty (unchanged) From koala73 review (#3242 second-pass, HIGH new #2). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review HIGH 3): restore statusUrl on RunScenarioResponse + document 202→200 wire break (#3207) Commit 7 silently shifted /api/scenario/v1/run-scenario's response contract in two ways that the commit message covered only partially: 1. HTTP 202 Accepted → HTTP 200 OK 2. Dropped `statusUrl` string from the response body The `statusUrl` drop was mentioned as "unused by SupplyChainPanel" but not framed as a contract change. The 202 → 200 shift was not mentioned at all. This is a same-version (v1 → v1) migration, so external callers that key off either signal — `response.status === 202` or `response.body.statusUrl` — silently branch incorrectly. Evaluated options: (a) sebuf per-RPC status-code config — not available. sebuf's HttpConfig only models `path` and `method`; no status annotation. (b) Bump to scenario/v2 — judged heavier than the break itself for a single status-code shift. No in-repo caller uses 202 or statusUrl; the docs-level impact is containable. (c) Accept the break, document explicitly, partially restore. Took option (c): - Restored `statusUrl` in the proto (new field `string status_url = 3` on RunScenarioResponse). Server computes `/api/scenario/v1/get-scenario-status?jobId=<encoded job_id>` and populates it on every successful enqueue. External callers that followed this URL keep working unchanged. - 202 → 200 is not recoverable inside the sebuf generator, so it is called out explicitly in two places: - docs/api-scenarios.mdx now includes a prominent `<Warning>` block documenting the v1→v1 contract shift + the suggested migration (branch on response body shape, not HTTP status). - RunScenarioResponse proto comment explains why 200 is the new success status on enqueue. OpenAPI bundle regenerated to reflect the restored statusUrl field. - Regression test added in tests/scenario-handler.test.mjs pinning `statusUrl` to the exact URL-encoded shape — locks the invariant so a future proto rename or handler refactor can't silently drop it again. From koala73 review (#3242 second-pass, HIGH new #3). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review HIGH 1/2): close webhook tenant-isolation gap on shipping/v2 (#3207) Koala flagged this as a merge blocker in PR #3242 review. server/worldmonitor/shipping/v2/{register-webhook,list-webhooks}.ts migrated without reinstating validateApiKey(req, { forceKey: true }), diverging from both the sibling api/v2/shipping/webhooks/[subscriberId] routes and the documented "X-WorldMonitor-Key required" contract in docs/api-shipping-v2.mdx. Attack surface: the gateway accepts Clerk bearer auth as a pro signal. A Clerk-authenticated pro user with no X-WorldMonitor-Key reaches the handler, callerFingerprint() falls back to 'anon', and every such caller collapses into a shared webhook:owner:anon:v1 bucket. The defense-in-depth ownerTag !== ownerHash check in list-webhooks.ts doesn't catch it because both sides equal 'anon' — every Clerk-session holder could enumerate / overwrite every other Clerk-session pro tenant's registered webhook URLs. Fix: reinstate validateApiKey(ctx.request, { forceKey: true }) at the top of each handler, throwing ApiError(401) when absent. Matches the sibling routes exactly and the published partner contract. Tests: - tests/shipping-v2-handler.test.mjs: two existing "non-PRO → 403" tests for register/list were using makeCtx() with no key, which now fails at the 401 layer first. Renamed to "no API key → 401 (tenant-isolation gate)" with a comment explaining the failure mode being tested. 18/18 pass. Verified: typecheck:api, lint:api-contract (no change), lint:boundaries, lint:rate-limit-policies, test:data (6005/6005). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(review HIGH 2/2): restore v1 path aliases on scenario + supply-chain (#3207) Koala flagged this as a merge blocker in PR #3242 review. Commits 6 + 7 of #3207 renamed five documented v1 URLs to the sebuf method-derived paths and deleted the legacy edge-function files: POST /api/scenario/v1/run → run-scenario GET /api/scenario/v1/status → get-scenario-status GET /api/scenario/v1/templates → list-scenario-templates GET /api/supply-chain/v1/country-products → get-country-products GET /api/supply-chain/v1/multi-sector-cost-shock → get-multi-sector-cost-shock server/router.ts is an exact static-match table (Map keyed on `METHOD PATH`), so any external caller — docs, partner scripts, grep-the- internet — hitting the old documented URL would 404 on first request after merge. Commit 8 (shipping/v2) preserved partner URLs byte-for- byte; the scenario + supply-chain renames missed that discipline. Fix: add five thin alias edge functions that rewrite the pathname to the canonical sebuf path and delegate to the domain [rpc].ts gateway via a new server/alias-rewrite.ts helper. Premium gating, rate limits, entitlement checks, and cache-tier lookups all fire on the canonical path — aliases are pure URL rewrites, not a duplicate handler pipeline. api/scenario/v1/{run,status,templates}.ts api/supply-chain/v1/{country-products,multi-sector-cost-shock}.ts Vite dev parity: file-based routing at api/ is a Vercel concern, so the dev middleware (vite.config.ts) gets a matching V1_ALIASES rewrite map before the router dispatch. Manifest: 5 new entries under `deferred` with removal_issue=#3282 (tracking their retirement at the next v1→v2 break). lint:api-contract stays green (89 files checked, 55 manifest entries validated). Docs: - docs/api-scenarios.mdx: migration callout at the top with the full old→new URL table and a link to the retirement issue. - CHANGELOG.md + docs/changelog.mdx: Changed entry documenting the rename + alias compat + the 202→200 shift (from commit23c821a1). Verified: typecheck:api, lint:api-contract, lint:rate-limit-policies, lint:boundaries, test:data (6005/6005). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1258 lines
65 KiB
TypeScript
1258 lines
65 KiB
TypeScript
import { useState, useEffect, useRef, type ReactElement } from 'react';
|
|
import type { UserResource } from '@clerk/types';
|
|
import * as Sentry from '@sentry/react';
|
|
import { motion } from 'motion/react';
|
|
import {
|
|
Globe, Activity, ShieldAlert, Zap, Terminal, Database,
|
|
Send, MessageCircle, Mail, MessageSquare, ChevronDown,
|
|
ArrowRight, Check, Lock, Server, Cpu, Layers,
|
|
Bell, Brain, Key, Plug, PanelTop, ExternalLink,
|
|
BarChart3, Clock, Radio, Ship, Plane, Flame,
|
|
Cable, Wifi, MapPin, TrendingUp,
|
|
Filter, Lightbulb, SlidersHorizontal, Telescope,
|
|
LineChart, Search, Shield, Building2,
|
|
Landmark, Fuel
|
|
} from 'lucide-react';
|
|
import { t } from './i18n';
|
|
import { initOverlay, ensureClerk } from './services/checkout';
|
|
import { PricingSection } from './components/PricingSection';
|
|
import { SoonBadge } from './components/SoonBadge';
|
|
import dashboardFallback from './assets/worldmonitor-7-mar-2026.jpg';
|
|
import wiredLogo from './assets/wired-logo.svg';
|
|
|
|
const API_BASE = 'https://api.worldmonitor.app/api';
|
|
const TURNSTILE_SITE_KEY = '0x4AAAAAACnaYgHIyxclu8Tj';
|
|
|
|
declare global {
|
|
interface Window {
|
|
turnstile?: {
|
|
render: (container: string | HTMLElement, opts: Record<string, unknown>) => string;
|
|
getResponse: (widgetOrId?: string | HTMLElement) => string | undefined;
|
|
reset: (widgetOrId?: string | HTMLElement) => void;
|
|
};
|
|
}
|
|
}
|
|
|
|
export function renderTurnstileWidgets(): number {
|
|
if (!window.turnstile) return 0;
|
|
let count = 0;
|
|
document.querySelectorAll<HTMLElement>('.cf-turnstile:not([data-rendered])').forEach(el => {
|
|
const widgetId = window.turnstile!.render(el, {
|
|
sitekey: TURNSTILE_SITE_KEY,
|
|
size: 'flexible',
|
|
callback: (token: string) => { el.dataset.token = token; },
|
|
'expired-callback': () => { delete el.dataset.token; },
|
|
'error-callback': () => { delete el.dataset.token; },
|
|
});
|
|
el.dataset.rendered = 'true';
|
|
el.dataset.widgetId = String(widgetId);
|
|
count++;
|
|
});
|
|
return count;
|
|
}
|
|
|
|
function getRefCode(): string | undefined {
|
|
const params = new URLSearchParams(window.location.search);
|
|
return params.get('ref') || undefined;
|
|
}
|
|
|
|
function openSignIn(): void {
|
|
ensureClerk().then(c => c.openSignIn()).catch((err) => {
|
|
console.error('[auth] Failed to open sign in:', err);
|
|
Sentry.captureException(err, { tags: { surface: 'pro-marketing', action: 'open-sign-in' } });
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Subscribe to Clerk's current user. Returns null while loading or signed out,
|
|
* and the Clerk UserResource when signed in. Re-renders on any auth change
|
|
* (sign-in, sign-out, user switch) via clerk.addListener.
|
|
*
|
|
* Used by the Navbar to swap the SIGN IN button for Clerk's UserButton avatar
|
|
* once the visitor is authenticated, and by the Hero to hide its redundant
|
|
* SIGN IN CTA. Single source of truth for "is the /pro visitor signed in".
|
|
*/
|
|
function useClerkUser(): { user: UserResource | null; isLoaded: boolean } {
|
|
const [user, setUser] = useState<UserResource | null>(null);
|
|
const [isLoaded, setIsLoaded] = useState(false);
|
|
|
|
useEffect(() => {
|
|
let mounted = true;
|
|
let unsubscribe: (() => void) | undefined;
|
|
|
|
ensureClerk()
|
|
.then((clerk) => {
|
|
if (!mounted) return;
|
|
setUser(clerk.user ?? null);
|
|
setIsLoaded(true);
|
|
unsubscribe = clerk.addListener(() => {
|
|
if (!mounted) return;
|
|
setUser(clerk.user ?? null);
|
|
});
|
|
})
|
|
.catch((err) => {
|
|
console.error('[auth] Failed to load Clerk for nav auth state:', err);
|
|
Sentry.captureException(err, { tags: { surface: 'pro-marketing', action: 'load-clerk-for-nav' } });
|
|
if (mounted) setIsLoaded(true); // unblock UI; show signed-out state
|
|
});
|
|
|
|
return () => {
|
|
mounted = false;
|
|
unsubscribe?.();
|
|
};
|
|
}, []);
|
|
|
|
return { user, isLoaded };
|
|
}
|
|
|
|
/**
|
|
* Mounts Clerk's native UserButton (avatar + dropdown with profile + sign
|
|
* out) into a DOM node. Using Clerk's built-in widget avoids reimplementing
|
|
* a signed-in UI from scratch and inherits theming from the existing
|
|
* clerk.load() appearance options in services/checkout.ts.
|
|
*/
|
|
function ClerkUserButton(): ReactElement {
|
|
const ref = useRef<HTMLDivElement | null>(null);
|
|
|
|
useEffect(() => {
|
|
if (!ref.current) return;
|
|
const el = ref.current;
|
|
let unmounted = false;
|
|
|
|
ensureClerk()
|
|
.then((clerk) => {
|
|
if (unmounted || !el) return;
|
|
clerk.mountUserButton(el, {
|
|
afterSignOutUrl: 'https://www.worldmonitor.app/pro',
|
|
});
|
|
})
|
|
.catch((err) => {
|
|
console.error('[auth] Failed to mount user button:', err);
|
|
Sentry.captureException(err, { tags: { surface: 'pro-marketing', action: 'mount-user-button' } });
|
|
});
|
|
|
|
return () => {
|
|
unmounted = true;
|
|
ensureClerk().then((clerk) => {
|
|
if (el) clerk.unmountUserButton(el);
|
|
}).catch(() => { /* mount path already failed */ });
|
|
};
|
|
}, []);
|
|
|
|
return <div ref={ref} className="flex items-center" />;
|
|
}
|
|
|
|
const SlackIcon = () => (
|
|
<svg viewBox="0 0 24 24" className="w-5 h-5" fill="currentColor" aria-hidden="true">
|
|
<path d="M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"/>
|
|
</svg>
|
|
);
|
|
|
|
const Logo = () => (
|
|
<a href="https://worldmonitor.app" className="flex items-center gap-2 hover:opacity-80 transition-opacity" aria-label="World Monitor — Home">
|
|
<div className="relative w-8 h-8 rounded-full bg-wm-card border border-wm-border flex items-center justify-center overflow-hidden">
|
|
<Globe className="w-5 h-5 text-wm-blue opacity-50 absolute" aria-hidden="true" />
|
|
<Activity className="w-6 h-6 text-wm-green absolute z-10" aria-hidden="true" />
|
|
</div>
|
|
<div className="flex flex-col">
|
|
<span className="font-display font-bold text-sm leading-none tracking-tight">WORLD MONITOR</span>
|
|
<span className="text-[9px] text-wm-muted font-mono uppercase tracking-widest leading-none mt-1">by Someone.ceo</span>
|
|
</div>
|
|
</a>
|
|
);
|
|
|
|
/* ─── 0. Navbar ─── */
|
|
const Navbar = () => {
|
|
const { user, isLoaded } = useClerkUser();
|
|
return (
|
|
<nav className="fixed top-0 left-0 right-0 z-50 glass-panel border-b-0 border-x-0 rounded-none" aria-label="Main navigation">
|
|
<div className="max-w-7xl mx-auto px-6 h-16 flex items-center justify-between">
|
|
<Logo />
|
|
<div className="hidden md:flex items-center gap-8 text-sm font-mono text-wm-muted">
|
|
<a href="#tiers" className="hover:text-wm-text transition-colors">{t('nav.free')}</a>
|
|
<a href="#pro" className="hover:text-wm-green transition-colors">{t('nav.pro')}</a>
|
|
<a href="#api" className="hover:text-wm-text transition-colors">{t('nav.api')}</a>
|
|
<a href="#enterprise" className="hover:text-wm-text transition-colors">{t('nav.enterprise')}</a>
|
|
</div>
|
|
<div className="flex items-center gap-2">
|
|
{/* While Clerk is still loading, render nothing in the auth slot
|
|
to avoid a SIGN IN → UserButton flicker for returning users. */}
|
|
{isLoaded && (user
|
|
? <ClerkUserButton />
|
|
: (
|
|
<button
|
|
type="button"
|
|
onClick={openSignIn}
|
|
className="border border-wm-border text-wm-text px-4 py-2 rounded-sm font-mono text-xs uppercase tracking-wider font-bold hover:border-wm-text transition-colors"
|
|
>
|
|
{t('nav.signIn')}
|
|
</button>
|
|
))}
|
|
<a href="#pricing" className="bg-wm-green text-wm-bg px-4 py-2 rounded-sm font-mono text-xs uppercase tracking-wider font-bold hover:bg-green-400 transition-colors">
|
|
{t('nav.upgradeToPro')}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
);
|
|
};
|
|
|
|
/* ─── 1. Hero — Less noise, more signal ─── */
|
|
const WiredBadge = () => (
|
|
<a
|
|
href="https://www.wired.me/story/the-music-streaming-ceo-who-built-a-global-war-map"
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
className="inline-flex items-center gap-2 px-3 py-1.5 rounded-full border border-wm-border bg-wm-card/50 text-wm-muted text-xs font-mono hover:border-wm-green/30 hover:text-wm-text transition-colors"
|
|
>
|
|
{t('wired.asFeaturedIn')} <span className="text-wm-text font-bold">WIRED</span> <ExternalLink className="w-3 h-3" aria-hidden="true" />
|
|
</a>
|
|
);
|
|
|
|
const SignalBars = () => {
|
|
const total = 60;
|
|
const center = total / 2;
|
|
const signalRadius = 8;
|
|
|
|
return (
|
|
<div className="relative my-4 md:my-8 -mx-6">
|
|
<div className="absolute inset-0 flex items-center justify-center pointer-events-none">
|
|
<div className="w-64 h-40 md:w-96 md:h-56 bg-wm-green/8 rounded-full blur-[80px]" />
|
|
</div>
|
|
<div className="flex items-end justify-center gap-[3px] md:gap-1 h-28 md:h-44 relative px-4" aria-hidden="true">
|
|
{Array.from({ length: total }).map((_, i) => {
|
|
const distFromCenter = Math.abs(i - center);
|
|
const isSignal = distFromCenter <= signalRadius;
|
|
const signalIntensity = isSignal ? 1 - distFromCenter / signalRadius : 0;
|
|
const peakHeight = 60 + signalIntensity * 110;
|
|
const noiseBase = Math.max(8, 35 - distFromCenter * 0.8);
|
|
|
|
return (
|
|
<motion.div
|
|
key={i}
|
|
className={`flex-1 max-w-2 md:max-w-3 rounded-sm ${isSignal ? 'bg-wm-green' : 'bg-wm-muted/20'}`}
|
|
style={isSignal ? { boxShadow: `0 0 ${6 + signalIntensity * 12}px rgba(74,222,128,${signalIntensity * 0.5})` } : undefined}
|
|
initial={{ height: isSignal ? peakHeight * 0.3 : noiseBase * 0.5, opacity: isSignal ? 0.4 : 0.08 }}
|
|
animate={isSignal
|
|
? {
|
|
height: [peakHeight * 0.5, peakHeight, peakHeight * 0.65, peakHeight * 0.9],
|
|
opacity: [0.6 + signalIntensity * 0.3, 1, 0.75 + signalIntensity * 0.2, 0.95],
|
|
}
|
|
: {
|
|
height: [noiseBase, noiseBase * 0.3, noiseBase * 0.7, noiseBase * 0.15, noiseBase * 0.5],
|
|
opacity: [0.2, 0.06, 0.15, 0.04, 0.12],
|
|
}
|
|
}
|
|
transition={{
|
|
duration: isSignal ? 2.5 + signalIntensity * 0.5 : 1 + Math.random() * 0.6,
|
|
repeat: Infinity,
|
|
repeatType: 'reverse',
|
|
delay: isSignal ? distFromCenter * 0.07 : Math.random() * 0.6,
|
|
ease: 'easeInOut',
|
|
}}
|
|
/>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const Hero = () => {
|
|
const { user, isLoaded } = useClerkUser();
|
|
// Showing "Sign In" to an already-signed-in user wastes a CTA slot.
|
|
// Hide it once auth state confirms; falls back to just the "Choose Plan"
|
|
// CTA which is the relevant action for returning users anyway.
|
|
const showSignIn = isLoaded && !user;
|
|
return (
|
|
<section className="pt-28 pb-12 px-6 relative overflow-hidden">
|
|
<div className="absolute inset-0 bg-[radial-gradient(circle_at_50%_20%,rgba(74,222,128,0.08)_0%,transparent_50%)] pointer-events-none" />
|
|
<div className="max-w-4xl mx-auto text-center relative z-10">
|
|
<motion.div
|
|
initial={{ opacity: 0, y: 20 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
transition={{ duration: 0.6 }}
|
|
>
|
|
<div className="mb-4">
|
|
<WiredBadge />
|
|
</div>
|
|
|
|
<h1 className="text-6xl md:text-8xl font-display font-bold tracking-tighter leading-[0.95]">
|
|
<span className="text-wm-muted/40">{t('hero.noiseWord')}</span>
|
|
<span className="mx-3 md:mx-5 text-wm-border/50">→</span>
|
|
<span className="text-transparent bg-clip-text bg-gradient-to-r from-wm-green to-emerald-300 text-glow">{t('hero.signalWord')}</span>
|
|
</h1>
|
|
|
|
<SignalBars />
|
|
|
|
<p className="text-lg md:text-xl text-wm-muted max-w-xl mx-auto font-light leading-relaxed">
|
|
{t('hero.valueProps')}
|
|
</p>
|
|
|
|
<div className="flex flex-col sm:flex-row gap-3 justify-center mt-8">
|
|
<a href="#pricing" className="bg-wm-green text-wm-bg px-6 py-3 rounded-sm font-mono text-sm uppercase tracking-wider font-bold hover:bg-green-400 transition-colors flex items-center justify-center gap-2">
|
|
{t('hero.choosePlan')} <ArrowRight className="w-4 h-4" aria-hidden="true" />
|
|
</a>
|
|
{showSignIn && (
|
|
<button type="button" onClick={openSignIn} className="border border-wm-border text-wm-text px-6 py-3 rounded-sm font-mono text-sm uppercase tracking-wider font-bold hover:border-wm-text transition-colors">
|
|
{t('hero.signIn')}
|
|
</button>
|
|
)}
|
|
</div>
|
|
|
|
<div className="flex items-center justify-center mt-4">
|
|
<a href="https://worldmonitor.app" className="text-xs text-wm-green font-mono hover:text-green-300 transition-colors flex items-center gap-1">
|
|
{t('hero.tryFreeDashboard')} <ArrowRight className="w-3 h-3" aria-hidden="true" />
|
|
</a>
|
|
</div>
|
|
</motion.div>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
/* ─── 2. Social proof (current — WIRED badge already in hero) ─── */
|
|
const SocialProof = () => (
|
|
<section className="border-y border-wm-border bg-wm-card/30 py-16 px-6">
|
|
<div className="max-w-5xl mx-auto">
|
|
<div className="grid grid-cols-2 md:grid-cols-4 gap-8 text-center mb-12">
|
|
{[
|
|
{ value: "2M+", label: t('socialProof.uniqueVisitors') },
|
|
{ value: "421K", label: t('socialProof.peakDailyUsers') },
|
|
{ value: "190+", label: t('socialProof.countriesReached') },
|
|
{ value: "500+", label: t('socialProof.liveDataSources') },
|
|
].map((stat, i) => (
|
|
<div key={i}>
|
|
<p className="text-3xl md:text-4xl font-display font-bold text-wm-green">{stat.value}</p>
|
|
<p className="text-xs font-mono text-wm-muted uppercase tracking-widest mt-1">{stat.label}</p>
|
|
</div>
|
|
))}
|
|
</div>
|
|
<blockquote className="max-w-3xl mx-auto text-center">
|
|
<p className="text-lg md:text-xl text-wm-muted italic leading-relaxed">
|
|
"{t('socialProof.quote')}"
|
|
</p>
|
|
<footer className="mt-6 flex items-center justify-center gap-3">
|
|
<a href="https://www.wired.me/story/the-music-streaming-ceo-who-built-a-global-war-map" target="_blank" rel="noreferrer" className="inline-flex items-center gap-2 text-wm-muted hover:text-wm-text transition-colors">
|
|
<img src={wiredLogo} alt="WIRED" className="h-5 brightness-0 invert opacity-60 hover:opacity-100 transition-opacity" />
|
|
</a>
|
|
</footer>
|
|
</blockquote>
|
|
</div>
|
|
</section>
|
|
);
|
|
|
|
/* ─── 3. Two-path split (new — from draft) ─── */
|
|
const TwoPathSplit = () => (
|
|
<section className="py-24 px-6 max-w-5xl mx-auto" id="tiers">
|
|
<h2 className="sr-only">Plans</h2>
|
|
<div className="grid md:grid-cols-2 gap-8">
|
|
<div className="bg-wm-card border border-wm-green p-8 relative border-glow">
|
|
<div className="absolute top-0 left-0 w-full h-1 bg-wm-green" />
|
|
<h3 className="font-display text-2xl font-bold mb-2">{t('twoPath.proTitle')}</h3>
|
|
<p className="text-sm text-wm-muted mb-6">{t('twoPath.proDesc')}</p>
|
|
<ul className="space-y-3 mb-8">
|
|
{[t('twoPath.proF1'), t('twoPath.proF2'), t('twoPath.proF3'), t('twoPath.proF4'), t('twoPath.proF5'), t('twoPath.proF6'), t('twoPath.proF7'), t('twoPath.proF8'), t('twoPath.proF9')].map((f, i) => (
|
|
<li key={i} className="flex items-start gap-3 text-sm">
|
|
<Check className="w-4 h-4 shrink-0 mt-0.5 text-wm-green" aria-hidden="true" />
|
|
<span className="text-wm-muted">{f}</span>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
<a href="#pricing" className="block text-center py-2.5 rounded-sm font-mono text-xs uppercase tracking-wider font-bold bg-wm-green text-wm-bg hover:bg-green-400 transition-colors">
|
|
{t('twoPath.choosePlan')}
|
|
</a>
|
|
</div>
|
|
|
|
<div className="bg-wm-card border border-wm-border p-8">
|
|
<h3 className="font-display text-2xl font-bold mb-2">{t('twoPath.entTitle')}</h3>
|
|
<p className="text-sm text-wm-muted mb-6">{t('twoPath.entDesc')}</p>
|
|
<ul className="space-y-3 mb-8">
|
|
<li className="text-xs font-mono text-wm-green uppercase tracking-wider mb-1">{t('twoPath.entF1')}</li>
|
|
{[t('twoPath.entF2'), t('twoPath.entF3'), t('twoPath.entF4'), t('twoPath.entF5'), t('twoPath.entF6'), t('twoPath.entF7'), t('twoPath.entF8'), t('twoPath.entF9'), t('twoPath.entF10'), t('twoPath.entF11')].map((f, i) => (
|
|
<li key={i} className="flex items-start gap-3 text-sm">
|
|
<Check className="w-4 h-4 shrink-0 mt-0.5 text-wm-muted" aria-hidden="true" />
|
|
<span className="text-wm-muted">{f}</span>
|
|
</li>
|
|
))}
|
|
</ul>
|
|
<a href="#enterprise" className="block text-center py-2.5 rounded-sm font-mono text-xs uppercase tracking-wider font-bold border border-wm-border text-wm-muted hover:text-wm-text hover:border-wm-text transition-colors">
|
|
{t('twoPath.entCta')}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
|
|
/* ─── 4. Why Upgrade (new — from draft) ─── */
|
|
const WhyUpgrade = () => {
|
|
const items = [
|
|
{ icon: <Filter className="w-6 h-6" aria-hidden="true" />, title: t('whyUpgrade.noiseTitle'), desc: t('whyUpgrade.noiseDesc') },
|
|
{ icon: <TrendingUp className="w-6 h-6" aria-hidden="true" />, title: t('whyUpgrade.fasterTitle'), desc: t('whyUpgrade.fasterDesc') },
|
|
{ icon: <SlidersHorizontal className="w-6 h-6" aria-hidden="true" />, title: t('whyUpgrade.controlTitle'), desc: t('whyUpgrade.controlDesc') },
|
|
{ icon: <Telescope className="w-6 h-6" aria-hidden="true" />, title: t('whyUpgrade.deeperTitle'), desc: t('whyUpgrade.deeperDesc') },
|
|
];
|
|
|
|
return (
|
|
<section className="py-24 px-6 border-t border-wm-border bg-wm-card/20">
|
|
<div className="max-w-5xl mx-auto">
|
|
<h2 className="text-3xl md:text-5xl font-display font-bold mb-16 text-center">{t('whyUpgrade.title')}</h2>
|
|
<div className="grid md:grid-cols-2 gap-8">
|
|
{items.map((item, i) => (
|
|
<div key={i} className="flex gap-5">
|
|
<div className="text-wm-green shrink-0 mt-1">{item.icon}</div>
|
|
<div>
|
|
<h3 className="font-bold text-lg mb-2">{item.title}</h3>
|
|
<p className="text-sm text-wm-muted leading-relaxed">{item.desc}</p>
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
/* ─── Three Flagship Pillars (new) ─── */
|
|
const Pillars = () => {
|
|
const items = [
|
|
{ icon: <Brain className="w-7 h-7" aria-hidden="true" />, title: t('pillars.askIt'), desc: t('pillars.askItDesc') },
|
|
{ icon: <Bell className="w-7 h-7" aria-hidden="true" />, title: t('pillars.subscribeIt'), desc: t('pillars.subscribeItDesc') },
|
|
{ icon: <Plug className="w-7 h-7" aria-hidden="true" />, title: t('pillars.buildOnIt'), desc: t('pillars.buildOnItDesc') },
|
|
];
|
|
|
|
return (
|
|
<section className="py-20 px-6 border-t border-wm-border">
|
|
<div className="max-w-5xl mx-auto">
|
|
<div className="grid md:grid-cols-3 gap-6">
|
|
{items.map((item, i) => (
|
|
<div key={i} className="bg-wm-card border border-wm-border p-6 hover:border-wm-green/30 transition-colors">
|
|
<div className="text-wm-green mb-4">{item.icon}</div>
|
|
<h3 className="font-display text-xl font-bold mb-2">{item.title}</h3>
|
|
<p className="text-sm text-wm-muted leading-relaxed">{item.desc}</p>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
/* ─── Delivery Desk (new) ─── */
|
|
const DeliveryDesk = () => (
|
|
<section className="py-24 px-6 border-t border-wm-border bg-wm-card/20">
|
|
<div className="max-w-4xl mx-auto text-center">
|
|
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-wm-green/30 bg-wm-green/10 text-wm-green text-xs font-mono mb-6">
|
|
{t('deliveryDesk.eyebrow')}
|
|
</div>
|
|
<h2 className="text-3xl md:text-5xl font-display font-bold mb-6">{t('deliveryDesk.title')}</h2>
|
|
<p className="text-lg text-wm-muted leading-relaxed mb-6">
|
|
{t('deliveryDesk.body')}
|
|
</p>
|
|
<p className="text-xl md:text-2xl font-display font-bold text-wm-green mb-8">
|
|
{t('deliveryDesk.closer')}
|
|
</p>
|
|
<p className="font-mono text-xs text-wm-muted uppercase tracking-widest">
|
|
{t('deliveryDesk.channels')}
|
|
</p>
|
|
</div>
|
|
</section>
|
|
);
|
|
|
|
/* ─── 5. Live Dashboard Embed (current) ─── */
|
|
const LivePreview = () => (
|
|
<section className="px-6 py-16">
|
|
<div className="max-w-6xl mx-auto">
|
|
<div className="relative rounded-lg overflow-hidden border border-wm-border shadow-2xl shadow-wm-green/5">
|
|
<div className="bg-wm-card px-4 py-2 border-b border-wm-border flex items-center gap-3">
|
|
<div className="flex gap-1.5">
|
|
<div className="w-3 h-3 rounded-full bg-red-500/70" />
|
|
<div className="w-3 h-3 rounded-full bg-yellow-500/70" />
|
|
<div className="w-3 h-3 rounded-full bg-green-500/70" />
|
|
</div>
|
|
<span className="font-mono text-xs text-wm-muted ml-2">{t('livePreview.windowTitle')}</span>
|
|
<a
|
|
href="https://worldmonitor.app"
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
className="ml-auto text-xs text-wm-green font-mono hover:text-green-300 transition-colors flex items-center gap-1"
|
|
>
|
|
{t('livePreview.openFullScreen')} <ExternalLink className="w-3 h-3" aria-hidden="true" />
|
|
</a>
|
|
</div>
|
|
<div className="relative aspect-[16/9] bg-black">
|
|
<img
|
|
src={dashboardFallback}
|
|
alt="World Monitor Dashboard"
|
|
className="absolute inset-0 w-full h-full object-cover"
|
|
/>
|
|
<iframe
|
|
// ?embed=pro-preview is the unique marker the main app's
|
|
// IS_EMBEDDED_PREVIEW helper keys off to silence premium-RPC
|
|
// 401s that otherwise surface in /pro's parent console. See
|
|
// src/utils/embedded-preview.ts. Not a generic iframe gate —
|
|
// enterprise white-label embeds without this marker keep
|
|
// firing premium RPCs normally.
|
|
src="https://worldmonitor.app?embed=pro-preview"
|
|
title={t('livePreview.iframeTitle')}
|
|
className="relative w-full h-full border-0"
|
|
loading="lazy"
|
|
sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox"
|
|
/>
|
|
<div className="absolute inset-0 pointer-events-none bg-gradient-to-t from-wm-bg/80 via-transparent to-transparent" />
|
|
<div className="absolute bottom-4 left-0 right-0 text-center pointer-events-auto">
|
|
<a
|
|
href="https://worldmonitor.app"
|
|
target="_blank"
|
|
rel="noreferrer"
|
|
className="inline-flex items-center gap-2 bg-wm-green text-wm-bg px-6 py-3 rounded-sm font-mono text-sm uppercase tracking-wider font-bold hover:bg-green-400 transition-colors"
|
|
>
|
|
{t('livePreview.tryLiveDashboard')} <ArrowRight className="w-4 h-4" aria-hidden="true" />
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<p className="text-center text-xs text-wm-muted font-mono mt-4">
|
|
{t('livePreview.description')}
|
|
</p>
|
|
</div>
|
|
</section>
|
|
);
|
|
|
|
/* ─── 6. Source Marquee (current) ─── */
|
|
const SourceMarquee = () => {
|
|
const sources = [
|
|
"Finnhub", "FRED", "Bloomberg", "CNBC", "Nikkei", "CoinGecko", "Polymarket",
|
|
"Reuters", "ACLED", "UCDP", "GDELT", "NASA FIRMS", "USGS", "OpenSky", "AISStream",
|
|
"Cloudflare Radar", "BGPStream", "GPSJam", "NOAA", "Copernicus", "IAEA",
|
|
"Al Jazeera", "Sky News", "Euronews", "DW News", "France 24",
|
|
"OilPrice", "Rigzone", "Maritime Executive", "Hellenic Shipping News",
|
|
"Defense One", "Jane's", "The War Zone",
|
|
"TechCrunch", "Ars Technica", "The Verge", "Wired",
|
|
"Krebs on Security", "BleepingComputer", "The Record",
|
|
];
|
|
const items = sources.join(" · ");
|
|
return (
|
|
<section className="border-y border-wm-border bg-wm-card/20 overflow-hidden py-4" aria-label="Data sources">
|
|
<div className="marquee-track whitespace-nowrap font-mono text-xs text-wm-muted uppercase tracking-widest">
|
|
<span className="inline-block px-4">{items} · </span>
|
|
<span className="inline-block px-4">{items} · </span>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
/* ─── 7. Pro Showcase + Slack Mock (current) ─── */
|
|
const ProShowcase = () => (
|
|
<section className="py-24 px-6 border-t border-wm-border bg-wm-card/30" id="pro">
|
|
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-16 items-start">
|
|
<div>
|
|
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-wm-green/30 bg-wm-green/10 text-wm-green text-xs font-mono mb-6">
|
|
{t('proShowcase.proTier')}
|
|
</div>
|
|
<h2 className="text-3xl md:text-5xl font-display font-bold mb-6">{t('proShowcase.title')}</h2>
|
|
<p className="text-wm-muted mb-8">
|
|
{t('proShowcase.subtitle')}
|
|
</p>
|
|
|
|
<div className="space-y-6">
|
|
<div className="flex gap-4">
|
|
<TrendingUp className="w-6 h-6 text-wm-green shrink-0" aria-hidden="true" />
|
|
<div>
|
|
<h3 className="font-bold mb-1">{t('proShowcase.equityResearch')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('proShowcase.equityResearchDesc')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="flex gap-4">
|
|
<Globe className="w-6 h-6 text-wm-green shrink-0" aria-hidden="true" />
|
|
<div>
|
|
<h3 className="font-bold mb-1">{t('proShowcase.geopoliticalAnalysis')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('proShowcase.geopoliticalAnalysisDesc')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="flex gap-4">
|
|
<BarChart3 className="w-6 h-6 text-wm-green shrink-0" aria-hidden="true" />
|
|
<div>
|
|
<h3 className="font-bold mb-1">{t('proShowcase.economyAnalytics')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('proShowcase.economyAnalyticsDesc')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="flex gap-4">
|
|
<ShieldAlert className="w-6 h-6 text-wm-green shrink-0" aria-hidden="true" />
|
|
<div>
|
|
<h3 className="font-bold mb-1">{t('proShowcase.riskMonitoring')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('proShowcase.riskMonitoringDesc')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="flex gap-4">
|
|
<Telescope className="w-6 h-6 text-wm-green shrink-0" aria-hidden="true" />
|
|
<div>
|
|
<h4 className="font-bold mb-1">
|
|
{t('proShowcase.orbitalSurveillance')}
|
|
<SoonBadge />
|
|
</h4>
|
|
<p className="text-sm text-wm-muted">{t('proShowcase.orbitalSurveillanceDesc').replace(/^\(Soon\)\s*/, '')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="flex gap-4">
|
|
<Clock className="w-6 h-6 text-wm-green shrink-0" aria-hidden="true" />
|
|
<div>
|
|
<h3 className="font-bold mb-1">{t('proShowcase.morningBriefs')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('proShowcase.morningBriefsDesc')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="flex gap-4">
|
|
<Key className="w-6 h-6 text-wm-green shrink-0" aria-hidden="true" />
|
|
<div>
|
|
<h3 className="font-bold mb-1">{t('proShowcase.oneKey')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('proShowcase.oneKeyDesc')}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="mt-10 pt-8 border-t border-wm-border">
|
|
<p className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-4">{t('proShowcase.deliveryLabel')}</p>
|
|
<div className="flex gap-6">
|
|
{[
|
|
{ icon: <SlackIcon />, label: "Slack" },
|
|
{ icon: <MessageSquare className="w-5 h-5" aria-hidden="true" />, label: "Discord" },
|
|
{ icon: <Send className="w-5 h-5" aria-hidden="true" />, label: "Telegram" },
|
|
{ icon: <Mail className="w-5 h-5" aria-hidden="true" />, label: "Email" },
|
|
{ icon: <Plug className="w-5 h-5" aria-hidden="true" />, label: "Webhook" },
|
|
].map((ch, i) => (
|
|
<div key={i} className="flex flex-col items-center gap-1.5 text-wm-muted hover:text-wm-text transition-colors cursor-pointer">
|
|
{ch.icon}
|
|
<span className="text-[10px] font-mono">{ch.label}</span>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="bg-[#1a1d21] rounded-lg border border-[#35373b] overflow-hidden shadow-2xl sticky top-24">
|
|
<div className="bg-[#222529] px-4 py-3 border-b border-[#35373b] flex items-center gap-3">
|
|
<div className="w-3 h-3 rounded-full bg-red-500" />
|
|
<div className="w-3 h-3 rounded-full bg-yellow-500" />
|
|
<div className="w-3 h-3 rounded-full bg-green-500" />
|
|
<span className="ml-2 font-mono text-xs text-gray-400">#world-monitor-alerts</span>
|
|
</div>
|
|
<div className="p-6 space-y-6 font-sans text-sm">
|
|
<div className="flex gap-4">
|
|
<div className="w-10 h-10 rounded bg-wm-green/20 flex items-center justify-center shrink-0">
|
|
<Globe className="w-6 h-6 text-wm-green" aria-hidden="true" />
|
|
</div>
|
|
<div>
|
|
<div className="flex items-baseline gap-2 mb-1">
|
|
<span className="font-bold text-gray-200">World Monitor</span>
|
|
<span className="text-xs text-gray-500 bg-gray-800 px-1 rounded">APP</span>
|
|
<span className="text-xs text-gray-500">8:00 AM</span>
|
|
</div>
|
|
<p className="text-gray-300 font-bold mb-3">{t('slackMock.morningBrief')} · Mar 6</p>
|
|
|
|
<div className="space-y-3">
|
|
<div className="pl-3 border-l-2 border-blue-500">
|
|
<span className="text-blue-400 font-bold text-xs uppercase tracking-wider">{t('slackMock.markets')}</span>
|
|
<p className="text-gray-300 mt-1">{t('slackMock.marketsText')}</p>
|
|
</div>
|
|
|
|
<div className="pl-3 border-l-2 border-orange-500">
|
|
<span className="text-orange-400 font-bold text-xs uppercase tracking-wider">{t('slackMock.elevated')}</span>
|
|
<p className="text-gray-300 mt-1">{t('slackMock.elevatedText')}</p>
|
|
</div>
|
|
|
|
<div className="pl-3 border-l-2 border-yellow-500">
|
|
<span className="text-yellow-400 font-bold text-xs uppercase tracking-wider">{t('slackMock.watch')}</span>
|
|
<p className="text-gray-300 mt-1">{t('slackMock.watchText')}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
|
|
/* ─── 8. Audience Personas (new — from draft) ─── */
|
|
const AudiencePersonas = () => {
|
|
const personas = [
|
|
{ icon: <LineChart className="w-6 h-6" aria-hidden="true" />, title: t('audience.investorsTitle'), desc: t('audience.investorsDesc') },
|
|
{ icon: <Fuel className="w-6 h-6" aria-hidden="true" />, title: t('audience.tradersTitle'), desc: t('audience.tradersDesc') },
|
|
{ icon: <Search className="w-6 h-6" aria-hidden="true" />, title: t('audience.researchersTitle'), desc: t('audience.researchersDesc') },
|
|
{ icon: <Globe className="w-6 h-6" aria-hidden="true" />, title: t('audience.journalistsTitle'), desc: t('audience.journalistsDesc') },
|
|
{ icon: <Landmark className="w-6 h-6" aria-hidden="true" />, title: t('audience.govTitle'), desc: t('audience.govDesc') },
|
|
{ icon: <Building2 className="w-6 h-6" aria-hidden="true" />, title: t('audience.teamsTitle'), desc: t('audience.teamsDesc') },
|
|
];
|
|
|
|
return (
|
|
<section className="py-24 px-6">
|
|
<div className="max-w-5xl mx-auto">
|
|
<h2 className="text-3xl md:text-5xl font-display font-bold mb-16 text-center">{t('audience.title')}</h2>
|
|
<div className="grid md:grid-cols-3 gap-6">
|
|
{personas.map((p, i) => (
|
|
<div key={i} className="bg-wm-card border border-wm-border p-6 hover:border-wm-green/30 transition-colors">
|
|
<div className="text-wm-green mb-4">{p.icon}</div>
|
|
<h3 className="font-bold mb-2">{p.title}</h3>
|
|
<p className="text-sm text-wm-muted">{p.desc}</p>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
/* ─── 9. API Section (current) ─── */
|
|
const ApiSection = () => (
|
|
<section className="py-24 px-6 border-y border-wm-border bg-[#0a0a0a]" id="api">
|
|
<div className="max-w-7xl mx-auto grid lg:grid-cols-2 gap-16 items-center">
|
|
<div className="order-2 lg:order-1">
|
|
<div className="bg-black border border-wm-border rounded-lg overflow-hidden font-mono text-sm">
|
|
<div className="bg-wm-card px-4 py-2 border-b border-wm-border flex items-center gap-2">
|
|
<Terminal className="w-4 h-4 text-wm-muted" aria-hidden="true" />
|
|
<span className="text-wm-muted text-xs">api.worldmonitor.app</span>
|
|
</div>
|
|
<div className="p-6 text-gray-300 overflow-x-auto">
|
|
<pre><code>
|
|
<span className="text-wm-blue">curl</span> \<br/>
|
|
<span className="text-wm-green">"https://api.worldmonitor.app/v1/intelligence/convergence?region=MENA&time_window=6h"</span> \<br/>
|
|
-H <span className="text-wm-green">"Authorization: Bearer wm_live_xxx"</span><br/><br/>
|
|
<span className="text-wm-muted">{"{"}</span><br/>
|
|
<span className="text-wm-blue">"status"</span>: <span className="text-wm-green">"success"</span>,<br/>
|
|
<span className="text-wm-blue">"data"</span>: <span className="text-wm-muted">{"["}</span><br/>
|
|
<span className="text-wm-muted">{"{"}</span><br/>
|
|
<span className="text-wm-blue">"type"</span>: <span className="text-wm-green">"multi_signal_convergence"</span>,<br/>
|
|
<span className="text-wm-blue">"signals"</span>: <span className="text-wm-muted">["military_flights", "ais_dark_ships", "oref_sirens"]</span>,<br/>
|
|
<span className="text-wm-blue">"confidence"</span>: <span className="text-orange-400">0.92</span>,<br/>
|
|
<span className="text-wm-blue">"location"</span>: <span className="text-wm-muted">{"{"}</span> <span className="text-wm-blue">"lat"</span>: <span className="text-orange-400">34.05</span>, <span className="text-wm-blue">"lng"</span>: <span className="text-orange-400">35.12</span> <span className="text-wm-muted">{"}"}</span><br/>
|
|
<span className="text-wm-muted">{"}"}</span><br/>
|
|
<span className="text-wm-muted">{"]"}</span><br/>
|
|
<span className="text-wm-muted">{"}"}</span>
|
|
</code></pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="order-1 lg:order-2">
|
|
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-wm-border bg-wm-card text-wm-muted text-xs font-mono mb-6">
|
|
{t('apiSection.apiTier')}
|
|
</div>
|
|
<h2 className="text-3xl md:text-5xl font-display font-bold mb-6">{t('apiSection.title')}</h2>
|
|
<p className="text-wm-muted mb-8">
|
|
{t('apiSection.subtitle')}
|
|
</p>
|
|
<ul className="space-y-4 mb-8">
|
|
<li className="flex items-start gap-3">
|
|
<Server className="w-5 h-5 text-wm-muted shrink-0" aria-hidden="true" />
|
|
<span className="text-sm">{t('apiSection.restApi')}</span>
|
|
</li>
|
|
<li className="flex items-start gap-3">
|
|
<Lock className="w-5 h-5 text-wm-muted shrink-0" aria-hidden="true" />
|
|
<span className="text-sm">{t('apiSection.authenticated')}</span>
|
|
</li>
|
|
<li className="flex items-start gap-3">
|
|
<Database className="w-5 h-5 text-wm-muted shrink-0" aria-hidden="true" />
|
|
<span className="text-sm">{t('apiSection.structured')}</span>
|
|
</li>
|
|
</ul>
|
|
|
|
<div className="grid grid-cols-2 gap-4 mb-8 p-4 bg-wm-card border border-wm-border rounded-sm">
|
|
<div>
|
|
<p className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('apiSection.starter')}</p>
|
|
<p className="text-sm font-bold">{t('apiSection.starterReqs')}</p>
|
|
<p className="text-xs text-wm-muted">{t('apiSection.starterWebhooks')}</p>
|
|
</div>
|
|
<div>
|
|
<p className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('apiSection.business')}</p>
|
|
<p className="text-sm font-bold">{t('apiSection.businessReqs')}</p>
|
|
<p className="text-xs text-wm-muted">{t('apiSection.businessWebhooks')}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<p className="text-sm text-wm-muted border-l-2 border-wm-border pl-4">
|
|
{t('apiSection.feedData')}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
|
|
/* ─── 10. Enterprise Showcase (current + enriched CTA) ─── */
|
|
const EnterpriseShowcase = () => (
|
|
<section className="py-24 px-6" id="enterprise">
|
|
<div className="max-w-7xl mx-auto">
|
|
<div className="text-center mb-16">
|
|
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-wm-border bg-wm-card text-wm-muted text-xs font-mono mb-6">
|
|
{t('enterpriseShowcase.enterpriseTier')}
|
|
</div>
|
|
<h2 className="text-3xl md:text-5xl font-display font-bold mb-6">{t('enterpriseShowcase.title')}</h2>
|
|
<p className="text-wm-muted max-w-2xl mx-auto">
|
|
{t('enterpriseShowcase.subtitle')}
|
|
</p>
|
|
</div>
|
|
|
|
<div className="grid md:grid-cols-3 gap-6 mb-6">
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<ShieldAlert className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.security')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.securityDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<Cpu className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.aiAgents')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.aiAgentsDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<Layers className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.dataLayers')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.dataLayersDesc')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="grid md:grid-cols-3 gap-6 mb-12">
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<Plug className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.connectors')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.connectorsDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<PanelTop className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.whiteLabel')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.whiteLabelDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<BarChart3 className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.financial')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.financialDesc')}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="data-grid mb-12">
|
|
<div className="data-cell">
|
|
<h4 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.commodity')}</h4>
|
|
<p className="text-sm">{t('enterpriseShowcase.commodityDesc')}</p>
|
|
</div>
|
|
<div className="data-cell">
|
|
<h4 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.government')}</h4>
|
|
<p className="text-sm">{t('enterpriseShowcase.governmentDesc')}</p>
|
|
</div>
|
|
<div className="data-cell">
|
|
<h4 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.risk')}</h4>
|
|
<p className="text-sm">{t('enterpriseShowcase.riskDesc')}</p>
|
|
</div>
|
|
<div className="data-cell">
|
|
<h4 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.soc')}</h4>
|
|
<p className="text-sm">{t('enterpriseShowcase.socDesc')}</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div className="text-center mt-12">
|
|
<a
|
|
href="#enterprise-contact"
|
|
aria-label="Talk to sales about Enterprise plans"
|
|
className="inline-flex items-center gap-2 bg-wm-green text-wm-bg px-8 py-3 rounded-sm font-mono text-sm uppercase tracking-wider font-bold hover:bg-green-400 transition-colors"
|
|
>
|
|
{t('enterpriseShowcase.talkToSales')} <ArrowRight className="w-4 h-4" aria-hidden="true" />
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
);
|
|
|
|
/* ─── 11. Comparison Table (simplified columns, kept technical rows) ─── */
|
|
const PricingTable = () => {
|
|
const rows = [
|
|
{ feature: t('pricingTable.dataRefresh'), free: t('pricingTable.f5_15min'), pro: t('pricingTable.fLt60s'), api: t('pricingTable.fPerRequest'), ent: t('pricingTable.fLiveEdge') },
|
|
{ feature: t('pricingTable.dashboard'), free: t('pricingTable.f50panels'), pro: t('pricingTable.f50panels'), api: "\u2014", ent: t('pricingTable.fWhiteLabel') },
|
|
{ feature: t('pricingTable.ai'), free: t('pricingTable.fBYOK'), pro: t('pricingTable.fIncluded'), api: "\u2014", ent: t('pricingTable.fAgentsPersonas') },
|
|
{ feature: t('pricingTable.briefsAlerts'), free: "\u2014", pro: t('pricingTable.fDailyFlash'), api: "\u2014", ent: t('pricingTable.fTeamDist') },
|
|
{ feature: t('pricingTable.delivery'), free: "\u2014", pro: t('pricingTable.fSlackTgWa'), api: t('pricingTable.fWebhook'), ent: t('pricingTable.fSiemMcp') },
|
|
{ feature: t('pricingTable.apiRow'), free: "\u2014", pro: "\u2014", api: t('pricingTable.fRestWebhook'), ent: t('pricingTable.fMcpBulk') },
|
|
{ feature: t('pricingTable.infraLayers'), free: t('pricingTable.f45'), pro: t('pricingTable.f45'), api: "\u2014", ent: t('pricingTable.fTensOfThousands') },
|
|
{ feature: t('pricingTable.satellite'), free: t('pricingTable.fLiveTracking'), pro: t('pricingTable.fPassAlerts'), api: "\u2014", ent: t('pricingTable.fImagerySar') },
|
|
{ feature: t('pricingTable.connectorsRow'), free: "\u2014", pro: "\u2014", api: "\u2014", ent: t('pricingTable.f100plus') },
|
|
{ feature: t('pricingTable.deployment'), free: t('pricingTable.fCloud'), pro: t('pricingTable.fCloud'), api: t('pricingTable.fCloud'), ent: t('pricingTable.fCloudOnPrem') },
|
|
{ feature: t('pricingTable.securityRow'), free: t('pricingTable.fStandard'), pro: t('pricingTable.fStandard'), api: t('pricingTable.fKeyAuth'), ent: t('pricingTable.fSsoMfa') },
|
|
];
|
|
|
|
return (
|
|
<section className="py-24 px-6 max-w-7xl mx-auto">
|
|
<div className="text-center mb-16">
|
|
<h2 className="text-3xl md:text-5xl font-display font-bold mb-6">{t('pricingTable.title')}</h2>
|
|
</div>
|
|
<div className="hidden md:block">
|
|
<div className="grid grid-cols-5 gap-4 mb-4 pb-4 border-b border-wm-border font-mono text-xs uppercase tracking-widest text-wm-muted">
|
|
<div>{t('pricingTable.feature')}</div>
|
|
<div>{t('pricingTable.freeHeader')}</div>
|
|
<div className="text-wm-green">{t('pricingTable.proHeader')}</div>
|
|
<div>{t('pricingTable.apiHeader')}</div>
|
|
<div>{t('pricingTable.entHeader')}</div>
|
|
</div>
|
|
{rows.map((row, i) => (
|
|
<div key={i} className="grid grid-cols-5 gap-4 py-4 border-b border-wm-border/50 text-sm hover:bg-wm-card/50 transition-colors">
|
|
<div className="font-medium">{row.feature}</div>
|
|
<div className="text-wm-muted">{row.free}</div>
|
|
<div className="text-wm-green">{row.pro}</div>
|
|
<div className="text-wm-muted">{row.api}</div>
|
|
<div className="text-wm-muted">{row.ent}</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
<div className="md:hidden space-y-4">
|
|
{rows.map((row, i) => (
|
|
<div key={i} className="bg-wm-card border border-wm-border p-4 rounded-sm">
|
|
<p className="font-medium text-sm mb-3">{row.feature}</p>
|
|
<div className="grid grid-cols-2 gap-2 text-xs">
|
|
<div><span className="text-wm-muted">{t('tiers.free')}:</span> {row.free}</div>
|
|
<div><span className="text-wm-green">{t('tiers.pro')}:</span> <span className="text-wm-green">{row.pro}</span></div>
|
|
<div><span className="text-wm-muted">{t('nav.api')}:</span> {row.api}</div>
|
|
<div><span className="text-wm-muted">{t('tiers.enterprise')}:</span> {row.ent}</div>
|
|
</div>
|
|
</div>
|
|
))}
|
|
</div>
|
|
<p className="text-center text-sm text-wm-muted mt-8">
|
|
{t('pricingTable.noteBelow')}
|
|
</p>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
/* ─── 12. FAQ (draft copy — warmer tone) ─── */
|
|
const FAQ = () => {
|
|
const faqs = [
|
|
{ q: t('faq.q1'), a: t('faq.a1'), open: true },
|
|
{ q: t('faq.q2'), a: t('faq.a2') },
|
|
{ q: t('faq.q3'), a: t('faq.a3') },
|
|
{ q: t('faq.q4'), a: t('faq.a4') },
|
|
{ q: t('faq.q5'), a: t('faq.a5') },
|
|
{ q: t('faq.q6'), a: t('faq.a6') },
|
|
{ q: t('faq.q7'), a: t('faq.a7') },
|
|
{ q: t('faq.q8'), a: t('faq.a8') },
|
|
{ q: t('faq.q9'), a: t('faq.a9') },
|
|
{ q: t('faq.q10'), a: t('faq.a10') },
|
|
{ q: t('faq.q11'), a: t('faq.a11') },
|
|
{ q: t('faq.q12'), a: t('faq.a12') },
|
|
{ q: t('faq.q13'), a: t('faq.a13') },
|
|
];
|
|
|
|
return (
|
|
<section className="py-24 px-6 max-w-3xl mx-auto">
|
|
<h2 className="text-3xl font-display font-bold mb-12 text-center">{t('faq.title')}</h2>
|
|
<div className="space-y-4">
|
|
{faqs.map((faq, i) => (
|
|
<details key={i} open={faq.open} className="group bg-wm-card border border-wm-border rounded-sm [&_summary::-webkit-details-marker]:hidden">
|
|
<summary className="flex items-center justify-between p-6 cursor-pointer font-medium">
|
|
{faq.q}
|
|
<ChevronDown className="w-5 h-5 text-wm-muted group-open:rotate-180 transition-transform" aria-hidden="true" />
|
|
</summary>
|
|
<div className="px-6 pb-6 text-wm-muted text-sm border-t border-wm-border pt-4 mt-2">
|
|
{faq.a}
|
|
</div>
|
|
</details>
|
|
))}
|
|
</div>
|
|
</section>
|
|
);
|
|
};
|
|
|
|
/* ─── 13. Footer ─── */
|
|
const Footer = () => (
|
|
<footer className="border-t border-wm-border bg-[#020202] pt-8 pb-12 px-6 text-center">
|
|
<div className="flex flex-col md:flex-row items-center justify-between max-w-7xl mx-auto text-xs text-wm-muted font-mono">
|
|
<div className="flex items-center gap-3 mb-4 md:mb-0">
|
|
<img src="/favico/favicon-32x32.png" alt="" width="28" height="28" className="rounded-full" />
|
|
<div className="flex flex-col">
|
|
<span className="font-display font-bold text-sm leading-none tracking-tight text-wm-text">WORLD MONITOR</span>
|
|
<span className="text-[9px] uppercase tracking-[2px] opacity-60 mt-0.5">by Someone.ceo</span>
|
|
</div>
|
|
</div>
|
|
<div className="flex items-center gap-6">
|
|
<a href="/" className="hover:text-wm-text transition-colors">Dashboard</a>
|
|
<a href="https://www.worldmonitor.app/blog/" className="hover:text-wm-text transition-colors">Blog</a>
|
|
<a href="https://www.worldmonitor.app/docs" className="hover:text-wm-text transition-colors">Docs</a>
|
|
<a href="https://status.worldmonitor.app/" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">Status</a>
|
|
<a href="https://github.com/koala73/worldmonitor" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">GitHub</a>
|
|
<a href="https://discord.gg/re63kWKxaz" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">Discord</a>
|
|
<a href="https://x.com/worldmonitorai" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">X</a>
|
|
</div>
|
|
<span className="text-[10px] opacity-40 mt-4 md:mt-0">© {new Date().getFullYear()} WorldMonitor</span>
|
|
</div>
|
|
</footer>
|
|
);
|
|
|
|
/* ─── Enterprise Page (dedicated /pro/#enterprise) ─── */
|
|
const EnterprisePage = () => (
|
|
<div className="min-h-screen selection:bg-wm-green/30 selection:text-wm-green">
|
|
<nav className="fixed top-0 left-0 right-0 z-50 glass-panel border-b-0 border-x-0 rounded-none" aria-label="Main navigation">
|
|
<div className="max-w-7xl mx-auto px-6 h-16 flex items-center justify-between">
|
|
<a href="#" onClick={(e) => { e.preventDefault(); window.location.hash = ''; }}><Logo /></a>
|
|
<div className="hidden md:flex items-center gap-8 text-sm font-mono text-wm-muted">
|
|
<a href="#" onClick={(e) => { e.preventDefault(); window.location.hash = ''; }} className="hover:text-wm-text transition-colors">{t('nav.pro')}</a>
|
|
<a href="#enterprise" onClick={(e) => { e.preventDefault(); document.getElementById('features')?.scrollIntoView({ behavior: 'smooth' }); }} className="hover:text-wm-text transition-colors">{t('nav.enterprise')}</a>
|
|
<a href="#enterprise-contact" onClick={(e) => { e.preventDefault(); document.getElementById('contact')?.scrollIntoView({ behavior: 'smooth' }); }} className="hover:text-wm-green transition-colors">{t('enterpriseShowcase.talkToSales')}</a>
|
|
</div>
|
|
<a href="#enterprise-contact" onClick={(e) => { e.preventDefault(); document.getElementById('contact')?.scrollIntoView({ behavior: 'smooth' }); }} className="bg-wm-green text-wm-bg px-4 py-2 rounded-sm font-mono text-xs uppercase tracking-wider font-bold hover:bg-green-400 transition-colors">
|
|
{t('enterpriseShowcase.talkToSales')}
|
|
</a>
|
|
</div>
|
|
</nav>
|
|
|
|
<main className="pt-24">
|
|
{/* Hero */}
|
|
<section className="py-24 px-6 text-center">
|
|
<div className="max-w-4xl mx-auto">
|
|
<div className="inline-flex items-center gap-2 px-3 py-1 rounded-full border border-wm-border bg-wm-card text-wm-muted text-xs font-mono mb-6">
|
|
{t('enterpriseShowcase.enterpriseTier')}
|
|
</div>
|
|
<h2 className="text-4xl md:text-6xl font-display font-bold mb-6">{t('enterpriseShowcase.title')}</h2>
|
|
<p className="text-lg text-wm-muted max-w-2xl mx-auto mb-10">
|
|
{t('enterpriseShowcase.subtitle')}
|
|
</p>
|
|
<a href="#enterprise-contact" onClick={(e) => { e.preventDefault(); document.getElementById('contact')?.scrollIntoView({ behavior: 'smooth' }); }} className="inline-flex items-center gap-2 bg-wm-green text-wm-bg px-8 py-3 rounded-sm font-mono text-sm uppercase tracking-wider font-bold hover:bg-green-400 transition-colors">
|
|
{t('enterpriseShowcase.talkToSales')} <ArrowRight className="w-4 h-4" aria-hidden="true" />
|
|
</a>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Features grid */}
|
|
<section className="py-24 px-6" id="features">
|
|
<div className="max-w-7xl mx-auto">
|
|
<h2 className="sr-only">Enterprise Features</h2>
|
|
<div className="grid md:grid-cols-3 gap-6 mb-6">
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<ShieldAlert className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.security')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.securityDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<Cpu className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.aiAgents')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.aiAgentsDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<Layers className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.dataLayers')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.dataLayersDesc')}</p>
|
|
</div>
|
|
</div>
|
|
<div className="grid md:grid-cols-3 gap-6 mb-12">
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<Plug className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.connectors')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.connectorsDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<PanelTop className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.whiteLabel')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.whiteLabelDesc')}</p>
|
|
</div>
|
|
<div className="bg-wm-card border border-wm-border p-6">
|
|
<BarChart3 className="w-8 h-8 text-wm-muted mb-4" aria-hidden="true" />
|
|
<h3 className="font-bold mb-2">{t('enterpriseShowcase.financial')}</h3>
|
|
<p className="text-sm text-wm-muted">{t('enterpriseShowcase.financialDesc')}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Use cases */}
|
|
<section className="py-24 px-6 border-t border-wm-border">
|
|
<div className="max-w-7xl mx-auto">
|
|
<h2 className="text-3xl font-display font-bold mb-12 text-center">{t('enterpriseShowcase.title')}</h2>
|
|
<div className="data-grid">
|
|
<div className="data-cell">
|
|
<h3 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.commodity')}</h3>
|
|
<p className="text-sm">{t('enterpriseShowcase.commodityDesc')}</p>
|
|
</div>
|
|
<div className="data-cell">
|
|
<h3 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.government')}</h3>
|
|
<p className="text-sm">{t('enterpriseShowcase.governmentDesc')}</p>
|
|
</div>
|
|
<div className="data-cell">
|
|
<h3 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.risk')}</h3>
|
|
<p className="text-sm">{t('enterpriseShowcase.riskDesc')}</p>
|
|
</div>
|
|
<div className="data-cell">
|
|
<h3 className="font-mono text-xs text-wm-muted uppercase tracking-widest mb-2">{t('enterpriseShowcase.soc')}</h3>
|
|
<p className="text-sm">{t('enterpriseShowcase.socDesc')}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
{/* Contact form */}
|
|
<section className="py-24 px-6 border-t border-wm-border" id="contact">
|
|
<div className="max-w-xl mx-auto">
|
|
<h2 className="font-display text-3xl font-bold mb-2 text-center">{t('enterpriseShowcase.contactFormTitle')}</h2>
|
|
<p className="text-sm text-wm-muted mb-10 text-center">{t('enterpriseShowcase.contactFormSubtitle')}</p>
|
|
<form className="space-y-4" onSubmit={async (e) => {
|
|
e.preventDefault();
|
|
const form = e.currentTarget;
|
|
const btn = form.querySelector('button[type="submit"]') as HTMLButtonElement;
|
|
const origText = btn.textContent;
|
|
btn.disabled = true;
|
|
btn.textContent = t('enterpriseShowcase.contactSending');
|
|
const fd = new FormData(form);
|
|
const honeypot = (form.querySelector('input[name="website"]') as HTMLInputElement)?.value || '';
|
|
const turnstileWidget = form.querySelector('.cf-turnstile') as HTMLElement | null;
|
|
const turnstileToken = turnstileWidget?.dataset.token || '';
|
|
try {
|
|
const res = await fetch(`${API_BASE}/leads/v1/submit-contact`, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
email: fd.get('email'),
|
|
name: fd.get('name'),
|
|
organization: fd.get('organization'),
|
|
phone: fd.get('phone'),
|
|
message: fd.get('message'),
|
|
source: 'enterprise-contact',
|
|
website: honeypot,
|
|
turnstileToken,
|
|
}),
|
|
});
|
|
const errorEl = form.querySelector('[data-form-error]') as HTMLElement | null;
|
|
if (!res.ok) {
|
|
const data = await res.json().catch(() => ({}));
|
|
if (res.status === 422 && errorEl) {
|
|
errorEl.textContent = data.message || data.error || t('enterpriseShowcase.workEmailRequired');
|
|
errorEl.classList.remove('hidden');
|
|
btn.textContent = origText;
|
|
btn.disabled = false;
|
|
return;
|
|
}
|
|
throw new Error();
|
|
}
|
|
if (errorEl) errorEl.classList.add('hidden');
|
|
btn.textContent = t('enterpriseShowcase.contactSent');
|
|
btn.className = btn.className.replace('bg-wm-green', 'bg-wm-card border border-wm-green text-wm-green');
|
|
} catch {
|
|
btn.textContent = t('enterpriseShowcase.contactFailed');
|
|
btn.disabled = false;
|
|
if (turnstileWidget?.dataset.widgetId && window.turnstile) {
|
|
window.turnstile.reset(turnstileWidget.dataset.widgetId);
|
|
delete turnstileWidget.dataset.token;
|
|
}
|
|
setTimeout(() => { btn.textContent = origText; }, 4000);
|
|
}
|
|
}}>
|
|
<input type="text" name="website" autoComplete="off" tabIndex={-1} aria-hidden="true" className="absolute opacity-0 h-0 w-0 pointer-events-none" />
|
|
<div className="grid grid-cols-2 gap-4">
|
|
<input type="text" name="name" placeholder={t('enterpriseShowcase.namePlaceholder')} required className="bg-wm-bg border border-wm-border rounded-sm px-4 py-3 text-sm focus:outline-none focus:border-wm-green transition-colors font-mono" />
|
|
<input type="email" name="email" placeholder={t('enterpriseShowcase.emailPlaceholder')} required className="bg-wm-bg border border-wm-border rounded-sm px-4 py-3 text-sm focus:outline-none focus:border-wm-green transition-colors font-mono" />
|
|
</div>
|
|
<span data-form-error className="hidden text-red-400 text-xs font-mono block" />
|
|
<div className="grid grid-cols-2 gap-4">
|
|
<input type="text" name="organization" placeholder={t('enterpriseShowcase.orgPlaceholder')} required className="bg-wm-bg border border-wm-border rounded-sm px-4 py-3 text-sm focus:outline-none focus:border-wm-green transition-colors font-mono" />
|
|
<input type="tel" name="phone" placeholder={t('enterpriseShowcase.phonePlaceholder')} required className="bg-wm-bg border border-wm-border rounded-sm px-4 py-3 text-sm focus:outline-none focus:border-wm-green transition-colors font-mono" />
|
|
</div>
|
|
<textarea name="message" placeholder={t('enterpriseShowcase.messagePlaceholder')} rows={4} className="w-full bg-wm-bg border border-wm-border rounded-sm px-4 py-3 text-sm focus:outline-none focus:border-wm-green transition-colors font-mono resize-none" />
|
|
<div className="cf-turnstile mx-auto" />
|
|
<button type="submit" className="w-full bg-wm-green text-wm-bg py-3 rounded-sm font-mono text-sm uppercase tracking-wider font-bold hover:bg-green-400 transition-colors">
|
|
{t('enterpriseShowcase.submitContact')}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</section>
|
|
</main>
|
|
|
|
{/* Footer */}
|
|
<footer className="border-t border-wm-border bg-[#020202] py-8 px-6 text-center">
|
|
<div className="flex flex-col md:flex-row items-center justify-between max-w-7xl mx-auto text-xs text-wm-muted font-mono">
|
|
<div className="flex items-center gap-3 mb-4 md:mb-0">
|
|
<img src="/favico/favicon-32x32.png" alt="" width="28" height="28" className="rounded-full" />
|
|
<div className="flex flex-col">
|
|
<span className="font-display font-bold text-sm leading-none tracking-tight text-wm-text">WORLD MONITOR</span>
|
|
<span className="text-[9px] uppercase tracking-[2px] opacity-60 mt-0.5">by Someone.ceo</span>
|
|
</div>
|
|
</div>
|
|
<div className="flex items-center gap-6">
|
|
<a href="/" className="hover:text-wm-text transition-colors">Dashboard</a>
|
|
<a href="https://www.worldmonitor.app/blog/" className="hover:text-wm-text transition-colors">Blog</a>
|
|
<a href="https://www.worldmonitor.app/docs" className="hover:text-wm-text transition-colors">Docs</a>
|
|
<a href="https://status.worldmonitor.app/" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">Status</a>
|
|
<a href="https://github.com/koala73/worldmonitor" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">GitHub</a>
|
|
<a href="https://discord.gg/re63kWKxaz" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">Discord</a>
|
|
<a href="https://x.com/worldmonitorai" target="_blank" rel="noreferrer" className="hover:text-wm-text transition-colors">X</a>
|
|
</div>
|
|
<span className="text-[10px] opacity-40 mt-4 md:mt-0">© {new Date().getFullYear()} WorldMonitor</span>
|
|
</div>
|
|
</footer>
|
|
</div>
|
|
);
|
|
|
|
/* ─── Page Layout ─── */
|
|
export default function App() {
|
|
const [page, setPage] = useState(() => window.location.hash.startsWith('#enterprise') ? 'enterprise' : 'home');
|
|
|
|
// Initialize Dodo checkout overlay with success handler
|
|
useEffect(() => {
|
|
initOverlay(() => {
|
|
// Show success banner
|
|
const banner = document.createElement('div');
|
|
Object.assign(banner.style, {
|
|
position: 'fixed', top: '0', left: '0', right: '0', zIndex: '99999',
|
|
padding: '14px 20px', background: 'linear-gradient(135deg, #16a34a, #22c55e)',
|
|
color: '#fff', fontWeight: '600', fontSize: '14px', textAlign: 'center',
|
|
boxShadow: '0 2px 12px rgba(0,0,0,0.3)', transition: 'opacity 0.4s ease, transform 0.4s ease',
|
|
transform: 'translateY(-100%)', opacity: '0',
|
|
});
|
|
banner.textContent = 'Payment received! Unlocking your premium features...';
|
|
document.body.appendChild(banner);
|
|
requestAnimationFrame(() => { banner.style.transform = 'translateY(0)'; banner.style.opacity = '1'; });
|
|
setTimeout(() => { window.location.href = 'https://worldmonitor.app'; }, 3000);
|
|
});
|
|
}, []);
|
|
|
|
useEffect(() => {
|
|
const onHash = () => {
|
|
const hash = window.location.hash;
|
|
const next = hash.startsWith('#enterprise') ? 'enterprise' : 'home';
|
|
const wasEnterprise = page === 'enterprise';
|
|
setPage(next);
|
|
if (next === 'enterprise' && !wasEnterprise) window.scrollTo(0, 0);
|
|
if (hash === '#enterprise-contact') {
|
|
setTimeout(() => {
|
|
document.getElementById('contact')?.scrollIntoView({ behavior: 'smooth' });
|
|
}, wasEnterprise ? 0 : 100);
|
|
}
|
|
};
|
|
window.addEventListener('hashchange', onHash);
|
|
return () => window.removeEventListener('hashchange', onHash);
|
|
}, [page]);
|
|
|
|
useEffect(() => {
|
|
if (page === 'enterprise' && window.location.hash === '#enterprise-contact') {
|
|
setTimeout(() => {
|
|
document.getElementById('contact')?.scrollIntoView({ behavior: 'smooth' });
|
|
}, 100);
|
|
}
|
|
}, []);
|
|
|
|
if (page === 'enterprise') return <EnterprisePage />;
|
|
|
|
return (
|
|
<div className="min-h-screen selection:bg-wm-green/30 selection:text-wm-green">
|
|
<Navbar />
|
|
<main>
|
|
<Hero />
|
|
<SourceMarquee />
|
|
<Pillars />
|
|
<WhyUpgrade />
|
|
<TwoPathSplit />
|
|
<ProShowcase />
|
|
<DeliveryDesk />
|
|
<AudiencePersonas />
|
|
<SocialProof />
|
|
<LivePreview />
|
|
<PricingSection refCode={getRefCode()} />
|
|
<PricingTable />
|
|
<ApiSection />
|
|
<EnterpriseShowcase />
|
|
<FAQ />
|
|
</main>
|
|
<Footer />
|
|
</div>
|
|
);
|
|
}
|