bhl-forms 0.6.14 → 0.7.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 (94) hide show
  1. package/dist/bhl-forms.es.js +1757 -1759
  2. package/dist/bhl-forms.iife.js +4 -4
  3. package/dist/bhl-forms.modern.es.js +2804 -2811
  4. package/dist/bhl-forms.modern.iife.js +6 -6
  5. package/dist/bhl-forms.modern.umd.js +6 -6
  6. package/dist/bhl-forms.umd.js +4 -4
  7. package/dist/forms/accidentsAndInjuries.es.js +278 -215
  8. package/dist/forms/accidentsAndInjuries.iife.js +1 -1
  9. package/dist/forms/accidentsAndInjuries.json +1 -1
  10. package/dist/forms/appraisals.es.js +16 -7
  11. package/dist/forms/appraisals.iife.js +1 -1
  12. package/dist/forms/business.es.js +288 -226
  13. package/dist/forms/business.iife.js +1 -1
  14. package/dist/forms/business.json +1 -1
  15. package/dist/forms/childAndFamily.es.js +271 -214
  16. package/dist/forms/childAndFamily.iife.js +1 -1
  17. package/dist/forms/childAndFamily.json +1 -1
  18. package/dist/forms/childAndFamilySingle.es.js +614 -545
  19. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  20. package/dist/forms/childAndFamilySingle.json +1 -1
  21. package/dist/forms/civilLawsuit.es.js +608 -541
  22. package/dist/forms/civilLawsuit.iife.js +1 -1
  23. package/dist/forms/civilLawsuit.json +1 -1
  24. package/dist/forms/coins.es.js +16 -7
  25. package/dist/forms/coins.iife.js +1 -1
  26. package/dist/forms/contracts.es.js +275 -217
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +1 -1
  29. package/dist/forms/criminal.es.js +631 -562
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +1 -1
  32. package/dist/forms/divorce.es.js +614 -545
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +1 -1
  35. package/dist/forms/employmentAndWorkplace.es.js +555 -496
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +1 -1
  38. package/dist/forms/generalHomeImprovement.es.js +3224 -0
  39. package/dist/forms/generalHomeImprovement.iife.js +1 -0
  40. package/dist/forms/generalHomeImprovement.json +1 -0
  41. package/dist/forms/generalLegal.es.js +274 -216
  42. package/dist/forms/generalLegal.iife.js +1 -1
  43. package/dist/forms/generalLegal.json +1 -1
  44. package/dist/forms/generalLegalJustAnswer.es.js +4534 -0
  45. package/dist/forms/generalLegalJustAnswer.iife.js +1 -0
  46. package/dist/forms/generalLegalJustAnswer.json +1 -0
  47. package/dist/forms/generalLegalPopUnder.es.js +275 -217
  48. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  49. package/dist/forms/generalLegalPopUnder.json +1 -1
  50. package/dist/forms/generalLegalPopUnderSingle.es.js +645 -573
  51. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  52. package/dist/forms/generalLegalPopUnderSingle.json +1 -1
  53. package/dist/forms/generalLegalSingle.es.js +645 -573
  54. package/dist/forms/generalLegalSingle.iife.js +1 -1
  55. package/dist/forms/generalLegalSingle.json +1 -1
  56. package/dist/forms/generalLegalThankYou.es.js +137 -130
  57. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  58. package/dist/forms/generalLegalThankYouConsultation.es.js +647 -575
  59. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  60. package/dist/forms/generalLegalThankYouConsultation.json +1 -1
  61. package/dist/forms/harassmentAndDiscrimination.es.js +271 -214
  62. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  63. package/dist/forms/harassmentAndDiscrimination.json +1 -1
  64. package/dist/forms/landlordTenant.es.js +287 -230
  65. package/dist/forms/landlordTenant.iife.js +1 -1
  66. package/dist/forms/landlordTenant.json +1 -1
  67. package/dist/forms/malpractice.es.js +276 -217
  68. package/dist/forms/malpractice.iife.js +1 -1
  69. package/dist/forms/malpractice.json +1 -1
  70. package/dist/forms/mechanics.es.js +171 -165
  71. package/dist/forms/mechanics.iife.js +1 -1
  72. package/dist/forms/mechanics.json +1 -1
  73. package/dist/forms/patentsAndIP.es.js +617 -548
  74. package/dist/forms/patentsAndIP.iife.js +1 -1
  75. package/dist/forms/patentsAndIP.json +1 -1
  76. package/dist/forms/realEstate.es.js +272 -215
  77. package/dist/forms/realEstate.iife.js +1 -1
  78. package/dist/forms/realEstate.json +1 -1
  79. package/dist/forms/repossession.es.js +275 -217
  80. package/dist/forms/repossession.iife.js +1 -1
  81. package/dist/forms/repossession.json +1 -1
  82. package/dist/forms/ssdi.es.js +139 -138
  83. package/dist/forms/ssdi.iife.js +1 -1
  84. package/dist/forms/ssdi.json +1 -1
  85. package/dist/forms/testForm.es.js +55 -52
  86. package/dist/forms/testForm.iife.js +1 -1
  87. package/dist/forms/testRedirects.es.js +28 -22
  88. package/dist/forms/testRedirects.iife.js +1 -1
  89. package/dist/forms/vets.es.js +16 -7
  90. package/dist/forms/vets.iife.js +1 -1
  91. package/dist/forms/willsAndTrusts.es.js +272 -213
  92. package/dist/forms/willsAndTrusts.iife.js +1 -1
  93. package/dist/forms/willsAndTrusts.json +1 -1
  94. package/package.json +3 -3
