@drawbridge/components 0.1.46 → 0.1.48

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 (162) hide show
  1. package/dist/bridge/cart-drawer.js +152 -0
  2. package/dist/bridge/cart-drawer.mjs +123 -0
  3. package/dist/bridge/fields.js +278 -0
  4. package/dist/bridge/fields.mjs +276 -1
  5. package/dist/bridge/form-subdomain-checkout.js +687 -0
  6. package/dist/bridge/form-subdomain-checkout.mjs +665 -0
  7. package/dist/bridge/form-subdomain-shop-modal.js +234 -274
  8. package/dist/bridge/form-subdomain-shop-modal.mjs +233 -275
  9. package/dist/bridge/form-subdomain-shop.js +4 -1
  10. package/dist/bridge/form-subdomain-shop.mjs +4 -1
  11. package/dist/bridge/form-subdomain.js +24 -5
  12. package/dist/bridge/form-subdomain.mjs +25 -6
  13. package/dist/bridge/lib/age-gate.js +12 -0
  14. package/dist/bridge/lib/age-gate.mjs +11 -0
  15. package/dist/bridge/lib/cart.js +79 -0
  16. package/dist/bridge/lib/cart.mjs +48 -0
  17. package/dist/bridge/lib/checkout-kit.js +2 -32
  18. package/dist/bridge/lib/checkout-kit.mjs +2 -32
  19. package/dist/bridge/lib/entry.js +41 -0
  20. package/dist/bridge/lib/entry.mjs +40 -0
  21. package/dist/bridge/product-tile.js +13 -6
  22. package/dist/bridge/product-tile.mjs +13 -6
  23. package/dist/bridge/template-layout.js +263 -129
  24. package/dist/bridge/template-layout.mjs +264 -130
  25. package/dist/bridge/template-modal.js +39 -74
  26. package/dist/bridge/template-modal.mjs +40 -75
  27. package/dist/dashboard/avatar.js +2 -3
  28. package/dist/dashboard/avatar.mjs +2 -3
  29. package/dist/dashboard/buttons-subscription.js +1 -1
  30. package/dist/dashboard/buttons-subscription.mjs +1 -1
  31. package/dist/dashboard/campaign-form.js +179 -155
  32. package/dist/dashboard/campaign-form.mjs +179 -155
  33. package/dist/dashboard/campaign-share.js +347 -0
  34. package/dist/dashboard/campaign-share.mjs +314 -0
  35. package/dist/dashboard/card-affiliate.js +1 -1
  36. package/dist/dashboard/card-affiliate.mjs +1 -1
  37. package/dist/dashboard/card-campaign-switch.js +4 -1
  38. package/dist/dashboard/card-campaign-switch.mjs +4 -1
  39. package/dist/dashboard/card-order.js +22 -4
  40. package/dist/dashboard/card-order.mjs +22 -4
  41. package/dist/dashboard/embed-stripe.js +145 -0
  42. package/dist/dashboard/embed-stripe.mjs +116 -0
  43. package/dist/dashboard/form-admin-provider.js +71 -17
  44. package/dist/dashboard/form-admin-provider.mjs +71 -17
  45. package/dist/dashboard/form-file-upload.js +3 -2
  46. package/dist/dashboard/form-file-upload.mjs +4 -3
  47. package/dist/dashboard/form-organization-campaign-advertisements.js +47 -6
  48. package/dist/dashboard/form-organization-campaign-advertisements.mjs +47 -6
  49. package/dist/dashboard/form-organization-campaign-field-birthday.js +193 -0
  50. package/dist/dashboard/form-organization-campaign-field-birthday.mjs +164 -0
  51. package/dist/dashboard/form-organization-campaign-field-rating.js +246 -0
  52. package/dist/dashboard/form-organization-campaign-field-rating.mjs +217 -0
  53. package/dist/dashboard/form-organization-campaign-page.js +73 -39
  54. package/dist/dashboard/form-organization-campaign-page.mjs +73 -39
  55. package/dist/dashboard/form-organization-campaign.js +82 -0
  56. package/dist/dashboard/form-organization-campaign.mjs +81 -0
  57. package/dist/dashboard/form-organization-connection.js +48 -6
  58. package/dist/dashboard/form-organization-connection.mjs +48 -7
  59. package/dist/dashboard/form-organization-product.js +1461 -0
  60. package/dist/dashboard/form-organization-product.mjs +1425 -0
  61. package/dist/dashboard/form-organization-workflow.js +72 -1
  62. package/dist/dashboard/form-organization-workflow.mjs +69 -1
  63. package/dist/dashboard/form-otc.js +4 -5
  64. package/dist/dashboard/form-otc.mjs +4 -5
  65. package/dist/dashboard/form-stripe.js +12 -5
  66. package/dist/dashboard/form-stripe.mjs +12 -5
  67. package/dist/dashboard/input-combobox.js +6 -0
  68. package/dist/dashboard/input-combobox.mjs +6 -0
  69. package/dist/dashboard/input-fields.js +37 -161
  70. package/dist/dashboard/input-fields.mjs +37 -161
  71. package/dist/dashboard/input-file.js +21 -4
  72. package/dist/dashboard/input-file.mjs +21 -4
  73. package/dist/dashboard/input-font.js +2 -0
  74. package/dist/dashboard/input-font.mjs +2 -0
  75. package/dist/dashboard/input-gallery.js +201 -0
  76. package/dist/dashboard/input-gallery.mjs +172 -0
  77. package/dist/dashboard/input-group-ai.js +15 -3
  78. package/dist/dashboard/input-group-ai.mjs +15 -3
  79. package/dist/dashboard/lib/ab-tests.js +2 -2
  80. package/dist/dashboard/lib/ab-tests.mjs +2 -2
  81. package/dist/dashboard/lib/connection-controls.js +5 -2
  82. package/dist/dashboard/lib/connection-controls.mjs +3 -1
  83. package/dist/dashboard/lib/form-page.js +1 -1
  84. package/dist/dashboard/lib/form-page.mjs +1 -1
  85. package/dist/dashboard/lib/menu.js +19 -0
  86. package/dist/dashboard/lib/menu.mjs +18 -0
  87. package/dist/dashboard/lib/products.js +169 -0
  88. package/dist/dashboard/lib/products.mjs +135 -0
  89. package/dist/dashboard/lib/settings-paths.js +35 -0
  90. package/dist/dashboard/lib/settings-paths.mjs +11 -0
  91. package/dist/dashboard/lib/uppy.js +10 -1
  92. package/dist/dashboard/lib/uppy.mjs +11 -2
  93. package/dist/dashboard/menu.js +13 -2
  94. package/dist/dashboard/menu.mjs +13 -2
  95. package/dist/dashboard/order-sections.js +456 -6
  96. package/dist/dashboard/order-sections.mjs +453 -7
  97. package/dist/dashboard/preview.js +119 -52
  98. package/dist/dashboard/preview.mjs +119 -52
  99. package/dist/dashboard/provider-ui.js +9 -7
  100. package/dist/dashboard/provider-ui.mjs +9 -7
  101. package/dist/dashboard/recharts.js +10 -4
  102. package/dist/dashboard/recharts.mjs +10 -4
  103. package/dist/dashboard/shipping-rates.js +404 -0
  104. package/dist/dashboard/shipping-rates.mjs +371 -0
  105. package/dist/dashboard/template-buyer.js +301 -0
  106. package/dist/dashboard/template-buyer.mjs +267 -0
  107. package/dist/dashboard/template-dashboard.js +11 -1
  108. package/dist/dashboard/template-dashboard.mjs +11 -1
  109. package/dist/dashboard/template-design.js +209 -130
  110. package/dist/dashboard/template-design.mjs +210 -131
  111. package/dist/dashboard/template-ui.js +157 -55
  112. package/dist/dashboard/template-ui.mjs +158 -56
  113. package/dist/icons/flags.js +134 -0
  114. package/dist/icons/flags.mjs +115 -0
  115. package/dist/input-checkbox.js +28 -10
  116. package/dist/input-checkbox.mjs +28 -10
  117. package/dist/product.js +96 -24
  118. package/dist/product.mjs +97 -25
  119. package/dist/shared/carousel.js +14 -5
  120. package/dist/shared/carousel.mjs +14 -5
  121. package/dist/shared/lib/helpers.js +54 -6
  122. package/dist/shared/lib/helpers.mjs +53 -8
  123. package/dist/shared/order-summary.js +139 -0
  124. package/dist/shared/order-summary.mjs +110 -0
  125. package/package.json +84 -4
  126. package/types/bridge/cart-drawer.d.ts +31 -0
  127. package/types/bridge/fields.d.ts +14 -2
  128. package/types/bridge/form-subdomain-checkout.d.ts +20 -0
  129. package/types/bridge/form-subdomain-shop-modal.d.ts +27 -3
  130. package/types/bridge/form-subdomain.d.ts +13 -0
  131. package/types/bridge/lib/age-gate.d.ts +5 -0
  132. package/types/bridge/lib/cart.d.ts +44 -0
  133. package/types/bridge/lib/checkout-kit.d.ts +2 -10
  134. package/types/bridge/lib/entry.d.ts +5 -0
  135. package/types/bridge/product-tile.d.ts +2 -0
  136. package/types/dashboard/campaign-share.d.ts +16 -0
  137. package/types/dashboard/card-order.d.ts +6 -0
  138. package/types/dashboard/embed-stripe.d.ts +25 -0
  139. package/types/dashboard/form-admin-provider.d.ts +9 -2
  140. package/types/dashboard/form-file-upload.d.ts +2 -1
  141. package/types/dashboard/form-organization-campaign-advertisements.d.ts +3 -0
  142. package/types/dashboard/form-organization-campaign-field-birthday.d.ts +31 -0
  143. package/types/dashboard/form-organization-campaign-field-rating.d.ts +33 -0
  144. package/types/dashboard/form-organization-campaign-page.d.ts +8 -1
  145. package/types/dashboard/form-organization-campaign.d.ts +3 -0
  146. package/types/dashboard/form-organization-connection.d.ts +11 -0
  147. package/types/dashboard/form-organization-product.d.ts +24 -0
  148. package/types/dashboard/form-otc.d.ts +5 -1
  149. package/types/dashboard/form-stripe.d.ts +3 -2
  150. package/types/dashboard/input-combobox.d.ts +2 -0
  151. package/types/dashboard/input-file.d.ts +2 -0
  152. package/types/dashboard/input-gallery.d.ts +14 -0
  153. package/types/dashboard/lib/products.d.ts +14 -0
  154. package/types/dashboard/lib/settings-paths.d.ts +5 -0
  155. package/types/dashboard/order-sections.d.ts +24 -1
  156. package/types/dashboard/preview.d.ts +11 -3
  157. package/types/dashboard/shipping-rates.d.ts +26 -0
  158. package/types/dashboard/template-buyer.d.ts +50 -0
  159. package/types/icons/flags.d.ts +5 -0
  160. package/types/input-checkbox.d.ts +2 -0
  161. package/types/shared/lib/helpers.d.ts +4 -0
  162. package/types/shared/order-summary.d.ts +19 -0
