@churnkey/react 0.6.4 → 0.7.0

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.
Files changed (36) hide show
  1. package/dist/{chunk-WTFB6T53.cjs → chunk-4ZAJYXG2.cjs} +7 -6
  2. package/dist/chunk-4ZAJYXG2.cjs.map +1 -0
  3. package/dist/{chunk-4WYZSTRI.js → chunk-BODEVZ3K.js} +189 -10
  4. package/dist/chunk-BODEVZ3K.js.map +1 -0
  5. package/dist/{chunk-EYIGZLVT.js → chunk-GH5EKETT.js} +6 -3
  6. package/dist/chunk-GH5EKETT.js.map +1 -0
  7. package/dist/{chunk-OC5H64F4.js → chunk-KS3RWFRH.js} +4 -3
  8. package/dist/chunk-KS3RWFRH.js.map +1 -0
  9. package/dist/{chunk-WVSNF3TN.cjs → chunk-M6Z3BHEH.cjs} +6 -2
  10. package/dist/chunk-M6Z3BHEH.cjs.map +1 -0
  11. package/dist/{chunk-WGS432VT.cjs → chunk-SWEPUHIN.cjs} +192 -9
  12. package/dist/chunk-SWEPUHIN.cjs.map +1 -0
  13. package/dist/core.cjs +30 -14
  14. package/dist/core.d.cts +22 -6
  15. package/dist/core.d.ts +22 -6
  16. package/dist/core.js +2 -2
  17. package/dist/headless.cjs +3 -3
  18. package/dist/headless.d.cts +4 -1
  19. package/dist/headless.d.ts +4 -1
  20. package/dist/headless.js +2 -2
  21. package/dist/index.cjs +235 -161
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +14 -14
  24. package/dist/index.d.ts +14 -14
  25. package/dist/index.js +136 -78
  26. package/dist/index.js.map +1 -1
  27. package/dist/{step-graph-BpoAhd0d.d.cts → step-graph-s1L1wV-P.d.cts} +184 -2
  28. package/dist/{step-graph-BpoAhd0d.d.ts → step-graph-s1L1wV-P.d.ts} +184 -2
  29. package/dist/styles.css +13 -0
  30. package/package.json +1 -1
  31. package/dist/chunk-4WYZSTRI.js.map +0 -1
  32. package/dist/chunk-EYIGZLVT.js.map +0 -1
  33. package/dist/chunk-OC5H64F4.js.map +0 -1
  34. package/dist/chunk-WGS432VT.cjs.map +0 -1
  35. package/dist/chunk-WTFB6T53.cjs.map +0 -1
  36. package/dist/chunk-WVSNF3TN.cjs.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkWTFB6T53_cjs = require('./chunk-WTFB6T53.cjs');
4
- var chunkWVSNF3TN_cjs = require('./chunk-WVSNF3TN.cjs');
5
- var chunkWGS432VT_cjs = require('./chunk-WGS432VT.cjs');
3
+ var chunk4ZAJYXG2_cjs = require('./chunk-4ZAJYXG2.cjs');
4
+ var chunkM6Z3BHEH_cjs = require('./chunk-M6Z3BHEH.cjs');
5
+ var chunkSWEPUHIN_cjs = require('./chunk-SWEPUHIN.cjs');
6
6
  var react = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
 
@@ -24,33 +24,37 @@ function DefaultConfirm({
24
24
  lossesLabel,
25
25
  confirmLabel,
26
26
  goBackLabel,
27
+ periodEndNotice,
27
28
  onConfirm,
28
29
  onGoBack,
29
30
  isProcessing,
30
- classNames
31
+ classNames,
32
+ messages
31
33
  }) {
34
+ const m = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
32
35
  const hasLosses = Array.isArray(losses) && losses.length > 0;
33
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-confirm", classNames?.root), children: [
34
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: title }),
35
- description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: description, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
36
- hasLosses && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-loss-block", classNames?.lossList), children: [
37
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkWGS432VT_cjs.cn("ck-loss-label", classNames?.lossLabel), children: lossesLabel ?? "You'll lose access to:" }),
38
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "ck-loss-list", children: losses.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: chunkWGS432VT_cjs.cn("ck-loss-item", classNames?.lossItem), children: [
39
- /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: chunkWGS432VT_cjs.cn("ck-loss-bullet", classNames?.lossBullet), children: "\u25CF" }),
36
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-confirm", classNames?.root), children: [
37
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: title }),
38
+ description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
39
+ hasLosses && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-loss-block", classNames?.lossList), children: [
40
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkSWEPUHIN_cjs.cn("ck-loss-label", classNames?.lossLabel), children: lossesLabel ?? m.confirm.lossesLabel }),
41
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "ck-loss-list", children: losses.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: chunkSWEPUHIN_cjs.cn("ck-loss-item", classNames?.lossItem), children: [
42
+ /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: chunkSWEPUHIN_cjs.cn("ck-loss-bullet", classNames?.lossBullet), children: "\u25CF" }),
40
43
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: item })
41
44
  ] }, item)) })
42
45
  ] }),
46
+ periodEndNotice && /* @__PURE__ */ jsxRuntime.jsx("p", { className: chunkSWEPUHIN_cjs.cn("ck-period-end", classNames?.periodEndNotice), children: periodEndNotice }),
43
47
  /* @__PURE__ */ jsxRuntime.jsx(
44
48
  "button",
45
49
  {
46
50
  type: "button",
47
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-danger", classNames?.confirmButton),
51
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-danger", classNames?.confirmButton),
48
52
  onClick: onConfirm,
49
53
  disabled: isProcessing,
50
- children: isProcessing ? "Processing..." : confirmLabel
54
+ children: isProcessing ? m.common.processing : confirmLabel
51
55
  }
52
56
  ),
53
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.goBackButton), onClick: onGoBack, children: goBackLabel })
57
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.goBackButton), onClick: onGoBack, children: goBackLabel })
54
58
  ] });
55
59
  }