@@ -6,14 +6,97 @@ function LegalRedirectUrl() {
6
6
  return 'https://listings.ziplawyer.com/api/v1/redirect?zone_id=4&vertical=Legal&category=${properties.Type_Of_Legal_Problem}&Degree_Of_Interest=${properties.Degree_Of_Interest}&zip_code=${properties.Zip}&sub_id=${properties.vid}'
7
7
  }
8
8
 
9
- var TCPA_LANGUAGE = "By checking this box, I a) agree to the Terms of Use, and b) consent to be contacted by lawyers, lawyer networks, and partners of this website using live, autodialed, pre-recorded, or artificial voice calls, as well as text messages. Your consent is not required as a condition of purchasing any goods or services. To submit this request without this consent, call 878-213-4937.";
10
-
11
- const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC = '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
12
- const DEFAULT_COMMENTS_LABEL = 'Please briefly describe your legal issue in a few words:';
13
- const DEFAULT_FINAL_HEADLINE = 'Submit Your Case';
14
- const DEFAULT_FINAL_HEADLINE_DYNAMIC = '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
15
- const DEFAULT_FINAL_SUBHEADLINE = 'You may benefit from speaking with a legal professional. Please verify your contact information.';
16
- const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC = '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
9
+ const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL = '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
10
+ const DEFAULT_COMMENTS_LABEL_LEGAL = 'Please briefly describe your legal issue in a few words:';
11
+ const DEFAULT_FINAL_HEADLINE_LEGAL = 'Submit Your Case';
12
+ const DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL = '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
13
+ const DEFAULT_FINAL_SUBHEADLINE_LEGAL = 'You may benefit from speaking with a legal professional. Please verify your contact information.';
14
+ const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL = '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
15
+ const TCPA_LANGUAGE_LEGAL = "By checking this box, I a) agree to the Terms of Use, and b) consent to be contacted by lawyers, lawyer networks, and partners of this website using live, autodialed, pre-recorded, or artificial voice calls, as well as text messages. Your consent is not required as a condition of purchasing any goods or services. To submit this request without this consent, call 878-213-4937.";
16
+ const defaultLegalImprovementCrossSells = {
17
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
18
+ 'Personal Injury': 'Personal or Workplace Injury',
19
+ 'DUI and DWI': 'Involved in a DUI/DWI',
20
+ 'Wills and Trusts': 'Need a Will or Trust',
21
+ 'Power of Attorney': 'Update Power of Attorney',
22
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
23
+ };
24
+ const CROSS_SELL_OPTION_MAP_LEGAL = {
25
+ // Values can be a list or a map of value -> display value
26
+ 'Auto and Car Accidents': {
27
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
28
+ 'Wills and Trusts': 'Need a Will or Trust',
29
+ 'Workers Compensation': 'Workplace Injury',
30
+ 'Power of Attorney': 'Update Power of Attorney',
31
+ 'Divorce and Separation': 'Need a Divorce or Separation',
32
+ 'Child Custody': 'Need help with Child Custody',
33
+ },
34
+ "Personal Injury": {
35
+ 'DUI and DWI': 'Involved in a DUI/DWI',
36
+ 'Wills and Trusts': 'Need a Will or Trust',
37
+ 'Power of Attorney': 'Update Power of Attorney',
38
+ 'Divorce and Separation': 'Need a Divorce or Separation',
39
+ 'Child Custody': 'Need help with Child Custody',
40
+ // TODO add one more?
41
+ },
42
+ "Workers Compensation": {
43
+ 'DUI and DWI': 'Involved in a DUI/DWI',
44
+ 'Wills and Trusts': 'Need a Will or Trust',
45
+ 'Power of Attorney': 'Update Power of Attorney',
46
+ 'Divorce and Separation': 'Need a Divorce or Separation',
47
+ 'Child Custody': 'Need help with Child Custody',
48
+ // TODO add one more?
49
+ },
50
+ "DUI and DWI": {
51
+ 'Personal Injury': 'Personal or Workplace Injury',
52
+ 'Wills and Trusts': 'Need a Will or Trust',
53
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
54
+ 'Power of Attorney': 'Update Power of Attorney',
55
+ 'Divorce and Separation': 'Need a Divorce or Separation',
56
+ 'Child Custody': 'Need help with Child Custody',
57
+ },
58
+ "Wills and Trusts": {
59
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
60
+ 'Personal Injury': 'Personal or Workplace Injury',
61
+ 'DUI and DWI': 'Involved in a DUI/DWI',
62
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
63
+ 'Divorce and Separation': 'Need a Divorce or Separation',
64
+ 'Child Custody': 'Need help with Child Custody',
65
+ },
66
+ "Probate and Estates": {
67
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
68
+ 'Personal Injury': 'Personal or Workplace Injury',
69
+ 'DUI and DWI': 'Involved in a DUI/DWI',
70
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
71
+ 'Divorce and Separation': 'Need a Divorce or Separation',
72
+ 'Child Custody': 'Need help with Child Custody',
73
+ },
74
+ "Power of Attorney": {
75
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
76
+ 'Personal Injury': 'Personal or Workplace Injury',
77
+ 'DUI and DWI': 'Involved in a DUI/DWI',
78
+ 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
79
+ 'Divorce and Separation': 'Need a Divorce or Separation',
80
+ 'Child Custody': 'Need help with Child Custody',
81
+ },
82
+ "Long Term Disability": {
83
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
84
+ 'DUI and DWI': 'Involved in a DUI/DWI',
85
+ 'Wills and Trusts': 'Need a Will or Trust',
86
+ 'Power of Attorney': 'Update Power of Attorney',
87
+ 'Divorce and Separation': 'Need a Divorce or Separation',
88
+ 'Child Custody': 'Need help with Child Custody',
89
+ },
90
+ "Social Security Disability and Insurance": {
91
+ 'Auto and Car Accidents': 'Injured in a Car Accident',
92
+ 'DUI and DWI': 'Involved in a DUI/DWI',
93
+ 'Wills and Trusts': 'Need a Will or Trust',
94
+ 'Power of Attorney': 'Update Power of Attorney',
95
+ 'Divorce and Separation': 'Need a Divorce or Separation',
96
+ 'Child Custody': 'Need help with Child Custody',
97
+ },
98
+ '*': defaultLegalImprovementCrossSells,
99
+ };
17
100
 
