@drawbridge/components 0.1.12 → 0.1.14

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 (236) hide show
  1. package/components/styles.css +364 -2
  2. package/dist/advertisement.js +3 -1
  3. package/dist/advertisement.mjs +3 -1
  4. package/dist/bridge/advertisements.js +2 -0
  5. package/dist/bridge/advertisements.mjs +2 -0
  6. package/dist/bridge/countdown.js +2 -1
  7. package/dist/bridge/countdown.mjs +2 -1
  8. package/dist/bridge/form-subdomain-embed.js +18 -20
  9. package/dist/bridge/form-subdomain-embed.mjs +18 -20
  10. package/dist/bridge/form-subdomain-header.js +24 -1
  11. package/dist/bridge/form-subdomain-header.mjs +24 -1
  12. package/dist/bridge/form-subdomain-missions.js +538 -0
  13. package/dist/bridge/form-subdomain-missions.mjs +502 -0
  14. package/dist/bridge/form-subdomain.js +530 -220
  15. package/dist/bridge/form-subdomain.mjs +533 -222
  16. package/dist/bridge/lib/entry.js +59 -0
  17. package/dist/bridge/lib/entry.mjs +29 -0
  18. package/dist/bridge/lib/location.js +38 -0
  19. package/dist/bridge/lib/location.mjs +13 -0
  20. package/dist/bridge/lib/order.js +71 -0
  21. package/dist/bridge/lib/order.mjs +44 -0
  22. package/dist/bridge/lib/url.js +9 -0
  23. package/dist/bridge/lib/url.mjs +7 -0
  24. package/dist/bridge/share-button.js +5 -3
  25. package/dist/bridge/share-button.mjs +5 -3
  26. package/dist/bridge/subdomain-content.js +7 -6
  27. package/dist/bridge/subdomain-content.mjs +7 -6
  28. package/dist/bridge/template-layout.js +59 -21
  29. package/dist/bridge/template-layout.mjs +59 -21
  30. package/dist/bridge/template-modal.js +42 -76
  31. package/dist/bridge/template-modal.mjs +39 -73
  32. package/dist/bridge/template-preview.js +208 -0
  33. package/dist/bridge/template-preview.mjs +173 -0
  34. package/dist/bridge/template-subdomain-gallery.js +6 -2
  35. package/dist/bridge/template-subdomain-gallery.mjs +6 -2
  36. package/dist/bridge/template-subdomain-link.js +6 -1
  37. package/dist/bridge/template-subdomain-link.mjs +6 -1
  38. package/dist/bridge/template-subdomain.js +20 -15
  39. package/dist/bridge/template-subdomain.mjs +20 -15
  40. package/dist/dashboard/accordion.js +74 -39
  41. package/dist/dashboard/accordion.mjs +74 -39
  42. package/dist/dashboard/avatar.js +109 -3
  43. package/dist/dashboard/avatar.mjs +106 -4
  44. package/dist/dashboard/buttons-subscription.js +384 -0
  45. package/dist/dashboard/buttons-subscription.mjs +349 -0
  46. package/dist/dashboard/card-campaign-switch.js +265 -0
  47. package/dist/dashboard/card-campaign-switch.mjs +231 -0
  48. package/dist/dashboard/card-order.js +28 -11
  49. package/dist/dashboard/card-order.mjs +28 -11
  50. package/dist/dashboard/card-section.js +26 -2
  51. package/dist/dashboard/card-section.mjs +26 -2
  52. package/dist/dashboard/card-tile.js +6 -7
  53. package/dist/dashboard/card-tile.mjs +6 -7
  54. package/dist/dashboard/connection-workflows.js +196 -0
  55. package/dist/dashboard/connection-workflows.mjs +162 -0
  56. package/dist/dashboard/device.js +95 -0
  57. package/dist/dashboard/device.mjs +72 -0
  58. package/dist/dashboard/form-admin-campaign.js +19 -50
  59. package/dist/dashboard/form-admin-campaign.mjs +20 -51
  60. package/dist/dashboard/form-ai.js +9 -6
  61. package/dist/dashboard/form-ai.mjs +9 -6
  62. package/dist/dashboard/form-auth.js +35 -25
  63. package/dist/dashboard/form-auth.mjs +36 -26
  64. package/dist/dashboard/form-file.js +10 -1
  65. package/dist/dashboard/form-file.mjs +10 -1
  66. package/dist/dashboard/form-filters-analytics.js +14 -1
  67. package/dist/dashboard/form-filters-analytics.mjs +15 -2
  68. package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
  69. package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
  70. package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
  71. package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
  72. package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
  73. package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
  74. package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
  75. package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
  76. package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
  77. package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
  78. package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
  79. package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
  80. package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
  81. package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
  82. package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
  83. package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
  84. package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
  85. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
  86. package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
  87. package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
  88. package/dist/dashboard/form-organization-campaign-link.js +7 -1
  89. package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
  90. package/dist/dashboard/form-organization-campaign-mission.js +291 -0
  91. package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
  92. package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
  93. package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
  94. package/dist/dashboard/form-organization-campaign-page.js +20 -11
  95. package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
  96. package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
  97. package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
  98. package/dist/dashboard/form-organization-campaign-section.js +223 -0
  99. package/dist/dashboard/form-organization-campaign-section.mjs +194 -0
  100. package/dist/dashboard/form-organization-campaign.js +114 -469
  101. package/dist/dashboard/form-organization-campaign.mjs +113 -467
  102. package/dist/dashboard/form-organization-export.js +4 -7
  103. package/dist/dashboard/form-organization-export.mjs +4 -7
  104. package/dist/dashboard/form-organization-identity.js +46 -51
  105. package/dist/dashboard/form-organization-identity.mjs +46 -51
  106. package/dist/dashboard/form-organization-workflow.js +518 -686
  107. package/dist/dashboard/form-organization-workflow.mjs +517 -682
  108. package/dist/dashboard/form-organization.js +82 -110
  109. package/dist/dashboard/form-organization.mjs +81 -109
  110. package/dist/dashboard/form-otc.js +4 -5
  111. package/dist/dashboard/form-otc.mjs +4 -5
  112. package/dist/dashboard/form-payment-methods.js +20 -9
  113. package/dist/dashboard/form-payment-methods.mjs +20 -9
  114. package/dist/dashboard/form-stripe.js +30 -0
  115. package/dist/dashboard/form-stripe.mjs +26 -0
  116. package/dist/dashboard/input-array.js +4 -2
  117. package/dist/dashboard/input-array.mjs +4 -2
  118. package/dist/dashboard/input-combobox.js +7 -3
  119. package/dist/dashboard/input-combobox.mjs +7 -3
  120. package/dist/dashboard/input-date.js +7 -0
  121. package/dist/dashboard/input-date.mjs +7 -0
  122. package/dist/dashboard/input-fields.js +80 -20
  123. package/dist/dashboard/input-fields.mjs +80 -20
  124. package/dist/dashboard/input-file.js +21 -1
  125. package/dist/dashboard/input-file.mjs +21 -1
  126. package/dist/dashboard/input-font.js +10 -1
  127. package/dist/dashboard/input-font.mjs +10 -1
  128. package/dist/dashboard/lib/item-list.js +57 -0
  129. package/dist/dashboard/lib/item-list.mjs +33 -0
  130. package/dist/dashboard/lib/menu.js +50 -0
  131. package/dist/dashboard/lib/menu.mjs +26 -0
  132. package/dist/dashboard/locked.js +82 -0
  133. package/dist/dashboard/locked.mjs +53 -0
  134. package/dist/dashboard/menu.js +72 -19
  135. package/dist/dashboard/menu.mjs +72 -19
  136. package/dist/dashboard/note-ai.js +69 -0
  137. package/dist/dashboard/note-ai.mjs +36 -0
  138. package/dist/dashboard/preview.js +419 -0
  139. package/dist/dashboard/preview.mjs +384 -0
  140. package/dist/dashboard/steps.js +39 -13
  141. package/dist/dashboard/steps.mjs +37 -12
  142. package/dist/dashboard/table-contacts.js +136 -0
  143. package/dist/dashboard/table-contacts.mjs +103 -0
  144. package/dist/dashboard/template-not-found.js +4 -2
  145. package/dist/dashboard/template-not-found.mjs +4 -2
  146. package/dist/dashboard/template-socket.js +51 -7
  147. package/dist/dashboard/template-socket.mjs +51 -7
  148. package/dist/icons/desktop.js +46 -0
  149. package/dist/icons/desktop.mjs +27 -0
  150. package/dist/icons/phone.js +46 -0
  151. package/dist/icons/phone.mjs +27 -0
  152. package/dist/icons/puzzle-piece.js +46 -0
  153. package/dist/icons/puzzle-piece.mjs +27 -0
  154. package/dist/icons/tablet.js +46 -0
  155. package/dist/icons/tablet.mjs +27 -0
  156. package/dist/icons/users.js +46 -0
  157. package/dist/icons/users.mjs +27 -0
  158. package/dist/input-checkbox.js +1 -0
  159. package/dist/input-checkbox.mjs +1 -0
  160. package/dist/input-code.js +101 -0
  161. package/dist/input-code.mjs +78 -0
  162. package/dist/input-text.js +2 -1
  163. package/dist/input-text.mjs +2 -1
  164. package/dist/shared/input-checkbox-list.js +0 -1
  165. package/dist/shared/input-checkbox-list.mjs +0 -1
  166. package/dist/shared/input-switch.js +6 -1
  167. package/dist/shared/input-switch.mjs +6 -1
  168. package/dist/shared/lib/campaign.js +117 -0
  169. package/dist/shared/lib/campaign.mjs +91 -0
  170. package/dist/shared/lib/helpers.js +14 -2
  171. package/dist/shared/lib/helpers.mjs +13 -2
  172. package/package.json +133 -13
  173. package/types/bridge/form-subdomain-header.d.ts +2 -0
  174. package/types/bridge/form-subdomain-missions.d.ts +36 -0
  175. package/types/bridge/form-subdomain.d.ts +23 -1
  176. package/types/bridge/lib/entry.d.ts +26 -0
  177. package/types/bridge/lib/location.d.ts +13 -0
  178. package/types/bridge/lib/order.d.ts +30 -0
  179. package/types/bridge/lib/url.d.ts +19 -0
  180. package/types/bridge/template-modal.d.ts +1 -1
  181. package/types/bridge/template-preview.d.ts +10 -0
  182. package/types/bridge/template-subdomain-link.d.ts +2 -0
  183. package/types/dashboard/accordion.d.ts +2 -0
  184. package/types/dashboard/avatar.d.ts +18 -2
  185. package/types/dashboard/buttons-subscription.d.ts +22 -0
  186. package/types/dashboard/card-campaign-switch.d.ts +32 -0
  187. package/types/dashboard/card-order.d.ts +11 -0
  188. package/types/dashboard/card-section.d.ts +2 -0
  189. package/types/dashboard/connection-workflows.d.ts +33 -0
  190. package/types/dashboard/device.d.ts +12 -0
  191. package/types/dashboard/form-admin-campaign.d.ts +3 -2
  192. package/types/dashboard/form-ai.d.ts +2 -2
  193. package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
  194. package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
  195. package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
  196. package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
  197. package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
  198. package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
  199. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
  200. package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
  201. package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
  202. package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
  203. package/types/dashboard/form-organization-campaign-section.d.ts +27 -0
  204. package/types/dashboard/form-organization-campaign.d.ts +27 -17
  205. package/types/dashboard/form-organization-identity.d.ts +2 -0
  206. package/types/dashboard/form-organization-workflow.d.ts +43 -47
  207. package/types/dashboard/form-organization.d.ts +7 -2
  208. package/types/dashboard/form-stripe.d.ts +3 -0
  209. package/types/dashboard/input-combobox.d.ts +2 -0
  210. package/types/dashboard/input-date.d.ts +2 -0
  211. package/types/dashboard/input-fields.d.ts +3 -2
  212. package/types/dashboard/input-file.d.ts +4 -0
  213. package/types/dashboard/lib/item-list.d.ts +14 -0
  214. package/types/dashboard/lib/menu.d.ts +17 -0
  215. package/types/dashboard/locked.d.ts +10 -0
  216. package/types/dashboard/menu.d.ts +10 -2
  217. package/types/dashboard/note-ai.d.ts +15 -0
  218. package/types/dashboard/preview.d.ts +33 -0
  219. package/types/dashboard/steps.d.ts +19 -4
  220. package/types/dashboard/table-cell-title.d.ts +2 -2
  221. package/types/dashboard/table-contacts.d.ts +2 -0
  222. package/types/icons/desktop.d.ts +5 -0
  223. package/types/icons/phone.d.ts +5 -0
  224. package/types/icons/puzzle-piece.d.ts +5 -0
  225. package/types/icons/tablet.d.ts +5 -0
  226. package/types/icons/users.d.ts +5 -0
  227. package/types/input-code.d.ts +23 -0
  228. package/types/shared/input-switch.d.ts +2 -0
  229. package/types/shared/lib/campaign.d.ts +35 -0
  230. package/types/shared/lib/helpers.d.ts +3 -0
  231. package/dist/dashboard/card-integration.js +0 -187
  232. package/dist/dashboard/card-integration.mjs +0 -158
  233. package/dist/dashboard/iframe.js +0 -159
  234. package/dist/dashboard/iframe.mjs +0 -130
  235. package/types/dashboard/card-integration.d.ts +0 -24
  236. package/types/dashboard/iframe.d.ts +0 -18
