@landform.io/sdk 0.1.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.
Files changed (63) hide show
  1. package/dist/api/index.cjs +17 -0
  2. package/dist/api/index.cjs.map +1 -0
  3. package/dist/api/index.d.cts +48 -0
  4. package/dist/api/index.d.ts +48 -0
  5. package/dist/api/index.js +4 -0
  6. package/dist/api/index.js.map +1 -0
  7. package/dist/chunk-52W6RI6C.cjs +4 -0
  8. package/dist/chunk-52W6RI6C.cjs.map +1 -0
  9. package/dist/chunk-DASQI7IA.cjs +4 -0
  10. package/dist/chunk-DASQI7IA.cjs.map +1 -0
  11. package/dist/chunk-EL7YGOTY.js +3 -0
  12. package/dist/chunk-EL7YGOTY.js.map +1 -0
  13. package/dist/chunk-GVOTY5NG.js +3 -0
  14. package/dist/chunk-GVOTY5NG.js.map +1 -0
  15. package/dist/chunk-HUIMGLDC.js +488 -0
  16. package/dist/chunk-HUIMGLDC.js.map +1 -0
  17. package/dist/chunk-I6L5OCM3.js +1657 -0
  18. package/dist/chunk-I6L5OCM3.js.map +1 -0
  19. package/dist/chunk-IQXKFO6Q.cjs +55 -0
  20. package/dist/chunk-IQXKFO6Q.cjs.map +1 -0
  21. package/dist/chunk-P2GUKJHH.cjs +117 -0
  22. package/dist/chunk-P2GUKJHH.cjs.map +1 -0
  23. package/dist/chunk-PDUJU32P.js +687 -0
  24. package/dist/chunk-PDUJU32P.js.map +1 -0
  25. package/dist/chunk-PKHTPGWQ.js +114 -0
  26. package/dist/chunk-PKHTPGWQ.js.map +1 -0
  27. package/dist/chunk-V7WAYO2Q.js +48 -0
  28. package/dist/chunk-V7WAYO2Q.js.map +1 -0
  29. package/dist/chunk-WHV333XL.cjs +1684 -0
  30. package/dist/chunk-WHV333XL.cjs.map +1 -0
  31. package/dist/chunk-WIFNU3FA.cjs +497 -0
  32. package/dist/chunk-WIFNU3FA.cjs.map +1 -0
  33. package/dist/chunk-ZLOP4BTK.cjs +695 -0
  34. package/dist/chunk-ZLOP4BTK.cjs.map +1 -0
  35. package/dist/components/index.cjs +99 -0
  36. package/dist/components/index.cjs.map +1 -0
  37. package/dist/components/index.d.cts +166 -0
  38. package/dist/components/index.d.ts +166 -0
  39. package/dist/components/index.js +6 -0
  40. package/dist/components/index.js.map +1 -0
  41. package/dist/hooks/index.cjs +35 -0
  42. package/dist/hooks/index.cjs.map +1 -0
  43. package/dist/hooks/index.d.cts +75 -0
  44. package/dist/hooks/index.d.ts +75 -0
  45. package/dist/hooks/index.js +6 -0
  46. package/dist/hooks/index.js.map +1 -0
  47. package/dist/index-DoRZImTl.d.cts +590 -0
  48. package/dist/index-DoRZImTl.d.ts +590 -0
  49. package/dist/index.cjs +186 -0
  50. package/dist/index.cjs.map +1 -0
  51. package/dist/index.d.cts +8 -0
  52. package/dist/index.d.ts +8 -0
  53. package/dist/index.js +9 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/theme/index.cjs +61 -0
  56. package/dist/theme/index.cjs.map +1 -0
  57. package/dist/theme/index.d.cts +65 -0
  58. package/dist/theme/index.d.ts +65 -0
  59. package/dist/theme/index.js +4 -0
  60. package/dist/theme/index.js.map +1 -0
  61. package/dist/useForm-D1mB6REv.d.ts +48 -0
  62. package/dist/useForm-kF8xK1mJ.d.cts +48 -0
  63. package/package.json +101 -0