56
60
  function DefaultFeedback({
@@ -62,20 +66,22 @@ function DefaultFeedback({
62
66
  value,
63
67
  onChange,
64
68
  onSubmit,
65
- classNames
69
+ classNames,
70
+ messages
66
71
  }) {
72
+ const m = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
67
73
  const [focused, setFocused] = react.useState(false);
68
74
  const hasMin = minLength > 0;
69
75
  const isUnderMin = hasMin && value.length > 0 && value.length < minLength;
70
76
  const isValid = !required || value.length >= minLength;
71
- const placeholderText = placeholder ?? (hasMin ? `At least ${minLength} characters\u2026` : "Type your thoughts\u2026");
72
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-feedback", classNames?.root), children: [
73
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: title }),
74
- description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: description, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
77
+ const placeholderText = placeholder ?? (hasMin ? chunkSWEPUHIN_cjs.formatMessage(m.feedback.placeholderWithMin, { minLength }) : m.feedback.placeholder);
78
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-feedback", classNames?.root), children: [
79
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: title }),
80
+ description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
75
81
  /* @__PURE__ */ jsxRuntime.jsxs(
76
82
  "div",
77
83
  {
78
- className: chunkWGS432VT_cjs.cn(
84
+ className: chunkSWEPUHIN_cjs.cn(
79
85
  "ck-feedback-field",
80
86
  focused && "ck-feedback-field--focused",
81
87
  isUnderMin && "ck-feedback-field--invalid"
@@ -84,7 +90,7 @@ function DefaultFeedback({
84
90
  /* @__PURE__ */ jsxRuntime.jsx(
85
91
  "textarea",
86
92
  {
87
- className: chunkWGS432VT_cjs.cn("ck-textarea", classNames?.textarea),
93
+ className: chunkSWEPUHIN_cjs.cn("ck-textarea", classNames?.textarea),
88
94
  placeholder: placeholderText,
89
95
  value,
90
96
  onChange: (e) => onChange(e.target.value),
@@ -96,7 +102,7 @@ function DefaultFeedback({
96
102
  hasMin && /* @__PURE__ */ jsxRuntime.jsxs(
97
103
  "div",
98
104
  {
99
- className: chunkWGS432VT_cjs.cn(
105
+ className: chunkSWEPUHIN_cjs.cn(
100
106
  "ck-character-count",
101
107
  isUnderMin && "ck-character-count--invalid",
102
108
  classNames?.characterCount
@@ -115,10 +121,10 @@ function DefaultFeedback({
115
121
  "button",
116
122
  {
117
123
  type: "button",
118
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.submitButton),
124
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.submitButton),
119
125
  onClick: onSubmit,
120
126
  disabled: !isValid,
121
- children: "Continue"
127
+ children: m.common.continue
122
128
  }
123
129
  )
124
130
  ] });
@@ -130,25 +136,27 @@ function DefaultContactOffer({
130
136
  onAccept,
131
137
  onDecline,
132
138
  isProcessing,
133
- classNames
139
+ classNames,
140
+ messages
134
141
  }) {
142
+ const msg = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
135
143
  const headline = title ?? offer.copy.headline;
136
144
  const body = description ?? offer.copy.body;
137
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
138
- headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: headline }),
139
- body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: body, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
140
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-offer-card", classNames?.card), children: [
145
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
146
+ headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: headline }),
147
+ body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
148
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-offer-card", classNames?.card), children: [
141
149
  /* @__PURE__ */ jsxRuntime.jsx(
142
150
  "button",
143
151
  {
144
152
  type: "button",
145
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
153
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
146
154
  onClick: () => onAccept(),
147
155
  disabled: isProcessing,
148
- children: isProcessing ? "Processing..." : offer.copy.cta
156
+ children: isProcessing ? msg.common.processing : offer.copy.cta
149
157
  }
150
158
  ),
151
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
159
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
152
160
  ] })
153
161
  ] });
154
162
  }
@@ -159,31 +167,33 @@ function DefaultDiscountOffer({
159
167
  onAccept,
160
168
  onDecline,
161
169
  isProcessing,
162
- classNames
170
+ classNames,
171
+ messages
163
172
  }) {
173
+ const msg = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
164
174
  const o = offer;
165
175
  const headline = title ?? offer.copy.headline;
166
176
  const body = description ?? offer.copy.body;
167
- const phrase = chunkWVSNF3TN_cjs.discountPhrase(o);
168
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
169
- headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: headline }),
170
- body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: body, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
171
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-offer-card", classNames?.card), children: [
177
+ const phrase = chunkM6Z3BHEH_cjs.discountPhrase(o);
178
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
179
+ headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: headline }),
180
+ body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
181
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-offer-card", classNames?.card), children: [
172
182
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-details ck-offer-discount", children: [
173
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-discount-eyebrow", children: "Limited-time offer" }),
183
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-discount-eyebrow", children: msg.offer.limitedTimeEyebrow }),
174
184
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-discount-phrase", children: phrase })
175
185
  ] }),
176
186
  /* @__PURE__ */ jsxRuntime.jsx(
177
187
  "button",
178
188
  {
179
189
  type: "button",
180
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
190
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
181
191
  onClick: () => onAccept(),
182
192
  disabled: isProcessing,
183
- children: isProcessing ? "Processing..." : offer.copy.cta
193
+ children: isProcessing ? msg.common.processing : offer.copy.cta
184
194
  }
185
195
  ),
186
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
196
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
187
197
  ] })
188
198
  ] });
189
199
  }
