bhl-forms 0.13.0 → 0.13.2

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 (46) hide show
  1. package/dist/bhl-forms.es.js +35 -35
  2. package/dist/bhl-forms.iife.js +4 -4
  3. package/dist/bhl-forms.modern.es.js +524 -522
  4. package/dist/bhl-forms.modern.iife.js +7 -7
  5. package/dist/bhl-forms.modern.umd.js +7 -7
  6. package/dist/bhl-forms.umd.js +4 -4
  7. package/dist/forms/applianceRepair.es.js +6 -6
  8. package/dist/forms/applianceRepair.iife.js +1 -1
  9. package/dist/forms/applianceRepairMinimal.es.js +6 -6
  10. package/dist/forms/applianceRepairMinimal.iife.js +1 -1
  11. package/dist/forms/applianceRepairMinimal.json +1 -1
  12. package/dist/forms/electrical.es.js +49 -291
  13. package/dist/forms/electrical.iife.js +1 -1
  14. package/dist/forms/electrical.json +1 -1
  15. package/dist/forms/generalContractors.es.js +6 -6
  16. package/dist/forms/generalContractors.iife.js +1 -1
  17. package/dist/forms/generalContractors.json +1 -1
  18. package/dist/forms/generalHomeImprovement.es.js +6 -6
  19. package/dist/forms/generalHomeImprovement.iife.js +1 -1
  20. package/dist/forms/generalHomeImprovement.json +1 -1
  21. package/dist/forms/generalHomeImprovementThankYou.es.js +6 -6
  22. package/dist/forms/generalHomeImprovementThankYou.iife.js +1 -1
  23. package/dist/forms/generalHomeImprovementThankYou.json +1 -1
  24. package/dist/forms/painting.es.js +6 -6
  25. package/dist/forms/painting.iife.js +1 -1
  26. package/dist/forms/painting.json +1 -1
  27. package/dist/forms/plumbing.es.js +50 -291
  28. package/dist/forms/plumbing.iife.js +1 -1
  29. package/dist/forms/plumbing.json +1 -1
  30. package/dist/forms/remodeling.es.js +6 -6
  31. package/dist/forms/remodeling.iife.js +1 -1
  32. package/dist/forms/remodeling.json +1 -1
  33. package/dist/forms/restoration.es.js +1553 -0
  34. package/dist/forms/restoration.iife.js +1 -0
  35. package/dist/forms/restoration.json +1 -0
  36. package/dist/forms/restorationCall.es.js +6 -6
  37. package/dist/forms/restorationCall.iife.js +1 -1
  38. package/dist/forms/restorationCall.json +1 -1
  39. package/dist/forms/roofing.es.js +49 -286
  40. package/dist/forms/roofing.iife.js +1 -1
  41. package/dist/forms/roofing.json +1 -1
  42. package/dist/forms/windows.es.js +6 -6
  43. package/dist/forms/windows.iife.js +1 -1
  44. package/dist/forms/windows.json +1 -1
  45. package/dist/main.css +1 -1
  46. package/package.json +1 -1