@@ -0,0 +1,1684 @@
1
+ 'use strict';
2
+
3
+ var chunkWIFNU3FA_cjs = require('./chunk-WIFNU3FA.cjs');
4
+ var React2 = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
+
9
+ var React2__default = /*#__PURE__*/_interopDefault(React2);
10
+
11
+ var FormContext = React2.createContext(null);
12
+ function useFormContext() {
13
+ const ctx = React2.useContext(FormContext);
14
+ if (!ctx) {
15
+ throw new Error("useFormContext must be used within a FormProvider");
16
+ }
17
+ return ctx;
18
+ }
19
+ function FormProvider({ children, ...options }) {
20
+ const form = chunkWIFNU3FA_cjs.useForm(options);
21
+ const contextValue = React2.useMemo(
22
+ () => ({
23
+ ...form,
24
+ content: options.content,
25
+ settings: options.settings
26
+ }),
27
+ [form, options.content, options.settings]
28
+ );
29
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkWIFNU3FA_cjs.ThemeContext.Provider, { value: options.theme, children: /* @__PURE__ */ jsxRuntime.jsx(FormContext.Provider, { value: contextValue, children }) });
30
+ }
31
+ function WelcomeScreen({ screen, onStart }) {
32
+ const { title, properties, attachment } = screen;
33
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-screen", children: [
34
+ attachment && attachment.type === "image" && /* @__PURE__ */ jsxRuntime.jsx(
35
+ "img",
36
+ {
37
+ src: attachment.href,
38
+ alt: attachment.properties?.description || "",
39
+ style: { maxWidth: "100%", maxHeight: "300px", marginBottom: "2rem" }
40
+ }
41
+ ),
42
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "lf-screen-title", children: title }),
43
+ properties.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lf-screen-description", children: properties.description }),
44
+ properties.showButton && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lf-button", onClick: onStart, children: properties.buttonText || "Start" })
45
+ ] });
46
+ }
47
+ function ThankYouScreen({ screen }) {
48
+ const { title, properties, attachment } = screen;
49
+ const handleButtonClick = () => {
50
+ switch (properties.buttonMode) {
51
+ case "reload":
52
+ window.location.reload();
53
+ break;
54
+ case "redirect":
55
+ if (properties.redirectUrl) {
56
+ window.location.href = properties.redirectUrl;
57
+ }
58
+ break;
59
+ }
60
+ };
61
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-screen", children: [
62
+ attachment && attachment.type === "image" && /* @__PURE__ */ jsxRuntime.jsx(
63
+ "img",
64
+ {
65
+ src: attachment.href,
66
+ alt: attachment.properties?.description || "",
67
+ style: { maxWidth: "100%", maxHeight: "300px", marginBottom: "2rem" }
68
+ }
69
+ ),
70
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "lf-screen-title", children: title }),
71
+ properties.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lf-screen-description", children: properties.description }),
72
+ properties.showButton && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lf-button", onClick: handleButtonClick, children: properties.buttonText || "Done" })
73
+ ] });
74
+ }
75
+ function QuestionHeader({
76
+ field,
77
+ questionNumber,
78
+ showQuestionNumber
79
+ }) {
80
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "var(--lf-spacing-question)" }, children: [
81
+ showQuestionNumber && questionNumber !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(
82
+ "span",
83
+ {
84
+ className: "lf-question-description",
85
+ style: { display: "block", marginBottom: "0.25rem", fontSize: "0.875rem" },
86
+ children: questionNumber
87
+ }
88
+ ),
89
+ /* @__PURE__ */ jsxRuntime.jsxs("h2", { className: "lf-question-title", children: [
90
+ field.title,
91
+ field.validations?.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-required", style: { marginLeft: "0.25rem" }, children: "*" })
92
+ ] }),
93
+ field.description && /* @__PURE__ */ jsxRuntime.jsx(
94
+ "p",
95
+ {
96
+ className: "lf-question-description",
97
+ style: { marginTop: "0.5rem", fontSize: "1rem" },
98
+ children: field.description
99
+ }
100
+ )
101
+ ] });
102
+ }
103
+ function MultipleChoice({
104
+ field,
105
+ value,
106
+ error,
107
+ onChange,
108
+ onNext,
109
+ showQuestionNumber,
110
+ questionNumber,
111
+ showKeyHints,
112
+ systemMessages
113
+ }) {
114
+ const theme = chunkWIFNU3FA_cjs.useThemeContext();
115
+ const selectedValues = value || [];
116
+ const { choices, allowMultipleSelection } = field.properties;
117
+ const isCardStyle = theme.componentVariants?.choiceStyle === "card";
118
+ const choiceLayout = theme.componentVariants?.choiceLayout || "single-column";
119
+ const choiceIndicator = theme.componentVariants?.choiceIndicator || "checkmark";
120
+ const choiceContainerMaxWidth = theme.componentVariants?.choiceContainerMaxWidth;
121
+ const handleChoiceClick = (choiceRef) => {
122
+ if (allowMultipleSelection) {
123
+ const newValues = selectedValues.includes(choiceRef) ? selectedValues.filter((v) => v !== choiceRef) : [...selectedValues, choiceRef];
124
+ onChange(newValues);
125
+ } else {
126
+ const newValue = [choiceRef];
127
+ onChange(newValue);
128
+ onNext(newValue);
129
+ }
130
+ };
131
+ React2__default.default.useEffect(() => {
132
+ const handleKeyDown = (e) => {
133
+ const key = e.key.toUpperCase();
134
+ const index = key.charCodeAt(0) - 65;
135
+ if (index >= 0 && index < choices.length) {
136
+ handleChoiceClick(choices[index].ref);
137
+ }
138
+ };
139
+ if (showKeyHints) {
140
+ window.addEventListener("keydown", handleKeyDown);
141
+ return () => window.removeEventListener("keydown", handleKeyDown);
142
+ }
143
+ }, [choices, showKeyHints, selectedValues]);
144
+ const containerStyle = choiceLayout === "single-column" ? {
145
+ display: "flex",
146
+ flexDirection: "column",
147
+ gap: "var(--lf-spacing-option)"
148
+ } : {
149
+ display: "grid",
150
+ gridTemplateColumns: choiceLayout === "two-column" ? "repeat(2, 1fr)" : "repeat(auto-fit, minmax(160px, 1fr))",
151
+ gap: "var(--lf-spacing-option)",
152
+ maxWidth: choiceContainerMaxWidth || void 0,
153
+ margin: choiceContainerMaxWidth ? "0 auto" : void 0
154
+ };
155
+ const renderIndicator = (isSelected) => {
156
+ if (choiceIndicator === "none") {
157
+ return null;
158
+ }
159
+ if (choiceIndicator === "arrow") {
160
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-choice-indicator", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", children: [
161
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "9", r: "9", fill: isSelected ? "#111113" : "white" }),
162
+ /* @__PURE__ */ jsxRuntime.jsx(
163
+ "path",
164
+ {
165
+ d: "M8 5.5L11.5 9L8 12.5",
166
+ stroke: isSelected ? "white" : "black",
167
+ strokeWidth: "2.5",
168
+ strokeLinecap: "round",
169
+ strokeLinejoin: "round"
170
+ }
171
+ )
172
+ ] }) });
173
+ }
174
+ if (choiceIndicator === "radio") {
175
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-choice-indicator", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", children: [
176
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "9", r: "8", stroke: isSelected ? "var(--lf-color-primary)" : "#E5E7EB", strokeWidth: "2", fill: "none" }),
177
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "9", r: "5", fill: "var(--lf-color-primary)" })
178
+ ] }) });
179
+ }
180
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-choice-indicator", children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(
181
+ "svg",
182
+ {
183
+ width: "14",
184
+ height: "14",
185
+ viewBox: "0 0 24 24",
186
+ fill: "none",
187
+ stroke: "currentColor",
188
+ strokeWidth: "3",
189
+ strokeLinecap: "round",
190
+ strokeLinejoin: "round",
191
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
192
+ }
193
+ ) });
194
+ };
195
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
196
+ /* @__PURE__ */ jsxRuntime.jsx(
197
+ QuestionHeader,
198
+ {
199
+ field,
200
+ questionNumber,
201
+ showQuestionNumber
202
+ }
203
+ ),
204
+ allowMultipleSelection && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lf-field-hint", style: { marginBottom: "var(--lf-spacing-option)", opacity: 0.7 }, children: systemMessages?.multipleSelectionHint || "Choose as many as you like" }),
205
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyle, children: choices.map((choice, index) => {
206
+ const isSelected = selectedValues.includes(choice.ref);
207
+ if (isCardStyle) {
208
+ return /* @__PURE__ */ jsxRuntime.jsxs(
209
+ "button",
210
+ {
211
+ type: "button",
212
+ onClick: () => handleChoiceClick(choice.ref),
213
+ className: `lf-choice-card ${isSelected ? "lf-choice-card-selected" : ""}`,
214
+ children: [
215
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1 }, children: choice.label }),
216
+ renderIndicator(isSelected)
217
+ ]
218
+ },
219
+ choice.ref
220
+ );
221
+ }
222
+ return /* @__PURE__ */ jsxRuntime.jsxs(
223
+ "button",
224
+ {
225
+ type: "button",
226
+ onClick: () => handleChoiceClick(choice.ref),
227
+ className: `lf-choice ${isSelected ? "lf-choice-selected" : ""}`,
228
+ children: [
229
+ showKeyHints && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-key-hint", children: String.fromCharCode(65 + index) }),
230
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { flex: 1 }, children: choice.label }),
231
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(
232
+ "svg",
233
+ {
234
+ width: "20",
235
+ height: "20",
236
+ viewBox: "0 0 24 24",
237
+ fill: "none",
238
+ stroke: "currentColor",
239
+ strokeWidth: "3",
240
+ strokeLinecap: "round",
241
+ strokeLinejoin: "round",
242
+ style: { color: "var(--lf-color-primary)" },
243
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
244
+ }
245
+ )
246
+ ]
247
+ },
248
+ choice.ref
249
+ );
250
+ }) }),
251
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${field.ref}-error`, className: "lf-error", children: error })
252
+ ] });
253
+ }
254
+ function NumberField({
255
+ field,
256
+ value,
257
+ error,
258
+ onChange,
259
+ onNext,
260
+ showQuestionNumber,
261
+ questionNumber
262
+ }) {
263
+ const { onKeyDown } = chunkWIFNU3FA_cjs.useField({
264
+ field,
265
+ value,
266
+ error,
267
+ onChange,
268
+ onNext
269
+ });
270
+ const handleChange = (e) => {
271
+ const val = e.target.value;
272
+ if (val === "") {
273
+ onChange("");
274
+ } else {
275
+ const num = parseFloat(val);
276
+ if (!isNaN(num)) {
277
+ onChange(num);
278
+ }
279
+ }
280
+ };
281
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
282
+ /* @__PURE__ */ jsxRuntime.jsx(
283
+ QuestionHeader,
284
+ {
285
+ field,
286
+ questionNumber,
287
+ showQuestionNumber
288
+ }
289
+ ),
290
+ /* @__PURE__ */ jsxRuntime.jsx(
291
+ "input",
292
+ {
293
+ type: "number",
294
+ value: value !== void 0 ? String(value) : "",
295
+ onChange: handleChange,
296
+ onKeyDown,
297
+ placeholder: field.properties?.placeholder,
298
+ min: field.validations?.minValue,
299
+ max: field.validations?.maxValue,
300
+ className: "lf-input-underline",
301
+ "aria-invalid": !!error,
302
+ "aria-describedby": error ? `${field.ref}-error` : void 0
303
+ }
304
+ ),
305
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${field.ref}-error`, className: "lf-error", children: error })
306
+ ] });
307
+ }
308
+ function OpinionScale({
309
+ field,
310
+ value,
311
+ error,
312
+ onChange,
313
+ onNext,
314
+ showQuestionNumber,
315
+ questionNumber
316
+ }) {
317
+ const { steps, startAtOne, labels } = field.properties;
318
+ const currentValue = value;
319
+ const startValue = startAtOne ? 1 : 0;
320
+ const handleClick = (rating) => {
321
+ onChange(rating);
322
+ onNext(rating);
323
+ };
324
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
325
+ /* @__PURE__ */ jsxRuntime.jsx(
326
+ QuestionHeader,
327
+ {
328
+ field,
329
+ questionNumber,
330
+ showQuestionNumber
331
+ }
332
+ ),
333
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
334
+ /* @__PURE__ */ jsxRuntime.jsx(
335
+ "div",
336
+ {
337
+ style: {
338
+ display: "flex",
339
+ gap: "0.5rem",
340
+ flexWrap: "wrap"
341
+ },
342
+ children: Array.from({ length: steps }, (_, i) => startValue + i).map((num) => /* @__PURE__ */ jsxRuntime.jsx(
343
+ "button",
344
+ {
345
+ type: "button",
346
+ onClick: () => handleClick(num),
347
+ className: `lf-scale-button ${currentValue === num ? "lf-scale-button-selected" : ""}`,
348
+ children: num
349
+ },
350
+ num
351
+ ))
352
+ }
353
+ ),
354
+ (labels.left || labels.right) && /* @__PURE__ */ jsxRuntime.jsxs(
355
+ "div",
356
+ {
357
+ style: {
358
+ display: "flex",
359
+ justifyContent: "space-between",
360
+ marginTop: "0.75rem",
361
+ fontSize: "0.875rem",
362
+ color: "var(--lf-color-placeholder)"
363
+ },
364
+ children: [
365
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.left }),
366
+ labels.center && /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.center }),
367
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: labels.right })
368
+ ]
369
+ }
370
+ )
371
+ ] }),
372
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${field.ref}-error`, className: "lf-error", children: error })
373
+ ] });
374
+ }
375
+ var SHAPES = {
376
+ star: (filled) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) }),
377
+ heart: (filled) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z" }) }),
378
+ thumbsup: (filled) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }) }),
379
+ trophy: (filled) => /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", children: [
380
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
381
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
382
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 22h16" }),
383
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
384
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
385
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
386
+ ] }),
387
+ crown: (filled) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m2 4 3 12h14l3-12-6 7-4-7-4 7-6-7zm3 16h14" }) })
388
+ };
389
+ function Rating({
390
+ field,
391
+ value,
392
+ error,
393
+ onChange,
394
+ onNext,
395
+ showQuestionNumber,
396
+ questionNumber
397
+ }) {
398
+ const [hoverValue, setHoverValue] = React2.useState(null);
399
+ const { steps, shape } = field.properties;
400
+ const currentValue = value || 0;
401
+ const displayValue = hoverValue !== null ? hoverValue : currentValue;
402
+ const handleClick = (rating) => {
403
+ onChange(rating);
404
+ onNext(rating);
405
+ };
406
+ const ShapeComponent = SHAPES[shape] || SHAPES.star;
407
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
408
+ /* @__PURE__ */ jsxRuntime.jsx(
409
+ QuestionHeader,
410
+ {
411
+ field,
412
+ questionNumber,
413
+ showQuestionNumber
414
+ }
415
+ ),
416
+ /* @__PURE__ */ jsxRuntime.jsx(
417
+ "div",
418
+ {
419
+ style: {
420
+ display: "flex",
421
+ gap: "0.5rem"
422
+ },
423
+ onMouseLeave: () => setHoverValue(null),
424
+ children: Array.from({ length: steps }, (_, i) => i + 1).map((rating) => /* @__PURE__ */ jsxRuntime.jsx(
425
+ "button",
426
+ {
427
+ type: "button",
428
+ onClick: () => handleClick(rating),
429
+ onMouseEnter: () => setHoverValue(rating),
430
+ className: `lf-rating-star ${rating <= displayValue ? "lf-rating-star-active" : ""}`,
431
+ style: {
432
+ background: "none",
433
+ border: "none",
434
+ cursor: "pointer",
435
+ padding: "0.25rem",
436
+ width: "2.5rem",
437
+ height: "2.5rem"
438
+ },
439
+ "aria-label": `Rate ${rating} out of ${steps}`,
440
+ children: ShapeComponent(rating <= displayValue)
441
+ },
442
+ rating
443
+ ))
444
+ }
445
+ ),
446
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${field.ref}-error`, className: "lf-error", children: error })
447
+ ] });
448
+ }
449
+ function Statement({
450
+ field,
451
+ onNext,
452
+ showQuestionNumber,
453
+ questionNumber
454
+ }) {
455
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
456
+ /* @__PURE__ */ jsxRuntime.jsx(
457
+ QuestionHeader,
458
+ {
459
+ field,
460
+ questionNumber,
461
+ showQuestionNumber
462
+ }
463
+ ),
464
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "lf-button", onClick: onNext, children: field.properties.buttonText || "Continue" })
465
+ ] });
466
+ }
467
+ function TextField({
468
+ field,
469
+ value,
470
+ error,
471
+ onChange,
472
+ onNext,
473
+ showQuestionNumber,
474
+ questionNumber
475
+ }) {
476
+ const { getInputProps, getTextareaProps } = chunkWIFNU3FA_cjs.useField({
477
+ field,
478
+ value,
479
+ error,
480
+ onChange,
481
+ onNext
482
+ });
483
+ const isLongText = field.type === "long_text";
484
+ const inputType = field.type === "email" ? "email" : field.type === "website" ? "url" : "text";
485
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
486
+ /* @__PURE__ */ jsxRuntime.jsx(
487
+ QuestionHeader,
488
+ {
489
+ field,
490
+ questionNumber,
491
+ showQuestionNumber
492
+ }
493
+ ),
494
+ isLongText ? /* @__PURE__ */ jsxRuntime.jsx(
495
+ "textarea",
496
+ {
497
+ ...getTextareaProps(),
498
+ className: "lf-input",
499
+ rows: 4,
500
+ style: { resize: "vertical", minHeight: "120px" }
501
+ }
502
+ ) : /* @__PURE__ */ jsxRuntime.jsx("input", { ...getInputProps(), type: inputType, className: "lf-input-underline" }),
503
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${field.ref}-error`, className: "lf-error", children: error })
504
+ ] });
505
+ }
506
+ function YesNo({
507
+ field,
508
+ value,
509
+ error,
510
+ onChange,
511
+ onNext,
512
+ showQuestionNumber,
513
+ questionNumber,
514
+ showKeyHints
515
+ }) {
516
+ const currentValue = value;
517
+ const handleClick = (answer) => {
518
+ onChange(answer);
519
+ onNext(answer);
520
+ };
521
+ React2__default.default.useEffect(() => {
522
+ const handleKeyDown = (e) => {
523
+ if (e.key.toLowerCase() === "y") {
524
+ handleClick(true);
525
+ } else if (e.key.toLowerCase() === "n") {
526
+ handleClick(false);
527
+ }
528
+ };
529
+ if (showKeyHints) {
530
+ window.addEventListener("keydown", handleKeyDown);
531
+ return () => window.removeEventListener("keydown", handleKeyDown);
532
+ }
533
+ }, [showKeyHints]);
534
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
535
+ /* @__PURE__ */ jsxRuntime.jsx(
536
+ QuestionHeader,
537
+ {
538
+ field,
539
+ questionNumber,
540
+ showQuestionNumber
541
+ }
542
+ ),
543
+ /* @__PURE__ */ jsxRuntime.jsxs(
544
+ "div",
545
+ {
546
+ style: {
547
+ display: "flex",
548
+ gap: "var(--lf-spacing-option)"
549
+ },
550
+ children: [
551
+ /* @__PURE__ */ jsxRuntime.jsxs(
552
+ "button",
553
+ {
554
+ type: "button",
555
+ onClick: () => handleClick(true),
556
+ className: `lf-choice ${currentValue === true ? "lf-choice-selected" : ""}`,
557
+ style: { flex: 1 },
558
+ children: [
559
+ showKeyHints && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-key-hint", children: "Y" }),
560
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Yes" }),
561
+ currentValue === true && /* @__PURE__ */ jsxRuntime.jsx(
562
+ "svg",
563
+ {
564
+ width: "20",
565
+ height: "20",
566
+ viewBox: "0 0 24 24",
567
+ fill: "none",
568
+ stroke: "currentColor",
569
+ strokeWidth: "3",
570
+ style: { color: "var(--lf-color-primary)", marginLeft: "auto" },
571
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
572
+ }
573
+ )
574
+ ]
575
+ }
576
+ ),
577
+ /* @__PURE__ */ jsxRuntime.jsxs(
578
+ "button",
579
+ {
580
+ type: "button",
581
+ onClick: () => handleClick(false),
582
+ className: `lf-choice ${currentValue === false ? "lf-choice-selected" : ""}`,
583
+ style: { flex: 1 },
584
+ children: [
585
+ showKeyHints && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-key-hint", children: "N" }),
586
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "No" }),
587
+ currentValue === false && /* @__PURE__ */ jsxRuntime.jsx(
588
+ "svg",
589
+ {
590
+ width: "20",
591
+ height: "20",
592
+ viewBox: "0 0 24 24",
593
+ fill: "none",
594
+ stroke: "currentColor",
595
+ strokeWidth: "3",
596
+ style: { color: "var(--lf-color-primary)", marginLeft: "auto" },
597
+ children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
598
+ }
599
+ )
600
+ ]
601
+ }
602
+ )
603
+ ]
604
+ }
605
+ ),
606
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${field.ref}-error`, className: "lf-error", children: error })
607
+ ] });
608
+ }
609
+ function FieldRenderer({
610
+ field,
611
+ value,
612
+ error,
613
+ onChange,
614
+ onNext,
615
+ showQuestionNumber,
616
+ questionNumber,
617
+ showKeyHints,
618
+ systemMessages
619
+ }) {
620
+ const commonProps = {
621
+ value,
622
+ error,
623
+ onChange,
624
+ onNext,
625
+ showQuestionNumber,
626
+ questionNumber
627
+ };
628
+ switch (field.type) {
629
+ case "short_text":
630
+ case "long_text":
631
+ case "email":
632
+ case "website":
633
+ return /* @__PURE__ */ jsxRuntime.jsx(TextField, { field, ...commonProps });
634
+ case "number":
635
+ return /* @__PURE__ */ jsxRuntime.jsx(NumberField, { field, ...commonProps });
636
+ case "multiple_choice":
637
+ return /* @__PURE__ */ jsxRuntime.jsx(
638
+ MultipleChoice,
639
+ {
640
+ field,
641
+ ...commonProps,
642
+ showKeyHints,
643
+ systemMessages
644
+ }
645
+ );
646
+ case "rating":
647
+ return /* @__PURE__ */ jsxRuntime.jsx(Rating, { field, ...commonProps });
648
+ case "opinion_scale":
649
+ return /* @__PURE__ */ jsxRuntime.jsx(OpinionScale, { field, ...commonProps });
650
+ case "yes_no":
651
+ return /* @__PURE__ */ jsxRuntime.jsx(YesNo, { field, ...commonProps, showKeyHints });
652
+ case "statement":
653
+ return /* @__PURE__ */ jsxRuntime.jsx(
654
+ Statement,
655
+ {
656
+ field,
657
+ onNext,
658
+ showQuestionNumber,
659
+ questionNumber
660
+ }
661
+ );
662
+ // For field types not yet implemented, show a basic input
663
+ case "phone_number":
664
+ case "date":
665
+ case "dropdown":
666
+ case "picture_choice":
667
+ case "ranking":
668
+ case "nps":
669
+ case "legal":
670
+ case "file_upload":
671
+ case "contact_info":
672
+ case "payment":
673
+ case "group":
674
+ case "matrix":
675
+ case "address":
676
+ case "slider":
677
+ case "signature":
678
+ default:
679
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-field", children: [
680
+ /* @__PURE__ */ jsxRuntime.jsx(
681
+ QuestionHeader,
682
+ {
683
+ field,
684
+ questionNumber,
685
+ showQuestionNumber
686
+ }
687
+ ),
688
+ /* @__PURE__ */ jsxRuntime.jsx(
689
+ "input",
690
+ {
691
+ type: "text",
692
+ value: value || "",
693
+ onChange: (e) => onChange(e.target.value),
694
+ onKeyDown: (e) => {
695
+ if (e.key === "Enter") {
696
+ e.preventDefault();
697
+ onNext();
698
+ }
699
+ },
700
+ className: "lf-input-underline",
701
+ placeholder: `Enter your ${field.type.replace(/_/g, " ")}`
702
+ }
703
+ ),
704
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `${field.ref}-error`, className: "lf-error", children: error })
705
+ ] });
706
+ }
707
+ }
708
+ function NavigationControls({ onNext, onPrevious }) {
709
+ const { canGoBack, canGoNext, isSubmitting, next, previous, settings } = useFormContext();
710
+ const theme = chunkWIFNU3FA_cjs.useThemeContext();
711
+ const navVisibility = theme.componentVariants?.navigationVisibility || "always";
712
+ if (navVisibility === "hidden" || navVisibility === "auto-advance") {
713
+ return null;
714
+ }
715
+ const handleNext = () => onNext ? onNext() : next();
716
+ const handlePrevious = () => onPrevious ? onPrevious() : previous();
717
+ const confirmText = settings.systemMessages?.confirmButtonText || "OK";
718
+ const enterHint = settings.systemMessages?.pressEnterText || "press Enter";
719
+ const isBottomBar = theme.componentVariants?.navigationLayout === "bottom-bar";
720
+ if (isBottomBar) {
721
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-navigation-bottom-bar", children: [
722
+ /* @__PURE__ */ jsxRuntime.jsxs(
723
+ "button",
724
+ {
725
+ type: "button",
726
+ className: "lf-nav-btn-back",
727
+ onClick: handlePrevious,
728
+ disabled: !canGoBack,
729
+ "aria-label": "Previous question",
730
+ children: [
731
+ /* @__PURE__ */ jsxRuntime.jsx(
732
+ "svg",
733
+ {
734
+ width: "16",
735
+ height: "16",
736
+ viewBox: "0 0 24 24",
737
+ fill: "none",
738
+ stroke: "currentColor",
739
+ strokeWidth: "2",
740
+ strokeLinecap: "round",
741
+ strokeLinejoin: "round",
742
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" })
743
+ }
744
+ ),
745
+ "Back"
746
+ ]
747
+ }
748
+ ),
749
+ /* @__PURE__ */ jsxRuntime.jsxs(
750
+ "button",
751
+ {
752
+ type: "button",
753
+ className: "lf-nav-btn-next",
754
+ onClick: handleNext,
755
+ disabled: isSubmitting,
756
+ "aria-label": "Next question",
757
+ children: [
758
+ "Next",
759
+ /* @__PURE__ */ jsxRuntime.jsx(
760
+ "svg",
761
+ {
762
+ width: "16",
763
+ height: "16",
764
+ viewBox: "0 0 24 24",
765
+ fill: "none",
766
+ stroke: "currentColor",
767
+ strokeWidth: "2",
768
+ strokeLinecap: "round",
769
+ strokeLinejoin: "round",
770
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 12h14M12 5l7 7-7 7" })
771
+ }
772
+ )
773
+ ]
774
+ }
775
+ )
776
+ ] });
777
+ }
778
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-navigation", children: [
779
+ /* @__PURE__ */ jsxRuntime.jsx(
780
+ "button",
781
+ {
782
+ type: "button",
783
+ className: "lf-navigation-button",
784
+ onClick: handlePrevious,
785
+ disabled: !canGoBack,
786
+ "aria-label": "Previous question",
787
+ children: /* @__PURE__ */ jsxRuntime.jsx(
788
+ "svg",
789
+ {
790
+ width: "16",
791
+ height: "16",
792
+ viewBox: "0 0 24 24",
793
+ fill: "none",
794
+ stroke: "currentColor",
795
+ strokeWidth: "2",
796
+ strokeLinecap: "round",
797
+ strokeLinejoin: "round",
798
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15 18l-6-6 6-6" })
799
+ }
800
+ )
801
+ }
802
+ ),
803
+ /* @__PURE__ */ jsxRuntime.jsxs(
804
+ "button",
805
+ {
806
+ type: "button",
807
+ className: "lf-button",
808
+ onClick: handleNext,
809
+ disabled: isSubmitting,
810
+ children: [
811
+ confirmText,
812
+ /* @__PURE__ */ jsxRuntime.jsxs(
813
+ "span",
814
+ {
815
+ style: {
816
+ opacity: 0.7,
817
+ fontSize: "0.75rem",
818
+ marginLeft: "0.5rem"
819
+ },
820
+ children: [
821
+ enterHint,
822
+ " \u21B5"
823
+ ]
824
+ }
825
+ )
826
+ ]
827
+ }
828
+ ),
829
+ /* @__PURE__ */ jsxRuntime.jsx(
830
+ "button",
831
+ {
832
+ type: "button",
833
+ className: "lf-navigation-button",
834
+ onClick: handleNext,
835
+ disabled: !canGoNext || isSubmitting,
836
+ "aria-label": "Next question",
837
+ children: /* @__PURE__ */ jsxRuntime.jsx(
838
+ "svg",
839
+ {
840
+ width: "16",
841
+ height: "16",
842
+ viewBox: "0 0 24 24",
843
+ fill: "none",
844
+ stroke: "currentColor",
845
+ strokeWidth: "2",
846
+ strokeLinecap: "round",
847
+ strokeLinejoin: "round",
848
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 18l6-6-6-6" })
849
+ }
850
+ )
851
+ }
852
+ )
853
+ ] });
854
+ }
855
+ function ProgressBar() {
856
+ const { content, answers, currentIndex, settings } = useFormContext();
857
+ const theme = chunkWIFNU3FA_cjs.useThemeContext();
858
+ const { percentage, segments } = chunkWIFNU3FA_cjs.useProgress({ content, answers, currentIndex });
859
+ if (!settings.showProgressBar || !theme.progressBar.enabled) {
860
+ return null;
861
+ }
862
+ const position = theme.progressBar.position === "bottom" ? "bottom" : "top";
863
+ const positionStyle = {
864
+ position: "fixed",
865
+ left: 0,
866
+ right: 0,
867
+ [position]: 0,
868
+ zIndex: 100
869
+ };
870
+ if (theme.progressBar.style === "segmented") {
871
+ return /* @__PURE__ */ jsxRuntime.jsx(
872
+ "div",
873
+ {
874
+ style: {
875
+ ...positionStyle,
876
+ display: "flex",
877
+ gap: "4px",
878
+ padding: "8px 16px"
879
+ },
880
+ children: segments.map((segment) => /* @__PURE__ */ jsxRuntime.jsx(
881
+ "div",
882
+ {
883
+ style: {
884
+ flex: 1,
885
+ height: "4px",
886
+ backgroundColor: segment.completed ? "var(--lf-color-progress-fill)" : "var(--lf-color-progress-bg)",
887
+ transition: "background-color var(--lf-transition-duration) var(--lf-transition-easing)"
888
+ }
889
+ },
890
+ segment.index
891
+ ))
892
+ }
893
+ );
894
+ }
895
+ if (theme.progressBar.style === "percentage") {
896
+ return /* @__PURE__ */ jsxRuntime.jsxs(
897
+ "div",
898
+ {
899
+ style: {
900
+ ...positionStyle,
901
+ padding: "8px 16px",
902
+ textAlign: "center",
903
+ fontSize: "0.875rem",
904
+ fontWeight: 500,
905
+ color: "var(--lf-color-question)"
906
+ },
907
+ children: [
908
+ Math.round(percentage),
909
+ "%"
910
+ ]
911
+ }
912
+ );
913
+ }
914
+ if (theme.progressBar.style === "dots") {
915
+ return /* @__PURE__ */ jsxRuntime.jsx(
916
+ "div",
917
+ {
918
+ style: {
919
+ ...positionStyle,
920
+ display: "flex",
921
+ justifyContent: "center",
922
+ gap: "8px",
923
+ padding: "8px 16px"
924
+ },
925
+ children: segments.map((segment) => /* @__PURE__ */ jsxRuntime.jsx(
926
+ "div",
927
+ {
928
+ style: {
929
+ width: segment.current ? "12px" : "8px",
930
+ height: segment.current ? "12px" : "8px",
931
+ borderRadius: "50%",
932
+ backgroundColor: segment.completed || segment.current ? "var(--lf-color-progress-fill)" : "var(--lf-color-progress-bg)",
933
+ transition: "all var(--lf-transition-duration) var(--lf-transition-easing)"
934
+ }
935
+ },
936
+ segment.index
937
+ ))
938
+ }
939
+ );
940
+ }
941
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...positionStyle, padding: "8px 16px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
942
+ "div",
943
+ {
944
+ className: "lf-progress",
945
+ style: { height: "4px", borderRadius: "2px" },
946
+ children: /* @__PURE__ */ jsxRuntime.jsx(
947
+ "div",
948
+ {
949
+ className: "lf-progress-fill",
950
+ style: {
951
+ width: `${percentage}%`,
952
+ height: "100%",
953
+ borderRadius: "2px"
954
+ }
955
+ }
956
+ )
957
+ }
958
+ ) });
959
+ }
960
+
961
+ // src/utils/timeEstimate.ts
962
+ var FIELD_TIME_ESTIMATES = {
963
+ // Text fields
964
+ short_text: 15,
965
+ long_text: 45,
966
+ email: 12,
967
+ phone_number: 15,
968
+ website: 12,
969
+ // Selection fields
970
+ multiple_choice: 10,
971
+ picture_choice: 12,
972
+ dropdown: 12,
973
+ yes_no: 5,
974
+ ranking: 20,
975
+ // Scale/rating fields
976
+ rating: 8,
977
+ opinion_scale: 8,
978
+ nps: 8,
979
+ // Complex fields
980
+ address: 60,
981
+ contact_info: 45,
982
+ date: 10,
983
+ number: 10,
984
+ slider: 8,
985
+ signature: 30,
986
+ file_upload: 20,
987
+ payment: 60,
988
+ // Display fields (minimal time)
989
+ statement: 5,
990
+ legal: 15,
991
+ group: 0,
992
+ matrix: 30
993
+ };
994
+ function formatTimeEstimate(seconds) {
995
+ if (seconds < 60) {
996
+ return `About ${Math.round(seconds / 10) * 10} sec`;
997
+ }
998
+ const minutes = Math.round(seconds / 60);
999
+ return `About ${minutes} min`;
1000
+ }
1001
+ function calculateRemainingTime(content, answeredFieldRefs) {
1002
+ let totalSeconds = 0;
1003
+ for (const field of content.fields) {
1004
+ if (answeredFieldRefs.includes(field.ref)) {
1005
+ continue;
1006
+ }
1007
+ const fieldTime = FIELD_TIME_ESTIMATES[field.type] ?? 15;
1008
+ totalSeconds += fieldTime;
1009
+ }
1010
+ return totalSeconds;
1011
+ }
1012
+ function TimeToComplete() {
1013
+ const { content, settings, answers, isStarted, isCompleted } = useFormContext();
1014
+ if (!settings.showTimeToComplete) {
1015
+ return null;
1016
+ }
1017
+ if (isCompleted) {
1018
+ return null;
1019
+ }
1020
+ const answeredFieldRefs = Object.keys(answers);
1021
+ const remainingSeconds = React2.useMemo(
1022
+ () => calculateRemainingTime(content, answeredFieldRefs),
1023
+ [content, answeredFieldRefs]
1024
+ );
1025
+ if (remainingSeconds <= 0) {
1026
+ return null;
1027
+ }
1028
+ const timeText = formatTimeEstimate(remainingSeconds);
1029
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1030
+ "div",
1031
+ {
1032
+ className: "lf-time-estimate",
1033
+ style: {
1034
+ position: "fixed",
1035
+ top: "1rem",
1036
+ right: "1rem",
1037
+ zIndex: 50,
1038
+ display: "flex",
1039
+ alignItems: "center",
1040
+ gap: "0.5rem",
1041
+ padding: "0.5rem 0.75rem",
1042
+ fontSize: "0.75rem",
1043
+ color: "var(--lf-color-question)",
1044
+ opacity: 0.7
1045
+ },
1046
+ children: [
1047
+ /* @__PURE__ */ jsxRuntime.jsxs(
1048
+ "svg",
1049
+ {
1050
+ width: "14",
1051
+ height: "14",
1052
+ viewBox: "0 0 24 24",
1053
+ fill: "none",
1054
+ stroke: "currentColor",
1055
+ strokeWidth: "2",
1056
+ strokeLinecap: "round",
1057
+ strokeLinejoin: "round",
1058
+ children: [
1059
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1060
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
1061
+ ]
1062
+ }
1063
+ ),
1064
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: timeText })
1065
+ ]
1066
+ }
1067
+ );
1068
+ }
1069
+ function CookieConsent({ onAccept }) {
1070
+ const [isVisible, setIsVisible] = React2.useState(false);
1071
+ React2.useEffect(() => {
1072
+ if (!chunkWIFNU3FA_cjs.hasCookieConsent()) {
1073
+ setIsVisible(true);
1074
+ }
1075
+ }, []);
1076
+ const handleAccept = () => {
1077
+ chunkWIFNU3FA_cjs.setCookieConsent(true);
1078
+ setIsVisible(false);
1079
+ onAccept();
1080
+ };
1081
+ if (!isVisible) {
1082
+ return null;
1083
+ }
1084
+ return /* @__PURE__ */ jsxRuntime.jsx(
1085
+ "div",
1086
+ {
1087
+ className: "lf-cookie-consent",
1088
+ style: {
1089
+ position: "fixed",
1090
+ inset: 0,
1091
+ zIndex: 1e3,
1092
+ display: "flex",
1093
+ alignItems: "center",
1094
+ justifyContent: "center",
1095
+ backgroundColor: "rgba(0, 0, 0, 0.5)"
1096
+ },
1097
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1098
+ "div",
1099
+ {
1100
+ style: {
1101
+ maxWidth: "400px",
1102
+ margin: "1rem",
1103
+ padding: "1.5rem",
1104
+ backgroundColor: "var(--lf-color-surface, #fff)",
1105
+ borderRadius: "var(--lf-border-radius, 8px)",
1106
+ boxShadow: "0 4px 20px rgba(0, 0, 0, 0.15)"
1107
+ },
1108
+ children: [
1109
+ /* @__PURE__ */ jsxRuntime.jsx(
1110
+ "div",
1111
+ {
1112
+ style: {
1113
+ width: "48px",
1114
+ height: "48px",
1115
+ margin: "0 auto 1rem",
1116
+ display: "flex",
1117
+ alignItems: "center",
1118
+ justifyContent: "center",
1119
+ backgroundColor: "color-mix(in srgb, var(--lf-color-primary) 15%, transparent)",
1120
+ borderRadius: "50%"
1121
+ },
1122
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1123
+ "svg",
1124
+ {
1125
+ width: "24",
1126
+ height: "24",
1127
+ viewBox: "0 0 24 24",
1128
+ fill: "none",
1129
+ stroke: "var(--lf-color-primary)",
1130
+ strokeWidth: "2",
1131
+ strokeLinecap: "round",
1132
+ strokeLinejoin: "round",
1133
+ children: [
1134
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1135
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "8", cy: "9", r: "1", fill: "currentColor" }),
1136
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "15", cy: "9", r: "1", fill: "currentColor" }),
1137
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "9", cy: "14", r: "1", fill: "currentColor" }),
1138
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "14", cy: "14", r: "1", fill: "currentColor" }),
1139
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "1", fill: "currentColor" })
1140
+ ]
1141
+ }
1142
+ )
1143
+ }
1144
+ ),
1145
+ /* @__PURE__ */ jsxRuntime.jsx(
1146
+ "h2",
1147
+ {
1148
+ className: "lf-question-title",
1149
+ style: {
1150
+ fontSize: "1.25rem",
1151
+ textAlign: "center",
1152
+ marginBottom: "0.75rem"
1153
+ },
1154
+ children: "Cookie consent"
1155
+ }
1156
+ ),
1157
+ /* @__PURE__ */ jsxRuntime.jsx(
1158
+ "p",
1159
+ {
1160
+ className: "lf-question-description",
1161
+ style: {
1162
+ textAlign: "center",
1163
+ marginBottom: "1.5rem",
1164
+ fontSize: "0.875rem",
1165
+ lineHeight: 1.5
1166
+ },
1167
+ children: "This form uses cookies to save your progress and provide a better experience. By continuing, you agree to the use of cookies."
1168
+ }
1169
+ ),
1170
+ /* @__PURE__ */ jsxRuntime.jsx(
1171
+ "button",
1172
+ {
1173
+ type: "button",
1174
+ onClick: handleAccept,
1175
+ className: "lf-button",
1176
+ style: {
1177
+ width: "100%",
1178
+ padding: "0.75rem 1.5rem",
1179
+ fontSize: "1rem"
1180
+ },
1181
+ children: "Accept and continue"
1182
+ }
1183
+ )
1184
+ ]
1185
+ }
1186
+ )
1187
+ }
1188
+ );
1189
+ }
1190
+ function Captcha({
1191
+ siteKey,
1192
+ onVerify,
1193
+ onError,
1194
+ onExpired,
1195
+ theme = "auto",
1196
+ size = "normal"
1197
+ }) {
1198
+ const containerRef = React2.useRef(null);
1199
+ const widgetIdRef = React2.useRef(null);
1200
+ const [isLoading, setIsLoading] = React2.useState(true);
1201
+ const [error, setError] = React2.useState(null);
1202
+ const initializeTurnstile = React2.useCallback(() => {
1203
+ if (!containerRef.current || !window.turnstile) return;
1204
+ if (widgetIdRef.current) {
1205
+ try {
1206
+ window.turnstile.remove(widgetIdRef.current);
1207
+ } catch (e) {
1208
+ }
1209
+ }
1210
+ try {
1211
+ widgetIdRef.current = window.turnstile.render(containerRef.current, {
1212
+ sitekey: siteKey,
1213
+ callback: (token) => {
1214
+ setIsLoading(false);
1215
+ onVerify(token);
1216
+ },
1217
+ "error-callback": () => {
1218
+ setIsLoading(false);
1219
+ setError("Verification failed. Please try again.");
1220
+ onError?.();
1221
+ },
1222
+ "expired-callback": () => {
1223
+ setError("Verification expired. Please try again.");
1224
+ onExpired?.();
1225
+ },
1226
+ theme,
1227
+ size
1228
+ });
1229
+ setIsLoading(false);
1230
+ } catch (e) {
1231
+ setIsLoading(false);
1232
+ setError("Failed to initialize CAPTCHA.");
1233
+ onError?.();
1234
+ }
1235
+ }, [siteKey, onVerify, onError, onExpired, theme, size]);
1236
+ React2.useEffect(() => {
1237
+ if (window.turnstile) {
1238
+ initializeTurnstile();
1239
+ return;
1240
+ }
1241
+ const existingScript = document.querySelector(
1242
+ 'script[src*="challenges.cloudflare.com/turnstile"]'
1243
+ );
1244
+ if (existingScript) {
1245
+ existingScript.addEventListener("load", initializeTurnstile);
1246
+ return;
1247
+ }
1248
+ const script = document.createElement("script");
1249
+ script.src = "https://challenges.cloudflare.com/turnstile/v0/api.js";
1250
+ script.async = true;
1251
+ script.defer = true;
1252
+ script.onload = initializeTurnstile;
1253
+ script.onerror = () => {
1254
+ setIsLoading(false);
1255
+ setError("Failed to load CAPTCHA. Please refresh the page.");
1256
+ onError?.();
1257
+ };
1258
+ document.head.appendChild(script);
1259
+ return () => {
1260
+ if (widgetIdRef.current && window.turnstile) {
1261
+ try {
1262
+ window.turnstile.remove(widgetIdRef.current);
1263
+ } catch (e) {
1264
+ }
1265
+ }
1266
+ };
1267
+ }, [initializeTurnstile, onError]);
1268
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1269
+ "div",
1270
+ {
1271
+ className: "lf-captcha",
1272
+ style: {
1273
+ display: "flex",
1274
+ flexDirection: "column",
1275
+ alignItems: "center",
1276
+ gap: "0.75rem",
1277
+ padding: "1rem 0"
1278
+ },
1279
+ children: [
1280
+ isLoading && /* @__PURE__ */ jsxRuntime.jsxs(
1281
+ "div",
1282
+ {
1283
+ style: {
1284
+ display: "flex",
1285
+ alignItems: "center",
1286
+ gap: "0.5rem",
1287
+ color: "var(--lf-color-question)",
1288
+ opacity: 0.7
1289
+ },
1290
+ children: [
1291
+ /* @__PURE__ */ jsxRuntime.jsxs(
1292
+ "svg",
1293
+ {
1294
+ width: "16",
1295
+ height: "16",
1296
+ viewBox: "0 0 24 24",
1297
+ fill: "none",
1298
+ stroke: "currentColor",
1299
+ strokeWidth: "2",
1300
+ className: "animate-spin",
1301
+ children: [
1302
+ /* @__PURE__ */ jsxRuntime.jsx(
1303
+ "circle",
1304
+ {
1305
+ cx: "12",
1306
+ cy: "12",
1307
+ r: "10",
1308
+ stroke: "currentColor",
1309
+ strokeWidth: "4",
1310
+ fill: "none",
1311
+ opacity: "0.25"
1312
+ }
1313
+ ),
1314
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M4 12a8 8 0 0 1 8-8", opacity: "0.75" })
1315
+ ]
1316
+ }
1317
+ ),
1318
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "0.875rem" }, children: "Loading verification..." })
1319
+ ]
1320
+ }
1321
+ ),
1322
+ /* @__PURE__ */ jsxRuntime.jsx("div", { ref: containerRef }),
1323
+ error && /* @__PURE__ */ jsxRuntime.jsx(
1324
+ "p",
1325
+ {
1326
+ style: {
1327
+ color: "var(--lf-color-error, #ef4444)",
1328
+ fontSize: "0.875rem",
1329
+ textAlign: "center"
1330
+ },
1331
+ children: error
1332
+ }
1333
+ )
1334
+ ]
1335
+ }
1336
+ );
1337
+ }
1338
+ function Branding() {
1339
+ const theme = chunkWIFNU3FA_cjs.useThemeContext();
1340
+ if (!theme.branding.showPoweredBy) {
1341
+ return null;
1342
+ }
1343
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-branding", children: [
1344
+ "Powered by",
1345
+ " ",
1346
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://landform.io", target: "_blank", rel: "noopener noreferrer", children: "Landform" })
1347
+ ] });
1348
+ }
1349
+ function Header() {
1350
+ const theme = chunkWIFNU3FA_cjs.useThemeContext();
1351
+ const headerLayout = theme.componentVariants?.headerLayout;
1352
+ if (!headerLayout || headerLayout === "none") {
1353
+ return null;
1354
+ }
1355
+ const brandName = theme.branding?.brandName;
1356
+ const logoUrl = theme.branding?.logoUrl;
1357
+ if (headerLayout === "centered-logo") {
1358
+ return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "lf-header-centered", children: [
1359
+ logoUrl && /* @__PURE__ */ jsxRuntime.jsx(
1360
+ "img",
1361
+ {
1362
+ src: logoUrl,
1363
+ alt: brandName || "Logo",
1364
+ className: "lf-header-logo"
1365
+ }
1366
+ ),
1367
+ brandName && !logoUrl && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lf-header-brand", style: { fontSize: "1.125rem", fontWeight: 600, color: "var(--lf-color-question)" }, children: brandName })
1368
+ ] });
1369
+ }
1370
+ if (headerLayout === "left-logo") {
1371
+ return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "lf-header-left", style: {
1372
+ display: "flex",
1373
+ alignItems: "center",
1374
+ padding: "1rem var(--lf-spacing-container)",
1375
+ gap: "0.75rem"
1376
+ }, children: [
1377
+ logoUrl && /* @__PURE__ */ jsxRuntime.jsx(
1378
+ "img",
1379
+ {
1380
+ src: logoUrl,
1381
+ alt: brandName || "Logo",
1382
+ className: "lf-header-logo"
1383
+ }
1384
+ ),
1385
+ brandName && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "1rem", fontWeight: 500, color: "var(--lf-color-question)" }, children: brandName })
1386
+ ] });
1387
+ }
1388
+ return null;
1389
+ }
1390
+ function FormRenderer(props) {
1391
+ const { className, ...formOptions } = props;
1392
+ return /* @__PURE__ */ jsxRuntime.jsx(FormProvider, { ...formOptions, children: /* @__PURE__ */ jsxRuntime.jsx(
1393
+ FormRendererInner,
1394
+ {
1395
+ className,
1396
+ theme: formOptions.theme,
1397
+ turnstileSiteKey: formOptions.turnstileSiteKey
1398
+ }
1399
+ ) });
1400
+ }
1401
+ function FormRendererInner({ className, theme, turnstileSiteKey }) {
1402
+ const {
1403
+ currentItem,
1404
+ settings,
1405
+ isStarted,
1406
+ isCompleted,
1407
+ isDuplicateSubmission,
1408
+ showCaptcha,
1409
+ setCaptchaToken,
1410
+ submit,
1411
+ start,
1412
+ next,
1413
+ answers,
1414
+ errors,
1415
+ setAnswer
1416
+ } = useFormContext();
1417
+ const { backgroundStyle } = chunkWIFNU3FA_cjs.useTheme({ theme });
1418
+ const [showCookieConsent, setShowCookieConsent] = React2.useState(false);
1419
+ const [hasConsent, setHasConsent] = React2.useState(true);
1420
+ React2.useEffect(() => {
1421
+ if (settings.showCookieConsent && !chunkWIFNU3FA_cjs.hasCookieConsent()) {
1422
+ setShowCookieConsent(true);
1423
+ setHasConsent(false);
1424
+ }
1425
+ }, [settings.showCookieConsent]);
1426
+ const handleCookieConsentAccept = () => {
1427
+ setShowCookieConsent(false);
1428
+ setHasConsent(true);
1429
+ };
1430
+ if (isDuplicateSubmission) {
1431
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `lf-form ${className || ""}`, style: backgroundStyle, children: [
1432
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lf-question-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-screen", style: { textAlign: "center" }, children: [
1433
+ /* @__PURE__ */ jsxRuntime.jsx(
1434
+ "div",
1435
+ {
1436
+ style: {
1437
+ width: "80px",
1438
+ height: "80px",
1439
+ margin: "0 auto 1.5rem",
1440
+ display: "flex",
1441
+ alignItems: "center",
1442
+ justifyContent: "center",
1443
+ backgroundColor: "var(--lf-color-primary)",
1444
+ opacity: 0.1,
1445
+ borderRadius: "50%"
1446
+ },
1447
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1448
+ "svg",
1449
+ {
1450
+ width: "40",
1451
+ height: "40",
1452
+ viewBox: "0 0 24 24",
1453
+ fill: "none",
1454
+ stroke: "var(--lf-color-primary)",
1455
+ strokeWidth: "2",
1456
+ strokeLinecap: "round",
1457
+ strokeLinejoin: "round",
1458
+ children: [
1459
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
1460
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "22 4 12 14.01 9 11.01" })
1461
+ ]
1462
+ }
1463
+ )
1464
+ }
1465
+ ),
1466
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "lf-question-title", style: { marginBottom: "0.75rem" }, children: "You've already submitted" }),
1467
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "lf-question-description", children: "You have already submitted a response to this form." })
1468
+ ] }) }),
1469
+ /* @__PURE__ */ jsxRuntime.jsx(Branding, {})
1470
+ ] });
1471
+ }
1472
+ if (!currentItem) {
1473
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `lf-form ${className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lf-screen", children: "Loading..." }) });
1474
+ }
1475
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `lf-form ${className || ""}`, style: backgroundStyle, children: [
1476
+ showCookieConsent && /* @__PURE__ */ jsxRuntime.jsx(CookieConsent, { onAccept: handleCookieConsentAccept }),
1477
+ showCaptcha && turnstileSiteKey && /* @__PURE__ */ jsxRuntime.jsx(
1478
+ "div",
1479
+ {
1480
+ className: "lf-captcha-modal",
1481
+ style: {
1482
+ position: "fixed",
1483
+ inset: 0,
1484
+ zIndex: 1e3,
1485
+ display: "flex",
1486
+ alignItems: "center",
1487
+ justifyContent: "center",
1488
+ backgroundColor: "rgba(0, 0, 0, 0.5)"
1489
+ },
1490
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
1491
+ "div",
1492
+ {
1493
+ style: {
1494
+ maxWidth: "400px",
1495
+ margin: "1rem",
1496
+ padding: "1.5rem",
1497
+ backgroundColor: "var(--lf-color-surface, #fff)",
1498
+ borderRadius: "var(--lf-border-radius, 8px)",
1499
+ boxShadow: "0 4px 20px rgba(0, 0, 0, 0.15)",
1500
+ textAlign: "center"
1501
+ },
1502
+ children: [
1503
+ /* @__PURE__ */ jsxRuntime.jsx(
1504
+ "h2",
1505
+ {
1506
+ className: "lf-question-title",
1507
+ style: { fontSize: "1.25rem", marginBottom: "0.75rem" },
1508
+ children: "Please verify you're human"
1509
+ }
1510
+ ),
1511
+ /* @__PURE__ */ jsxRuntime.jsx(
1512
+ "p",
1513
+ {
1514
+ className: "lf-question-description",
1515
+ style: { marginBottom: "1rem", fontSize: "0.875rem", opacity: 0.7 },
1516
+ children: "Complete the verification below to submit your response."
1517
+ }
1518
+ ),
1519
+ /* @__PURE__ */ jsxRuntime.jsx(
1520
+ Captcha,
1521
+ {
1522
+ siteKey: turnstileSiteKey,
1523
+ onVerify: (token) => {
1524
+ setCaptchaToken(token);
1525
+ submit();
1526
+ }
1527
+ }
1528
+ )
1529
+ ]
1530
+ }
1531
+ )
1532
+ }
1533
+ ),
1534
+ isStarted && !isCompleted && /* @__PURE__ */ jsxRuntime.jsx(ProgressBar, {}),
1535
+ isStarted && !isCompleted && /* @__PURE__ */ jsxRuntime.jsx(Header, {}),
1536
+ /* @__PURE__ */ jsxRuntime.jsx(TimeToComplete, {}),
1537
+ /* @__PURE__ */ jsxRuntime.jsxs(
1538
+ "div",
1539
+ {
1540
+ className: "lf-question-container",
1541
+ style: {
1542
+ ...theme?.componentVariants?.containerMaxWidth && {
1543
+ maxWidth: theme.componentVariants.containerMaxWidth
1544
+ },
1545
+ ...!hasConsent && { opacity: 0.3, pointerEvents: "none" }
1546
+ },
1547
+ children: [
1548
+ currentItem.type === "welcome" && /* @__PURE__ */ jsxRuntime.jsx(WelcomeScreen, { screen: currentItem.screen, onStart: start }),
1549
+ currentItem.type === "field" && /* @__PURE__ */ jsxRuntime.jsx(
1550
+ FieldRenderer,
1551
+ {
1552
+ field: currentItem.field,
1553
+ value: answers[currentItem.field.ref],
1554
+ error: errors[currentItem.field.ref] || null,
1555
+ onChange: (value) => setAnswer(currentItem.field.ref, value),
1556
+ onNext: next,
1557
+ questionNumber: currentItem.index + 1,
1558
+ showQuestionNumber: settings.showQuestionNumber,
1559
+ showKeyHints: settings.showKeyHintOnChoices,
1560
+ systemMessages: settings.systemMessages
1561
+ }
1562
+ ),
1563
+ currentItem.type === "thankYou" && /* @__PURE__ */ jsxRuntime.jsx(ThankYouScreen, { screen: currentItem.screen })
1564
+ ]
1565
+ }
1566
+ ),
1567
+ !settings.hideNavigation && isStarted && currentItem.type === "field" && /* @__PURE__ */ jsxRuntime.jsx(NavigationControls, {}),
1568
+ /* @__PURE__ */ jsxRuntime.jsx(Branding, {})
1569
+ ] });
1570
+ }
1571
+ function FormContainer({ children, className }) {
1572
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `lf-form ${className || ""}`, children });
1573
+ }
1574
+ function QuestionContainer({ children, className }) {
1575
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `lf-question-container ${className || ""}`, children });
1576
+ }
1577
+ function ClosedScreen({
1578
+ title,
1579
+ message,
1580
+ type = "closed"
1581
+ }) {
1582
+ const defaultTitle = type === "scheduled" ? "Form not available" : type === "limit" ? "Response limit reached" : "Form closed";
1583
+ const defaultMessage = type === "scheduled" ? "This form is not currently accepting responses." : type === "limit" ? "This form has reached its maximum number of responses." : "This form is no longer accepting responses.";
1584
+ const iconPath = type === "limit" ? (
1585
+ // Bar chart icon for limit reached
1586
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1587
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18", y1: "20", x2: "18", y2: "10" }),
1588
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "20", x2: "12", y2: "4" }),
1589
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "6", y1: "20", x2: "6", y2: "14" })
1590
+ ] })
1591
+ ) : type === "scheduled" ? (
1592
+ // Clock icon for scheduling
1593
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1594
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "10" }),
1595
+ /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "12 6 12 12 16 14" })
1596
+ ] })
1597
+ ) : (
1598
+ // Lock icon for closed
1599
+ /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1600
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
1601
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
1602
+ ] })
1603
+ );
1604
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lf-form", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lf-question-container", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "lf-screen", style: { textAlign: "center" }, children: [
1605
+ /* @__PURE__ */ jsxRuntime.jsx(
1606
+ "div",
1607
+ {
1608
+ style: {
1609
+ width: "80px",
1610
+ height: "80px",
1611
+ margin: "0 auto 1.5rem",
1612
+ display: "flex",
1613
+ alignItems: "center",
1614
+ justifyContent: "center",
1615
+ backgroundColor: "color-mix(in srgb, var(--lf-color-primary, #6366f1) 15%, transparent)",
1616
+ borderRadius: "50%"
1617
+ },
1618
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1619
+ "svg",
1620
+ {
1621
+ width: "40",
1622
+ height: "40",
1623
+ viewBox: "0 0 24 24",
1624
+ fill: "none",
1625
+ stroke: "var(--lf-color-primary, #6366f1)",
1626
+ strokeWidth: "2",
1627
+ strokeLinecap: "round",
1628
+ strokeLinejoin: "round",
1629
+ children: iconPath
1630
+ }
1631
+ )
1632
+ }
1633
+ ),
1634
+ /* @__PURE__ */ jsxRuntime.jsx(
1635
+ "h1",
1636
+ {
1637
+ className: "lf-question-title",
1638
+ style: {
1639
+ fontSize: "2rem",
1640
+ marginBottom: "0.75rem",
1641
+ color: "var(--lf-color-question, #1f2937)"
1642
+ },
1643
+ children: title || defaultTitle
1644
+ }
1645
+ ),
1646
+ /* @__PURE__ */ jsxRuntime.jsx(
1647
+ "p",
1648
+ {
1649
+ className: "lf-question-description",
1650
+ style: {
1651
+ fontSize: "1.125rem",
1652
+ color: "var(--lf-color-question, #1f2937)",
1653
+ opacity: 0.7
1654
+ },
1655
+ children: message || defaultMessage
1656
+ }
1657
+ )
1658
+ ] }) }) });
1659
+ }
1660
+
1661
+ exports.Branding = Branding;
1662
+ exports.ClosedScreen = ClosedScreen;
1663
+ exports.CookieConsent = CookieConsent;
1664
+ exports.FieldRenderer = FieldRenderer;
1665
+ exports.FormContainer = FormContainer;
1666
+ exports.FormProvider = FormProvider;
1667
+ exports.FormRenderer = FormRenderer;
1668
+ exports.MultipleChoice = MultipleChoice;
1669
+ exports.NavigationControls = NavigationControls;
1670
+ exports.NumberField = NumberField;
1671
+ exports.OpinionScale = OpinionScale;
1672
+ exports.ProgressBar = ProgressBar;
1673
+ exports.QuestionContainer = QuestionContainer;
1674
+ exports.QuestionHeader = QuestionHeader;
1675
+ exports.Rating = Rating;
1676
+ exports.Statement = Statement;
1677
+ exports.TextField = TextField;
1678
+ exports.ThankYouScreen = ThankYouScreen;
1679
+ exports.TimeToComplete = TimeToComplete;
1680
+ exports.WelcomeScreen = WelcomeScreen;
1681
+ exports.YesNo = YesNo;
1682
+ exports.useFormContext = useFormContext;
1683
+ //# sourceMappingURL=chunk-WHV333XL.cjs.map
1684
+ //# sourceMappingURL=chunk-WHV333XL.cjs.map