@@ -194,8 +204,10 @@ function DefaultPauseOffer({
194
204
  onAccept,
195
205
  onDecline,
196
206
  isProcessing,
197
- classNames
207
+ classNames,
208
+ messages
198
209
  }) {
210
+ const msg = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
199
211
  const o = offer;
200
212
  const max = Math.max(1, o.months);
201
213
  const [months, setMonths] = react.useState(1);
@@ -203,24 +215,24 @@ function DefaultPauseOffer({
203
215
  const body = description ?? offer.copy.body;
204
216
  const resume = /* @__PURE__ */ new Date();
205
217
  resume.setMonth(resume.getMonth() + months);
206
- const resumeDate = chunkWVSNF3TN_cjs.formatMonthDayLong(resume);
207
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
208
- headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: headline }),
209
- body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: body, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
210
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-offer-card ck-pause-card", classNames?.card), children: [
211
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-pause-eyebrow", children: "We'll see you back on" }),
218
+ const resumeDate = chunkM6Z3BHEH_cjs.formatMonthDayLong(resume);
219
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
220
+ headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: headline }),
221
+ body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
222
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-offer-card ck-pause-card", classNames?.card), children: [
223
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-pause-eyebrow", children: msg.offer.pauseEyebrow }),
212
224
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-pause-date", children: resumeDate }),
213
- max > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkWGS432VT_cjs.cn("ck-pause-chips", classNames?.pauseSlider), children: Array.from({ length: max }, (_, i) => i + 1).map((m) => /* @__PURE__ */ jsxRuntime.jsxs(
225
+ max > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkSWEPUHIN_cjs.cn("ck-pause-chips", classNames?.pauseSlider), children: Array.from({ length: max }, (_, i) => i + 1).map((m) => /* @__PURE__ */ jsxRuntime.jsxs(
214
226
  "button",
215
227
  {
216
228
  type: "button",
217
229
  onClick: () => setMonths(m),
218
- className: chunkWGS432VT_cjs.cn("ck-pause-chip", m === months && "ck-pause-chip--selected"),
230
+ className: chunkSWEPUHIN_cjs.cn("ck-pause-chip", m === months && "ck-pause-chip--selected"),
219
231
  "aria-pressed": m === months,
220
232
  children: [
221
233
  m,
222
234
  " ",
223
- m === 1 ? "month" : "months"
235
+ m === 1 ? msg.common.month : msg.common.months
224
236
  ]
225
237
  },
226
238
  m
@@ -230,13 +242,13 @@ function DefaultPauseOffer({
230
242
  "button",
231
243
  {
232
244
  type: "button",
233
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
245
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
234
246
  onClick: () => onAccept({ months }),
235
247
  disabled: isProcessing,
236
- children: isProcessing ? "Processing..." : offer.copy.cta
248
+ children: isProcessing ? msg.common.processing : offer.copy.cta
237
249
  }
238
250
  ),
239
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
251
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
240
252
  ] });
241
253
  }
242
254
  function Checkmark({ color = "currentColor", size = 14 }) {
@@ -250,8 +262,10 @@ function DefaultPlanChangeOffer({
250
262
  onAccept,
251
263
  onDecline,
252
264
  isProcessing,
253
- classNames
265
+ classNames,
266
+ messages
254
267
  }) {
268
+ const msg = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
255
269
  const o = offer;
256
270
  const plans = o.plans ?? [];
257
271
  const currentPlanId = subscriptions[0]?.items[0]?.price.id;
@@ -260,11 +274,11 @@ function DefaultPlanChangeOffer({
260
274
  const selectedPlan = plans.find((p) => p.id === selectedPlanId) ?? null;
261
275
  const headline = title ?? offer.copy.headline;
262
276
  const body = description ?? offer.copy.body;
263
- const ctaLabel = isProcessing ? "Processing..." : selectedPlan?.name ? `Switch to ${selectedPlan.name}` : offer.copy.cta;
264
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
265
- headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: headline }),
266
- body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: body, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
267
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-offer-card", classNames?.card), children: [
277
+ const ctaLabel = isProcessing ? msg.common.processing : selectedPlan?.name ? chunkSWEPUHIN_cjs.formatMessage(msg.offer.switchToCta, { planName: selectedPlan.name }) : offer.copy.cta;
278
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
279
+ headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: headline }),
280
+ body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
281
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-offer-card", classNames?.card), children: [
268
282
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-details ck-plan-grid", children: plans.map((plan) => {
269
283
  const interval = plan.duration?.interval ?? "month";
270
284
  const currency = plan.amount.currency ?? "USD";
@@ -276,7 +290,7 @@ function DefaultPlanChangeOffer({
276
290
  type: "button",
277
291
  onClick: () => setSelectedPlanId(plan.id),
278
292
  disabled: isCurrent,
279
- className: chunkWGS432VT_cjs.cn(
293
+ className: chunkSWEPUHIN_cjs.cn(
280
294
  "ck-plan-card",
281
295
  isSelected && "ck-plan-card--selected",
282
296
  isCurrent && "ck-plan-card--current"
@@ -285,11 +299,11 @@ function DefaultPlanChangeOffer({
285
299
  children: [
286
300
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-plan-name", children: [
287
301
  plan.name ?? plan.id,
288
- isCurrent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ck-plan-current-badge", children: "Current" })
302
+ isCurrent && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ck-plan-current-badge", children: msg.offer.currentPlanBadge })
289
303
  ] }),
290
304
  plan.tagline && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-plan-tagline", children: plan.tagline }),
291
305
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-plan-price-row", children: [
292
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ck-plan-amount", children: chunkWVSNF3TN_cjs.formatPriceFromMinor(plan.amount.value, currency) }),
306
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ck-plan-amount", children: chunkM6Z3BHEH_cjs.formatPriceFromMinor(plan.amount.value, currency) }),
293
307
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ck-plan-period", children: [
294
308
  "/",
295
309
  interval
@@ -309,13 +323,13 @@ function DefaultPlanChangeOffer({
309
323
  "button",
310
324
  {
311
325
  type: "button",
312
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
326
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
313
327
  onClick: () => selectedPlanId && onAccept({ planId: selectedPlanId }),
314
328
  disabled: isProcessing || !selectedPlanId,
315
329
  children: ctaLabel
316
330
  }
317
331
  ),
318
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
332
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
319
333
  ] })
320
334
  ] });
321
335
  }
@@ -326,8 +340,10 @@ function DefaultRebateOffer({
326
340
  onAccept,
327
341
  onDecline,
328
342
  isProcessing,
329
- classNames
343
+ classNames,
344
+ messages
330
345
  }) {
346
+ const msg = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
331
347
  const o = offer;
332
348
  const headline = title ?? offer.copy.headline;
333
349
  const body = description ?? offer.copy.body;
@@ -335,45 +351,44 @@ function DefaultRebateOffer({
335
351
  const amount = o.amountMinor ?? 0;
336
352
  const refund = o.amountPaidMinor != null && o.netAfterRebateMinor != null ? o.amountPaidMinor - o.netAfterRebateMinor : amount;
337
353
  const taxRefunded = refund - amount;
338
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
339
- headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: headline }),
340
- body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: body, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
341
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-offer-card", classNames?.card), children: [
354
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
355
+ headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: headline }),
356
+ body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
357
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-offer-card", classNames?.card), children: [
342
358
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-rebate", children: [
343
359
  o.amountPaidMinor != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-rebate-row", children: [