@@ -12609,63 +12609,63 @@ const ul = () => {
12609
12609
  if (Ee("Mounting form:", r), r.schema && r.experiment)
12610
12610
  throw Error("Only one of schema and experiment allowed");
12611
12611
  const n = r.data || {};
12612
- n.submitUrl = n.submitUrl || yc, n.prepData = n.prepData || tg, n.preStepFunc = n.preStepFunc || lg, n.prevStepFunc = n.prevStepFunc || og, n.fireStepEvent = n.fireStepEvent || ug, n.handleRedirect = n.handleRedirect || tc, n.scrollAnchor = n.scrollAnchor || Cs, n.hideFormShowOther = (o = null) => (l, u) => Ie(this, null, function* () {
12613
- if (o && o != "null") {
12614
- if (!(o instanceof Function))
12612
+ n.submitUrl = n.submitUrl || yc, n.prepData = n.prepData || tg, n.preStepFunc = n.preStepFunc || lg, n.prevStepFunc = n.prevStepFunc || og, n.fireStepEvent = n.fireStepEvent || ug, n.handleRedirect = n.handleRedirect || tc, n.scrollAnchor = n.scrollAnchor || Cs, n.hideFormShowOther = (l = null) => (u, c) => Ie(this, null, function* () {
12613
+ if (l && l != "null") {
12614
+ if (!(l instanceof Function))
12615
12615
  throw "prepData must be a function";
12616
- l = o(l, u);
12617
- const T = Object.fromEntries(
12618
- Object.entries(l.properties || {}).filter(
12619
- ([p]) => !["vid", "Domain_Abbrev", "form_id"].includes(p)
12616
+ u = l(u, c);
12617
+ const p = Object.fromEntries(
12618
+ Object.entries(u.properties || {}).filter(
12619
+ ([y]) => !["vid", "Domain_Abbrev", "form_id"].includes(y)
12620
12620
  )
12621
12621
  );
12622
- window.zarPoolDataLayer = window.zarPoolDataLayer || [], window.zarPoolDataLayer.push(T);
12622
+ window.zarPoolDataLayer = window.zarPoolDataLayer || [], window.zarPoolDataLayer.push(p);
12623
12623
  }
12624
- const c = window.bhlFormsHideElemId || "form", f = window.bhlFormsShowElemId || "phone-number", b = document.getElementById(c), v = document.getElementById(f);
12625
- !b || !v || (b.style.display = "none", v.style.display = "block");
12626
- }), n.getVal = (o, l) => !o || !l ? void 0 : sn(o.value)[l], n.onEnter = (o) => (l) => {
12627
- if (l.key === "Enter" || l.keyCode === 13)
12624
+ const f = window.bhlFormsHideElemId || "form", b = window.bhlFormsShowElemId || "phone-number", v = document.getElementById(f), T = document.getElementById(b);
12625
+ !v || !T || (v.style.display = "none", T.style.display = "block");
12626
+ }), n.getVal = (l, u) => !l || !u ? void 0 : sn(l.value)[u], n.onEnter = (l) => (u) => {
12627
+ if (u.key === "Enter" || u.keyCode === 13)
12628
12628
  try {
12629
- o(), l.preventDefault();
12630
- } catch (u) {
12631
- const c = "onEnter failed: " + u.toString();
12632
- console.warn(c), tt("warning", c);
12629
+ l(), u.preventDefault();
12630
+ } catch (c) {
12631
+ const f = "onEnter failed: " + c.toString();
12632
+ console.warn(f), tt("warning", f);
12633
12633
  }
12634
- }, n.onInput = (o) => (l, u) => Ie(this, null, function* () {
12635
- const c = document.getElementById(u.props.id);
12636
- if (!c) {
12637
- console.warn("onInput: no element found for id:", u.props.id);
12634
+ }, n.onInput = (l) => (u, c) => Ie(this, null, function* () {
12635
+ const f = document.getElementById(c.props.id);
12636
+ if (!f) {
12637
+ console.warn("onInput: no element found for id:", c.props.id);
12638
12638
  return;
12639
12639
  }
12640
- if (!(c && c.offsetParent === null))
12640
+ if (!(f && f.offsetParent === null))
12641
12641
  try {
12642
- yield new Promise((f) => setTimeout(f, 50)), o();
12643
- } catch (f) {
12644
- const b = "onInput failed: " + f.toString();
12645
- console.warn(b), tt("warning", b);
12642
+ yield new Promise((b) => setTimeout(b, 50)), l();
12643
+ } catch (b) {
12644
+ const v = "onInput failed: " + b.toString();
12645
+ console.warn(v), tt("warning", v);
12646
12646
  }
12647
- }), n.getCrossSellOptions = function(o, l) {
12648
- const u = o.attrs.crossSellOptionMap, c = u[l];
12649
- return c || u["*"];
12650
- }, n.buildData = function(o) {
12651
- return $u([{ type: "meta", data: o }], n);
12647
+ }), n.getCrossSellOptions = function(l, u) {
12648
+ const c = l.attrs.crossSellOptionMap, f = c[u];
12649
+ return f || c["*"];
12650
+ }, n.buildData = function(l) {
12651
+ return $u([{ type: "meta", data: l }], n);
12652
12652
  };
12653
12653
  let i;
12654
12654
  if (r.schema)
12655
12655
  i = r.schema;
12656
12656
  else if (r.experiment) {
12657
- const o = Gv(r.experiment);
12658
- i = o.variant.schema, r.experimentCallback && (Ee("form.experimentCallback", r.experimentCallback), r.experimentCallback === !0 ? cg(r, o.variant, o.fromCache) : r.experimentCallback(r, o.variant, o.fromCache));
12657
+ const l = Gv(r.experiment);
12658
+ i = l.variant.schema, r.experimentCallback && (Ee("form.experimentCallback", r.experimentCallback), r.experimentCallback === !0 ? cg(r, l.variant, l.fromCache) : r.experimentCallback(r, l.variant, l.fromCache));
12659
12659
  }
12660
12660
  let a = i;
12661
- i instanceof Function ? a = i(n) : typeof i == "string" && (a = yield Zv(i));
12662
- const s = Zd(Qh, { schema: a, data: n }).use(cv, {
12661
+ i instanceof Function ? a = i(n) : typeof i == "string" && (a = yield Zv(i)), document.querySelector("#" + r.target).classList.add("bhl-form");
12662
+ const o = Zd(Qh, { schema: a, data: n }).use(cv, {
12663
12663
  config: {
12664
12664
  classes: e
12665
12665
  },
12666
12666
  plugins: M0()
12667
12667
  });
12668
- s.mount("#" + r.target), ll[r.target] = s;
12668
+ o.mount("#" + r.target), ll[r.target] = o;
12669
12669
  });
12670
12670
  }), Ee("Apps:", ll);
12671
12671
  }, mn = window.bhlFormsInitStrategy || "immediate";