@drawbridge/components 0.1.37 → 0.1.39

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 (329) hide show
  1. package/components/styles.css +68 -355
  2. package/dist/advertisement.js +15 -20
  3. package/dist/advertisement.mjs +15 -20
  4. package/dist/bridge/advertisements.js +4 -2
  5. package/dist/bridge/advertisements.mjs +5 -3
  6. package/dist/bridge/fields.js +89 -6
  7. package/dist/bridge/fields.mjs +89 -7
  8. package/dist/bridge/form-subdomain-agreement.js +165 -0
  9. package/dist/bridge/form-subdomain-agreement.mjs +132 -0
  10. package/dist/bridge/form-subdomain-embed.js +5 -1
  11. package/dist/bridge/form-subdomain-embed.mjs +5 -1
  12. package/dist/bridge/form-subdomain-header.js +21 -14
  13. package/dist/bridge/form-subdomain-header.mjs +20 -14
  14. package/dist/bridge/form-subdomain-issue.js +17 -8
  15. package/dist/bridge/form-subdomain-issue.mjs +17 -8
  16. package/dist/bridge/form-subdomain-missions.js +58 -52
  17. package/dist/bridge/form-subdomain-missions.mjs +60 -54
  18. package/dist/bridge/form-subdomain.js +226 -95
  19. package/dist/bridge/form-subdomain.mjs +225 -97
  20. package/dist/bridge/lib/entry.js +71 -6
  21. package/dist/bridge/lib/entry.mjs +60 -5
  22. package/dist/bridge/lib/order.js +23 -0
  23. package/dist/bridge/lib/order.mjs +20 -0
  24. package/dist/bridge/template-layout.js +5 -2
  25. package/dist/bridge/template-layout.mjs +6 -3
  26. package/dist/bridge/template-modal.js +82 -15
  27. package/dist/bridge/template-modal.mjs +83 -16
  28. package/dist/bridge/template-subdomain-gallery.js +126 -75
  29. package/dist/bridge/template-subdomain-gallery.mjs +122 -75
  30. package/dist/bridge/template-subdomain.js +16 -14
  31. package/dist/bridge/template-subdomain.mjs +17 -15
  32. package/dist/dashboard/avatar.js +5 -0
  33. package/dist/dashboard/avatar.mjs +5 -0
  34. package/dist/dashboard/campaign-form.js +1815 -0
  35. package/dist/dashboard/campaign-form.mjs +1786 -0
  36. package/dist/dashboard/card-affiliate.js +3 -2
  37. package/dist/dashboard/card-affiliate.mjs +3 -2
  38. package/dist/dashboard/card-campaign-agreement.js +172 -0
  39. package/dist/dashboard/card-campaign-agreement.mjs +139 -0
  40. package/dist/dashboard/card-campaign-switch.js +25 -10
  41. package/dist/dashboard/card-campaign-switch.mjs +24 -10
  42. package/dist/dashboard/card-order.js +6 -14
  43. package/dist/dashboard/card-order.mjs +6 -14
  44. package/dist/dashboard/card-section.js +69 -26
  45. package/dist/dashboard/card-section.mjs +65 -26
  46. package/dist/dashboard/card-shortcut.js +183 -0
  47. package/dist/dashboard/card-shortcut.mjs +154 -0
  48. package/dist/dashboard/card-tile.js +3 -35
  49. package/dist/dashboard/card-tile.mjs +3 -34
  50. package/dist/dashboard/document-blocks.js +305 -0
  51. package/dist/dashboard/document-blocks.mjs +270 -0
  52. package/dist/dashboard/drawer-subscription.js +52 -14
  53. package/dist/dashboard/drawer-subscription.mjs +52 -14
  54. package/dist/dashboard/drawer.js +20 -3
  55. package/dist/dashboard/drawer.mjs +21 -4
  56. package/dist/dashboard/dropdown.js +6 -2
  57. package/dist/dashboard/dropdown.mjs +6 -2
  58. package/dist/dashboard/form-admin-subscription-custom.js +72 -8
  59. package/dist/dashboard/form-admin-subscription-custom.mjs +72 -8
  60. package/dist/dashboard/form-ai.js +0 -148
  61. package/dist/dashboard/form-ai.mjs +1 -148
  62. package/dist/dashboard/form-filters-analytics.js +86 -38
  63. package/dist/dashboard/form-filters-analytics.mjs +85 -38
  64. package/dist/dashboard/form-organization-brand.js +30 -13
  65. package/dist/dashboard/form-organization-brand.mjs +30 -13
  66. package/dist/dashboard/form-organization-campaign-advertisement.js +38 -112
  67. package/dist/dashboard/form-organization-campaign-advertisement.mjs +38 -112
  68. package/dist/dashboard/form-organization-campaign-advertisements.js +374 -0
  69. package/dist/dashboard/form-organization-campaign-advertisements.mjs +345 -0
  70. package/dist/dashboard/form-organization-campaign-agreement.js +402 -210
  71. package/dist/dashboard/form-organization-campaign-agreement.mjs +398 -211
  72. package/dist/dashboard/form-organization-campaign-design.js +258 -0
  73. package/dist/dashboard/form-organization-campaign-design.mjs +223 -0
  74. package/dist/dashboard/form-organization-campaign-field-item.js +585 -0
  75. package/dist/dashboard/form-organization-campaign-field-item.mjs +552 -0
  76. package/dist/dashboard/form-organization-campaign-field-number.js +48 -7
  77. package/dist/dashboard/form-organization-campaign-field-number.mjs +48 -7
  78. package/dist/dashboard/form-organization-campaign-field-select.js +15 -4
  79. package/dist/dashboard/form-organization-campaign-field-select.mjs +15 -4
  80. package/dist/dashboard/form-organization-campaign-field-skill.js +359 -0
  81. package/dist/dashboard/form-organization-campaign-field-skill.mjs +330 -0
  82. package/dist/dashboard/form-organization-campaign-field-text.js +46 -6
  83. package/dist/dashboard/form-organization-campaign-field-text.mjs +46 -6
  84. package/dist/dashboard/form-organization-campaign-field-textarea.js +22 -13
  85. package/dist/dashboard/form-organization-campaign-field-textarea.mjs +22 -13
  86. package/dist/dashboard/form-organization-campaign-footer.js +178 -0
  87. package/dist/dashboard/form-organization-campaign-footer.mjs +149 -0
  88. package/dist/dashboard/form-organization-campaign-integration-age.js +2 -35
  89. package/dist/dashboard/form-organization-campaign-integration-age.mjs +2 -35
  90. package/dist/dashboard/form-organization-campaign-integration-geocode.js +4 -1
  91. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +4 -1
  92. package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
  93. package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
  94. package/dist/dashboard/form-organization-campaign-page-preview.js +1 -2
  95. package/dist/dashboard/form-organization-campaign-page-preview.mjs +1 -2
  96. package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
  97. package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
  98. package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
  99. package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
  100. package/dist/dashboard/form-organization-campaign-page-slug.js +2 -3
  101. package/dist/dashboard/form-organization-campaign-page-slug.mjs +2 -3
  102. package/dist/dashboard/form-organization-campaign-page.js +168 -265
  103. package/dist/dashboard/form-organization-campaign-page.mjs +170 -266
  104. package/dist/dashboard/form-organization-campaign-section.js +125 -107
  105. package/dist/dashboard/form-organization-campaign-section.mjs +121 -107
  106. package/dist/dashboard/form-organization-campaign.js +119 -9
  107. package/dist/dashboard/form-organization-campaign.mjs +118 -9
  108. package/dist/dashboard/form-organization-file-frame.js +7 -1
  109. package/dist/dashboard/form-organization-file-frame.mjs +7 -1
  110. package/dist/dashboard/form-organization-workflow.js +587 -530
  111. package/dist/dashboard/form-organization-workflow.mjs +588 -531
  112. package/dist/dashboard/form-organization.js +22 -0
  113. package/dist/dashboard/form-organization.mjs +22 -0
  114. package/dist/dashboard/form-reposition.js +396 -0
  115. package/dist/dashboard/form-reposition.mjs +359 -0
  116. package/dist/dashboard/form-support.js +189 -0
  117. package/dist/dashboard/form-support.mjs +160 -0
  118. package/dist/dashboard/form-tests.js +683 -0
  119. package/dist/dashboard/form-tests.mjs +646 -0
  120. package/dist/dashboard/form-verify-prize.js +114 -34
  121. package/dist/dashboard/form-verify-prize.mjs +111 -34
  122. package/dist/dashboard/google.js +8 -1
  123. package/dist/dashboard/google.mjs +8 -1
  124. package/dist/dashboard/input-array.js +2 -0
  125. package/dist/dashboard/input-array.mjs +2 -0
  126. package/dist/dashboard/input-editor.js +17 -6
  127. package/dist/dashboard/input-editor.mjs +17 -6
  128. package/dist/dashboard/input-fields.js +287 -437
  129. package/dist/dashboard/input-fields.mjs +287 -436
  130. package/dist/dashboard/input-file.js +70 -2
  131. package/dist/dashboard/input-file.mjs +70 -2
  132. package/dist/dashboard/input-font.js +64 -55
  133. package/dist/dashboard/input-font.mjs +64 -55
  134. package/dist/dashboard/input-resource.js +4 -1
  135. package/dist/dashboard/input-resource.mjs +4 -1
  136. package/dist/dashboard/lib/ab-tests.js +130 -0
  137. package/dist/dashboard/lib/ab-tests.mjs +94 -0
  138. package/dist/dashboard/lib/features.js +1 -1
  139. package/dist/dashboard/lib/features.mjs +1 -1
  140. package/dist/dashboard/lib/focus.js +93 -0
  141. package/dist/dashboard/lib/focus.mjs +69 -0
  142. package/dist/dashboard/lib/form-page.js +209 -0
  143. package/dist/dashboard/lib/form-page.mjs +161 -0
  144. package/dist/dashboard/lib/item-list.js +0 -15
  145. package/dist/dashboard/lib/item-list.mjs +0 -14
  146. package/dist/dashboard/lib/rail.js +16 -17
  147. package/dist/dashboard/lib/rail.mjs +15 -16
  148. package/dist/dashboard/lib/sms.js +8 -2
  149. package/dist/dashboard/lib/sms.mjs +6 -1
  150. package/dist/dashboard/list-resource.js +2 -0
  151. package/dist/dashboard/list-resource.mjs +2 -0
  152. package/dist/dashboard/menu.js +54 -5
  153. package/dist/dashboard/menu.mjs +53 -5
  154. package/dist/dashboard/modal.js +19 -4
  155. package/dist/dashboard/modal.mjs +20 -5
  156. package/dist/dashboard/order-sections.js +4 -0
  157. package/dist/dashboard/order-sections.mjs +4 -0
  158. package/dist/dashboard/preview.js +838 -324
  159. package/dist/dashboard/preview.mjs +826 -324
  160. package/dist/dashboard/provider-ui.js +20 -12
  161. package/dist/dashboard/provider-ui.mjs +21 -13
  162. package/dist/dashboard/recharts.js +53 -28
  163. package/dist/dashboard/recharts.mjs +53 -28
  164. package/dist/dashboard/swatch.js +35 -0
  165. package/dist/dashboard/swatch.mjs +31 -0
  166. package/dist/dashboard/table-contacts.js +6 -10
  167. package/dist/dashboard/table-contacts.mjs +6 -10
  168. package/dist/dashboard/table.js +10 -3
  169. package/dist/dashboard/table.mjs +9 -3
  170. package/dist/dashboard/template-dashboard.js +12 -7
  171. package/dist/dashboard/template-dashboard.mjs +11 -7
  172. package/dist/dashboard/template-design.js +564 -0
  173. package/dist/dashboard/template-design.mjs +531 -0
  174. package/dist/dashboard/template-rail.js +192 -126
  175. package/dist/dashboard/template-rail.mjs +190 -125
  176. package/dist/dashboard/template-socket.js +0 -3
  177. package/dist/dashboard/template-socket.mjs +0 -3
  178. package/dist/dashboard/template-test-page.js +436 -0
  179. package/dist/dashboard/template-test-page.mjs +407 -0
  180. package/dist/dashboard/template-tests.js +141 -0
  181. package/dist/dashboard/template-tests.mjs +112 -0
  182. package/dist/dashboard/template-ui.js +20 -11
  183. package/dist/dashboard/template-ui.mjs +22 -13
  184. package/dist/dashboard/template-variant.js +185 -0
  185. package/dist/dashboard/template-variant.mjs +156 -0
  186. package/dist/icons/arrow-down-long.js +47 -0
  187. package/dist/icons/arrow-down-long.mjs +28 -0
  188. package/dist/icons/arrows-pointing-out.js +46 -0
  189. package/dist/icons/arrows-pointing-out.mjs +27 -0
  190. package/dist/icons/beaker.js +46 -0
  191. package/dist/icons/beaker.mjs +27 -0
  192. package/dist/icons/identification.js +46 -0
  193. package/dist/icons/identification.mjs +27 -0
  194. package/dist/icons/lifebuoy.js +46 -0
  195. package/dist/icons/lifebuoy.mjs +27 -0
  196. package/dist/icons/rectangle-group.js +46 -0
  197. package/dist/icons/rectangle-group.mjs +27 -0
  198. package/dist/icons/rectangle-stack.js +46 -0
  199. package/dist/icons/rectangle-stack.mjs +27 -0
  200. package/dist/icons/shopping-bag.js +46 -0
  201. package/dist/icons/shopping-bag.mjs +27 -0
  202. package/dist/icons/swatch.js +46 -0
  203. package/dist/icons/swatch.mjs +27 -0
  204. package/dist/icons/window.js +46 -0
  205. package/dist/icons/window.mjs +27 -0
  206. package/dist/icons/zoom-in.js +46 -0
  207. package/dist/icons/zoom-in.mjs +27 -0
  208. package/dist/input-answer.js +60 -0
  209. package/dist/input-answer.mjs +27 -0
  210. package/dist/input-checkbox.js +7 -1
  211. package/dist/input-checkbox.mjs +7 -1
  212. package/dist/input-name.js +3 -3
  213. package/dist/input-name.mjs +3 -3
  214. package/dist/input-select.js +3 -1
  215. package/dist/input-select.mjs +3 -1
  216. package/dist/provider-font.js +4 -3
  217. package/dist/provider-font.mjs +4 -3
  218. package/dist/shared/badge.js +15 -0
  219. package/dist/shared/badge.mjs +11 -0
  220. package/dist/shared/carousel.js +11 -7
  221. package/dist/shared/carousel.mjs +11 -7
  222. package/dist/shared/document-pieces.js +295 -0
  223. package/dist/shared/document-pieces.mjs +260 -0
  224. package/dist/shared/lib/campaign.js +18 -9
  225. package/dist/shared/lib/campaign.mjs +17 -9
  226. package/dist/shared/lib/helpers.js +24 -0
  227. package/dist/shared/lib/helpers.mjs +22 -0
  228. package/dist/shared/lib/video.js +6 -0
  229. package/dist/shared/lib/video.mjs +5 -0
  230. package/dist/shared/sortable.js +27 -10
  231. package/dist/shared/sortable.mjs +27 -10
  232. package/dist/shared/tabs.js +1 -1
  233. package/dist/shared/tabs.mjs +1 -1
  234. package/dist/video.js +127 -9
  235. package/dist/video.mjs +125 -11
  236. package/package.json +176 -20
  237. package/types/bridge/fields.d.ts +6 -1
  238. package/types/bridge/form-subdomain-agreement.d.ts +27 -0
  239. package/types/bridge/form-subdomain-missions.d.ts +2 -0
  240. package/types/bridge/form-subdomain.d.ts +62 -3
  241. package/types/bridge/lib/entry.d.ts +46 -7
  242. package/types/bridge/lib/order.d.ts +13 -2
  243. package/types/bridge/subdomain-content.d.ts +1 -0
  244. package/types/bridge/template-subdomain-gallery.d.ts +13 -1
  245. package/types/dashboard/campaign-form.d.ts +42 -0
  246. package/types/dashboard/card-campaign-agreement.d.ts +26 -0
  247. package/types/dashboard/card-campaign-switch.d.ts +13 -1
  248. package/types/dashboard/card-order.d.ts +2 -2
  249. package/types/dashboard/card-section.d.ts +9 -1
  250. package/types/dashboard/card-shortcut.d.ts +40 -0
  251. package/types/dashboard/card-tile.d.ts +4 -9
  252. package/types/dashboard/document-blocks.d.ts +14 -0
  253. package/types/dashboard/drawer.d.ts +3 -0
  254. package/types/dashboard/form-ai.d.ts +0 -17
  255. package/types/dashboard/form-organization-brand.d.ts +3 -0
  256. package/types/dashboard/form-organization-campaign-advertisements.d.ts +15 -0
  257. package/types/dashboard/form-organization-campaign-agreement.d.ts +53 -10
  258. package/types/dashboard/form-organization-campaign-design.d.ts +46 -0
  259. package/types/dashboard/form-organization-campaign-field-item.d.ts +36 -0
  260. package/types/dashboard/form-organization-campaign-field-number.d.ts +4 -1
  261. package/types/dashboard/form-organization-campaign-field-select.d.ts +6 -1
  262. package/types/dashboard/form-organization-campaign-field-skill.d.ts +36 -0
  263. package/types/dashboard/form-organization-campaign-field-text.d.ts +5 -1
  264. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +4 -1
  265. package/types/dashboard/form-organization-campaign-footer.d.ts +23 -0
  266. package/types/dashboard/form-organization-campaign-integration-age.d.ts +2 -1
  267. package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +2 -0
  268. package/types/dashboard/form-organization-campaign-page.d.ts +9 -15
  269. package/types/dashboard/form-organization-campaign-section.d.ts +24 -8
  270. package/types/dashboard/form-organization-campaign.d.ts +3 -0
  271. package/types/dashboard/form-organization-workflow.d.ts +3 -0
  272. package/types/dashboard/form-organization.d.ts +2 -2
  273. package/types/dashboard/form-reposition.d.ts +29 -0
  274. package/types/dashboard/form-support.d.ts +14 -0
  275. package/types/dashboard/form-tests.d.ts +78 -0
  276. package/types/dashboard/form-verify-prize.d.ts +30 -3
  277. package/types/dashboard/input-editor.d.ts +9 -0
  278. package/types/dashboard/input-fields.d.ts +8 -5
  279. package/types/dashboard/input-file.d.ts +4 -0
  280. package/types/dashboard/input-resource.d.ts +1 -0
  281. package/types/dashboard/lib/ab-tests.d.ts +50 -0
  282. package/types/dashboard/lib/escape.d.ts +4 -0
  283. package/types/dashboard/lib/focus.d.ts +16 -0
  284. package/types/dashboard/lib/form-page.d.ts +25 -0
  285. package/types/dashboard/lib/item-list.d.ts +10 -5
  286. package/types/dashboard/lib/rail.d.ts +0 -1
  287. package/types/dashboard/lib/sms.d.ts +7 -0
  288. package/types/dashboard/modal.d.ts +3 -1
  289. package/types/dashboard/preview.d.ts +65 -10
  290. package/types/dashboard/recharts.d.ts +3 -0
  291. package/types/dashboard/swatch.d.ts +4 -0
  292. package/types/dashboard/template-dashboard.d.ts +3 -0
  293. package/types/dashboard/template-design.d.ts +30 -0
  294. package/types/dashboard/template-test-page.d.ts +69 -0
  295. package/types/dashboard/template-tests.d.ts +30 -0
  296. package/types/dashboard/template-variant.d.ts +18 -0
  297. package/types/icons/arrow-down-long.d.ts +5 -0
  298. package/types/icons/arrows-pointing-out.d.ts +5 -0
  299. package/types/icons/beaker.d.ts +5 -0
  300. package/types/icons/identification.d.ts +5 -0
  301. package/types/icons/lifebuoy.d.ts +5 -0
  302. package/types/icons/rectangle-group.d.ts +5 -0
  303. package/types/icons/rectangle-stack.d.ts +5 -0
  304. package/types/icons/shopping-bag.d.ts +5 -0
  305. package/types/icons/swatch.d.ts +5 -0
  306. package/types/icons/window.d.ts +5 -0
  307. package/types/icons/zoom-in.d.ts +5 -0
  308. package/types/input-answer.d.ts +15 -0
  309. package/types/input-select.d.ts +2 -0
  310. package/types/shared/button.d.ts +1 -1
  311. package/types/shared/document-pieces.d.ts +34 -0
  312. package/types/shared/lib/campaign.d.ts +11 -0
  313. package/types/shared/lib/helpers.d.ts +22 -1
  314. package/types/shared/lib/motion.d.ts +2 -0
  315. package/types/shared/lib/video.d.ts +3 -0
  316. package/types/shared/sortable.d.ts +6 -0
  317. package/types/video.d.ts +18 -2
  318. package/dist/bridge/template-preview.js +0 -208
  319. package/dist/bridge/template-preview.mjs +0 -173
  320. package/dist/dashboard/device.js +0 -95
  321. package/dist/dashboard/device.mjs +0 -72
  322. package/dist/dashboard/form-organization-campaign-field-list.js +0 -425
  323. package/dist/dashboard/form-organization-campaign-field-list.mjs +0 -396
  324. package/dist/dashboard/item-row.js +0 -92
  325. package/dist/dashboard/item-row.mjs +0 -63
  326. package/types/bridge/template-preview.d.ts +0 -10
  327. package/types/dashboard/device.d.ts +0 -12
  328. package/types/dashboard/form-organization-campaign-field-list.d.ts +0 -36
  329. package/types/dashboard/item-row.d.ts +0 -25