344
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "You paid this period" }),
345
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: chunkWVSNF3TN_cjs.formatPriceFromMinor(o.amountPaidMinor, currency) })
360
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: msg.offer.rebate.paidLabel }),
361
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: chunkM6Z3BHEH_cjs.formatPriceFromMinor(o.amountPaidMinor, currency) })
346
362
  ] }),
347
363
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-rebate-row ck-offer-rebate-credit", children: [
348
364
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
349
- "Money back",
365
+ msg.offer.rebate.moneyBackLabel,
350
366
  taxRefunded > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ck-offer-rebate-tax", children: [
351
- " (incl. ",
352
- chunkWVSNF3TN_cjs.formatPriceFromMinor(taxRefunded, currency),
353
- " tax)"
367
+ " ",
368
+ chunkSWEPUHIN_cjs.formatMessage(msg.offer.rebate.inclTax, { amount: chunkM6Z3BHEH_cjs.formatPriceFromMinor(taxRefunded, currency) })
354
369
  ] })
355
370
  ] }),
356
371
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
357
372
  "\u2212",
358
- chunkWVSNF3TN_cjs.formatPriceFromMinor(refund, currency)
373
+ chunkM6Z3BHEH_cjs.formatPriceFromMinor(refund, currency)
359
374
  ] })
360
375
  ] }),
361
376
  o.netAfterRebateMinor != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-rebate-row ck-offer-rebate-total", children: [
362
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Your net for this period" }),
363
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: chunkWVSNF3TN_cjs.formatPriceFromMinor(o.netAfterRebateMinor, currency) })
377
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: msg.offer.rebate.netLabel }),
378
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: chunkM6Z3BHEH_cjs.formatPriceFromMinor(o.netAfterRebateMinor, currency) })
364
379
  ] })
365
380
  ] }),
366
381
  /* @__PURE__ */ jsxRuntime.jsx(
367
382
  "button",
368
383
  {
369
384
  type: "button",
370
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
385
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
371
386
  onClick: () => onAccept(),
372
387
  disabled: isProcessing,
373
- children: isProcessing ? "Processing..." : offer.copy.cta
388
+ children: isProcessing ? msg.common.processing : offer.copy.cta
374
389
  }
375
390
  ),
376
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
391
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
377
392
  ] })
378
393
  ] });
379
394
  }
@@ -381,15 +396,15 @@ function DefaultRedirectOffer({ title, description, offer, onDecline, classNames
381
396
  const url = offer.url;
382
397
  const headline = title ?? offer.copy.headline;
383
398
  const body = description ?? offer.copy.body;
384
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
385
- headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: headline }),
386
- body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: body, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
387
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-offer-card", classNames?.card), children: [
399
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
400
+ headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: headline }),
401
+ body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
402
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-offer-card", classNames?.card), children: [
388
403
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-offer-details", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "ck-redirect-link", children: [
389
404
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: offer.copy.cta }),
390
405
  /* @__PURE__ */ jsxRuntime.jsx(ExternalIcon, {})
391
406
  ] }) }),
392
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
407
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
393
408
  ] })
394
409
  ] });
395
410
  }
@@ -422,28 +437,30 @@ function DefaultTrialExtensionOffer({
422
437
  onAccept,
423
438
  onDecline,
424
439
  isProcessing,
425
- classNames
440
+ classNames,
441
+ messages
426
442
  }) {
443
+ const msg = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
427
444
  const o = offer;
428
445
  const headline = title ?? offer.copy.headline;
429
446
  const body = description ?? offer.copy.body;
430
447
  const end = /* @__PURE__ */ new Date();
431
448
  end.setDate(end.getDate() + o.days);
432
- const newEnd = chunkWVSNF3TN_cjs.formatMonthDay(end);
433
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
434
- headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: headline }),
435
- body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: body, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
436
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-offer-card", classNames?.card), children: [
449
+ const newEnd = chunkM6Z3BHEH_cjs.formatMonthDay(end);
450
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-offer", classNames?.root), children: [
451
+ headline && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: headline }),
452
+ body && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: body, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
453
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-offer-card", classNames?.card), children: [
437
454
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-offer-details ck-trial-block", children: [
438
455
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-trial-badge", children: [
439
456
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-trial-days", children: [
440
457
  "+",
441
458
  o.days
442
459
  ] }),
443
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-trial-unit", children: o.days === 1 ? "day" : "days" })
460
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-trial-unit", children: o.days === 1 ? msg.common.day : msg.common.days })
444
461
  ] }),
445
462
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
446
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-trial-end-label", children: "New end date" }),
463
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-trial-end-label", children: msg.offer.newEndDateLabel }),
447
464
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-trial-end-date", children: newEnd })
448
465
  ] })
449
466
  ] }),
@@ -451,13 +468,13 @@ function DefaultTrialExtensionOffer({
451
468
  "button",
452
469
  {
453
470
  type: "button",
454
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
471
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.acceptButton),
455
472
  onClick: () => onAccept(),
456
473
  disabled: isProcessing,
457
- children: isProcessing ? "Processing..." : offer.copy.cta
474
+ children: isProcessing ? msg.common.processing : offer.copy.cta
458
475
  }
459
476
  ),
460
- /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
477
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button-link", classNames?.declineButton), onClick: onDecline, children: offer.copy.declineCta })
461
478
  ] })
462
479
  ] });
463
480
  }
@@ -493,12 +510,13 @@ function pickOfferComponent(type, components) {
493
510
  return null;
494
511
  }
495
512
  }
496
- function DefaultSuccess({ title, description, onClose, classNames }) {
497
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-success", classNames?.root), children: [
498
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkWGS432VT_cjs.cn("ck-success-icon", classNames?.icon), children: /* @__PURE__ */ jsxRuntime.jsx(Checkmark, { color: "currentColor", size: 26 }) }),
499
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: title }),
500
- description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: description, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
501
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-success-actions", children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.closeButton), onClick: onClose, children: "Done" }) })
513
+ function DefaultSuccess({ title, description, onClose, classNames, messages }) {
514
+ const m = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
515
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-success", classNames?.root), children: [
516
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkSWEPUHIN_cjs.cn("ck-success-icon", classNames?.icon), children: /* @__PURE__ */ jsxRuntime.jsx(Checkmark, { color: "currentColor", size: 26 }) }),
517
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: title }),
518
+ description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
519
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-success-actions", children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.closeButton), onClick: onClose, children: m.common.done }) })
502
520
  ] });