@@ -0,0 +1,59 @@
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 entry_exports = {};
19
+ __export(entry_exports, {
20
+ agreementWording: () => agreementWording,
21
+ awardingOn: () => awardingOn,
22
+ buttonText: () => buttonText,
23
+ copy: () => copy,
24
+ formOn: () => formOn,
25
+ giveawayOn: () => giveawayOn,
26
+ panelMissions: () => panelMissions,
27
+ panelTitle: () => panelTitle
28
+ });
29
+ module.exports = __toCommonJS(entry_exports);
30
+ var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
31
+ const copy = (data, key) => {
32
+ var _a, _b, _c, _d, _e;
33
+ return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a[key]) || ((_e = (_d = (_c = (_b = import_drawbridge_utils.constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e[key === "purchase" ? "order" : key]);
34
+ };
35
+ const agreementWording = {
36
+ marketing: "I agree to receive marketing emails about this campaign. Unsubscribe any time.",
37
+ // The default wording carrier reviewers look for: explicit texts, rates, and STOP.
38
+ sms: "I agree to receive text messages about this campaign. Message and data rates may apply. Reply STOP to opt out."
39
+ };
40
+ const buttonText = (data, open) => copy(data, !open ? "inactive" : (data == null ? void 0 : data.awarding) === false ? "button" : "active");
41
+ const formOn = (data) => (data == null ? void 0 : data.form) !== false;
42
+ const giveawayOn = (data) => (data == null ? void 0 : data.giveaway) !== false;
43
+ const awardingOn = (data) => giveawayOn(data) && (data == null ? void 0 : data.awarding) !== false;
44
+ const panelTitle = (data, awarding = awardingOn(data)) => {
45
+ var _a, _b, _c, _d, _e, _f;
46
+ return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a.title) || ((_f = (_e = (_d = (_c = (_b = import_drawbridge_utils.constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e.title) == null ? void 0 : _f[awarding ? "awarding" : "open"]);
47
+ };
48
+ const panelMissions = (missions = [], repeat = false) => repeat ? (missions || []).filter((item) => (item == null ? void 0 : item.type) !== "form") : missions;
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ agreementWording,
52
+ awardingOn,
53
+ buttonText,
54
+ copy,
55
+ formOn,
56
+ giveawayOn,
57
+ panelMissions,
58
+ panelTitle
59
+ });
@@ -0,0 +1,29 @@
1
+ import { constants } from "@drawbridge/drawbridge-utils";
2
+ const copy = (data, key) => {
3
+ var _a, _b, _c, _d, _e;
4
+ return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a[key]) || ((_e = (_d = (_c = (_b = constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e[key === "purchase" ? "order" : key]);
5
+ };
6
+ const agreementWording = {
7
+ marketing: "I agree to receive marketing emails about this campaign. Unsubscribe any time.",
8
+ // The default wording carrier reviewers look for: explicit texts, rates, and STOP.
9
+ sms: "I agree to receive text messages about this campaign. Message and data rates may apply. Reply STOP to opt out."
10
+ };
11
+ const buttonText = (data, open) => copy(data, !open ? "inactive" : (data == null ? void 0 : data.awarding) === false ? "button" : "active");
12
+ const formOn = (data) => (data == null ? void 0 : data.form) !== false;
13
+ const giveawayOn = (data) => (data == null ? void 0 : data.giveaway) !== false;
14
+ const awardingOn = (data) => giveawayOn(data) && (data == null ? void 0 : data.awarding) !== false;
15
+ const panelTitle = (data, awarding = awardingOn(data)) => {
16
+ var _a, _b, _c, _d, _e, _f;
17
+ return ((_a = data == null ? void 0 : data.defaults) == null ? void 0 : _a.title) || ((_f = (_e = (_d = (_c = (_b = constants) == null ? void 0 : _b.campaign) == null ? void 0 : _c.form) == null ? void 0 : _d.copy) == null ? void 0 : _e.title) == null ? void 0 : _f[awarding ? "awarding" : "open"]);
18
+ };
19
+ const panelMissions = (missions = [], repeat = false) => repeat ? (missions || []).filter((item) => (item == null ? void 0 : item.type) !== "form") : missions;
20
+ export {
21
+ agreementWording,
22
+ awardingOn,
23
+ buttonText,
24
+ copy,
25
+ formOn,
26
+ giveawayOn,
27
+ panelMissions,
28
+ panelTitle
29
+ };
@@ -0,0 +1,38 @@
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 location_exports = {};
19
+ __export(location_exports, {
20
+ LOCATION_TIMEOUT: () => LOCATION_TIMEOUT,
21
+ locationCopy: () => locationCopy,
22
+ locationStatus: () => locationStatus
23
+ });
24
+ module.exports = __toCommonJS(location_exports);
25
+ const LOCATION_TIMEOUT = 15e3;
26
+ const locationCopy = {
27
+ asking: "Allow location access in your browser to continue.",
28
+ denied: "Location access is off for this page. Turn it on in your browser settings, then try again.",
29
+ missing: "We couldn't find your location.",
30
+ unsupported: "Your browser or device does not support location."
31
+ };
32
+ const locationStatus = (error) => (error == null ? void 0 : error.code) === 1 ? "denied" : "missing";
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ LOCATION_TIMEOUT,
36
+ locationCopy,
37
+ locationStatus
38
+ });
@@ -0,0 +1,13 @@
1
+ const LOCATION_TIMEOUT = 15e3;
2
+ const locationCopy = {
3
+ asking: "Allow location access in your browser to continue.",
4
+ denied: "Location access is off for this page. Turn it on in your browser settings, then try again.",
5
+ missing: "We couldn't find your location.",
6
+ unsupported: "Your browser or device does not support location."
7
+ };
8
+ const locationStatus = (error) => (error == null ? void 0 : error.code) === 1 ? "denied" : "missing";
9
+ export {
10
+ LOCATION_TIMEOUT,
11
+ locationCopy,
12
+ locationStatus
13
+ };
@@ -0,0 +1,71 @@
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 order_exports = {};
19
+ __export(order_exports, {
20
+ isLastList: () => isLastList,
21
+ itemCount: () => itemCount,
22
+ limitMessage: () => limitMessage,
23
+ orderTotal: () => orderTotal,
24
+ sectionsOf: () => sectionsOf
25
+ });
26
+ module.exports = __toCommonJS(order_exports);
27
+ var import_fields_validate = require("@drawbridge/drawbridge-utils/fields-validate");
28
+ const sectionsOf = (fields) => Array.isArray(fields == null ? void 0 : fields.sections) && fields.sections.length > 0 ? fields.sections : [
29
+ {
30
+ fields: [
31
+ ...(fields == null ? void 0 : fields.lead) || [],
32
+ ...(fields == null ? void 0 : fields.additional) || []
33
+ ],
34
+ id: "information",
35
+ title: "Your information",
36
+ type: "information"
37
+ }
38
+ ];
39
+ const lists = (fields = []) => fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
40
+ const lines = (fields, answers = {}) => lists(fields).flatMap((field) => {
41
+ var _a;
42
+ return (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).map((item) => {
43
+ var _a2;
44
+ return {
45
+ item,
46
+ quantity: Number((_a2 = answers == null ? void 0 : answers[field.id]) == null ? void 0 : _a2[item.id]) || 0
47
+ };
48
+ });
49
+ });
50
+ const orderTotal = (fields, answers) => Math.round(lines(fields, answers).reduce(
51
+ (sum, { item, quantity }) => sum + (typeof (item == null ? void 0 : item.price) === "number" ? item.price * quantity : 0),
52
+ 0
53
+ ) * 100) / 100;
54
+ const itemCount = (fields, answers) => lines(fields, answers).reduce((sum, { quantity }) => sum + quantity, 0);
55
+ const isLastList = (fields, id) => {
56
+ var _a;
57
+ return Boolean(id) && ((_a = lists(fields).at(-1)) == null ? void 0 : _a.id) === id;
58
+ };
59
+ const limitMessage = (item, quantity) => {
60
+ var _a;
61
+ const max = (_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max;
62
+ return max && Number(quantity) >= max ? import_fields_validate.errors.limit(max) : null;
63
+ };
64
+ // Annotate the CommonJS export names for ESM import in node:
65
+ 0 && (module.exports = {
66
+ isLastList,
67
+ itemCount,
68
+ limitMessage,
69
+ orderTotal,
70
+ sectionsOf
71
+ });
@@ -0,0 +1,44 @@
1
+ import { errors } from "@drawbridge/drawbridge-utils/fields-validate";
2
+ const sectionsOf = (fields) => Array.isArray(fields == null ? void 0 : fields.sections) && fields.sections.length > 0 ? fields.sections : [
3
+ {
4
+ fields: [
5
+ ...(fields == null ? void 0 : fields.lead) || [],
6
+ ...(fields == null ? void 0 : fields.additional) || []
7
+ ],
8
+ id: "information",
9
+ title: "Your information",
10
+ type: "information"
11
+ }
12
+ ];
13
+ const lists = (fields = []) => fields.filter((field) => (field == null ? void 0 : field.slug) === "list");
14
+ const lines = (fields, answers = {}) => lists(fields).flatMap((field) => {
15
+ var _a;
16
+ return (((_a = field == null ? void 0 : field.settings) == null ? void 0 : _a.items) || []).map((item) => {
17
+ var _a2;
18
+ return {
19
+ item,
20
+ quantity: Number((_a2 = answers == null ? void 0 : answers[field.id]) == null ? void 0 : _a2[item.id]) || 0
21
+ };
22
+ });
23
+ });
24
+ const orderTotal = (fields, answers) => Math.round(lines(fields, answers).reduce(
25
+ (sum, { item, quantity }) => sum + (typeof (item == null ? void 0 : item.price) === "number" ? item.price * quantity : 0),
26
+ 0
27
+ ) * 100) / 100;
28
+ const itemCount = (fields, answers) => lines(fields, answers).reduce((sum, { quantity }) => sum + quantity, 0);
29
+ const isLastList = (fields, id) => {
30
+ var _a;
31
+ return Boolean(id) && ((_a = lists(fields).at(-1)) == null ? void 0 : _a.id) === id;
32
+ };
33
+ const limitMessage = (item, quantity) => {
34
+ var _a;
35
+ const max = (_a = item == null ? void 0 : item.attributes) == null ? void 0 : _a.max;
36
+ return max && Number(quantity) >= max ? errors.limit(max) : null;
37
+ };
38
+ export {
39
+ isLastList,
40
+ itemCount,
41
+ limitMessage,
42
+ orderTotal,
43
+ sectionsOf
44
+ };
@@ -18,6 +18,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
18
18
  var url_exports = {};
19
19
  __export(url_exports, {
20
20
  isSafeRedirect: () => isSafeRedirect,
21
+ leadEndpoint: () => leadEndpoint,
22
+ missionEndpoint: () => missionEndpoint,
21
23
  safeHref: () => safeHref,
22
24
  submissionEndpoint: () => submissionEndpoint
23
25
  });
@@ -56,9 +58,16 @@ const submissionEndpoint = ({ affiliate, id, slug, subdomain, token }) => {
56
58
  const query = params.toString();
57
59
  return "/subdomain/" + subdomain + "/page/" + slug + "/submission/" + encodeURIComponent(id) + (query ? "?" + query : "");
58
60
  };
61
+ const leadEndpoint = ({ lead, slug, subdomain, token }) => {
62
+ if (typeof lead !== "string" || !/^[\w-]+\.[\w-]+$/.test(lead)) return null;
63
+ return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + lead + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
64
+ };
65
+ const missionEndpoint = ({ action, slug, subdomain, type }) => "/subdomain/" + subdomain + "/page/" + slug + "/mission/" + type + "/" + action;
59
66
  // Annotate the CommonJS export names for ESM import in node:
60
67
  0 && (module.exports = {
61
68
  isSafeRedirect,
69
+ leadEndpoint,
70
+ missionEndpoint,
62
71
  safeHref,
63
72
  submissionEndpoint
64
73
  });
@@ -32,8 +32,15 @@ const submissionEndpoint = ({ affiliate, id, slug, subdomain, token }) => {
32
32
  const query = params.toString();
33
33
  return "/subdomain/" + subdomain + "/page/" + slug + "/submission/" + encodeURIComponent(id) + (query ? "?" + query : "");
34
34
  };
35
+ const leadEndpoint = ({ lead, slug, subdomain, token }) => {
36
+ if (typeof lead !== "string" || !/^[\w-]+\.[\w-]+$/.test(lead)) return null;
37
+ return "/subdomain/" + subdomain + "/page/" + slug + "/lead/" + lead + (token ? "?drwbrdg_pre=" + encodeURIComponent(token) : "");
38
+ };
39
+ const missionEndpoint = ({ action, slug, subdomain, type }) => "/subdomain/" + subdomain + "/page/" + slug + "/mission/" + type + "/" + action;
35
40
  export {
36
41
  isSafeRedirect,
42
+ leadEndpoint,
43
+ missionEndpoint,
37
44
  safeHref,
38
45
  submissionEndpoint
39
46
  };
@@ -35,6 +35,7 @@ var import_react = require("react");
35
35
  var import_image = __toESM(require("next/image"));
36
36
  var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
37
37
  var import_styles = require("../styles");
38
+ var import_helpers = require("../shared/lib/helpers");
38
39
  var import_react_share = require("react-share");
39
40
  const iconSize = 40;
40
41
  const ShareButton = ({
@@ -44,7 +45,7 @@ const ShareButton = ({
44
45
  style,
45
46
  values
46
47
  }) => {
47
- var _a, _b, _c;
48
+ var _a, _b;
48
49
  const src = (0, import_cdn.cdnSrc)(values == null ? void 0 : values.image, "1200x630", (_a = values == null ? void 0 : values.image) == null ? void 0 : _a.updatedAt);
49
50
  const brandButton = style && (0, import_styles.buttonStyle)(style);
50
51
  const icon = {
@@ -212,7 +213,7 @@ const ShareButton = ({
212
213
  import_image.default,
213
214
  {
214
215
  ...{
215
- alt: "preview - " + ((_c = values == null ? void 0 : values.image) == null ? void 0 : _c.filename),
216
+ alt: (0, import_helpers.imageAlt)(values == null ? void 0 : values.image, values == null ? void 0 : values.alt),
216
217
  className: "object-cover object-center",
217
218
  fill: true,
218
219
  sizes: "448px",
@@ -227,7 +228,8 @@ const ShareButton = ({
227
228
  "div",
228
229
  {
229
230
  ...{
230
- className: "flex items-center flex-nowrap gap-[11.5px] overflow-x-auto hide-scrollbar"
231
+ // Eight 40px buttons fit a 400px panel at 11px (11.5px overflowed by half a pixel and clipped the last); narrower, the row scrolls.
232
+ className: "flex items-center flex-nowrap gap-[11px] overflow-x-auto hide-scrollbar"
231
233
  },
232
234
  children: icons
233
235
  }
@@ -3,6 +3,7 @@ import { Fragment } from "react";
3
3
  import Image from "next/image";
4
4
  import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
5
5
  import { buttonStyle } from "../styles.mjs";
6
+ import { imageAlt } from "../shared/lib/helpers.mjs";
6
7
  import {
7
8
  EmailIcon,
8
9
  EmailShareButton,
@@ -29,7 +30,7 @@ const ShareButton = ({
29
30
  style,
30
31
  values
31
32
  }) => {
32
- var _a, _b, _c;
33
+ var _a, _b;
33
34
  const src = cdnSrc(values == null ? void 0 : values.image, "1200x630", (_a = values == null ? void 0 : values.image) == null ? void 0 : _a.updatedAt);
34
35
  const brandButton = style && buttonStyle(style);
35
36
  const icon = {
@@ -197,7 +198,7 @@ const ShareButton = ({
197
198
  Image,
198
199
  {
199
200
  ...{
200
- alt: "preview - " + ((_c = values == null ? void 0 : values.image) == null ? void 0 : _c.filename),
201
+ alt: imageAlt(values == null ? void 0 : values.image, values == null ? void 0 : values.alt),
201
202
  className: "object-cover object-center",
202
203
  fill: true,
203
204
  sizes: "448px",
@@ -212,7 +213,8 @@ const ShareButton = ({
212
213
  "div",
213
214
  {
214
215
  ...{
215
- className: "flex items-center flex-nowrap gap-[11.5px] overflow-x-auto hide-scrollbar"
216
+ // Eight 40px buttons fit a 400px panel at 11px (11.5px overflowed by half a pixel and clipped the last); narrower, the row scrolls.
217
+ className: "flex items-center flex-nowrap gap-[11px] overflow-x-auto hide-scrollbar"
216
218
  },
217
219
  children: icons
218
220
  }
@@ -34,6 +34,7 @@ module.exports = __toCommonJS(subdomain_content_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_cdn = require("@drawbridge/drawbridge-utils/cdn");
36
36
  var import_image = __toESM(require("next/image"));
37
+ var import_helpers = require("../shared/lib/helpers");
37
38
  const SubdomainContent = ({
38
39
  action,
39
40
  countdown,
@@ -46,7 +47,7 @@ const SubdomainContent = ({
46
47
  productsSection,
47
48
  style
48
49
  }) => {
49
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
50
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
50
51
  const logo = (_a = data == null ? void 0 : data.images) == null ? void 0 : _a.logo;
51
52
  const opacity = (_d = (_c = (_b = style == null ? void 0 : style.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) == null ? void 0 : _d.replace(")", ",.9)");
52
53
  const defaultHeaderClassName = gallery.length > 0 ? "hidden lg:block w-full " : "max-w-lg m-auto block pt-20 lg:pt-20 space-y-3";
@@ -89,7 +90,7 @@ const SubdomainContent = ({
89
90
  import_image.default,
90
91
  {
91
92
  ...{
92
- alt: data.headline + " - logo - " + (logo == null ? void 0 : logo.filename),
93
+ alt: (0, import_helpers.imageAlt)(logo, (_g = data == null ? void 0 : data.descriptions) == null ? void 0 : _g.logo),
93
94
  className: "object-cover object-center rounded-full overflow-hidden",
94
95
  fill: true,
95
96
  priority: true,
@@ -120,25 +121,25 @@ const SubdomainContent = ({
120
121
  children: data.description
121
122
  }
122
123
  ),
123
- gallery.length === 0 && ((_h = (_g = data == null ? void 0 : data.images) == null ? void 0 : _g.preview) == null ? void 0 : _h.id) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
124
+ gallery.length === 0 && ((_i = (_h = data == null ? void 0 : data.images) == null ? void 0 : _h.preview) == null ? void 0 : _i.id) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
124
125
  "div",
125
126
  {
126
127
  ...{
127
128
  className: "w-full relative aspect-[40/21] overflow-hidden mt-6",
128
129
  style: {
129
- borderRadius: ((_i = style == null ? void 0 : style.image) == null ? void 0 : _i.radius) != null ? style.image.radius + "px" : "12px"
130
+ borderRadius: ((_j = style == null ? void 0 : style.image) == null ? void 0 : _j.radius) != null ? style.image.radius + "px" : "12px"
130
131
  }
131
132
  },
132
133
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
133
134
  import_image.default,
134
135
  {
135
136
  ...{
136
- alt: "background - " + ((_k = (_j = data == null ? void 0 : data.images) == null ? void 0 : _j.preview) == null ? void 0 : _k.filename),
137
+ alt: (0, import_helpers.imageAlt)((_k = data == null ? void 0 : data.images) == null ? void 0 : _k.preview, (_l = data == null ? void 0 : data.descriptions) == null ? void 0 : _l.preview),
137
138
  className: "object-cover object-center",
138
139
  fill: true,
139
140
  priority: true,
140
141
  sizes: "(min-width: 576px) 528px, 100vw",
141
- src: (0, import_cdn.cdnSrc)((_l = data == null ? void 0 : data.images) == null ? void 0 : _l.preview, "1200x630", (_n = (_m = data == null ? void 0 : data.images) == null ? void 0 : _m.preview) == null ? void 0 : _n.updatedAt),
142
+ src: (0, import_cdn.cdnSrc)((_m = data == null ? void 0 : data.images) == null ? void 0 : _m.preview, "1200x630", (_o = (_n = data == null ? void 0 : data.images) == null ? void 0 : _n.preview) == null ? void 0 : _o.updatedAt),
142
143
  unoptimized: true
143
144
  }
144
145
  }
@@ -2,6 +2,7 @@
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { cdnSrc } from "@drawbridge/drawbridge-utils/cdn";
4
4
  import Image from "next/image";
5
+ import { imageAlt } from "../shared/lib/helpers.mjs";
5
6
  const SubdomainContent = ({
6
7
  action,
7
8
  countdown,
@@ -14,7 +15,7 @@ const SubdomainContent = ({
14
15
  productsSection,
15
16
  style
16
17
  }) => {
17
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
18
19
  const logo = (_a = data == null ? void 0 : data.images) == null ? void 0 : _a.logo;
19
20
  const opacity = (_d = (_c = (_b = style == null ? void 0 : style.background) == null ? void 0 : _b.color) == null ? void 0 : _c.rgb) == null ? void 0 : _d.replace(")", ",.9)");
20
21
  const defaultHeaderClassName = gallery.length > 0 ? "hidden lg:block w-full " : "max-w-lg m-auto block pt-20 lg:pt-20 space-y-3";
@@ -57,7 +58,7 @@ const SubdomainContent = ({
57
58
  Image,
58
59
  {
59
60
  ...{
60
- alt: data.headline + " - logo - " + (logo == null ? void 0 : logo.filename),
61
+ alt: imageAlt(logo, (_g = data == null ? void 0 : data.descriptions) == null ? void 0 : _g.logo),
61
62
  className: "object-cover object-center rounded-full overflow-hidden",
62
63
  fill: true,
63
64
  priority: true,
@@ -88,25 +89,25 @@ const SubdomainContent = ({
88
89
  children: data.description
89
90
  }
90
91
  ),
91
- gallery.length === 0 && ((_h = (_g = data == null ? void 0 : data.images) == null ? void 0 : _g.preview) == null ? void 0 : _h.id) && /* @__PURE__ */ jsx(
92
+ gallery.length === 0 && ((_i = (_h = data == null ? void 0 : data.images) == null ? void 0 : _h.preview) == null ? void 0 : _i.id) && /* @__PURE__ */ jsx(
92
93
  "div",
93
94
  {
94
95
  ...{
95
96
  className: "w-full relative aspect-[40/21] overflow-hidden mt-6",
96
97
  style: {
97
- borderRadius: ((_i = style == null ? void 0 : style.image) == null ? void 0 : _i.radius) != null ? style.image.radius + "px" : "12px"
98
+ borderRadius: ((_j = style == null ? void 0 : style.image) == null ? void 0 : _j.radius) != null ? style.image.radius + "px" : "12px"
98
99
  }
99
100
  },
100
101
  children: /* @__PURE__ */ jsx(
101
102
  Image,
102
103
  {
103
104
  ...{
104
- alt: "background - " + ((_k = (_j = data == null ? void 0 : data.images) == null ? void 0 : _j.preview) == null ? void 0 : _k.filename),
105
+ alt: imageAlt((_k = data == null ? void 0 : data.images) == null ? void 0 : _k.preview, (_l = data == null ? void 0 : data.descriptions) == null ? void 0 : _l.preview),
105
106
  className: "object-cover object-center",
106
107
  fill: true,
107
108
  priority: true,
108
109
  sizes: "(min-width: 576px) 528px, 100vw",
109
- src: cdnSrc((_l = data == null ? void 0 : data.images) == null ? void 0 : _l.preview, "1200x630", (_n = (_m = data == null ? void 0 : data.images) == null ? void 0 : _m.preview) == null ? void 0 : _n.updatedAt),
110
+ src: cdnSrc((_m = data == null ? void 0 : data.images) == null ? void 0 : _m.preview, "1200x630", (_o = (_n = data == null ? void 0 : data.images) == null ? void 0 : _n.preview) == null ? void 0 : _o.updatedAt),
110
111
  unoptimized: true
111
112
  }
112
113
  }