18
101
  // ------ Common Base Settings
19
102
 
@@ -186,6 +269,73 @@ const sbsDate = (updates) => {
186
269
  return date(updates)
187
270
  };
188
271
 
272
+ const email = (scope) => sbsText({
273
+ $formkit: 'email',
274
+ name: scope ? scope + ':' + 'Email' : 'Email',
275
+ label: 'Email Address:',
276
+ placeholder: 'email@domain.com',
277
+ autocomplete: 'email',
278
+ 'data-tf-sensitive': 'false',
279
+ validation: 'required|email',
280
+ validationMessages: {
281
+ required: 'Email is required',
282
+ email: 'Invalid Email'
283
+ }
284
+ });
285
+
286
+ const firstName = (scope) => sbsText({
287
+ label: 'First Name:',
288
+ placeholder: 'First',
289
+ name: scope ? scope + ':' + 'First_Name' : 'First_Name',
290
+ autocomplete: "given-name",
291
+ validationMessages: {
292
+ required: 'First Name is required'
293
+ }
294
+ });
295
+
296
+ const lastName = (scope) => sbsText({
297
+ label: 'Last Name:',
298
+ placeholder: 'Last',
299
+ name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
300
+ autocomplete: "family-name",
301
+ validationMessages: {
302
+ required: 'Last Name is required'
303
+ }
304
+ });
305
+
306
+ const phone = (scope) => sbsText({
307
+ $formkit: 'tel',
308
+ name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
309
+ label: 'Phone Number:',
310
+ placeholder: '###-###-####',
311
+ maxlength: 12,
312
+ help: '10-digit phone number, hyphens optional',
313
+ autocomplete: 'tel-national',
314
+ 'data-tf-sensitive': 'false',
315
+ validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
316
+ validationMessages: {
317
+ required: 'Field is required',
318
+ matches: 'Invalid Phone Format, use ###-###-####',
319
+ valid_phone: 'Invalid Phone Number'
320
+ },
321
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
322
+ });
323
+
324
+
325
+ const zipcode = (scope) => sbsText({
326
+ label: 'Zip Code:',
327
+ placeholder: '#####',
328
+ name: scope ? scope + ':' + 'Zip' : 'Zip',
329
+ maxlength: 5,
330
+ inputmode: "numeric",
331
+ autocomplete: 'postal-code',
332
+ validation: 'required|matches:/^[0-9]{5}$/',
333
+ validationMessages: {
334
+ required: 'Zip Code is required',
335
+ matches: 'Invalid Zip Code'
336
+ }
337
+ });
338
+
189
339
  const amountPaymentsPastDue = () => sbsSelect({
190
340
  label: 'Total Amount of Payments that are Past Due:',
191
341
  name: 'Amount_Payments_Past_Due',
@@ -736,20 +886,6 @@ const driversLicenseType = () => sbs2ItemRadio({
736
886
  ]
737
887
  });
738
888
 
739
- const email = (scope) => sbsText({
740
- $formkit: 'email',
741
- name: scope ? scope + ':' + 'Email' : 'Email',
742
- label: 'Email Address:',
743
- placeholder: 'email@domain.com',
744
- autocomplete: 'email',
745
- 'data-tf-sensitive': 'false',
746
- validation: 'required|email',
747
- validationMessages: {
748
- required: 'Email is required',
749
- email: 'Invalid Email'
750
- }
751
- });
752
-
753
889
  const employerType = () => sbsSelect({
754
890
  label: 'The Employer Is a:',
755
891
  name: 'Employer_Type',
@@ -798,16 +934,6 @@ const estateLegalServicesNeeded = (scope) => sbsSelect({
798
934
  ]
799
935
  });
800
936
 
801
- const firstName = (scope) => sbsText({
802
- $formkit: 'text',
803
- label: 'First Name:',
804
- placeholder: 'First',
805
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
806
- autocomplete: "given-name",
807
- validationMessages: {
808
- required: 'First Name is required'
809
- }
810
- });
811
937
 
812
938
  const TOLPOptions = [
813
939
  'Adoption',
@@ -955,17 +1081,6 @@ const incidentDate = (scope) => sbsDate({
955
1081
  label: 'Date of Incident:',
956
1082
  });
957
1083
 
958
- const lastName = (scope) => sbsText({
959
- $formkit: 'text',
960
- label: 'Last Name:',
961
- placeholder: 'Last',
962
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
963
- autocomplete: "family-name",
964
- validationMessages: {
965
- required: 'Last Name is required'
966
- }
967
- });
968
-
969
1084
  const landlordTenantParty = () => sbsSelect({
970
1085
  label: 'I am the:',
971
1086
  name: 'Landlord_Tenant_Party',
@@ -1024,69 +1139,7 @@ const legalCrossSells$1 = () => col2Checkbox({
1024
1139
  help: 'Just hit "Next" if none apply',
1025
1140
  helpClass: 't-text-center !t-text-sm',
1026
1141
  validation: null,
1027
- options: {
1028
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Auto and Car Accidents"',
1029
- then: {
1030
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
1031
- 'Wills and Trusts': 'Need a Will or Trust',
1032
- 'Workers Compensation': 'Workplace Injury',
1033
- 'Power of Attorney': 'Update Power of Attorney',
1034
- 'Divorce and Separation': 'Need a Divorce or Separation',
1035
- 'Child Custody': 'Need help with Child Custody',
1036
- },
1037
- else: {
1038
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Personal Injury" || $getVal($get(form), "Type_Of_Legal_Problem") === "Workers Compensation"',
1039
- then: {
1040
- 'DUI and DWI': 'Involved in a DUI/DWI',
1041
- 'Wills and Trusts': 'Need a Will or Trust',
1042
- 'Power of Attorney': 'Update Power of Attorney',
1043
- 'Divorce and Separation': 'Need a Divorce or Separation',
1044
- 'Child Custody': 'Need help with Child Custody',
1045
- // TODO add one more?
1046
- },
1047
- else: {
1048
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "DUI and DWI"',
1049
- then: {
1050
- 'Personal Injury': 'Personal or Workplace Injury',
1051
- 'Wills and Trusts': 'Need a Will or Trust',
1052
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
1053
- 'Power of Attorney': 'Update Power of Attorney',
1054
- 'Divorce and Separation': 'Need a Divorce or Separation',
1055
- 'Child Custody': 'Need help with Child Custody',
1056
- },
1057
- else: {
1058
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Wills and Trusts" || $getVal($get(form), "Type_Of_Legal_Problem") === "Probate and Estates" || $getVal($get(form), "Type_Of_Legal_Problem") === "Power of Attorney"',
1059
- then: {
1060
- 'Auto and Car Accidents': 'Injured in a Car Accident',
1061
- 'Personal Injury': 'Personal or Workplace Injury',
1062
- 'DUI and DWI': 'Involved in a DUI/DWI',
1063
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
1064
- 'Divorce and Separation': 'Need a Divorce or Separation',
1065
- 'Child Custody': 'Need help with Child Custody',
1066
- },
1067
- else: {
1068
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Long Term Disability" || $getVal($get(form), "Type_Of_Legal_Problem") === "Social Security Disability and Insurance"',
1069
- then: {
1070
- 'Auto and Car Accidents': 'Injured in a Car Accident',
1071
- 'DUI and DWI': 'Involved in a DUI/DWI',
1072
- 'Wills and Trusts': 'Need a Will or Trust',
1073
- 'Power of Attorney': 'Update Power of Attorney',
1074
- 'Divorce and Separation': 'Need a Divorce or Separation',
1075
- 'Child Custody': 'Need help with Child Custody',
1076
- },
1077
- else: {
1078
- 'Auto and Car Accidents': 'Injured in a Car Accident',
1079
- 'Personal Injury': 'Personal or Workplace Injury',
1080
- 'DUI and DWI': 'Involved in a DUI/DWI',
1081
- 'Wills and Trusts': 'Need a Will or Trust',
1082
- 'Power of Attorney': 'Update Power of Attorney',
1083
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
1084
- }
1085
- }
1086
- }
1087
- }
1088
- }
1089
- }
1142
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
1090
1143
  });
1091
1144
 
1092
1145
  const loanAmount = () => sbsSelect({
@@ -1183,24 +1236,6 @@ const pendingCharges = (scope) => sbsYesNoRadio({
1183
1236
  label: 'Do you currently have any pending charges?'
1184
1237
  });
1185
1238
 
1186
- const phone = (scope) => sbsText({
1187
- $formkit: 'tel',
1188
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
1189
- label: 'Phone Number:',
1190
- placeholder: '###-###-####',
1191
- maxlength: 12,
1192
- help: '10-digit phone number, hyphens optional',
1193
- autocomplete: 'tel-national',
1194
- 'data-tf-sensitive': 'false',
1195
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
1196
- validationMessages: {
1197
- required: 'Field is required',
1198
- matches: 'Invalid Phone Format, use ###-###-####',
1199
- valid_phone: 'Invalid Phone Number'
1200
- },
1201
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
1202
- });
1203
-
1204
1239
  const primaryInjury = (scope) => sbs2ColRadio({
1205
1240
  name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
1206
1241
  label: 'Primary Injury:',
@@ -1467,21 +1502,6 @@ const wouldLikeLawyerTo = () => sbsRadio({
1467
1502
  ]
1468
1503
  });
1469
1504
 
1470
- const zipcode = (scope) => sbsText({
1471
- label: 'Zip Code:',
1472
- placeholder: '#####',
1473
- name: scope ? scope + ':' + 'Zip' : 'Zip',
1474
- maxlength: 5,
1475
- inputmode: "numeric",
1476
- autocomplete: 'postal-code',
1477
- validation: 'required|matches:/^[0-9]{5}$/',
1478
- validationMessages: {
1479
- required: 'Zip Code is required',
1480
- matches: 'Invalid Zip Code'
1481
- }
1482
- });
1483
-
1484
-
1485
1505
  // ------ Question Groups
1486
1506
 
1487
1507
  // NOTE: name must be unique within a form!
@@ -2340,13 +2360,20 @@ function crossSellQuestionsStepSubHeadline(updates) {
2340
2360
  function commentsStepHeadline(updates) {
2341
2361
  return {
2342
2362
  $el: 'h3',
2343
- children: updates.headline || 'Additional Case Details',
2363
+ children: updates.headline || 'Additional Details',
2344
2364
  attrs: {
2345
2365
  class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-5 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
2346
2366
  }
2347
2367
  }
2348
2368
  }
2349
2369
 
2370
+ function commentsStepHeadlineLegal(updates) {
2371
+ return commentsStepHeadline({
2372
+ headline: updates.headline || 'Additional Case Details',
2373
+ headlineClass: updates.headlineClass
2374
+ })
2375
+ }
2376
+
2350
2377
  function firstAndLastStepHeadline(updates) {
2351
2378
  return {
2352
2379
  $el: 'h3',
@@ -2370,7 +2397,7 @@ function legalCrossSellsStepHeadline(updates) {
2370
2397
  function contactStepHeadline(updates) {
2371
2398
  return {
2372
2399
  $el: 'h3',
2373
- children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC,
2400
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
2374
2401
  attrs: {
2375
2402
  class: 't-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-3 t-pt-0 t-px-1' + ' ' + (updates.headlineClass || '')
2376
2403
  }
@@ -2380,7 +2407,7 @@ function contactStepHeadline(updates) {
2380
2407
  function contactStepSubHeadline(updates) {
2381
2408
  return {
2382
2409
  $el: 'h5',
2383
- children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC,
2410
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
2384
2411
  attrs: {
2385
2412
  class: 't-flex t-justify-center t-text-center !t-text-lg t-font-semibold t-pb-7 t-pt-0 t-px-3' + ' ' + (updates.subheadlineClass || '')
2386
2413
  }
@@ -2420,10 +2447,16 @@ const stepDefaults = (step, stepKey) => ({
2420
2447
  }
2421
2448
  });
2422
2449
 
2423
- function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = undefined, nextStepMap = undefined, autoFocus = undefined) {
2424
- if (typeof nextOnEnter === 'undefined') {
2425
- nextOnEnter = true;
2426
- }
2450
+ function step(name, inputs, updates = {}) {
2451
+ const {
2452
+ nextOnEnter = true,
2453
+ nextOnInput = false,
2454
+ stepKey = undefined,
2455
+ nextStepMap = undefined,
2456
+ triggerRedirectMap = undefined,
2457
+ autoFocus = undefined,
2458
+ } = updates;
2459
+
2427
2460
  if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
2428
2461
  const lastInput = findLastInput(inputs[inputs.length - 1]);
2429
2462
  if (lastInput && nextOnEnter === true) {
@@ -2443,6 +2476,7 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
2443
2476
  id: name,
2444
2477
  name: name,
2445
2478
  nextStepMap: nextStepMap,
2479
+ triggerRedirectMap: triggerRedirectMap,
2446
2480
  autoFocus: autoFocus,
2447
2481
  children: inputs
2448
2482
  }
@@ -2451,6 +2485,34 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
2451
2485
  )
2452
2486
  }
2453
2487
 
2488
+ function contactInfo(updates = {}) {
2489
+ return step(
2490
+ 'contactInfo',
2491
+ [
2492
+ contactStepHeadline(updates),
2493
+ contactStepSubHeadline(updates),
2494
+ trustedFormScript(),
2495
+ email(updates.scope),
2496
+ phone(updates.scope),
2497
+ TCPAConsent(updates.scope),
2498
+ secureIcon()
2499
+ ],
2500
+ { nextOnEnter: false }
2501
+ )
2502
+ }
2503
+
2504
+ function firstAndLastV2(updates = {}) {
2505
+ return step(
2506
+ 'firstAndLast',
2507
+ [
2508
+ firstAndLastStepHeadline(updates),
2509
+ firstName(),
2510
+ lastName()
2511
+ ],
2512
+ updates
2513
+ )
2514
+ }
2515
+
2454
2516
  function generalLegalTOLPAndZip(updates = {}) {
2455
2517
  return step(
2456
2518
  'generalLegalTOLPAndZip',
@@ -2464,10 +2526,7 @@ function generalLegalTOLPAndZip(updates = {}) {
2464
2526
  realEstateTOLPDisplay(),
2465
2527
  zipcode()
2466
2528
  ],
2467
- updates.nextOnEnter,
2468
- updates.nextOnInput,
2469
- updates.stepKey,
2470
- updates.nextStepMap
2529
+ updates
2471
2530
  )
2472
2531
  }
2473
2532
 
@@ -2475,10 +2534,10 @@ function commentsWithBankruptcy(updates = {}) {
2475
2534
  return step(
2476
2535
  'commentsWithBankruptcy',
2477
2536
  [
2478
- commentsStepHeadline(updates),
2537
+ commentsStepHeadlineLegal(updates),
2479
2538
  comments({
2480
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL : updates.label,
2481
- placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
2539
+ label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
2540
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
2482
2541
  inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
2483
2542
  }, updates.scope),
2484
2543
  // TODO: needs scope support
@@ -2495,39 +2554,10 @@ function commentsWithBankruptcy(updates = {}) {
2495
2554
  ],
2496
2555
  }
2497
2556
  ],
2498
- false // nextOnEnter
2499
- )
2500
- }
2501
-
2502
- function contactInfo(updates = {}) {
2503
- return step(
2504
- 'contactInfo',
2505
- [
2506
- contactStepHeadline(updates),
2507
- contactStepSubHeadline(updates),
2508
- trustedFormScript(),
2509
- email(updates.scope),
2510
- phone(updates.scope),
2511
- TCPAConsent(updates.scope),
2512
- secureIcon()
2513
- ],
2514
- false, // nextOnEnter
2557
+ { nextOnEnter: false }
2515
2558
  )
2516
2559
  }
2517
2560
 
2518
- function firstAndLastV2(updates = {}) {
2519
- return step(
2520
- 'firstAndLast',
2521
- [
2522
- firstAndLastStepHeadline(updates),
2523
- firstName(),
2524
- lastName()
2525
- ],
2526
- updates.nextOnEnter
2527
- )
2528
- }
2529
-
2530
-
2531
2561
  const AllTOLPQuestions = () => {
2532
2562
  return [
2533
2563
  AdoptionQuestions(),
@@ -2598,11 +2628,10 @@ function generalLegalTOLPQuestions(updates = {}) {
2598
2628
  return step(
2599
2629
  'TOLPQuestions',
2600
2630
  questions,
2601
- updates.nextOnEnter
2631
+ updates
2602
2632
  )
2603
2633
  }
2604
2634
 
2605
-
2606
2635
  function autoAndCarAccidentCrossSellQuestions(updates = {}) {
2607
2636
  return step(
2608
2637
  'autoAndCarAccidentCrossSellQuestions',
@@ -2619,7 +2648,7 @@ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
2619
2648
  'CrossSell:Auto_and_Car_Accidents'
2620
2649
  )
2621
2650
  ],
2622
- updates.nextOnEnter
2651
+ updates
2623
2652
  )
2624
2653
  }
2625
2654
 
@@ -2638,7 +2667,7 @@ function childCustodyCrossSellQuestions(updates = {}) {
2638
2667
  'CrossSell:Child_Custody'
2639
2668
  )
2640
2669
  ],
2641
- updates.nextOnEnter
2670
+ updates
2642
2671
  )
2643
2672
  }
2644
2673
 
@@ -2657,7 +2686,7 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
2657
2686
  'CrossSell:Divorce_and_Separation'
2658
2687
  )
2659
2688
  ],
2660
- updates.nextOnEnter
2689
+ updates
2661
2690
  )
2662
2691
  }
2663
2692
 
@@ -2676,7 +2705,7 @@ function duiAndDWICrossSellQuestions(updates = {}) {
2676
2705
  'CrossSell:DUI_and_DWI'
2677
2706
  )
2678
2707
  ],
2679
- updates.nextOnEnter
2708
+ updates
2680
2709
  )
2681
2710
  }
2682
2711
 
@@ -2696,7 +2725,7 @@ function ssdiCrossSellQuestions(updates = {}) {
2696
2725
  'CrossSell:Social_Security_Disability_and_Insurance'
2697
2726
  )
2698
2727
  ],
2699
- updates.nextOnEnter
2728
+ updates
2700
2729
  )
2701
2730
  }
2702
2731
 
@@ -2716,7 +2745,7 @@ function personalInjuryCrossSellQuestions(updates = {}) {
2716
2745
  'CrossSell:Personal_Injury'
2717
2746
  )
2718
2747
  ],