503
521
  }
504
522
  function DefaultReasonButton({ reason, index, isSelected, onSelect }) {
@@ -510,7 +528,7 @@ function DefaultReasonButton({ reason, index, isSelected, onSelect }) {
510
528
  role: "radio",
511
529
  "aria-checked": isSelected,
512
530
  onClick: () => onSelect(reason.id),
513
- className: chunkWGS432VT_cjs.cn("ck-reason-button", isSelected && "ck-reason-button--selected"),
531
+ className: chunkSWEPUHIN_cjs.cn("ck-reason-button", isSelected && "ck-reason-button--selected"),
514
532
  children: [
515
533
  /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: "ck-reason-badge", children: isSelected ? /* @__PURE__ */ jsxRuntime.jsx(Checkmark, { color: "#fff", size: 12 }) : letter }),
516
534
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ck-reason-label", children: reason.label })
@@ -528,15 +546,17 @@ function DefaultSurvey({
528
546
  onFollowupResponseChange,
529
547
  onNext,
530
548
  classNames,
531
- components
549
+ components,
550
+ messages
532
551
  }) {
552
+ const m = messages ?? chunkSWEPUHIN_cjs.defaultMessages;
533
553
  const ReasonButton = components?.ReasonButton ?? DefaultReasonButton;
534
554
  const selected = reasons.find((r) => r.id === selectedReason);
535
555
  const showFollowup = selected?.freeform === true;
536
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWGS432VT_cjs.cn("ck-step ck-step-survey", classNames?.root), children: [
537
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkWGS432VT_cjs.cn("ck-step-title", classNames?.title), children: title }),
538
- description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { html: description, className: chunkWGS432VT_cjs.cn("ck-step-description", classNames?.description) }),
539
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkWGS432VT_cjs.cn("ck-reason-list", classNames?.reasonList), role: "radiogroup", "aria-label": title, children: reasons.map((reason, i) => /* @__PURE__ */ jsxRuntime.jsx(
556
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkSWEPUHIN_cjs.cn("ck-step ck-step-survey", classNames?.root), children: [
557
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: chunkSWEPUHIN_cjs.cn("ck-step-title", classNames?.title), children: title }),
558
+ description && /* @__PURE__ */ jsxRuntime.jsx(RichText, { as: "div", html: description, className: chunkSWEPUHIN_cjs.cn("ck-step-description", classNames?.description) }),
559
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkSWEPUHIN_cjs.cn("ck-reason-list", classNames?.reasonList), role: "radiogroup", "aria-label": title, children: reasons.map((reason, i) => /* @__PURE__ */ jsxRuntime.jsx(
540
560
  ReasonButton,
541
561
  {
542
562
  reason,
@@ -549,28 +569,28 @@ function DefaultSurvey({
549
569
  showFollowup && /* @__PURE__ */ jsxRuntime.jsx(
550
570
  "textarea",
551
571
  {
552
- className: chunkWGS432VT_cjs.cn("ck-reason-followup", classNames?.followupInput),
553
- placeholder: "Tell us more (optional)",
572
+ className: chunkSWEPUHIN_cjs.cn("ck-reason-followup", classNames?.followupInput),
573
+ placeholder: m.survey.followupPlaceholder,
554
574
  rows: 3,
555
575
  value: followupResponse,
556
576
  onChange: (e) => onFollowupResponseChange(e.target.value),
557
- "aria-label": "Additional detail"
577
+ "aria-label": m.survey.followupAriaLabel
558
578
  }
559
579
  ),
560
580
  /* @__PURE__ */ jsxRuntime.jsx(
561
581
  "button",
562
582
  {
563
583
  type: "button",
564
- className: chunkWGS432VT_cjs.cn("ck-button ck-button-primary", classNames?.continueButton),
584
+ className: chunkSWEPUHIN_cjs.cn("ck-button ck-button-primary", classNames?.continueButton),
565
585
  onClick: onNext,
566
586
  disabled: !selectedReason,
567
- children: "Continue"
587
+ children: m.common.continue
568
588
  }
569
589
  )
570
590
  ] });
571
591
  }
572
- function DefaultBackButton({ onBack, className }) {
573
- return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-back-button", className), onClick: onBack, children: [
592
+ function DefaultBackButton({ onBack, className, label }) {
593
+ return /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-back-button", className), onClick: onBack, children: [
574
594
  /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "14", height: "14", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
575
595
  "path",
576
596
  {
@@ -581,11 +601,11 @@ function DefaultBackButton({ onBack, className }) {
581
601
  strokeLinejoin: "round"
582
602
  }
583
603
  ) }),
584
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Back" })
604
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label ?? "Back" })
585
605
  ] });
586
606
  }
587
- function DefaultCloseButton({ onClose, className }) {
588
- return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkWGS432VT_cjs.cn("ck-close-button", className), onClick: onClose, "aria-label": "Close", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) });
607
+ function DefaultCloseButton({ onClose, className, label }) {
608
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: chunkSWEPUHIN_cjs.cn("ck-close-button", className), onClick: onClose, "aria-label": label ?? "Close", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 5L5 15M5 5l10 10", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }) }) });
589
609
  }
