@drawbridge/components 0.1.37 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/styles.css +68 -355
- package/dist/advertisement.js +15 -20
- package/dist/advertisement.mjs +15 -20
- package/dist/bridge/advertisements.js +4 -2
- package/dist/bridge/advertisements.mjs +5 -3
- package/dist/bridge/fields.js +89 -6
- package/dist/bridge/fields.mjs +89 -7
- package/dist/bridge/form-subdomain-agreement.js +165 -0
- package/dist/bridge/form-subdomain-agreement.mjs +132 -0
- package/dist/bridge/form-subdomain-embed.js +5 -1
- package/dist/bridge/form-subdomain-embed.mjs +5 -1
- package/dist/bridge/form-subdomain-header.js +21 -14
- package/dist/bridge/form-subdomain-header.mjs +20 -14
- package/dist/bridge/form-subdomain-issue.js +17 -8
- package/dist/bridge/form-subdomain-issue.mjs +17 -8
- package/dist/bridge/form-subdomain-missions.js +58 -52
- package/dist/bridge/form-subdomain-missions.mjs +60 -54
- package/dist/bridge/form-subdomain.js +223 -94
- package/dist/bridge/form-subdomain.mjs +222 -96
- package/dist/bridge/lib/entry.js +61 -6
- package/dist/bridge/lib/entry.mjs +51 -5
- package/dist/bridge/lib/order.js +23 -0
- package/dist/bridge/lib/order.mjs +20 -0
- package/dist/bridge/template-layout.js +5 -2
- package/dist/bridge/template-layout.mjs +6 -3
- package/dist/bridge/template-modal.js +82 -15
- package/dist/bridge/template-modal.mjs +83 -16
- package/dist/bridge/template-subdomain-gallery.js +126 -75
- package/dist/bridge/template-subdomain-gallery.mjs +122 -75
- package/dist/bridge/template-subdomain.js +16 -14
- package/dist/bridge/template-subdomain.mjs +17 -15
- package/dist/dashboard/avatar.js +5 -0
- package/dist/dashboard/avatar.mjs +5 -0
- package/dist/dashboard/campaign-form.js +1798 -0
- package/dist/dashboard/campaign-form.mjs +1769 -0
- package/dist/dashboard/card-affiliate.js +3 -2
- package/dist/dashboard/card-affiliate.mjs +3 -2
- package/dist/dashboard/card-campaign-agreement.js +172 -0
- package/dist/dashboard/card-campaign-agreement.mjs +139 -0
- package/dist/dashboard/card-campaign-switch.js +34 -9
- package/dist/dashboard/card-campaign-switch.mjs +32 -8
- package/dist/dashboard/card-order.js +6 -14
- package/dist/dashboard/card-order.mjs +6 -14
- package/dist/dashboard/card-section.js +69 -26
- package/dist/dashboard/card-section.mjs +65 -26
- package/dist/dashboard/card-shortcut.js +181 -0
- package/dist/dashboard/card-shortcut.mjs +152 -0
- package/dist/dashboard/card-tile.js +3 -35
- package/dist/dashboard/card-tile.mjs +3 -34
- package/dist/dashboard/document-blocks.js +305 -0
- package/dist/dashboard/document-blocks.mjs +270 -0
- package/dist/dashboard/drawer-subscription.js +52 -14
- package/dist/dashboard/drawer-subscription.mjs +52 -14
- package/dist/dashboard/drawer.js +20 -3
- package/dist/dashboard/drawer.mjs +21 -4
- package/dist/dashboard/dropdown.js +6 -2
- package/dist/dashboard/dropdown.mjs +6 -2
- package/dist/dashboard/form-admin-subscription-custom.js +72 -8
- package/dist/dashboard/form-admin-subscription-custom.mjs +72 -8
- package/dist/dashboard/form-ai.js +0 -148
- package/dist/dashboard/form-ai.mjs +1 -148
- package/dist/dashboard/form-filters-analytics.js +86 -38
- package/dist/dashboard/form-filters-analytics.mjs +85 -38
- package/dist/dashboard/form-organization-brand.js +30 -13
- package/dist/dashboard/form-organization-brand.mjs +30 -13
- package/dist/dashboard/form-organization-campaign-advertisement.js +38 -112
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +38 -112
- package/dist/dashboard/form-organization-campaign-advertisements.js +374 -0
- package/dist/dashboard/form-organization-campaign-advertisements.mjs +345 -0
- package/dist/dashboard/form-organization-campaign-agreement.js +402 -210
- package/dist/dashboard/form-organization-campaign-agreement.mjs +398 -211
- package/dist/dashboard/form-organization-campaign-design.js +258 -0
- package/dist/dashboard/form-organization-campaign-design.mjs +223 -0
- package/dist/dashboard/form-organization-campaign-field-item.js +585 -0
- package/dist/dashboard/form-organization-campaign-field-item.mjs +552 -0
- package/dist/dashboard/form-organization-campaign-field-number.js +48 -7
- package/dist/dashboard/form-organization-campaign-field-number.mjs +48 -7
- package/dist/dashboard/form-organization-campaign-field-select.js +15 -4
- package/dist/dashboard/form-organization-campaign-field-select.mjs +15 -4
- package/dist/dashboard/form-organization-campaign-field-skill.js +359 -0
- package/dist/dashboard/form-organization-campaign-field-skill.mjs +330 -0
- package/dist/dashboard/form-organization-campaign-field-text.js +46 -6
- package/dist/dashboard/form-organization-campaign-field-text.mjs +46 -6
- package/dist/dashboard/form-organization-campaign-field-textarea.js +22 -13
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +22 -13
- package/dist/dashboard/form-organization-campaign-footer.js +178 -0
- package/dist/dashboard/form-organization-campaign-footer.mjs +149 -0
- package/dist/dashboard/form-organization-campaign-integration-age.js +2 -35
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +2 -35
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +4 -1
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +4 -1
- package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
- package/dist/dashboard/form-organization-campaign-page-preview.js +1 -2
- package/dist/dashboard/form-organization-campaign-page-preview.mjs +1 -2
- package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
- package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
- package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
- package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
- package/dist/dashboard/form-organization-campaign-page-slug.js +2 -3
- package/dist/dashboard/form-organization-campaign-page-slug.mjs +2 -3
- package/dist/dashboard/form-organization-campaign-page.js +168 -265
- package/dist/dashboard/form-organization-campaign-page.mjs +170 -266
- package/dist/dashboard/form-organization-campaign-section.js +125 -107
- package/dist/dashboard/form-organization-campaign-section.mjs +121 -107
- package/dist/dashboard/form-organization-campaign.js +119 -9
- package/dist/dashboard/form-organization-campaign.mjs +118 -9
- package/dist/dashboard/form-organization-file-frame.js +7 -1
- package/dist/dashboard/form-organization-file-frame.mjs +7 -1
- package/dist/dashboard/form-organization-workflow.js +587 -530
- package/dist/dashboard/form-organization-workflow.mjs +588 -531
- package/dist/dashboard/form-organization.js +22 -0
- package/dist/dashboard/form-organization.mjs +22 -0
- package/dist/dashboard/form-reposition.js +396 -0
- package/dist/dashboard/form-reposition.mjs +359 -0
- package/dist/dashboard/form-support.js +189 -0
- package/dist/dashboard/form-support.mjs +160 -0
- package/dist/dashboard/form-tests.js +683 -0
- package/dist/dashboard/form-tests.mjs +646 -0
- package/dist/dashboard/form-verify-prize.js +114 -34
- package/dist/dashboard/form-verify-prize.mjs +111 -34
- package/dist/dashboard/google.js +8 -1
- package/dist/dashboard/google.mjs +8 -1
- package/dist/dashboard/input-array.js +2 -0
- package/dist/dashboard/input-array.mjs +2 -0
- package/dist/dashboard/input-editor.js +17 -6
- package/dist/dashboard/input-editor.mjs +17 -6
- package/dist/dashboard/input-fields.js +287 -437
- package/dist/dashboard/input-fields.mjs +287 -436
- package/dist/dashboard/input-file.js +70 -2
- package/dist/dashboard/input-file.mjs +70 -2
- package/dist/dashboard/input-font.js +64 -55
- package/dist/dashboard/input-font.mjs +64 -55
- package/dist/dashboard/input-resource.js +4 -1
- package/dist/dashboard/input-resource.mjs +4 -1
- package/dist/dashboard/lib/ab-tests.js +130 -0
- package/dist/dashboard/lib/ab-tests.mjs +94 -0
- package/dist/dashboard/lib/features.js +1 -1
- package/dist/dashboard/lib/features.mjs +1 -1
- package/dist/dashboard/lib/focus.js +93 -0
- package/dist/dashboard/lib/focus.mjs +69 -0
- package/dist/dashboard/lib/form-page.js +203 -0
- package/dist/dashboard/lib/form-page.mjs +155 -0
- package/dist/dashboard/lib/item-list.js +0 -15
- package/dist/dashboard/lib/item-list.mjs +0 -14
- package/dist/dashboard/lib/rail.js +16 -17
- package/dist/dashboard/lib/rail.mjs +15 -16
- package/dist/dashboard/lib/sms.js +8 -2
- package/dist/dashboard/lib/sms.mjs +6 -1
- package/dist/dashboard/list-resource.js +2 -0
- package/dist/dashboard/list-resource.mjs +2 -0
- package/dist/dashboard/menu.js +54 -5
- package/dist/dashboard/menu.mjs +53 -5
- package/dist/dashboard/modal.js +19 -4
- package/dist/dashboard/modal.mjs +20 -5
- package/dist/dashboard/order-sections.js +4 -0
- package/dist/dashboard/order-sections.mjs +4 -0
- package/dist/dashboard/preview.js +838 -324
- package/dist/dashboard/preview.mjs +826 -324
- package/dist/dashboard/provider-ui.js +20 -12
- package/dist/dashboard/provider-ui.mjs +21 -13
- package/dist/dashboard/recharts.js +53 -28
- package/dist/dashboard/recharts.mjs +53 -28
- package/dist/dashboard/swatch.js +35 -0
- package/dist/dashboard/swatch.mjs +31 -0
- package/dist/dashboard/table-contacts.js +6 -10
- package/dist/dashboard/table-contacts.mjs +6 -10
- package/dist/dashboard/table.js +10 -3
- package/dist/dashboard/table.mjs +9 -3
- package/dist/dashboard/template-dashboard.js +12 -7
- package/dist/dashboard/template-dashboard.mjs +11 -7
- package/dist/dashboard/template-design.js +564 -0
- package/dist/dashboard/template-design.mjs +531 -0
- package/dist/dashboard/template-rail.js +198 -126
- package/dist/dashboard/template-rail.mjs +196 -125
- package/dist/dashboard/template-socket.js +0 -3
- package/dist/dashboard/template-socket.mjs +0 -3
- package/dist/dashboard/template-test-page.js +436 -0
- package/dist/dashboard/template-test-page.mjs +407 -0
- package/dist/dashboard/template-tests.js +141 -0
- package/dist/dashboard/template-tests.mjs +112 -0
- package/dist/dashboard/template-ui.js +20 -11
- package/dist/dashboard/template-ui.mjs +22 -13
- package/dist/dashboard/template-variant.js +185 -0
- package/dist/dashboard/template-variant.mjs +156 -0
- package/dist/icons/arrow-down-long.js +47 -0
- package/dist/icons/arrow-down-long.mjs +28 -0
- package/dist/icons/arrows-pointing-out.js +46 -0
- package/dist/icons/arrows-pointing-out.mjs +27 -0
- package/dist/icons/beaker.js +46 -0
- package/dist/icons/beaker.mjs +27 -0
- package/dist/icons/identification.js +46 -0
- package/dist/icons/identification.mjs +27 -0
- package/dist/icons/lifebuoy.js +46 -0
- package/dist/icons/lifebuoy.mjs +27 -0
- package/dist/icons/rectangle-group.js +46 -0
- package/dist/icons/rectangle-group.mjs +27 -0
- package/dist/icons/rectangle-stack.js +46 -0
- package/dist/icons/rectangle-stack.mjs +27 -0
- package/dist/icons/shopping-bag.js +46 -0
- package/dist/icons/shopping-bag.mjs +27 -0
- package/dist/icons/swatch.js +46 -0
- package/dist/icons/swatch.mjs +27 -0
- package/dist/icons/window.js +46 -0
- package/dist/icons/window.mjs +27 -0
- package/dist/icons/zoom-in.js +46 -0
- package/dist/icons/zoom-in.mjs +27 -0
- package/dist/input-answer.js +60 -0
- package/dist/input-answer.mjs +27 -0
- package/dist/input-checkbox.js +7 -1
- package/dist/input-checkbox.mjs +7 -1
- package/dist/input-name.js +3 -3
- package/dist/input-name.mjs +3 -3
- package/dist/input-select.js +3 -1
- package/dist/input-select.mjs +3 -1
- package/dist/provider-font.js +4 -3
- package/dist/provider-font.mjs +4 -3
- package/dist/shared/badge.js +15 -0
- package/dist/shared/badge.mjs +11 -0
- package/dist/shared/carousel.js +11 -7
- package/dist/shared/carousel.mjs +11 -7
- package/dist/shared/document-pieces.js +295 -0
- package/dist/shared/document-pieces.mjs +260 -0
- package/dist/shared/lib/campaign.js +3 -9
- package/dist/shared/lib/campaign.mjs +3 -9
- package/dist/shared/lib/helpers.js +24 -0
- package/dist/shared/lib/helpers.mjs +22 -0
- package/dist/shared/lib/video.js +6 -0
- package/dist/shared/lib/video.mjs +5 -0
- package/dist/shared/sortable.js +27 -10
- package/dist/shared/sortable.mjs +27 -10
- package/dist/shared/tabs.js +1 -1
- package/dist/shared/tabs.mjs +1 -1
- package/dist/video.js +127 -9
- package/dist/video.mjs +125 -11
- package/package.json +176 -20
- package/types/bridge/fields.d.ts +6 -1
- package/types/bridge/form-subdomain-agreement.d.ts +27 -0
- package/types/bridge/form-subdomain-missions.d.ts +2 -0
- package/types/bridge/form-subdomain.d.ts +62 -3
- package/types/bridge/lib/entry.d.ts +44 -7
- package/types/bridge/lib/order.d.ts +13 -2
- package/types/bridge/subdomain-content.d.ts +1 -0
- package/types/bridge/template-subdomain-gallery.d.ts +13 -1
- package/types/dashboard/campaign-form.d.ts +42 -0
- package/types/dashboard/card-campaign-agreement.d.ts +26 -0
- package/types/dashboard/card-campaign-switch.d.ts +20 -1
- package/types/dashboard/card-order.d.ts +2 -2
- package/types/dashboard/card-section.d.ts +9 -1
- package/types/dashboard/card-shortcut.d.ts +38 -0
- package/types/dashboard/card-tile.d.ts +4 -9
- package/types/dashboard/document-blocks.d.ts +14 -0
- package/types/dashboard/drawer.d.ts +3 -0
- package/types/dashboard/form-ai.d.ts +0 -17
- package/types/dashboard/form-organization-brand.d.ts +3 -0
- package/types/dashboard/form-organization-campaign-advertisements.d.ts +15 -0
- package/types/dashboard/form-organization-campaign-agreement.d.ts +53 -10
- package/types/dashboard/form-organization-campaign-design.d.ts +46 -0
- package/types/dashboard/form-organization-campaign-field-item.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-number.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-field-select.d.ts +6 -1
- package/types/dashboard/form-organization-campaign-field-skill.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-text.d.ts +5 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +4 -1
- package/types/dashboard/form-organization-campaign-footer.d.ts +23 -0
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +2 -0
- package/types/dashboard/form-organization-campaign-page.d.ts +9 -15
- package/types/dashboard/form-organization-campaign-section.d.ts +24 -8
- package/types/dashboard/form-organization-campaign.d.ts +3 -0
- package/types/dashboard/form-organization-workflow.d.ts +3 -0
- package/types/dashboard/form-organization.d.ts +2 -2
- package/types/dashboard/form-reposition.d.ts +29 -0
- package/types/dashboard/form-support.d.ts +14 -0
- package/types/dashboard/form-tests.d.ts +78 -0
- package/types/dashboard/form-verify-prize.d.ts +30 -3
- package/types/dashboard/input-editor.d.ts +9 -0
- package/types/dashboard/input-fields.d.ts +8 -5
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/input-resource.d.ts +1 -0
- package/types/dashboard/lib/ab-tests.d.ts +50 -0
- package/types/dashboard/lib/escape.d.ts +4 -0
- package/types/dashboard/lib/focus.d.ts +16 -0
- package/types/dashboard/lib/form-page.d.ts +25 -0
- package/types/dashboard/lib/item-list.d.ts +10 -5
- package/types/dashboard/lib/rail.d.ts +0 -1
- package/types/dashboard/lib/sms.d.ts +7 -0
- package/types/dashboard/modal.d.ts +3 -1
- package/types/dashboard/preview.d.ts +65 -10
- package/types/dashboard/recharts.d.ts +3 -0
- package/types/dashboard/swatch.d.ts +4 -0
- package/types/dashboard/template-dashboard.d.ts +3 -0
- package/types/dashboard/template-design.d.ts +30 -0
- package/types/dashboard/template-test-page.d.ts +69 -0
- package/types/dashboard/template-tests.d.ts +30 -0
- package/types/dashboard/template-variant.d.ts +18 -0
- package/types/icons/arrow-down-long.d.ts +5 -0
- package/types/icons/arrows-pointing-out.d.ts +5 -0
- package/types/icons/beaker.d.ts +5 -0
- package/types/icons/identification.d.ts +5 -0
- package/types/icons/lifebuoy.d.ts +5 -0
- package/types/icons/rectangle-group.d.ts +5 -0
- package/types/icons/rectangle-stack.d.ts +5 -0
- package/types/icons/shopping-bag.d.ts +5 -0
- package/types/icons/swatch.d.ts +5 -0
- package/types/icons/window.d.ts +5 -0
- package/types/icons/zoom-in.d.ts +5 -0
- package/types/input-answer.d.ts +15 -0
- package/types/input-select.d.ts +2 -0
- package/types/shared/button.d.ts +1 -1
- package/types/shared/document-pieces.d.ts +34 -0
- package/types/shared/lib/helpers.d.ts +22 -1
- package/types/shared/lib/motion.d.ts +2 -0
- package/types/shared/lib/video.d.ts +3 -0
- package/types/shared/sortable.d.ts +6 -0
- package/types/video.d.ts +18 -2
- package/dist/bridge/template-preview.js +0 -208
- package/dist/bridge/template-preview.mjs +0 -173
- package/dist/dashboard/device.js +0 -95
- package/dist/dashboard/device.mjs +0 -72
- package/dist/dashboard/form-organization-campaign-field-list.js +0 -425
- package/dist/dashboard/form-organization-campaign-field-list.mjs +0 -396
- package/dist/dashboard/item-row.js +0 -92
- package/dist/dashboard/item-row.mjs +0 -63
- package/types/bridge/template-preview.d.ts +0 -10
- package/types/dashboard/device.d.ts +0 -12
- package/types/dashboard/form-organization-campaign-field-list.d.ts +0 -36
- package/types/dashboard/item-row.d.ts +0 -25
|
@@ -14,9 +14,10 @@ import { ageFor, ageGateSchema } from "./lib/age-gate.mjs";
|
|
|
14
14
|
import { useGoogleReCaptcha } from "react-google-recaptcha-v3";
|
|
15
15
|
import { assertRecaptcha } from "./lib/recaptcha.mjs";
|
|
16
16
|
import { submissionEndpoint } from "./lib/url.mjs";
|
|
17
|
-
import { agreementWording, panelMissions } from "./lib/entry.mjs";
|
|
17
|
+
import { AFTER, agreementContent, agreementShown, agreementTitles, agreementWording, panelMissions, termsOptOut } from "./lib/entry.mjs";
|
|
18
|
+
import FormSubdomainAgreement from "./form-subdomain-agreement.mjs";
|
|
18
19
|
import { LOCATION_TIMEOUT, locationCopy, locationStatus } from "./lib/location.mjs";
|
|
19
|
-
import { isLastList, itemCount, limitMessage, orderTotal, sectionsOf } from "./lib/order.mjs";
|
|
20
|
+
import { isLastList, itemCount, itemRuns, limitMessage, orderTotal, priced, refusedSection, sectionsOf } from "./lib/order.mjs";
|
|
20
21
|
import Form from "../shared/form.mjs";
|
|
21
22
|
import Button from "../shared/button.mjs";
|
|
22
23
|
import Fieldset from "../shared/fieldset.mjs";
|
|
@@ -45,6 +46,7 @@ const scrollToCentre = (node) => {
|
|
|
45
46
|
};
|
|
46
47
|
const FormSubdomainSubmission = ({
|
|
47
48
|
affiliate,
|
|
49
|
+
after = AFTER,
|
|
48
50
|
button,
|
|
49
51
|
checkout,
|
|
50
52
|
giveaway,
|
|
@@ -149,6 +151,7 @@ const FormSubdomainSubmission = ({
|
|
|
149
151
|
{
|
|
150
152
|
...{
|
|
151
153
|
advertisements,
|
|
154
|
+
after,
|
|
152
155
|
button,
|
|
153
156
|
contact: data == null ? void 0 : data.contact,
|
|
154
157
|
message,
|
|
@@ -162,6 +165,10 @@ const FormSubdomainSubmission = ({
|
|
|
162
165
|
}
|
|
163
166
|
}
|
|
164
167
|
);
|
|
168
|
+
const parts = {
|
|
169
|
+
advertisements,
|
|
170
|
+
message: message && /* @__PURE__ */ jsx(FormSubdomainMessage, { ...{ message, style } })
|
|
171
|
+
};
|
|
165
172
|
return /* @__PURE__ */ jsxs(
|
|
166
173
|
"div",
|
|
167
174
|
{
|
|
@@ -174,16 +181,13 @@ const FormSubdomainSubmission = ({
|
|
|
174
181
|
{
|
|
175
182
|
...{
|
|
176
183
|
button,
|
|
177
|
-
title,
|
|
178
184
|
preview,
|
|
179
185
|
style,
|
|
180
|
-
|
|
181
|
-
message
|
|
182
|
-
}
|
|
186
|
+
title
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
189
|
),
|
|
186
|
-
|
|
190
|
+
after.map((key) => /* @__PURE__ */ jsx(Fragment, { children: parts[key] }, key))
|
|
187
191
|
]
|
|
188
192
|
}
|
|
189
193
|
);
|
|
@@ -287,10 +291,11 @@ const FormSubdomainGeocode = ({
|
|
|
287
291
|
disabled,
|
|
288
292
|
callback,
|
|
289
293
|
preview,
|
|
294
|
+
still,
|
|
290
295
|
style,
|
|
291
296
|
values
|
|
292
297
|
}) => {
|
|
293
|
-
const [state, setState] = useState(disabled ? { message: "Campaign is not currently active", status: "inactive" } : { status: "checking" });
|
|
298
|
+
const [state, setState] = useState(still ? { status: "asking" } : disabled ? { message: "Campaign is not currently active", status: "inactive" } : { status: "checking" });
|
|
294
299
|
const [attempt, setAttempt] = useState(0);
|
|
295
300
|
const searchParams = useSearchParams();
|
|
296
301
|
const token = searchParams.get("drwbrdg_pre");
|
|
@@ -299,7 +304,7 @@ const FormSubdomainGeocode = ({
|
|
|
299
304
|
useEffect(
|
|
300
305
|
() => {
|
|
301
306
|
var _a, _b;
|
|
302
|
-
if (disabled) return;
|
|
307
|
+
if (disabled || still) return;
|
|
303
308
|
if (!navigator.geolocation) {
|
|
304
309
|
setState({ status: "unsupported" });
|
|
305
310
|
return;
|
|
@@ -337,7 +342,7 @@ const FormSubdomainGeocode = ({
|
|
|
337
342
|
live = false;
|
|
338
343
|
};
|
|
339
344
|
},
|
|
340
|
-
[attempt, disabled, preview, token, values == null ? void 0 : values.slug, values == null ? void 0 : values.subdomain]
|
|
345
|
+
[attempt, disabled, preview, still, token, values == null ? void 0 : values.slug, values == null ? void 0 : values.subdomain]
|
|
341
346
|
);
|
|
342
347
|
if (["denied", "inactive", "missing", "outside", "unsupported"].includes(state.status)) {
|
|
343
348
|
const retry = ["denied", "missing"].includes(state.status);
|
|
@@ -477,7 +482,8 @@ const FormSubdomainAge = ({
|
|
|
477
482
|
{
|
|
478
483
|
...{
|
|
479
484
|
button,
|
|
480
|
-
|
|
485
|
+
description: values == null ? void 0 : values.description,
|
|
486
|
+
title: (values == null ? void 0 : values.title) || "Confirm your age",
|
|
481
487
|
style
|
|
482
488
|
}
|
|
483
489
|
}
|
|
@@ -524,7 +530,7 @@ const FormSubdomainAge = ({
|
|
|
524
530
|
className: "space-y-2 w-full"
|
|
525
531
|
},
|
|
526
532
|
children: [
|
|
527
|
-
/* @__PURE__ */ jsx("p", { children: "Month" }),
|
|
533
|
+
/* @__PURE__ */ jsx("p", { children: "Month *" }),
|
|
528
534
|
/* @__PURE__ */ jsx(
|
|
529
535
|
InputText,
|
|
530
536
|
{
|
|
@@ -552,7 +558,7 @@ const FormSubdomainAge = ({
|
|
|
552
558
|
className: "space-y-2 w-full"
|
|
553
559
|
},
|
|
554
560
|
children: [
|
|
555
|
-
/* @__PURE__ */ jsx("p", { children: "Day" }),
|
|
561
|
+
/* @__PURE__ */ jsx("p", { children: "Day *" }),
|
|
556
562
|
/* @__PURE__ */ jsx(
|
|
557
563
|
InputText,
|
|
558
564
|
{
|
|
@@ -580,7 +586,7 @@ const FormSubdomainAge = ({
|
|
|
580
586
|
className: "space-y-2 w-full"
|
|
581
587
|
},
|
|
582
588
|
children: [
|
|
583
|
-
/* @__PURE__ */ jsx("p", { children: "Year" }),
|
|
589
|
+
/* @__PURE__ */ jsx("p", { children: "Year *" }),
|
|
584
590
|
/* @__PURE__ */ jsx(
|
|
585
591
|
InputText,
|
|
586
592
|
{
|
|
@@ -621,7 +627,8 @@ const FormSubdomainAge = ({
|
|
|
621
627
|
...{
|
|
622
628
|
disabled,
|
|
623
629
|
style,
|
|
624
|
-
submitting: formState == null ? void 0 : formState.isSubmitting
|
|
630
|
+
submitting: formState == null ? void 0 : formState.isSubmitting,
|
|
631
|
+
text: (values == null ? void 0 : values.button) || "Next"
|
|
625
632
|
}
|
|
626
633
|
}
|
|
627
634
|
)
|
|
@@ -637,11 +644,11 @@ const FormSubdomainItemList = ({
|
|
|
637
644
|
currency,
|
|
638
645
|
field,
|
|
639
646
|
onChange,
|
|
640
|
-
prices,
|
|
647
|
+
prices = true,
|
|
641
648
|
style,
|
|
642
649
|
value
|
|
643
650
|
}) => {
|
|
644
|
-
var _a;
|
|
651
|
+
var _a, _b;
|
|
645
652
|
return /* @__PURE__ */ jsxs(
|
|
646
653
|
"div",
|
|
647
654
|
{
|
|
@@ -649,8 +656,8 @@ const FormSubdomainItemList = ({
|
|
|
649
656
|
className: "space-y-2"
|
|
650
657
|
},
|
|
651
658
|
children: [
|
|
652
|
-
/* @__PURE__ */ jsx(
|
|
653
|
-
"
|
|
659
|
+
(((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).length !== 1 && /* @__PURE__ */ jsx(
|
|
660
|
+
"h5",
|
|
654
661
|
{
|
|
655
662
|
...{
|
|
656
663
|
className: "text-xs uppercase tracking-wide opacity-60"
|
|
@@ -664,8 +671,8 @@ const FormSubdomainItemList = ({
|
|
|
664
671
|
...{
|
|
665
672
|
className: "space-y-4"
|
|
666
673
|
},
|
|
667
|
-
children: (((
|
|
668
|
-
var _a2,
|
|
674
|
+
children: (((_b = field == null ? void 0 : field.settings) == null ? void 0 : _b.items) || []).map((item) => {
|
|
675
|
+
var _a2, _b2;
|
|
669
676
|
const quantity = Number(value == null ? void 0 : value[item.id]) || 0;
|
|
670
677
|
const src = cdnSrc(item.image, "200x200", (_a2 = item.image) == null ? void 0 : _a2.updatedAt);
|
|
671
678
|
return /* @__PURE__ */ jsx(
|
|
@@ -691,7 +698,7 @@ const FormSubdomainItemList = ({
|
|
|
691
698
|
{
|
|
692
699
|
...{
|
|
693
700
|
// The image's own description, else its file name, as every image slot.
|
|
694
|
-
alt: item.description || ((
|
|
701
|
+
alt: item.description || ((_b2 = item.image) == null ? void 0 : _b2.filename) || "",
|
|
695
702
|
className: "object-cover",
|
|
696
703
|
fill: true,
|
|
697
704
|
sizes: "56px",
|
|
@@ -725,7 +732,7 @@ const FormSubdomainItemList = ({
|
|
|
725
732
|
className: "text-xs opacity-60"
|
|
726
733
|
},
|
|
727
734
|
children: formatCurrency({
|
|
728
|
-
code: currency.toUpperCase(),
|
|
735
|
+
code: (currency || "usd").toUpperCase(),
|
|
729
736
|
display: "parts",
|
|
730
737
|
value: item.price
|
|
731
738
|
})
|
|
@@ -779,20 +786,28 @@ const FormSubdomainSection = ({
|
|
|
779
786
|
focus,
|
|
780
787
|
initial,
|
|
781
788
|
last,
|
|
789
|
+
onAgreement,
|
|
782
790
|
preview,
|
|
791
|
+
refused,
|
|
783
792
|
section,
|
|
784
793
|
slugs = [],
|
|
785
794
|
style,
|
|
786
795
|
values
|
|
787
796
|
}) => {
|
|
788
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
797
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
789
798
|
const fields = (section == null ? void 0 : section.fields) || [];
|
|
790
799
|
const lists = fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
|
|
791
|
-
const prices = (
|
|
792
|
-
const currency = ((
|
|
793
|
-
const
|
|
794
|
-
|
|
795
|
-
|
|
800
|
+
const prices = priced(lists);
|
|
801
|
+
const currency = ((_a = section == null ? void 0 : section.settings) == null ? void 0 : _a.currency) || "usd";
|
|
802
|
+
const opens = (key) => {
|
|
803
|
+
var _a2;
|
|
804
|
+
return agreementContent((_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]);
|
|
805
|
+
};
|
|
806
|
+
const optOutLine = termsOptOut(values);
|
|
807
|
+
const smsConsent = Boolean(last) && (values == null ? void 0 : values.sms) !== false && Boolean((_c = (_b = values == null ? void 0 : values.agreements) == null ? void 0 : _b.sms) == null ? void 0 : _c.enabled) && slugs.includes("phone");
|
|
808
|
+
const marketingConsent = Boolean(last) && Boolean((_e = (_d = values == null ? void 0 : values.agreements) == null ? void 0 : _d.marketing) == null ? void 0 : _e.enabled) && agreementShown((_f = values == null ? void 0 : values.agreements) == null ? void 0 : _f.marketing);
|
|
809
|
+
const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled) && agreementShown((_i = values == null ? void 0 : values.agreements) == null ? void 0 : _i.terms);
|
|
810
|
+
const privacy = Boolean(last) && Boolean((_k = (_j = values == null ? void 0 : values.agreements) == null ? void 0 : _j.privacy) == null ? void 0 : _k.enabled) && Boolean(opens("privacy"));
|
|
796
811
|
const schema = useMemo(
|
|
797
812
|
() => {
|
|
798
813
|
var _a2;
|
|
@@ -832,10 +847,17 @@ const FormSubdomainSection = ({
|
|
|
832
847
|
},
|
|
833
848
|
[marketingConsent, section, smsConsent, termsConsent, values]
|
|
834
849
|
);
|
|
835
|
-
const { control, getValues, handleSubmit, formState } = useForm({
|
|
850
|
+
const { control, getValues, handleSubmit, formState, setError } = useForm({
|
|
836
851
|
defaultValues: initial || {},
|
|
837
852
|
resolver: resolver(schema)
|
|
838
853
|
});
|
|
854
|
+
useEffect(
|
|
855
|
+
() => Object.entries(refused || {}).forEach(([id, message]) => {
|
|
856
|
+
if (fields.some((field) => (field == null ? void 0 : field.id) === id)) setError("fields." + id, { message });
|
|
857
|
+
}),
|
|
858
|
+
[refused]
|
|
859
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
860
|
+
);
|
|
839
861
|
const answers = useWatch({
|
|
840
862
|
control,
|
|
841
863
|
name: "fields"
|
|
@@ -852,19 +874,34 @@ const FormSubdomainSection = ({
|
|
|
852
874
|
{
|
|
853
875
|
...{
|
|
854
876
|
labelId: "checkbox-" + key,
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
877
|
+
// @story public-entry/read-agreement
|
|
878
|
+
// A link opens in a new tab; a document opens over the form, with Back.
|
|
879
|
+
label: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
880
|
+
opens(key) === "link" ? /* @__PURE__ */ jsx(
|
|
881
|
+
Button,
|
|
882
|
+
{
|
|
883
|
+
...{
|
|
884
|
+
element: Link,
|
|
885
|
+
href: (_b2 = (_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]) == null ? void 0 : _b2.link,
|
|
886
|
+
inline: true,
|
|
887
|
+
target: "_blank",
|
|
888
|
+
variant: "link"
|
|
889
|
+
},
|
|
890
|
+
children: ((_d2 = (_c2 = values == null ? void 0 : values.agreements) == null ? void 0 : _c2[key]) == null ? void 0 : _d2.label) || fallback
|
|
891
|
+
}
|
|
892
|
+
) : opens(key) === "document" ? /* @__PURE__ */ jsx(
|
|
893
|
+
Button,
|
|
894
|
+
{
|
|
895
|
+
...{
|
|
896
|
+
inline: true,
|
|
897
|
+
onClick: () => onAgreement == null ? void 0 : onAgreement(key),
|
|
898
|
+
variant: "link"
|
|
899
|
+
},
|
|
900
|
+
children: ((_f2 = (_e2 = values == null ? void 0 : values.agreements) == null ? void 0 : _e2[key]) == null ? void 0 : _f2.label) || fallback
|
|
901
|
+
}
|
|
902
|
+
) : ((_h2 = (_g2 = values == null ? void 0 : values.agreements) == null ? void 0 : _g2[key]) == null ? void 0 : _h2.label) || fallback,
|
|
903
|
+
key === "terms" && " *"
|
|
904
|
+
] }),
|
|
868
905
|
onChange,
|
|
869
906
|
style,
|
|
870
907
|
value
|
|
@@ -873,7 +910,7 @@ const FormSubdomainSection = ({
|
|
|
873
910
|
);
|
|
874
911
|
};
|
|
875
912
|
const count = itemCount(lists, answers);
|
|
876
|
-
const itemsError = (
|
|
913
|
+
const itemsError = (_m = (_l = formState == null ? void 0 : formState.errors) == null ? void 0 : _l.items) == null ? void 0 : _m.message;
|
|
877
914
|
const totalBlock = (prices || itemsError) && /* @__PURE__ */ jsxs(
|
|
878
915
|
"div",
|
|
879
916
|
{
|
|
@@ -888,7 +925,7 @@ const FormSubdomainSection = ({
|
|
|
888
925
|
className: "flex items-center justify-between text-sm"
|
|
889
926
|
},
|
|
890
927
|
children: [
|
|
891
|
-
/* @__PURE__ */ jsx("span", { children: "
|
|
928
|
+
/* @__PURE__ */ jsx("span", { children: "TOTAL \xB7 " + count + " " + (count === 1 ? "ITEM" : "ITEMS") }),
|
|
892
929
|
/* @__PURE__ */ jsx("span", { children: formatCurrency({
|
|
893
930
|
code: currency.toUpperCase(),
|
|
894
931
|
display: "parts",
|
|
@@ -909,6 +946,38 @@ const FormSubdomainSection = ({
|
|
|
909
946
|
]
|
|
910
947
|
}
|
|
911
948
|
);
|
|
949
|
+
const drawn = (field) => /* @__PURE__ */ jsx(
|
|
950
|
+
Controller,
|
|
951
|
+
{
|
|
952
|
+
...{
|
|
953
|
+
control,
|
|
954
|
+
name: "fields." + field.id,
|
|
955
|
+
render: ({ field: { onChange, value } }) => {
|
|
956
|
+
var _a2, _b2;
|
|
957
|
+
return (field == null ? void 0 : field.slug) === "list" ? /* @__PURE__ */ jsx(
|
|
958
|
+
FormSubdomainItemList,
|
|
959
|
+
{
|
|
960
|
+
...{
|
|
961
|
+
currency,
|
|
962
|
+
field,
|
|
963
|
+
onChange,
|
|
964
|
+
prices,
|
|
965
|
+
style,
|
|
966
|
+
value
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
) : components[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]({
|
|
970
|
+
error: (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[field == null ? void 0 : field.id],
|
|
971
|
+
field,
|
|
972
|
+
onChange,
|
|
973
|
+
style,
|
|
974
|
+
value
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
},
|
|
979
|
+
field == null ? void 0 : field.id
|
|
980
|
+
);
|
|
912
981
|
const consent = [
|
|
913
982
|
termsConsent && ["terms"],
|
|
914
983
|
marketingConsent && ["marketing", agreementWording.marketing],
|
|
@@ -984,40 +1053,21 @@ const FormSubdomainSection = ({
|
|
|
984
1053
|
...{
|
|
985
1054
|
className: (lists.length > 0 ? "space-y-6 " : "space-y-4 ") + faded()
|
|
986
1055
|
},
|
|
987
|
-
children: fields.map((
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
FormSubdomainItemList,
|
|
998
|
-
{
|
|
999
|
-
...{
|
|
1000
|
-
currency,
|
|
1001
|
-
field,
|
|
1002
|
-
onChange,
|
|
1003
|
-
prices,
|
|
1004
|
-
style,
|
|
1005
|
-
value
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
) : components[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]({
|
|
1009
|
-
error: (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[field == null ? void 0 : field.id],
|
|
1010
|
-
field,
|
|
1011
|
-
onChange,
|
|
1012
|
-
style,
|
|
1013
|
-
value
|
|
1014
|
-
});
|
|
1015
|
-
}
|
|
1056
|
+
children: itemRuns(fields).map((run) => {
|
|
1057
|
+
var _a2;
|
|
1058
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1059
|
+
run.fields.length > 1 ? /* @__PURE__ */ jsx(
|
|
1060
|
+
"div",
|
|
1061
|
+
{
|
|
1062
|
+
...{
|
|
1063
|
+
className: "space-y-4"
|
|
1064
|
+
},
|
|
1065
|
+
children: run.fields.map(drawn)
|
|
1016
1066
|
}
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1067
|
+
) : drawn(run.fields[0]),
|
|
1068
|
+
run.fields.some((field) => isLastList(fields, field == null ? void 0 : field.id)) && totalBlock
|
|
1069
|
+
] }, (_a2 = run.fields[0]) == null ? void 0 : _a2.id);
|
|
1070
|
+
})
|
|
1021
1071
|
}
|
|
1022
1072
|
),
|
|
1023
1073
|
consent.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -1048,6 +1098,11 @@ const FormSubdomainSection = ({
|
|
|
1048
1098
|
{
|
|
1049
1099
|
...{
|
|
1050
1100
|
error: (_c2 = (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.agreements) == null ? void 0 : _b2[key]) == null ? void 0 : _c2.message,
|
|
1101
|
+
// @story public-entry/read-agreement
|
|
1102
|
+
// The organizer's own rules may not say it; our document does, in Opting out.
|
|
1103
|
+
...key === "terms" && opens("terms") === "link" && optOutLine && {
|
|
1104
|
+
message: optOutLine
|
|
1105
|
+
},
|
|
1051
1106
|
input: checkbox({
|
|
1052
1107
|
fallback,
|
|
1053
1108
|
key,
|
|
@@ -1083,11 +1138,41 @@ const FormSubdomainSection = ({
|
|
|
1083
1138
|
disabled,
|
|
1084
1139
|
style,
|
|
1085
1140
|
submitting: formState == null ? void 0 : formState.isSubmitting,
|
|
1086
|
-
|
|
1141
|
+
// @story public-entry/submit
|
|
1142
|
+
// The step's own Next text; the last step's is the form's one Submit text.
|
|
1143
|
+
text: last ? (values == null ? void 0 : values.submit) || "Submit" : (section == null ? void 0 : section.button) || "Next"
|
|
1087
1144
|
}
|
|
1088
1145
|
}
|
|
1089
1146
|
)
|
|
1090
1147
|
}
|
|
1148
|
+
),
|
|
1149
|
+
privacy && /* @__PURE__ */ jsx(
|
|
1150
|
+
"p",
|
|
1151
|
+
{
|
|
1152
|
+
...{
|
|
1153
|
+
className: "text-center text-xs " + faded("privacy"),
|
|
1154
|
+
...focus === "privacy" && {
|
|
1155
|
+
ref: focused
|
|
1156
|
+
}
|
|
1157
|
+
},
|
|
1158
|
+
children: /* @__PURE__ */ jsx(
|
|
1159
|
+
Button,
|
|
1160
|
+
{
|
|
1161
|
+
...{
|
|
1162
|
+
inline: true,
|
|
1163
|
+
variant: "link",
|
|
1164
|
+
...opens("privacy") === "link" ? {
|
|
1165
|
+
element: Link,
|
|
1166
|
+
href: (_o = (_n = values == null ? void 0 : values.agreements) == null ? void 0 : _n.privacy) == null ? void 0 : _o.link,
|
|
1167
|
+
target: "_blank"
|
|
1168
|
+
} : {
|
|
1169
|
+
onClick: () => onAgreement == null ? void 0 : onAgreement("privacy")
|
|
1170
|
+
}
|
|
1171
|
+
},
|
|
1172
|
+
children: ((_q = (_p = values == null ? void 0 : values.agreements) == null ? void 0 : _p.privacy) == null ? void 0 : _q.label) || "Privacy policy"
|
|
1173
|
+
}
|
|
1174
|
+
)
|
|
1175
|
+
}
|
|
1091
1176
|
)
|
|
1092
1177
|
]
|
|
1093
1178
|
}
|
|
@@ -1097,6 +1182,7 @@ const FormSubdomain = ({
|
|
|
1097
1182
|
agreements,
|
|
1098
1183
|
button,
|
|
1099
1184
|
disabled,
|
|
1185
|
+
documents,
|
|
1100
1186
|
fields,
|
|
1101
1187
|
focus,
|
|
1102
1188
|
integrations,
|
|
@@ -1107,20 +1193,29 @@ const FormSubdomain = ({
|
|
|
1107
1193
|
},
|
|
1108
1194
|
params,
|
|
1109
1195
|
preview,
|
|
1196
|
+
// @story public-entry/read-agreement
|
|
1197
|
+
// False while the campaign's giveaway is off ( lib/entry giveawayOn ).
|
|
1198
|
+
giveaway,
|
|
1110
1199
|
// The share payload's `sms` : false while texts are off on the platform.
|
|
1111
1200
|
sms,
|
|
1112
1201
|
step: start = 0,
|
|
1113
1202
|
style,
|
|
1203
|
+
// @story public-entry/submit
|
|
1204
|
+
// The form's one Submit text, on the last step ( `defaults.submit` ).
|
|
1205
|
+
submit,
|
|
1114
1206
|
tracking
|
|
1115
1207
|
}) => {
|
|
1116
|
-
var _a, _b, _c;
|
|
1208
|
+
var _a, _b, _c, _d, _e;
|
|
1117
1209
|
const { executeRecaptcha } = useGoogleReCaptcha();
|
|
1118
1210
|
const searchParams = useSearchParams();
|
|
1119
1211
|
const token = searchParams.get("drwbrdg_pre");
|
|
1120
1212
|
const [data, setData] = useState({});
|
|
1121
1213
|
const [step, setStep] = useState(start);
|
|
1214
|
+
const [reading, setReading] = useState(null);
|
|
1215
|
+
const [refused, setRefused] = useState(null);
|
|
1122
1216
|
const sections = sectionsOf(fields);
|
|
1123
1217
|
const slugs = sections.flatMap((section) => ((section == null ? void 0 : section.fields) || []).map((field) => field == null ? void 0 : field.slug));
|
|
1218
|
+
const before = Number(Boolean((_a = integrations == null ? void 0 : integrations.geocode) == null ? void 0 : _a.enabled)) + Number(Boolean((_b = integrations == null ? void 0 : integrations.age) == null ? void 0 : _b.enabled));
|
|
1124
1219
|
const merge = (object = {}) => ({
|
|
1125
1220
|
...data,
|
|
1126
1221
|
...object,
|
|
@@ -1131,7 +1226,7 @@ const FormSubdomain = ({
|
|
|
1131
1226
|
});
|
|
1132
1227
|
const onSubmit = useCallback(
|
|
1133
1228
|
async (values) => {
|
|
1134
|
-
var _a2, _b2;
|
|
1229
|
+
var _a2, _b2, _c2;
|
|
1135
1230
|
try {
|
|
1136
1231
|
let recaptcha;
|
|
1137
1232
|
if (Boolean((_a2 = integrations == null ? void 0 : integrations.recaptcha) == null ? void 0 : _a2.enabled)) {
|
|
@@ -1168,13 +1263,21 @@ const FormSubdomain = ({
|
|
|
1168
1263
|
);
|
|
1169
1264
|
}
|
|
1170
1265
|
} catch (error) {
|
|
1266
|
+
const index = refusedSection(sections, (_c2 = error == null ? void 0 : error.data) == null ? void 0 : _c2.fields);
|
|
1267
|
+
if (index >= 0) {
|
|
1268
|
+
setData(values);
|
|
1269
|
+
setRefused(error.data.fields);
|
|
1270
|
+
setStep(before + index);
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
;
|
|
1171
1274
|
onError(error);
|
|
1172
1275
|
}
|
|
1173
1276
|
},
|
|
1174
|
-
[executeRecaptcha, integrations, onError, onSuccess, params, preview, token, tracking]
|
|
1277
|
+
[before, executeRecaptcha, integrations, onError, onSuccess, params, preview, sections, token, tracking]
|
|
1175
1278
|
);
|
|
1176
1279
|
const forms = [
|
|
1177
|
-
...Boolean((
|
|
1280
|
+
...Boolean((_c = integrations == null ? void 0 : integrations.geocode) == null ? void 0 : _c.enabled) ? [
|
|
1178
1281
|
/* @__PURE__ */ jsx(
|
|
1179
1282
|
FormSubdomainGeocode,
|
|
1180
1283
|
{
|
|
@@ -1198,7 +1301,7 @@ const FormSubdomain = ({
|
|
|
1198
1301
|
"form-subdomain-geocode"
|
|
1199
1302
|
)
|
|
1200
1303
|
] : [],
|
|
1201
|
-
...Boolean((
|
|
1304
|
+
...Boolean((_d = integrations == null ? void 0 : integrations.age) == null ? void 0 : _d.enabled) ? [
|
|
1202
1305
|
/* @__PURE__ */ jsx(
|
|
1203
1306
|
FormSubdomainAge,
|
|
1204
1307
|
{
|
|
@@ -1223,7 +1326,7 @@ const FormSubdomain = ({
|
|
|
1223
1326
|
disabled,
|
|
1224
1327
|
preview,
|
|
1225
1328
|
style,
|
|
1226
|
-
values: (
|
|
1329
|
+
values: (_e = integrations == null ? void 0 : integrations.age) == null ? void 0 : _e.settings
|
|
1227
1330
|
}
|
|
1228
1331
|
},
|
|
1229
1332
|
"form-subdomain-age"
|
|
@@ -1241,6 +1344,7 @@ const FormSubdomain = ({
|
|
|
1241
1344
|
button,
|
|
1242
1345
|
callback: async (object) => {
|
|
1243
1346
|
const merged = merge(object);
|
|
1347
|
+
setRefused(null);
|
|
1244
1348
|
if (index < sections.length - 1) {
|
|
1245
1349
|
setData(merged);
|
|
1246
1350
|
setStep(step + 1);
|
|
@@ -1252,39 +1356,61 @@ const FormSubdomain = ({
|
|
|
1252
1356
|
focus,
|
|
1253
1357
|
initial: data,
|
|
1254
1358
|
last: index === sections.length - 1,
|
|
1359
|
+
onAgreement: setReading,
|
|
1255
1360
|
preview,
|
|
1361
|
+
refused,
|
|
1256
1362
|
section,
|
|
1257
1363
|
slugs,
|
|
1258
1364
|
style,
|
|
1259
1365
|
values: {
|
|
1260
1366
|
agreements,
|
|
1261
|
-
|
|
1367
|
+
giveaway,
|
|
1368
|
+
sms,
|
|
1369
|
+
submit
|
|
1262
1370
|
}
|
|
1263
1371
|
}
|
|
1264
1372
|
},
|
|
1265
1373
|
"form-subdomain-section-" + section.id
|
|
1266
1374
|
))
|
|
1267
1375
|
];
|
|
1268
|
-
return /* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ jsxs(
|
|
1269
1377
|
"div",
|
|
1270
1378
|
{
|
|
1271
1379
|
...{
|
|
1272
1380
|
className: "space-y-6"
|
|
1273
1381
|
},
|
|
1274
|
-
children:
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1382
|
+
children: [
|
|
1383
|
+
reading && /* @__PURE__ */ jsx(
|
|
1384
|
+
FormSubdomainAgreement,
|
|
1385
|
+
{
|
|
1386
|
+
...{
|
|
1387
|
+
agreement: agreements == null ? void 0 : agreements[reading],
|
|
1388
|
+
back: () => setReading(null),
|
|
1389
|
+
button,
|
|
1390
|
+
data: documents,
|
|
1391
|
+
style,
|
|
1392
|
+
title: agreementTitles[reading]
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
),
|
|
1396
|
+
/* @__PURE__ */ jsx(
|
|
1397
|
+
"div",
|
|
1398
|
+
{
|
|
1399
|
+
...{
|
|
1400
|
+
className: "relative w-full space-y-6" + (reading ? " hidden" : "")
|
|
1401
|
+
},
|
|
1402
|
+
children: forms == null ? void 0 : forms[step]
|
|
1403
|
+
}
|
|
1404
|
+
)
|
|
1405
|
+
]
|
|
1283
1406
|
}
|
|
1284
1407
|
);
|
|
1285
1408
|
};
|
|
1286
1409
|
var form_subdomain_default = FormSubdomain;
|
|
1287
1410
|
export {
|
|
1411
|
+
FormSubdomainAge,
|
|
1412
|
+
FormSubdomainGeocode,
|
|
1413
|
+
FormSubdomainItemList,
|
|
1288
1414
|
FormSubdomainMessage,
|
|
1289
1415
|
FormSubdomainSubmission,
|
|
1290
1416
|
form_subdomain_default as default
|