@getcredify/credify-insurance-widget 1.44.1 → 1.45.0

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 (64) hide show
  1. package/README.md +1 -1
  2. package/dist/{address-BEVwov8q-DDhbGo15.js → address-BEVwov8q-BHA-1zzm.js} +1 -1
  3. package/dist/api-BLmgLEy-.js +51 -0
  4. package/dist/{car-B83tx4O2.js → car-B8Sfr377.js} +1 -1
  5. package/dist/{check-Bu17NqRV.js → check-B8qTJ1zD.js} +1 -1
  6. package/dist/{copy-applicant-offer-CqzfNhkJ-DLXjbOLT.js → copy-applicant-offer-BPo842pD-COcsLcbo.js} +3 -3
  7. package/dist/{copy-from-record-BNP6CFFR-6SC1msxp.js → copy-from-record-DL503itm-B05F775l.js} +10 -10
  8. package/dist/{coverageDerivation-CV2ORogj-De8x_Bpm.js → coverageDerivation-CV2ORogj-D4IAkVAP.js} +1 -1
  9. package/dist/{fixtures-ijbZ16Zg-9n-90hL2.js → fixtures-ijbZ16Zg-CB6WPBEx.js} +1 -1
  10. package/dist/{household-prefill-CmtB9R3R-Bw0M1Q50.js → household-prefill-DJ-Y0NcP-TwmnYrqf.js} +30 -30
  11. package/dist/{householdPrefill-DLm3pxFH-BQibTi9l.js → householdPrefill-DLm3pxFH-Gudko0w4.js} +1 -1
  12. package/dist/iframe/assets/{address-BEVwov8q-BiiIpq2c.js → address-BEVwov8q-RcBegFnh.js} +1 -1
  13. package/dist/iframe/assets/{car-cifgdWXX.js → car-DQIQf4LA.js} +1 -1
  14. package/dist/iframe/assets/{check-TbHiw7rw.js → check-BiNh2j82.js} +1 -1
  15. package/dist/iframe/assets/{copy-applicant-offer-CqzfNhkJ-CVahKn8I.js → copy-applicant-offer-BPo842pD-Cj352DzN.js} +1 -1
  16. package/dist/iframe/assets/{copy-from-record-BNP6CFFR-Cn7Nr7XT.js → copy-from-record-DL503itm-B7hBbUhh.js} +2 -2
  17. package/dist/iframe/assets/{coverageDerivation-CV2ORogj-B7aNPljp.js → coverageDerivation-CV2ORogj-D3oRqD1U.js} +1 -1
  18. package/dist/iframe/assets/{dob-calendar-RIJ5S6YU-CdxMGaLz.js → dob-calendar-RIJ5S6YU-vOGgSHSK.js} +1 -1
  19. package/dist/iframe/assets/{fixtures-ijbZ16Zg-NuD06-4v.js → fixtures-ijbZ16Zg-BmEw6uDw.js} +1 -1
  20. package/dist/iframe/assets/household-prefill-DJ-Y0NcP-z6AnkJcR.js +1 -0
  21. package/dist/iframe/assets/{householdPrefill-DLm3pxFH-DzyOYQr_.js → householdPrefill-DLm3pxFH-BZXueCa7.js} +1 -1
  22. package/dist/iframe/assets/iframe-ku_diR98.js +107 -0
  23. package/dist/iframe/assets/{index-BknEWAR5.js → index-IiQzPjFm.js} +2 -2
  24. package/dist/iframe/assets/intake-review-panel-CWz2efw4-CP-sEc-j.js +1 -0
  25. package/dist/iframe/assets/{mockJump-hNzgzUmO-CQ7eZ354.js → mockJump-H1NFTDah-yzeq4yea.js} +1 -1
  26. package/dist/iframe/assets/payload-CQc06PZC-BxklUdmW.js +1 -0
  27. package/dist/iframe/assets/{question-list-DFjWa8ZA-DbabOwyP.js → question-list-CcoyuyQD-DCzTkzeE.js} +11 -11
  28. package/dist/iframe/assets/rates-panel-MXCbnqpL-TFkvW-DN.js +17 -0
  29. package/dist/iframe/assets/{review-panel-C_WxX33U-CxzpQutt.js → review-panel-CFVxGU7F-CqUUCDLK.js} +2 -2
  30. package/dist/iframe/assets/stage-BSRsu--X-BAWfI2cm.js +1 -0
  31. package/dist/iframe/assets/validation-ELW00AsL-ytOMlsxG.js +3 -0
  32. package/dist/iframe/assets/{vehicleCoverage-CBWORI1l-BqOK33e3.js → vehicleCoverage-DI2dKrnI-DVXwPfxd.js} +1 -1
  33. package/dist/iframe/assets/{visibility-CKRGC3Il-CLpoN3cd.js → visibility-CyRoLvg5-CxslMJYX.js} +1 -1
  34. package/dist/iframe/assets/waves-vdL6w3zC.js +16 -0
  35. package/dist/iframe/iframe.html +1 -1
  36. package/dist/{index-CY0roJE_.js → index-IZRzz1Mi.js} +1 -1
  37. package/dist/index.es.js +1 -1
  38. package/dist/index.umd.js +103 -103
  39. package/dist/{intake-review-panel-D27t8CZO-CxiXytFS.js → intake-review-panel-CWz2efw4-BQ-Nog4K.js} +27 -27
  40. package/dist/{mockJump-hNzgzUmO-CsTzthio.js → mockJump-H1NFTDah-CkqZVQxf.js} +1 -1
  41. package/dist/{payload-DrGFAxms-DmfWvvu_.js → payload-CQc06PZC-KA6cBCno.js} +26 -26
  42. package/dist/{question-list-DFjWa8ZA-B8f7Jf6J.js → question-list-CcoyuyQD-_c4J4n0G.js} +51 -51
  43. package/dist/rates-panel-MXCbnqpL-DGYBAFto.js +1323 -0
  44. package/dist/{review-panel-C_WxX33U-CZu6We48.js → review-panel-CFVxGU7F-CtO3WmnD.js} +51 -51
  45. package/dist/stage-BSRsu--X-DJs8ps3K.js +197 -0
  46. package/dist/utils/prefill.d.ts +2 -4
  47. package/dist/{validation-D42QXxck-BPUVtzkv.js → validation-ELW00AsL-C4xgPdbr.js} +341 -343
  48. package/dist/{vehicleCoverage-CBWORI1l-DZmjvVjU.js → vehicleCoverage-DI2dKrnI-Lq9BCjQm.js} +3 -3
  49. package/dist/{visibility-CKRGC3Il-_72Koc98.js → visibility-CyRoLvg5-DNRgF2sH.js} +6 -6
  50. package/dist/waves-DM8Lgssk.js +71 -0
  51. package/dist/{widget-CP6ApixH.js → widget-3S1xkGig.js} +2972 -2827
  52. package/package.json +2 -2
  53. package/dist/api-CWMwIjKu.js +0 -51
  54. package/dist/core-CrEw_I-E-CsRUhlZy.js +0 -417
  55. package/dist/iframe/assets/core-CrEw_I-E-DJNj5Zzo.js +0 -16
  56. package/dist/iframe/assets/household-prefill-CmtB9R3R-0b9HYzDA.js +0 -1
  57. package/dist/iframe/assets/iframe-Be9NY0jq.js +0 -107
  58. package/dist/iframe/assets/intake-review-panel-D27t8CZO-QuAzDm1O.js +0 -1
  59. package/dist/iframe/assets/payload-DrGFAxms-DIGXNw5l.js +0 -1
  60. package/dist/iframe/assets/rates-panel-BSFiWEZX-GsRBXu7R.js +0 -17
  61. package/dist/iframe/assets/stage-knShj71W-CEkRTdvw.js +0 -1
  62. package/dist/iframe/assets/validation-D42QXxck-DrIBn9be.js +0 -3
  63. package/dist/rates-panel-BSFiWEZX-DdETQZ83.js +0 -1001
  64. package/dist/stage-knShj71W-XIJ7bUoN.js +0 -197