590
610
  function trapFocus(container) {
591
611
  const focusableSelector = [
@@ -645,7 +665,7 @@ function DefaultModal({ open, onClose, children, className, overlayClassName })
645
665
  "div",
646
666
  {
647
667
  ref: overlayRef,
648
- className: chunkWGS432VT_cjs.cn("ck-overlay", overlayClassName),
668
+ className: chunkSWEPUHIN_cjs.cn("ck-overlay", overlayClassName),
649
669
  onClick: (e) => {
650
670
  if (e.target === overlayRef.current) onClose();
651
671
  },
@@ -657,7 +677,7 @@ function DefaultModal({ open, onClose, children, className, overlayClassName })
657
677
  "aria-modal": "true",
658
678
  "aria-labelledby": "ck-dialog-title",
659
679
  tabIndex: -1,
660
- className: chunkWGS432VT_cjs.cn("ck-modal", className),
680
+ className: chunkSWEPUHIN_cjs.cn("ck-modal", className),
661
681
  children
662
682
  }
663
683
  )
@@ -683,7 +703,7 @@ function useColorScheme(preference) {
683
703
  return system;
684
704
  }
685
705
  function CancelFlow(props) {
686
- const { machine, state, isLoading, loadError, retry } = chunkWTFB6T53_cjs.useCancelFlowMachine(props);
706
+ const { machine, state, isLoading, loadError, retry } = chunk4ZAJYXG2_cjs.useCancelFlowMachine(props);
687
707
  if (isLoading || loadError) {
688
708
  return /* @__PURE__ */ jsxRuntime.jsx(
689
709
  LoadStatus,
@@ -694,7 +714,8 @@ function CancelFlow(props) {
694
714
  onClose: props.onClose,
695
715
  isLoading,
696
716
  loadError,
697
- onRetry: retry
717
+ onRetry: retry,
718
+ messages: machine.messages
698
719
  }
699
720
  );
700
721
  }
@@ -717,16 +738,17 @@ function LoadStatus({
717
738
  onClose,
718
739
  isLoading,
719
740
  loadError,
720
- onRetry
741
+ onRetry,
742
+ messages
721
743
  }) {
722
744
  const scheme = useColorScheme(appearance?.colorScheme);
723
- const appearanceStyle = chunkWGS432VT_cjs.appearanceToStyle(appearance);
745
+ const appearanceStyle = chunkSWEPUHIN_cjs.appearanceToStyle(appearance);
724
746
  const Modal = components?.Modal ?? DefaultModal;
725
747
  const CloseButton = components?.CloseButton ?? DefaultCloseButton;
726
748
  const handleClose = onClose ?? (() => {
727
749
  });
728
750
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-cancel-flow", "data-color-scheme": scheme, style: appearanceStyle, children: /* @__PURE__ */ jsxRuntime.jsxs(Modal, { open: true, onClose: handleClose, className: classNames?.modal, overlayClassName: classNames?.overlay, children: [
729
- /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClose: handleClose, className: classNames?.closeButton }),
751
+ /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClose: handleClose, className: classNames?.closeButton, label: messages.common.close }),
730
752
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-content", children: [
731
753
  isLoading && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-loading", style: { padding: "32px", textAlign: "center" }, children: [
732
754
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -744,10 +766,10 @@ function LoadStatus({
744
766
  }
745
767
  }
746
768
  ),
747
- /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "var(--ck-color-text-secondary, #6b7280)" }, children: "Loading your options..." })
769
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "var(--ck-color-text-secondary, #6b7280)" }, children: messages.common.loading })
748
770
  ] }),
749
771
  loadError && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-error", role: "alert", style: { padding: "32px", textAlign: "center" }, children: [
750
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ck-error-message", style: { marginBottom: 16 }, children: "We couldn't load your cancellation options. Please try again." }),
772
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ck-error-message", style: { marginBottom: 16 }, children: messages.common.loadError }),
751
773
  /* @__PURE__ */ jsxRuntime.jsx(
752
774
  "button",
753
775
  {
@@ -764,7 +786,7 @@ function LoadStatus({
764
786
  borderRadius: "var(--ck-border-radius, 8px)",
765
787
  cursor: "pointer"
766
788
  },
767
- children: "Try again"
789
+ children: messages.common.tryAgain
768
790
  }
769
791
  )
770
792
  ] })
@@ -773,15 +795,16 @@ function LoadStatus({
773
795
  }
774
796
  function FlowShell({ machine, state, appearance, classNames, components, customComponents }) {
775
797
  const scheme = useColorScheme(appearance?.colorScheme);
776
- const appearanceStyle = chunkWGS432VT_cjs.appearanceToStyle(appearance);
798
+ const appearanceStyle = chunkSWEPUHIN_cjs.appearanceToStyle(appearance);
799
+ const messages = machine.messages;
777
800
  const Modal = components?.Modal ?? DefaultModal;
778
801
  const CloseButton = components?.CloseButton ?? DefaultCloseButton;
779
802
  const BackButton = components?.BackButton ?? DefaultBackButton;
780
803
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-cancel-flow", "data-color-scheme": scheme, style: appearanceStyle, children: /* @__PURE__ */ jsxRuntime.jsxs(Modal, { open: true, onClose: machine.close, className: classNames?.modal, overlayClassName: classNames?.overlay, children: [
781
- /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClose: machine.close, className: classNames?.closeButton }),
804
+ /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { onClose: machine.close, className: classNames?.closeButton, label: messages.common.close }),
782
805
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ck-content", children: [
783
- machine.canGoBack && /* @__PURE__ */ jsxRuntime.jsx(BackButton, { onBack: machine.back, className: classNames?.backButton }),
784
- state.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-error", role: "alert", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ck-error-message", children: "Something went wrong. Please try again." }) }),
806
+ machine.canGoBack && /* @__PURE__ */ jsxRuntime.jsx(BackButton, { onBack: machine.back, className: classNames?.backButton, label: messages.common.back }),
807
+ state.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ck-error", role: "alert", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "ck-error-message", children: messages.common.error }) }),
785
808
  /* @__PURE__ */ jsxRuntime.jsx(StepRenderer, { state, machine, components, customComponents })
786
809
  ] })
787
810
  ] }) });
