@burdenoff/website-sdk 2026.521.2 → 2026.521.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1122 @@
1
+ import * as React from 'react';
2
+ import { createContext, useState, useEffect, useContext, useRef } from 'react';
3
+ import { Mail, Phone, MapPin, Clock, Send, FileText, Download } from 'lucide-react';
4
+ import ReCAPTCHA from 'react-google-recaptcha';
5
+ import { toast } from 'sonner';
6
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
7
+ import { Helmet } from 'react-helmet-async';
8
+ import { Slot } from '@radix-ui/react-slot';
9
+ import { cva } from 'class-variance-authority';
10
+ import { clsx } from 'clsx';
11
+ import { twMerge } from 'tailwind-merge';
12
+ import * as LabelPrimitive from '@radix-ui/react-label';
13
+
14
+ var __defProp = Object.defineProperty;
15
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
17
+
18
+ // src/client/security.ts
19
+ var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1"]);
20
+ var RESERVED_HEADERS = /* @__PURE__ */ new Set([
21
+ "authorization",
22
+ "cookie",
23
+ "x-actor-id",
24
+ "x-actor-type",
25
+ "x-consent-granted-by",
26
+ "x-consent-scope",
27
+ "x-consent-granted-at",
28
+ "x-consent-expires-at"
29
+ ]);
30
+ function validateGatewayUrl(value) {
31
+ let url;
32
+ try {
33
+ url = new URL(value);
34
+ } catch {
35
+ throw new Error("Gateway URL must be a valid absolute URL");
36
+ }
37
+ if (url.protocol === "https:") {
38
+ return url.toString();
39
+ }
40
+ if (url.protocol === "http:" && LOOPBACK_HOSTS.has(url.hostname.toLowerCase())) {
41
+ return url.toString();
42
+ }
43
+ throw new Error("Gateway URL must use HTTPS unless it targets localhost");
44
+ }
45
+ function sanitizeHeaders(headers) {
46
+ if (!headers) return void 0;
47
+ return Object.fromEntries(
48
+ Object.entries(headers).filter(
49
+ ([key]) => !RESERVED_HEADERS.has(key.toLowerCase())
50
+ )
51
+ );
52
+ }
53
+
54
+ // src/client/graphql-client.ts
55
+ var _WebSDKClient = class _WebSDKClient {
56
+ constructor(config) {
57
+ __publicField(this, "config");
58
+ __publicField(this, "queryCache", /* @__PURE__ */ new Map());
59
+ __publicField(this, "inflight", /* @__PURE__ */ new Map());
60
+ this.config = {
61
+ ...config,
62
+ gatewayUrl: validateGatewayUrl(config.gatewayUrl),
63
+ headers: sanitizeHeaders(config.headers)
64
+ };
65
+ }
66
+ getConfig() {
67
+ return this.config;
68
+ }
69
+ /**
70
+ * Execute a GraphQL query (with deduplication and caching)
71
+ */
72
+ async query(query, variables) {
73
+ const cacheKey = JSON.stringify({ query, variables });
74
+ const cached = this.queryCache.get(cacheKey);
75
+ if (cached) {
76
+ if (Date.now() - cached.ts < _WebSDKClient.CACHE_TTL) {
77
+ return cached.data;
78
+ }
79
+ this.queryCache.delete(cacheKey);
80
+ }
81
+ const existing = this.inflight.get(cacheKey);
82
+ if (existing) {
83
+ return existing;
84
+ }
85
+ const promise = this.request(query, variables).then((result) => {
86
+ if (result.data && !result.errors?.length) {
87
+ if (this.queryCache.size >= _WebSDKClient.MAX_CACHE_ENTRIES) {
88
+ const oldestEntry = this.queryCache.keys().next().value;
89
+ if (oldestEntry) {
90
+ this.queryCache.delete(oldestEntry);
91
+ }
92
+ }
93
+ this.queryCache.set(cacheKey, { data: result, ts: Date.now() });
94
+ }
95
+ return result;
96
+ }).finally(() => {
97
+ this.inflight.delete(cacheKey);
98
+ });
99
+ this.inflight.set(cacheKey, promise);
100
+ return promise;
101
+ }
102
+ /**
103
+ * Execute a GraphQL mutation
104
+ */
105
+ async mutate(mutation, variables) {
106
+ return this.request(mutation, variables);
107
+ }
108
+ async request(query, variables) {
109
+ try {
110
+ const response = await fetch(this.config.gatewayUrl, {
111
+ method: "POST",
112
+ headers: {
113
+ "Content-Type": "application/json",
114
+ "x-product-id": this.config.productId,
115
+ ...this.config.headers
116
+ },
117
+ body: JSON.stringify({ query, variables })
118
+ });
119
+ if (!response.ok) {
120
+ console.error(
121
+ "[WebSDK] GraphQL request failed",
122
+ response.status,
123
+ response.statusText
124
+ );
125
+ return {
126
+ errors: [
127
+ {
128
+ message: `HTTP ${response.status}: ${response.statusText}`,
129
+ extensions: { code: `HTTP_${response.status}` }
130
+ }
131
+ ]
132
+ };
133
+ }
134
+ return await response.json();
135
+ } catch (error) {
136
+ console.error(
137
+ "[WebSDK] Network error",
138
+ error instanceof Error ? error.message : "unknown error"
139
+ );
140
+ return {
141
+ errors: [
142
+ {
143
+ message: error instanceof Error ? error.message : "Network error",
144
+ extensions: { code: "NETWORK_ERROR" }
145
+ }
146
+ ]
147
+ };
148
+ }
149
+ }
150
+ };
151
+ __publicField(_WebSDKClient, "CACHE_TTL", 5 * 60 * 1e3);
152
+ // 5 minutes
153
+ __publicField(_WebSDKClient, "MAX_CACHE_ENTRIES", 100);
154
+ var WebSDKContext = createContext(null);
155
+ function useWebSDK() {
156
+ const client = useContext(WebSDKContext);
157
+ if (!client) {
158
+ throw new Error("useWebSDK must be used within a WebSDKProvider");
159
+ }
160
+ return client;
161
+ }
162
+ function useWebSDKConfig() {
163
+ const client = useWebSDK();
164
+ return client.getConfig();
165
+ }
166
+ var ProductContext = createContext({
167
+ product: null,
168
+ loading: true,
169
+ error: null,
170
+ hasProvider: false,
171
+ refetch: () => {
172
+ }
173
+ });
174
+ function useProduct() {
175
+ return useContext(ProductContext);
176
+ }
177
+ function PageHead({
178
+ title,
179
+ description,
180
+ productName,
181
+ keywords,
182
+ image,
183
+ url,
184
+ favicon,
185
+ robots = "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1",
186
+ locale = "en_US",
187
+ twitterHandle,
188
+ themeColor = "#000000",
189
+ structuredData,
190
+ additionalMeta
191
+ }) {
192
+ const fullTitle = productName && !title.includes(productName) ? `${title} | ${productName}` : title;
193
+ const fullImageUrl = image && !image.startsWith("http") && url ? `${url.replace(/\/$/, "")}${image}` : image;
194
+ const structuredDataItems = structuredData ? Array.isArray(structuredData) ? structuredData : [structuredData] : [];
195
+ return /* @__PURE__ */ jsxs(Helmet, { children: [
196
+ /* @__PURE__ */ jsx("title", { children: fullTitle }),
197
+ /* @__PURE__ */ jsx("meta", { name: "title", content: fullTitle }),
198
+ description && /* @__PURE__ */ jsx("meta", { name: "description", content: description }),
199
+ keywords && /* @__PURE__ */ jsx("meta", { name: "keywords", content: keywords }),
200
+ /* @__PURE__ */ jsx("meta", { name: "author", content: "Burdenoff Consultancy Services Pvt Ltd" }),
201
+ /* @__PURE__ */ jsx("meta", { name: "robots", content: robots }),
202
+ url && /* @__PURE__ */ jsx("link", { rel: "canonical", href: url }),
203
+ favicon && /* @__PURE__ */ jsx("link", { rel: "icon", href: favicon }),
204
+ /* @__PURE__ */ jsx("meta", { property: "og:type", content: "website" }),
205
+ /* @__PURE__ */ jsx("meta", { property: "og:title", content: fullTitle }),
206
+ description && /* @__PURE__ */ jsx("meta", { property: "og:description", content: description }),
207
+ fullImageUrl && /* @__PURE__ */ jsx("meta", { property: "og:image", content: fullImageUrl }),
208
+ url && /* @__PURE__ */ jsx("meta", { property: "og:url", content: url }),
209
+ /* @__PURE__ */ jsx("meta", { property: "og:locale", content: locale }),
210
+ productName && /* @__PURE__ */ jsx("meta", { property: "og:site_name", content: productName }),
211
+ /* @__PURE__ */ jsx("meta", { name: "twitter:card", content: "summary_large_image" }),
212
+ /* @__PURE__ */ jsx("meta", { name: "twitter:title", content: fullTitle }),
213
+ description && /* @__PURE__ */ jsx("meta", { name: "twitter:description", content: description }),
214
+ fullImageUrl && /* @__PURE__ */ jsx("meta", { name: "twitter:image", content: fullImageUrl }),
215
+ twitterHandle && /* @__PURE__ */ jsx("meta", { name: "twitter:creator", content: twitterHandle }),
216
+ /* @__PURE__ */ jsx("meta", { name: "theme-color", content: themeColor }),
217
+ structuredDataItems.map((data, index) => /* @__PURE__ */ jsx("script", { type: "application/ld+json", children: JSON.stringify(data) }, `ld-${index}`)),
218
+ additionalMeta?.map((meta, index) => /* @__PURE__ */ jsx(
219
+ "meta",
220
+ {
221
+ ...meta.name ? { name: meta.name } : {},
222
+ ...meta.property ? { property: meta.property } : {},
223
+ content: meta.content
224
+ },
225
+ `meta-${index}`
226
+ ))
227
+ ] });
228
+ }
229
+ function cn(...inputs) {
230
+ return twMerge(clsx(inputs));
231
+ }
232
+ var buttonVariants = cva(
233
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
234
+ {
235
+ variants: {
236
+ variant: {
237
+ default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
238
+ destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
239
+ outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
240
+ secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
241
+ ghost: "hover:bg-accent hover:text-accent-foreground",
242
+ link: "text-primary underline-offset-4 hover:underline"
243
+ },
244
+ size: {
245
+ default: "h-9 px-4 py-2",
246
+ sm: "h-8 rounded-md px-3 text-xs",
247
+ lg: "h-10 rounded-md px-8",
248
+ icon: "h-9 w-9"
249
+ }
250
+ },
251
+ defaultVariants: {
252
+ variant: "default",
253
+ size: "default"
254
+ }
255
+ }
256
+ );
257
+ var Button = React.forwardRef(
258
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
259
+ const Comp = asChild ? Slot : "button";
260
+ return /* @__PURE__ */ jsx(
261
+ Comp,
262
+ {
263
+ className: cn(buttonVariants({ variant, size, className })),
264
+ ref,
265
+ ...props
266
+ }
267
+ );
268
+ }
269
+ );
270
+ Button.displayName = "Button";
271
+ var Input = React.forwardRef(
272
+ ({ className, type, ...props }, ref) => {
273
+ return /* @__PURE__ */ jsx(
274
+ "input",
275
+ {
276
+ type,
277
+ className: cn(
278
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
279
+ className
280
+ ),
281
+ ref,
282
+ ...props
283
+ }
284
+ );
285
+ }
286
+ );
287
+ Input.displayName = "Input";
288
+ var labelVariants = cva(
289
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
290
+ );
291
+ var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
292
+ LabelPrimitive.Root,
293
+ {
294
+ ref,
295
+ className: cn(labelVariants(), className),
296
+ ...props
297
+ }
298
+ ));
299
+ Label.displayName = LabelPrimitive.Root.displayName;
300
+ var Select = React.forwardRef(({ className, children, ...props }, ref) => {
301
+ return /* @__PURE__ */ jsx(
302
+ "select",
303
+ {
304
+ className: cn(
305
+ "flex h-9 w-full appearance-none rounded-md border border-input bg-transparent bg-[length:1rem_1rem] bg-[right_0.75rem_center] bg-no-repeat px-3 py-1 pr-8 text-base shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
306
+ // Inline SVG chevron: SVG inside a `background-image: url(data:…)`
307
+ // does NOT inherit `currentColor` from the host element (the SVG is
308
+ // its own document with no parent CSS context), so the stroke is
309
+ // hardcoded to a muted slate-400 (#94a3b8). Matches the muted
310
+ // foreground token visually in both light and dark themes well
311
+ // enough for a passive chevron — addresses #9 review feedback.
312
+ `bg-[url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>")]`,
313
+ className
314
+ ),
315
+ ref,
316
+ ...props,
317
+ children
318
+ }
319
+ );
320
+ });
321
+ Select.displayName = "Select";
322
+ var Textarea = React.forwardRef(({ className, ...props }, ref) => {
323
+ return /* @__PURE__ */ jsx(
324
+ "textarea",
325
+ {
326
+ className: cn(
327
+ "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
328
+ className
329
+ ),
330
+ ref,
331
+ ...props
332
+ }
333
+ );
334
+ });
335
+ Textarea.displayName = "Textarea";
336
+ var SUBMIT_CONTACT_INQUIRY_MUTATION = (
337
+ /* GraphQL */
338
+ `
339
+ mutation SubmitContactInquiry($input: SubmitContactInquiryInput!) {
340
+ submitContactInquiry(input: $input) {
341
+ success
342
+ message
343
+ }
344
+ }
345
+ `
346
+ );
347
+ async function submitContactForm(client, data, productId) {
348
+ try {
349
+ const result = await client.mutate(SUBMIT_CONTACT_INQUIRY_MUTATION, {
350
+ input: {
351
+ name: `${data.firstName} ${data.lastName}`,
352
+ email: data.email.trim().toLowerCase(),
353
+ company: data.company || void 0,
354
+ subject: data.subject,
355
+ message: data.message,
356
+ productId,
357
+ // Send `category` only when the user actually picked one. Older
358
+ // backend deployments without the `category` field in the
359
+ // `SubmitContactInquiryInput` schema would reject any unknown
360
+ // field; spreading conditionally keeps the SDK forward-
361
+ // compatible.
362
+ ...data.category ? { category: data.category } : {},
363
+ ...data.recaptchaToken ? { recaptchaToken: data.recaptchaToken } : {}
364
+ }
365
+ });
366
+ if (result.errors?.length) {
367
+ const errorMsg = result.errors[0]?.message ?? "Failed to send message";
368
+ return { success: false, message: errorMsg };
369
+ }
370
+ const response = result.data?.submitContactInquiry;
371
+ if (response?.success) {
372
+ return {
373
+ success: true,
374
+ message: response.message || "Message sent successfully!"
375
+ };
376
+ }
377
+ return {
378
+ success: false,
379
+ message: response?.message || "Failed to send message"
380
+ };
381
+ } catch (error) {
382
+ console.error("Contact form submission error:", error);
383
+ return {
384
+ success: false,
385
+ message: "Network error. Please try again."
386
+ };
387
+ }
388
+ }
389
+ function replacePlaceholders(text, productName, email) {
390
+ return text.replace(/{productName}/g, productName).replace(/{email}/g, email);
391
+ }
392
+ function ContactPage({
393
+ productName,
394
+ recaptchaSiteKey,
395
+ contactEmail,
396
+ contactPhone,
397
+ officeAddress,
398
+ responseTime = "We typically respond within 24 hours",
399
+ heroTitle = "Get in Touch",
400
+ heroDescription = "Have questions about {productName}? We're here to help. Reach out to our team and we'll get back to you as soon as possible.",
401
+ // Backward-compatibility: default to `[]` so existing consumers
402
+ // (fluidgrids/burdenoff/algoshred websites) that don't pass
403
+ // `categories` continue to render with NO dropdown — same behavior
404
+ // they had before this SDK version. To opt in, pass an explicit
405
+ // `categories={…}` array (or the exported `DEFAULT_CONTACT_CATEGORIES`
406
+ // constant for the sane Burdenoff-generic vocabulary).
407
+ categories = [],
408
+ categoryLabel = "Category",
409
+ categoryPlaceholder = "Select a category",
410
+ categoryRequired = true,
411
+ additionalOptions = [
412
+ {
413
+ title: "Sales Inquiries",
414
+ description: "Ready to see {productName} in action? Our sales team is here to help.",
415
+ buttonText: "Contact Sales",
416
+ buttonLink: `mailto:${contactEmail}`
417
+ },
418
+ {
419
+ title: "Technical Support",
420
+ description: "Need help with your {productName} setup? Our support team is ready.",
421
+ buttonText: "Get Support",
422
+ buttonLink: `mailto:${contactEmail}`
423
+ },
424
+ {
425
+ title: "Partnership",
426
+ description: "Interested in partnering with {productName}? Let's explore opportunities.",
427
+ buttonText: "Partner With Us",
428
+ buttonLink: `mailto:${contactEmail}`
429
+ }
430
+ ],
431
+ seo
432
+ }) {
433
+ const client = useWebSDK();
434
+ const config = useWebSDKConfig();
435
+ const { product } = useProduct();
436
+ const resolvedProductId = product?.id || config.productId;
437
+ const displayName = productName ?? product?.name ?? config.productId;
438
+ const effectiveRecaptchaSiteKey = recaptchaSiteKey ?? config.recaptchaSiteKey ?? "";
439
+ const recaptchaRef = useRef(null);
440
+ const [isSubmitting, setIsSubmitting] = useState(false);
441
+ const [submitStatus, setSubmitStatus] = useState("idle");
442
+ const handleSubmit = async (e) => {
443
+ e.preventDefault();
444
+ const recaptchaToken = recaptchaRef.current?.getValue() ?? "";
445
+ if (effectiveRecaptchaSiteKey && !recaptchaToken) {
446
+ toast.error("Please complete the reCAPTCHA verification");
447
+ return;
448
+ }
449
+ setIsSubmitting(true);
450
+ setSubmitStatus("idle");
451
+ const form = e.currentTarget;
452
+ try {
453
+ const formData = new FormData(form);
454
+ const showCategory = categories.length > 0;
455
+ const rawCategory = showCategory ? (formData.get("category") ?? "").trim() : "";
456
+ if (showCategory && categoryRequired && !rawCategory) {
457
+ toast.error("Please select a category");
458
+ setIsSubmitting(false);
459
+ return;
460
+ }
461
+ const contactData = {
462
+ firstName: formData.get("firstName"),
463
+ lastName: formData.get("lastName"),
464
+ email: formData.get("email"),
465
+ company: formData.get("company"),
466
+ category: rawCategory || void 0,
467
+ subject: formData.get("subject"),
468
+ message: formData.get("message"),
469
+ recaptchaToken
470
+ };
471
+ const result = await submitContactForm(
472
+ client,
473
+ contactData,
474
+ resolvedProductId
475
+ );
476
+ if (result.success) {
477
+ setSubmitStatus("success");
478
+ toast.success(
479
+ result.message ?? `Thank you for contacting ${displayName}. We'll get back to you within 24 hours.`
480
+ );
481
+ if (form) {
482
+ form.reset();
483
+ }
484
+ recaptchaRef.current?.reset();
485
+ } else {
486
+ setSubmitStatus("error");
487
+ toast.error(
488
+ result.message ?? "Failed to send message. Please try again."
489
+ );
490
+ recaptchaRef.current?.reset();
491
+ }
492
+ } catch (error) {
493
+ console.error("Error submitting form:", error);
494
+ setSubmitStatus("error");
495
+ toast.error("Failed to send message. Please try again later.");
496
+ recaptchaRef.current?.reset();
497
+ } finally {
498
+ setIsSubmitting(false);
499
+ }
500
+ };
501
+ return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
502
+ seo && /* @__PURE__ */ jsx(
503
+ PageHead,
504
+ {
505
+ title: seo.title ?? `Contact ${displayName} - Get in Touch With Our Team`,
506
+ description: seo.description ?? `Ready to transform your business? Contact our team for sales inquiries, technical support, or partnership opportunities. We're here to help you succeed.`,
507
+ productName: displayName,
508
+ keywords: seo.keywords ?? `contact ${displayName.toLowerCase()}, sales inquiries, customer support, technical support, partnership opportunities, get in touch`,
509
+ image: seo.image ?? "/og-image-contact.png",
510
+ url: seo.url
511
+ }
512
+ ),
513
+ /* @__PURE__ */ jsx("section", { className: "bg-gradient-to-b from-background to-muted/20 py-12 sm:py-16 md:py-20 lg:py-24", children: /* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "text-center max-w-3xl mx-auto", children: [
514
+ /* @__PURE__ */ jsx("h1", { className: "text-3xl sm:text-4xl md:text-5xl font-bold mb-4 sm:mb-6", children: heroTitle }),
515
+ /* @__PURE__ */ jsx("p", { className: "text-lg sm:text-xl text-muted-foreground leading-relaxed", children: replacePlaceholders(heroDescription, displayName, contactEmail) })
516
+ ] }) }) }),
517
+ /* @__PURE__ */ jsx("section", { className: "py-12 sm:py-16 md:py-20 lg:py-24", children: /* @__PURE__ */ jsx("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs("div", { className: "grid sm:grid-cols-1 lg:grid-cols-3 gap-8 sm:gap-10 lg:gap-12", children: [
518
+ /* @__PURE__ */ jsxs("div", { className: "lg:col-span-1 order-2 lg:order-1", children: [
519
+ /* @__PURE__ */ jsx("h2", { className: "text-xl sm:text-2xl font-bold mb-4 sm:mb-6", children: "Contact Information" }),
520
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4 sm:space-y-6", children: [
521
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start space-x-3 sm:space-x-4", children: [
522
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 sm:w-10 sm:h-10 bg-primary/10 rounded-lg flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx(Mail, { className: "h-4 w-4 sm:h-5 sm:w-5 text-primary" }) }),
523
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
524
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold mb-1 text-sm sm:text-base", children: "Email" }),
525
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm sm:text-base break-all", children: contactEmail })
526
+ ] })
527
+ ] }),
528
+ contactPhone && /* @__PURE__ */ jsxs("div", { className: "flex items-start space-x-3 sm:space-x-4", children: [
529
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 sm:w-10 sm:h-10 bg-primary/10 rounded-lg flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx(Phone, { className: "h-4 w-4 sm:h-5 sm:w-5 text-primary" }) }),
530
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
531
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold mb-1 text-sm sm:text-base", children: "Phone" }),
532
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm sm:text-base", children: contactPhone })
533
+ ] })
534
+ ] }),
535
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start space-x-3 sm:space-x-4", children: [
536
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 sm:w-10 sm:h-10 bg-primary/10 rounded-lg flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx(MapPin, { className: "h-4 w-4 sm:h-5 sm:w-5 text-primary" }) }),
537
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
538
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold mb-1 text-sm sm:text-base", children: "Office" }),
539
+ /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground text-sm sm:text-base leading-relaxed", children: [
540
+ officeAddress.line1,
541
+ /* @__PURE__ */ jsx("br", {}),
542
+ officeAddress.line2,
543
+ /* @__PURE__ */ jsx("br", {}),
544
+ officeAddress.line3,
545
+ /* @__PURE__ */ jsx("br", {}),
546
+ officeAddress.country
547
+ ] })
548
+ ] })
549
+ ] }),
550
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start space-x-3 sm:space-x-4", children: [
551
+ /* @__PURE__ */ jsx("div", { className: "w-8 h-8 sm:w-10 sm:h-10 bg-primary/10 rounded-lg flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ jsx(Clock, { className: "h-4 w-4 sm:h-5 sm:w-5 text-primary" }) }),
552
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
553
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold mb-1 text-sm sm:text-base", children: "Response Time" }),
554
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm sm:text-base", children: responseTime })
555
+ ] })
556
+ ] })
557
+ ] })
558
+ ] }),
559
+ /* @__PURE__ */ jsx("div", { className: "lg:col-span-2 order-1 lg:order-2", children: /* @__PURE__ */ jsxs("div", { className: "bg-card border rounded-lg p-4 sm:p-6 md:p-8", children: [
560
+ /* @__PURE__ */ jsx("h2", { className: "text-xl sm:text-2xl font-bold mb-4 sm:mb-6", children: "Send us a Message" }),
561
+ /* @__PURE__ */ jsxs(
562
+ "form",
563
+ {
564
+ onSubmit: handleSubmit,
565
+ className: "space-y-4 sm:space-y-6",
566
+ children: [
567
+ /* @__PURE__ */ jsxs("div", { className: "grid sm:grid-cols-2 gap-4 sm:gap-6", children: [
568
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
569
+ /* @__PURE__ */ jsx(
570
+ Label,
571
+ {
572
+ htmlFor: "firstName",
573
+ className: "text-sm sm:text-base",
574
+ children: "First Name *"
575
+ }
576
+ ),
577
+ /* @__PURE__ */ jsx(
578
+ Input,
579
+ {
580
+ id: "firstName",
581
+ name: "firstName",
582
+ required: true,
583
+ placeholder: "John",
584
+ className: "text-sm sm:text-base"
585
+ }
586
+ )
587
+ ] }),
588
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
589
+ /* @__PURE__ */ jsx(
590
+ Label,
591
+ {
592
+ htmlFor: "lastName",
593
+ className: "text-sm sm:text-base",
594
+ children: "Last Name *"
595
+ }
596
+ ),
597
+ /* @__PURE__ */ jsx(
598
+ Input,
599
+ {
600
+ id: "lastName",
601
+ name: "lastName",
602
+ required: true,
603
+ placeholder: "Doe",
604
+ className: "text-sm sm:text-base"
605
+ }
606
+ )
607
+ ] })
608
+ ] }),
609
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
610
+ /* @__PURE__ */ jsx(Label, { htmlFor: "email", className: "text-sm sm:text-base", children: "Email *" }),
611
+ /* @__PURE__ */ jsx(
612
+ Input,
613
+ {
614
+ id: "email",
615
+ name: "email",
616
+ type: "email",
617
+ required: true,
618
+ placeholder: "john@company.com",
619
+ className: "text-sm sm:text-base"
620
+ }
621
+ )
622
+ ] }),
623
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
624
+ /* @__PURE__ */ jsx(Label, { htmlFor: "company", className: "text-sm sm:text-base", children: "Company" }),
625
+ /* @__PURE__ */ jsx(
626
+ Input,
627
+ {
628
+ id: "company",
629
+ name: "company",
630
+ placeholder: "Acme Inc.",
631
+ className: "text-sm sm:text-base"
632
+ }
633
+ )
634
+ ] }),
635
+ categories.length > 0 && /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
636
+ /* @__PURE__ */ jsxs(
637
+ Label,
638
+ {
639
+ htmlFor: "category",
640
+ className: "text-sm sm:text-base",
641
+ children: [
642
+ categoryLabel,
643
+ categoryRequired ? " *" : ""
644
+ ]
645
+ }
646
+ ),
647
+ /* @__PURE__ */ jsxs(
648
+ Select,
649
+ {
650
+ id: "category",
651
+ name: "category",
652
+ required: categoryRequired,
653
+ defaultValue: "",
654
+ className: "text-sm sm:text-base",
655
+ children: [
656
+ /* @__PURE__ */ jsx("option", { value: "", disabled: categoryRequired, children: categoryPlaceholder }),
657
+ categories.map((c) => /* @__PURE__ */ jsx("option", { value: c.value, children: c.label }, c.value))
658
+ ]
659
+ }
660
+ )
661
+ ] }),
662
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
663
+ /* @__PURE__ */ jsx(Label, { htmlFor: "subject", className: "text-sm sm:text-base", children: "Subject *" }),
664
+ /* @__PURE__ */ jsx(
665
+ Input,
666
+ {
667
+ id: "subject",
668
+ name: "subject",
669
+ required: true,
670
+ placeholder: "How can we help you?",
671
+ className: "text-sm sm:text-base"
672
+ }
673
+ )
674
+ ] }),
675
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
676
+ /* @__PURE__ */ jsx(Label, { htmlFor: "message", className: "text-sm sm:text-base", children: "Message *" }),
677
+ /* @__PURE__ */ jsx(
678
+ Textarea,
679
+ {
680
+ id: "message",
681
+ name: "message",
682
+ required: true,
683
+ placeholder: "Tell us more about your needs...",
684
+ rows: 5,
685
+ className: "text-sm sm:text-base min-h-[120px] sm:min-h-[150px] resize-y"
686
+ }
687
+ )
688
+ ] }),
689
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
690
+ effectiveRecaptchaSiteKey && /* @__PURE__ */ jsx("div", { className: "flex justify-center sm:justify-start", children: /* @__PURE__ */ jsx(
691
+ ReCAPTCHA,
692
+ {
693
+ ref: recaptchaRef,
694
+ sitekey: effectiveRecaptchaSiteKey
695
+ }
696
+ ) }),
697
+ /* @__PURE__ */ jsx(
698
+ Button,
699
+ {
700
+ type: "submit",
701
+ size: "lg",
702
+ disabled: isSubmitting,
703
+ className: "w-full sm:w-auto min-w-[200px]",
704
+ children: isSubmitting ? "Sending..." : /* @__PURE__ */ jsxs(Fragment, { children: [
705
+ "Send Message ",
706
+ /* @__PURE__ */ jsx(Send, { className: "ml-2 h-4 w-4" })
707
+ ] })
708
+ }
709
+ )
710
+ ] }),
711
+ submitStatus === "success" && /* @__PURE__ */ jsxs("div", { className: "p-3 sm:p-4 bg-green-50 border border-green-200 rounded-lg text-green-800 mt-4", children: [
712
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-sm sm:text-base", children: "Message sent successfully!" }),
713
+ /* @__PURE__ */ jsxs("p", { className: "text-xs sm:text-sm mt-1", children: [
714
+ "Thank you for contacting ",
715
+ displayName,
716
+ ". We'll get back to you within 24 hours."
717
+ ] })
718
+ ] }),
719
+ submitStatus === "error" && /* @__PURE__ */ jsxs("div", { className: "p-3 sm:p-4 bg-red-50 border border-red-200 rounded-lg text-red-800 mt-4", children: [
720
+ /* @__PURE__ */ jsx("p", { className: "font-medium text-sm sm:text-base", children: "Failed to send message" }),
721
+ /* @__PURE__ */ jsxs("p", { className: "text-xs sm:text-sm mt-1", children: [
722
+ "Please try again later or contact us directly at",
723
+ " ",
724
+ contactEmail
725
+ ] })
726
+ ] })
727
+ ]
728
+ }
729
+ )
730
+ ] }) })
731
+ ] }) }) }),
732
+ /* @__PURE__ */ jsx("section", { className: "py-12 sm:py-16 md:py-20 lg:py-24 bg-muted/30", children: /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [
733
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl font-bold text-center mb-8 sm:mb-12", children: "More Ways to Connect" }),
734
+ /* @__PURE__ */ jsx("div", { className: "grid sm:grid-cols-2 lg:grid-cols-3 gap-6 sm:gap-8 max-w-5xl mx-auto", children: additionalOptions.map((option, index) => /* @__PURE__ */ jsxs(
735
+ "div",
736
+ {
737
+ className: "text-center p-4 sm:p-6 bg-card border rounded-lg",
738
+ children: [
739
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-base sm:text-lg mb-2", children: option.title }),
740
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm sm:text-base mb-4 leading-relaxed", children: replacePlaceholders(
741
+ option.description,
742
+ displayName,
743
+ contactEmail
744
+ ) }),
745
+ /* @__PURE__ */ jsx(
746
+ Button,
747
+ {
748
+ variant: "outline",
749
+ asChild: true,
750
+ className: "text-sm sm:text-base",
751
+ children: /* @__PURE__ */ jsx("a", { href: option.buttonLink, children: option.buttonText })
752
+ }
753
+ )
754
+ ]
755
+ },
756
+ index
757
+ )) })
758
+ ] }) })
759
+ ] });
760
+ }
761
+ function renderMarkdown(md) {
762
+ let html = md;
763
+ html = html.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
764
+ html = html.replace(/```(\w*)\n([\s\S]*?)```/g, (_m, _lang, code) => {
765
+ return `<pre><code>${code.trim()}</code></pre>`;
766
+ });
767
+ html = html.replace(/`([^`]+)`/g, "<code>$1</code>");
768
+ html = html.replace(/^###### (.+)$/gm, "<h6>$1</h6>");
769
+ html = html.replace(/^##### (.+)$/gm, "<h5>$1</h5>");
770
+ html = html.replace(/^#### (.+)$/gm, "<h4>$1</h4>");
771
+ html = html.replace(/^### (.+)$/gm, "<h3>$1</h3>");
772
+ html = html.replace(/^## (.+)$/gm, "<h2>$1</h2>");
773
+ html = html.replace(/^# (.+)$/gm, "<h1>$1</h1>");
774
+ html = html.replace(/\*\*\*(.+?)\*\*\*/g, "<strong><em>$1</em></strong>");
775
+ html = html.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>");
776
+ html = html.replace(/\*(.+?)\*/g, "<em>$1</em>");
777
+ html = html.replace(
778
+ /\[([^\]]+)\]\(([^)]+)\)/g,
779
+ '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'
780
+ );
781
+ html = html.replace(/^&gt; (.+)$/gm, "<blockquote>$1</blockquote>");
782
+ html = html.replace(/(^- .+$(\n^- .+$)*)/gm, (block) => {
783
+ const items = block.split("\n").map((line) => `<li>${line.replace(/^- /, "")}</li>`).join("");
784
+ return `<ul>${items}</ul>`;
785
+ });
786
+ html = html.replace(/(^\d+\. .+$(\n^\d+\. .+$)*)/gm, (block) => {
787
+ const items = block.split("\n").map((line) => `<li>${line.replace(/^\d+\. /, "")}</li>`).join("");
788
+ return `<ol>${items}</ol>`;
789
+ });
790
+ html = html.replace(/^---$/gm, "<hr />");
791
+ html = html.split(/\n\n+/).map((block) => {
792
+ const trimmed = block.trim();
793
+ if (!trimmed) return "";
794
+ if (/^<(h[1-6]|ul|ol|pre|blockquote|hr)/.test(trimmed)) return trimmed;
795
+ return `<p>${trimmed.replace(/\n/g, "<br />")}</p>`;
796
+ }).join("\n");
797
+ return html;
798
+ }
799
+ function ContentRenderer({
800
+ content,
801
+ format = "markdown",
802
+ className
803
+ }) {
804
+ if (format === "markdown") {
805
+ return /* @__PURE__ */ jsx(
806
+ "div",
807
+ {
808
+ className,
809
+ dangerouslySetInnerHTML: { __html: renderMarkdown(content) }
810
+ }
811
+ );
812
+ }
813
+ if (format === "html") {
814
+ return /* @__PURE__ */ jsx(
815
+ "div",
816
+ {
817
+ className,
818
+ dangerouslySetInnerHTML: { __html: content }
819
+ }
820
+ );
821
+ }
822
+ return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx("pre", { style: { whiteSpace: "pre-wrap", fontFamily: "inherit" }, children: content }) });
823
+ }
824
+ var PARTNER_CONTENT_QUERY = `
825
+ query PartnerContent($productId: String!, $limit: Int) {
826
+ publicContentPages(productId: $productId, limit: $limit, offset: 0) {
827
+ items {
828
+ id
829
+ title
830
+ slug
831
+ excerpt
832
+ content
833
+ contentFormat
834
+ thumbnail
835
+ tags
836
+ publishedAt
837
+ lastUpdated
838
+ }
839
+ }
840
+ }
841
+ `;
842
+ var PARTNER_DOCUMENTS_QUERY = `
843
+ query PartnerDocuments($productId: String!, $limit: Int) {
844
+ publicPressKitAssets(productId: $productId, limit: $limit, offset: 0) {
845
+ items {
846
+ id
847
+ category
848
+ title
849
+ description
850
+ fileUrl
851
+ fileName
852
+ fileSize
853
+ mimeType
854
+ version
855
+ tags
856
+ sortOrder
857
+ updatedAt
858
+ }
859
+ }
860
+ }
861
+ `;
862
+ function formatFileSize(bytes) {
863
+ if (!bytes || bytes <= 0) return "";
864
+ const units = ["B", "KB", "MB", "GB"];
865
+ let i = 0;
866
+ let n = bytes;
867
+ while (n >= 1024 && i < units.length - 1) {
868
+ n /= 1024;
869
+ i++;
870
+ }
871
+ return `${n.toFixed(n >= 10 || i === 0 ? 0 : 1)} ${units[i]}`;
872
+ }
873
+ async function downloadDocument(e, doc) {
874
+ e.preventDefault();
875
+ const name = doc.fileName || doc.fileUrl.split("/").pop()?.split("?")[0] || doc.title || "partner-document";
876
+ const openInTab = () => window.open(doc.fileUrl, "_blank", "noopener,noreferrer");
877
+ try {
878
+ const res = await fetch(doc.fileUrl, { mode: "cors" });
879
+ if (!res.ok) {
880
+ openInTab();
881
+ return;
882
+ }
883
+ const blob = await res.blob();
884
+ const objUrl = URL.createObjectURL(blob);
885
+ const a = document.createElement("a");
886
+ a.href = objUrl;
887
+ a.download = name;
888
+ document.body.appendChild(a);
889
+ a.click();
890
+ a.remove();
891
+ URL.revokeObjectURL(objUrl);
892
+ } catch {
893
+ openInTab();
894
+ }
895
+ }
896
+ function PartnerHero({
897
+ title,
898
+ subtitle
899
+ }) {
900
+ return /* @__PURE__ */ jsx("section", { className: "bg-gradient-to-b from-background to-muted/20 py-16 md:py-24", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 max-w-4xl text-center", children: [
901
+ /* @__PURE__ */ jsx("h1", { className: "text-4xl md:text-5xl font-bold tracking-tight text-foreground mb-4", children: title }),
902
+ subtitle && /* @__PURE__ */ jsx("p", { className: "text-lg md:text-xl text-muted-foreground max-w-2xl mx-auto", children: subtitle })
903
+ ] }) });
904
+ }
905
+ function PartnerContentSection({
906
+ page
907
+ }) {
908
+ return /* @__PURE__ */ jsx("section", { className: "py-12 md:py-16", children: /* @__PURE__ */ jsx(
909
+ "div",
910
+ {
911
+ className: [
912
+ "mx-auto max-w-3xl px-4",
913
+ // Headings
914
+ "[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:tracking-tight [&_h1]:mt-0 [&_h1]:mb-6",
915
+ "[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2]:mt-10 [&_h2]:mb-4",
916
+ "[&_h3]:text-xl [&_h3]:font-semibold [&_h3]:mt-7 [&_h3]:mb-3",
917
+ "[&_h4]:text-lg [&_h4]:font-semibold [&_h4]:mt-6 [&_h4]:mb-2",
918
+ // Block elements
919
+ "[&_p]:my-4 [&_p]:leading-relaxed [&_p]:text-base",
920
+ "[&_ul]:my-4 [&_ul]:pl-6 [&_ul]:list-disc [&_ul]:space-y-1",
921
+ "[&_ol]:my-4 [&_ol]:pl-6 [&_ol]:list-decimal [&_ol]:space-y-1",
922
+ "[&_li]:leading-relaxed",
923
+ "[&_li>p]:my-1",
924
+ "[&_blockquote]:border-l-4 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:italic [&_blockquote]:my-4 [&_blockquote]:text-muted-foreground",
925
+ "[&_hr]:my-8 [&_hr]:border-border",
926
+ // Inline elements
927
+ "[&_strong]:font-semibold [&_strong]:text-foreground",
928
+ "[&_em]:italic",
929
+ "[&_a]:underline [&_a]:underline-offset-2 [&_a]:text-accent hover:[&_a]:text-accent/80 [&_a]:transition-colors",
930
+ "[&_code]:rounded [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:text-sm [&_code]:font-mono",
931
+ "[&_pre]:my-4 [&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:p-4 [&_pre]:text-sm",
932
+ "[&_pre>code]:bg-transparent [&_pre>code]:p-0"
933
+ ].join(" "),
934
+ children: page.content && /* @__PURE__ */ jsx(
935
+ ContentRenderer,
936
+ {
937
+ content: page.content,
938
+ format: (
939
+ // Validate before passing; unknown formats fall through to
940
+ // ContentRenderer's default behavior (markdown rendering)
941
+ // rather than getting silently force-cast to an
942
+ // unsupported variant.
943
+ page.contentFormat === "markdown" || page.contentFormat === "html" ? page.contentFormat : void 0
944
+ )
945
+ }
946
+ )
947
+ }
948
+ ) });
949
+ }
950
+ function PartnerDocumentCard({ doc }) {
951
+ const sizeLabel = formatFileSize(doc.fileSize);
952
+ const ext = doc.fileName?.split(".").pop()?.toUpperCase();
953
+ return /* @__PURE__ */ jsxs("article", { className: "flex flex-col gap-3 rounded-xl border border-border bg-card p-5 shadow-sm hover:shadow-md transition-shadow", children: [
954
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
955
+ /* @__PURE__ */ jsx("div", { className: "rounded-lg bg-muted p-2.5 shrink-0", children: /* @__PURE__ */ jsx(FileText, { size: 20, className: "text-muted-foreground" }) }),
956
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
957
+ /* @__PURE__ */ jsx("h3", { className: "font-semibold text-foreground truncate", children: doc.title }),
958
+ doc.version && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground mt-0.5", children: [
959
+ "Version ",
960
+ doc.version
961
+ ] })
962
+ ] })
963
+ ] }),
964
+ doc.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-3", children: doc.description }),
965
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 mt-auto pt-2 border-t border-border/60", children: [
966
+ /* @__PURE__ */ jsxs("div", { className: "text-xs text-muted-foreground flex items-center gap-2", children: [
967
+ ext && /* @__PURE__ */ jsx("span", { children: ext }),
968
+ sizeLabel && /* @__PURE__ */ jsxs(Fragment, { children: [
969
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\xB7" }),
970
+ /* @__PURE__ */ jsx("span", { children: sizeLabel })
971
+ ] })
972
+ ] }),
973
+ /* @__PURE__ */ jsxs(
974
+ "a",
975
+ {
976
+ href: doc.fileUrl,
977
+ download: doc.fileName ?? void 0,
978
+ onClick: (e) => void downloadDocument(e, doc),
979
+ className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground hover:bg-muted transition-colors",
980
+ children: [
981
+ /* @__PURE__ */ jsx(Download, { size: 14 }),
982
+ "Download"
983
+ ]
984
+ }
985
+ )
986
+ ] })
987
+ ] });
988
+ }
989
+ function PartnerDocumentsSection({
990
+ title,
991
+ subtitle,
992
+ docs
993
+ }) {
994
+ return /* @__PURE__ */ jsx("section", { className: "py-12 md:py-16 bg-muted/20", children: /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 max-w-5xl", children: [
995
+ /* @__PURE__ */ jsxs("header", { className: "mb-8 md:mb-10 text-center", children: [
996
+ /* @__PURE__ */ jsx("h2", { className: "text-2xl md:text-3xl font-bold text-foreground mb-2", children: title }),
997
+ subtitle && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-2xl mx-auto", children: subtitle })
998
+ ] }),
999
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: docs.map((doc) => /* @__PURE__ */ jsx(PartnerDocumentCard, { doc }, doc.id)) })
1000
+ ] }) });
1001
+ }
1002
+ var DEFAULT_PARTNER_CATEGORY = {
1003
+ value: "partnership",
1004
+ label: "Partner program"
1005
+ };
1006
+ function PartnersPage(props) {
1007
+ const {
1008
+ productName: productNameProp,
1009
+ heroTitle = "Partner with us",
1010
+ heroSubtitle,
1011
+ contentTag = "partner",
1012
+ contentSlug,
1013
+ documentsTag = "partner",
1014
+ documentsTitle = "Partner Documents",
1015
+ documentsSubtitle,
1016
+ showContactForm = true,
1017
+ contactCategory,
1018
+ formTitle = "Become a partner",
1019
+ formSubtitle,
1020
+ contactEmail,
1021
+ contactPhone,
1022
+ officeAddress,
1023
+ responseTime,
1024
+ recaptchaSiteKey,
1025
+ additionalOptions,
1026
+ seoTitle,
1027
+ seoDescription,
1028
+ seoKeywords,
1029
+ className
1030
+ } = props;
1031
+ const client = useWebSDK();
1032
+ const config = useWebSDKConfig();
1033
+ const { product } = useProduct();
1034
+ const resolvedProductId = product?.id ?? config?.productId ?? productNameProp ?? "";
1035
+ const resolvedProductName = productNameProp ?? product?.name ?? config?.productId ?? "our team";
1036
+ const [contentPage, setContentPage] = useState(null);
1037
+ const [docs, setDocs] = useState([]);
1038
+ const [loading, setLoading] = useState(true);
1039
+ useEffect(() => {
1040
+ if (!client || !resolvedProductId) {
1041
+ setContentPage(null);
1042
+ setDocs([]);
1043
+ setLoading(false);
1044
+ return;
1045
+ }
1046
+ let cancelled = false;
1047
+ setLoading(true);
1048
+ void Promise.allSettled([
1049
+ client.query(PARTNER_CONTENT_QUERY, { productId: resolvedProductId, limit: 50 }),
1050
+ client.query(
1051
+ PARTNER_DOCUMENTS_QUERY,
1052
+ { productId: resolvedProductId, limit: 50 }
1053
+ )
1054
+ ]).then(([contentResult, docsResult]) => {
1055
+ if (cancelled) return;
1056
+ if (contentResult.status === "rejected") {
1057
+ setContentPage(null);
1058
+ } else if (contentResult.status === "fulfilled") {
1059
+ const items = contentResult.value.data?.publicContentPages?.items ?? [];
1060
+ const match = contentSlug ? items.find((p) => p.slug === contentSlug) : items.find((p) => p.tags?.includes(contentTag));
1061
+ setContentPage(match ?? null);
1062
+ }
1063
+ if (docsResult.status === "rejected") {
1064
+ setDocs([]);
1065
+ } else if (docsResult.status === "fulfilled") {
1066
+ const items = docsResult.value.data?.publicPressKitAssets?.items ?? [];
1067
+ const filtered = items.filter(
1068
+ (d) => d.category === "DOCUMENT" && d.tags?.includes(documentsTag) && !!d.fileUrl
1069
+ ).sort(
1070
+ (a, b) => a.sortOrder - b.sortOrder
1071
+ );
1072
+ setDocs(filtered);
1073
+ }
1074
+ setLoading(false);
1075
+ });
1076
+ return () => {
1077
+ cancelled = true;
1078
+ };
1079
+ }, [client, resolvedProductId, contentSlug, contentTag, documentsTag]);
1080
+ const lockedCategory = contactCategory === false ? null : contactCategory ?? DEFAULT_PARTNER_CATEGORY;
1081
+ return /* @__PURE__ */ jsxs("div", { className, children: [
1082
+ /* @__PURE__ */ jsx(
1083
+ PageHead,
1084
+ {
1085
+ title: seoTitle ?? `${heroTitle} \u2014 ${resolvedProductName}`,
1086
+ description: seoDescription ?? heroSubtitle ?? `Join the ${resolvedProductName} partner programme.`,
1087
+ keywords: seoKeywords
1088
+ }
1089
+ ),
1090
+ /* @__PURE__ */ jsx(PartnerHero, { title: heroTitle, subtitle: heroSubtitle }),
1091
+ !loading && contentPage && /* @__PURE__ */ jsx(PartnerContentSection, { page: contentPage }),
1092
+ !loading && docs.length > 0 && /* @__PURE__ */ jsx(
1093
+ PartnerDocumentsSection,
1094
+ {
1095
+ title: documentsTitle,
1096
+ subtitle: documentsSubtitle,
1097
+ docs
1098
+ }
1099
+ ),
1100
+ showContactForm && /* @__PURE__ */ jsx(
1101
+ ContactPage,
1102
+ {
1103
+ productName: resolvedProductName,
1104
+ heroTitle: formTitle,
1105
+ heroDescription: formSubtitle ?? `Tell us about your organisation and a partner manager from ${resolvedProductName} will be in touch.`,
1106
+ contactEmail,
1107
+ contactPhone,
1108
+ officeAddress,
1109
+ responseTime,
1110
+ recaptchaSiteKey,
1111
+ additionalOptions,
1112
+ categories: lockedCategory ? [lockedCategory] : [],
1113
+ categoryLabel: "Partnership type",
1114
+ categoryRequired: !!lockedCategory
1115
+ }
1116
+ )
1117
+ ] });
1118
+ }
1119
+
1120
+ export { PartnersPage };
1121
+ //# sourceMappingURL=partners.mjs.map
1122
+ //# sourceMappingURL=partners.mjs.map