2719
- updates.nextOnEnter
2748
+ updates
2720
2749
  )
2721
2750
  }
2722
2751
 
@@ -2735,7 +2764,7 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
2735
2764
  'CrossSell:Power_of_Attorney'
2736
2765
  )
2737
2766
  ],
2738
- updates.nextOnEnter
2767
+ updates
2739
2768
  )
2740
2769
  }
2741
2770
 
@@ -2754,7 +2783,7 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
2754
2783
  'CrossSell:Wills_and_Trusts'
2755
2784
  )
2756
2785
  ],
2757
- updates.nextOnEnter
2786
+ updates
2758
2787
  )
2759
2788
  }
2760
2789
 
@@ -2774,21 +2803,20 @@ function workersCompensationCrossSellQuestions(updates = {}) {
2774
2803
  'CrossSell:Workers_Compensation'
2775
2804
  )
2776
2805
  ],
2777
- updates.nextOnEnter
2806
+ updates
2778
2807
  )
2779
2808
  }
2780
2809
 
2781
2810
  function legalCrossSells(updates = {}) {
2811
+ updates.nextOnInput = false;
2812
+ updates.stepKey = '$get(Type_Of_Legal_Problem).value';
2782
2813
  return step(
2783
2814
  'legalCrossSells',
2784
2815
  [
2785
2816
  legalCrossSellsStepHeadline(updates),
2786
2817
  legalCrossSells$1(),
2787
2818
  ],
2788
- updates.nextOnEnter,
2789
- false,
2790
- // Note: we should probably scope this stepKey to this step name
2791
- '$get(Type_Of_Legal_Problem).value'
2819
+ updates
2792
2820
  )
2793
2821
  }
