@drawbridge/components 0.1.36 → 0.1.37

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 (338) hide show
  1. package/components/styles.css +355 -68
  2. package/dist/advertisement.js +20 -15
  3. package/dist/advertisement.mjs +20 -15
  4. package/dist/bridge/advertisements.js +2 -4
  5. package/dist/bridge/advertisements.mjs +3 -5
  6. package/dist/bridge/fields.js +6 -89
  7. package/dist/bridge/fields.mjs +7 -89
  8. package/dist/bridge/form-subdomain-embed.js +1 -5
  9. package/dist/bridge/form-subdomain-embed.mjs +1 -5
  10. package/dist/bridge/form-subdomain-header.js +14 -21
  11. package/dist/bridge/form-subdomain-header.mjs +14 -20
  12. package/dist/bridge/form-subdomain-issue.js +8 -17
  13. package/dist/bridge/form-subdomain-issue.mjs +8 -17
  14. package/dist/bridge/form-subdomain-missions.js +52 -58
  15. package/dist/bridge/form-subdomain-missions.mjs +54 -60
  16. package/dist/bridge/form-subdomain.js +94 -223
  17. package/dist/bridge/form-subdomain.mjs +96 -222
  18. package/dist/bridge/lib/entry.js +6 -61
  19. package/dist/bridge/lib/entry.mjs +5 -51
  20. package/dist/bridge/lib/order.js +0 -23
  21. package/dist/bridge/lib/order.mjs +0 -20
  22. package/dist/bridge/template-layout.js +2 -5
  23. package/dist/bridge/template-layout.mjs +3 -6
  24. package/dist/bridge/template-modal.js +15 -82
  25. package/dist/bridge/template-modal.mjs +16 -83
  26. package/dist/bridge/template-preview.js +208 -0
  27. package/dist/bridge/template-preview.mjs +173 -0
  28. package/dist/bridge/template-subdomain-gallery.js +75 -126
  29. package/dist/bridge/template-subdomain-gallery.mjs +75 -122
  30. package/dist/bridge/template-subdomain.js +14 -16
  31. package/dist/bridge/template-subdomain.mjs +15 -17
  32. package/dist/dashboard/avatar.js +0 -5
  33. package/dist/dashboard/avatar.mjs +0 -5
  34. package/dist/dashboard/card-affiliate.js +2 -3
  35. package/dist/dashboard/card-affiliate.mjs +2 -3
  36. package/dist/dashboard/card-campaign-switch.js +9 -34
  37. package/dist/dashboard/card-campaign-switch.mjs +8 -32
  38. package/dist/dashboard/card-connection.js +91 -51
  39. package/dist/dashboard/card-connection.mjs +89 -50
  40. package/dist/dashboard/card-order.js +14 -6
  41. package/dist/dashboard/card-order.mjs +14 -6
  42. package/dist/dashboard/card-section.js +26 -69
  43. package/dist/dashboard/card-section.mjs +26 -65
  44. package/dist/dashboard/card-tile.js +35 -3
  45. package/dist/dashboard/card-tile.mjs +34 -3
  46. package/dist/dashboard/device.js +95 -0
  47. package/dist/dashboard/device.mjs +72 -0
  48. package/dist/dashboard/drawer-subscription.js +14 -52
  49. package/dist/dashboard/drawer-subscription.mjs +14 -52
  50. package/dist/dashboard/drawer.js +3 -20
  51. package/dist/dashboard/drawer.mjs +4 -21
  52. package/dist/dashboard/dropdown.js +2 -6
  53. package/dist/dashboard/dropdown.mjs +2 -6
  54. package/dist/dashboard/form-admin-subscription-custom.js +8 -72
  55. package/dist/dashboard/form-admin-subscription-custom.mjs +8 -72
  56. package/dist/dashboard/form-ai.js +148 -0
  57. package/dist/dashboard/form-ai.mjs +148 -1
  58. package/dist/dashboard/form-filters-analytics.js +62 -85
  59. package/dist/dashboard/form-filters-analytics.mjs +61 -85
  60. package/dist/dashboard/form-organization-brand.js +13 -30
  61. package/dist/dashboard/form-organization-brand.mjs +13 -30
  62. package/dist/dashboard/form-organization-campaign-advertisement.js +112 -38
  63. package/dist/dashboard/form-organization-campaign-advertisement.mjs +112 -38
  64. package/dist/dashboard/form-organization-campaign-agreement.js +210 -402
  65. package/dist/dashboard/form-organization-campaign-agreement.mjs +211 -398
  66. package/dist/dashboard/form-organization-campaign-field-list.js +425 -0
  67. package/dist/dashboard/form-organization-campaign-field-list.mjs +396 -0
  68. package/dist/dashboard/form-organization-campaign-field-number.js +7 -48
  69. package/dist/dashboard/form-organization-campaign-field-number.mjs +7 -48
  70. package/dist/dashboard/form-organization-campaign-field-select.js +4 -15
  71. package/dist/dashboard/form-organization-campaign-field-select.mjs +4 -15
  72. package/dist/dashboard/form-organization-campaign-field-text.js +6 -46
  73. package/dist/dashboard/form-organization-campaign-field-text.mjs +6 -46
  74. package/dist/dashboard/form-organization-campaign-field-textarea.js +13 -22
  75. package/dist/dashboard/form-organization-campaign-field-textarea.mjs +13 -22
  76. package/dist/dashboard/form-organization-campaign-integration-age.js +35 -2
  77. package/dist/dashboard/form-organization-campaign-integration-age.mjs +35 -2
  78. package/dist/dashboard/form-organization-campaign-integration-geocode.js +1 -4
  79. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +1 -4
  80. package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
  81. package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
  82. package/dist/dashboard/form-organization-campaign-page-preview.js +2 -1
  83. package/dist/dashboard/form-organization-campaign-page-preview.mjs +2 -1
  84. package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
  85. package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
  86. package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
  87. package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
  88. package/dist/dashboard/form-organization-campaign-page-slug.js +3 -2
  89. package/dist/dashboard/form-organization-campaign-page-slug.mjs +3 -2
  90. package/dist/dashboard/form-organization-campaign-page.js +265 -168
  91. package/dist/dashboard/form-organization-campaign-page.mjs +266 -170
  92. package/dist/dashboard/form-organization-campaign-section.js +107 -125
  93. package/dist/dashboard/form-organization-campaign-section.mjs +107 -121
  94. package/dist/dashboard/form-organization-campaign.js +9 -119
  95. package/dist/dashboard/form-organization-campaign.mjs +9 -118
  96. package/dist/dashboard/form-organization-file-frame.js +1 -7
  97. package/dist/dashboard/form-organization-file-frame.mjs +1 -7
  98. package/dist/dashboard/form-organization-workflow.js +545 -589
  99. package/dist/dashboard/form-organization-workflow.mjs +545 -590
  100. package/dist/dashboard/form-organization.js +0 -22
  101. package/dist/dashboard/form-organization.mjs +0 -22
  102. package/dist/dashboard/form-verify-prize.js +34 -114
  103. package/dist/dashboard/form-verify-prize.mjs +34 -111
  104. package/dist/dashboard/google.js +1 -8
  105. package/dist/dashboard/google.mjs +1 -8
  106. package/dist/dashboard/input-array.js +0 -2
  107. package/dist/dashboard/input-array.mjs +0 -2
  108. package/dist/dashboard/input-combobox.js +9 -0
  109. package/dist/dashboard/input-combobox.mjs +9 -0
  110. package/dist/dashboard/input-date.js +8 -3
  111. package/dist/dashboard/input-date.mjs +8 -3
  112. package/dist/dashboard/input-editor.js +6 -17
  113. package/dist/dashboard/input-editor.mjs +6 -17
  114. package/dist/dashboard/input-fields.js +437 -287
  115. package/dist/dashboard/input-fields.mjs +436 -287
  116. package/dist/dashboard/input-file.js +2 -70
  117. package/dist/dashboard/input-file.mjs +2 -70
  118. package/dist/dashboard/input-font.js +55 -64
  119. package/dist/dashboard/input-font.mjs +55 -64
  120. package/dist/dashboard/input-resource.js +1 -4
  121. package/dist/dashboard/input-resource.mjs +1 -4
  122. package/dist/dashboard/item-row.js +92 -0
  123. package/dist/dashboard/item-row.mjs +63 -0
  124. package/dist/dashboard/lib/features.js +1 -1
  125. package/dist/dashboard/lib/features.mjs +1 -1
  126. package/dist/dashboard/lib/item-list.js +15 -0
  127. package/dist/dashboard/lib/item-list.mjs +14 -0
  128. package/dist/dashboard/lib/rail.js +17 -16
  129. package/dist/dashboard/lib/rail.mjs +16 -15
  130. package/dist/dashboard/lib/sms.js +2 -8
  131. package/dist/dashboard/lib/sms.mjs +1 -6
  132. package/dist/dashboard/list-resource.js +0 -2
  133. package/dist/dashboard/list-resource.mjs +0 -2
  134. package/dist/dashboard/menu.js +5 -54
  135. package/dist/dashboard/menu.mjs +5 -53
  136. package/dist/dashboard/modal.js +4 -19
  137. package/dist/dashboard/modal.mjs +5 -20
  138. package/dist/dashboard/order-sections.js +0 -4
  139. package/dist/dashboard/order-sections.mjs +0 -4
  140. package/dist/dashboard/preview.js +324 -838
  141. package/dist/dashboard/preview.mjs +324 -826
  142. package/dist/dashboard/provider-ui.js +12 -20
  143. package/dist/dashboard/provider-ui.mjs +13 -21
  144. package/dist/dashboard/recharts.js +28 -53
  145. package/dist/dashboard/recharts.mjs +28 -53
  146. package/dist/dashboard/swatch.js +0 -35
  147. package/dist/dashboard/swatch.mjs +0 -31
  148. package/dist/dashboard/table-contacts.js +10 -6
  149. package/dist/dashboard/table-contacts.mjs +10 -6
  150. package/dist/dashboard/table.js +3 -10
  151. package/dist/dashboard/table.mjs +3 -9
  152. package/dist/dashboard/template-dashboard.js +21 -13
  153. package/dist/dashboard/template-dashboard.mjs +21 -12
  154. package/dist/dashboard/template-rail.js +126 -198
  155. package/dist/dashboard/template-rail.mjs +125 -196
  156. package/dist/dashboard/template-socket.js +12 -0
  157. package/dist/dashboard/template-socket.mjs +12 -0
  158. package/dist/dashboard/template-ui.js +11 -20
  159. package/dist/dashboard/template-ui.mjs +13 -22
  160. package/dist/input-checkbox.js +1 -7
  161. package/dist/input-checkbox.mjs +1 -7
  162. package/dist/input-name.js +3 -3
  163. package/dist/input-name.mjs +3 -3
  164. package/dist/input-select.js +1 -3
  165. package/dist/input-select.mjs +1 -3
  166. package/dist/provider-font.js +3 -4
  167. package/dist/provider-font.mjs +3 -4
  168. package/dist/shared/badge.js +0 -15
  169. package/dist/shared/badge.mjs +0 -11
  170. package/dist/shared/carousel.js +7 -11
  171. package/dist/shared/carousel.mjs +7 -11
  172. package/dist/shared/lib/campaign.js +9 -3
  173. package/dist/shared/lib/campaign.mjs +9 -3
  174. package/dist/shared/lib/helpers.js +0 -24
  175. package/dist/shared/lib/helpers.mjs +0 -22
  176. package/dist/shared/lib/video.js +0 -6
  177. package/dist/shared/lib/video.mjs +0 -5
  178. package/dist/shared/sortable.js +10 -27
  179. package/dist/shared/sortable.mjs +10 -27
  180. package/dist/shared/tabs.js +1 -1
  181. package/dist/shared/tabs.mjs +1 -1
  182. package/dist/video.js +9 -127
  183. package/dist/video.mjs +11 -125
  184. package/package.json +20 -176
  185. package/types/bridge/fields.d.ts +1 -6
  186. package/types/bridge/form-subdomain-missions.d.ts +0 -2
  187. package/types/bridge/form-subdomain.d.ts +3 -62
  188. package/types/bridge/lib/entry.d.ts +7 -44
  189. package/types/bridge/lib/order.d.ts +2 -13
  190. package/types/bridge/subdomain-content.d.ts +0 -1
  191. package/types/bridge/template-preview.d.ts +10 -0
  192. package/types/bridge/template-subdomain-gallery.d.ts +1 -13
  193. package/types/dashboard/card-campaign-switch.d.ts +1 -20
  194. package/types/dashboard/card-connection.d.ts +8 -0
  195. package/types/dashboard/card-order.d.ts +2 -2
  196. package/types/dashboard/card-section.d.ts +1 -9
  197. package/types/dashboard/card-tile.d.ts +9 -4
  198. package/types/dashboard/device.d.ts +12 -0
  199. package/types/dashboard/drawer.d.ts +0 -3
  200. package/types/dashboard/form-ai.d.ts +17 -0
  201. package/types/dashboard/form-filters-analytics.d.ts +14 -0
  202. package/types/dashboard/form-organization-brand.d.ts +0 -3
  203. package/types/dashboard/form-organization-campaign-agreement.d.ts +10 -53
  204. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  205. package/types/dashboard/form-organization-campaign-field-number.d.ts +1 -4
  206. package/types/dashboard/form-organization-campaign-field-select.d.ts +1 -6
  207. package/types/dashboard/form-organization-campaign-field-text.d.ts +1 -5
  208. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +1 -4
  209. package/types/dashboard/form-organization-campaign-integration-age.d.ts +1 -2
  210. package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +0 -2
  211. package/types/dashboard/form-organization-campaign-page.d.ts +15 -9
  212. package/types/dashboard/form-organization-campaign-section.d.ts +8 -24
  213. package/types/dashboard/form-organization-campaign.d.ts +0 -3
  214. package/types/dashboard/form-organization-workflow.d.ts +4 -3
  215. package/types/dashboard/form-organization.d.ts +2 -2
  216. package/types/dashboard/form-verify-prize.d.ts +3 -30
  217. package/types/dashboard/input-combobox.d.ts +2 -0
  218. package/types/dashboard/input-date.d.ts +2 -0
  219. package/types/dashboard/input-editor.d.ts +0 -9
  220. package/types/dashboard/input-fields.d.ts +5 -8
  221. package/types/dashboard/input-file.d.ts +0 -4
  222. package/types/dashboard/input-resource.d.ts +0 -1
  223. package/types/dashboard/item-row.d.ts +25 -0
  224. package/types/dashboard/lib/item-list.d.ts +5 -10
  225. package/types/dashboard/lib/rail.d.ts +1 -0
  226. package/types/dashboard/lib/sms.d.ts +0 -7
  227. package/types/dashboard/modal.d.ts +1 -3
  228. package/types/dashboard/preview.d.ts +10 -65
  229. package/types/dashboard/recharts.d.ts +0 -3
  230. package/types/dashboard/swatch.d.ts +0 -4
  231. package/types/dashboard/template-dashboard.d.ts +2 -3
  232. package/types/input-select.d.ts +0 -2
  233. package/types/shared/button.d.ts +1 -1
  234. package/types/shared/lib/helpers.d.ts +1 -22
  235. package/types/shared/lib/video.d.ts +0 -3
  236. package/types/shared/sortable.d.ts +0 -6
  237. package/types/video.d.ts +2 -18
  238. package/dist/bridge/form-subdomain-agreement.js +0 -165
  239. package/dist/bridge/form-subdomain-agreement.mjs +0 -132
  240. package/dist/dashboard/campaign-form.js +0 -1798
  241. package/dist/dashboard/campaign-form.mjs +0 -1769
  242. package/dist/dashboard/card-campaign-agreement.js +0 -172
  243. package/dist/dashboard/card-campaign-agreement.mjs +0 -139
  244. package/dist/dashboard/card-shortcut.js +0 -181
  245. package/dist/dashboard/card-shortcut.mjs +0 -152
  246. package/dist/dashboard/document-blocks.js +0 -305
  247. package/dist/dashboard/document-blocks.mjs +0 -270
  248. package/dist/dashboard/form-organization-campaign-advertisements.js +0 -374
  249. package/dist/dashboard/form-organization-campaign-advertisements.mjs +0 -345
  250. package/dist/dashboard/form-organization-campaign-design.js +0 -258
  251. package/dist/dashboard/form-organization-campaign-design.mjs +0 -223
  252. package/dist/dashboard/form-organization-campaign-field-item.js +0 -585
  253. package/dist/dashboard/form-organization-campaign-field-item.mjs +0 -552
  254. package/dist/dashboard/form-organization-campaign-field-skill.js +0 -359
  255. package/dist/dashboard/form-organization-campaign-field-skill.mjs +0 -330
  256. package/dist/dashboard/form-organization-campaign-footer.js +0 -178
  257. package/dist/dashboard/form-organization-campaign-footer.mjs +0 -149
  258. package/dist/dashboard/form-reposition.js +0 -396
  259. package/dist/dashboard/form-reposition.mjs +0 -359
  260. package/dist/dashboard/form-support.js +0 -189
  261. package/dist/dashboard/form-support.mjs +0 -160
  262. package/dist/dashboard/form-tests.js +0 -683
  263. package/dist/dashboard/form-tests.mjs +0 -646
  264. package/dist/dashboard/lib/ab-tests.js +0 -130
  265. package/dist/dashboard/lib/ab-tests.mjs +0 -94
  266. package/dist/dashboard/lib/focus.js +0 -93
  267. package/dist/dashboard/lib/focus.mjs +0 -69
  268. package/dist/dashboard/lib/form-page.js +0 -203
  269. package/dist/dashboard/lib/form-page.mjs +0 -155
  270. package/dist/dashboard/template-design.js +0 -564
  271. package/dist/dashboard/template-design.mjs +0 -531
  272. package/dist/dashboard/template-test-page.js +0 -436
  273. package/dist/dashboard/template-test-page.mjs +0 -407
  274. package/dist/dashboard/template-tests.js +0 -141
  275. package/dist/dashboard/template-tests.mjs +0 -112
  276. package/dist/dashboard/template-variant.js +0 -185
  277. package/dist/dashboard/template-variant.mjs +0 -156
  278. package/dist/icons/arrow-down-long.js +0 -47
  279. package/dist/icons/arrow-down-long.mjs +0 -28
  280. package/dist/icons/arrows-pointing-out.js +0 -46
  281. package/dist/icons/arrows-pointing-out.mjs +0 -27
  282. package/dist/icons/beaker.js +0 -46
  283. package/dist/icons/beaker.mjs +0 -27
  284. package/dist/icons/identification.js +0 -46
  285. package/dist/icons/identification.mjs +0 -27
  286. package/dist/icons/lifebuoy.js +0 -46
  287. package/dist/icons/lifebuoy.mjs +0 -27
  288. package/dist/icons/rectangle-group.js +0 -46
  289. package/dist/icons/rectangle-group.mjs +0 -27
  290. package/dist/icons/rectangle-stack.js +0 -46
  291. package/dist/icons/rectangle-stack.mjs +0 -27
  292. package/dist/icons/shopping-bag.js +0 -46
  293. package/dist/icons/shopping-bag.mjs +0 -27
  294. package/dist/icons/swatch.js +0 -46
  295. package/dist/icons/swatch.mjs +0 -27
  296. package/dist/icons/window.js +0 -46
  297. package/dist/icons/window.mjs +0 -27
  298. package/dist/icons/zoom-in.js +0 -46
  299. package/dist/icons/zoom-in.mjs +0 -27
  300. package/dist/input-answer.js +0 -60
  301. package/dist/input-answer.mjs +0 -27
  302. package/dist/shared/document-pieces.js +0 -295
  303. package/dist/shared/document-pieces.mjs +0 -260
  304. package/types/bridge/form-subdomain-agreement.d.ts +0 -27
  305. package/types/dashboard/campaign-form.d.ts +0 -42
  306. package/types/dashboard/card-campaign-agreement.d.ts +0 -26
  307. package/types/dashboard/card-shortcut.d.ts +0 -38
  308. package/types/dashboard/document-blocks.d.ts +0 -14
  309. package/types/dashboard/form-organization-campaign-advertisements.d.ts +0 -15
  310. package/types/dashboard/form-organization-campaign-design.d.ts +0 -46
  311. package/types/dashboard/form-organization-campaign-field-item.d.ts +0 -36
  312. package/types/dashboard/form-organization-campaign-field-skill.d.ts +0 -36
  313. package/types/dashboard/form-organization-campaign-footer.d.ts +0 -23
  314. package/types/dashboard/form-reposition.d.ts +0 -29
  315. package/types/dashboard/form-support.d.ts +0 -14
  316. package/types/dashboard/form-tests.d.ts +0 -78
  317. package/types/dashboard/lib/ab-tests.d.ts +0 -50
  318. package/types/dashboard/lib/escape.d.ts +0 -4
  319. package/types/dashboard/lib/focus.d.ts +0 -16
  320. package/types/dashboard/lib/form-page.d.ts +0 -25
  321. package/types/dashboard/template-design.d.ts +0 -30
  322. package/types/dashboard/template-test-page.d.ts +0 -69
  323. package/types/dashboard/template-tests.d.ts +0 -30
  324. package/types/dashboard/template-variant.d.ts +0 -18
  325. package/types/icons/arrow-down-long.d.ts +0 -5
  326. package/types/icons/arrows-pointing-out.d.ts +0 -5
  327. package/types/icons/beaker.d.ts +0 -5
  328. package/types/icons/identification.d.ts +0 -5
  329. package/types/icons/lifebuoy.d.ts +0 -5
  330. package/types/icons/rectangle-group.d.ts +0 -5
  331. package/types/icons/rectangle-stack.d.ts +0 -5
  332. package/types/icons/shopping-bag.d.ts +0 -5
  333. package/types/icons/swatch.d.ts +0 -5
  334. package/types/icons/window.d.ts +0 -5
  335. package/types/icons/zoom-in.d.ts +0 -5
  336. package/types/input-answer.d.ts +0 -15
  337. package/types/shared/document-pieces.d.ts +0 -34
  338. package/types/shared/lib/motion.d.ts +0 -2
