@getcredify/credify-insurance-widget 1.45.0 → 1.47.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.
- package/dist/{address-BEVwov8q-BHA-1zzm.js → address-BEVwov8q-CFogwodr.js} +1 -1
- package/dist/api-EzrQ6TjH.js +53 -0
- package/dist/{car-B8Sfr377.js → car-CxlVKO91.js} +1 -1
- package/dist/{check-B8qTJ1zD.js → check-BAikbl_K.js} +1 -1
- package/dist/{copy-applicant-offer-BPo842pD-COcsLcbo.js → copy-applicant-offer-UApiJBeU-BesLtSKE.js} +3 -3
- package/dist/{copy-from-record-DL503itm-B05F775l.js → copy-from-record-DL503itm-Cr4NH27U.js} +8 -8
- package/dist/{coverageDerivation-CV2ORogj-D4IAkVAP.js → coverageDerivation-CV2ORogj-C2Nwlsa1.js} +1 -1
- package/dist/{fixtures-ijbZ16Zg-CB6WPBEx.js → fixtures-ijbZ16Zg-B9zEGweJ.js} +1 -1
- package/dist/{household-prefill-DJ-Y0NcP-TwmnYrqf.js → household-prefill-BwSS00qI-Cngp1yri.js} +22 -22
- package/dist/{householdPrefill-DLm3pxFH-Gudko0w4.js → householdPrefill-DLm3pxFH-CSdgf8cD.js} +1 -1
- package/dist/iframe/assets/{address-BEVwov8q-RcBegFnh.js → address-BEVwov8q-CQFQYwN_.js} +1 -1
- package/dist/iframe/assets/{car-DQIQf4LA.js → car-dMyHgJCm.js} +1 -1
- package/dist/iframe/assets/{check-BiNh2j82.js → check-vA4Wm8iT.js} +1 -1
- package/dist/iframe/assets/{copy-applicant-offer-BPo842pD-Cj352DzN.js → copy-applicant-offer-UApiJBeU-DoOvd5Iq.js} +1 -1
- package/dist/iframe/assets/{copy-from-record-DL503itm-B7hBbUhh.js → copy-from-record-DL503itm-Db_VVvOI.js} +1 -1
- package/dist/iframe/assets/{coverageDerivation-CV2ORogj-D3oRqD1U.js → coverageDerivation-CV2ORogj-gpaPp3-I.js} +1 -1
- package/dist/iframe/assets/{dob-calendar-RIJ5S6YU-vOGgSHSK.js → dob-calendar-RIJ5S6YU-Tg0d9tov.js} +1 -1
- package/dist/iframe/assets/{fixtures-ijbZ16Zg-BmEw6uDw.js → fixtures-ijbZ16Zg-Cbt1vB2m.js} +1 -1
- package/dist/iframe/assets/household-prefill-BwSS00qI-C8MTGR1p.js +1 -0
- package/dist/iframe/assets/{householdPrefill-DLm3pxFH-BZXueCa7.js → householdPrefill-DLm3pxFH-BMN6WUsw.js} +1 -1
- package/dist/iframe/assets/{iframe-ku_diR98.js → iframe-BqFwviRo.js} +29 -29
- package/dist/iframe/assets/{index-IiQzPjFm.js → index-CeDETFEQ.js} +2 -2
- package/dist/iframe/assets/{intake-review-panel-CWz2efw4-CP-sEc-j.js → intake-review-panel-CjiYTJXh-CxJXC0fl.js} +1 -1
- package/dist/iframe/assets/{mockJump-H1NFTDah-yzeq4yea.js → mockJump-DCZoGtRl-DqT1rb7l.js} +1 -1
- package/dist/iframe/assets/{payload-CQc06PZC-BxklUdmW.js → payload-DurIYSZk-Bq3ZDZQk.js} +1 -1
- package/dist/iframe/assets/{question-list-CcoyuyQD-DCzTkzeE.js → question-list-CjN64tfw-D8aGV13x.js} +3 -3
- package/dist/iframe/assets/rates-panel-B1xVYtTQ-CInEw7cd.js +17 -0
- package/dist/iframe/assets/{review-panel-CFVxGU7F-CqUUCDLK.js → review-panel-DuzWoTKP-Rwdzp6eC.js} +2 -2
- package/dist/iframe/assets/{stage-BSRsu--X-BAWfI2cm.js → stage-CnucLiNn-DuURgPad.js} +1 -1
- package/dist/iframe/assets/{validation-ELW00AsL-ytOMlsxG.js → validation-Db4WCn17-_NNdawKQ.js} +1 -1
- package/dist/iframe/assets/{vehicleCoverage-DI2dKrnI-DVXwPfxd.js → vehicleCoverage-CDBtkdww-Bo-t8CRG.js} +1 -1
- package/dist/iframe/assets/{visibility-CyRoLvg5-CxslMJYX.js → visibility-iwttXt0y-DNGCSVig.js} +1 -1
- package/dist/iframe/assets/{waves-vdL6w3zC.js → waves-DRA5QD6r.js} +1 -1
- package/dist/iframe/iframe.html +1 -1
- package/dist/{index-IZRzz1Mi.js → index-DBc8hvqD.js} +21 -21
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +95 -95
- package/dist/{intake-review-panel-CWz2efw4-BQ-Nog4K.js → intake-review-panel-CjiYTJXh-Cy_2auOe.js} +17 -17
- package/dist/{mockJump-H1NFTDah-CkqZVQxf.js → mockJump-DCZoGtRl-DBhd5ad0.js} +1 -1
- package/dist/{payload-CQc06PZC-KA6cBCno.js → payload-DurIYSZk-CKtSbWzb.js} +22 -22
- package/dist/{question-list-CcoyuyQD-_c4J4n0G.js → question-list-CjN64tfw-BpPrkylH.js} +13 -13
- package/dist/{rates-panel-MXCbnqpL-DGYBAFto.js → rates-panel-B1xVYtTQ-BUF3Ofoi.js} +237 -222
- package/dist/{review-panel-CFVxGU7F-CtO3WmnD.js → review-panel-DuzWoTKP-BfwFC6Jz.js} +57 -57
- package/dist/{stage-BSRsu--X-DJs8ps3K.js → stage-CnucLiNn-CjHsEHOW.js} +4 -4
- package/dist/{validation-ELW00AsL-C4xgPdbr.js → validation-Db4WCn17-DiPhPmjM.js} +2 -2
- package/dist/{vehicleCoverage-DI2dKrnI-Lq9BCjQm.js → vehicleCoverage-CDBtkdww-Bm9pGAq7.js} +3 -3
- package/dist/{visibility-CyRoLvg5-DNRgF2sH.js → visibility-iwttXt0y-DtOOYFcv.js} +1 -1
- package/dist/{waves-DM8Lgssk.js → waves-oZRnENZl.js} +1 -1
- package/dist/{widget-3S1xkGig.js → widget-CpC6N1oq.js} +1320 -1286
- package/package.json +2 -2
- package/dist/api-BLmgLEy-.js +0 -51
- package/dist/iframe/assets/household-prefill-DJ-Y0NcP-z6AnkJcR.js +0 -1
- package/dist/iframe/assets/rates-panel-MXCbnqpL-TFkvW-DN.js +0 -17
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { j as i, e as o, A as t, P as r, a as u, d as l, X as n, r as d, q as p, b as f, H as g, Y as c, Q as m, c as S, h as T, k as h, F as y, M as Q, N as k, f as A, g as E, D as R, _ as v, x as P, E as C, O as _, J as O, i as U, v as V, Z as b, S as D, B as F, R as I, n as B, u as K, T as L, l as M, C as Y, w as Z, m as q, V as x, o as G, z as H, y as N, p as j, s as w } from "./widget-CpC6N1oq.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 captureLandingUtm,
|
|
15
|
+
p as captureResumeTokenFromUrl,
|
|
16
|
+
f as cityFromZip,
|
|
17
|
+
g as clearQuoteSession,
|
|
18
|
+
c as configureApi,
|
|
19
|
+
m as configureZipCityLookup,
|
|
20
|
+
S as consumeResumeToken,
|
|
21
|
+
T as createQuote,
|
|
22
|
+
h as decodeVin,
|
|
23
|
+
y as dismissDriverPrefill,
|
|
24
|
+
Q as dismissVehiclePrefill,
|
|
25
|
+
k as fetchDriverPrefillSuggestions,
|
|
26
|
+
A as fetchVehiclePrefillSuggestions,
|
|
27
|
+
E as getApiConfig,
|
|
28
|
+
R as getQuestionsByStage,
|
|
29
|
+
v as getQuote,
|
|
30
|
+
P as getRates,
|
|
31
|
+
C as getStagesForQuote,
|
|
32
|
+
_ as getVehicleOptions,
|
|
33
|
+
O as hasResumeToken,
|
|
34
|
+
U as isMockEnabled,
|
|
35
|
+
V as isSupportedState,
|
|
36
|
+
b as isTestModeEnabled,
|
|
37
|
+
D as issueResumeLink,
|
|
38
|
+
F as loadAuthToken,
|
|
39
|
+
I as loadQuoteId,
|
|
40
|
+
B as parseUtm,
|
|
41
|
+
K as post,
|
|
42
|
+
L as prefillProperty,
|
|
43
|
+
M as prefillSuggestions,
|
|
44
|
+
Y as redeemResumeToken,
|
|
45
|
+
Z as requestBind,
|
|
46
|
+
q as resetApiConfig,
|
|
47
|
+
x as resetPrefillSuggestions,
|
|
48
|
+
G as saveAuthToken,
|
|
49
|
+
H as saveQuoteId,
|
|
50
|
+
N as sendSmsCode,
|
|
51
|
+
j as updateQuote,
|
|
52
|
+
w as verifySmsCode
|
|
53
|
+
};
|
package/dist/{copy-applicant-offer-BPo842pD-COcsLcbo.js → copy-applicant-offer-UApiJBeU-BesLtSKE.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as d } from "./widget-
|
|
2
|
-
import { k as y, j as h } from "./visibility-
|
|
3
|
-
import { u as m, l as f, s as c } from "./copy-from-record-DL503itm-
|
|
1
|
+
import { t as d } from "./widget-CpC6N1oq.js";
|
|
2
|
+
import { k as y, j as h } from "./visibility-iwttXt0y-DtOOYFcv.js";
|
|
3
|
+
import { u as m, l as f, s as c } from "./copy-from-record-DL503itm-Cr4NH27U.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() {
|
package/dist/{copy-from-record-DL503itm-B05F775l.js → copy-from-record-DL503itm-Cr4NH27U.js}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { j as N } from "./visibility-
|
|
3
|
-
import { k as f } from "./validation-
|
|
1
|
+
import { a6 as x, a7 as b, K as v } from "./widget-CpC6N1oq.js";
|
|
2
|
+
import { j as N } from "./visibility-iwttXt0y-DtOOYFcv.js";
|
|
3
|
+
import { k as f } from "./validation-Db4WCn17-DiPhPmjM.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-
|
|
6
|
+
import { C as K } from "./check-BAikbl_K.js";
|
|
7
7
|
(function() {
|
|
8
8
|
if (typeof t > "u")
|
|
9
9
|
var t = { env: {} };
|
|
@@ -78,7 +78,7 @@ var A = {
|
|
|
78
78
|
index: i,
|
|
79
79
|
name: a || `Driver ${i + 1}`
|
|
80
80
|
}] : [];
|
|
81
|
-
}),
|
|
81
|
+
}), O = ({ 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
|
-
},
|
|
93
|
+
}, Q = ({ 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", {
|
|
@@ -184,6 +184,6 @@ export {
|
|
|
184
184
|
w as U,
|
|
185
185
|
L as c,
|
|
186
186
|
B as l,
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
Q as s,
|
|
188
|
+
O as u
|
|
189
189
|
};
|
package/dist/{household-prefill-DJ-Y0NcP-TwmnYrqf.js → household-prefill-BwSS00qI-Cngp1yri.js}
RENAMED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import { U as
|
|
3
|
-
import { j as
|
|
4
|
-
import { useState as u, useRef as C, useEffect as
|
|
1
|
+
import { t as U, F as z, P as E, l as p, M as L, a as q, K as w } from "./widget-CpC6N1oq.js";
|
|
2
|
+
import { U as B, y as D, h as F, m as H, d as K, u as M, l as R } from "./householdPrefill-DLm3pxFH-CSdgf8cD.js";
|
|
3
|
+
import { j as T } from "./visibility-iwttXt0y-DtOOYFcv.js";
|
|
4
|
+
import { useState as u, useRef as C, useEffect as I } from "react";
|
|
5
5
|
import { jsx as d, jsxs as r } from "react/jsx-runtime";
|
|
6
|
-
import { C as
|
|
6
|
+
import { C as G } from "./car-CxlVKO91.js";
|
|
7
7
|
(function() {
|
|
8
8
|
if (typeof t > "u")
|
|
9
9
|
var t = { env: {} };
|
|
10
10
|
})();
|
|
11
|
-
var de = /* @__PURE__ */
|
|
11
|
+
var de = /* @__PURE__ */ U({ HouseholdPrefill: () => Q }), J = {
|
|
12
12
|
vehicle: {
|
|
13
13
|
fetch: p.vehicle.fetch,
|
|
14
14
|
peek: p.vehicle.peek,
|
|
15
15
|
apply: q,
|
|
16
16
|
dismiss: L,
|
|
17
|
-
mergeInto:
|
|
17
|
+
mergeInto: H,
|
|
18
18
|
skip: () => !1,
|
|
19
19
|
alreadyPresent: () => !1,
|
|
20
|
-
icon:
|
|
20
|
+
icon: G,
|
|
21
21
|
heading: (t) => t === 1 ? "We found a vehicle at your address" : `We found ${t} vehicles at your address`,
|
|
22
22
|
body: "Pick the ones you want covered and we'll fill in the details.",
|
|
23
23
|
decline: "I'll add them myself",
|
|
@@ -27,23 +27,23 @@ var de = /* @__PURE__ */ O({ HouseholdPrefill: () => Q }), M = {
|
|
|
27
27
|
fetch: p.driver.fetch,
|
|
28
28
|
peek: p.driver.peek,
|
|
29
29
|
apply: E,
|
|
30
|
-
dismiss:
|
|
31
|
-
mergeInto:
|
|
32
|
-
skip:
|
|
33
|
-
alreadyPresent: (t, c) =>
|
|
34
|
-
icon:
|
|
30
|
+
dismiss: z,
|
|
31
|
+
mergeInto: F,
|
|
32
|
+
skip: D,
|
|
33
|
+
alreadyPresent: (t, c) => T(t, "drivers").some((i) => K(R(i), M(c.label))),
|
|
34
|
+
icon: B,
|
|
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:
|
|
41
|
-
let s =
|
|
42
|
-
|
|
40
|
+
}, Q = ({ kind: t, quoteId: c, values: i, onApply: P }) => {
|
|
41
|
+
let s = J[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"), [$, A] = u(n ?? []), [o, x] = u(() => new Set((n ?? []).filter((e) => e.alreadyOnApplication).map((e) => e.id))), N = C(!1), k = C(i);
|
|
42
|
+
I(() => {
|
|
43
43
|
k.current = i;
|
|
44
|
-
}),
|
|
44
|
+
}), I(() => {
|
|
45
45
|
!c || N.current || g || (N.current = !0, s.fetch(c).then((e) => {
|
|
46
|
-
|
|
46
|
+
A(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
|
}));
|
|
@@ -74,7 +74,7 @@ var de = /* @__PURE__ */ O({ HouseholdPrefill: () => Q }), M = {
|
|
|
74
74
|
})
|
|
75
75
|
});
|
|
76
76
|
if (h !== "offering" && h !== "applying") return null;
|
|
77
|
-
let y =
|
|
77
|
+
let y = $.filter((e) => !s.alreadyPresent(i, e));
|
|
78
78
|
if (!y.length) return null;
|
|
79
79
|
let W = (e) => {
|
|
80
80
|
x((l) => {
|
|
@@ -85,8 +85,8 @@ var de = /* @__PURE__ */ O({ HouseholdPrefill: () => Q }), M = {
|
|
|
85
85
|
if (!c || !o.size) return;
|
|
86
86
|
a("applying");
|
|
87
87
|
let e = await s.apply([...o], c);
|
|
88
|
-
e.length &&
|
|
89
|
-
},
|
|
88
|
+
e.length && P(s.mergeInto(k.current, e)), a("done");
|
|
89
|
+
}, O = () => {
|
|
90
90
|
a("done"), c && s.dismiss(c);
|
|
91
91
|
}, m = h === "applying";
|
|
92
92
|
return /* @__PURE__ */ d("div", {
|
|
@@ -135,7 +135,7 @@ var de = /* @__PURE__ */ O({ HouseholdPrefill: () => Q }), M = {
|
|
|
135
135
|
}), /* @__PURE__ */ d("button", {
|
|
136
136
|
type: "button",
|
|
137
137
|
disabled: m,
|
|
138
|
-
onClick:
|
|
138
|
+
onClick: O,
|
|
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 +1 @@
|
|
|
1
|
-
import{t as _}from"./iframe-
|
|
1
|
+
import{t as _}from"./iframe-BqFwviRo.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 +1 @@
|
|
|
1
|
-
import{t as y,r as s,
|
|
1
|
+
import{t as y,r as s,a as d}from"./iframe-BqFwviRo.js";import{k as h,j as m}from"./visibility-iwttXt0y-DNGCSVig.js";import{u as c,l as b,s as g}from"./copy-from-record-DL503itm-Db_VVvOI.js";import"./types-LUGvo5ic-CB-wcgK3.js";import"./validation-Db4WCn17-_NNdawKQ.js";import"./check-vA4Wm8iT.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,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{l as f,I as g,r as _,a as t,f as b}from"./iframe-BqFwviRo.js";import{j}from"./visibility-iwttXt0y-DNGCSVig.js";import{k as y}from"./validation-Db4WCn17-_NNdawKQ.js";import{C as v}from"./check-vA4Wm8iT.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 E}from"./iframe-
|
|
1
|
+
import{t as E}from"./iframe-BqFwviRo.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};
|