@burdenoff/website-sdk 2026.1101.1 → 2026.1101.2
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.
- package/README.md +42 -8
- package/dist/analytics/index.js +19 -69
- package/dist/analytics/index.js.map +1 -1
- package/dist/analytics/index.mjs +3 -69
- package/dist/analytics/index.mjs.map +1 -1
- package/dist/avatar-live/index.js +1 -0
- package/dist/avatar-live/index.js.map +1 -1
- package/dist/avatar-live/index.mjs +1 -0
- package/dist/avatar-live/index.mjs.map +1 -1
- package/dist/avatar-live-view/index.js +10 -30
- package/dist/avatar-live-view/index.js.map +1 -1
- package/dist/avatar-live-view/index.mjs +4 -24
- package/dist/avatar-live-view/index.mjs.map +1 -1
- package/dist/chunk-23H4JUL4.js +41 -0
- package/dist/chunk-23H4JUL4.js.map +1 -0
- package/dist/chunk-34RX5P75.mjs +25 -0
- package/dist/chunk-34RX5P75.mjs.map +1 -0
- package/dist/chunk-3LFFY7AZ.js +184 -0
- package/dist/chunk-3LFFY7AZ.js.map +1 -0
- package/dist/chunk-3X26GE4S.js +2794 -0
- package/dist/chunk-3X26GE4S.js.map +1 -0
- package/dist/chunk-45GCA4GG.js +85 -0
- package/dist/chunk-45GCA4GG.js.map +1 -0
- package/dist/chunk-4SAGVLHN.js +876 -0
- package/dist/chunk-4SAGVLHN.js.map +1 -0
- package/dist/chunk-4U6YAII5.js +218 -0
- package/dist/chunk-4U6YAII5.js.map +1 -0
- package/dist/chunk-5GMTBOO6.js +21 -0
- package/dist/chunk-5GMTBOO6.js.map +1 -0
- package/dist/chunk-5JRJ57CL.mjs +329 -0
- package/dist/chunk-5JRJ57CL.mjs.map +1 -0
- package/dist/chunk-6C2DKIC7.js +4 -0
- package/dist/chunk-6C2DKIC7.js.map +1 -0
- package/dist/chunk-6IBFBWC5.mjs +17 -0
- package/dist/chunk-6IBFBWC5.mjs.map +1 -0
- package/dist/chunk-6KY2ZRVI.js +116 -0
- package/dist/chunk-6KY2ZRVI.js.map +1 -0
- package/dist/chunk-6VJT3SM4.mjs +182 -0
- package/dist/chunk-6VJT3SM4.mjs.map +1 -0
- package/dist/chunk-6YZUFMK2.mjs +40 -0
- package/dist/chunk-6YZUFMK2.mjs.map +1 -0
- package/dist/chunk-7A6R7CGG.js +47 -0
- package/dist/chunk-7A6R7CGG.js.map +1 -0
- package/dist/chunk-7PWL4V2R.js +4 -0
- package/dist/chunk-7PWL4V2R.js.map +1 -0
- package/dist/chunk-AA33WDYS.js +161 -0
- package/dist/chunk-AA33WDYS.js.map +1 -0
- package/dist/chunk-AHRGFXV2.js +525 -0
- package/dist/chunk-AHRGFXV2.js.map +1 -0
- package/dist/chunk-B63XLDZH.mjs +109 -0
- package/dist/chunk-B63XLDZH.mjs.map +1 -0
- package/dist/chunk-BX2USEWF.mjs +35 -0
- package/dist/chunk-BX2USEWF.mjs.map +1 -0
- package/dist/chunk-BYSZT35R.js +150 -0
- package/dist/chunk-BYSZT35R.js.map +1 -0
- package/dist/chunk-C6OJIHNO.js +12 -0
- package/dist/chunk-C6OJIHNO.js.map +1 -0
- package/dist/chunk-COOELBX7.mjs +63 -0
- package/dist/chunk-COOELBX7.mjs.map +1 -0
- package/dist/chunk-D2TW7MNC.mjs +2771 -0
- package/dist/chunk-D2TW7MNC.mjs.map +1 -0
- package/dist/chunk-D5KEZ6V6.mjs +3 -0
- package/dist/chunk-D5KEZ6V6.mjs.map +1 -0
- package/dist/chunk-E3GUGJMY.js +46 -0
- package/dist/chunk-E3GUGJMY.js.map +1 -0
- package/dist/chunk-EBZ2HGJ2.mjs +52 -0
- package/dist/chunk-EBZ2HGJ2.mjs.map +1 -0
- package/dist/chunk-EDLTUOIA.mjs +210 -0
- package/dist/chunk-EDLTUOIA.mjs.map +1 -0
- package/dist/chunk-EJQSOT4X.js +4 -0
- package/dist/chunk-EJQSOT4X.js.map +1 -0
- package/dist/chunk-EUPFS6MZ.mjs +2019 -0
- package/dist/chunk-EUPFS6MZ.mjs.map +1 -0
- package/dist/chunk-F3XWDC3B.js +77 -0
- package/dist/chunk-F3XWDC3B.js.map +1 -0
- package/dist/chunk-FFADMVIK.mjs +5127 -0
- package/dist/chunk-FFADMVIK.mjs.map +1 -0
- package/dist/chunk-FJWS7BKT.mjs +3 -0
- package/dist/chunk-FJWS7BKT.mjs.map +1 -0
- package/dist/chunk-FJZJDUOR.mjs +3 -0
- package/dist/chunk-FJZJDUOR.mjs.map +1 -0
- package/dist/chunk-GCFLCO2Z.mjs +145 -0
- package/dist/chunk-GCFLCO2Z.mjs.map +1 -0
- package/dist/chunk-GEXC4LRP.js +61 -0
- package/dist/chunk-GEXC4LRP.js.map +1 -0
- package/dist/chunk-GTRAXQGC.mjs +3 -0
- package/dist/chunk-GTRAXQGC.mjs.map +1 -0
- package/dist/chunk-IKOIRUKW.js +270 -0
- package/dist/chunk-IKOIRUKW.js.map +1 -0
- package/dist/chunk-IXTWOPRN.js +45 -0
- package/dist/chunk-IXTWOPRN.js.map +1 -0
- package/dist/chunk-JDXOXGOK.js +547 -0
- package/dist/chunk-JDXOXGOK.js.map +1 -0
- package/dist/chunk-JSLDWYV7.mjs +558 -0
- package/dist/chunk-JSLDWYV7.mjs.map +1 -0
- package/dist/chunk-JXLSTVBK.js +336 -0
- package/dist/chunk-JXLSTVBK.js.map +1 -0
- package/dist/chunk-KHYXK7FG.mjs +49 -0
- package/dist/chunk-KHYXK7FG.mjs.map +1 -0
- package/dist/chunk-KSMBOWQQ.js +2034 -0
- package/dist/chunk-KSMBOWQQ.js.map +1 -0
- package/dist/chunk-KU2PXHGB.mjs +83 -0
- package/dist/chunk-KU2PXHGB.mjs.map +1 -0
- package/dist/chunk-KZANIV3S.mjs +37 -0
- package/dist/chunk-KZANIV3S.mjs.map +1 -0
- package/dist/chunk-L4BP6YOB.js +20 -0
- package/dist/chunk-L4BP6YOB.js.map +1 -0
- package/dist/chunk-MRKA2OAF.mjs +75 -0
- package/dist/chunk-MRKA2OAF.mjs.map +1 -0
- package/dist/chunk-N5EC53MH.mjs +80 -0
- package/dist/chunk-N5EC53MH.mjs.map +1 -0
- package/dist/chunk-NZANQGDM.mjs +34 -0
- package/dist/chunk-NZANQGDM.mjs.map +1 -0
- package/dist/chunk-O4GS3XPZ.js +10 -0
- package/dist/chunk-O4GS3XPZ.js.map +1 -0
- package/dist/chunk-O76QDGRM.js +5154 -0
- package/dist/chunk-O76QDGRM.js.map +1 -0
- package/dist/chunk-OYEUNZJY.js +114 -0
- package/dist/chunk-OYEUNZJY.js.map +1 -0
- package/dist/chunk-PHXAGQNB.js +74 -0
- package/dist/chunk-PHXAGQNB.js.map +1 -0
- package/dist/chunk-PIHHPP7J.mjs +16 -0
- package/dist/chunk-PIHHPP7J.mjs.map +1 -0
- package/dist/chunk-PXRHVVOU.mjs +499 -0
- package/dist/chunk-PXRHVVOU.mjs.map +1 -0
- package/dist/chunk-QMA6U6AU.js +36 -0
- package/dist/chunk-QMA6U6AU.js.map +1 -0
- package/dist/chunk-R6J7IULF.js +44 -0
- package/dist/chunk-R6J7IULF.js.map +1 -0
- package/dist/chunk-R7G6TWIS.mjs +10 -0
- package/dist/chunk-R7G6TWIS.mjs.map +1 -0
- package/dist/chunk-RUMGFI6L.mjs +544 -0
- package/dist/chunk-RUMGFI6L.mjs.map +1 -0
- package/dist/chunk-S54JWSJF.js +565 -0
- package/dist/chunk-S54JWSJF.js.map +1 -0
- package/dist/chunk-SK5UGG6A.js +2041 -0
- package/dist/chunk-SK5UGG6A.js.map +1 -0
- package/dist/chunk-SKIYDKIS.mjs +70 -0
- package/dist/chunk-SKIYDKIS.mjs.map +1 -0
- package/dist/chunk-SZNS5IK6.mjs +322 -0
- package/dist/chunk-SZNS5IK6.mjs.map +1 -0
- package/dist/chunk-T7JIPZAC.js +66 -0
- package/dist/chunk-T7JIPZAC.js.map +1 -0
- package/dist/chunk-TGYQHO2E.mjs +864 -0
- package/dist/chunk-TGYQHO2E.mjs.map +1 -0
- package/dist/chunk-TT3MHN42.mjs +8 -0
- package/dist/chunk-TT3MHN42.mjs.map +1 -0
- package/dist/chunk-UM55U65W.mjs +268 -0
- package/dist/chunk-UM55U65W.mjs.map +1 -0
- package/dist/chunk-UQ2HALUD.js +72 -0
- package/dist/chunk-UQ2HALUD.js.map +1 -0
- package/dist/chunk-UXWT7G77.js +82 -0
- package/dist/chunk-UXWT7G77.js.map +1 -0
- package/dist/chunk-VNS5WDWO.mjs +7 -0
- package/dist/chunk-VNS5WDWO.mjs.map +1 -0
- package/dist/chunk-VRWZLGR7.js +4 -0
- package/dist/chunk-VRWZLGR7.js.map +1 -0
- package/dist/chunk-VZLDSNH4.mjs +22 -0
- package/dist/chunk-VZLDSNH4.mjs.map +1 -0
- package/dist/chunk-W6P3YETJ.js +92 -0
- package/dist/chunk-W6P3YETJ.js.map +1 -0
- package/dist/chunk-WPKFFQCR.mjs +90 -0
- package/dist/chunk-WPKFFQCR.mjs.map +1 -0
- package/dist/chunk-WTVTI5TO.mjs +22 -0
- package/dist/chunk-WTVTI5TO.mjs.map +1 -0
- package/dist/chunk-XJOBZ4RJ.js +44 -0
- package/dist/chunk-XJOBZ4RJ.js.map +1 -0
- package/dist/chunk-XP2JDNDU.js +325 -0
- package/dist/chunk-XP2JDNDU.js.map +1 -0
- package/dist/chunk-Y4V5CEWD.mjs +112 -0
- package/dist/chunk-Y4V5CEWD.mjs.map +1 -0
- package/dist/chunk-YERN2UWM.js +116 -0
- package/dist/chunk-YERN2UWM.js.map +1 -0
- package/dist/chunk-ZKJQWFAA.mjs +114 -0
- package/dist/chunk-ZKJQWFAA.mjs.map +1 -0
- package/dist/chunk-ZOON3S3Y.mjs +138 -0
- package/dist/chunk-ZOON3S3Y.mjs.map +1 -0
- package/dist/chunk-ZP6QRAYC.mjs +2024 -0
- package/dist/chunk-ZP6QRAYC.mjs.map +1 -0
- package/dist/chunk-ZSTFX7FV.js +9 -0
- package/dist/chunk-ZSTFX7FV.js.map +1 -0
- package/dist/client/index.js +23 -331
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +3 -330
- package/dist/client/index.mjs.map +1 -1
- package/dist/comparison/index.js +28 -111
- package/dist/comparison/index.js.map +1 -1
- package/dist/comparison/index.mjs +2 -107
- package/dist/comparison/index.mjs.map +1 -1
- package/dist/components/contact.js +21 -931
- package/dist/components/contact.js.map +1 -1
- package/dist/components/contact.mjs +12 -909
- package/dist/components/contact.mjs.map +1 -1
- package/dist/components/electron-download.js +12 -124
- package/dist/components/electron-download.js.map +1 -1
- package/dist/components/electron-download.mjs +4 -106
- package/dist/components/electron-download.mjs.map +1 -1
- package/dist/components/explore-cta.js +8 -112
- package/dist/components/explore-cta.js.map +1 -1
- package/dist/components/explore-cta.mjs +3 -114
- package/dist/components/explore-cta.mjs.map +1 -1
- package/dist/components/explore.js +62 -7833
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +13 -7800
- package/dist/components/explore.mjs.map +1 -1
- package/dist/components/launch-countdown.js +8 -83
- package/dist/components/launch-countdown.js.map +1 -1
- package/dist/components/launch-countdown.mjs +3 -85
- package/dist/components/launch-countdown.mjs.map +1 -1
- package/dist/components/newsletter.js +20 -993
- package/dist/components/newsletter.js.map +1 -1
- package/dist/components/newsletter.mjs +11 -971
- package/dist/components/newsletter.mjs.map +1 -1
- package/dist/components/partners.js +24 -1302
- package/dist/components/partners.js.map +1 -1
- package/dist/components/partners.mjs +15 -1276
- package/dist/components/partners.mjs.map +1 -1
- package/dist/components/pricing.js +49 -1249
- package/dist/components/pricing.js.map +1 -1
- package/dist/components/pricing.mjs +8 -1226
- package/dist/components/pricing.mjs.map +1 -1
- package/dist/components/problems-solved.js +8 -150
- package/dist/components/problems-solved.js.map +1 -1
- package/dist/components/problems-solved.mjs +4 -133
- package/dist/components/problems-solved.mjs.map +1 -1
- package/dist/components/resource-links.js +8 -304
- package/dist/components/resource-links.js.map +1 -1
- package/dist/components/resource-links.mjs +5 -308
- package/dist/components/resource-links.mjs.map +1 -1
- package/dist/components/social-links.js +8 -343
- package/dist/components/social-links.js.map +1 -1
- package/dist/components/social-links.mjs +5 -347
- package/dist/components/social-links.mjs.map +1 -1
- package/dist/components/unsubscribe.js +10 -627
- package/dist/components/unsubscribe.js.map +1 -1
- package/dist/components/unsubscribe.mjs +6 -611
- package/dist/components/unsubscribe.mjs.map +1 -1
- package/dist/components/waitlist.js +21 -1001
- package/dist/components/waitlist.js.map +1 -1
- package/dist/components/waitlist.mjs +12 -982
- package/dist/components/waitlist.mjs.map +1 -1
- package/dist/components/website-switcher.js +12 -175
- package/dist/components/website-switcher.js.map +1 -1
- package/dist/components/website-switcher.mjs +4 -157
- package/dist/components/website-switcher.mjs.map +1 -1
- package/dist/content/index.js +118 -3616
- package/dist/content/index.js.map +1 -1
- package/dist/content/index.mjs +12 -3567
- package/dist/content/index.mjs.map +1 -1
- package/dist/hooks/index.js +37 -2321
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +6 -2318
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4145 -20599
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3766 -20567
- package/dist/index.mjs.map +1 -1
- package/dist/product/index.js +20 -393
- package/dist/product/index.js.map +1 -1
- package/dist/product/index.mjs +5 -394
- package/dist/product/index.mjs.map +1 -1
- package/dist/seo/index.js +8 -76
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/index.mjs +3 -78
- package/dist/seo/index.mjs.map +1 -1
- package/dist/store/index.js +51 -2650
- package/dist/store/index.js.map +1 -1
- package/dist/store/index.mjs +13 -2619
- package/dist/store/index.mjs.map +1 -1
- package/dist/utils/index.js +69 -134
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/index.mjs +5 -122
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -1
|
@@ -1,613 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { cva } from 'class-variance-authority';
|
|
8
|
-
import { clsx } from 'clsx';
|
|
9
|
-
import { twMerge } from 'tailwind-merge';
|
|
10
|
-
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
14
|
-
|
|
15
|
-
// src/client/security.ts
|
|
16
|
-
var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1"]);
|
|
17
|
-
var RESERVED_HEADERS = /* @__PURE__ */ new Set([
|
|
18
|
-
"authorization",
|
|
19
|
-
"cookie",
|
|
20
|
-
"x-actor-id",
|
|
21
|
-
"x-actor-type",
|
|
22
|
-
"x-consent-granted-by",
|
|
23
|
-
"x-consent-scope",
|
|
24
|
-
"x-consent-granted-at",
|
|
25
|
-
"x-consent-expires-at"
|
|
26
|
-
]);
|
|
27
|
-
function validateGatewayUrl(value) {
|
|
28
|
-
let url;
|
|
29
|
-
try {
|
|
30
|
-
url = new URL(value);
|
|
31
|
-
} catch {
|
|
32
|
-
throw new Error("Gateway URL must be a valid absolute URL");
|
|
33
|
-
}
|
|
34
|
-
if (url.protocol === "https:") {
|
|
35
|
-
return url.toString();
|
|
36
|
-
}
|
|
37
|
-
if (url.protocol === "http:" && LOOPBACK_HOSTS.has(url.hostname.toLowerCase())) {
|
|
38
|
-
return url.toString();
|
|
39
|
-
}
|
|
40
|
-
throw new Error("Gateway URL must use HTTPS unless it targets localhost");
|
|
41
|
-
}
|
|
42
|
-
function sanitizeHeaders(headers) {
|
|
43
|
-
if (!headers) return void 0;
|
|
44
|
-
return Object.fromEntries(
|
|
45
|
-
Object.entries(headers).filter(
|
|
46
|
-
([key]) => !RESERVED_HEADERS.has(key.toLowerCase())
|
|
47
|
-
)
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
var CF_ACCESS_GATED_HOSTS = /* @__PURE__ */ new Set([
|
|
51
|
-
"alphagraphql.burdenoff.com",
|
|
52
|
-
"alphagraphqlworkspaces.burdenoff.com"
|
|
53
|
-
]);
|
|
54
|
-
function cfAccessHeaders(gatewayUrl, cfAccess) {
|
|
55
|
-
const clientId = cfAccess?.clientId?.trim();
|
|
56
|
-
const clientSecret = cfAccess?.clientSecret?.trim();
|
|
57
|
-
if (!clientId || !clientSecret) return {};
|
|
58
|
-
let host;
|
|
59
|
-
try {
|
|
60
|
-
host = new URL(gatewayUrl).hostname.toLowerCase();
|
|
61
|
-
} catch {
|
|
62
|
-
return {};
|
|
63
|
-
}
|
|
64
|
-
if (!CF_ACCESS_GATED_HOSTS.has(host)) return {};
|
|
65
|
-
return {
|
|
66
|
-
"CF-Access-Client-Id": clientId,
|
|
67
|
-
"CF-Access-Client-Secret": clientSecret
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// src/client/graphql-client.ts
|
|
72
|
-
var _WebSDKClient = class _WebSDKClient {
|
|
73
|
-
constructor(config) {
|
|
74
|
-
__publicField(this, "config");
|
|
75
|
-
__publicField(this, "queryCache", /* @__PURE__ */ new Map());
|
|
76
|
-
__publicField(this, "inflight", /* @__PURE__ */ new Map());
|
|
77
|
-
this.config = {
|
|
78
|
-
...config,
|
|
79
|
-
gatewayUrl: validateGatewayUrl(config.gatewayUrl),
|
|
80
|
-
headers: sanitizeHeaders(config.headers)
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
getConfig() {
|
|
84
|
-
return this.config;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Execute a GraphQL query (with deduplication and caching).
|
|
88
|
-
*
|
|
89
|
-
* Pass `{ cache: false }` to bypass the cache entirely — required for poll
|
|
90
|
-
* loops, where every tick must reach the network.
|
|
91
|
-
*/
|
|
92
|
-
async query(query, variables, options) {
|
|
93
|
-
if (options?.cache === false) {
|
|
94
|
-
return this.request(query, variables, true, options.timeoutMs);
|
|
95
|
-
}
|
|
96
|
-
const cacheKey = JSON.stringify({ query, variables });
|
|
97
|
-
const cached = this.queryCache.get(cacheKey);
|
|
98
|
-
if (cached) {
|
|
99
|
-
if (Date.now() - cached.ts < _WebSDKClient.CACHE_TTL) {
|
|
100
|
-
return cached.data;
|
|
101
|
-
}
|
|
102
|
-
this.queryCache.delete(cacheKey);
|
|
103
|
-
}
|
|
104
|
-
const existing = this.inflight.get(cacheKey);
|
|
105
|
-
if (existing) {
|
|
106
|
-
return existing;
|
|
107
|
-
}
|
|
108
|
-
const promise = this.request(query, variables, true, options?.timeoutMs).then((result) => {
|
|
109
|
-
if (result.data && !result.errors?.length) {
|
|
110
|
-
if (this.queryCache.size >= _WebSDKClient.MAX_CACHE_ENTRIES) {
|
|
111
|
-
const oldestEntry = this.queryCache.keys().next().value;
|
|
112
|
-
if (oldestEntry) {
|
|
113
|
-
this.queryCache.delete(oldestEntry);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
this.queryCache.set(cacheKey, { data: result, ts: Date.now() });
|
|
117
|
-
}
|
|
118
|
-
return result;
|
|
119
|
-
}).finally(() => {
|
|
120
|
-
this.inflight.delete(cacheKey);
|
|
121
|
-
});
|
|
122
|
-
this.inflight.set(cacheKey, promise);
|
|
123
|
-
return promise;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Execute a GraphQL mutation
|
|
127
|
-
*/
|
|
128
|
-
async mutate(mutation, variables, options) {
|
|
129
|
-
return this.request(mutation, variables, false, options?.timeoutMs);
|
|
130
|
-
}
|
|
131
|
-
/** HTTP statuses worth another attempt — transient server/edge conditions. */
|
|
132
|
-
static isRetriableStatus(status) {
|
|
133
|
-
return status === 429 || status === 408 || status >= 500 && status < 600;
|
|
134
|
-
}
|
|
135
|
-
static sleep(ms) {
|
|
136
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Perform the HTTP call with a hard timeout. Every outcome resolves to a
|
|
140
|
-
* GraphQLResponse — callers never hang, so a UI's `loading` state always
|
|
141
|
-
* settles into data or a renderable error.
|
|
142
|
-
*/
|
|
143
|
-
async attempt(query, variables, timeoutMs) {
|
|
144
|
-
const controller = new AbortController();
|
|
145
|
-
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
146
|
-
try {
|
|
147
|
-
const response = await fetch(this.config.gatewayUrl, {
|
|
148
|
-
method: "POST",
|
|
149
|
-
headers: {
|
|
150
|
-
"Content-Type": "application/json",
|
|
151
|
-
"x-product-id": this.config.productId,
|
|
152
|
-
...this.config.headers,
|
|
153
|
-
...cfAccessHeaders(this.config.gatewayUrl, this.config.cfAccess)
|
|
154
|
-
},
|
|
155
|
-
body: JSON.stringify({ query, variables }),
|
|
156
|
-
signal: controller.signal
|
|
157
|
-
});
|
|
158
|
-
if (!response.ok) {
|
|
159
|
-
console.error(
|
|
160
|
-
"[WebSDK] GraphQL request failed",
|
|
161
|
-
response.status,
|
|
162
|
-
response.statusText
|
|
163
|
-
);
|
|
164
|
-
return {
|
|
165
|
-
res: {
|
|
166
|
-
errors: [
|
|
167
|
-
{
|
|
168
|
-
message: `HTTP ${response.status}: ${response.statusText}`,
|
|
169
|
-
extensions: { code: `HTTP_${response.status}` }
|
|
170
|
-
}
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
|
-
retriable: _WebSDKClient.isRetriableStatus(response.status)
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
return {
|
|
177
|
-
res: await response.json(),
|
|
178
|
-
retriable: false
|
|
179
|
-
};
|
|
180
|
-
} catch (error) {
|
|
181
|
-
const aborted = error instanceof Error && (error.name === "AbortError" || controller.signal.aborted);
|
|
182
|
-
const message = aborted ? `Request timed out after ${timeoutMs}ms` : error instanceof Error ? error.message : "Network error";
|
|
183
|
-
console.error("[WebSDK] Network error", message);
|
|
184
|
-
return {
|
|
185
|
-
res: {
|
|
186
|
-
errors: [
|
|
187
|
-
{
|
|
188
|
-
message,
|
|
189
|
-
extensions: { code: aborted ? "TIMEOUT" : "NETWORK_ERROR" }
|
|
190
|
-
}
|
|
191
|
-
]
|
|
192
|
-
},
|
|
193
|
-
// Transport-level failures are worth one more try; a genuine outage
|
|
194
|
-
// just fails twice quickly and still renders an error state.
|
|
195
|
-
retriable: true
|
|
196
|
-
};
|
|
197
|
-
} finally {
|
|
198
|
-
clearTimeout(timer);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
async request(query, variables, retry = true, timeoutOverrideMs) {
|
|
202
|
-
const timeoutMs = timeoutOverrideMs ?? this.config.timeoutMs ?? _WebSDKClient.DEFAULT_TIMEOUT_MS;
|
|
203
|
-
const maxRetries = retry ? this.config.maxRetries ?? _WebSDKClient.DEFAULT_MAX_RETRIES : 0;
|
|
204
|
-
let last;
|
|
205
|
-
for (let i = 0; i <= maxRetries; i++) {
|
|
206
|
-
const { res, retriable } = await this.attempt(
|
|
207
|
-
query,
|
|
208
|
-
variables,
|
|
209
|
-
timeoutMs
|
|
210
|
-
);
|
|
211
|
-
if (!retriable || i === maxRetries) return res;
|
|
212
|
-
last = res;
|
|
213
|
-
await _WebSDKClient.sleep(
|
|
214
|
-
_WebSDKClient.RETRY_BASE_DELAY_MS * (i + 1) + Math.random() * 200
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
return last;
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
__publicField(_WebSDKClient, "CACHE_TTL", 5 * 60 * 1e3);
|
|
221
|
-
// 5 minutes
|
|
222
|
-
__publicField(_WebSDKClient, "MAX_CACHE_ENTRIES", 100);
|
|
223
|
-
__publicField(_WebSDKClient, "DEFAULT_TIMEOUT_MS", 12e3);
|
|
224
|
-
__publicField(_WebSDKClient, "DEFAULT_MAX_RETRIES", 1);
|
|
225
|
-
__publicField(_WebSDKClient, "RETRY_BASE_DELAY_MS", 400);
|
|
226
|
-
var WebSDKContext = createContext(null);
|
|
227
|
-
function useWebSDK() {
|
|
228
|
-
const client = useContext(WebSDKContext);
|
|
229
|
-
if (!client) {
|
|
230
|
-
throw new Error("useWebSDK must be used within a WebSDKProvider");
|
|
231
|
-
}
|
|
232
|
-
return client;
|
|
233
|
-
}
|
|
234
|
-
function useWebSDKConfig() {
|
|
235
|
-
const client = useWebSDK();
|
|
236
|
-
return client.getConfig();
|
|
237
|
-
}
|
|
238
|
-
function canonicalFromLocation() {
|
|
239
|
-
if (typeof window === "undefined" || !window.location) return void 0;
|
|
240
|
-
const { origin, pathname } = window.location;
|
|
241
|
-
if (!origin || origin === "null") return void 0;
|
|
242
|
-
const path = pathname === "/" ? "/" : pathname.replace(/\/+$/, "");
|
|
243
|
-
return `${origin}${path}`;
|
|
244
|
-
}
|
|
245
|
-
function resolveImageUrl(image, base) {
|
|
246
|
-
if (!image || /^https?:\/\//i.test(image)) return image;
|
|
247
|
-
if (!base) return image;
|
|
248
|
-
try {
|
|
249
|
-
return new URL(image, base).toString();
|
|
250
|
-
} catch {
|
|
251
|
-
return image;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
function serializeJsonLd(data) {
|
|
255
|
-
return JSON.stringify(data).replace(/</g, "\\u003c").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
256
|
-
}
|
|
257
|
-
function PageHead({
|
|
258
|
-
title,
|
|
259
|
-
description,
|
|
260
|
-
productName,
|
|
261
|
-
keywords,
|
|
262
|
-
image,
|
|
263
|
-
url,
|
|
264
|
-
favicon,
|
|
265
|
-
robots = "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1",
|
|
266
|
-
locale = "en_US",
|
|
267
|
-
twitterHandle,
|
|
268
|
-
themeColor = "#000000",
|
|
269
|
-
author,
|
|
270
|
-
structuredData,
|
|
271
|
-
additionalMeta
|
|
272
|
-
}) {
|
|
273
|
-
const fullTitle = productName && !title.includes(productName) ? `${title} | ${productName}` : title;
|
|
274
|
-
const resolvedUrl = url ?? canonicalFromLocation();
|
|
275
|
-
const fullImageUrl = resolveImageUrl(image, resolvedUrl);
|
|
276
|
-
const structuredDataItems = structuredData ? Array.isArray(structuredData) ? structuredData : [structuredData] : [];
|
|
277
|
-
return /* @__PURE__ */ jsxs(Helmet, { children: [
|
|
278
|
-
/* @__PURE__ */ jsx("title", { children: fullTitle }),
|
|
279
|
-
/* @__PURE__ */ jsx("meta", { name: "title", content: fullTitle }),
|
|
280
|
-
description ? /* @__PURE__ */ jsx("meta", { name: "description", content: description }) : null,
|
|
281
|
-
keywords ? /* @__PURE__ */ jsx("meta", { name: "keywords", content: keywords }) : null,
|
|
282
|
-
author ? /* @__PURE__ */ jsx("meta", { name: "author", content: author }) : null,
|
|
283
|
-
/* @__PURE__ */ jsx("meta", { name: "robots", content: robots }),
|
|
284
|
-
resolvedUrl ? /* @__PURE__ */ jsx("link", { rel: "canonical", href: resolvedUrl }) : null,
|
|
285
|
-
favicon ? /* @__PURE__ */ jsx("link", { rel: "icon", href: favicon }) : null,
|
|
286
|
-
/* @__PURE__ */ jsx("meta", { property: "og:type", content: "website" }),
|
|
287
|
-
/* @__PURE__ */ jsx("meta", { property: "og:title", content: fullTitle }),
|
|
288
|
-
description ? /* @__PURE__ */ jsx("meta", { property: "og:description", content: description }) : null,
|
|
289
|
-
fullImageUrl ? /* @__PURE__ */ jsx("meta", { property: "og:image", content: fullImageUrl }) : null,
|
|
290
|
-
resolvedUrl ? /* @__PURE__ */ jsx("meta", { property: "og:url", content: resolvedUrl }) : null,
|
|
291
|
-
/* @__PURE__ */ jsx("meta", { property: "og:locale", content: locale }),
|
|
292
|
-
productName ? /* @__PURE__ */ jsx("meta", { property: "og:site_name", content: productName }) : null,
|
|
293
|
-
/* @__PURE__ */ jsx("meta", { name: "twitter:card", content: "summary_large_image" }),
|
|
294
|
-
/* @__PURE__ */ jsx("meta", { name: "twitter:title", content: fullTitle }),
|
|
295
|
-
description ? /* @__PURE__ */ jsx("meta", { name: "twitter:description", content: description }) : null,
|
|
296
|
-
fullImageUrl ? /* @__PURE__ */ jsx("meta", { name: "twitter:image", content: fullImageUrl }) : null,
|
|
297
|
-
twitterHandle ? /* @__PURE__ */ jsx("meta", { name: "twitter:creator", content: twitterHandle }) : null,
|
|
298
|
-
/* @__PURE__ */ jsx("meta", { name: "theme-color", content: themeColor }),
|
|
299
|
-
structuredDataItems.map((data, index) => /* @__PURE__ */ jsx("script", { type: "application/ld+json", children: serializeJsonLd(data) }, `ld-${index}`)),
|
|
300
|
-
additionalMeta?.map((meta, index) => /* @__PURE__ */ jsx(
|
|
301
|
-
"meta",
|
|
302
|
-
{
|
|
303
|
-
...meta.name ? { name: meta.name } : {},
|
|
304
|
-
...meta.property ? { property: meta.property } : {},
|
|
305
|
-
content: meta.content
|
|
306
|
-
},
|
|
307
|
-
`meta-${index}`
|
|
308
|
-
))
|
|
309
|
-
] });
|
|
310
|
-
}
|
|
311
|
-
function cn(...inputs) {
|
|
312
|
-
return twMerge(clsx(inputs));
|
|
313
|
-
}
|
|
314
|
-
var buttonVariants = cva(
|
|
315
|
-
"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",
|
|
316
|
-
{
|
|
317
|
-
variants: {
|
|
318
|
-
variant: {
|
|
319
|
-
default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
320
|
-
destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
321
|
-
outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
322
|
-
secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
323
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
324
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
325
|
-
},
|
|
326
|
-
size: {
|
|
327
|
-
default: "h-9 px-4 py-2",
|
|
328
|
-
sm: "h-8 rounded-md px-3 text-xs",
|
|
329
|
-
lg: "h-10 rounded-md px-8",
|
|
330
|
-
icon: "h-9 w-9"
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
defaultVariants: {
|
|
334
|
-
variant: "default",
|
|
335
|
-
size: "default"
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
);
|
|
339
|
-
var Button = React.forwardRef(
|
|
340
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
341
|
-
const Comp = asChild ? Slot : "button";
|
|
342
|
-
return /* @__PURE__ */ jsx(
|
|
343
|
-
Comp,
|
|
344
|
-
{
|
|
345
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
346
|
-
ref,
|
|
347
|
-
...props
|
|
348
|
-
}
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
);
|
|
352
|
-
Button.displayName = "Button";
|
|
353
|
-
var UNSUBSCRIBE_MUTATION = (
|
|
354
|
-
/* GraphQL */
|
|
355
|
-
`
|
|
356
|
-
mutation PublicUnsubscribeByToken($token: String!) {
|
|
357
|
-
publicUnsubscribeByToken(token: $token)
|
|
358
|
-
}
|
|
359
|
-
`
|
|
360
|
-
);
|
|
361
|
-
function UnsubscribePage({
|
|
362
|
-
productName,
|
|
363
|
-
className = "",
|
|
364
|
-
seoTitle = "Unsubscribe from Newsletter",
|
|
365
|
-
seoDescription = "Manage your newsletter subscription preferences.",
|
|
366
|
-
resubscribeUrl,
|
|
367
|
-
successMessage = "You have been successfully unsubscribed from our newsletter.",
|
|
368
|
-
errorMessage = "Something went wrong. Please try again or contact support."
|
|
369
|
-
}) {
|
|
370
|
-
const client = useWebSDK();
|
|
371
|
-
const config = useWebSDKConfig();
|
|
372
|
-
const displayName = productName ?? config.productId;
|
|
373
|
-
const [state, setState] = useState("loading");
|
|
374
|
-
const [error, setError] = useState("");
|
|
375
|
-
const [token, setToken] = useState("");
|
|
376
|
-
const [successCopy, setSuccessCopy] = useState(successMessage);
|
|
377
|
-
useEffect(() => {
|
|
378
|
-
const params = new URLSearchParams(window.location.search);
|
|
379
|
-
const t = params.get("token");
|
|
380
|
-
if (t) {
|
|
381
|
-
setToken(t);
|
|
382
|
-
setState("confirming");
|
|
383
|
-
} else {
|
|
384
|
-
setState("invalid");
|
|
385
|
-
}
|
|
386
|
-
}, []);
|
|
387
|
-
const handleUnsubscribe = async () => {
|
|
388
|
-
if (!token) return;
|
|
389
|
-
setState("processing");
|
|
390
|
-
try {
|
|
391
|
-
const result = await client.mutate(UNSUBSCRIBE_MUTATION, { token });
|
|
392
|
-
if (result.errors?.length) {
|
|
393
|
-
const errMsg = result.errors[0]?.message ?? errorMessage;
|
|
394
|
-
const code = result.errors[0]?.extensions?.code;
|
|
395
|
-
if (code === "ALREADY_UNSUBSCRIBED") {
|
|
396
|
-
toast.info("You are already unsubscribed from this newsletter.");
|
|
397
|
-
setSuccessCopy("You were already unsubscribed from this newsletter.");
|
|
398
|
-
setState("success");
|
|
399
|
-
return;
|
|
400
|
-
} else if (code === "UNSUBSCRIBE_TOKEN_EXPIRED") {
|
|
401
|
-
setError(
|
|
402
|
-
"This unsubscribe link has expired. Please contact support."
|
|
403
|
-
);
|
|
404
|
-
} else if (code === "INVALID_UNSUBSCRIBE_TOKEN") {
|
|
405
|
-
setState("invalid");
|
|
406
|
-
return;
|
|
407
|
-
} else {
|
|
408
|
-
setError(errMsg);
|
|
409
|
-
}
|
|
410
|
-
setState("error");
|
|
411
|
-
return;
|
|
412
|
-
}
|
|
413
|
-
if (result.data?.publicUnsubscribeByToken) {
|
|
414
|
-
setSuccessCopy(successMessage);
|
|
415
|
-
setState("success");
|
|
416
|
-
toast.success("Successfully unsubscribed");
|
|
417
|
-
} else {
|
|
418
|
-
setError(errorMessage);
|
|
419
|
-
setState("error");
|
|
420
|
-
}
|
|
421
|
-
} catch {
|
|
422
|
-
setError(errorMessage);
|
|
423
|
-
setState("error");
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
return /* @__PURE__ */ jsxs(
|
|
427
|
-
"div",
|
|
428
|
-
{
|
|
429
|
-
className,
|
|
430
|
-
style: {
|
|
431
|
-
minHeight: "60vh",
|
|
432
|
-
display: "flex",
|
|
433
|
-
alignItems: "center",
|
|
434
|
-
justifyContent: "center",
|
|
435
|
-
padding: "6rem 1rem 4rem"
|
|
436
|
-
},
|
|
437
|
-
children: [
|
|
438
|
-
/* @__PURE__ */ jsx(PageHead, { title: seoTitle, description: seoDescription }),
|
|
439
|
-
/* @__PURE__ */ jsxs("div", { className: "max-w-md w-full text-center", children: [
|
|
440
|
-
state === "loading" && /* @__PURE__ */ jsxs("div", { className: "animate-pulse", children: [
|
|
441
|
-
/* @__PURE__ */ jsx("div", { className: "h-8 w-48 bg-muted rounded mx-auto mb-4" }),
|
|
442
|
-
/* @__PURE__ */ jsx("div", { className: "h-4 w-64 bg-muted rounded mx-auto" })
|
|
443
|
-
] }),
|
|
444
|
-
state === "confirming" && /* @__PURE__ */ jsxs("div", { children: [
|
|
445
|
-
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-6 rounded-full bg-amber-100 dark:bg-amber-900/30 flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
446
|
-
"svg",
|
|
447
|
-
{
|
|
448
|
-
className: "w-8 h-8 text-amber-600 dark:text-amber-400",
|
|
449
|
-
fill: "none",
|
|
450
|
-
viewBox: "0 0 24 24",
|
|
451
|
-
stroke: "currentColor",
|
|
452
|
-
strokeWidth: 2,
|
|
453
|
-
children: /* @__PURE__ */ jsx(
|
|
454
|
-
"path",
|
|
455
|
-
{
|
|
456
|
-
strokeLinecap: "round",
|
|
457
|
-
strokeLinejoin: "round",
|
|
458
|
-
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"
|
|
459
|
-
}
|
|
460
|
-
)
|
|
461
|
-
}
|
|
462
|
-
) }),
|
|
463
|
-
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold text-foreground mb-3", children: "Unsubscribe from Newsletter" }),
|
|
464
|
-
/* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mb-8", children: [
|
|
465
|
-
"Are you sure you want to unsubscribe from ",
|
|
466
|
-
displayName,
|
|
467
|
-
" ",
|
|
468
|
-
"newsletter? You will no longer receive updates and news from us."
|
|
469
|
-
] }),
|
|
470
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-3 justify-center", children: [
|
|
471
|
-
/* @__PURE__ */ jsx(
|
|
472
|
-
Button,
|
|
473
|
-
{
|
|
474
|
-
onClick: handleUnsubscribe,
|
|
475
|
-
variant: "destructive",
|
|
476
|
-
className: "px-8",
|
|
477
|
-
children: "Yes, Unsubscribe"
|
|
478
|
-
}
|
|
479
|
-
),
|
|
480
|
-
resubscribeUrl && /* @__PURE__ */ jsx(
|
|
481
|
-
Button,
|
|
482
|
-
{
|
|
483
|
-
variant: "outline",
|
|
484
|
-
onClick: () => {
|
|
485
|
-
window.location.href = resubscribeUrl;
|
|
486
|
-
},
|
|
487
|
-
className: "px-8",
|
|
488
|
-
children: "Cancel"
|
|
489
|
-
}
|
|
490
|
-
)
|
|
491
|
-
] })
|
|
492
|
-
] }),
|
|
493
|
-
state === "processing" && /* @__PURE__ */ jsxs("div", { children: [
|
|
494
|
-
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-6 rounded-full bg-muted flex items-center justify-center", children: /* @__PURE__ */ jsxs(
|
|
495
|
-
"svg",
|
|
496
|
-
{
|
|
497
|
-
className: "w-8 h-8 text-muted-foreground animate-spin",
|
|
498
|
-
fill: "none",
|
|
499
|
-
viewBox: "0 0 24 24",
|
|
500
|
-
children: [
|
|
501
|
-
/* @__PURE__ */ jsx(
|
|
502
|
-
"circle",
|
|
503
|
-
{
|
|
504
|
-
className: "opacity-25",
|
|
505
|
-
cx: "12",
|
|
506
|
-
cy: "12",
|
|
507
|
-
r: "10",
|
|
508
|
-
stroke: "currentColor",
|
|
509
|
-
strokeWidth: "4"
|
|
510
|
-
}
|
|
511
|
-
),
|
|
512
|
-
/* @__PURE__ */ jsx(
|
|
513
|
-
"path",
|
|
514
|
-
{
|
|
515
|
-
className: "opacity-75",
|
|
516
|
-
fill: "currentColor",
|
|
517
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
518
|
-
}
|
|
519
|
-
)
|
|
520
|
-
]
|
|
521
|
-
}
|
|
522
|
-
) }),
|
|
523
|
-
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold text-foreground mb-3", children: "Unsubscribing..." }),
|
|
524
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Please wait while we process your request." })
|
|
525
|
-
] }),
|
|
526
|
-
state === "success" && /* @__PURE__ */ jsxs("div", { children: [
|
|
527
|
-
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-6 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
528
|
-
"svg",
|
|
529
|
-
{
|
|
530
|
-
className: "w-8 h-8 text-green-600 dark:text-green-400",
|
|
531
|
-
fill: "none",
|
|
532
|
-
viewBox: "0 0 24 24",
|
|
533
|
-
stroke: "currentColor",
|
|
534
|
-
strokeWidth: 2,
|
|
535
|
-
children: /* @__PURE__ */ jsx(
|
|
536
|
-
"path",
|
|
537
|
-
{
|
|
538
|
-
strokeLinecap: "round",
|
|
539
|
-
strokeLinejoin: "round",
|
|
540
|
-
d: "M5 13l4 4L19 7"
|
|
541
|
-
}
|
|
542
|
-
)
|
|
543
|
-
}
|
|
544
|
-
) }),
|
|
545
|
-
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold text-foreground mb-3", children: "Successfully Unsubscribed" }),
|
|
546
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-8", children: successCopy }),
|
|
547
|
-
resubscribeUrl && /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
|
|
548
|
-
"Changed your mind?",
|
|
549
|
-
" ",
|
|
550
|
-
/* @__PURE__ */ jsx(
|
|
551
|
-
"a",
|
|
552
|
-
{
|
|
553
|
-
href: resubscribeUrl,
|
|
554
|
-
className: "text-primary underline hover:no-underline",
|
|
555
|
-
children: "Resubscribe"
|
|
556
|
-
}
|
|
557
|
-
)
|
|
558
|
-
] })
|
|
559
|
-
] }),
|
|
560
|
-
state === "error" && /* @__PURE__ */ jsxs("div", { children: [
|
|
561
|
-
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-6 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
562
|
-
"svg",
|
|
563
|
-
{
|
|
564
|
-
className: "w-8 h-8 text-red-600 dark:text-red-400",
|
|
565
|
-
fill: "none",
|
|
566
|
-
viewBox: "0 0 24 24",
|
|
567
|
-
stroke: "currentColor",
|
|
568
|
-
strokeWidth: 2,
|
|
569
|
-
children: /* @__PURE__ */ jsx(
|
|
570
|
-
"path",
|
|
571
|
-
{
|
|
572
|
-
strokeLinecap: "round",
|
|
573
|
-
strokeLinejoin: "round",
|
|
574
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
575
|
-
}
|
|
576
|
-
)
|
|
577
|
-
}
|
|
578
|
-
) }),
|
|
579
|
-
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold text-foreground mb-3", children: "Unsubscribe Failed" }),
|
|
580
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-8", children: error }),
|
|
581
|
-
/* @__PURE__ */ jsx(Button, { onClick: () => setState("confirming"), variant: "outline", children: "Try Again" })
|
|
582
|
-
] }),
|
|
583
|
-
state === "invalid" && /* @__PURE__ */ jsxs("div", { children: [
|
|
584
|
-
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto mb-6 rounded-full bg-gray-100 dark:bg-gray-800 flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
585
|
-
"svg",
|
|
586
|
-
{
|
|
587
|
-
className: "w-8 h-8 text-gray-400",
|
|
588
|
-
fill: "none",
|
|
589
|
-
viewBox: "0 0 24 24",
|
|
590
|
-
stroke: "currentColor",
|
|
591
|
-
strokeWidth: 2,
|
|
592
|
-
children: /* @__PURE__ */ jsx(
|
|
593
|
-
"path",
|
|
594
|
-
{
|
|
595
|
-
strokeLinecap: "round",
|
|
596
|
-
strokeLinejoin: "round",
|
|
597
|
-
d: "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"
|
|
598
|
-
}
|
|
599
|
-
)
|
|
600
|
-
}
|
|
601
|
-
) }),
|
|
602
|
-
/* @__PURE__ */ jsx("h1", { className: "text-2xl font-bold text-foreground mb-3", children: "Invalid Unsubscribe Link" }),
|
|
603
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "This unsubscribe link is invalid or missing. If you want to unsubscribe, please use the link from your newsletter email." })
|
|
604
|
-
] })
|
|
605
|
-
] })
|
|
606
|
-
]
|
|
607
|
-
}
|
|
608
|
-
);
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
export { UnsubscribePage };
|
|
1
|
+
export { UnsubscribePage } from '../chunk-UM55U65W.mjs';
|
|
2
|
+
import '../chunk-N5EC53MH.mjs';
|
|
3
|
+
import '../chunk-KHYXK7FG.mjs';
|
|
4
|
+
import '../chunk-R7G6TWIS.mjs';
|
|
5
|
+
import '../chunk-5JRJ57CL.mjs';
|
|
6
|
+
import '../chunk-VNS5WDWO.mjs';
|
|
612
7
|
//# sourceMappingURL=unsubscribe.mjs.map
|
|
613
8
|
//# sourceMappingURL=unsubscribe.mjs.map
|