@getcredify/credify-insurance-widget 1.41.1 → 1.42.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/README.md +91 -0
- package/dist/address-BEVwov8q-C8G87tij.js +59 -0
- package/dist/api-C7f0dnt7.js +51 -0
- package/dist/car-B0hJrE0Z.js +26 -0
- package/dist/check-Dfh9u4c0.js +15 -0
- package/dist/copy-applicant-offer-B-BIN2o5-BX-QE7Ao.js +56 -0
- package/dist/copy-from-record-BNP6CFFR-Bcb9EW-a.js +189 -0
- package/dist/core-Po4qPIof-fZL0sXdW.js +417 -0
- package/dist/coverageDerivation-CV2ORogj-CAthw76f.js +76 -0
- package/dist/credify-insurance-widget.css +1 -1
- package/dist/{fixtures-ijbZ16Zg-BfdDTLYu.js → fixtures-ijbZ16Zg-Csnryzo8.js} +1 -1
- package/dist/household-prefill-DVLBBva1-GGgzEdDL.js +151 -0
- package/dist/householdPrefill-DLm3pxFH-B34UGBGP.js +111 -0
- package/dist/iframe/assets/address-BEVwov8q-BpbNiia-.js +1 -0
- package/dist/iframe/assets/car-DkfXVYz0.js +6 -0
- package/dist/iframe/assets/check-l6TGSrXO.js +6 -0
- package/dist/iframe/assets/copy-applicant-offer-B-BIN2o5-cs-SCWuH.js +1 -0
- package/dist/iframe/assets/copy-from-record-BNP6CFFR-BtCRUQRw.js +6 -0
- package/dist/iframe/assets/core-Po4qPIof-jDmdAxP7.js +16 -0
- package/dist/iframe/assets/coverageDerivation-CV2ORogj-DhQFAhwv.js +1 -0
- package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DO_r0-z3.js +1 -0
- package/dist/iframe/assets/{fixtures-ijbZ16Zg-DbpkZfa3.js → fixtures-ijbZ16Zg-CUQxYANz.js} +1 -1
- package/dist/iframe/assets/household-prefill-DVLBBva1-DTK1EHT0.js +1 -0
- package/dist/iframe/assets/householdPrefill-DLm3pxFH-BM54Rqyd.js +6 -0
- package/dist/iframe/assets/iframe-BImWklE9.js +107 -0
- package/dist/iframe/assets/iframe-Bl0qTZgO.css +1 -0
- package/dist/iframe/assets/index-CNb9AhPB.js +6 -0
- package/dist/iframe/assets/intake-review-panel-B7rXvRvm-wNGntinn.js +1 -0
- package/dist/iframe/assets/{mockJump-CL8w249w-Bp9W72n5.js → mockJump-DpXrnQUq-DKyp2H5R.js} +1 -1
- package/dist/iframe/assets/payload-JXpCaeS6-CcfrGvLo.js +1 -0
- package/dist/iframe/assets/question-list-ChcBzofd-D5ZVofFR.js +317 -0
- package/dist/iframe/assets/rates-panel-BaIzEqX6-GSsykLkc.js +17 -0
- package/dist/iframe/assets/review-panel-DYCuhwdo-CyBebe6T.js +6 -0
- package/dist/iframe/assets/stage-Bpq1A5xB-CwZgWOhp.js +1 -0
- package/dist/iframe/assets/types-LUGvo5ic-CB-wcgK3.js +1 -0
- package/dist/iframe/assets/validation-DRqHT-u7-pY2KjHw4.js +3 -0
- package/dist/iframe/assets/vehicleCoverage-BPJaWQyg-DBJ_jL3e.js +1 -0
- package/dist/iframe/assets/visibility-hEdBjgi7-_AUGO8E2.js +1 -0
- package/dist/iframe/iframe.html +2 -2
- package/dist/index-CQXR1Un8.js +354 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.es.js +4 -4
- package/dist/index.umd.js +105 -115
- package/dist/intake-review-panel-B7rXvRvm-CDyR-rVg.js +186 -0
- package/dist/{mockJump-CL8w249w-1jjBaNyK.js → mockJump-DpXrnQUq-BaitU9aZ.js} +1 -1
- package/dist/payload-JXpCaeS6-pjITtvlm.js +128 -0
- package/dist/question-list-ChcBzofd-fVRN9fTl.js +6505 -0
- package/dist/rates-panel-BaIzEqX6-BULjKxqz.js +1001 -0
- package/dist/review-panel-DYCuhwdo-BImR4S06.js +903 -0
- package/dist/stage-Bpq1A5xB-Cphc07aC.js +197 -0
- package/dist/types-LUGvo5ic-CiVRcsV9.js +9 -0
- package/dist/utils/assets.d.ts +12 -0
- package/dist/utils/branding.d.ts +21 -0
- package/dist/utils/partner.d.ts +32 -0
- package/dist/utils/support/bland.d.ts +5 -0
- package/dist/validation-DRqHT-u7-CL2m7f4k.js +2852 -0
- package/dist/vehicleCoverage-BPJaWQyg-g7bBFmro.js +144 -0
- package/dist/visibility-hEdBjgi7-WW4BVjmf.js +198 -0
- package/dist/widget-BUAzkBEK.js +13061 -0
- package/package.json +2 -2
- package/dist/api-Cjj6Dfhg.js +0 -51
- package/dist/iframe/assets/dob-calendar-RIJ5S6YU-DMJbmHdB.js +0 -1
- package/dist/iframe/assets/iframe-DFqQdMHv.css +0 -1
- package/dist/iframe/assets/iframe-iPSy7w5L.js +0 -494
- package/dist/widget-Umfy69_M.js +0 -27318
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { t as h } from "./widget-BUAzkBEK.js";
|
|
2
|
+
import { _ as f } from "./visibility-hEdBjgi7-WW4BVjmf.js";
|
|
3
|
+
import { O as p } from "./validation-DRqHT-u7-CL2m7f4k.js";
|
|
4
|
+
(function() {
|
|
5
|
+
if (typeof o > "u")
|
|
6
|
+
var o = { env: {} };
|
|
7
|
+
})();
|
|
8
|
+
var x = /* @__PURE__ */ h({
|
|
9
|
+
DRIVER_ASSIGNMENTS_KEY: () => _,
|
|
10
|
+
VEHICLE_COVERAGE_KEYS: () => u,
|
|
11
|
+
VEHICLE_COVERAGE_LABELS: () => b,
|
|
12
|
+
VEHICLE_POLICY_SELECTIONS_KEY: () => s,
|
|
13
|
+
assignmentsFor: () => H,
|
|
14
|
+
driverAssignmentError: () => N,
|
|
15
|
+
driverPercent: () => F,
|
|
16
|
+
ensureAutoCoverageSelections: () => y,
|
|
17
|
+
vehicleCoverageErrors: () => $,
|
|
18
|
+
vehicleCoverageOptions: () => w,
|
|
19
|
+
vehicleDisplayName: () => C,
|
|
20
|
+
withDriverPercent: () => S
|
|
21
|
+
}), s = "vehicle_policy_selections", y = (o, e) => o !== "AutoCurrentCarrier" || e.some((r) => r.key === "vehicle_policy_selections") ? [...e] : [...e, {
|
|
22
|
+
question: "Vehicle coverage selections",
|
|
23
|
+
inputType: "custom",
|
|
24
|
+
key: s,
|
|
25
|
+
required: !1
|
|
26
|
+
}], u = [
|
|
27
|
+
"vehicle_comp_deductible",
|
|
28
|
+
"vehicle_coll_deductible",
|
|
29
|
+
"vehicle_towing_and_labor",
|
|
30
|
+
"vehicle_transportation_expense"
|
|
31
|
+
], a = [
|
|
32
|
+
"NoCoverage",
|
|
33
|
+
"Zero",
|
|
34
|
+
"Fifty",
|
|
35
|
+
"Hundred",
|
|
36
|
+
"TwoHunderd",
|
|
37
|
+
"TwoHundredfifty",
|
|
38
|
+
"FiveHundred",
|
|
39
|
+
"Thousand",
|
|
40
|
+
"TwoThousand"
|
|
41
|
+
], c = [
|
|
42
|
+
"NoCoverage",
|
|
43
|
+
"Zero",
|
|
44
|
+
"Fifty",
|
|
45
|
+
"Hundred",
|
|
46
|
+
"TwoHunderd",
|
|
47
|
+
"TwoHundredfifty",
|
|
48
|
+
"FiveHundred",
|
|
49
|
+
"SeventyFiveHundred",
|
|
50
|
+
"Thousand",
|
|
51
|
+
"TwoThousand"
|
|
52
|
+
], g = [
|
|
53
|
+
"NoCoverage",
|
|
54
|
+
"TwentyFive",
|
|
55
|
+
"Forty",
|
|
56
|
+
"Fifty",
|
|
57
|
+
"SeventyFive",
|
|
58
|
+
"Eighty",
|
|
59
|
+
"Hundred",
|
|
60
|
+
"TwelveHundred",
|
|
61
|
+
"TwoHundred",
|
|
62
|
+
"Unlimited"
|
|
63
|
+
], m = [
|
|
64
|
+
"NoCoverage",
|
|
65
|
+
"TwentyFive",
|
|
66
|
+
"Fifty",
|
|
67
|
+
"SeventyFive",
|
|
68
|
+
"Hundred",
|
|
69
|
+
"TwoHundred",
|
|
70
|
+
"Unlimited"
|
|
71
|
+
], E = [
|
|
72
|
+
"NoCoverage",
|
|
73
|
+
"cov20to600",
|
|
74
|
+
"cov30to900",
|
|
75
|
+
"cov40to1200",
|
|
76
|
+
"cov50to1500"
|
|
77
|
+
], T = [
|
|
78
|
+
"NoCoverage",
|
|
79
|
+
"cov20to600",
|
|
80
|
+
"cov25to750",
|
|
81
|
+
"cov30to900",
|
|
82
|
+
"cov40to1200",
|
|
83
|
+
"cov50to1500",
|
|
84
|
+
"cov100to3000"
|
|
85
|
+
], C = (o, e) => [
|
|
86
|
+
o.year,
|
|
87
|
+
o.make,
|
|
88
|
+
o.model
|
|
89
|
+
].filter(Boolean).join(" ") || `Vehicle ${e + 1}`, b = {
|
|
90
|
+
vehicle_comp_deductible: "Comprehensive deductible",
|
|
91
|
+
vehicle_coll_deductible: "Collision deductible",
|
|
92
|
+
vehicle_towing_and_labor: "Towing and Labor",
|
|
93
|
+
vehicle_transportation_expense: "Transportation expense"
|
|
94
|
+
}, w = (o) => {
|
|
95
|
+
let e = f(o);
|
|
96
|
+
return {
|
|
97
|
+
vehicle_comp_deductible: e ? c : a,
|
|
98
|
+
vehicle_coll_deductible: e ? c : a,
|
|
99
|
+
vehicle_towing_and_labor: e ? m : g,
|
|
100
|
+
vehicle_transportation_expense: e ? T : E
|
|
101
|
+
};
|
|
102
|
+
}, _ = "driver_vehicle_assignments", H = (o) => {
|
|
103
|
+
let e = o[_];
|
|
104
|
+
return e && typeof e == "object" ? e : {};
|
|
105
|
+
}, F = (o, e, r) => o[`v${e}`]?.[`d${r}`], S = (o, e, r, t) => ({
|
|
106
|
+
...o,
|
|
107
|
+
[`v${e}`]: {
|
|
108
|
+
...o[`v${e}`] ?? {},
|
|
109
|
+
[`d${r}`]: t
|
|
110
|
+
}
|
|
111
|
+
}), N = (o, e, r) => {
|
|
112
|
+
if (r < 2) return null;
|
|
113
|
+
let t = o[`v${e}`];
|
|
114
|
+
if (!t) return null;
|
|
115
|
+
let i = Array.from({ length: r }, (n, v) => t[`d${v}`] ?? 0), l = i.filter((n) => n > 0);
|
|
116
|
+
if (l.length >= 2 && l.every((n) => n === 50)) return "Two drivers cannot both be at 50%. Give one of them the larger share.";
|
|
117
|
+
let d = i.reduce((n, v) => n + v, 0);
|
|
118
|
+
return d > 0 && d !== 100 ? `Driver percentages must add up to 100% (currently ${d}%).` : null;
|
|
119
|
+
}, $ = (o) => {
|
|
120
|
+
let e = [];
|
|
121
|
+
return o.forEach((r, t) => {
|
|
122
|
+
let i = {};
|
|
123
|
+
for (let l of u) p(r?.[l], "select") && (i[l] = "Required");
|
|
124
|
+
Object.keys(i).length && e.push({
|
|
125
|
+
index: t,
|
|
126
|
+
errorsByKey: i
|
|
127
|
+
});
|
|
128
|
+
}), e;
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
H as a,
|
|
132
|
+
y as c,
|
|
133
|
+
x as d,
|
|
134
|
+
C as f,
|
|
135
|
+
s as i,
|
|
136
|
+
$ as l,
|
|
137
|
+
u as n,
|
|
138
|
+
N as o,
|
|
139
|
+
S as p,
|
|
140
|
+
b as r,
|
|
141
|
+
F as s,
|
|
142
|
+
_ as t,
|
|
143
|
+
w as u
|
|
144
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { n as C } from "./types-LUGvo5ic-CiVRcsV9.js";
|
|
2
|
+
import { a3 as w } from "./widget-BUAzkBEK.js";
|
|
3
|
+
(function() {
|
|
4
|
+
if (typeof e > "u")
|
|
5
|
+
var e = { env: {} };
|
|
6
|
+
})();
|
|
7
|
+
var N = (e) => {
|
|
8
|
+
let r = (n, i) => n.map((o, l) => {
|
|
9
|
+
let u = i.length ? i.join("__") : "root", c = o.key ?? `${u}__q${l}_${String(o.question).slice(0, 24).replace(/\W+/g, "-") || "field"}`, s = (o.conditionals ?? []).map((t, a) => ({
|
|
10
|
+
...t,
|
|
11
|
+
conditionalQuestions: t.conditionalQuestions ? r(t.conditionalQuestions, [...i, `${c}__c${a}`]) : void 0
|
|
12
|
+
}));
|
|
13
|
+
return {
|
|
14
|
+
...o,
|
|
15
|
+
key: c,
|
|
16
|
+
conditionals: s
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
return r(e, []);
|
|
20
|
+
}, y = (e) => typeof e == "number" && Number.isFinite(e) ? e : typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? Number(e) : null, h = (e) => {
|
|
21
|
+
if (e instanceof Date && !Number.isNaN(e.getTime())) return e.getTime();
|
|
22
|
+
if (typeof e == "string") {
|
|
23
|
+
let r = Date.parse(e);
|
|
24
|
+
return Number.isNaN(r) ? null : r;
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}, f = (e, r) => {
|
|
28
|
+
let n = y(e), i = y(r);
|
|
29
|
+
if (n != null && i != null) return n - i;
|
|
30
|
+
let o = h(e), l = h(r);
|
|
31
|
+
return o != null && l != null ? o - l : e == null || r == null ? null : String(e).localeCompare(String(r));
|
|
32
|
+
}, b = (e, r) => Array.isArray(e) ? e.some((n) => n === r) : typeof e == "string" && r != null && e.includes(String(r)), D = (e, r, n) => {
|
|
33
|
+
switch (r) {
|
|
34
|
+
case "equals":
|
|
35
|
+
return e === n;
|
|
36
|
+
case "notEquals":
|
|
37
|
+
return e !== n && e !== "" && e != null;
|
|
38
|
+
case "lessThan": {
|
|
39
|
+
let i = f(e, n);
|
|
40
|
+
return i != null && i < 0;
|
|
41
|
+
}
|
|
42
|
+
case "greaterThan": {
|
|
43
|
+
let i = f(e, n);
|
|
44
|
+
return i != null && i > 0;
|
|
45
|
+
}
|
|
46
|
+
case "contains":
|
|
47
|
+
return b(e, n);
|
|
48
|
+
case "startsWith":
|
|
49
|
+
return e != null && n != null && String(e).startsWith(String(n));
|
|
50
|
+
case "endsWith":
|
|
51
|
+
return e != null && n != null && String(e).endsWith(String(n));
|
|
52
|
+
default:
|
|
53
|
+
return !1;
|
|
54
|
+
}
|
|
55
|
+
}, d = (e) => e.inputType !== "radio" || !e.options || e.options.length !== 1 || e.options[0] !== "Yes" ? !1 : (e.conditionals ?? []).some((r) => r.conditionalQuestionsAllowMultiple && r.conditionalType === "equals" && r.conditionalValue === "Yes"), x = (e, r) => d(e) ? "Yes" : r, Y = (e) => (e.conditionals ?? []).find((r) => r.conditionalQuestionsAllowMultiple), K = (e, r) => {
|
|
56
|
+
let n = x(e, r[e.key]), i = (e.conditionals ?? []).filter((o) => D(n, o.conditionalType, o.conditionalValue));
|
|
57
|
+
return i.length > 1 && !i.some((o) => o.conditionalQuestionsAllowMultiple) ? i.slice(0, 1) : i;
|
|
58
|
+
}, P = /* @__PURE__ */ new Set([
|
|
59
|
+
"additional_pip",
|
|
60
|
+
"tort_threshold",
|
|
61
|
+
"pip_coverage_type",
|
|
62
|
+
"extended_medical",
|
|
63
|
+
"policy_pip_deductible",
|
|
64
|
+
"is_corporation"
|
|
65
|
+
]), k = /* @__PURE__ */ new Set([
|
|
66
|
+
"anti_theft_type",
|
|
67
|
+
"passive_restraint_type",
|
|
68
|
+
"anti_lock_brakes",
|
|
69
|
+
"daytime_running_lights",
|
|
70
|
+
"vehicle_full_glass",
|
|
71
|
+
"vehicle_loan_lease",
|
|
72
|
+
"percent_to_work",
|
|
73
|
+
"stated_value_amount_cents",
|
|
74
|
+
"vehicle_comp_deductible",
|
|
75
|
+
"vehicle_coll_deductible",
|
|
76
|
+
"vehicle_towing_and_labor",
|
|
77
|
+
"vehicle_transportation_expense",
|
|
78
|
+
"accident_prevention_course",
|
|
79
|
+
"driver_accidents",
|
|
80
|
+
"driver_violations",
|
|
81
|
+
"losses",
|
|
82
|
+
"middle_name",
|
|
83
|
+
"ssn_display",
|
|
84
|
+
"auto_current_annual_premium_cents",
|
|
85
|
+
"has_co_applicant",
|
|
86
|
+
"co_applicant_middle_name",
|
|
87
|
+
"co_applicant_relationship"
|
|
88
|
+
]), I = /* @__PURE__ */ new Set([
|
|
89
|
+
"Home",
|
|
90
|
+
"HomeConstruction",
|
|
91
|
+
"HomeFeatures",
|
|
92
|
+
"Demographics"
|
|
93
|
+
]), T = /* @__PURE__ */ new Set(["HomePolicy", "BundlePolicy"]), Q = /* @__PURE__ */ new Set([
|
|
94
|
+
"HomeCustomer",
|
|
95
|
+
"BundleCustomer",
|
|
96
|
+
"Demographics"
|
|
97
|
+
]), A = (e) => {
|
|
98
|
+
if (typeof e != "string" || !e.trim()) return !1;
|
|
99
|
+
let r = e.trim().toLowerCase();
|
|
100
|
+
return r === "nj" || r === "n.j." || r === "n.j" || r === "new jersey";
|
|
101
|
+
}, g = (e) => !!e && A(e.state ?? e.State), S = (e, r, n) => e === "has_health_insurance_auto_accident" ? r === "BundleCustomer" || r === "Demographics" ? !1 : !g(n) : P.has(e) ? !g(n) : e === "household_size" ? !(r && I.has(r)) : e === "number_of_mortgagees" ? !(r && T.has(r)) : (e === "has_co_applicant" || e === "co_applicant_middle_name" || e === "co_applicant_relationship") && r && Q.has(r) ? !1 : e === "multi_policy_discount" && r === "HomePolicy" || k.has(e), E = /* @__PURE__ */ new Set([
|
|
102
|
+
"auto_prior_years",
|
|
103
|
+
"auto_prior_months",
|
|
104
|
+
"auto_continuous_coverage_years"
|
|
105
|
+
]), v = (e) => {
|
|
106
|
+
if (typeof e != "string") return null;
|
|
107
|
+
let r = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
108
|
+
if (!r) return null;
|
|
109
|
+
let [n, i, o] = [
|
|
110
|
+
Number(r[1]),
|
|
111
|
+
Number(r[2]),
|
|
112
|
+
Number(r[3])
|
|
113
|
+
];
|
|
114
|
+
if (i < 1 || i > 12 || o < 1 || o > 31) return null;
|
|
115
|
+
let l = new Date(Date.UTC(n, i - 1, o));
|
|
116
|
+
return l.getUTCFullYear() !== n || l.getUTCMonth() !== i - 1 || l.getUTCDate() !== o ? null : l.getTime();
|
|
117
|
+
}, p = (e, r) => {
|
|
118
|
+
if (!r.effectiveDateKey || !r.expirationDateKey) return !1;
|
|
119
|
+
let n = v(e[r.expirationDateKey]), i = v(e[r.effectiveDateKey]);
|
|
120
|
+
return n == null || i == null ? !1 : n < i;
|
|
121
|
+
}, $ = (e) => {
|
|
122
|
+
let r = null, n = null, i = null, o = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), u = (s) => {
|
|
123
|
+
let t = s.key ?? "", a = String(s.question ?? "").trim().toLowerCase();
|
|
124
|
+
!r && (t === "auto_prior_carrier_name" || t === "home_prior_carrier_name" || a.includes("current auto insurance company")) && (r = t), !n && (t === "effective_date" || a.includes("when do you need your insurance to begin")) && (n = t), !i && (t === "auto_prior_expiration_date" || t === "home_prior_expiration_date" || a.includes("when does the current policy expire")) && (i = t), (t === "auto_reason_for_no_insurance" || a.includes("reason you are not currently insured") || a.includes("reason for lapse in coverage")) && o.add(t), (t === "auto_prior_years" || t === "auto_prior_months" || t === "auto_continuous_coverage_years" || t === "auto_prior_expiration_date" || t === "auto_current_annual_premium_cents" || t === "auto_prior_liability_limit") && l.add(t);
|
|
125
|
+
};
|
|
126
|
+
e.forEach(u);
|
|
127
|
+
let c = (s) => {
|
|
128
|
+
s.forEach((t) => {
|
|
129
|
+
(t.conditionals ?? []).forEach((a) => {
|
|
130
|
+
let _ = a.conditionalQuestions ?? [];
|
|
131
|
+
_.forEach(u), c(_);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
return c(e), {
|
|
136
|
+
currentCarrierKey: r,
|
|
137
|
+
effectiveDateKey: n,
|
|
138
|
+
expirationDateKey: i,
|
|
139
|
+
noInsuranceReasonKeys: o,
|
|
140
|
+
hideWhenNoPriorInsuranceKeys: l
|
|
141
|
+
};
|
|
142
|
+
}, H = (e, r) => r.currentCarrierKey === "home_prior_carrier_name" && e.home_prior_carrier_name === "NoPriorInsurance" && e.auto_prior_carrier_name !== "NoPriorInsurance" ? !1 : (r.currentCarrierKey ? e[r.currentCarrierKey] : void 0) === "NoPriorInsurance" ? !0 : !r.effectiveDateKey || !r.expirationDateKey || r.expirationDateKey === "home_prior_expiration_date" && p(e, r) ? !1 : p(e, r), W = (e, r, n) => {
|
|
143
|
+
let i = e.key ?? "";
|
|
144
|
+
if (n.noInsuranceReasonKeys.has(i) && n.currentCarrierKey === "home_prior_carrier_name" && r.home_prior_carrier_name === "NoPriorInsurance" && r.auto_prior_carrier_name !== "NoPriorInsurance") return !1;
|
|
145
|
+
let o = (n.currentCarrierKey ? r[n.currentCarrierKey] : void 0) === "NoPriorInsurance";
|
|
146
|
+
return o && n.hideWhenNoPriorInsuranceKeys.has(i) ? !1 : !n.noInsuranceReasonKeys.has(i) || o ? !0 : H(r, n);
|
|
147
|
+
}, j = /* @__PURE__ */ new Set(["HomePolicy", "BundlePolicy"]), q = (e, r, n) => (e.key ?? "") !== "lapse_in_coverage" || !n || !j.has(n) || r.home_prior_carrier_name !== "NoPriorInsurance", M = (e, r) => {
|
|
148
|
+
let n = e.key ?? "";
|
|
149
|
+
if (n === "co_applicant_occupation" || n !== "occupation") return !0;
|
|
150
|
+
let i = String(r.industry ?? r.employment_industry ?? "").trim();
|
|
151
|
+
return !w.has(i);
|
|
152
|
+
}, F = (e, r, n) => {
|
|
153
|
+
let i = N(e), o = $(i), l = [], u = (c) => {
|
|
154
|
+
c.forEach((s) => {
|
|
155
|
+
if (!W(s, r, o) || !M(s, r) || !q(s, r, n)) return;
|
|
156
|
+
let t = s.key ?? "";
|
|
157
|
+
if (S(t, n, r)) {
|
|
158
|
+
let a = o.currentCarrierKey ? r[o.currentCarrierKey] : void 0;
|
|
159
|
+
if (!(a && a !== "NoPriorInsurance" && p(r, o) && E.has(t))) return;
|
|
160
|
+
}
|
|
161
|
+
d(s) || l.push(s), K(s, r).forEach((a) => {
|
|
162
|
+
let _ = a.conditionalQuestions ?? [];
|
|
163
|
+
_.length && (a.conditionalQuestionsAllowMultiple || u(_));
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
return u(i), l;
|
|
168
|
+
}, R = (e, r, n, i, o) => {
|
|
169
|
+
let l = N(e), u = [], c = (s) => {
|
|
170
|
+
s.forEach((t) => {
|
|
171
|
+
let a = t.key ?? "";
|
|
172
|
+
if (!S(a, i, n) && (o !== 0 || a !== "relationship_to_insured" && a !== "is_registered_owner")) {
|
|
173
|
+
if (a === "occupation") {
|
|
174
|
+
let _ = String(r.industry ?? r.employment_industry ?? "").trim();
|
|
175
|
+
if (w.has(_)) return;
|
|
176
|
+
}
|
|
177
|
+
d(t) || u.push(t), K(t, r).forEach((_) => {
|
|
178
|
+
let m = _.conditionalQuestions ?? [];
|
|
179
|
+
!m.length || _.conditionalQuestionsAllowMultiple || c(m);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
return c(l), u;
|
|
185
|
+
}, L = (e, r) => {
|
|
186
|
+
let n = e[C(r)];
|
|
187
|
+
return Array.isArray(n) ? n : [];
|
|
188
|
+
};
|
|
189
|
+
export {
|
|
190
|
+
R as A,
|
|
191
|
+
A as _,
|
|
192
|
+
d as c,
|
|
193
|
+
K as d,
|
|
194
|
+
L as j,
|
|
195
|
+
F as k,
|
|
196
|
+
N as n,
|
|
197
|
+
Y as u
|
|
198
|
+
};
|