2794
2822
 
@@ -2931,9 +2959,7 @@ function formProps(updates) {
2931
2959
  return props
2932
2960
  }
2933
2961
 
2934
- const metaDefaults = {
2935
- tcpaLanguage: TCPA_LANGUAGE
2936
- };
2962
+ const metaDefaults = {};
2937
2963
 
2938
2964
  function metaProps(updates) {
2939
2965
  const data = merge(
@@ -2946,7 +2972,7 @@ function metaProps(updates) {
2946
2972
  }
2947
2973
  }
2948
2974
 
2949
- function defaultMetaProps(tolps = null) {
2975
+ function defaultMetaPropsLegal(tolps = null) {
2950
2976
  let commentsPlaceholders = TOLPCommentsPlaceholders;
2951
2977
  let finalHeadlines = TOLPFinalHeadlines;
2952
2978
  let finalSubHeadlines = TOLPFinalSubHeadlines;
@@ -2956,23 +2982,27 @@ function defaultMetaProps(tolps = null) {
2956
2982
  finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
2957
2983
  }
2958
2984
  return metaProps({
2959
- defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
2985
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
2986
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
2960
2987
  commentsPlaceholders: commentsPlaceholders,
2961
- defaultFinalHeadline: DEFAULT_FINAL_HEADLINE,
2988
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
2962
2989
  finalHeadlines: finalHeadlines,
2963
- defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE,
2964
- finalSubHeadlines: finalSubHeadlines,
2990
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
2991
+ finalSubHeadlines: finalSubHeadlines
2965
2992
  })
2966
2993
  }
2967
2994
 
2968
2995
  function defaultMetaPropsLegalLegacy() {
2969
- const meta = defaultMetaProps();
2996
+ const meta = defaultMetaPropsLegal();
2970
2997
  meta.data.dynamicSchema = [
2971
2998
  generalLegalTOLPQuestions(),
2972
2999
  commentsWithBankruptcy({
2973
3000
  inputClass: '!t-h-28',
2974
3001
  }),
2975
- legalCrossSells(),
3002
+ legalCrossSells({
3003
+ headlineClass: '!t-text-dark',
3004
+ nextStepMap: nextStepsMapLegalCrossSells,
3005
+ }),
2976
3006
  autoAndCarAccidentCrossSellQuestions(),
2977
3007
  personalInjuryCrossSellQuestions(),
2978
3008
  workersCompensationCrossSellQuestions(),
@@ -3456,17 +3486,44 @@ const TOLPFinalSubHeadlines = {
3456
3486
  // 'Non-Workplace Discrimination': '',
3457
3487
  };
3458
3488
 
3459
-
3460
3489
  const nextStepsMapLegalLegacy = {
3461
- '*': [
3462
- 'TOLPQuestions',
3463
- 'commentsWithBankruptcy',
3464
- 'legalCrossSells',
3465
- 'firstAndLast',
3466
- 'contactInfo',
3467
- ]
3490
+ values: {
3491
+ '*': [
3492
+ 'TOLPQuestions',
3493
+ 'commentsWithBankruptcy',
3494
+ 'legalCrossSells',
3495
+ 'firstAndLast',
3496
+ 'contactInfo',
3497
+ ]
3498
+ }
3468
3499
  };
3469
3500
 
3501
+ const nextStepsMapLegalCrossSells = {
3502
+ values: {
3503
+ 'Legal_CrossSells': {
3504
+ 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
3505
+ 'Personal Injury': ['personalInjuryCrossSellQuestions'],
3506
+ 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
3507
+ 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
3508
+ 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
3509
+ 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
3510
+ 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
3511
+ 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
3512
+ 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
3513
+ 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
3514
+ 'Child Custody': ['childCustodyCrossSellQuestions'],
3515
+ },
3516
+ '*': ['firstAndLast', 'contactInfo'],
3517
+ },
3518
+
3519
+ // NOTE: this assumes a certain placement of the cross sell question
3520
+ // in the form flow.
3521
+ appendSteps: ['firstAndLast', 'contactInfo'],
3522
+ matchesAllowed: 1,
3523
+ };
3524
+
3525
+ const legalCrossSellOptionMap = CROSS_SELL_OPTION_MAP_LEGAL;
3526
+
3470
3527
  const schema = [
3471
3528
  defaultMetaPropsLegalLegacy(),
3472
3529
  formAnchor(),
@@ -3476,6 +3533,7 @@ const schema = [
3476
3533
  formId: 'generalLegal',
3477
3534
  redirectMap: legalRedirectMap(),
3478
3535
  valueOverrideMap: legalAllValueOverrideMap,
3536
+ crossSellOptionMap: legalCrossSellOptionMap
3479
3537
  }),
3480
3538
  children: [
3481
3539
  headline({