@@ -1,130 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var ab_tests_exports = {};
19
- __export(ab_tests_exports, {
20
- WEEK: () => WEEK,
21
- daysLeft: () => daysLeft,
22
- even: () => even,
23
- lines: () => lines,
24
- move: () => move,
25
- scale: () => scale,
26
- signed: () => signed,
27
- span: () => span,
28
- variantAction: () => variantAction,
29
- variantHref: () => variantHref,
30
- variantKey: () => variantKey,
31
- variantPage: () => variantPage,
32
- variantPreview: () => variantPreview,
33
- variantSaved: () => variantSaved
34
- });
35
- module.exports = __toCommonJS(ab_tests_exports);
36
- const DAY = 24 * 60 * 60 * 1e3;
37
- const scale = (shares = {}, ids = [], total = 100) => {
38
- if (!ids.length) return {};
39
- const before = ids.reduce((sum, id) => sum + (shares[id] || 0), 0);
40
- const exact = Object.fromEntries(ids.map((id) => [id, before ? (shares[id] || 0) / before * total : total / ids.length]));
41
- const next = Object.fromEntries(ids.map((id) => [id, Math.max(1, Math.floor(exact[id]))]));
42
- const left = total - ids.reduce((sum, id) => sum + next[id], 0);
43
- const cut = [...ids].sort((one, other) => exact[other] - Math.floor(exact[other]) - (exact[one] - Math.floor(exact[one])));
44
- cut.slice(0, Math.max(0, left)).forEach((id) => {
45
- next[id] += 1;
46
- });
47
- if (left < 0) next[ids.reduce((top, id) => next[id] > next[top] ? id : top, ids[0])] += left;
48
- return next;
49
- };
50
- const even = (ids = []) => scale({}, ids);
51
- const move = (shares = {}, ids = [], id, value) => {
52
- const rest = ids.filter((item) => item !== id);
53
- const kept = Math.max(1, Math.min(Number(value) || 1, 100 - rest.length));
54
- return {
55
- ...scale(shares, rest, 100 - kept),
56
- [id]: kept
57
- };
58
- };
59
- const short = (value) => new Date(value).toLocaleDateString("en-US", {
60
- day: "numeric",
61
- month: "short"
62
- });
63
- const span = ({ endsAt, startsAt } = {}) => startsAt && endsAt ? short(startsAt) + " \u2013 " + short(endsAt) : null;
64
- const daysLeft = (endsAt, now = Date.now()) => Math.max(0, Math.ceil((new Date(endsAt).getTime() - now) / DAY));
65
- const WEEK = 7 * DAY;
66
- const signed = (lift) => {
67
- if (lift === null || lift === void 0) return null;
68
- return (lift < 0 ? "\u2212" : lift > 0 ? "+" : "") + Math.abs(lift) + "%";
69
- };
70
- const lines = (total) => total > 3 ? ["actions", "campaigns", "connections", "count", "events", "pages"].slice(0, total) : ["count", "events", "pages"].slice(0, total);
71
- const variantAction = (row) => (row == null ? void 0 : row.disabled) ? "enable" : (row == null ? void 0 : row.leads) ? "disable" : "delete";
72
- const variantHref = ({ campaign, main, organization, test, variant }) => {
73
- const base = "/organizations/" + organization + "/campaigns/" + campaign;
74
- return main || !test ? base + "/page" : base + "/tests/" + test + "/variants/" + variant;
75
- };
76
- const variantPage = ({ campaign, organization, test, variant }) => ({
77
- back: test ? "/organizations/" + organization + "/campaigns/" + campaign + "/tests/" + test : void 0,
78
- endpoint: "/organization/" + organization + "/campaign/" + campaign + "/page/" + variant,
79
- tasks: (data) => {
80
- var _a;
81
- return (data == null ? void 0 : data.locked) ? {
82
- ...data == null ? void 0 : data.tasks,
83
- items: [
84
- {
85
- complete: false,
86
- kind: "required",
87
- title: "This page is kept from a test and cannot be edited"
88
- },
89
- ...((_a = data == null ? void 0 : data.tasks) == null ? void 0 : _a.items) || []
90
- ]
91
- } : data == null ? void 0 : data.tasks;
92
- },
93
- title: (data) => {
94
- var _a;
95
- return test && ((_a = data == null ? void 0 : data.test) == null ? void 0 : _a.name) || "Page";
96
- }
97
- });
98
- const variantKey = ({ campaign, organization, variant }) => ["organization-campaign-page", organization, campaign, variant];
99
- const variantSaved = ({ campaign, organization }) => [
100
- {
101
- queryKey: ["campaign", campaign]
102
- },
103
- {
104
- queryKey: ["menu", "organization", organization]
105
- },
106
- {
107
- queryKey: ["menu", "campaign", organization, campaign]
108
- }
109
- ];
110
- const variantPreview = (campaign) => {
111
- var _a, _b, _c;
112
- return ((_a = campaign == null ? void 0 : campaign.share) == null ? void 0 : _a.url) + (((_c = (_b = campaign == null ? void 0 : campaign.tokens) == null ? void 0 : _b.admin) == null ? void 0 : _c.text) ? "?drwbrdg_pre=" + campaign.tokens.admin.text : "");
113
- };
114
- // Annotate the CommonJS export names for ESM import in node:
115
- 0 && (module.exports = {
116
- WEEK,
117
- daysLeft,
118
- even,
119
- lines,
120
- move,
121
- scale,
122
- signed,
123
- span,
124
- variantAction,
125
- variantHref,
126
- variantKey,
127
- variantPage,
128
- variantPreview,
129
- variantSaved
130
- });
@@ -1,94 +0,0 @@
1
- const DAY = 24 * 60 * 60 * 1e3;
2
- const scale = (shares = {}, ids = [], total = 100) => {
3
- if (!ids.length) return {};
4
- const before = ids.reduce((sum, id) => sum + (shares[id] || 0), 0);
5
- const exact = Object.fromEntries(ids.map((id) => [id, before ? (shares[id] || 0) / before * total : total / ids.length]));
6
- const next = Object.fromEntries(ids.map((id) => [id, Math.max(1, Math.floor(exact[id]))]));
7
- const left = total - ids.reduce((sum, id) => sum + next[id], 0);
8
- const cut = [...ids].sort((one, other) => exact[other] - Math.floor(exact[other]) - (exact[one] - Math.floor(exact[one])));
9
- cut.slice(0, Math.max(0, left)).forEach((id) => {
10
- next[id] += 1;
11
- });
12
- if (left < 0) next[ids.reduce((top, id) => next[id] > next[top] ? id : top, ids[0])] += left;
13
- return next;
14
- };
15
- const even = (ids = []) => scale({}, ids);
16
- const move = (shares = {}, ids = [], id, value) => {
17
- const rest = ids.filter((item) => item !== id);
18
- const kept = Math.max(1, Math.min(Number(value) || 1, 100 - rest.length));
19
- return {
20
- ...scale(shares, rest, 100 - kept),
21
- [id]: kept
22
- };
23
- };
24
- const short = (value) => new Date(value).toLocaleDateString("en-US", {
25
- day: "numeric",
26
- month: "short"
27
- });
28
- const span = ({ endsAt, startsAt } = {}) => startsAt && endsAt ? short(startsAt) + " \u2013 " + short(endsAt) : null;
29
- const daysLeft = (endsAt, now = Date.now()) => Math.max(0, Math.ceil((new Date(endsAt).getTime() - now) / DAY));
30
- const WEEK = 7 * DAY;
31
- const signed = (lift) => {
32
- if (lift === null || lift === void 0) return null;
33
- return (lift < 0 ? "\u2212" : lift > 0 ? "+" : "") + Math.abs(lift) + "%";
34
- };
35
- const lines = (total) => total > 3 ? ["actions", "campaigns", "connections", "count", "events", "pages"].slice(0, total) : ["count", "events", "pages"].slice(0, total);
36
- const variantAction = (row) => (row == null ? void 0 : row.disabled) ? "enable" : (row == null ? void 0 : row.leads) ? "disable" : "delete";
37
- const variantHref = ({ campaign, main, organization, test, variant }) => {
38
- const base = "/organizations/" + organization + "/campaigns/" + campaign;
39
- return main || !test ? base + "/page" : base + "/tests/" + test + "/variants/" + variant;
40
- };
41
- const variantPage = ({ campaign, organization, test, variant }) => ({
42
- back: test ? "/organizations/" + organization + "/campaigns/" + campaign + "/tests/" + test : void 0,
43
- endpoint: "/organization/" + organization + "/campaign/" + campaign + "/page/" + variant,
44
- tasks: (data) => {
45
- var _a;
46
- return (data == null ? void 0 : data.locked) ? {
47
- ...data == null ? void 0 : data.tasks,
48
- items: [
49
- {
50
- complete: false,
51
- kind: "required",
52
- title: "This page is kept from a test and cannot be edited"
53
- },
54
- ...((_a = data == null ? void 0 : data.tasks) == null ? void 0 : _a.items) || []
55
- ]
56
- } : data == null ? void 0 : data.tasks;
57
- },
58
- title: (data) => {
59
- var _a;
60
- return test && ((_a = data == null ? void 0 : data.test) == null ? void 0 : _a.name) || "Page";
61
- }
62
- });
63
- const variantKey = ({ campaign, organization, variant }) => ["organization-campaign-page", organization, campaign, variant];
64
- const variantSaved = ({ campaign, organization }) => [
65
- {
66
- queryKey: ["campaign", campaign]
67
- },
68
- {
69
- queryKey: ["menu", "organization", organization]
70
- },
71
- {
72
- queryKey: ["menu", "campaign", organization, campaign]
73
- }
74
- ];
75
- const variantPreview = (campaign) => {
76
- var _a, _b, _c;
77
- return ((_a = campaign == null ? void 0 : campaign.share) == null ? void 0 : _a.url) + (((_c = (_b = campaign == null ? void 0 : campaign.tokens) == null ? void 0 : _b.admin) == null ? void 0 : _c.text) ? "?drwbrdg_pre=" + campaign.tokens.admin.text : "");
78
- };
79
- export {
80
- WEEK,
81
- daysLeft,
82
- even,
83
- lines,
84
- move,
85
- scale,
86
- signed,
87
- span,
88
- variantAction,
89
- variantHref,
90
- variantKey,
91
- variantPage,
92
- variantPreview,
93
- variantSaved
94
- };
@@ -1,93 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var focus_exports = {};
19
- __export(focus_exports, {
20
- tabTarget: () => tabTarget,
21
- useTrap: () => useTrap
22
- });
23
- module.exports = __toCommonJS(focus_exports);
24
- var import_react = require("react");
25
- const FOCUSABLE = "a[href], button, input, select, textarea, [tabindex]";
26
- const controls = (node) => [...node.querySelectorAll(FOCUSABLE)].filter((item) => item.tabIndex >= 0 && !item.matches(":disabled") && item.getClientRects().length > 0 && !item.closest("[inert]"));
27
- const tabTarget = ({ active, items, shift }) => {
28
- if (items.length === 0) return null;
29
- const first = items[0];
30
- const last = items[items.length - 1];
31
- if (!items.includes(active)) return shift ? last : first;
32
- if (shift) return active === first ? last : null;
33
- return active === last ? first : null;
34
- };
35
- const traps = [];
36
- const closed = [];
37
- const settle = () => {
38
- const target = closed.map((trap) => trap.opener).find((opener) => (opener == null ? void 0 : opener.isConnected) && !closed.some((trap) => {
39
- var _a, _b;
40
- return (_b = (_a = trap.node) == null ? void 0 : _a.contains) == null ? void 0 : _b.call(_a, opener);
41
- }));
42
- closed.length = 0;
43
- target == null ? void 0 : target.focus();
44
- };
45
- const useTrap = (active, node, { enter = true, when } = {}) => {
46
- const opener = (0, import_react.useRef)(null);
47
- const opened = (0, import_react.useRef)(false);
48
- if (Boolean(active) !== opened.current) {
49
- opened.current = Boolean(active);
50
- opener.current = active && typeof document !== "undefined" ? document.activeElement : null;
51
- }
52
- (0, import_react.useEffect)(
53
- () => {
54
- const find = () => node && "current" in node ? node.current : node;
55
- if (!active || !node) return void 0;
56
- const trap = {
57
- node: find(),
58
- opener: enter ? opener.current : null
59
- };
60
- traps.push(trap);
61
- if (enter && trap.node && !trap.node.contains(document.activeElement)) (controls(trap.node)[0] || trap.node).focus();
62
- const onKeyDown = (event) => {
63
- const layer = find();
64
- if (event.key !== "Tab" || event.defaultPrevented || traps[traps.length - 1] !== trap || !layer || when && !when()) return;
65
- const items = controls(layer);
66
- const next = tabTarget({
67
- active: document.activeElement,
68
- items,
69
- shift: event.shiftKey
70
- });
71
- if (!next && items.length) return;
72
- event.preventDefault();
73
- next == null ? void 0 : next.focus();
74
- };
75
- document.addEventListener("keydown", onKeyDown);
76
- return () => {
77
- traps.splice(traps.indexOf(trap), 1);
78
- document.removeEventListener("keydown", onKeyDown);
79
- if (!enter) return;
80
- closed.push(trap);
81
- queueMicrotask(settle);
82
- };
83
- },
84
- // `when` reads the window at each key, so a new function is not a new layer.
85
- // eslint-disable-next-line react-hooks/exhaustive-deps
86
- [active, enter, node]
87
- );
88
- };
89
- // Annotate the CommonJS export names for ESM import in node:
90
- 0 && (module.exports = {
91
- tabTarget,
92
- useTrap
93
- });
@@ -1,69 +0,0 @@
1
- import { useEffect, useRef } from "react";
2
- const FOCUSABLE = "a[href], button, input, select, textarea, [tabindex]";
3
- const controls = (node) => [...node.querySelectorAll(FOCUSABLE)].filter((item) => item.tabIndex >= 0 && !item.matches(":disabled") && item.getClientRects().length > 0 && !item.closest("[inert]"));
4
- const tabTarget = ({ active, items, shift }) => {
5
- if (items.length === 0) return null;
6
- const first = items[0];
7
- const last = items[items.length - 1];
8
- if (!items.includes(active)) return shift ? last : first;
9
- if (shift) return active === first ? last : null;
10
- return active === last ? first : null;
11
- };
12
- const traps = [];
13
- const closed = [];
14
- const settle = () => {
15
- const target = closed.map((trap) => trap.opener).find((opener) => (opener == null ? void 0 : opener.isConnected) && !closed.some((trap) => {
16
- var _a, _b;
17
- return (_b = (_a = trap.node) == null ? void 0 : _a.contains) == null ? void 0 : _b.call(_a, opener);
18
- }));
19
- closed.length = 0;
20
- target == null ? void 0 : target.focus();
21
- };
22
- const useTrap = (active, node, { enter = true, when } = {}) => {
23
- const opener = useRef(null);
24
- const opened = useRef(false);
25
- if (Boolean(active) !== opened.current) {
26
- opened.current = Boolean(active);
27
- opener.current = active && typeof document !== "undefined" ? document.activeElement : null;
28
- }
29
- useEffect(
30
- () => {
31
- const find = () => node && "current" in node ? node.current : node;
32
- if (!active || !node) return void 0;
33
- const trap = {
34
- node: find(),
35
- opener: enter ? opener.current : null
36
- };
37
- traps.push(trap);
38
- if (enter && trap.node && !trap.node.contains(document.activeElement)) (controls(trap.node)[0] || trap.node).focus();
39
- const onKeyDown = (event) => {
40
- const layer = find();
41
- if (event.key !== "Tab" || event.defaultPrevented || traps[traps.length - 1] !== trap || !layer || when && !when()) return;
42
- const items = controls(layer);
43
- const next = tabTarget({
44
- active: document.activeElement,
45
- items,
46
- shift: event.shiftKey
47
- });
48
- if (!next && items.length) return;
49
- event.preventDefault();
50
- next == null ? void 0 : next.focus();
51
- };
52
- document.addEventListener("keydown", onKeyDown);
53
- return () => {
54
- traps.splice(traps.indexOf(trap), 1);
55
- document.removeEventListener("keydown", onKeyDown);
56
- if (!enter) return;
57
- closed.push(trap);
58
- queueMicrotask(settle);
59
- };
60
- },
61
- // `when` reads the window at each key, so a new function is not a new layer.
62
- // eslint-disable-next-line react-hooks/exhaustive-deps
63
- [active, enter, node]
64
- );
65
- };
66
- export {
67
- tabTarget,
68
- useTrap
69
- };
@@ -1,203 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
- var form_page_exports = {};
19
- __export(form_page_exports, {
20
- AFTER: () => AFTER,
21
- MAX_ADS: () => MAX_ADS,
22
- MAX_SECTIONS: () => MAX_SECTIONS,
23
- addedOnce: () => addedOnce,
24
- adsLimit: () => adsLimit,
25
- advertisementsKey: () => advertisementsKey,
26
- afterRows: () => afterRows,
27
- ageRange: () => ageRange,
28
- agreementRows: () => agreementRows,
29
- asksPhone: () => asksPhone,
30
- counted: () => counted,
31
- footerAgreements: () => footerAgreements,
32
- footerRows: () => footerRows,
33
- formParts: () => formParts,
34
- formSlides: () => formSlides,
35
- giveawayLocked: () => giveawayLocked,
36
- itemGroup: () => itemGroup,
37
- itemPrice: () => itemPrice,
38
- lastStepId: () => lastStepId,
39
- locationText: () => locationText,
40
- planLocked: () => planLocked,
41
- privacyLink: () => privacyLink,
42
- readableDocuments: () => readableDocuments,
43
- rowLabel: () => rowLabel,
44
- sectionOn: () => sectionOn,
45
- showsTotal: () => showsTotal
46
- });
47
- module.exports = __toCommonJS(form_page_exports);
48
- var import_entry = require("../../bridge/lib/entry");
49
- const MAX_SECTIONS = 3;
50
- const MAX_ADS = 5;
51
- const adsLimit = (count) => count >= MAX_ADS ? "A campaign can have up to " + MAX_ADS + " advertisements." : null;
52
- const advertisementsKey = (params) => ["campaign-advertisements", params == null ? void 0 : params.organization, params == null ? void 0 : params.campaign];
53
- const AFTER = ["message", "missions", "advertisements"];
54
- const once = ["email", "name", "note", "phone", "pickup"];
55
- const addedOnce = (slug, keys = []) => once.includes(slug) && (keys || []).includes(slug);
56
- const planLocked = (section) => Boolean(section == null ? void 0 : section.task) && Boolean((section == null ? void 0 : section.locked) || (section == null ? void 0 : section.disabled));
57
- const giveawayLocked = (section) => (section == null ? void 0 : section.type) === "order" && Boolean(section == null ? void 0 : section.giveaway);
58
- const sectionOn = (section) => (section == null ? void 0 : section.enabled) !== false && !giveawayLocked(section) && !planLocked(section);
59
- const formParts = (sections = []) => {
60
- var _a;
61
- const list = Array.isArray(sections) ? sections : [];
62
- const checks = ((_a = list.find((section) => (section == null ? void 0 : section.type) === "eligibility")) == null ? void 0 : _a.items) || [];
63
- return {
64
- after: list.find((section) => (section == null ? void 0 : section.type) === "after") || null,
65
- age: checks.find((item) => (item == null ? void 0 : item.slug) === "age") || null,
66
- customs: list.filter((section) => (section == null ? void 0 : section.type) === "section"),
67
- information: list.find((section) => (section == null ? void 0 : section.type) === "information") || null,
68
- location: checks.find((item) => (item == null ? void 0 : item.slug) === "geocode") || null,
69
- order: list.find((section) => (section == null ? void 0 : section.type) === "order") || null
70
- };
71
- };
72
- const asks = (section) => ((section == null ? void 0 : section.items) || []).some((field) => (section == null ? void 0 : section.type) !== "order" || (field == null ? void 0 : field.slug) === "list");
73
- const lastStepId = (steps = []) => {
74
- var _a;
75
- return ((_a = [...steps].reverse().find((section) => sectionOn(section) && asks(section))) == null ? void 0 : _a.id) || null;
76
- };
77
- const asksPhone = (sections = []) => (Array.isArray(sections) ? sections : []).some((section) => ((section == null ? void 0 : section.items) || []).some((field) => (field == null ? void 0 : field.slug) === "phone"));
78
- const ageRange = (settings = {}) => (settings == null ? void 0 : settings.max) ? "Ages " + (settings == null ? void 0 : settings.min) + "\u2013" + settings.max : "Ages " + (settings == null ? void 0 : settings.min) + " and older";
79
- const locationText = (item) => {
80
- var _a;
81
- return [item == null ? void 0 : item.label, (_a = item == null ? void 0 : item.settings) == null ? void 0 : _a.place].filter(Boolean).join(" of ");
82
- };
83
- const priced = (field) => {
84
- var _a;
85
- return (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).some((item) => typeof (item == null ? void 0 : item.price) === "number");
86
- };
87
- const showsTotal = (items = []) => (items || []).some((field) => (field == null ? void 0 : field.slug) === "list" && priced(field));
88
- const footerAgreements = ({ agreements = {}, phone, texts }) => {
89
- var _a;
90
- return [
91
- ["terms", (_a = import_entry.agreementTitles) == null ? void 0 : _a.terms],
92
- ["marketing", import_entry.agreementWording.marketing],
93
- ["sms", import_entry.agreementWording.sms]
94
- ].filter(([key]) => {
95
- var _a2, _b, _c;
96
- return Boolean((_b = (_a2 = agreements == null ? void 0 : agreements[key]) == null ? void 0 : _a2.values) == null ? void 0 : _b.enabled) && (key === "sms" ? Boolean(texts && phone) : Boolean((0, import_entry.agreementContent)((_c = agreements == null ? void 0 : agreements[key]) == null ? void 0 : _c.values)));
97
- }).map(([key, fallback]) => {
98
- var _a2, _b;
99
- return {
100
- key,
101
- // Terms must be ticked, so it ends with *, as on the share form.
102
- label: (((_b = (_a2 = agreements == null ? void 0 : agreements[key]) == null ? void 0 : _a2.values) == null ? void 0 : _b.label) || fallback) + (key === "terms" ? " *" : "")
103
- };
104
- });
105
- };
106
- const footerRows = (agreements = {}, texts) => Object.keys(agreements || {}).filter((key) => texts || key !== "sms");
107
- const agreementRows = (agreements = {}, texts) => footerRows(agreements, texts).map((id) => {
108
- var _a, _b, _c, _d;
109
- return {
110
- id,
111
- on: Boolean((_b = (_a = agreements == null ? void 0 : agreements[id]) == null ? void 0 : _a.values) == null ? void 0 : _b.enabled),
112
- title: ((_c = agreements[id]) == null ? void 0 : _c.title) || ((_d = import_entry.agreementTitles) == null ? void 0 : _d[id]) || id
113
- };
114
- });
115
- const readableDocuments = (agreements = {}, texts) => footerRows(agreements, texts).filter((id) => {
116
- var _a, _b, _c, _d;
117
- return ((_b = (_a = agreements[id]) == null ? void 0 : _a.values) == null ? void 0 : _b.enabled) && (((_d = (_c = agreements[id]) == null ? void 0 : _c.values) == null ? void 0 : _d.type) || "document") === "document";
118
- }).map((id) => {
119
- var _a, _b, _c;
120
- return {
121
- key: ((_b = (_a = agreements[id]) == null ? void 0 : _a.document) == null ? void 0 : _b.name) || ((_c = agreements[id]) == null ? void 0 : _c.title) || id,
122
- value: id
123
- };
124
- });
125
- const privacyLink = (agreements = {}) => {
126
- var _a, _b;
127
- return ((_b = (_a = agreements == null ? void 0 : agreements.privacy) == null ? void 0 : _a.values) == null ? void 0 : _b.enabled) && (0, import_entry.agreementContent)(agreements.privacy.values) ? agreements.privacy.values.label || "Privacy policy" : null;
128
- };
129
- const afterRows = (order, response) => {
130
- const rows = Array.isArray(order) && order.length ? order.filter((key) => AFTER.includes(key)) : AFTER;
131
- return response === "order" ? rows.filter((key) => key !== "missions") : rows;
132
- };
133
- const rowLabel = (field) => {
134
- var _a;
135
- return ((field == null ? void 0 : field.label) || (field == null ? void 0 : field.title) || "") + ((field == null ? void 0 : field.slug) !== "list" && ((_a = field == null ? void 0 : field.attributes) == null ? void 0 : _a.required) !== false ? "\xA0*" : "");
136
- };
137
- const itemPrice = (field) => {
138
- var _a, _b, _c;
139
- return (field == null ? void 0 : field.slug) === "list" && ((_b = (_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) == null ? void 0 : _b.length) === 1 && typeof ((_c = field.settings.items[0]) == null ? void 0 : _c.price) === "number" ? field.settings.items[0].price : null;
140
- };
141
- const itemGroup = (field) => {
142
- var _a;
143
- return (field == null ? void 0 : field.slug) === "list" && (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).length > 1;
144
- };
145
- const counted = (number, total) => (number || 0) + " of " + (total || 0);
146
- const formSlides = ({ after, age, customs = [], information, location, order } = {}, agreements) => {
147
- var _a;
148
- return [
149
- {
150
- id: "start",
151
- title: "Entry button"
152
- },
153
- location && {
154
- id: "location",
155
- title: "Location"
156
- },
157
- age && age.enabled !== false && {
158
- id: "age",
159
- title: ((_a = age.settings) == null ? void 0 : _a.title) || "Confirm your age"
160
- },
161
- ...[information, ...customs || [], order].filter((section) => section && sectionOn(section)).map((section) => ({
162
- id: section.id,
163
- title: section.title
164
- })),
165
- agreements && {
166
- id: "agreements",
167
- title: "Agreements"
168
- },
169
- after && {
170
- id: "after",
171
- title: "After entry"
172
- }
173
- ].filter(Boolean);
174
- };
175
- // Annotate the CommonJS export names for ESM import in node:
176
- 0 && (module.exports = {
177
- AFTER,
178
- MAX_ADS,
179
- MAX_SECTIONS,
180
- addedOnce,
181
- adsLimit,
182
- advertisementsKey,
183
- afterRows,
184
- ageRange,
185
- agreementRows,
186
- asksPhone,
187
- counted,
188
- footerAgreements,
189
- footerRows,
190
- formParts,
191
- formSlides,
192
- giveawayLocked,
193
- itemGroup,
194
- itemPrice,
195
- lastStepId,
196
- locationText,
197
- planLocked,
198
- privacyLink,
199
- readableDocuments,
200
- rowLabel,
201
- sectionOn,
202
- showsTotal
203
- });