@@ -793,6 +816,7 @@ function StepRenderer({
793
816
  customComponents
794
817
  }) {
795
818
  const stepConfig = machine.currentStep;
819
+ const messages = machine.messages;
796
820
  switch (state.step) {
797
821
  case "survey": {
798
822
  const Survey = components?.Survey ?? DefaultSurvey;
@@ -800,7 +824,7 @@ function StepRenderer({
800
824
  return /* @__PURE__ */ jsxRuntime.jsx(
801
825
  Survey,
802
826
  {
803
- title: config?.title ?? chunkWGS432VT_cjs.defaultTitles.survey,
827
+ title: config?.title ?? messages.survey.title,
804
828
  description: config?.description,
805
829
  customer: state.customer,
806
830
  subscriptions: state.subscriptions,
@@ -811,7 +835,8 @@ function StepRenderer({
811
835
  onFollowupResponseChange: machine.setFollowupResponse,
812
836
  onNext: machine.next,
813
837
  classNames: config?.classNames,
814
- components
838
+ components,
839
+ messages
815
840
  }
816
841
  );
817
842
  }
@@ -832,7 +857,7 @@ function StepRenderer({
832
857
  }
833
858
  );
834
859
  }
835
- if (!chunkWGS432VT_cjs.BUILT_IN_OFFER_TYPES.includes(offer.type)) {
860
+ if (!chunkSWEPUHIN_cjs.BUILT_IN_OFFER_TYPES.includes(offer.type)) {
836
861
  return /* @__PURE__ */ jsxRuntime.jsx(UnregisteredOfferFallback, { offerType: offer.type, onSkip: machine.decline });
837
862
  }
838
863
  const Offer = components?.Offer ?? DefaultOffer;
@@ -849,7 +874,8 @@ function StepRenderer({
849
874
  onDecline: machine.decline,
850
875
  isProcessing: state.isProcessing,
851
876
  classNames: config?.classNames,
852
- components
877
+ components,
878
+ messages
853
879
  }
854
880
  );
855
881
  }
@@ -859,7 +885,7 @@ function StepRenderer({
859
885
  return /* @__PURE__ */ jsxRuntime.jsx(
860
886
  Feedback,
861
887
  {
862
- title: config?.title ?? chunkWGS432VT_cjs.defaultTitles.feedback,
888
+ title: config?.title ?? messages.feedback.title,
863
889
  description: config?.description,
864
890
  customer: state.customer,
865
891
  subscriptions: state.subscriptions,
@@ -869,7 +895,8 @@ function StepRenderer({
869
895
  value: state.feedback,
870
896
  onChange: machine.setFeedback,
871
897
  onSubmit: machine.next,
872
- classNames: config?.classNames
898
+ classNames: config?.classNames,
899
+ messages
873
900
  }
874
901
  );
875
902
  }
@@ -879,18 +906,20 @@ function StepRenderer({
879
906
  return /* @__PURE__ */ jsxRuntime.jsx(
880
907
  Confirm,
881
908
  {
882
- title: config?.title ?? chunkWGS432VT_cjs.defaultTitles.confirm,
909
+ title: config?.title ?? messages.confirm.title,
883
910
  description: config?.description,
884
911
  customer: state.customer,
885
912
  subscriptions: state.subscriptions,
886
913
  losses: config?.losses,
887
914
  lossesLabel: config?.lossesLabel,
888
- confirmLabel: config?.confirmLabel ?? "Cancel subscription",
889
- goBackLabel: config?.goBackLabel ?? "Go back",
915
+ confirmLabel: config?.confirmLabel ?? chunkSWEPUHIN_cjs.selectTiming(messages.confirm.cta, state.cancelAtPeriodEnd),
916
+ goBackLabel: config?.goBackLabel ?? messages.confirm.goBack,
917
+ periodEndNotice: resolvePeriodEndNotice(state, messages),
890
918
  onConfirm: machine.cancel,
891
919
  onGoBack: machine.back,
892
920
  isProcessing: state.isProcessing,
893
- classNames: config?.classNames
921
+ classNames: config?.classNames,
922
+ messages
894
923
  }
895
924
  );
896
925
  }
@@ -898,17 +927,20 @@ function StepRenderer({
898
927
  const Success = components?.Success ?? DefaultSuccess;
899
928
  const config = stepConfig;
900
929
  const isSaved = state.outcome === "saved";
930
+ const perOffer = isSaved ? savedOfferCopy(messages, state.acceptedOffer) : void 0;
901
931
  return /* @__PURE__ */ jsxRuntime.jsx(
902
932
  Success,
903
933
  {
904
934
  outcome: state.outcome ?? "cancelled",
905
935
  offer: machine.currentOffer ?? void 0,
906
- title: isSaved ? config?.savedTitle ?? "Welcome back!" : config?.cancelledTitle ?? "Subscription cancelled",
907
- description: isSaved ? config?.savedDescription ?? "Your offer has been applied." : config?.cancelledDescription ?? "We're sorry to see you go.",
936
+ acceptedOffer: state.acceptedOffer ?? void 0,
937
+ title: isSaved ? config?.savedTitle ?? perOffer?.title ?? messages.success.saved.title : config?.cancelledTitle ?? chunkSWEPUHIN_cjs.selectTiming(messages.success.cancelled.title, state.cancelAtPeriodEnd),
938
+ description: isSaved ? config?.savedDescription ?? pauseResumeDescription(messages, state.acceptedOffer) ?? perOffer?.description ?? messages.success.saved.description : config?.cancelledDescription ?? chunkSWEPUHIN_cjs.selectTiming(messages.success.cancelled.description, state.cancelAtPeriodEnd),
908
939
  customer: state.customer,
909
940
  subscriptions: state.subscriptions,
910
941
  onClose: machine.close,
911
- classNames: config?.classNames
942
+ classNames: config?.classNames,
943
+ messages
912
944
  }
913
945
  );
914
946
  }
@@ -936,6 +968,32 @@ function StepRenderer({
936
968
  }
937
969
  }
938
970
  }
971
+ var SAVED_OFFER_COPY_TYPES = ["discount", "pause", "trial_extension", "plan_change", "rebate"];
972
+ function savedOfferCopy(messages, offer) {
973
+ if (!offer) return void 0;
974
+ if (!SAVED_OFFER_COPY_TYPES.includes(offer.type)) return void 0;
975
+ return messages.success.saved[offer.type];
976
+ }
977
+ function pauseResumeDescription(messages, offer) {
978
+ if (offer?.type !== "pause") return void 0;
979
+ const months = offer.result?.months;
980
+ if (typeof months !== "number" || months < 1) return void 0;
981
+ const resume = /* @__PURE__ */ new Date();
982
+ if (offer.interval === "week") {
983
+ resume.setDate(resume.getDate() + months * 7);
984
+ } else {
985
+ resume.setMonth(resume.getMonth() + months);
986
+ }
987
+ return chunkSWEPUHIN_cjs.formatMessage(messages.success.saved.pause.resumeDescription, { resumeDate: chunkM6Z3BHEH_cjs.formatShortDate(resume) });
988
+ }
989
+ function resolvePeriodEndNotice(state, messages) {
990
+ if (state.cancelAtPeriodEnd !== true) return void 0;
991
+ const template = chunkSWEPUHIN_cjs.selectTiming(messages.confirm.periodEndNotice, state.cancelAtPeriodEnd);
992
+ if (!template) return void 0;
993
+ const periodEnd = chunkM6Z3BHEH_cjs.formatPeriodEnd(state.subscriptions);
994
+ if (!periodEnd) return void 0;
995
+ return chunkSWEPUHIN_cjs.formatMessage(template, { periodEnd });
996
+ }
939
997
  function UnregisteredStepFallback({ step, onSkip }) {
940
998
  react.useEffect(() => {
941
999
  console.warn(`[churnkey] No component registered for step type "${step}". Skipping.`);
@@ -953,55 +1011,71 @@ function UnregisteredOfferFallback({ offerType, onSkip }) {
953
1011
 
954
1012
  Object.defineProperty(exports, "useCancelFlow", {
955
1013
  enumerable: true,
956
- get: function () { return chunkWTFB6T53_cjs.useCancelFlow; }
1014
+ get: function () { return chunk4ZAJYXG2_cjs.useCancelFlow; }
957
1015
  });
958
1016
  Object.defineProperty(exports, "calculateDiscountedPrice", {
959
1017
  enumerable: true,
960
- get: function () { return chunkWVSNF3TN_cjs.calculateDiscountedPrice; }
1018
+ get: function () { return chunkM6Z3BHEH_cjs.calculateDiscountedPrice; }
961
1019
  });
962
1020
  Object.defineProperty(exports, "formatPeriodEnd", {
963
1021
  enumerable: true,
964
- get: function () { return chunkWVSNF3TN_cjs.formatPeriodEnd; }
1022
+ get: function () { return chunkM6Z3BHEH_cjs.formatPeriodEnd; }
965
1023
  });
966
1024
  Object.defineProperty(exports, "formatPrice", {
967
1025
  enumerable: true,
968
- get: function () { return chunkWVSNF3TN_cjs.formatPrice; }
1026
+ get: function () { return chunkM6Z3BHEH_cjs.formatPrice; }
969
1027
  });
970
1028
  Object.defineProperty(exports, "AnalyticsClient", {
971
1029
  enumerable: true,
972
- get: function () { return chunkWGS432VT_cjs.AnalyticsClient; }
1030
+ get: function () { return chunkSWEPUHIN_cjs.AnalyticsClient; }
973
1031
  });
974
1032
  Object.defineProperty(exports, "BUILT_IN_OFFER_TYPES", {
975
1033
  enumerable: true,
976
- get: function () { return chunkWGS432VT_cjs.BUILT_IN_OFFER_TYPES; }
1034
+ get: function () { return chunkSWEPUHIN_cjs.BUILT_IN_OFFER_TYPES; }
977
1035
  });
978
1036
  Object.defineProperty(exports, "BUILT_IN_STEP_TYPES", {
979
1037
  enumerable: true,
980
- get: function () { return chunkWGS432VT_cjs.BUILT_IN_STEP_TYPES; }
1038
+ get: function () { return chunkSWEPUHIN_cjs.BUILT_IN_STEP_TYPES; }
981
1039
  });
982
1040
  Object.defineProperty(exports, "CancelFlowMachine", {
983
1041
  enumerable: true,
984
- get: function () { return chunkWGS432VT_cjs.CancelFlowMachine; }
1042
+ get: function () { return chunkSWEPUHIN_cjs.CancelFlowMachine; }
985
1043
  });
986
1044
  Object.defineProperty(exports, "ChurnkeyApi", {
987
1045
  enumerable: true,
988
- get: function () { return chunkWGS432VT_cjs.ChurnkeyApi; }
1046
+ get: function () { return chunkSWEPUHIN_cjs.ChurnkeyApi; }
989
1047
  });
990
1048
  Object.defineProperty(exports, "appearanceToStyle", {
991
1049
  enumerable: true,
992
- get: function () { return chunkWGS432VT_cjs.appearanceToStyle; }
1050
+ get: function () { return chunkSWEPUHIN_cjs.appearanceToStyle; }
1051
+ });
1052
+ Object.defineProperty(exports, "buildMessages", {
1053
+ enumerable: true,
1054
+ get: function () { return chunkSWEPUHIN_cjs.buildMessages; }
993
1055
  });
994
1056
  Object.defineProperty(exports, "cn", {
995
1057
  enumerable: true,
996
- get: function () { return chunkWGS432VT_cjs.cn; }
1058
+ get: function () { return chunkSWEPUHIN_cjs.cn; }
997
1059
  });
998
1060
  Object.defineProperty(exports, "decodeSessionToken", {
999
1061
  enumerable: true,
1000
- get: function () { return chunkWGS432VT_cjs.decodeSessionToken; }
1062
+ get: function () { return chunkSWEPUHIN_cjs.decodeSessionToken; }
1063
+ });
1064
+ Object.defineProperty(exports, "defaultMessages", {
1065
+ enumerable: true,
1066
+ get: function () { return chunkSWEPUHIN_cjs.defaultMessages; }
1001
1067
  });
1002
1068
  Object.defineProperty(exports, "defaultTitles", {
1003
1069
  enumerable: true,
1004
- get: function () { return chunkWGS432VT_cjs.defaultTitles; }
1070
+ get: function () { return chunkSWEPUHIN_cjs.defaultTitles; }
1071
+ });
1072
+ Object.defineProperty(exports, "formatMessage", {
1073
+ enumerable: true,
1074
+ get: function () { return chunkSWEPUHIN_cjs.formatMessage; }
1075
+ });
1076
+ Object.defineProperty(exports, "selectTiming", {
1077
+ enumerable: true,
1078
+ get: function () { return chunkSWEPUHIN_cjs.selectTiming; }
1005
1079
  });
1006
1080
  exports.CancelFlow = CancelFlow;
1007
1081
  exports.DefaultBackButton = DefaultBackButton;