package/README.md CHANGED
@@ -352,7 +352,7 @@ collects are credited to your firm:
352
352
  </script>
353
353
  ```
354
354
 
355
- Your partner ID is in the partner portal under **Settings → API keys**, with
355
+ Your partner ID is in the partner portal under **Integrations**, with
356
356
  this snippet already filled in. You do not create it — it exists as soon as
357
357
  your firm profile does, and it never changes.
358
358
 
@@ -1,4 +1,4 @@
1
- import { t as _ } from "./widget-CP6ApixH.js";
1
+ import { t as _ } from "./widget-3S1xkGig.js";
2
2
  (function() {
3
3
  if (typeof t > "u")
4
4
  var t = { env: {} };
@@ -0,0 +1,51 @@
1
+ import { j as i, e as o, A as t, N as r, a as u, d as l, X as n, q as d, b as f, H as p, Y as g, Q as c, c as m, m as S, O as T, P as h, f as y, M as Q, k, g as A, E, h as R, i as v, T as P, D as C, J as _, l as O, _ as V, Z as b, x as D, B as I, R as U, u as B, w as F, z as K, S as M, C as Y, n as Z, o as q, V as x, p as G, v as H, r as L, y as N } from "./widget-3S1xkGig.js";
2
+ (function() {
3
+ if (typeof e > "u")
4
+ var e = { env: {} };
5
+ })();
6
+ export {
7
+ i as AUTH_TOKEN_STORAGE_KEY,
8
+ o as CredifyApiError,
9
+ t as QUOTE_ID_STORAGE_KEY,
10
+ r as applyDriverPrefill,
11
+ u as applyVehiclePrefill,
12
+ l as bodyWithQuoteId,
13
+ n as buildResumeUrl,
14
+ d as captureResumeTokenFromUrl,
15
+ f as cityFromZip,
16
+ p as clearQuoteSession,
17
+ g as configureApi,
18
+ c as configureZipCityLookup,
19
+ m as consumeResumeToken,
20
+ S as createQuote,
21
+ T as decodeVin,
22
+ h as dismissDriverPrefill,
23
+ y as dismissVehiclePrefill,
24
+ Q as fetchDriverPrefillSuggestions,
25
+ k as fetchVehiclePrefillSuggestions,
26
+ A as getApiConfig,
27
+ E as getQuestionsByStage,
28
+ R as getQuote,
29
+ v as getRates,
30
+ P as getStagesForQuote,
31
+ C as getVehicleOptions,
32
+ _ as hasResumeToken,
33
+ O as isMockEnabled,
34
+ V as isSupportedState,
35
+ b as isTestModeEnabled,
36
+ D as issueResumeLink,
37
+ I as loadAuthToken,
38
+ U as loadQuoteId,
39
+ B as post,
40
+ F as prefillProperty,
41
+ K as prefillSuggestions,
42
+ M as redeemResumeToken,
43
+ Y as requestBind,
44
+ Z as resetApiConfig,
45
+ q as resetPrefillSuggestions,
46
+ x as saveAuthToken,
47
+ G as saveQuoteId,
48
+ H as sendSmsCode,
49
+ L as updateQuote,
50
+ N as verifySmsCode
51
+ };
@@ -1,4 +1,4 @@
1
- import { a4 as e } from "./widget-CP6ApixH.js";
1
+ import { a4 as e } from "./widget-3S1xkGig.js";
2
2
  (function() {
3
3
  if (typeof c > "u")
4
4
  var c = { env: {} };
@@ -1,4 +1,4 @@
1
- import { a4 as c } from "./widget-CP6ApixH.js";
1
+ import { a4 as c } from "./widget-3S1xkGig.js";
2
2
  (function() {
3
3
  if (typeof e > "u")
4
4
  var e = { env: {} };
@@ -1,6 +1,6 @@
1
- import { t as d } from "./widget-CP6ApixH.js";
2
- import { k as y, j as h } from "./visibility-CKRGC3Il-_72Koc98.js";
3
- import { u as m, l as f, s as c } from "./copy-from-record-BNP6CFFR-6SC1msxp.js";
1
+ import { t as d } from "./widget-3S1xkGig.js";
2
+ import { k as y, j as h } from "./visibility-CyRoLvg5-DNRgF2sH.js";
3
+ import { u as m, l as f, s as c } from "./copy-from-record-DL503itm-B05F775l.js";
4
4
  import { useMemo as p, useCallback as b } from "react";
5
5
  import { jsx as g } from "react/jsx-runtime";
6
6
  (function() {
@@ -1,9 +1,9 @@
1
- import { a4 as x, a5 as b, r as v } from "./widget-CP6ApixH.js";
2
- import { j as N } from "./visibility-CKRGC3Il-_72Koc98.js";
3
- import { O as f } from "./validation-D42QXxck-BPUVtzkv.js";
1
+ import { a4 as x, a5 as b, G as v } from "./widget-3S1xkGig.js";
2
+ import { j as N } from "./visibility-CyRoLvg5-DNRgF2sH.js";
3
+ import { k as f } from "./validation-ELW00AsL-C4xgPdbr.js";
4
4
  import { useState as y } from "react";
5
5
  import { jsxs as p, jsx as n, Fragment as k } from "react/jsx-runtime";
6
- import { C as K } from "./check-Bu17NqRV.js";
6
+ import { C as K } from "./check-B8qTJ1zD.js";
7
7
  (function() {
8
8
  if (typeof t > "u")
9
9
  var t = { env: {} };
@@ -71,14 +71,14 @@ var A = {
71
71
  if (!Array.isArray(e) || e.length === 0) return c;
72
72
  let i = String(c);
73
73
  return e.includes(i) ? c : (j[i] ?? []).find((a) => e.includes(a));
74
- }, h = (t, c = "") => [t[`${c}first_name`], t[`${c}last_name`]].map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), O = (t) => h(t), B = (t, c = {}) => N(t, "drivers").flatMap((e, i) => {
74
+ }, h = (t, c = "") => [t[`${c}first_name`], t[`${c}last_name`]].map((e) => String(e ?? "").trim()).filter(Boolean).join(" "), L = (t) => h(t), B = (t, c = {}) => N(t, "drivers").flatMap((e, i) => {
75
75
  if (c.exclude?.(e, i)) return [];
76
76
  let a = h(e);
77
77
  return a || !f(e.date_of_birth) ? [{
78
78
  index: i,
79
79
  name: a || `Driver ${i + 1}`
80
80
  }] : [];
81
- }), I = ({ kind: t, source: c, targetQuestions: e }) => {
81
+ }), G = ({ kind: t, source: c, targetQuestions: e }) => {
82
82
  let i = new Map(e.map((d) => [d.key, d])), a = {};
83
83
  for (let [d, o] of Object.entries(A[t])) {
84
84
  let m = i.get(d);
@@ -90,7 +90,7 @@ var A = {
90
90
  }
91
91
  let r = $[t];
92
92
  return r && a[r.occupationKey] !== void 0 && (b(a[r.industryKey])?.includes(String(a[r.occupationKey])) || delete a[r.occupationKey]), a;
93
- }, Q = ({ heading: t, body: c, candidates: e, applyLabel: i = "Use these details", onApply: a }) => {
93
+ }, O = ({ heading: t, body: c, candidates: e, applyLabel: i = "Use these details", onApply: a }) => {
94
94
  let [r, d] = y(e[0]?.index ?? 0), [o, m] = y(null);
95
95
  if (!e.length) return null;
96
96
  if (o) return /* @__PURE__ */ p("p", {
@@ -182,8 +182,8 @@ var A = {
182
182
  };
183
183
  export {
184
184
  w as U,
185
- O as c,
185
+ L as c,
186
186
  B as l,
187
- Q as s,
188
- I as u
187
+ O as s,
188
+ G as u
189
189
  };
@@ -1,4 +1,4 @@
1
- import { t as E } from "./widget-CP6ApixH.js";
1
+ import { t as E } from "./widget-3S1xkGig.js";
2
2
  (function() {
3
3
  if (typeof r > "u")
4
4
  var r = { env: {} };
@@ -1,4 +1,4 @@
1
- import { t } from "./widget-CP6ApixH.js";
1
+ import { t } from "./widget-3S1xkGig.js";
2
2
  (function() {
3
3
  if (typeof e > "u")
4
4
  var e = { env: {} };
@@ -1,20 +1,20 @@
1
- import { t as U, j as z, A as D, I as p, O as E, D as L, r as w } from "./widget-CP6ApixH.js";
2
- import { U as q, y as H, h as R, m as T, d as B, u as F, l as G } from "./householdPrefill-DLm3pxFH-BQibTi9l.js";
3
- import { j as J } from "./visibility-CKRGC3Il-_72Koc98.js";
4
- import { useState as u, useRef as C, useEffect as I } from "react";
1
+ import { t as O, P as U, N as E, z as p, f as L, a as q, G as w } from "./widget-3S1xkGig.js";
2
+ import { U as D, y as G, h as H, m as R, d as T, u as B, l as F } from "./householdPrefill-DLm3pxFH-Gudko0w4.js";
3
+ import { j as J } from "./visibility-CyRoLvg5-DNRgF2sH.js";
4
+ import { useState as u, useRef as C, useEffect as A } from "react";
5
5
  import { jsx as d, jsxs as r } from "react/jsx-runtime";
6
- import { C as K } from "./car-B83tx4O2.js";
6
+ import { C as K } from "./car-B8Sfr377.js";
7
7
  (function() {
8
8
  if (typeof t > "u")
9
9
  var t = { env: {} };
10
10
  })();
11
- var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
11
+ var de = /* @__PURE__ */ O({ HouseholdPrefill: () => Q }), M = {
12
12
  vehicle: {
13
13
  fetch: p.vehicle.fetch,
14
14
  peek: p.vehicle.peek,
15
- apply: L,
16
- dismiss: E,
17
- mergeInto: T,
15
+ apply: q,
16
+ dismiss: L,
17
+ mergeInto: R,
18
18
  skip: () => !1,
19
19
  alreadyPresent: () => !1,
20
20
  icon: K,
@@ -26,24 +26,24 @@ var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
26
26
  driver: {
27
27
  fetch: p.driver.fetch,
28
28
  peek: p.driver.peek,
29
- apply: D,
30
- dismiss: z,
31
- mergeInto: R,
32
- skip: H,
33
- alreadyPresent: (t, c) => J(t, "drivers").some((i) => B(G(i), F(c.label))),
34
- icon: q,
29
+ apply: E,
30
+ dismiss: U,
31
+ mergeInto: H,
32
+ skip: G,
33
+ alreadyPresent: (t, c) => J(t, "drivers").some((i) => T(F(i), B(c.label))),
34
+ icon: D,
35
35
  heading: (t) => t === 1 ? "We found another driver in your household" : `We found ${t} drivers in your household`,
36
36
  body: "Add anyone who drives these vehicles. We already have you.",
37
37
  decline: "I'll add them myself",
38
38
  searching: "Looking for other drivers in your household…"
39
39
  }
40
- }, Q = ({ kind: t, quoteId: c, values: i, onApply: A }) => {
41
- let s = M[t], [g] = u(() => s.skip(i)), b = !!c && !g, n = b && c ? s.peek(c) : void 0, [v, a] = u(n ? n.length ? "offering" : "done" : "idle"), [$, j] = u(n ?? []), [o, x] = u(() => new Set((n ?? []).filter((e) => e.alreadyOnApplication).map((e) => e.id))), N = C(!1), k = C(i);
42
- I(() => {
40
+ }, Q = ({ kind: t, quoteId: c, values: i, onApply: I }) => {
41
+ let s = M[t], [g] = u(() => s.skip(i)), b = !!c && !g, n = b && c ? s.peek(c) : void 0, [v, a] = u(n ? n.length ? "offering" : "done" : "idle"), [P, $] = u(n ?? []), [o, x] = u(() => new Set((n ?? []).filter((e) => e.alreadyOnApplication).map((e) => e.id))), N = C(!1), k = C(i);
42
+ A(() => {
43
43
  k.current = i;
44
- }), I(() => {
44
+ }), A(() => {
45
45
  !c || N.current || g || (N.current = !0, s.fetch(c).then((e) => {
46
- j(e), x(new Set(e.filter((l) => l.alreadyOnApplication).map((l) => l.id))), a(e.length ? "offering" : "done");
46
+ $(e), x(new Set(e.filter((l) => l.alreadyOnApplication).map((l) => l.id))), a(e.length ? "offering" : "done");
47
47
  }).catch(() => {
48
48
  a("done");
49
49
  }));
@@ -52,7 +52,7 @@ var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
52
52
  s,
53
53
  g
54
54
  ]);
55
- let P = s.icon, h = v === "idle" && b ? "searching" : v;
55
+ let S = s.icon, h = v === "idle" && b ? "searching" : v;
56
56
  if (h === "searching") return /* @__PURE__ */ d("div", {
57
57
  className: "cds-mb-5 cds-rounded-xl cds-border cds-border-accent/40 cds-bg-highlight cds-p-4",
58
58
  "aria-live": "polite",
@@ -74,26 +74,26 @@ var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
74
74
  })
75
75
  });
76
76
  if (h !== "offering" && h !== "applying") return null;
77
- let y = $.filter((e) => !s.alreadyPresent(i, e));
77
+ let y = P.filter((e) => !s.alreadyPresent(i, e));
78
78
  if (!y.length) return null;
79
- let S = (e) => {
79
+ let W = (e) => {
80
80
  x((l) => {
81
81
  let f = new Set(l);
82
82
  return f.has(e) ? f.delete(e) : f.add(e), f;
83
83
  });
84
- }, W = async () => {
84
+ }, j = async () => {
85
85
  if (!c || !o.size) return;
86
86
  a("applying");
87
87
  let e = await s.apply([...o], c);
88
- e.length && A(s.mergeInto(k.current, e)), a("done");
89
- }, O = () => {
88
+ e.length && I(s.mergeInto(k.current, e)), a("done");
89
+ }, z = () => {
90
90
  a("done"), c && s.dismiss(c);
91
91
  }, m = h === "applying";
92
92
  return /* @__PURE__ */ d("div", {
93
93
  className: "cds-mb-5 cds-rounded-xl cds-border cds-border-accent/40 cds-bg-highlight cds-p-4",
94
94
  children: /* @__PURE__ */ r("div", {
95
95
  className: "cds-flex cds-items-start cds-gap-3",
96
- children: [/* @__PURE__ */ d(P, {
96
+ children: [/* @__PURE__ */ d(S, {
97
97
  "aria-hidden": "true",
98
98
  className: "cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-accent"
99
99
  }), /* @__PURE__ */ r("div", {
@@ -116,7 +116,7 @@ var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
116
116
  className: "cds-mt-0.5",
117
117
  checked: o.has(e.id),
118
118
  disabled: m,
119
- onChange: () => S(e.id)
119
+ onChange: () => W(e.id)
120
120
  }), /* @__PURE__ */ d("span", {
121
121
  "data-credify-redact": !0,
122
122
  className: "cds-font-semibold",
@@ -129,13 +129,13 @@ var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), M = {
129
129
  children: [/* @__PURE__ */ d("button", {
130
130
  type: "button",
131
131
  disabled: m || !o.size,
132
- onClick: () => void W(),
132
+ onClick: () => void j(),
133
133
  className: `cds-rounded-lg cds-bg-accent cds-px-4 cds-py-2 cds-text-sm cds-font-bold cds-text-primary-foreground hover:cds-bg-accent disabled:cds-cursor-not-allowed disabled:cds-opacity-50 ${w}`,
134
134
  children: m ? "Adding…" : "Use these"
135
135
  }), /* @__PURE__ */ d("button", {
136
136
  type: "button",
137
137
  disabled: m,
138
- onClick: O,
138
+ onClick: z,
139
139
  className: `cds-text-sm cds-font-semibold cds-text-fg cds-underline disabled:cds-opacity-50 ${w}`,
140
140
  children: s.decline
141
141
  })]
@@ -1,4 +1,4 @@
1
- import { a4 as A } from "./widget-CP6ApixH.js";
1
+ import { a4 as A } from "./widget-3S1xkGig.js";
2
2
  import { t as c } from "./types-LUGvo5ic-CiVRcsV9.js";
3
3
  (function() {
4
4
  if (typeof e > "u")
@@ -1 +1 @@
1
- import{t as _}from"./iframe-Be9NY0jq.js";var u=_({ADDRESS_COLUMN_PREFIXES:()=>m,addressFromColumns:()=>p,addressToColumns:()=>c,composeAddress:()=>n,normalizeStateCode:()=>a,parseAddress:()=>i}),a=r=>{let t=r.trim();return/^[A-Za-z]{2}$/.test(t)?t.toUpperCase():t},i=r=>{let[t="",e="",o=""]=r.split(",").map(d=>d.trim()).filter(Boolean),l=/^([A-Za-z .]{2,})\s+(\d{5})(?:-\d{4})?$/.exec(o);return{line_1:t,city:e,state:a(l?.[1]?.trim()??""),postal_code:l?.[2]??""}},n=r=>{let t=[r.line_1.trim(),r.line_2.trim()].filter(Boolean).join(" ");if(!t)return"";let e=a(r.state.trim());return`${t}, ${r.city.trim()}, ${e} ${r.postal_code.trim()}`.replace(/\s+/g," ").trim()},m={address:"",prior_address:"prior_",garaging_address:"garaging_address_"},s=(r,t)=>{let e=r[t];return e==null?"":String(e)},p=(r,t)=>n({line_1:s(r,`${t}line_1`),line_2:s(r,`${t}line_2`),city:s(r,`${t}city`),state:s(r,`${t}state`),postal_code:s(r,`${t}postal_code`)}),c=(r,t)=>{let e=i(r);return{[`${t}line_1`]:e.line_1||null,[`${t}city`]:e.city||null,[`${t}state`]:e.state||null,[`${t}postal_code`]:e.postal_code||null}};export{n as a,u as i,p as n,a as o,c as r,i as s,m as t};
1
+ import{t as _}from"./iframe-ku_diR98.js";var u=_({ADDRESS_COLUMN_PREFIXES:()=>m,addressFromColumns:()=>p,addressToColumns:()=>c,composeAddress:()=>n,normalizeStateCode:()=>a,parseAddress:()=>i}),a=r=>{let t=r.trim();return/^[A-Za-z]{2}$/.test(t)?t.toUpperCase():t},i=r=>{let[t="",e="",o=""]=r.split(",").map(d=>d.trim()).filter(Boolean),l=/^([A-Za-z .]{2,})\s+(\d{5})(?:-\d{4})?$/.exec(o);return{line_1:t,city:e,state:a(l?.[1]?.trim()??""),postal_code:l?.[2]??""}},n=r=>{let t=[r.line_1.trim(),r.line_2.trim()].filter(Boolean).join(" ");if(!t)return"";let e=a(r.state.trim());return`${t}, ${r.city.trim()}, ${e} ${r.postal_code.trim()}`.replace(/\s+/g," ").trim()},m={address:"",prior_address:"prior_",garaging_address:"garaging_address_"},s=(r,t)=>{let e=r[t];return e==null?"":String(e)},p=(r,t)=>n({line_1:s(r,`${t}line_1`),line_2:s(r,`${t}line_2`),city:s(r,`${t}city`),state:s(r,`${t}state`),postal_code:s(r,`${t}postal_code`)}),c=(r,t)=>{let e=i(r);return{[`${t}line_1`]:e.line_1||null,[`${t}city`]:e.city||null,[`${t}state`]:e.state||null,[`${t}postal_code`]:e.postal_code||null}};export{n as a,u as i,p as n,a as o,c as r,i as s,m as t};
@@ -1,4 +1,4 @@
1
- import{l as c}from"./iframe-Be9NY0jq.js";/**
1
+ import{m as c}from"./iframe-ku_diR98.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{l as c}from"./iframe-Be9NY0jq.js";/**
1
+ import{m as c}from"./iframe-ku_diR98.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{t as y,r as s,a as d}from"./iframe-Be9NY0jq.js";import{k as h,j as m}from"./visibility-CKRGC3Il-CLpoN3cd.js";import{u as c,l as b,s as g}from"./copy-from-record-BNP6CFFR-Cn7Nr7XT.js";import"./types-LUGvo5ic-CB-wcgK3.js";import"./validation-D42QXxck-DrIBn9be.js";import"./check-TbHiw7rw.js";var O=y({CopyApplicantOffer:()=>k}),f={Demographics:{kind:"applicant",heading:"Are you one of the drivers?",body:"We'll reuse the details you already gave for them, so you don't type them twice.",applyLabel:"Use these details"},Ssn:{kind:"applicantSsn",heading:"Are you one of the drivers?",body:"We can reuse the Social Security number you already entered for them.",applyLabel:"Use the SSN"}},k=({stage:r,questions:n,values:t,onPatch:u})=>{let e=f[r],i=s.useMemo(()=>e?h(n,t,r):[],[e,n,t,r]),o=s.useCallback(a=>e?c({kind:e.kind,source:m(t,"drivers")[a]??{},targetQuestions:i}):{},[e,t,i]),l=s.useMemo(()=>e?b(t).filter(a=>Object.keys(o(a.index)).length>0):[],[e,t,o]);return!e||!l.length?null:d.jsx(g,{heading:e.heading,body:e.body,applyLabel:e.applyLabel,candidates:l,onApply:a=>{let p=o(a);return u(p),Object.keys(p).length}})};export{O as n,k as t};
1
+ import{t as y,r as s,b as d}from"./iframe-ku_diR98.js";import{k as h,j as m}from"./visibility-CyRoLvg5-CxslMJYX.js";import{u as c,l as b,s as g}from"./copy-from-record-DL503itm-B7hBbUhh.js";import"./types-LUGvo5ic-CB-wcgK3.js";import"./validation-ELW00AsL-ytOMlsxG.js";import"./check-BiNh2j82.js";var O=y({CopyApplicantOffer:()=>k}),f={Demographics:{kind:"applicant",heading:"Are you one of the drivers?",body:"We'll reuse the details you already gave for them, so you don't type them twice.",applyLabel:"Use these details"},Ssn:{kind:"applicantSsn",heading:"Are you one of the drivers?",body:"We can reuse the Social Security number you already entered for them.",applyLabel:"Use the SSN"}},k=({stage:r,questions:n,values:t,onPatch:u})=>{let e=f[r],i=s.useMemo(()=>e?h(n,t,r):[],[e,n,t,r]),o=s.useCallback(a=>e?c({kind:e.kind,source:m(t,"drivers")[a]??{},targetQuestions:i}):{},[e,t,i]),l=s.useMemo(()=>e?b(t).filter(a=>Object.keys(o(a.index)).length>0):[],[e,t,o]);return!e||!l.length?null:d.jsx(g,{heading:e.heading,body:e.body,applyLabel:e.applyLabel,candidates:l,onApply:a=>{let p=o(a);return u(p),Object.keys(p).length}})};export{O as n,k as t};
@@ -1,6 +1,6 @@
1
- import{l as f,N as g,r as _,a as t,f as b}from"./iframe-Be9NY0jq.js";import{j}from"./visibility-CKRGC3Il-CLpoN3cd.js";import{O as y}from"./validation-D42QXxck-DrIBn9be.js";import{C as N}from"./check-TbHiw7rw.js";/**
1
+ import{m as f,I as g,r as _,b as t,f as b}from"./iframe-ku_diR98.js";import{j}from"./visibility-CyRoLvg5-CxslMJYX.js";import{k as y}from"./validation-ELW00AsL-ytOMlsxG.js";import{C as v}from"./check-BiNh2j82.js";/**
2
2
  * @license lucide-react v0.562.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const v=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],k=f("user-round-check",v);var K={applicant:{gender:"gender",marital_status:"marital_status",employment_industry:"industry",occupation:"occupation"},applicantSsn:{social_security_number:"social_security_number"},coApplicant:{co_applicant_first_name:"first_name",co_applicant_middle_name:"middle_name",co_applicant_last_name:"last_name",co_applicant_date_of_birth:"date_of_birth",co_applicant_gender:"gender",co_applicant_marital_status:"marital_status",co_applicant_employment_industry:"industry",co_applicant_occupation:"occupation",co_applicant_relationship:"relationship_to_insured"},driverFromApplicant:{first_name:"first_name",last_name:"last_name",date_of_birth:"date_of_birth",gender:"gender",marital_status:"marital_status",industry:"employment_industry",occupation:"occupation",social_security_number:"social_security_number"}},S={applicant:{industryKey:"employment_industry",occupationKey:"occupation"},coApplicant:{industryKey:"co_applicant_employment_industry",occupationKey:"co_applicant_occupation"},driverFromApplicant:{industryKey:"industry",occupationKey:"occupation"}},w={Separated:["Seperated"],Seperated:["Separated"],DomesticPartner:["Domestic Partner"],"Domestic Partner":["DomesticPartner"]},A=(a,s)=>{let e=a.options;if(!Array.isArray(e)||e.length===0)return s;let n=String(s);return e.includes(n)?s:(w[n]??[]).find(c=>e.includes(c))},h=(a,s="")=>[a[`${s}first_name`],a[`${s}last_name`]].map(e=>String(e??"").trim()).filter(Boolean).join(" "),P=a=>h(a),M=(a,s={})=>j(a,"drivers").flatMap((e,n)=>{if(s.exclude?.(e,n))return[];let c=h(e);return c||!y(e.date_of_birth)?[{index:n,name:c||`Driver ${n+1}`}]:[]}),U=({kind:a,source:s,targetQuestions:e})=>{let n=new Map(e.map(d=>[d.key,d])),c={};for(let[d,o]of Object.entries(K[a])){let p=n.get(d);if(!p)continue;let m=s[o];if(y(m,p.inputType))continue;let l=A(p,m);l!==void 0&&(c[d]=l)}let i=S[a];return i&&c[i.occupationKey]!==void 0&&(g(c[i.industryKey])?.includes(String(c[i.occupationKey]))||delete c[i.occupationKey]),c},E=({heading:a,body:s,candidates:e,applyLabel:n="Use these details",onApply:c})=>{let[i,d]=_.useState(e[0]?.index??0),[o,p]=_.useState(null);if(!e.length)return null;if(o)return t.jsxs("p",{className:"cds-mb-4 cds-flex cds-items-center cds-gap-2 cds-text-sm cds-text-fg-muted","aria-live":"polite",children:[t.jsx(N,{"aria-hidden":"true",className:"cds-h-4 cds-w-4 cds-shrink-0 cds-text-accent"}),"Filled ",o.count," ",o.count===1?"answer":"answers"," from ",t.jsx("span",{"data-credify-redact":!0,children:o.name}),". Change anything below that is not right."]});let m=()=>{let r=e.find(x=>x.index===i)??e[0];if(!r)return;let u=c(r.index);u>0&&p({name:r.name,count:u})},l=e.length===1?e[0]:void 0;return t.jsx("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-accent/40 cds-bg-highlight cds-p-4",children:t.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[t.jsx(k,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-accent"}),t.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[t.jsx("h3",{className:"cds-text-sm cds-font-bold cds-text-fg",children:a}),t.jsx("p",{className:"cds-mt-0.5 cds-text-sm cds-text-fg-muted",children:s}),l?null:t.jsxs("fieldset",{className:"cds-mt-3",children:[t.jsx("legend",{className:"sr-only",children:a}),t.jsx("div",{className:"cds-space-y-1.5",children:e.map(r=>t.jsxs("label",{className:"cds-flex cds-cursor-pointer cds-items-center cds-gap-2 cds-text-sm cds-text-fg",children:[t.jsx("input",{type:"radio",name:`copy-source-${a.replace(/\W+/g,"-")}`,checked:i===r.index,onChange:()=>d(r.index)}),t.jsx("span",{"data-credify-redact":!0,className:"cds-font-semibold",children:r.name})]},r.index))})]}),t.jsx("button",{type:"button",onClick:m,className:`cds-mt-4 cds-rounded-lg cds-bg-accent cds-px-4 cds-py-2 cds-text-sm cds-font-bold cds-text-primary-foreground hover:cds-bg-accent ${b}`,children:l?t.jsxs(t.Fragment,{children:[n," from ",t.jsx("span",{"data-credify-redact":!0,children:l.name})]}):n})]})]})})};export{k as U,P as c,M as l,E as s,U as u};
6
+ */const N=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],k=f("user-round-check",N);var K={applicant:{gender:"gender",marital_status:"marital_status",employment_industry:"industry",occupation:"occupation"},applicantSsn:{social_security_number:"social_security_number"},coApplicant:{co_applicant_first_name:"first_name",co_applicant_middle_name:"middle_name",co_applicant_last_name:"last_name",co_applicant_date_of_birth:"date_of_birth",co_applicant_gender:"gender",co_applicant_marital_status:"marital_status",co_applicant_employment_industry:"industry",co_applicant_occupation:"occupation",co_applicant_relationship:"relationship_to_insured"},driverFromApplicant:{first_name:"first_name",last_name:"last_name",date_of_birth:"date_of_birth",gender:"gender",marital_status:"marital_status",industry:"employment_industry",occupation:"occupation",social_security_number:"social_security_number"}},S={applicant:{industryKey:"employment_industry",occupationKey:"occupation"},coApplicant:{industryKey:"co_applicant_employment_industry",occupationKey:"co_applicant_occupation"},driverFromApplicant:{industryKey:"industry",occupationKey:"occupation"}},w={Separated:["Seperated"],Seperated:["Separated"],DomesticPartner:["Domestic Partner"],"Domestic Partner":["DomesticPartner"]},A=(a,s)=>{let e=a.options;if(!Array.isArray(e)||e.length===0)return s;let n=String(s);return e.includes(n)?s:(w[n]??[]).find(c=>e.includes(c))},h=(a,s="")=>[a[`${s}first_name`],a[`${s}last_name`]].map(e=>String(e??"").trim()).filter(Boolean).join(" "),P=a=>h(a),M=(a,s={})=>j(a,"drivers").flatMap((e,n)=>{if(s.exclude?.(e,n))return[];let c=h(e);return c||!y(e.date_of_birth)?[{index:n,name:c||`Driver ${n+1}`}]:[]}),U=({kind:a,source:s,targetQuestions:e})=>{let n=new Map(e.map(d=>[d.key,d])),c={};for(let[d,o]of Object.entries(K[a])){let p=n.get(d);if(!p)continue;let m=s[o];if(y(m,p.inputType))continue;let l=A(p,m);l!==void 0&&(c[d]=l)}let i=S[a];return i&&c[i.occupationKey]!==void 0&&(g(c[i.industryKey])?.includes(String(c[i.occupationKey]))||delete c[i.occupationKey]),c},E=({heading:a,body:s,candidates:e,applyLabel:n="Use these details",onApply:c})=>{let[i,d]=_.useState(e[0]?.index??0),[o,p]=_.useState(null);if(!e.length)return null;if(o)return t.jsxs("p",{className:"cds-mb-4 cds-flex cds-items-center cds-gap-2 cds-text-sm cds-text-fg-muted","aria-live":"polite",children:[t.jsx(v,{"aria-hidden":"true",className:"cds-h-4 cds-w-4 cds-shrink-0 cds-text-accent"}),"Filled ",o.count," ",o.count===1?"answer":"answers"," from ",t.jsx("span",{"data-credify-redact":!0,children:o.name}),". Change anything below that is not right."]});let m=()=>{let r=e.find(x=>x.index===i)??e[0];if(!r)return;let u=c(r.index);u>0&&p({name:r.name,count:u})},l=e.length===1?e[0]:void 0;return t.jsx("div",{className:"cds-mb-5 cds-rounded-xl cds-border cds-border-accent/40 cds-bg-highlight cds-p-4",children:t.jsxs("div",{className:"cds-flex cds-items-start cds-gap-3",children:[t.jsx(k,{"aria-hidden":"true",className:"cds-mt-0.5 cds-h-5 cds-w-5 cds-shrink-0 cds-text-accent"}),t.jsxs("div",{className:"cds-min-w-0 cds-flex-1",children:[t.jsx("h3",{className:"cds-text-sm cds-font-bold cds-text-fg",children:a}),t.jsx("p",{className:"cds-mt-0.5 cds-text-sm cds-text-fg-muted",children:s}),l?null:t.jsxs("fieldset",{className:"cds-mt-3",children:[t.jsx("legend",{className:"sr-only",children:a}),t.jsx("div",{className:"cds-space-y-1.5",children:e.map(r=>t.jsxs("label",{className:"cds-flex cds-cursor-pointer cds-items-center cds-gap-2 cds-text-sm cds-text-fg",children:[t.jsx("input",{type:"radio",name:`copy-source-${a.replace(/\W+/g,"-")}`,checked:i===r.index,onChange:()=>d(r.index)}),t.jsx("span",{"data-credify-redact":!0,className:"cds-font-semibold",children:r.name})]},r.index))})]}),t.jsx("button",{type:"button",onClick:m,className:`cds-mt-4 cds-rounded-lg cds-bg-accent cds-px-4 cds-py-2 cds-text-sm cds-font-bold cds-text-primary-foreground hover:cds-bg-accent ${b}`,children:l?t.jsxs(t.Fragment,{children:[n," from ",t.jsx("span",{"data-credify-redact":!0,children:l.name})]}):n})]})]})})};export{k as U,P as c,M as l,E as s,U as u};
@@ -1 +1 @@
1
- import{t as E}from"./iframe-Be9NY0jq.js";var b=E({COVERAGE_EDITED_KEY:()=>o,COVERAGE_SHARE_OF_DWELLING:()=>i,DWELLING_KEY:()=>s,PURCHASE_PRICE_KEY:()=>d,backfillRelatedCoverages:()=>g,coverageSharePercent:()=>p,deriveRelatedCoverages:()=>C,derivedCoverageAmount:()=>u,isCoverageEdited:()=>f,markCoverageEdited:()=>m,seedHomeCoverages:()=>A}),i={other_structures_coverage:.1,personal_property_coverage:.5,loss_of_use_coverage:.2},s="dwelling_replacement_cost",d="sale_price_cents",o="__coverage_edited",_=500,u=(r,e)=>Math.round(r*e/_)*_,p=r=>{let e=i[r];return e===void 0?null:Math.round(e*100)},c=r=>{let e=r[o];return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]},f=(r,e)=>c(r).includes(e),a=r=>{let e=String(r??"").replace(/\D/g,"");if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null},m=(r,e,t)=>{if(i[e]===void 0)return{};let l=c(r);return a(t)===null?l.includes(e)?{[o]:l.filter(n=>n!==e)}:{}:l.includes(e)?{}:{[o]:[...l,e]}},C=(r,e)=>{let t=a(e);if(t===null)return{};let l={};for(let[n,v]of Object.entries(i))f(r,n)||(l[n]=u(t,v));return l},g=r=>{let e=a(r[s]);if(e===null)return{};let t={};for(let[l,n]of Object.entries(i))a(r[l])===null&&(t[l]=u(e,n));return t},A=r=>{let e={};if(a(r.dwelling_replacement_cost)===null){let t=a(r[d]);t!==null&&(e[s]=t)}return{...e,...g({...r,...e})}};export{g as a,C as c,m as d,A as f,d as i,u as l,i as n,b as o,s as r,p as s,o as t,f as u};
1
+ import{t as E}from"./iframe-ku_diR98.js";var b=E({COVERAGE_EDITED_KEY:()=>o,COVERAGE_SHARE_OF_DWELLING:()=>i,DWELLING_KEY:()=>s,PURCHASE_PRICE_KEY:()=>d,backfillRelatedCoverages:()=>g,coverageSharePercent:()=>p,deriveRelatedCoverages:()=>C,derivedCoverageAmount:()=>u,isCoverageEdited:()=>f,markCoverageEdited:()=>m,seedHomeCoverages:()=>A}),i={other_structures_coverage:.1,personal_property_coverage:.5,loss_of_use_coverage:.2},s="dwelling_replacement_cost",d="sale_price_cents",o="__coverage_edited",_=500,u=(r,e)=>Math.round(r*e/_)*_,p=r=>{let e=i[r];return e===void 0?null:Math.round(e*100)},c=r=>{let e=r[o];return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]},f=(r,e)=>c(r).includes(e),a=r=>{let e=String(r??"").replace(/\D/g,"");if(!e)return null;let t=Number(e);return Number.isFinite(t)&&t>0?t:null},m=(r,e,t)=>{if(i[e]===void 0)return{};let l=c(r);return a(t)===null?l.includes(e)?{[o]:l.filter(n=>n!==e)}:{}:l.includes(e)?{}:{[o]:[...l,e]}},C=(r,e)=>{let t=a(e);if(t===null)return{};let l={};for(let[n,v]of Object.entries(i))f(r,n)||(l[n]=u(t,v));return l},g=r=>{let e=a(r[s]);if(e===null)return{};let t={};for(let[l,n]of Object.entries(i))a(r[l])===null&&(t[l]=u(e,n));return t},A=r=>{let e={};if(a(r.dwelling_replacement_cost)===null){let t=a(r[d]);t!==null&&(e[s]=t)}return{...e,...g({...r,...e})}};export{g as a,C as c,m as d,A as f,d as i,u as l,i as n,b as o,s as r,p as s,o as t,f as u};