@codebards/ik-embeddable-form 0.0.2804519247-qa → 0.0.2808344517-qa

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/embed.js CHANGED
@@ -1,5 +1,6 @@
1
1
  var IKEmbeddableFormBundle = function(exports) {
2
2
  "use strict";
3
+ var _a, _b, _c, _d;
3
4
  const loadedContainerIds = /* @__PURE__ */ new Set();
4
5
  function resolveContainerId(override) {
5
6
  const id = ((override == null ? void 0 : override.trim()) || "GTM-P335R9N").trim();
@@ -94,8 +95,8 @@ var IKEmbeddableFormBundle = function(exports) {
94
95
  function buildFieldOwnerMap(config) {
95
96
  const map = {};
96
97
  config.steps.forEach((step) => {
97
- var _a;
98
- (_a = step.fields) == null ? void 0 : _a.forEach((field) => {
98
+ var _a2;
99
+ (_a2 = step.fields) == null ? void 0 : _a2.forEach((field) => {
99
100
  map[field.name] = [...map[field.name] ?? [], step.id];
100
101
  });
101
102
  });
@@ -104,10 +105,10 @@ var IKEmbeddableFormBundle = function(exports) {
104
105
  function buildFieldLabelMap(config) {
105
106
  const map = {};
106
107
  config.steps.forEach((step) => {
107
- var _a;
108
- (_a = step.fields) == null ? void 0 : _a.forEach((field) => {
109
- var _a2;
110
- if (!((_a2 = field.options) == null ? void 0 : _a2.length)) return;
108
+ var _a2;
109
+ (_a2 = step.fields) == null ? void 0 : _a2.forEach((field) => {
110
+ var _a3;
111
+ if (!((_a3 = field.options) == null ? void 0 : _a3.length)) return;
111
112
  const byValue = {};
112
113
  field.options.forEach((opt) => {
113
114
  byValue[String(opt.value)] = opt.label;
@@ -126,13 +127,13 @@ var IKEmbeddableFormBundle = function(exports) {
126
127
  function buildFormValues(formData, labels = {}, fields = ANALYTICS_VALUE_FIELDS) {
127
128
  const snapshot = {};
128
129
  fields.forEach((key) => {
129
- var _a;
130
+ var _a2;
130
131
  const value = formData[key];
131
132
  if (value === void 0 || value === null || value === "") return;
132
133
  if (!isPrimitive$1(value)) return;
133
134
  const snakeKey = toSnakeCase(key);
134
135
  snapshot[snakeKey] = value;
135
- const label = (_a = labels[key]) == null ? void 0 : _a[String(value)];
136
+ const label = (_a2 = labels[key]) == null ? void 0 : _a2[String(value)];
136
137
  if (label) snapshot[`${snakeKey}_label`] = label;
137
138
  });
138
139
  return snapshot;
@@ -713,9 +714,9 @@ var IKEmbeddableFormBundle = function(exports) {
713
714
  return path.startsWith("/") ? path : `/${path}`;
714
715
  }
715
716
  function resolveStaticCtaPageUrl(openConfig) {
716
- var _a;
717
+ var _a2;
717
718
  const { ctaPagePrefix } = getSiteStaticDefaults(openConfig.site);
718
- if ((_a = openConfig.ctaPageUrl) == null ? void 0 : _a.trim()) {
719
+ if ((_a2 = openConfig.ctaPageUrl) == null ? void 0 : _a2.trim()) {
719
720
  const raw = openConfig.ctaPageUrl.trim();
720
721
  if (raw.includes("://") || raw.startsWith("learn.com") || raw.startsWith("ik.com")) {
721
722
  return raw;
@@ -946,7 +947,7 @@ var IKEmbeddableFormBundle = function(exports) {
946
947
  }
947
948
  const UNKNOWN = { browserName: "Unknown", browserVersion: "Unknown" };
948
949
  function getBrowserDetails() {
949
- var _a, _b, _c;
950
+ var _a2, _b2, _c2;
950
951
  try {
951
952
  const ua = navigator.userAgent;
952
953
  let browserName = "Unknown";
@@ -956,16 +957,16 @@ var IKEmbeddableFormBundle = function(exports) {
956
957
  version = ua.split("Firefox/")[1] || "Unknown";
957
958
  } else if (ua.indexOf("Chrome") > -1 && ua.indexOf("Edg/") === -1) {
958
959
  browserName = "Chrome";
959
- version = ((_a = ua.split("Chrome/")[1]) == null ? void 0 : _a.split(" ")[0]) || "Unknown";
960
+ version = ((_a2 = ua.split("Chrome/")[1]) == null ? void 0 : _a2.split(" ")[0]) || "Unknown";
960
961
  } else if (ua.indexOf("Safari") > -1 && ua.indexOf("Chrome") === -1) {
961
962
  browserName = "Safari";
962
- version = ((_b = ua.split("Version/")[1]) == null ? void 0 : _b.split(" ")[0]) || "Unknown";
963
+ version = ((_b2 = ua.split("Version/")[1]) == null ? void 0 : _b2.split(" ")[0]) || "Unknown";
963
964
  } else if (ua.indexOf("Edg/") > -1) {
964
965
  browserName = "Edge";
965
966
  version = ua.split("Edg/")[1] || "Unknown";
966
967
  } else if (ua.indexOf("Trident/") > -1) {
967
968
  browserName = "Internet Explorer";
968
- version = ((_c = ua.split("rv:")[1]) == null ? void 0 : _c.split(")")[0]) || "Unknown";
969
+ version = ((_c2 = ua.split("rv:")[1]) == null ? void 0 : _c2.split(")")[0]) || "Unknown";
969
970
  }
970
971
  return { browserName, browserVersion: version };
971
972
  } catch {
@@ -1061,8 +1062,8 @@ var IKEmbeddableFormBundle = function(exports) {
1061
1062
  day: "2-digit"
1062
1063
  }).formatToParts(/* @__PURE__ */ new Date());
1063
1064
  const get2 = (type) => {
1064
- var _a;
1065
- return Number((_a = parts.find((p2) => p2.type === type)) == null ? void 0 : _a.value);
1065
+ var _a2;
1066
+ return Number((_a2 = parts.find((p2) => p2.type === type)) == null ? void 0 : _a2.value);
1066
1067
  };
1067
1068
  return { year: get2("year"), month: get2("month"), day: get2("day") };
1068
1069
  }
@@ -1078,8 +1079,8 @@ var IKEmbeddableFormBundle = function(exports) {
1078
1079
  hourCycle: "h23"
1079
1080
  }).formatToParts(date);
1080
1081
  const get2 = (type) => {
1081
- var _a;
1082
- return Number((_a = parts.find((p2) => p2.type === type)) == null ? void 0 : _a.value);
1082
+ var _a2;
1083
+ return Number((_a2 = parts.find((p2) => p2.type === type)) == null ? void 0 : _a2.value);
1083
1084
  };
1084
1085
  return {
1085
1086
  year: get2("year"),
@@ -1091,9 +1092,9 @@ var IKEmbeddableFormBundle = function(exports) {
1091
1092
  };
1092
1093
  }
1093
1094
  function timeZoneOffsetString(timeZone, at) {
1094
- var _a;
1095
+ var _a2;
1095
1096
  try {
1096
- const raw = ((_a = new Intl.DateTimeFormat("en-US", { timeZone, timeZoneName: "longOffset" }).formatToParts(at).find((p2) => p2.type === "timeZoneName")) == null ? void 0 : _a.value) ?? "GMT+00:00";
1097
+ const raw = ((_a2 = new Intl.DateTimeFormat("en-US", { timeZone, timeZoneName: "longOffset" }).formatToParts(at).find((p2) => p2.type === "timeZoneName")) == null ? void 0 : _a2.value) ?? "GMT+00:00";
1097
1098
  let offset = raw.replace("GMT", "") || "+00:00";
1098
1099
  if (/^[+-]\d:/.test(offset)) offset = offset.replace(/^([+-])(\d):/, "$10$2:");
1099
1100
  return offset || "+00:00";
@@ -1343,13 +1344,13 @@ var IKEmbeddableFormBundle = function(exports) {
1343
1344
  return new Date(year, monthIndex, day, hour24, minute);
1344
1345
  }
1345
1346
  function formatFirstSlotBadgeDate(slots) {
1346
- var _a, _b, _c;
1347
- const startTime = (_a = slots == null ? void 0 : slots[0]) == null ? void 0 : _a.startTime;
1347
+ var _a2, _b2, _c2;
1348
+ const startTime = (_a2 = slots == null ? void 0 : slots[0]) == null ? void 0 : _a2.startTime;
1348
1349
  if (!startTime) return null;
1349
1350
  const date = new Date(startTime);
1350
1351
  if (Number.isNaN(date.getTime())) return null;
1351
- const weekday = ((_b = WEEKDAYS[date.getDay()]) == null ? void 0 : _b.slice(0, 3)) ?? "";
1352
- const month = ((_c = MONTHS[date.getMonth()]) == null ? void 0 : _c.slice(0, 3)) ?? "";
1352
+ const weekday = ((_b2 = WEEKDAYS[date.getDay()]) == null ? void 0 : _b2.slice(0, 3)) ?? "";
1353
+ const month = ((_c2 = MONTHS[date.getMonth()]) == null ? void 0 : _c2.slice(0, 3)) ?? "";
1353
1354
  return `${weekday}, ${date.getDate()} ${month}`;
1354
1355
  }
1355
1356
  const defaultVariant = {
@@ -1699,14 +1700,14 @@ var IKEmbeddableFormBundle = function(exports) {
1699
1700
  return value.toLowerCase().replace(/[^a-z0-9]/g, "");
1700
1701
  }
1701
1702
  function resolveOfferUtmTerm() {
1702
- var _a;
1703
+ var _a2;
1703
1704
  const fromUrl = new URLSearchParams(window.location.search).get("utm_term");
1704
1705
  if (fromUrl == null ? void 0 : fromUrl.trim()) return fromUrl;
1705
- return ((_a = getWebinarContextOrNull()) == null ? void 0 : _a.utm.utm_term) ?? "";
1706
+ return ((_a2 = getWebinarContextOrNull()) == null ? void 0 : _a2.utm.utm_term) ?? "";
1706
1707
  }
1707
1708
  function offerQualifies(offer, utmTerm) {
1708
- var _a;
1709
- const gates = (_a = offer.showForUtmTerms) == null ? void 0 : _a.filter((gate) => normalizeTerm(gate).length > 0);
1709
+ var _a2;
1710
+ const gates = (_a2 = offer.showForUtmTerms) == null ? void 0 : _a2.filter((gate) => normalizeTerm(gate).length > 0);
1710
1711
  if (!(gates == null ? void 0 : gates.length)) return true;
1711
1712
  const term = normalizeTerm(utmTerm);
1712
1713
  if (!term) return false;
@@ -1725,15 +1726,15 @@ var IKEmbeddableFormBundle = function(exports) {
1725
1726
  const STYLE_VARIANTS = ["default", "webinar-card"];
1726
1727
  const DEFAULT_STYLE_VARIANT = "default";
1727
1728
  function resolveLayoutConfig(config) {
1728
- var _a, _b, _c, _d, _e, _f;
1729
- if (((_a = config.layout) == null ? void 0 : _a.type) === "split") {
1729
+ var _a2, _b2, _c2, _d2, _e, _f;
1730
+ if (((_a2 = config.layout) == null ? void 0 : _a2.type) === "split") {
1730
1731
  return config.layout;
1731
1732
  }
1732
- if (((_b = config.theme) == null ? void 0 : _b.layout) === "split") {
1733
+ if (((_b2 = config.theme) == null ? void 0 : _b2.layout) === "split") {
1733
1734
  return {
1734
1735
  type: "split",
1735
- modalMaxWidth: config.theme.modalMaxWidth ?? ((_c = config.layout) == null ? void 0 : _c.modalMaxWidth),
1736
- modalMinHeight: ((_d = config.layout) == null ? void 0 : _d.modalMinHeight) ?? "618px",
1736
+ modalMaxWidth: config.theme.modalMaxWidth ?? ((_c2 = config.layout) == null ? void 0 : _c2.modalMaxWidth),
1737
+ modalMinHeight: ((_d2 = config.layout) == null ? void 0 : _d2.modalMinHeight) ?? "618px",
1737
1738
  leftPanel: ((_e = config.layout) == null ? void 0 : _e.leftPanel) ?? (config.theme.sidebar ? {
1738
1739
  type: "webinar-promo",
1739
1740
  data: config.theme.sidebar
@@ -1747,17 +1748,17 @@ var IKEmbeddableFormBundle = function(exports) {
1747
1748
  return config.layout ?? null;
1748
1749
  }
1749
1750
  function isSplitLayout(config) {
1750
- var _a;
1751
- return ((_a = resolveLayoutConfig(config)) == null ? void 0 : _a.type) === "split";
1751
+ var _a2;
1752
+ return ((_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.type) === "split";
1752
1753
  }
1753
1754
  function getLeftPanel(config) {
1754
- var _a;
1755
- const panel = (_a = resolveLayoutConfig(config)) == null ? void 0 : _a.leftPanel;
1755
+ var _a2;
1756
+ const panel = (_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.leftPanel;
1756
1757
  return panel ? resolveLeftPanelOffer(panel) : void 0;
1757
1758
  }
1758
1759
  function getRightPanel(config) {
1759
- var _a;
1760
- const panel = ((_a = resolveLayoutConfig(config)) == null ? void 0 : _a.rightPanel) ?? {};
1760
+ var _a2;
1761
+ const panel = ((_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.rightPanel) ?? {};
1761
1762
  if (!panel.privacyPolicyUrl) return panel;
1762
1763
  return {
1763
1764
  ...panel,
@@ -1765,9 +1766,9 @@ var IKEmbeddableFormBundle = function(exports) {
1765
1766
  };
1766
1767
  }
1767
1768
  function shouldShowLeftPanel(config, openConfig, currentStepId) {
1768
- var _a;
1769
+ var _a2;
1769
1770
  if (openConfig == null ? void 0 : openConfig.hideLeftPanel) return false;
1770
- if ((_a = resolveLayoutConfig(config)) == null ? void 0 : _a.hideLeftPanel) return false;
1771
+ if ((_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.hideLeftPanel) return false;
1771
1772
  const currentStep = config.steps.find((s2) => s2.id === currentStepId);
1772
1773
  if (currentStep == null ? void 0 : currentStep.hideLeftPanel) return false;
1773
1774
  return !!getLeftPanel(config);
@@ -1782,9 +1783,9 @@ var IKEmbeddableFormBundle = function(exports) {
1782
1783
  return getDisplayMode(openConfig) === "modal";
1783
1784
  }
1784
1785
  function isStepperEnabled(config, openConfig) {
1785
- var _a;
1786
+ var _a2;
1786
1787
  if ((openConfig == null ? void 0 : openConfig.showStepper) !== void 0) return openConfig.showStepper;
1787
- const rightPanel = (_a = resolveLayoutConfig(config)) == null ? void 0 : _a.rightPanel;
1788
+ const rightPanel = (_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.rightPanel;
1788
1789
  if ((rightPanel == null ? void 0 : rightPanel.showStepper) !== void 0) return rightPanel.showStepper;
1789
1790
  return true;
1790
1791
  }
@@ -1798,8 +1799,8 @@ var IKEmbeddableFormBundle = function(exports) {
1798
1799
  return trimmed || void 0;
1799
1800
  }
1800
1801
  function getFormIntro(config, openConfig) {
1801
- var _a, _b;
1802
- const panelIntro = (_b = (_a = resolveLayoutConfig(config)) == null ? void 0 : _a.rightPanel) == null ? void 0 : _b.formIntro;
1802
+ var _a2, _b2;
1803
+ const panelIntro = (_b2 = (_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.rightPanel) == null ? void 0 : _b2.formIntro;
1803
1804
  const runtimeIntro = openConfig == null ? void 0 : openConfig.formIntro;
1804
1805
  const intro = {
1805
1806
  tag: trimIntroField((runtimeIntro == null ? void 0 : runtimeIntro.tag) ?? (panelIntro == null ? void 0 : panelIntro.tag)),
@@ -1812,10 +1813,10 @@ var IKEmbeddableFormBundle = function(exports) {
1812
1813
  return intro;
1813
1814
  }
1814
1815
  function shouldShowFormIntro(config, openConfig, progressSteps, currentStepId) {
1815
- var _a;
1816
+ var _a2;
1816
1817
  const intro = getFormIntro(config, openConfig);
1817
1818
  if (!intro) return false;
1818
- const firstFormStepId = (_a = progressSteps.find((s2) => s2.type === "form")) == null ? void 0 : _a.id;
1819
+ const firstFormStepId = (_a2 = progressSteps.find((s2) => s2.type === "form")) == null ? void 0 : _a2.id;
1819
1820
  return firstFormStepId === currentStepId;
1820
1821
  }
1821
1822
  const warnedStyleVariants = /* @__PURE__ */ new Set();
@@ -1833,16 +1834,16 @@ var IKEmbeddableFormBundle = function(exports) {
1833
1834
  return null;
1834
1835
  }
1835
1836
  function getStyleVariant(config, openConfig) {
1836
- var _a;
1837
- return normalizeStyleVariant(openConfig == null ? void 0 : openConfig.styleVariant) ?? normalizeStyleVariant((_a = resolveLayoutConfig(config)) == null ? void 0 : _a.styleVariant) ?? DEFAULT_STYLE_VARIANT;
1837
+ var _a2;
1838
+ return normalizeStyleVariant(openConfig == null ? void 0 : openConfig.styleVariant) ?? normalizeStyleVariant((_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.styleVariant) ?? DEFAULT_STYLE_VARIANT;
1838
1839
  }
1839
1840
  function getCardChrome(config) {
1840
- var _a;
1841
- return ((_a = resolveLayoutConfig(config)) == null ? void 0 : _a.card) ?? {};
1841
+ var _a2;
1842
+ return ((_a2 = resolveLayoutConfig(config)) == null ? void 0 : _a2.card) ?? {};
1842
1843
  }
1843
1844
  function getDesignTokens(config, openConfig) {
1844
- var _a;
1845
- return { ...((_a = config.theme) == null ? void 0 : _a.tokens) ?? {}, ...(openConfig == null ? void 0 : openConfig.themeTokens) ?? {} };
1845
+ var _a2;
1846
+ return { ...((_a2 = config.theme) == null ? void 0 : _a2.tokens) ?? {}, ...(openConfig == null ? void 0 : openConfig.themeTokens) ?? {} };
1846
1847
  }
1847
1848
  function shouldShowContinueBrowsingButton(openConfig) {
1848
1849
  if ((openConfig == null ? void 0 : openConfig.showContinueBrowsingButton) !== void 0) {
@@ -2138,13 +2139,13 @@ var IKEmbeddableFormBundle = function(exports) {
2138
2139
  return this.resolveLinearNext(currentStep, allSteps, formData);
2139
2140
  }
2140
2141
  resolveLinearNext(currentStep, allSteps, formData) {
2141
- var _a;
2142
+ var _a2;
2142
2143
  const visible = this.resolveVisibleSteps(allSteps, formData);
2143
2144
  const idx = visible.findIndex((s2) => s2.id === currentStep.id);
2144
2145
  let nextIdx = idx + 1;
2145
2146
  while (nextIdx < visible.length) {
2146
2147
  const next = visible[nextIdx];
2147
- if (next.type === "auto" && ((_a = next.autoExecute) == null ? void 0 : _a.background) && next.autoExecute.onSuccess) {
2148
+ if (next.type === "auto" && ((_a2 = next.autoExecute) == null ? void 0 : _a2.background) && next.autoExecute.onSuccess) {
2148
2149
  return next.autoExecute.onSuccess;
2149
2150
  }
2150
2151
  return next.id;
@@ -2450,10 +2451,10 @@ var IKEmbeddableFormBundle = function(exports) {
2450
2451
  }
2451
2452
  }
2452
2453
  async function sha256Hex(value) {
2453
- var _a;
2454
+ var _a2;
2454
2455
  const normalized = value.trim().toLowerCase();
2455
2456
  if (!normalized) return "";
2456
- const subtle = (_a = globalThis.crypto) == null ? void 0 : _a.subtle;
2457
+ const subtle = (_a2 = globalThis.crypto) == null ? void 0 : _a2.subtle;
2457
2458
  if (!subtle) return "";
2458
2459
  try {
2459
2460
  const bytes = new TextEncoder().encode(normalized);
@@ -2465,7 +2466,7 @@ var IKEmbeddableFormBundle = function(exports) {
2465
2466
  }
2466
2467
  class FormEngine {
2467
2468
  constructor(config, openConfig, apiClient2, analytics2) {
2468
- var _a;
2469
+ var _a2;
2469
2470
  this.listeners = /* @__PURE__ */ new Set();
2470
2471
  this.slotsPrefetchPromise = null;
2471
2472
  this.slotBookingPromise = null;
@@ -2477,7 +2478,7 @@ var IKEmbeddableFormBundle = function(exports) {
2477
2478
  this.analytics = analytics2;
2478
2479
  this.fieldLabels = buildFieldLabelMap(config);
2479
2480
  this.fieldOwnerSteps = buildFieldOwnerMap(config);
2480
- this.valueFields = ((_a = config.analytics) == null ? void 0 : _a.valueFields) ?? ANALYTICS_VALUE_FIELDS;
2481
+ this.valueFields = ((_a2 = config.analytics) == null ? void 0 : _a2.valueFields) ?? ANALYTICS_VALUE_FIELDS;
2481
2482
  const initialFormData = this.buildInitialFormData();
2482
2483
  const firstStep = this.resolveFirstStep(initialFormData);
2483
2484
  this.state = {
@@ -2570,11 +2571,11 @@ var IKEmbeddableFormBundle = function(exports) {
2570
2571
  return () => this.listeners.delete(listener);
2571
2572
  }
2572
2573
  async start() {
2573
- var _a;
2574
+ var _a2;
2574
2575
  resetFormValues();
2575
2576
  await this.ensureEmailDigest();
2576
2577
  this.analytics.trackFormOpen(this.config.id, this.openConfig.variant);
2577
- const dataClickId = (_a = this.openConfig.dataClickId) == null ? void 0 : _a.trim();
2578
+ const dataClickId = (_a2 = this.openConfig.dataClickId) == null ? void 0 : _a2.trim();
2578
2579
  if (dataClickId) {
2579
2580
  void trackClickActivity(dataClickId, {});
2580
2581
  }
@@ -2709,8 +2710,8 @@ var IKEmbeddableFormBundle = function(exports) {
2709
2710
  return Boolean(timeSlot || linkedIn || resume);
2710
2711
  }
2711
2712
  resolveStepApis(step, stepFormData) {
2712
- var _a;
2713
- if ((_a = step.apis) == null ? void 0 : _a.length) {
2713
+ var _a2;
2714
+ if ((_a2 = step.apis) == null ? void 0 : _a2.length) {
2714
2715
  return step.apis.filter((api) => {
2715
2716
  if (!api.requiresField) return true;
2716
2717
  const value = this.state.formData[api.requiresField] ?? stepFormData[api.requiresField];
@@ -2817,8 +2818,8 @@ var IKEmbeddableFormBundle = function(exports) {
2817
2818
  hasSlotBookingStep() {
2818
2819
  return this.stepResolver.resolveVisibleSteps(this.config.steps, this.state.formData).some(
2819
2820
  (step) => {
2820
- var _a;
2821
- return step.id === "slot-selection" || ((_a = step.autoExecute) == null ? void 0 : _a.action) === "book-webinar-slot";
2821
+ var _a2;
2822
+ return step.id === "slot-selection" || ((_a2 = step.autoExecute) == null ? void 0 : _a2.action) === "book-webinar-slot";
2822
2823
  }
2823
2824
  );
2824
2825
  }
@@ -2887,10 +2888,10 @@ var IKEmbeddableFormBundle = function(exports) {
2887
2888
  await this.ensureSlotsReady(step);
2888
2889
  }
2889
2890
  async runStepSuccess(step, response) {
2890
- var _a;
2891
+ var _a2;
2891
2892
  if (step.onStepSuccess === "webinar-contact-success") {
2892
2893
  const res = response;
2893
- const sfUuid = (res == null ? void 0 : res.salesforce_uuid) ?? ((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.salesforce_uuid);
2894
+ const sfUuid = (res == null ? void 0 : res.salesforce_uuid) ?? ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.salesforce_uuid);
2894
2895
  if (sfUuid) {
2895
2896
  persistSalesforceUuid(String(sfUuid));
2896
2897
  this.mergeFormData({ salesforceUuid: sfUuid });
@@ -2989,7 +2990,7 @@ var IKEmbeddableFormBundle = function(exports) {
2989
2990
  }
2990
2991
  /** Terminal bookkeeping for a finished flow — idempotent per session. */
2991
2992
  markFormComplete(stepId, response) {
2992
- var _a, _b;
2993
+ var _a2, _b2;
2993
2994
  if (this.state.isComplete) return;
2994
2995
  const result = {
2995
2996
  success: true,
@@ -3005,11 +3006,11 @@ var IKEmbeddableFormBundle = function(exports) {
3005
3006
  this.openConfig.variant,
3006
3007
  this.recordValues()
3007
3008
  );
3008
- (_b = (_a = this.openConfig).onSuccess) == null ? void 0 : _b.call(_a, result);
3009
+ (_b2 = (_a2 = this.openConfig).onSuccess) == null ? void 0 : _b2.call(_a2, result);
3009
3010
  }
3010
3011
  async finalSubmit() {
3011
- var _a, _b, _c;
3012
- if (!((_a = this.config.api) == null ? void 0 : _a.payloadBuilder)) return;
3012
+ var _a2, _b2, _c2;
3013
+ if (!((_a2 = this.config.api) == null ? void 0 : _a2.payloadBuilder)) return;
3013
3014
  const enrichedData = this.enrichFormDataForApi();
3014
3015
  const { mappedData, response } = await this.apiClient.execute(
3015
3016
  this.config.api,
@@ -3030,7 +3031,7 @@ var IKEmbeddableFormBundle = function(exports) {
3030
3031
  this.recordValues()
3031
3032
  );
3032
3033
  this.setState({ isComplete: true });
3033
- (_c = (_b = this.openConfig).onSuccess) == null ? void 0 : _c.call(_b, result);
3034
+ (_c2 = (_b2 = this.openConfig).onSuccess) == null ? void 0 : _c2.call(_b2, result);
3034
3035
  }
3035
3036
  navigateTo(stepId) {
3036
3037
  const next = this.getStepById(stepId);
@@ -3083,8 +3084,8 @@ var IKEmbeddableFormBundle = function(exports) {
3083
3084
  if (fromIdx === -1 || toIdx === -1 || toIdx <= fromIdx + 1) return;
3084
3085
  const autoStep = visible.slice(fromIdx + 1, toIdx).find(
3085
3086
  (step) => {
3086
- var _a;
3087
- return this.stepResolver.isAutoStep(step) && ((_a = step.autoExecute) == null ? void 0 : _a.background) && step.autoExecute.action === "book-webinar-slot";
3087
+ var _a2;
3088
+ return this.stepResolver.isAutoStep(step) && ((_a2 = step.autoExecute) == null ? void 0 : _a2.background) && step.autoExecute.action === "book-webinar-slot";
3088
3089
  }
3089
3090
  );
3090
3091
  if (!(autoStep == null ? void 0 : autoStep.autoExecute)) return;
@@ -3131,7 +3132,7 @@ var IKEmbeddableFormBundle = function(exports) {
3131
3132
  this.analytics.trackStepComplete(this.config.id, sourceStepId);
3132
3133
  }
3133
3134
  handleError(err, stepId) {
3134
- var _a, _b;
3135
+ var _a2, _b2;
3135
3136
  this.analytics.trackError(err, { stepId, formId: this.config.id });
3136
3137
  const error = err && typeof err === "object" && "code" in err ? err : {
3137
3138
  code: "UNKNOWN_ERROR",
@@ -3139,10 +3140,10 @@ var IKEmbeddableFormBundle = function(exports) {
3139
3140
  stepId
3140
3141
  };
3141
3142
  this.setState({ error });
3142
- (_b = (_a = this.openConfig).onError) == null ? void 0 : _b.call(_a, error);
3143
+ (_b2 = (_a2 = this.openConfig).onError) == null ? void 0 : _b2.call(_a2, error);
3143
3144
  }
3144
3145
  fireStepAnalytics(step) {
3145
- var _a;
3146
+ var _a2;
3146
3147
  const progressSteps = this.getProgressSteps();
3147
3148
  const stepIndex = progressSteps.findIndex((s2) => s2.id === step.id);
3148
3149
  recordStepId(step.id);
@@ -3160,7 +3161,7 @@ var IKEmbeddableFormBundle = function(exports) {
3160
3161
  );
3161
3162
  }
3162
3163
  const values = this.recordValues();
3163
- (_a = step.analyticsEvents) == null ? void 0 : _a.forEach((event) => {
3164
+ (_a2 = step.analyticsEvents) == null ? void 0 : _a2.forEach((event) => {
3164
3165
  this.analytics.track({
3165
3166
  ...event,
3166
3167
  metadata: { ...event.metadata, [FORM_VALUES_DL_KEY]: values }
@@ -3212,8 +3213,8 @@ var IKEmbeddableFormBundle = function(exports) {
3212
3213
  Object.assign(data, this.openConfig.prefilledValues);
3213
3214
  }
3214
3215
  this.config.steps.forEach((step) => {
3215
- var _a;
3216
- (_a = step.fields) == null ? void 0 : _a.forEach((field) => {
3216
+ var _a2;
3217
+ (_a2 = step.fields) == null ? void 0 : _a2.forEach((field) => {
3217
3218
  if (field.defaultValue !== void 0 && data[field.name] === void 0) {
3218
3219
  data[field.name] = field.defaultValue;
3219
3220
  }
@@ -3520,9 +3521,9 @@ var IKEmbeddableFormBundle = function(exports) {
3520
3521
  };
3521
3522
  }
3522
3523
  function resolveOptionLabel(options, value) {
3523
- var _a;
3524
+ var _a2;
3524
3525
  if (!value) return "";
3525
- const resolved = ((_a = options.find((option) => option.value === value)) == null ? void 0 : _a.label) ?? value;
3526
+ const resolved = ((_a2 = options.find((option) => option.value === value)) == null ? void 0 : _a2.label) ?? value;
3526
3527
  return normalizeAsciiDash(resolved);
3527
3528
  }
3528
3529
  function normalizeExperienceForApi(value) {
@@ -3830,8 +3831,8 @@ var IKEmbeddableFormBundle = function(exports) {
3830
3831
  captureError(error, context);
3831
3832
  }
3832
3833
  trackFormOpen(formId, variant) {
3833
- var _a;
3834
- const visitorId = (_a = getWebinarContextOrNull()) == null ? void 0 : _a.visitorId;
3834
+ var _a2;
3835
+ const visitorId = (_a2 = getWebinarContextOrNull()) == null ? void 0 : _a2.visitorId;
3835
3836
  if (visitorId) setClarityContext(visitorId);
3836
3837
  this.track({
3837
3838
  name: "form_open",
@@ -3937,8 +3938,8 @@ var IKEmbeddableFormBundle = function(exports) {
3937
3938
  return merged;
3938
3939
  }
3939
3940
  function isStepInVariantScope(step, variantId) {
3940
- var _a;
3941
- if (!((_a = step.variantScope) == null ? void 0 : _a.length)) return true;
3941
+ var _a2;
3942
+ if (!((_a2 = step.variantScope) == null ? void 0 : _a2.length)) return true;
3942
3943
  return step.variantScope.includes(variantId);
3943
3944
  }
3944
3945
  function mergeVariantConfig(base, variantId, overrides) {
@@ -4581,7 +4582,7 @@ var IKEmbeddableFormBundle = function(exports) {
4581
4582
  return handleResult(ctx, result);
4582
4583
  }
4583
4584
  "~validate"(data) {
4584
- var _a, _b;
4585
+ var _a2, _b2;
4585
4586
  const ctx = {
4586
4587
  common: {
4587
4588
  issues: [],
@@ -4602,7 +4603,7 @@ var IKEmbeddableFormBundle = function(exports) {
4602
4603
  issues: ctx.common.issues
4603
4604
  };
4604
4605
  } catch (err) {
4605
- if ((_b = (_a = err == null ? void 0 : err.message) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("encountered")) {
4606
+ if ((_b2 = (_a2 = err == null ? void 0 : err.message) == null ? void 0 : _a2.toLowerCase()) == null ? void 0 : _b2.includes("encountered")) {
4606
4607
  this["~standard"].async = true;
4607
4608
  }
4608
4609
  ctx.common = {
@@ -6342,8 +6343,8 @@ var IKEmbeddableFormBundle = function(exports) {
6342
6343
  unknownKeys: "strict",
6343
6344
  ...message !== void 0 ? {
6344
6345
  errorMap: (issue, ctx) => {
6345
- var _a, _b;
6346
- const defaultError = ((_b = (_a = this._def).errorMap) == null ? void 0 : _b.call(_a, issue, ctx).message) ?? ctx.defaultError;
6346
+ var _a2, _b2;
6347
+ const defaultError = ((_b2 = (_a2 = this._def).errorMap) == null ? void 0 : _b2.call(_a2, issue, ctx).message) ?? ctx.defaultError;
6347
6348
  if (issue.code === "unrecognized_keys")
6348
6349
  return {
6349
6350
  message: errorUtil.errToObj(message).message ?? defaultError
@@ -7963,8 +7964,8 @@ var IKEmbeddableFormBundle = function(exports) {
7963
7964
  return resolved;
7964
7965
  }
7965
7966
  findBundledVariantOverrides(config, variantId) {
7966
- var _a, _b;
7967
- return (_b = (_a = config.variants) == null ? void 0 : _a.find((v2) => v2.id === variantId)) == null ? void 0 : _b.overrides;
7967
+ var _a2, _b2;
7968
+ return (_b2 = (_a2 = config.variants) == null ? void 0 : _a2.find((v2) => v2.id === variantId)) == null ? void 0 : _b2.overrides;
7968
7969
  }
7969
7970
  applyPrefilledValues(config, values) {
7970
7971
  const clone = this.deepClone(config);
@@ -9257,17 +9258,17 @@ var IKEmbeddableFormBundle = function(exports) {
9257
9258
  this._addCountryCode(c3.iso2, c3.dialCode, c3.priority);
9258
9259
  }
9259
9260
  for (var _i = 0; _i < this.countries.length; _i++) {
9260
- var _c = this.countries[_i];
9261
- if (_c.areaCodes) {
9262
- var rootCountryCode = this.countryCodes[_c.dialCode][0];
9263
- for (var j2 = 0; j2 < _c.areaCodes.length; j2++) {
9264
- var areaCode = _c.areaCodes[j2];
9261
+ var _c2 = this.countries[_i];
9262
+ if (_c2.areaCodes) {
9263
+ var rootCountryCode = this.countryCodes[_c2.dialCode][0];
9264
+ for (var j2 = 0; j2 < _c2.areaCodes.length; j2++) {
9265
+ var areaCode = _c2.areaCodes[j2];
9265
9266
  for (var k2 = 1; k2 < areaCode.length; k2++) {
9266
- var partialDialCode = _c.dialCode + areaCode.substr(0, k2);
9267
+ var partialDialCode = _c2.dialCode + areaCode.substr(0, k2);
9267
9268
  this._addCountryCode(rootCountryCode, partialDialCode);
9268
- this._addCountryCode(_c.iso2, partialDialCode);
9269
+ this._addCountryCode(_c2.iso2, partialDialCode);
9269
9270
  }
9270
- this._addCountryCode(_c.iso2, _c.dialCode + areaCode);
9271
+ this._addCountryCode(_c2.iso2, _c2.dialCode + areaCode);
9271
9272
  }
9272
9273
  }
9273
9274
  }
@@ -15930,7 +15931,7 @@ var IKEmbeddableFormBundle = function(exports) {
15930
15931
  }
15931
15932
  }));
15932
15933
  y(() => {
15933
- var _a;
15934
+ var _a2;
15934
15935
  const container = containerRef.current;
15935
15936
  if (!container || inputRef.current) return;
15936
15937
  const input = document.createElement("input");
@@ -15943,7 +15944,7 @@ var IKEmbeddableFormBundle = function(exports) {
15943
15944
  if (dataTestId) input.dataset.testid = dataTestId;
15944
15945
  container.appendChild(input);
15945
15946
  inputRef.current = input;
15946
- const initialCountry = (_a = initialCountryRef.current) == null ? void 0 : _a.toLowerCase();
15947
+ const initialCountry = (_a2 = initialCountryRef.current) == null ? void 0 : _a2.toLowerCase();
15947
15948
  const iti = intlTelInput$1(input, {
15948
15949
  initialCountry: initialCountry ?? "auto",
15949
15950
  geoIpLookup: initialCountry ? void 0 : (callback) => {
@@ -15956,10 +15957,10 @@ var IKEmbeddableFormBundle = function(exports) {
15956
15957
  });
15957
15958
  itiRef.current = iti;
15958
15959
  const emitCountryChange = () => {
15959
- var _a2;
15960
+ var _a3;
15960
15961
  const data = iti.getSelectedCountryData();
15961
15962
  if (!(data == null ? void 0 : data.iso2)) return;
15962
- (_a2 = onCountryChangeRef.current) == null ? void 0 : _a2.call(onCountryChangeRef, `+${data.dialCode}`, data.iso2);
15963
+ (_a3 = onCountryChangeRef.current) == null ? void 0 : _a3.call(onCountryChangeRef, `+${data.dialCode}`, data.iso2);
15963
15964
  };
15964
15965
  const handleInput = () => {
15965
15966
  const digits = input.value.replace(/\D/g, "");
@@ -15971,12 +15972,12 @@ var IKEmbeddableFormBundle = function(exports) {
15971
15972
  });
15972
15973
  };
15973
15974
  const handleBlur = (event) => {
15974
- var _a2;
15975
- (_a2 = onBlurRef.current) == null ? void 0 : _a2.call(onBlurRef, event);
15975
+ var _a3;
15976
+ (_a3 = onBlurRef.current) == null ? void 0 : _a3.call(onBlurRef, event);
15976
15977
  };
15977
15978
  const handleFocus = (event) => {
15978
- var _a2;
15979
- (_a2 = onFocusRef.current) == null ? void 0 : _a2.call(onFocusRef, event);
15979
+ var _a3;
15980
+ (_a3 = onFocusRef.current) == null ? void 0 : _a3.call(onFocusRef, event);
15980
15981
  };
15981
15982
  const handleOpen = () => container.classList.add("ik-phone-input--open");
15982
15983
  const handleClose = () => container.classList.remove("ik-phone-input--open");
@@ -16571,10 +16572,10 @@ var IKEmbeddableFormBundle = function(exports) {
16571
16572
  "data-testid": leftPanelTestId(panelId, "progress-tracker"),
16572
16573
  "aria-label": "Registration progress groups",
16573
16574
  children: groups.map((group, idx) => {
16574
- var _a;
16575
+ var _a2;
16575
16576
  const isActive = idx === activeGroupIndex;
16576
16577
  const isPassed = idx < activeGroupIndex;
16577
- const isPending = isPassed && !!((_a = group.pendingOnStepIds) == null ? void 0 : _a.includes(currentStepId));
16578
+ const isPending = isPassed && !!((_a2 = group.pendingOnStepIds) == null ? void 0 : _a2.includes(currentStepId));
16578
16579
  const isComplete = isPassed && !isPending;
16579
16580
  const isUpcoming = !isActive && !isComplete && !isPending;
16580
16581
  const isLast = idx === groups.length - 1;
@@ -16817,9 +16818,9 @@ var IKEmbeddableFormBundle = function(exports) {
16817
16818
  firstSlotDateLabel,
16818
16819
  closeButton
16819
16820
  }) {
16820
- var _a;
16821
+ var _a2;
16821
16822
  const testBase = modalTestId2 ? modalSectionTestId(modalTestId2, "form-intro") : void 0;
16822
- const badges = ((_a = intro.badges) == null ? void 0 : _a.filter((badge) => badge.show !== false)) ?? [];
16823
+ const badges = ((_a2 = intro.badges) == null ? void 0 : _a2.filter((badge) => badge.show !== false)) ?? [];
16823
16824
  return /* @__PURE__ */ u$1(
16824
16825
  "div",
16825
16826
  {
@@ -17174,7 +17175,7 @@ var IKEmbeddableFormBundle = function(exports) {
17174
17175
  }
17175
17176
  }
17176
17177
  function ensureFontLoaded(tokens) {
17177
- var _a, _b;
17178
+ var _a2, _b2;
17178
17179
  const clean = sanitizeDesignTokens(tokens);
17179
17180
  const url = clean.fontUrl;
17180
17181
  if (!url || loadedFontUrls.has(url)) return;
@@ -17184,7 +17185,7 @@ var IKEmbeddableFormBundle = function(exports) {
17184
17185
  loadFontStylesheet(url);
17185
17186
  return;
17186
17187
  }
17187
- const family = clean.fontName ?? ((_b = (_a = clean.fontFamily) == null ? void 0 : _a.split(",")[0]) == null ? void 0 : _b.replace(/['"]/g, "").trim());
17188
+ const family = clean.fontName ?? ((_b2 = (_a2 = clean.fontFamily) == null ? void 0 : _a2.split(",")[0]) == null ? void 0 : _b2.replace(/['"]/g, "").trim());
17188
17189
  if (!family) {
17189
17190
  console.warn(
17190
17191
  "[IKForm] design token `fontUrl` points at a font file but neither `fontName` nor `fontFamily` was supplied — the font cannot be registered."
@@ -17454,7 +17455,7 @@ var IKEmbeddableFormBundle = function(exports) {
17454
17455
  modalTestId: modalTestId2,
17455
17456
  children
17456
17457
  }) {
17457
- var _a;
17458
+ var _a2;
17458
17459
  const chrome = T$1(() => resolveCardChrome(getCardChrome(config)), [config]);
17459
17460
  const tokens = T$1(() => getDesignTokens(config, openConfig), [config, openConfig]);
17460
17461
  const showCloseButton = shouldShowCloseButton(openConfig);
@@ -17463,7 +17464,7 @@ var IKEmbeddableFormBundle = function(exports) {
17463
17464
  }, [tokens.fontUrl, tokens.fontName, tokens.fontFamily]);
17464
17465
  const currentStep = config.steps.find((step) => step.id === currentStepId);
17465
17466
  const isTerminalStep = (currentStep == null ? void 0 : currentStep.type) === "success" || (currentStep == null ? void 0 : currentStep.type) === "error";
17466
- const showCapsules = chrome.capsules.show !== false && (((_a = chrome.capsules.items) == null ? void 0 : _a.length) ?? 0) > 0;
17467
+ const showCapsules = chrome.capsules.show !== false && (((_a2 = chrome.capsules.items) == null ? void 0 : _a2.length) ?? 0) > 0;
17467
17468
  const showTabs = chrome.tabs.show !== false && !isTerminalStep;
17468
17469
  const showFooterNote = chrome.footerNote.show !== false && !!chrome.footerNote.text;
17469
17470
  const showCountdown = chrome.countdown.show !== false;
@@ -17544,11 +17545,11 @@ var IKEmbeddableFormBundle = function(exports) {
17544
17545
  onClose,
17545
17546
  showContinueButton = true
17546
17547
  }) {
17547
- var _a;
17548
+ var _a2;
17548
17549
  const slots = state.formData.slots ?? [];
17549
17550
  const slotId = state.formData.slotId;
17550
17551
  const slot = slots.find((s2) => s2.id === slotId) ?? slots[0];
17551
- const timezone = formatTimezoneWithOffset((_a = getWebinarContextOrNull()) == null ? void 0 : _a.userTimezone);
17552
+ const timezone = formatTimezoneWithOffset((_a2 = getWebinarContextOrNull()) == null ? void 0 : _a2.userTimezone);
17552
17553
  const { success } = resolveCardChrome(getCardChrome(config));
17553
17554
  const handleContinue = () => {
17554
17555
  onClose();
@@ -17582,7 +17583,7 @@ var IKEmbeddableFormBundle = function(exports) {
17582
17583
  ] });
17583
17584
  }
17584
17585
  function formatTimezoneWithOffset(timezone) {
17585
- var _a;
17586
+ var _a2;
17586
17587
  const tz = timezone ?? Intl.DateTimeFormat().resolvedOptions().timeZone;
17587
17588
  if (!tz) return null;
17588
17589
  try {
@@ -17590,7 +17591,7 @@ var IKEmbeddableFormBundle = function(exports) {
17590
17591
  timeZone: tz,
17591
17592
  timeZoneName: "longOffset"
17592
17593
  }).formatToParts(/* @__PURE__ */ new Date());
17593
- const raw = (_a = parts.find((p2) => p2.type === "timeZoneName")) == null ? void 0 : _a.value;
17594
+ const raw = (_a2 = parts.find((p2) => p2.type === "timeZoneName")) == null ? void 0 : _a2.value;
17594
17595
  if (!raw) return tz;
17595
17596
  const normalized = raw.replace(/GMT([+-])0?(\d+)/, "GMT$1$2");
17596
17597
  return `${tz} (${normalized})`;
@@ -17720,10 +17721,10 @@ var IKEmbeddableFormBundle = function(exports) {
17720
17721
  modalTestId: modalId,
17721
17722
  children
17722
17723
  }) {
17723
- var _a;
17724
+ var _a2;
17724
17725
  const currentStep = progressSteps.find((s2) => s2.id === currentStepId);
17725
17726
  const showProgress = shouldShowStepper(config, openConfig, progressSteps, currentStepId);
17726
- const maxWidth = ((_a = config.theme) == null ? void 0 : _a.modalMaxWidth) ?? "520px";
17727
+ const maxWidth = ((_a2 = config.theme) == null ? void 0 : _a2.modalMaxWidth) ?? "520px";
17727
17728
  return /* @__PURE__ */ u$1(
17728
17729
  "div",
17729
17730
  {
@@ -19828,13 +19829,13 @@ var IKEmbeddableFormBundle = function(exports) {
19828
19829
  }
19829
19830
  }, [control, formState.isDirty]);
19830
19831
  gn.useEffect(() => {
19831
- var _a;
19832
+ var _a2;
19832
19833
  if (props.values && !deepEqual(props.values, _values.current)) {
19833
19834
  control._reset(props.values, {
19834
19835
  keepFieldsRef: true,
19835
19836
  ...control._options.resetOptions
19836
19837
  });
19837
- if (!((_a = control._options.resetOptions) === null || _a === void 0 ? void 0 : _a.keepIsValid)) {
19838
+ if (!((_a2 = control._options.resetOptions) === null || _a2 === void 0 ? void 0 : _a2.keepIsValid)) {
19838
19839
  control._setValid();
19839
19840
  }
19840
19841
  _values.current = props.values;
@@ -19914,8 +19915,8 @@ var IKEmbeddableFormBundle = function(exports) {
19914
19915
  defaultValue: field.defaultValue ?? "",
19915
19916
  rules,
19916
19917
  render: ({ field: rhfField, fieldState }) => {
19917
- var _a, _b, _c;
19918
- const errorMsg = (_a = fieldState.error) == null ? void 0 : _a.message;
19918
+ var _a2, _b2, _c2;
19919
+ const errorMsg = (_a2 = fieldState.error) == null ? void 0 : _a2.message;
19919
19920
  const withFieldInteract = (props) => ({
19920
19921
  ...props,
19921
19922
  onFocus: (e2) => {
@@ -19952,7 +19953,7 @@ var IKEmbeddableFormBundle = function(exports) {
19952
19953
  }
19953
19954
  );
19954
19955
  case "tel":
19955
- if ((_b = field.props) == null ? void 0 : _b.phoneInput) {
19956
+ if ((_b2 = field.props) == null ? void 0 : _b2.phoneInput) {
19956
19957
  const { ref: _phoneFieldRef, ...phoneControllerField } = rhfField;
19957
19958
  return /* @__PURE__ */ u$1(
19958
19959
  PhoneInput,
@@ -20012,7 +20013,7 @@ var IKEmbeddableFormBundle = function(exports) {
20012
20013
  onFieldInteract();
20013
20014
  rhfField.onChange(value);
20014
20015
  },
20015
- layout: ((_c = field.props) == null ? void 0 : _c.layout) ?? "card",
20016
+ layout: ((_c2 = field.props) == null ? void 0 : _c2.layout) ?? "card",
20016
20017
  "data-testid": fieldControlTestId(scope, field.name, "radio"),
20017
20018
  optionTestId: (optionValue) => radioOptionTestId(scope, field.name, optionValue)
20018
20019
  }
@@ -20063,17 +20064,17 @@ var IKEmbeddableFormBundle = function(exports) {
20063
20064
  }
20064
20065
  }
20065
20066
  function resolveFieldRules(field, phoneFieldProps) {
20066
- var _a, _b, _c;
20067
- const isIntlPhoneField = field.type === "tel" && Boolean((_a = field.props) == null ? void 0 : _a.phoneInput);
20067
+ var _a2, _b2, _c2;
20068
+ const isIntlPhoneField = field.type === "tel" && Boolean((_a2 = field.props) == null ? void 0 : _a2.phoneInput);
20068
20069
  const rules = buildRules(field.validation ?? [], { intlPhone: isIntlPhoneField });
20069
20070
  if (!isIntlPhoneField) return rules;
20070
- const phoneMessage = ((_c = (_b = field.validation) == null ? void 0 : _b.find((rule) => rule.type === "phone" || rule.type === "pattern")) == null ? void 0 : _c.message) ?? "Enter a valid phone number.";
20071
+ const phoneMessage = ((_c2 = (_b2 = field.validation) == null ? void 0 : _b2.find((rule) => rule.type === "phone" || rule.type === "pattern")) == null ? void 0 : _c2.message) ?? "Enter a valid phone number.";
20071
20072
  return {
20072
20073
  ...rules,
20073
20074
  validate: (value) => {
20074
- var _a2, _b2;
20075
+ var _a3, _b3;
20075
20076
  if (value == null || String(value).trim() === "") return true;
20076
- if (!((_b2 = (_a2 = phoneFieldProps == null ? void 0 : phoneFieldProps.inputRef) == null ? void 0 : _a2.current) == null ? void 0 : _b2.isValidNumber())) return phoneMessage;
20077
+ if (!((_b3 = (_a3 = phoneFieldProps == null ? void 0 : phoneFieldProps.inputRef) == null ? void 0 : _a3.current) == null ? void 0 : _b3.isValidNumber())) return phoneMessage;
20077
20078
  return true;
20078
20079
  }
20079
20080
  };
@@ -20127,11 +20128,11 @@ var IKEmbeddableFormBundle = function(exports) {
20127
20128
  config,
20128
20129
  onNext
20129
20130
  }) {
20130
- var _a, _b;
20131
+ var _a2, _b2;
20131
20132
  const privacyPolicyUrl = getRightPanel(config).privacyPolicyUrl;
20132
20133
  const ctx = getWebinarContextOrNull();
20133
20134
  const defaultPhoneCode = state.formData.phoneCode || (ctx ? countryCodeToDialCode(ctx.vCountryCode) : "+91");
20134
- const defaultCountryIso = state.formData.phoneCountryIso || ((_a = ctx == null ? void 0 : ctx.vCountryCode) == null ? void 0 : _a.toLowerCase()) || "in";
20135
+ const defaultCountryIso = state.formData.phoneCountryIso || ((_a2 = ctx == null ? void 0 : ctx.vCountryCode) == null ? void 0 : _a2.toLowerCase()) || "in";
20135
20136
  const phoneInputRef = A$1(null);
20136
20137
  const {
20137
20138
  control,
@@ -20154,10 +20155,10 @@ var IKEmbeddableFormBundle = function(exports) {
20154
20155
  [setValue]
20155
20156
  );
20156
20157
  const onSubmit = (data) => {
20157
- var _a2;
20158
+ var _a3;
20158
20159
  const phoneCode = String(data.phoneCode ?? defaultPhoneCode);
20159
20160
  const phoneDigits = String(data.phone ?? "").replace(/\D/g, "");
20160
- const phoneNumberFull = ((_a2 = phoneInputRef.current) == null ? void 0 : _a2.getE164Number()) || `${phoneCode}${phoneDigits}`;
20161
+ const phoneNumberFull = ((_a3 = phoneInputRef.current) == null ? void 0 : _a3.getE164Number()) || `${phoneCode}${phoneDigits}`;
20161
20162
  const fullName = String(data.fullName ?? "").trim();
20162
20163
  const nameParts = fullName.split(/\s+/);
20163
20164
  onNext({
@@ -20178,7 +20179,7 @@ var IKEmbeddableFormBundle = function(exports) {
20178
20179
  class: "ik-gql-step-shell",
20179
20180
  children: [
20180
20181
  /* @__PURE__ */ u$1(FormStepFieldsRegion, { scope: step.id, class: "flex flex-col gap-4 py-2", children: [
20181
- (_b = step.fields) == null ? void 0 : _b.map((field) => /* @__PURE__ */ u$1(
20182
+ (_b2 = step.fields) == null ? void 0 : _b2.map((field) => /* @__PURE__ */ u$1(
20182
20183
  FieldRenderer,
20183
20184
  {
20184
20185
  field,
@@ -20239,9 +20240,9 @@ var IKEmbeddableFormBundle = function(exports) {
20239
20240
  );
20240
20241
  }
20241
20242
  function buildDefaultValues$2(step, formData) {
20242
- var _a;
20243
+ var _a2;
20243
20244
  const defaults = {};
20244
- (_a = step.fields) == null ? void 0 : _a.forEach((field) => {
20245
+ (_a2 = step.fields) == null ? void 0 : _a2.forEach((field) => {
20245
20246
  defaults[field.name] = formData[field.name] ?? field.defaultValue ?? "";
20246
20247
  });
20247
20248
  return defaults;
@@ -20249,6 +20250,7 @@ var IKEmbeddableFormBundle = function(exports) {
20249
20250
  function GqlSlotPickerStepForm({
20250
20251
  step,
20251
20252
  state,
20253
+ canGoBack,
20252
20254
  onNext,
20253
20255
  onBack,
20254
20256
  onSlotSelect
@@ -20314,11 +20316,11 @@ var IKEmbeddableFormBundle = function(exports) {
20314
20316
  role: "group",
20315
20317
  children: [
20316
20318
  /* @__PURE__ */ u$1(StepParagraph, { scope: step.id, name: "empty-title", class: "text-[16px] font-semibold text-ik-text-primary", children: "No slots available" }),
20317
- /* @__PURE__ */ u$1(StepParagraph, { scope: step.id, name: "empty-message", class: "text-sm text-[#354156]", children: "We could not load webinar slots. Please go back and try again." })
20319
+ /* @__PURE__ */ u$1(StepParagraph, { scope: step.id, name: "empty-message", class: "text-sm text-[#354156]", children: canGoBack ? "We could not load webinar slots. Please go back and try again." : "We could not load webinar slots. Please try again in a moment." })
20318
20320
  ]
20319
20321
  }
20320
20322
  ),
20321
- /* @__PURE__ */ u$1(
20323
+ canGoBack && /* @__PURE__ */ u$1(
20322
20324
  Button,
20323
20325
  {
20324
20326
  type: "button",
@@ -20380,7 +20382,7 @@ var IKEmbeddableFormBundle = function(exports) {
20380
20382
  }
20381
20383
  ),
20382
20384
  /* @__PURE__ */ u$1(FormStepActionsRegion, { scope: step.id, class: "ik-gql-action-row", children: [
20383
- /* @__PURE__ */ u$1(
20385
+ canGoBack && /* @__PURE__ */ u$1(
20384
20386
  "button",
20385
20387
  {
20386
20388
  type: "button",
@@ -20528,7 +20530,7 @@ var IKEmbeddableFormBundle = function(exports) {
20528
20530
  onNext,
20529
20531
  onBack
20530
20532
  }) {
20531
- var _a;
20533
+ var _a2;
20532
20534
  const {
20533
20535
  control,
20534
20536
  handleSubmit,
@@ -20555,7 +20557,7 @@ var IKEmbeddableFormBundle = function(exports) {
20555
20557
  /* @__PURE__ */ u$1(StepParagraph, { scope: step.id, name: "title", class: "text-[16px] font-semibold leading-normal text-[#101828]", children: step.title }),
20556
20558
  step.subtitle && /* @__PURE__ */ u$1(StepParagraph, { scope: step.id, name: "subtitle", class: "text-[14px] font-normal leading-[1.5] text-black", children: step.subtitle })
20557
20559
  ] }),
20558
- /* @__PURE__ */ u$1(FormStepFieldsRegion, { scope: step.id, class: "flex flex-col gap-6", children: (_a = step.fields) == null ? void 0 : _a.map((field) => /* @__PURE__ */ u$1(
20560
+ /* @__PURE__ */ u$1(FormStepFieldsRegion, { scope: step.id, class: "flex flex-col gap-6", children: (_a2 = step.fields) == null ? void 0 : _a2.map((field) => /* @__PURE__ */ u$1(
20559
20561
  FieldRenderer,
20560
20562
  {
20561
20563
  field,
@@ -20618,9 +20620,9 @@ var IKEmbeddableFormBundle = function(exports) {
20618
20620
  ] });
20619
20621
  }
20620
20622
  function buildDefaultValues$1(step, formData) {
20621
- var _a;
20623
+ var _a2;
20622
20624
  const defaults = {};
20623
- (_a = step.fields) == null ? void 0 : _a.forEach((field) => {
20625
+ (_a2 = step.fields) == null ? void 0 : _a2.forEach((field) => {
20624
20626
  defaults[field.name] = formData[field.name] ?? field.defaultValue ?? "";
20625
20627
  });
20626
20628
  return defaults;
@@ -20836,22 +20838,22 @@ var IKEmbeddableFormBundle = function(exports) {
20836
20838
  resumeError ? "border-red-400" : ""
20837
20839
  ].join(" "),
20838
20840
  onClick: () => {
20839
- var _a;
20841
+ var _a2;
20840
20842
  reportFieldClickActivity("resumeFile");
20841
- (_a = fileInputRef.current) == null ? void 0 : _a.click();
20843
+ (_a2 = fileInputRef.current) == null ? void 0 : _a2.click();
20842
20844
  },
20843
20845
  onKeyDown: (e2) => {
20844
- var _a;
20846
+ var _a2;
20845
20847
  if (e2.key === "Enter" || e2.key === " ") {
20846
20848
  e2.preventDefault();
20847
- (_a = fileInputRef.current) == null ? void 0 : _a.click();
20849
+ (_a2 = fileInputRef.current) == null ? void 0 : _a2.click();
20848
20850
  }
20849
20851
  },
20850
20852
  onDragOver: (e2) => e2.preventDefault(),
20851
20853
  onDrop: (e2) => {
20852
- var _a, _b;
20854
+ var _a2, _b2;
20853
20855
  e2.preventDefault();
20854
- handleFileChange(((_b = (_a = e2.dataTransfer) == null ? void 0 : _a.files) == null ? void 0 : _b[0]) ?? null);
20856
+ handleFileChange(((_b2 = (_a2 = e2.dataTransfer) == null ? void 0 : _a2.files) == null ? void 0 : _b2[0]) ?? null);
20855
20857
  },
20856
20858
  role: "button",
20857
20859
  tabIndex: 0,
@@ -20868,8 +20870,8 @@ var IKEmbeddableFormBundle = function(exports) {
20868
20870
  "data-testid": stepTestId(scope, "resume-input"),
20869
20871
  "aria-invalid": !!resumeError,
20870
20872
  onChange: (e2) => {
20871
- var _a;
20872
- return handleFileChange(((_a = e2.target.files) == null ? void 0 : _a[0]) ?? null);
20873
+ var _a2;
20874
+ return handleFileChange(((_a2 = e2.target.files) == null ? void 0 : _a2[0]) ?? null);
20873
20875
  }
20874
20876
  }
20875
20877
  ),
@@ -21219,14 +21221,14 @@ var IKEmbeddableFormBundle = function(exports) {
21219
21221
  state,
21220
21222
  onClose
21221
21223
  }) {
21222
- var _a, _b, _c;
21224
+ var _a2, _b2, _c2;
21223
21225
  const inviteeStart = state.formData.inviteeStartTime;
21224
21226
  const eventStartTime = state.formData.eventStartTime;
21225
21227
  const slotParts = formatInviteeParts(inviteeStart, eventStartTime);
21226
21228
  const fallbackSlot = state.formData.slotDisplay ?? "";
21227
- const heading = (_a = step.success) == null ? void 0 : _a.heading;
21228
- const note = (_b = step.success) == null ? void 0 : _b.note;
21229
- const cta = (_c = step.success) == null ? void 0 : _c.cta;
21229
+ const heading = (_a2 = step.success) == null ? void 0 : _a2.heading;
21230
+ const note = (_b2 = step.success) == null ? void 0 : _b2.note;
21231
+ const cta = (_c2 = step.success) == null ? void 0 : _c2.cta;
21230
21232
  return /* @__PURE__ */ u$1(
21231
21233
  "div",
21232
21234
  {
@@ -21350,8 +21352,9 @@ var IKEmbeddableFormBundle = function(exports) {
21350
21352
  return;
21351
21353
  }
21352
21354
  if (cta.newTab) {
21353
- const tab = window.open(cta.href, "_blank", "noopener");
21355
+ const tab = window.open(cta.href, "_blank");
21354
21356
  if (tab) {
21357
+ tab.opener = null;
21355
21358
  onClose();
21356
21359
  return;
21357
21360
  }
@@ -21544,14 +21547,14 @@ var IKEmbeddableFormBundle = function(exports) {
21544
21547
  onClose,
21545
21548
  onSlotSelect
21546
21549
  }) {
21547
- var _a;
21550
+ var _a2;
21548
21551
  const handleBack = () => {
21549
21552
  reportBackClickActivity();
21550
21553
  onBack();
21551
21554
  };
21552
21555
  const showContinueBrowsingButton = shouldShowContinueBrowsingButton(openConfig);
21553
21556
  if (step.type === "auto") {
21554
- return /* @__PURE__ */ u$1(AutoStep, { step, error: ((_a = state.error) == null ? void 0 : _a.message) ?? null });
21557
+ return /* @__PURE__ */ u$1(AutoStep, { step, error: ((_a2 = state.error) == null ? void 0 : _a2.message) ?? null });
21555
21558
  }
21556
21559
  if (step.type === "success") {
21557
21560
  if (step.successStyle === "lead-magnet") {
@@ -21613,6 +21616,7 @@ var IKEmbeddableFormBundle = function(exports) {
21613
21616
  step,
21614
21617
  state,
21615
21618
  config,
21619
+ canGoBack,
21616
21620
  onNext,
21617
21621
  onBack: handleBack,
21618
21622
  onSlotSelect
@@ -21835,9 +21839,9 @@ var IKEmbeddableFormBundle = function(exports) {
21835
21839
  );
21836
21840
  }
21837
21841
  function buildDefaultValues(step, formData) {
21838
- var _a;
21842
+ var _a2;
21839
21843
  const defaults = {};
21840
- (_a = step.fields) == null ? void 0 : _a.forEach((field) => {
21844
+ (_a2 = step.fields) == null ? void 0 : _a2.forEach((field) => {
21841
21845
  defaults[field.name] = formData[field.name] ?? field.defaultValue ?? "";
21842
21846
  });
21843
21847
  return defaults;
@@ -22017,9 +22021,9 @@ var IKEmbeddableFormBundle = function(exports) {
22017
22021
  handleClose();
22018
22022
  };
22019
22023
  const registrationDeadline = T$1(() => {
22020
- var _a;
22024
+ var _a2;
22021
22025
  if (getStyleVariant(config, openConfig) !== "webinar-card") return null;
22022
- const leadMinutes = ((_a = getCardChrome(config).countdown) == null ? void 0 : _a.leadMinutes) ?? 0;
22026
+ const leadMinutes = ((_a2 = getCardChrome(config).countdown) == null ? void 0 : _a2.leadMinutes) ?? 0;
22023
22027
  return resolveRegistrationDeadline(state.formData.slots, leadMinutes);
22024
22028
  }, [config, openConfig, state.formData.slots]);
22025
22029
  const firstSlotDateLabel = T$1(
@@ -22531,7 +22535,10 @@ ${intlTelStyles}`;
22531
22535
  currentMountParent = null;
22532
22536
  }
22533
22537
  const GQL_GATE_CONFIG = {
22534
- eventName: "How to Nail your next Technical Interview",
22538
+ // Sent as `event_name` in every payload this gate produces (register / add-info /
22539
+ // qualifier) and used as the analytics label. Fixed for the lead-magnet flow so its
22540
+ // leads are attributable to it rather than folded in with the generic webinar form.
22541
+ eventName: "Accelerate your tech career in the AI-era",
22535
22542
  webinarType: "REGULAR",
22536
22543
  site: "organic",
22537
22544
  // No slot picker — this is a registration gate on a blog page, not a webinar booking.
@@ -22926,8 +22933,8 @@ ${leadMagnetStyles}`;
22926
22933
  return { uuid, sessionId: session_id, data };
22927
22934
  }
22928
22935
  async function submitAnalyse(uuid, sessionId, identity, timeoutMs = 3e4) {
22929
- var _a;
22930
- const job_role = (_a = identity.recommended_job_roles) == null ? void 0 : _a[0];
22936
+ var _a2;
22937
+ const job_role = (_a2 = identity.recommended_job_roles) == null ? void 0 : _a2[0];
22931
22938
  if (!job_role) {
22932
22939
  throw new Error("The analyser could not read that resume. Please try another file.");
22933
22940
  }
@@ -23066,10 +23073,10 @@ ${leadMagnetStyles}`;
23066
23073
  return;
23067
23074
  }
23068
23075
  setTimeout(() => {
23069
- var _a;
23076
+ var _a2;
23070
23077
  if (settled) return;
23071
23078
  settled = true;
23072
- (_a = claim.release()) == null ? void 0 : _a.close();
23079
+ (_a2 = claim.release()) == null ? void 0 : _a2.close();
23073
23080
  onDismissed == null ? void 0 : onDismissed();
23074
23081
  }, 3e3);
23075
23082
  };
@@ -23138,9 +23145,9 @@ ${leadMagnetStyles}`;
23138
23145
  };
23139
23146
  const BANNER_LEGACY_CLICK_ID = "ai-readiness-banner";
23140
23147
  function resolveClickId(surface, toolId) {
23141
- var _a;
23148
+ var _a2;
23142
23149
  if (surface === "banner") return BANNER_LEGACY_CLICK_ID;
23143
- return ((_a = LEGACY_CLICK_IDS[surface]) == null ? void 0 : _a[toolId]) ?? `lm_${surface}_${toolId}_cta`;
23150
+ return ((_a2 = LEGACY_CLICK_IDS[surface]) == null ? void 0 : _a2[toolId]) ?? `lm_${surface}_${toolId}_cta`;
23144
23151
  }
23145
23152
  function resolveCardListHeadClickId(toolId) {
23146
23153
  return CARD_LIST_HEAD_CLICK_IDS[toolId];
@@ -23165,7 +23172,7 @@ ${leadMagnetStyles}`;
23165
23172
  return null;
23166
23173
  }
23167
23174
  function buildView(tool) {
23168
- var _a;
23175
+ var _a2;
23169
23176
  const shared2 = getShared();
23170
23177
  const state = getToolState(tool.id);
23171
23178
  if (state.status === "analysing") {
@@ -23186,7 +23193,7 @@ ${leadMagnetStyles}`;
23186
23193
  return {
23187
23194
  mode: "blocked",
23188
23195
  fileName: shared2.resumeName,
23189
- blockedBy: (_a = getTool(shared2.activeToolId)) == null ? void 0 : _a.copy.title,
23196
+ blockedBy: (_a2 = getTool(shared2.activeToolId)) == null ? void 0 : _a2.copy.title,
23190
23197
  error: state.error,
23191
23198
  // No swapping the file while another tool is mid-run against it.
23192
23199
  canChangeFile: false
@@ -23361,12 +23368,12 @@ ${leadMagnetStyles}`;
23361
23368
  compact: compact2 = false,
23362
23369
  testId
23363
23370
  }) {
23364
- var _a, _b;
23371
+ var _a2, _b2;
23365
23372
  const activeIndex = Math.max(
23366
23373
  0,
23367
23374
  STEPS.findIndex((s2) => s2.phase === phase)
23368
23375
  );
23369
- const width = ((_a = STEPS[activeIndex]) == null ? void 0 : _a.target) ?? 38;
23376
+ const width = ((_a2 = STEPS[activeIndex]) == null ? void 0 : _a2.target) ?? 38;
23370
23377
  return /* @__PURE__ */ u$1(
23371
23378
  "div",
23372
23379
  {
@@ -23376,7 +23383,7 @@ ${leadMagnetStyles}`;
23376
23383
  "data-testid": testId,
23377
23384
  children: [
23378
23385
  /* @__PURE__ */ u$1("div", { class: "ik-lm-progress__track", "aria-hidden": "true", children: /* @__PURE__ */ u$1("span", { class: "ik-lm-progress__fill", style: `width:${width}%` }) }),
23379
- compact2 ? /* @__PURE__ */ u$1("p", { class: "ik-lm-progress__now", "data-testid": testId ? `${testId}-label` : void 0, children: (_b = STEPS[activeIndex]) == null ? void 0 : _b.label }) : /* @__PURE__ */ u$1("ol", { class: "ik-lm-progress__steps", children: STEPS.map((step, i2) => /* @__PURE__ */ u$1(
23386
+ compact2 ? /* @__PURE__ */ u$1("p", { class: "ik-lm-progress__now", "data-testid": testId ? `${testId}-label` : void 0, children: (_b2 = STEPS[activeIndex]) == null ? void 0 : _b2.label }) : /* @__PURE__ */ u$1("ol", { class: "ik-lm-progress__steps", children: STEPS.map((step, i2) => /* @__PURE__ */ u$1(
23380
23387
  "li",
23381
23388
  {
23382
23389
  class: "ik-lm-progress__step",
@@ -23417,8 +23424,8 @@ ${leadMagnetStyles}`;
23417
23424
  const head = splitAt === -1 ? "" : primaryLabel.slice(0, splitAt + 1);
23418
23425
  const tail = splitAt === -1 ? primaryLabel : primaryLabel.slice(splitAt + 1);
23419
23426
  const openPicker = () => {
23420
- var _a;
23421
- return (_a = inputRef.current) == null ? void 0 : _a.click();
23427
+ var _a2;
23428
+ return (_a2 = inputRef.current) == null ? void 0 : _a2.click();
23422
23429
  };
23423
23430
  const handleSlotClick = () => {
23424
23431
  reportLeadMagnetClick(ctaClickId);
@@ -23445,9 +23452,9 @@ ${leadMagnetStyles}`;
23445
23452
  class: "hidden",
23446
23453
  "data-testid": `leadmagnet-${tool.id}-upload-input`,
23447
23454
  onChange: (e2) => {
23448
- var _a;
23455
+ var _a2;
23449
23456
  setNudge(false);
23450
- onFileSelected(((_a = e2.target.files) == null ? void 0 : _a[0]) ?? null);
23457
+ onFileSelected(((_a2 = e2.target.files) == null ? void 0 : _a2[0]) ?? null);
23451
23458
  }
23452
23459
  }
23453
23460
  ),
@@ -23550,8 +23557,8 @@ ${leadMagnetStyles}`;
23550
23557
  eyebrow = DEFAULTS$1.eyebrow,
23551
23558
  heading = DEFAULTS$1.heading
23552
23559
  }) {
23553
- var _a;
23554
- const featuredId = featured ?? ((_a = tools[0]) == null ? void 0 : _a.id);
23560
+ var _a2;
23561
+ const featuredId = featured ?? ((_a2 = tools[0]) == null ? void 0 : _a2.id);
23555
23562
  const [openId, setOpenId] = d(featuredId);
23556
23563
  const ordered = tools.slice().sort((a2, b2) => rank(a2, featuredId) - rank(b2, featuredId));
23557
23564
  return /* @__PURE__ */ u$1("div", { class: "ik-lm-panel", "data-testid": "leadmagnet-card-list", children: [
@@ -23780,26 +23787,32 @@ ${leadMagnetStyles}`;
23780
23787
  }
23781
23788
  };
23782
23789
  if (typeof window !== "undefined") {
23783
- window.IKLeadMagnet = IKLeadMagnetInstance;
23790
+ if (!window.IKLeadMagnet) {
23791
+ window.IKLeadMagnet = IKLeadMagnetInstance;
23792
+ } else if (((_b = (_a = window.IKLeadMagnet).getVersion) == null ? void 0 : _b.call(_a)) !== IKLeadMagnetInstance.getVersion()) {
23793
+ console.warn(
23794
+ `[IKLeadMagnet] embed.js loaded again at a different version (${(_d = (_c = window.IKLeadMagnet).getVersion) == null ? void 0 : _d.call(_c)} already active, ${IKLeadMagnetInstance.getVersion()} ignored). Remove the duplicate <script src="embed.js"> tags from the page.`
23795
+ );
23796
+ }
23784
23797
  }
23785
23798
  let isOpen = false;
23786
23799
  const IKFormSDKInstance = {
23787
23800
  open(config) {
23788
- var _a, _b;
23801
+ var _a2, _b2;
23789
23802
  if (isOpen) {
23790
23803
  unmount$1();
23791
23804
  }
23792
23805
  if (config.displayMode === "inline" && !config.container) {
23793
23806
  console.error('IKForm.open: container is required when displayMode is "inline"');
23794
- (_a = config.onError) == null ? void 0 : _a.call(config, { code: "INVALID_CONFIG", message: "container is required for inline displayMode" });
23807
+ (_a2 = config.onError) == null ? void 0 : _a2.call(config, { code: "INVALID_CONFIG", message: "container is required for inline displayMode" });
23795
23808
  return;
23796
23809
  }
23797
23810
  isOpen = true;
23798
23811
  const handleClose = () => {
23799
- var _a2;
23812
+ var _a3;
23800
23813
  isOpen = false;
23801
23814
  unmount$1();
23802
- (_a2 = config.onClose) == null ? void 0 : _a2.call(config);
23815
+ (_a3 = config.onClose) == null ? void 0 : _a3.call(config);
23803
23816
  };
23804
23817
  try {
23805
23818
  mount$1({
@@ -23813,7 +23826,7 @@ ${leadMagnetStyles}`;
23813
23826
  isOpen = false;
23814
23827
  const message = err instanceof Error ? err.message : "Failed to open form";
23815
23828
  console.error(message);
23816
- (_b = config.onError) == null ? void 0 : _b.call(config, { code: "MOUNT_FAILED", message });
23829
+ (_b2 = config.onError) == null ? void 0 : _b2.call(config, { code: "MOUNT_FAILED", message });
23817
23830
  }
23818
23831
  },
23819
23832
  close() {