@@ -28,6 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var form_subdomain_exports = {};
30
30
  __export(form_subdomain_exports, {
31
+ FormSubdomainAge: () => FormSubdomainAge,
32
+ FormSubdomainGeocode: () => FormSubdomainGeocode,
33
+ FormSubdomainItemList: () => FormSubdomainItemList,
31
34
  FormSubdomainMessage: () => FormSubdomainMessage,
32
35
  FormSubdomainSubmission: () => FormSubdomainSubmission,
33
36
  default: () => form_subdomain_default
@@ -49,6 +52,7 @@ var import_react_google_recaptcha_v3 = require("react-google-recaptcha-v3");
49
52
  var import_recaptcha = require("./lib/recaptcha");
50
53
  var import_url = require("./lib/url");
51
54
  var import_entry = require("./lib/entry");
55
+ var import_form_subdomain_agreement = __toESM(require("./form-subdomain-agreement"));
52
56
  var import_location = require("./lib/location");
53
57
  var import_order = require("./lib/order");
54
58
  var import_form = __toESM(require("../shared/form"));
@@ -79,6 +83,7 @@ const scrollToCentre = (node) => {
79
83
  };
80
84
  const FormSubdomainSubmission = ({
81
85
  affiliate,
86
+ after = import_entry.AFTER,
82
87
  button,
83
88
  checkout,
84
89
  giveaway,
@@ -183,6 +188,7 @@ const FormSubdomainSubmission = ({
183
188
  {
184
189
  ...{
185
190
  advertisements,
191
+ after,
186
192
  button,
187
193
  contact: data == null ? void 0 : data.contact,
188
194
  message,
@@ -196,6 +202,10 @@ const FormSubdomainSubmission = ({
196
202
  }
197
203
  }
198
204
  );
205
+ const parts = {
206
+ advertisements,
207
+ message: message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormSubdomainMessage, { ...{ message, style } })
208
+ };
199
209
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
200
210
  "div",
201
211
  {
@@ -208,16 +218,13 @@ const FormSubdomainSubmission = ({
208
218
  {
209
219
  ...{
210
220
  button,
211
- title,
212
221
  preview,
213
222
  style,
214
- ...message && {
215
- message
216
- }
223
+ title
217
224
  }
218
225
  }
219
226
  ),
220
- advertisements
227
+ after.map((key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: parts[key] }, key))
221
228
  ]
222
229
  }
223
230
  );
@@ -321,10 +328,11 @@ const FormSubdomainGeocode = ({
321
328
  disabled,
322
329
  callback,
323
330
  preview,
331
+ still,
324
332
  style,
325
333
  values
326
334
  }) => {
327
- const [state, setState] = (0, import_react.useState)(disabled ? { message: "Campaign is not currently active", status: "inactive" } : { status: "checking" });
335
+ const [state, setState] = (0, import_react.useState)(still ? { status: "asking" } : disabled ? { message: "Campaign is not currently active", status: "inactive" } : { status: "checking" });
328
336
  const [attempt, setAttempt] = (0, import_react.useState)(0);
329
337
  const searchParams = (0, import_navigation.useSearchParams)();
330
338
  const token = searchParams.get("drwbrdg_pre");
@@ -333,7 +341,7 @@ const FormSubdomainGeocode = ({
333
341
  (0, import_react.useEffect)(
334
342
  () => {
335
343
  var _a, _b;
336
- if (disabled) return;
344
+ if (disabled || still) return;
337
345
  if (!navigator.geolocation) {
338
346
  setState({ status: "unsupported" });
339
347
  return;
@@ -371,7 +379,7 @@ const FormSubdomainGeocode = ({
371
379
  live = false;
372
380
  };
373
381
  },
374
- [attempt, disabled, preview, token, values == null ? void 0 : values.slug, values == null ? void 0 : values.subdomain]
382
+ [attempt, disabled, preview, still, token, values == null ? void 0 : values.slug, values == null ? void 0 : values.subdomain]
375
383
  );
376
384
  if (["denied", "inactive", "missing", "outside", "unsupported"].includes(state.status)) {
377
385
  const retry = ["denied", "missing"].includes(state.status);
@@ -511,7 +519,8 @@ const FormSubdomainAge = ({
511
519
  {
512
520
  ...{
513
521
  button,
514
- title: "Confirm your age",
522
+ description: values == null ? void 0 : values.description,
523
+ title: (values == null ? void 0 : values.title) || "Confirm your age",
515
524
  style
516
525
  }
517
526
  }
@@ -558,7 +567,7 @@ const FormSubdomainAge = ({
558
567
  className: "space-y-2 w-full"
559
568
  },
560
569
  children: [
561
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Month" }),
570
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Month *" }),
562
571
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
563
572
  import_input_text.default,
564
573
  {
@@ -586,7 +595,7 @@ const FormSubdomainAge = ({
586
595
  className: "space-y-2 w-full"
587
596
  },
588
597
  children: [
589
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Day" }),
598
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Day *" }),
590
599
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
591
600
  import_input_text.default,
592
601
  {
@@ -614,7 +623,7 @@ const FormSubdomainAge = ({
614
623
  className: "space-y-2 w-full"
615
624
  },
616
625
  children: [
617
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Year" }),
626
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Year *" }),
618
627
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
619
628
  import_input_text.default,
620
629
  {
@@ -655,7 +664,8 @@ const FormSubdomainAge = ({
655
664
  ...{
656
665
  disabled,
657
666
  style,
658
- submitting: formState == null ? void 0 : formState.isSubmitting
667
+ submitting: formState == null ? void 0 : formState.isSubmitting,
668
+ text: (values == null ? void 0 : values.button) || "Next"
659
669
  }
660
670
  }
661
671
  )
@@ -671,11 +681,11 @@ const FormSubdomainItemList = ({
671
681
  currency,
672
682
  field,
673
683
  onChange,
674
- prices,
684
+ prices = true,
675
685
  style,
676
686
  value
677
687
  }) => {
678
- var _a;
688
+ var _a, _b;
679
689
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
680
690
  "div",
681
691
  {
@@ -683,8 +693,8 @@ const FormSubdomainItemList = ({
683
693
  className: "space-y-2"
684
694
  },
685
695
  children: [
686
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
687
- "p",
696
+ (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).length !== 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
697
+ "h5",
688
698
  {
689
699
  ...{
690
700
  className: "text-xs uppercase tracking-wide opacity-60"
@@ -698,8 +708,8 @@ const FormSubdomainItemList = ({
698
708
  ...{
699
709
  className: "space-y-4"
700
710
  },
701
- children: (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).map((item) => {
702
- var _a2, _b;
711
+ children: (((_b = field == null ? void 0 : field.settings) == null ? void 0 : _b.items) || []).map((item) => {
712
+ var _a2, _b2;
703
713
  const quantity = Number(value == null ? void 0 : value[item.id]) || 0;
704
714
  const src = (0, import_cdn.cdnSrc)(item.image, "200x200", (_a2 = item.image) == null ? void 0 : _a2.updatedAt);
705
715
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -725,7 +735,7 @@ const FormSubdomainItemList = ({
725
735
  {
726
736
  ...{
727
737
  // The image's own description, else its file name, as every image slot.
728
- alt: item.description || ((_b = item.image) == null ? void 0 : _b.filename) || "",
738
+ alt: item.description || ((_b2 = item.image) == null ? void 0 : _b2.filename) || "",
729
739
  className: "object-cover",
730
740
  fill: true,
731
741
  sizes: "56px",
@@ -759,7 +769,7 @@ const FormSubdomainItemList = ({
759
769
  className: "text-xs opacity-60"
760
770
  },
761
771
  children: (0, import_drawbridge_utils.formatCurrency)({
762
- code: currency.toUpperCase(),
772
+ code: (currency || "usd").toUpperCase(),
763
773
  display: "parts",
764
774
  value: item.price
765
775
  })
@@ -813,20 +823,28 @@ const FormSubdomainSection = ({
813
823
  focus,
814
824
  initial,
815
825
  last,
826
+ onAgreement,
816
827
  preview,
828
+ refused,
817
829
  section,
818
830
  slugs = [],
819
831
  style,
820
832
  values
821
833
  }) => {
822
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
834
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
823
835
  const fields = (section == null ? void 0 : section.fields) || [];
824
836
  const lists = fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
825
- const prices = ((_a = section == null ? void 0 : section.settings) == null ? void 0 : _a.prices) !== false;
826
- const currency = ((_b = section == null ? void 0 : section.settings) == null ? void 0 : _b.currency) || "usd";
827
- const smsConsent = Boolean(last) && (values == null ? void 0 : values.sms) !== false && (Boolean((_d = (_c = values == null ? void 0 : values.agreements) == null ? void 0 : _c.sms) == null ? void 0 : _d.enabled) || slugs.includes("phone"));
828
- const marketingConsent = Boolean(last) && Boolean((_f = (_e = values == null ? void 0 : values.agreements) == null ? void 0 : _e.marketing) == null ? void 0 : _f.enabled);
829
- const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled);
837
+ const prices = (0, import_order.priced)(lists);
838
+ const currency = ((_a = section == null ? void 0 : section.settings) == null ? void 0 : _a.currency) || "usd";
839
+ const opens = (key) => {
840
+ var _a2;
841
+ return (0, import_entry.agreementContent)((_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]);
842
+ };
843
+ const optOutLine = (0, import_entry.termsOptOut)(values);
844
+ 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");
845
+ const marketingConsent = Boolean(last) && Boolean((_e = (_d = values == null ? void 0 : values.agreements) == null ? void 0 : _d.marketing) == null ? void 0 : _e.enabled) && (0, import_entry.agreementShown)((_f = values == null ? void 0 : values.agreements) == null ? void 0 : _f.marketing);
846
+ const termsConsent = Boolean(last) && Boolean((_h = (_g = values == null ? void 0 : values.agreements) == null ? void 0 : _g.terms) == null ? void 0 : _h.enabled) && (0, import_entry.agreementShown)((_i = values == null ? void 0 : values.agreements) == null ? void 0 : _i.terms);
847
+ 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"));
830
848
  const schema = (0, import_react.useMemo)(
831
849
  () => {
832
850
  var _a2;
@@ -866,10 +884,17 @@ const FormSubdomainSection = ({
866
884
  },
867
885
  [marketingConsent, section, smsConsent, termsConsent, values]
868
886
  );
869
- const { control, getValues, handleSubmit, formState } = (0, import_react_hook_form.useForm)({
887
+ const { control, getValues, handleSubmit, formState, setError } = (0, import_react_hook_form.useForm)({
870
888
  defaultValues: initial || {},
871
889
  resolver: (0, import_yup.resolver)(schema)
872
890
  });
891
+ (0, import_react.useEffect)(
892
+ () => Object.entries(refused || {}).forEach(([id, message]) => {
893
+ if (fields.some((field) => (field == null ? void 0 : field.id) === id)) setError("fields." + id, { message });
894
+ }),
895
+ [refused]
896
+ // eslint-disable-line react-hooks/exhaustive-deps
897
+ );
873
898
  const answers = (0, import_react_hook_form.useWatch)({
874
899
  control,
875
900
  name: "fields"
@@ -880,25 +905,42 @@ const FormSubdomainSection = ({
880
905
  onChange,
881
906
  value
882
907
  }) => {
883
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2;
908
+ var _a2, _b2, _c2, _d2;
909
+ const { lead, name } = (0, import_entry.agreementPhrase)(key, ((_b2 = (_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]) == null ? void 0 : _b2.label) || fallback);
884
910
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
885
911
  import_input_checkbox.default,
886
912
  {
887
913
  ...{
888
914
  labelId: "checkbox-" + key,
889
- label: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: ((_b2 = (_a2 = values == null ? void 0 : values.agreements) == null ? void 0 : _a2[key]) == null ? void 0 : _b2.link) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
890
- import_button.default,
891
- {
892
- ...{
893
- element: import_link.default,
894
- href: (_d2 = (_c2 = values == null ? void 0 : values.agreements) == null ? void 0 : _c2[key]) == null ? void 0 : _d2.link,
895
- inline: true,
896
- target: "_blank",
897
- variant: "link"
898
- },
899
- children: ((_f2 = (_e2 = values == null ? void 0 : values.agreements) == null ? void 0 : _e2[key]) == null ? void 0 : _f2.label) || fallback
900
- }
901
- ) : ((_h2 = (_g2 = values == null ? void 0 : values.agreements) == null ? void 0 : _g2[key]) == null ? void 0 : _h2.label) || fallback }),
915
+ // @story public-entry/read-agreement
916
+ // A link opens in a new tab; a document opens over the form, with Back.
917
+ label: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
918
+ lead,
919
+ opens(key) === "link" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
920
+ import_button.default,
921
+ {
922
+ ...{
923
+ element: import_link.default,
924
+ href: (_d2 = (_c2 = values == null ? void 0 : values.agreements) == null ? void 0 : _c2[key]) == null ? void 0 : _d2.link,
925
+ inline: true,
926
+ target: "_blank",
927
+ variant: "link"
928
+ },
929
+ children: name
930
+ }
931
+ ) : opens(key) === "document" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
932
+ import_button.default,
933
+ {
934
+ ...{
935
+ inline: true,
936
+ onClick: () => onAgreement == null ? void 0 : onAgreement(key),
937
+ variant: "link"
938
+ },
939
+ children: name
940
+ }
941
+ ) : name,
942
+ key === "terms" && " *"
943
+ ] }),
902
944
  onChange,
903
945
  style,
904
946
  value
@@ -907,7 +949,7 @@ const FormSubdomainSection = ({
907
949
  );
908
950
  };
909
951
  const count = (0, import_order.itemCount)(lists, answers);
910
- const itemsError = (_j = (_i = formState == null ? void 0 : formState.errors) == null ? void 0 : _i.items) == null ? void 0 : _j.message;
952
+ const itemsError = (_m = (_l = formState == null ? void 0 : formState.errors) == null ? void 0 : _l.items) == null ? void 0 : _m.message;
911
953
  const totalBlock = (prices || itemsError) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
912
954
  "div",
913
955
  {
@@ -922,7 +964,7 @@ const FormSubdomainSection = ({
922
964
  className: "flex items-center justify-between text-sm"
923
965
  },
924
966
  children: [
925
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "ESTIMATED TOTAL \xB7 " + count + " " + (count === 1 ? "ITEM" : "ITEMS") }),
967
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "TOTAL \xB7 " + count + " " + (count === 1 ? "ITEM" : "ITEMS") }),
926
968
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: (0, import_drawbridge_utils.formatCurrency)({
927
969
  code: currency.toUpperCase(),
928
970
  display: "parts",
@@ -943,6 +985,38 @@ const FormSubdomainSection = ({
943
985
  ]
944
986
  }
945
987
  );
988
+ const drawn = (field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
989
+ import_react_hook_form.Controller,
990
+ {
991
+ ...{
992
+ control,
993
+ name: "fields." + field.id,
994
+ render: ({ field: { onChange, value } }) => {
995
+ var _a2, _b2;
996
+ return (field == null ? void 0 : field.slug) === "list" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
997
+ FormSubdomainItemList,
998
+ {
999
+ ...{
1000
+ currency,
1001
+ field,
1002
+ onChange,
1003
+ prices,
1004
+ style,
1005
+ value
1006
+ }
1007
+ }
1008
+ ) : import_fields.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
+ }
1016
+ }
1017
+ },
1018
+ field == null ? void 0 : field.id
1019
+ );
946
1020
  const consent = [
947
1021
  termsConsent && ["terms"],
948
1022
  marketingConsent && ["marketing", import_entry.agreementWording.marketing],
@@ -1018,40 +1092,21 @@ const FormSubdomainSection = ({
1018
1092
  ...{
1019
1093
  className: (lists.length > 0 ? "space-y-6 " : "space-y-4 ") + faded()
1020
1094
  },
1021
- children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
1022
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1023
- import_react_hook_form.Controller,
1024
- {
1025
- ...{
1026
- control,
1027
- name: "fields." + field.id,
1028
- render: ({ field: { onChange, value } }) => {
1029
- var _a2, _b2;
1030
- return (field == null ? void 0 : field.slug) === "list" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1031
- FormSubdomainItemList,
1032
- {
1033
- ...{
1034
- currency,
1035
- field,
1036
- onChange,
1037
- prices,
1038
- style,
1039
- value
1040
- }
1041
- }
1042
- ) : import_fields.components[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]({
1043
- error: (_b2 = (_a2 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a2.fields) == null ? void 0 : _b2[field == null ? void 0 : field.id],
1044
- field,
1045
- onChange,
1046
- style,
1047
- value
1048
- });
1049
- }
1095
+ children: (0, import_order.itemRuns)(fields).map((run) => {
1096
+ var _a2;
1097
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
1098
+ run.fields.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1099
+ "div",
1100
+ {
1101
+ ...{
1102
+ className: "space-y-4"
1103
+ },
1104
+ children: run.fields.map(drawn)
1050
1105
  }
1051
- }
1052
- ),
1053
- (0, import_order.isLastList)(fields, field == null ? void 0 : field.id) && totalBlock
1054
- ] }, field == null ? void 0 : field.id))
1106
+ ) : drawn(run.fields[0]),
1107
+ run.fields.some((field) => (0, import_order.isLastList)(fields, field == null ? void 0 : field.id)) && totalBlock
1108
+ ] }, (_a2 = run.fields[0]) == null ? void 0 : _a2.id);
1109
+ })
1055
1110
  }
1056
1111
  ),
1057
1112
  consent.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1082,6 +1137,11 @@ const FormSubdomainSection = ({
1082
1137
  {
1083
1138
  ...{
1084
1139
  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,
1140
+ // @story public-entry/read-agreement
1141
+ // The organizer's own rules may not say it; our document does, in Opting out.
1142
+ ...key === "terms" && opens("terms") === "link" && optOutLine && {
1143
+ message: optOutLine
1144
+ },
1085
1145
  input: checkbox({
1086
1146
  fallback,
1087
1147
  key,
@@ -1117,11 +1177,41 @@ const FormSubdomainSection = ({
1117
1177
  disabled,
1118
1178
  style,
1119
1179
  submitting: formState == null ? void 0 : formState.isSubmitting,
1120
- text: last ? "Submit" : "Next"
1180
+ // @story public-entry/submit
1181
+ // The step's own Next text; the last step's is the form's one Submit text.
1182
+ text: last ? (values == null ? void 0 : values.submit) || "Submit" : (section == null ? void 0 : section.button) || "Next"
1121
1183
  }
1122
1184
  }
1123
1185
  )
1124
1186
  }
1187
+ ),
1188
+ privacy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1189
+ "p",
1190
+ {
1191
+ ...{
1192
+ className: "text-center text-xs " + faded("privacy"),
1193
+ ...focus === "privacy" && {
1194
+ ref: focused
1195
+ }
1196
+ },
1197
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1198
+ import_button.default,
1199
+ {
1200
+ ...{
1201
+ inline: true,
1202
+ variant: "link",
1203
+ ...opens("privacy") === "link" ? {
1204
+ element: import_link.default,
1205
+ href: (_o = (_n = values == null ? void 0 : values.agreements) == null ? void 0 : _n.privacy) == null ? void 0 : _o.link,
1206
+ target: "_blank"
1207
+ } : {
1208
+ onClick: () => onAgreement == null ? void 0 : onAgreement("privacy")
1209
+ }
1210
+ },
1211
+ children: ((_q = (_p = values == null ? void 0 : values.agreements) == null ? void 0 : _p.privacy) == null ? void 0 : _q.label) || "Privacy policy"
1212
+ }
1213
+ )
1214
+ }
1125
1215
  )
1126
1216
  ]
1127
1217
  }
@@ -1131,6 +1221,7 @@ const FormSubdomain = ({
1131
1221
  agreements,
1132
1222
  button,
1133
1223
  disabled,
1224
+ documents,
1134
1225
  fields,
1135
1226
  focus,
1136
1227
  integrations,
@@ -1141,20 +1232,29 @@ const FormSubdomain = ({
1141
1232
  },
1142
1233
  params,
1143
1234
  preview,
1235
+ // @story public-entry/read-agreement
1236
+ // False while the campaign's giveaway is off ( lib/entry giveawayOn ).
1237
+ giveaway,
1144
1238
  // The share payload's `sms` : false while texts are off on the platform.
1145
1239
  sms,
1146
1240
  step: start = 0,
1147
1241
  style,
1242
+ // @story public-entry/submit
1243
+ // The form's one Submit text, on the last step ( `defaults.submit` ).
1244
+ submit,
1148
1245
  tracking
1149
1246
  }) => {
1150
- var _a, _b, _c;
1247
+ var _a, _b, _c, _d, _e;
1151
1248
  const { executeRecaptcha } = (0, import_react_google_recaptcha_v3.useGoogleReCaptcha)();
1152
1249
  const searchParams = (0, import_navigation.useSearchParams)();
1153
1250
  const token = searchParams.get("drwbrdg_pre");
1154
1251
  const [data, setData] = (0, import_react.useState)({});
1155
1252
  const [step, setStep] = (0, import_react.useState)(start);
1253
+ const [reading, setReading] = (0, import_react.useState)(null);
1254
+ const [refused, setRefused] = (0, import_react.useState)(null);
1156
1255
  const sections = (0, import_order.sectionsOf)(fields);
1157
1256
  const slugs = sections.flatMap((section) => ((section == null ? void 0 : section.fields) || []).map((field) => field == null ? void 0 : field.slug));
1257
+ 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));
1158
1258
  const merge = (object = {}) => ({
1159
1259
  ...data,
1160
1260
  ...object,
@@ -1165,7 +1265,7 @@ const FormSubdomain = ({
1165
1265
  });
1166
1266
  const onSubmit = (0, import_react.useCallback)(
1167
1267
  async (values) => {
1168
- var _a2, _b2;
1268
+ var _a2, _b2, _c2;
1169
1269
  try {
1170
1270
  let recaptcha;
1171
1271
  if (Boolean((_a2 = integrations == null ? void 0 : integrations.recaptcha) == null ? void 0 : _a2.enabled)) {
@@ -1202,13 +1302,21 @@ const FormSubdomain = ({
1202
1302
  );
1203
1303
  }
1204
1304
  } catch (error) {
1305
+ const index = (0, import_order.refusedSection)(sections, (_c2 = error == null ? void 0 : error.data) == null ? void 0 : _c2.fields);
1306
+ if (index >= 0) {
1307
+ setData(values);
1308
+ setRefused(error.data.fields);
1309
+ setStep(before + index);
1310
+ return;
1311
+ }
1312
+ ;
1205
1313
  onError(error);
1206
1314
  }
1207
1315
  },
1208
- [executeRecaptcha, integrations, onError, onSuccess, params, preview, token, tracking]
1316
+ [before, executeRecaptcha, integrations, onError, onSuccess, params, preview, sections, token, tracking]
1209
1317
  );
1210
1318
  const forms = [
1211
- ...Boolean((_a = integrations == null ? void 0 : integrations.geocode) == null ? void 0 : _a.enabled) ? [
1319
+ ...Boolean((_c = integrations == null ? void 0 : integrations.geocode) == null ? void 0 : _c.enabled) ? [
1212
1320
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1213
1321
  FormSubdomainGeocode,
1214
1322
  {
@@ -1232,7 +1340,7 @@ const FormSubdomain = ({
1232
1340
  "form-subdomain-geocode"
1233
1341
  )
1234
1342
  ] : [],
1235
- ...Boolean((_b = integrations == null ? void 0 : integrations.age) == null ? void 0 : _b.enabled) ? [
1343
+ ...Boolean((_d = integrations == null ? void 0 : integrations.age) == null ? void 0 : _d.enabled) ? [
1236
1344
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1237
1345
  FormSubdomainAge,
1238
1346
  {
@@ -1257,7 +1365,7 @@ const FormSubdomain = ({
1257
1365
  disabled,
1258
1366
  preview,
1259
1367
  style,
1260
- values: (_c = integrations == null ? void 0 : integrations.age) == null ? void 0 : _c.settings
1368
+ values: (_e = integrations == null ? void 0 : integrations.age) == null ? void 0 : _e.settings
1261
1369
  }
1262
1370
  },
1263
1371
  "form-subdomain-age"
@@ -1275,6 +1383,7 @@ const FormSubdomain = ({
1275
1383
  button,
1276
1384
  callback: async (object) => {
1277
1385
  const merged = merge(object);
1386
+ setRefused(null);
1278
1387
  if (index < sections.length - 1) {
1279
1388
  setData(merged);
1280
1389
  setStep(step + 1);
@@ -1286,40 +1395,62 @@ const FormSubdomain = ({
1286
1395
  focus,
1287
1396
  initial: data,
1288
1397
  last: index === sections.length - 1,
1398
+ onAgreement: setReading,
1289
1399
  preview,
1400
+ refused,
1290
1401
  section,
1291
1402
  slugs,
1292
1403
  style,
1293
1404
  values: {
1294
1405
  agreements,
1295
- sms
1406
+ giveaway,
1407
+ sms,
1408
+ submit
1296
1409
  }
1297
1410
  }
1298
1411
  },
1299
1412
  "form-subdomain-section-" + section.id
1300
1413
  ))
1301
1414
  ];
1302
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1415
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1303
1416
  "div",
1304
1417
  {
1305
1418
  ...{
1306
1419
  className: "space-y-6"
1307
1420
  },
1308
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1309
- "div",
1310
- {
1311
- ...{
1312
- className: "relative w-full space-y-6"
1313
- },
1314
- children: forms == null ? void 0 : forms[step]
1315
- }
1316
- )
1421
+ children: [
1422
+ reading && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1423
+ import_form_subdomain_agreement.default,
1424
+ {
1425
+ ...{
1426
+ agreement: agreements == null ? void 0 : agreements[reading],
1427
+ back: () => setReading(null),
1428
+ button,
1429
+ data: documents,
1430
+ style,
1431
+ title: import_entry.agreementTitles[reading]
1432
+ }
1433
+ }
1434
+ ),
1435
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1436
+ "div",
1437
+ {
1438
+ ...{
1439
+ className: "relative w-full space-y-6" + (reading ? " hidden" : "")
1440
+ },
1441
+ children: forms == null ? void 0 : forms[step]
1442
+ }
1443
+ )
1444
+ ]
1317
1445
  }
1318
1446
  );
1319
1447
  };
1320
1448
  var form_subdomain_default = FormSubdomain;
1321
1449
  // Annotate the CommonJS export names for ESM import in node:
1322
1450
  0 && (module.exports = {
1451
+ FormSubdomainAge,
1452
+ FormSubdomainGeocode,
1453
+ FormSubdomainItemList,
1323
1454
  FormSubdomainMessage,
1324
1455
  FormSubdomainSubmission
1325
1456
  });