@@ -27,9 +27,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
28
  var form_organization_workflow_exports = {};
29
29
  __export(form_organization_workflow_exports, {
30
+ ABANDONED: () => ABANDONED,
30
31
  FormOrganizationWorkflowEdit: () => FormOrganizationWorkflowEdit,
31
32
  RESPONSE: () => RESPONSE,
32
33
  TextPreview: () => TextPreview,
34
+ afterOptions: () => afterOptions,
35
+ afterValue: () => afterValue,
33
36
  firstEntryOnly: () => firstEntryOnly,
34
37
  hasStepOptions: () => hasStepOptions,
35
38
  issueRow: () => issueRow,
@@ -60,6 +63,7 @@ var import_drawbridge_utils = require("@drawbridge/drawbridge-utils");
60
63
  var import_features = require("@drawbridge/drawbridge-utils/features");
61
64
  var import_fetch = require("@drawbridge/drawbridge-utils/fetch");
62
65
  var import_html = require("@drawbridge/drawbridge-utils/html");
66
+ var import_products = require("@drawbridge/drawbridge-utils/products");
63
67
  var import_form = require("../shared/lib/form");
64
68
  var import_react_query = require("@tanstack/react-query");
65
69
  var import_yup = __toESM(require("../shared/lib/yup"));
@@ -68,6 +72,7 @@ var import_fieldset = __toESM(require("../shared/fieldset"));
68
72
  var import_input_group = __toESM(require("../input-group"));
69
73
  var import_error = __toESM(require("../shared/error"));
70
74
  var import_input_textarea = __toESM(require("../input-textarea"));
75
+ var import_input_select = __toESM(require("../input-select"));
71
76
  var import_input_url = __toESM(require("../shared/input-url"));
72
77
  var import_input_resource = __toESM(require("./input-resource"));
73
78
  var import_input_combobox = __toESM(require("./input-combobox"));
@@ -97,6 +102,12 @@ const firstEntryOnly = ({ campaign, event, type }) => {
97
102
  if (type === "step.sms.send") return ((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.submissionLeadPrimaryKey) !== "phone";
98
103
  return true;
99
104
  };
105
+ const ABANDONED = "cart.abandoned";
106
+ const afterOptions = import_products.ABANDON_HOURS.map((hours) => ({
107
+ label: hours + (hours === 1 ? " hour" : " hours"),
108
+ value: String(hours)
109
+ }));
110
+ const afterValue = (trigger) => String(import_products.ABANDON_HOURS.includes(trigger == null ? void 0 : trigger.after) ? trigger.after : import_products.ABANDON_AFTER);
100
111
  const stepPrefills = {
101
112
  "step.email.send": {
102
113
  message: import_drawbridge_utils.constants.campaign.confirmation.message,
@@ -573,6 +584,15 @@ const LeadEmailNote = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
573
584
  children: "Drawbridge adds the entrant's order and missions under your message. You can't edit or remove them."
574
585
  }
575
586
  );
587
+ const CartEmailNote = () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
588
+ "p",
589
+ {
590
+ ...{
591
+ className: "text-sm text-gray-dark"
592
+ },
593
+ children: "Drawbridge adds the lead's cart and a button back to it under your message."
594
+ }
595
+ );
576
596
  const RESPONSE_STATES = [
577
597
  {
578
598
  key: "Email",
@@ -1019,6 +1039,10 @@ const FormOrganizationWorkflowEdit = ({
1019
1039
  );
1020
1040
  const { control, formState, getValues, handleSubmit, reset, setValue, watch } = (0, import_form.useForm)({
1021
1041
  values: {
1042
+ // @story workflows/cart-abandonment
1043
+ ...event === ABANDONED && {
1044
+ after: afterValue(values == null ? void 0 : values.trigger)
1045
+ },
1022
1046
  steps: defaultSteps
1023
1047
  },
1024
1048
  resolver: (0, import_yup.resolver)(workflowSchema)
@@ -1172,11 +1196,17 @@ const FormOrganizationWorkflowEdit = ({
1172
1196
  );
1173
1197
  };
1174
1198
  const onSubmit = async ({
1199
+ after,
1175
1200
  steps
1176
1201
  }) => {
1177
1202
  var _a2;
1178
1203
  try {
1179
1204
  const body = {
1205
+ // @story workflows/cart-abandonment
1206
+ // Send after, saved by the same Save as the steps.
1207
+ ...event === ABANDONED && {
1208
+ after: Number(after)
1209
+ },
1180
1210
  steps: steps.map(({ connectionId, discount, enabled, members, message, score, settings: parts, slug, subject, text, type, url }, index) => {
1181
1211
  const settings = type === RESPONSE ? responseSave(parts) : {};
1182
1212
  if (type === RESPONSE && parts.email.score && !settings.email.score) setValue("steps." + index + ".settings.email.score", null);
@@ -1256,6 +1286,43 @@ const FormOrganizationWorkflowEdit = ({
1256
1286
  variant: "gray"
1257
1287
  },
1258
1288
  children: [
1289
+ event === ABANDONED && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1290
+ import_card_section.default,
1291
+ {
1292
+ ...{
1293
+ className: "mb-4",
1294
+ title: "Send after"
1295
+ },
1296
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1297
+ import_form.Controller,
1298
+ {
1299
+ ...{
1300
+ control,
1301
+ name: "after",
1302
+ render: ({ field: { onChange, value } }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1303
+ import_input_group.default,
1304
+ {
1305
+ ...{
1306
+ input: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1307
+ import_input_select.default,
1308
+ {
1309
+ ...{
1310
+ "aria-label": "Send after",
1311
+ onChange,
1312
+ options: afterOptions,
1313
+ value
1314
+ }
1315
+ }
1316
+ ),
1317
+ message: "Counted from the last change to the cart."
1318
+ }
1319
+ }
1320
+ )
1321
+ }
1322
+ }
1323
+ )
1324
+ }
1325
+ ),
1259
1326
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1260
1327
  import_input_group.default,
1261
1328
  {
@@ -1445,7 +1512,7 @@ const FormOrganizationWorkflowEdit = ({
1445
1512
  var _a4;
1446
1513
  const [type] = val.split("::");
1447
1514
  const option = getStepOptions(index).find((o) => o.value === val);
1448
- const copy = pickedCopy({ row: getValues(`steps.${index}`), type });
1515
+ const copy = event === ABANDONED ? null : pickedCopy({ row: getValues(`steps.${index}`), type });
1449
1516
  setValue(`steps.${index}.settings`, type === RESPONSE ? responseStart((_a4 = values == null ? void 0 : values.autoResponse) == null ? void 0 : _a4.number) : null);
1450
1517
  onChange(type);
1451
1518
  setValue(`steps.${index}.connectionId`, (option == null ? void 0 : option.connectionId) || "");
@@ -1582,6 +1649,7 @@ const FormOrganizationWorkflowEdit = ({
1582
1649
  }
1583
1650
  ),
1584
1651
  event === "lead.insert" && emailSteps.includes(step.type) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LeadEmailNote, {}),
1652
+ event === ABANDONED && emailSteps.includes(step.type) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CartEmailNote, {}),
1585
1653
  step.type === "step.sms.send" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
1586
1654
  import_form.Controller,
1587
1655
  {
@@ -1724,9 +1792,12 @@ const FormOrganizationWorkflowEdit = ({
1724
1792
  };
1725
1793
  // Annotate the CommonJS export names for ESM import in node:
1726
1794
  0 && (module.exports = {
1795
+ ABANDONED,
1727
1796
  FormOrganizationWorkflowEdit,
1728
1797
  RESPONSE,
1729
1798
  TextPreview,
1799
+ afterOptions,
1800
+ afterValue,
1730
1801
  firstEntryOnly,
1731
1802
  hasStepOptions,
1732
1803
  issueRow,
@@ -6,6 +6,7 @@ import { constants, getPlanFeature } from "@drawbridge/drawbridge-utils";
6
6
  import { organization as organizationFeatures } from "@drawbridge/drawbridge-utils/features";
7
7
  import { isTransientError, request } from "@drawbridge/drawbridge-utils/fetch";
8
8
  import { escapeHtml } from "@drawbridge/drawbridge-utils/html";
9
+ import { ABANDON_AFTER, ABANDON_HOURS } from "@drawbridge/drawbridge-utils/products";
9
10
  import { useForm, useWatch, Controller } from "../shared/lib/form.mjs";
10
11
  import { keepPreviousData, useQuery, useQueryClient } from "@tanstack/react-query";
11
12
  import yup, { resolver } from "../shared/lib/yup.mjs";
@@ -14,6 +15,7 @@ import Fieldset from "../shared/fieldset.mjs";
14
15
  import InputGroup from "../input-group.mjs";
15
16
  import Error from "../shared/error.mjs";
16
17
  import InputTextarea from "../input-textarea.mjs";
18
+ import InputSelect from "../input-select.mjs";
17
19
  import InputUrl from "../shared/input-url.mjs";
18
20
  import InputResource from "./input-resource.mjs";
19
21
  import InputCombobox from "./input-combobox.mjs";
@@ -43,6 +45,12 @@ const firstEntryOnly = ({ campaign, event, type }) => {
43
45
  if (type === "step.sms.send") return ((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.submissionLeadPrimaryKey) !== "phone";
44
46
  return true;
45
47
  };
48
+ const ABANDONED = "cart.abandoned";
49
+ const afterOptions = ABANDON_HOURS.map((hours) => ({
50
+ label: hours + (hours === 1 ? " hour" : " hours"),
51
+ value: String(hours)
52
+ }));
53
+ const afterValue = (trigger) => String(ABANDON_HOURS.includes(trigger == null ? void 0 : trigger.after) ? trigger.after : ABANDON_AFTER);
46
54
  const stepPrefills = {
47
55
  "step.email.send": {
48
56
  message: constants.campaign.confirmation.message,
@@ -519,6 +527,15 @@ const LeadEmailNote = () => /* @__PURE__ */ jsx(
519
527
  children: "Drawbridge adds the entrant's order and missions under your message. You can't edit or remove them."
520
528
  }
521
529
  );
530
+ const CartEmailNote = () => /* @__PURE__ */ jsx(
531
+ "p",
532
+ {
533
+ ...{
534
+ className: "text-sm text-gray-dark"
535
+ },
536
+ children: "Drawbridge adds the lead's cart and a button back to it under your message."
537
+ }
538
+ );
522
539
  const RESPONSE_STATES = [
523
540
  {
524
541
  key: "Email",
@@ -965,6 +982,10 @@ const FormOrganizationWorkflowEdit = ({
965
982
  );
966
983
  const { control, formState, getValues, handleSubmit, reset, setValue, watch } = useForm({
967
984
  values: {
985
+ // @story workflows/cart-abandonment
986
+ ...event === ABANDONED && {
987
+ after: afterValue(values == null ? void 0 : values.trigger)
988
+ },
968
989
  steps: defaultSteps
969
990
  },
970
991
  resolver: resolver(workflowSchema)
@@ -1118,11 +1139,17 @@ const FormOrganizationWorkflowEdit = ({
1118
1139
  );
1119
1140
  };
1120
1141
  const onSubmit = async ({
1142
+ after,
1121
1143
  steps
1122
1144
  }) => {
1123
1145
  var _a2;
1124
1146
  try {
1125
1147
  const body = {
1148
+ // @story workflows/cart-abandonment
1149
+ // Send after, saved by the same Save as the steps.
1150
+ ...event === ABANDONED && {
1151
+ after: Number(after)
1152
+ },
1126
1153
  steps: steps.map(({ connectionId, discount, enabled, members, message, score, settings: parts, slug, subject, text, type, url }, index) => {
1127
1154
  const settings = type === RESPONSE ? responseSave(parts) : {};
1128
1155
  if (type === RESPONSE && parts.email.score && !settings.email.score) setValue("steps." + index + ".settings.email.score", null);
@@ -1202,6 +1229,43 @@ const FormOrganizationWorkflowEdit = ({
1202
1229
  variant: "gray"
1203
1230
  },
1204
1231
  children: [
1232
+ event === ABANDONED && /* @__PURE__ */ jsx(
1233
+ CardSection,
1234
+ {
1235
+ ...{
1236
+ className: "mb-4",
1237
+ title: "Send after"
1238
+ },
1239
+ children: /* @__PURE__ */ jsx(
1240
+ Controller,
1241
+ {
1242
+ ...{
1243
+ control,
1244
+ name: "after",
1245
+ render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsx(
1246
+ InputGroup,
1247
+ {
1248
+ ...{
1249
+ input: /* @__PURE__ */ jsx(
1250
+ InputSelect,
1251
+ {
1252
+ ...{
1253
+ "aria-label": "Send after",
1254
+ onChange,
1255
+ options: afterOptions,
1256
+ value
1257
+ }
1258
+ }
1259
+ ),
1260
+ message: "Counted from the last change to the cart."
1261
+ }
1262
+ }
1263
+ )
1264
+ }
1265
+ }
1266
+ )
1267
+ }
1268
+ ),
1205
1269
  /* @__PURE__ */ jsx(
1206
1270
  InputGroup,
1207
1271
  {
@@ -1391,7 +1455,7 @@ const FormOrganizationWorkflowEdit = ({
1391
1455
  var _a4;
1392
1456
  const [type] = val.split("::");
1393
1457
  const option = getStepOptions(index).find((o) => o.value === val);
1394
- const copy = pickedCopy({ row: getValues(`steps.${index}`), type });
1458
+ const copy = event === ABANDONED ? null : pickedCopy({ row: getValues(`steps.${index}`), type });
1395
1459
  setValue(`steps.${index}.settings`, type === RESPONSE ? responseStart((_a4 = values == null ? void 0 : values.autoResponse) == null ? void 0 : _a4.number) : null);
1396
1460
  onChange(type);
1397
1461
  setValue(`steps.${index}.connectionId`, (option == null ? void 0 : option.connectionId) || "");
@@ -1528,6 +1592,7 @@ const FormOrganizationWorkflowEdit = ({
1528
1592
  }
1529
1593
  ),
1530
1594
  event === "lead.insert" && emailSteps.includes(step.type) && /* @__PURE__ */ jsx(LeadEmailNote, {}),
1595
+ event === ABANDONED && emailSteps.includes(step.type) && /* @__PURE__ */ jsx(CartEmailNote, {}),
1531
1596
  step.type === "step.sms.send" && /* @__PURE__ */ jsx(
1532
1597
  Controller,
1533
1598
  {
@@ -1669,9 +1734,12 @@ const FormOrganizationWorkflowEdit = ({
1669
1734
  );
1670
1735
  };
1671
1736
  export {
1737
+ ABANDONED,
1672
1738
  FormOrganizationWorkflowEdit,
1673
1739
  RESPONSE,
1674
1740
  TextPreview,
1741
+ afterOptions,
1742
+ afterValue,
1675
1743
  firstEntryOnly,
1676
1744
  hasStepOptions,
1677
1745
  issueRow,
@@ -42,8 +42,10 @@ var import_input_group = __toESM(require("../input-group"));
42
42
  var import_input_code = __toESM(require("../input-code"));
43
43
  var import_button = __toESM(require("../shared/button"));
44
44
  const FormOtcCode = ({
45
+ message,
45
46
  onError,
46
47
  onSuccess,
48
+ title = "Authorization",
47
49
  values
48
50
  }) => {
49
51
  const [submitting, setSubmitting] = (0, import_react.useState)(false);
@@ -79,11 +81,8 @@ const FormOtcCode = ({
79
81
  disabled: submitting
80
82
  },
81
83
  children: [
82
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: "Authorization" }),
83
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { children: [
84
- "A code will be sent to ",
85
- values == null ? void 0 : values.identifier
86
- ] })
84
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: title }),
85
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: message || "A code will be sent to " + (values == null ? void 0 : values.identifier) })
87
86
  ]
88
87
  }
89
88
  ),
@@ -9,8 +9,10 @@ import InputGroup from "../input-group.mjs";
9
9
  import InputCode from "../input-code.mjs";
10
10
  import Button from "../shared/button.mjs";
11
11
  const FormOtcCode = ({
12
+ message,
12
13
  onError,
13
14
  onSuccess,
15
+ title = "Authorization",
14
16
  values
15
17
  }) => {
16
18
  const [submitting, setSubmitting] = useState(false);
@@ -46,11 +48,8 @@ const FormOtcCode = ({
46
48
  disabled: submitting
47
49
  },
48
50
  children: [
49
- /* @__PURE__ */ jsx("h3", { children: "Authorization" }),
50
- /* @__PURE__ */ jsxs("p", { children: [
51
- "A code will be sent to ",
52
- values == null ? void 0 : values.identifier
53
- ] })
51
+ /* @__PURE__ */ jsx("h3", { children: title }),
52
+ /* @__PURE__ */ jsx("p", { children: message || "A code will be sent to " + (values == null ? void 0 : values.identifier) })
54
53
  ]
55
54
  }
56
55
  ),
@@ -33,6 +33,7 @@ __export(form_stripe_exports, {
33
33
  module.exports = __toCommonJS(form_stripe_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_react = require("react");
36
+ var import_react_query = require("@tanstack/react-query");
36
37
  var import_fetch = require("@drawbridge/drawbridge-utils/fetch");
37
38
  var import_stripe_js = require("@stripe/stripe-js");
38
39
  var import_navigation = require("next/navigation");
@@ -43,14 +44,18 @@ var import_empty = __toESM(require("../shared/empty"));
43
44
  var import_card_task = __toESM(require("./card-task"));
44
45
  var import_provider_resource = __toESM(require("./provider-resource"));
45
46
  var import_button = __toESM(require("../shared/button"));
46
- const stripe = (0, import_stripe_js.loadStripe)(process.env.NEXT_PUBLIC_STRIPE_API_KEY);
47
+ const loaders = /* @__PURE__ */ new Map();
48
+ const stripeFor = (key) => {
49
+ if (!loaders.has(key)) loaders.set(key, (0, import_stripe_js.loadStripe)(key));
50
+ return loaders.get(key);
51
+ };
47
52
  const FormStripeInner = ({
48
53
  button,
49
54
  disabled,
50
55
  onSuccess
51
56
  }) => {
52
57
  const path = (0, import_navigation.usePathname)();
53
- const stripe2 = (0, import_react_stripe_js.useStripe)();
58
+ const stripe = (0, import_react_stripe_js.useStripe)();
54
59
  const elements = (0, import_react_stripe_js.useElements)();
55
60
  const [addressReady, setAddressReady] = (0, import_react.useState)(false);
56
61
  const [error, setError] = (0, import_react.useState)(null);
@@ -76,7 +81,7 @@ const FormStripeInner = ({
76
81
  setAddressReady(false);
77
82
  setPaymentReady(false);
78
83
  setError(null);
79
- const { error: error2, setupIntent } = await stripe2.confirmSetup({
84
+ const { error: error2, setupIntent } = await stripe.confirmSetup({
80
85
  elements,
81
86
  confirmParams: {
82
87
  return_url: process.env.NEXT_PUBLIC_APP_URI + path
@@ -170,14 +175,16 @@ const FormStripe = ({
170
175
  disabled,
171
176
  onSuccess
172
177
  }) => {
173
- if (!clientSecret) {
178
+ var _a, _b;
179
+ const key = (_b = (_a = (0, import_react_query.useQueryClient)().getQueryData(["app"])) == null ? void 0 : _a.credentials) == null ? void 0 : _b.stripePublishableKey;
180
+ if (!clientSecret || !key) {
174
181
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_empty.default, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Payment was not initialized correctly" }) });
175
182
  }
176
183
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
177
184
  import_react_stripe_js.Elements,
178
185
  {
179
186
  ...{
180
- stripe,
187
+ stripe: stripeFor(key),
181
188
  options: {
182
189
  clientSecret,
183
190
  appearance: {
@@ -1,5 +1,6 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from "react";
3
+ import { useQueryClient } from "@tanstack/react-query";
3
4
  import { request } from "@drawbridge/drawbridge-utils/fetch";
4
5
  import { loadStripe } from "@stripe/stripe-js";
5
6
  import { usePathname } from "next/navigation";
@@ -10,14 +11,18 @@ import Empty from "../shared/empty.mjs";
10
11
  import CardTask from "./card-task.mjs";
11
12
  import ProviderResource from "./provider-resource.mjs";
12
13
  import Button from "../shared/button.mjs";
13
- const stripe = loadStripe(process.env.NEXT_PUBLIC_STRIPE_API_KEY);
14
+ const loaders = /* @__PURE__ */ new Map();
15
+ const stripeFor = (key) => {
16
+ if (!loaders.has(key)) loaders.set(key, loadStripe(key));
17
+ return loaders.get(key);
18
+ };
14
19
  const FormStripeInner = ({
15
20
  button,
16
21
  disabled,
17
22
  onSuccess
18
23
  }) => {
19
24
  const path = usePathname();
20
- const stripe2 = useStripe();
25
+ const stripe = useStripe();
21
26
  const elements = useElements();
22
27
  const [addressReady, setAddressReady] = useState(false);
23
28
  const [error, setError] = useState(null);
@@ -43,7 +48,7 @@ const FormStripeInner = ({
43
48
  setAddressReady(false);
44
49
  setPaymentReady(false);
45
50
  setError(null);
46
- const { error: error2, setupIntent } = await stripe2.confirmSetup({
51
+ const { error: error2, setupIntent } = await stripe.confirmSetup({
47
52
  elements,
48
53
  confirmParams: {
49
54
  return_url: process.env.NEXT_PUBLIC_APP_URI + path
@@ -137,14 +142,16 @@ const FormStripe = ({
137
142
  disabled,
138
143
  onSuccess
139
144
  }) => {
140
- if (!clientSecret) {
145
+ var _a, _b;
146
+ const key = (_b = (_a = useQueryClient().getQueryData(["app"])) == null ? void 0 : _a.credentials) == null ? void 0 : _b.stripePublishableKey;
147
+ if (!clientSecret || !key) {
141
148
  return /* @__PURE__ */ jsx(Empty, { children: /* @__PURE__ */ jsx("p", { children: "Payment was not initialized correctly" }) });
142
149
  }
143
150
  return /* @__PURE__ */ jsx(
144
151
  Elements,
145
152
  {
146
153
  ...{
147
- stripe,
154
+ stripe: stripeFor(key),
148
155
  options: {
149
156
  clientSecret,
150
157
  appearance: {
@@ -40,6 +40,9 @@ var import_card_asset = __toESM(require("../shared/card-asset"));
40
40
  var import_badge = __toESM(require("../shared/badge"));
41
41
  var import_button = __toESM(require("../shared/button"));
42
42
  const InputCombobox = ({
43
+ // The name a reader hears when no visible label names it ( Impeccable audit,
44
+ // 2026-11-21: the font row's weight and letter case ).
45
+ "aria-label": name,
43
46
  disabled = false,
44
47
  onChange,
45
48
  options,
@@ -202,6 +205,9 @@ const InputCombobox = ({
202
205
  import_react2.ComboboxInput,
203
206
  {
204
207
  ...{
208
+ ...name && {
209
+ "aria-label": name
210
+ },
205
211
  autoComplete: "off",
206
212
  className: [
207
213
  "input w-full pr-9 focus:outline-hidden focus:ring-0 focus-visible:outline-hidden focus-visible:ring-0",
@@ -14,6 +14,9 @@ import CardAsset from "../shared/card-asset.mjs";
14
14
  import Badge from "../shared/badge.mjs";
15
15
  import Button from "../shared/button.mjs";
16
16
  const InputCombobox = ({
17
+ // The name a reader hears when no visible label names it ( Impeccable audit,
18
+ // 2026-11-21: the font row's weight and letter case ).
19
+ "aria-label": name,
17
20
  disabled = false,
18
21
  onChange,
19
22
  options,
@@ -176,6 +179,9 @@ const InputCombobox = ({
176
179
  ComboboxInput,
177
180
  {
178
181
  ...{
182
+ ...name && {
183
+ "aria-label": name
184
+ },
179
185
  autoComplete: "off",
180
186
  className: [
181
187
  "input w-full pr-9 focus:outline-hidden focus:ring-0 focus-visible:outline-hidden focus-visible:ring-0",