bhl-forms 0.6.15 → 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 +645 -573
  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
 
@@ -177,6 +260,73 @@ const sbsDate = (updates) => {
177
260
  return date(updates)
178
261
  };
179
262
 
263
+ const email = (scope) => sbsText({
264
+ $formkit: 'email',
265
+ name: scope ? scope + ':' + 'Email' : 'Email',
266
+ label: 'Email Address:',
267
+ placeholder: 'email@domain.com',
268
+ autocomplete: 'email',
269
+ 'data-tf-sensitive': 'false',
270
+ validation: 'required|email',
271
+ validationMessages: {
272
+ required: 'Email is required',
273
+ email: 'Invalid Email'
274
+ }
275
+ });
276
+
277
+ const firstName = (scope) => sbsText({
278
+ label: 'First Name:',
279
+ placeholder: 'First',
280
+ name: scope ? scope + ':' + 'First_Name' : 'First_Name',
281
+ autocomplete: "given-name",
282
+ validationMessages: {
283
+ required: 'First Name is required'
284
+ }
285
+ });
286
+
287
+ const lastName = (scope) => sbsText({
288
+ label: 'Last Name:',
289
+ placeholder: 'Last',
290
+ name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
291
+ autocomplete: "family-name",
292
+ validationMessages: {
293
+ required: 'Last Name is required'
294
+ }
295
+ });
296
+
297
+ const phone = (scope) => sbsText({
298
+ $formkit: 'tel',
299
+ name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
300
+ label: 'Phone Number:',
301
+ placeholder: '###-###-####',
302
+ maxlength: 12,
303
+ help: '10-digit phone number, hyphens optional',
304
+ autocomplete: 'tel-national',
305
+ 'data-tf-sensitive': 'false',
306
+ validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
307
+ validationMessages: {
308
+ required: 'Field is required',
309
+ matches: 'Invalid Phone Format, use ###-###-####',
310
+ valid_phone: 'Invalid Phone Number'
311
+ },
312
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
313
+ });
314
+
315
+
316
+ const zipcode = (scope) => sbsText({
317
+ label: 'Zip Code:',
318
+ placeholder: '#####',
319
+ name: scope ? scope + ':' + 'Zip' : 'Zip',
320
+ maxlength: 5,
321
+ inputmode: "numeric",
322
+ autocomplete: 'postal-code',
323
+ validation: 'required|matches:/^[0-9]{5}$/',
324
+ validationMessages: {
325
+ required: 'Zip Code is required',
326
+ matches: 'Invalid Zip Code'
327
+ }
328
+ });
329
+
180
330
  const applicantAge = (scope) => sbsText({
181
331
  name: scope ? scope + ':' + 'Applicant_Age' : 'Applicant_Age',
182
332
  label: 'Age of Applicant?',
@@ -315,20 +465,6 @@ const doctorTreatment = (scope) => sbsYesNoRadio({
315
465
  label: 'Have You Recently Been Treated by a Doctor, Hospital or Clinic?',
316
466
  });
317
467
 
318
- const email = (scope) => sbsText({
319
- $formkit: 'email',
320
- name: scope ? scope + ':' + 'Email' : 'Email',
321
- label: 'Email Address:',
322
- placeholder: 'email@domain.com',
323
- autocomplete: 'email',
324
- 'data-tf-sensitive': 'false',
325
- validation: 'required|email',
326
- validationMessages: {
327
- required: 'Email is required',
328
- email: 'Invalid Email'
329
- }
330
- });
331
-
332
468
  const employerType = () => sbsSelect({
333
469
  label: 'The Employer Is a:',
334
470
  name: 'Employer_Type',
@@ -361,18 +497,6 @@ const estateLegalServicesNeeded = (scope) => sbsSelect({
361
497
  ]
362
498
  });
363
499
 
364
- const firstName = (scope) => sbsText({
365
- $formkit: 'text',
366
- label: 'First Name:',
367
- placeholder: 'First',
368
- name: scope ? scope + ':' + 'First_Name' : 'First_Name',
369
- autocomplete: "given-name",
370
- validationMessages: {
371
- required: 'First Name is required'
372
- }
373
- });
374
-
375
-
376
500
  const harassmentAndDiscriminationTOLP = () => col2Radio({
377
501
  label: 'Type of Help Needed:',
378
502
  name: 'Type_Of_Legal_Problem',
@@ -402,17 +526,6 @@ const incidentDate = (scope) => sbsDate({
402
526
  label: 'Date of Incident:',
403
527
  });
404
528
 
405
- const lastName = (scope) => sbsText({
406
- $formkit: 'text',
407
- label: 'Last Name:',
408
- placeholder: 'Last',
409
- name: scope ? scope + ':' + 'Last_Name' : 'Last_Name',
410
- autocomplete: "family-name",
411
- validationMessages: {
412
- required: 'Last Name is required'
413
- }
414
- });
415
-
416
529
  const lawyerPaymentMethod = (scope) => sbsSelect({
417
530
  name: scope ? scope + ':' + 'Lawyer_Payment_Method' : 'Lawyer_Payment_Method',
418
531
  label: 'How Will You Pay for Legal Fees if You Hire a Lawyer?',
@@ -433,69 +546,7 @@ const legalCrossSells$1 = () => col2Checkbox({
433
546
  help: 'Just hit "Next" if none apply',
434
547
  helpClass: 't-text-center !t-text-sm',
435
548
  validation: null,
436
- options: {
437
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Auto and Car Accidents"',
438
- then: {
439
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
440
- 'Wills and Trusts': 'Need a Will or Trust',
441
- 'Workers Compensation': 'Workplace Injury',
442
- 'Power of Attorney': 'Update Power of Attorney',
443
- 'Divorce and Separation': 'Need a Divorce or Separation',
444
- 'Child Custody': 'Need help with Child Custody',
445
- },
446
- else: {
447
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Personal Injury" || $getVal($get(form), "Type_Of_Legal_Problem") === "Workers Compensation"',
448
- then: {
449
- 'DUI and DWI': 'Involved in a DUI/DWI',
450
- 'Wills and Trusts': 'Need a Will or Trust',
451
- 'Power of Attorney': 'Update Power of Attorney',
452
- 'Divorce and Separation': 'Need a Divorce or Separation',
453
- 'Child Custody': 'Need help with Child Custody',
454
- // TODO add one more?
455
- },
456
- else: {
457
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "DUI and DWI"',
458
- then: {
459
- 'Personal Injury': 'Personal or Workplace Injury',
460
- 'Wills and Trusts': 'Need a Will or Trust',
461
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
462
- 'Power of Attorney': 'Update Power of Attorney',
463
- 'Divorce and Separation': 'Need a Divorce or Separation',
464
- 'Child Custody': 'Need help with Child Custody',
465
- },
466
- else: {
467
- 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"',
468
- then: {
469
- 'Auto and Car Accidents': 'Injured in a Car Accident',
470
- 'Personal Injury': 'Personal or Workplace Injury',
471
- 'DUI and DWI': 'Involved in a DUI/DWI',
472
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
473
- 'Divorce and Separation': 'Need a Divorce or Separation',
474
- 'Child Custody': 'Need help with Child Custody',
475
- },
476
- else: {
477
- if: '$getVal($get(form), "Type_Of_Legal_Problem") === "Long Term Disability" || $getVal($get(form), "Type_Of_Legal_Problem") === "Social Security Disability and Insurance"',
478
- then: {
479
- 'Auto and Car Accidents': 'Injured in a Car Accident',
480
- 'DUI and DWI': 'Involved in a DUI/DWI',
481
- 'Wills and Trusts': 'Need a Will or Trust',
482
- 'Power of Attorney': 'Update Power of Attorney',
483
- 'Divorce and Separation': 'Need a Divorce or Separation',
484
- 'Child Custody': 'Need help with Child Custody',
485
- },
486
- else: {
487
- 'Auto and Car Accidents': 'Injured in a Car Accident',
488
- 'Personal Injury': 'Personal or Workplace Injury',
489
- 'DUI and DWI': 'Involved in a DUI/DWI',
490
- 'Wills and Trusts': 'Need a Will or Trust',
491
- 'Power of Attorney': 'Update Power of Attorney',
492
- 'Social Security Disability and Insurance': 'Interest in Disability Benefits',
493
- }
494
- }
495
- }
496
- }
497
- }
498
- }
549
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
499
550
  });
500
551
 
501
552
  const maritalStatus = (scope) => sbsSelect({
@@ -531,24 +582,6 @@ const pendingCharges = (scope) => sbsYesNoRadio({
531
582
  label: 'Do you currently have any pending charges?'
532
583
  });
533
584
 
534
- const phone = (scope) => sbsText({
535
- $formkit: 'tel',
536
- name: scope ? scope + ':' + 'Primary_Phone' : 'Primary_Phone',
537
- label: 'Phone Number:',
538
- placeholder: '###-###-####',
539
- maxlength: 12,
540
- help: '10-digit phone number, hyphens optional',
541
- autocomplete: 'tel-national',
542
- 'data-tf-sensitive': 'false',
543
- validation: 'required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone',
544
- validationMessages: {
545
- required: 'Field is required',
546
- matches: 'Invalid Phone Format, use ###-###-####',
547
- valid_phone: 'Invalid Phone Number'
548
- },
549
- helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]"
550
- });
551
-
552
585
  const primaryInjury = (scope) => sbs2ColRadio({
553
586
  name: scope ? scope + ':' + 'Primary_Injury' : 'Primary_Injury',
554
587
  label: 'Primary Injury:',
@@ -645,21 +678,6 @@ const valueOfAssets = (scope) => sbsSelect({
645
678
  ]
646
679
  });
647
680
 
648
- const zipcode = (scope) => sbsText({
649
- label: 'Zip Code:',
650
- placeholder: '#####',
651
- name: scope ? scope + ':' + 'Zip' : 'Zip',
652
- maxlength: 5,
653
- inputmode: "numeric",
654
- autocomplete: 'postal-code',
655
- validation: 'required|matches:/^[0-9]{5}$/',
656
- validationMessages: {
657
- required: 'Zip Code is required',
658
- matches: 'Invalid Zip Code'
659
- }
660
- });
661
-
662
-
663
681
  // ------ Question Groups
664
682
 
665
683
  // NOTE: name must be unique within a form!
@@ -969,13 +987,20 @@ function crossSellQuestionsStepSubHeadline(updates) {
969
987
  function commentsStepHeadline(updates) {
970
988
  return {
971
989
  $el: 'h3',
972
- children: updates.headline || 'Additional Case Details',
990
+ children: updates.headline || 'Additional Details',
973
991
  attrs: {
974
992
  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 || '')
975
993
  }
976
994
  }
977
995
  }
978
996
 
997
+ function commentsStepHeadlineLegal(updates) {
998
+ return commentsStepHeadline({
999
+ headline: updates.headline || 'Additional Case Details',
1000
+ headlineClass: updates.headlineClass
1001
+ })
1002
+ }
1003
+
979
1004
  function firstAndLastStepHeadline(updates) {
980
1005
  return {
981
1006
  $el: 'h3',
@@ -999,7 +1024,7 @@ function legalCrossSellsStepHeadline(updates) {
999
1024
  function contactStepHeadline(updates) {
1000
1025
  return {
1001
1026
  $el: 'h3',
1002
- children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC,
1027
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
1003
1028
  attrs: {
1004
1029
  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 || '')
1005
1030
  }
@@ -1009,7 +1034,7 @@ function contactStepHeadline(updates) {
1009
1034
  function contactStepSubHeadline(updates) {
1010
1035
  return {
1011
1036
  $el: 'h5',
1012
- children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC,
1037
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
1013
1038
  attrs: {
1014
1039
  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 || '')
1015
1040
  }
@@ -1049,10 +1074,16 @@ const stepDefaults = (step, stepKey) => ({
1049
1074
  }
1050
1075
  });
1051
1076
 
1052
- function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = undefined, nextStepMap = undefined, autoFocus = undefined) {
1053
- if (typeof nextOnEnter === 'undefined') {
1054
- nextOnEnter = true;
1055
- }
1077
+ function step(name, inputs, updates = {}) {
1078
+ const {
1079
+ nextOnEnter = true,
1080
+ nextOnInput = false,
1081
+ stepKey = undefined,
1082
+ nextStepMap = undefined,
1083
+ triggerRedirectMap = undefined,
1084
+ autoFocus = undefined,
1085
+ } = updates;
1086
+
1056
1087
  if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
1057
1088
  const lastInput = findLastInput(inputs[inputs.length - 1]);
1058
1089
  if (lastInput && nextOnEnter === true) {
@@ -1072,6 +1103,7 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1072
1103
  id: name,
1073
1104
  name: name,
1074
1105
  nextStepMap: nextStepMap,
1106
+ triggerRedirectMap: triggerRedirectMap,
1075
1107
  autoFocus: autoFocus,
1076
1108
  children: inputs
1077
1109
  }
@@ -1080,34 +1112,6 @@ function step(name, inputs, nextOnEnter = true, nextOnInput = false, stepKey = u
1080
1112
  )
1081
1113
  }
1082
1114
 
1083
- function commentsWithBankruptcy(updates = {}) {
1084
- return step(
1085
- 'commentsWithBankruptcy',
1086
- [
1087
- commentsStepHeadline(updates),
1088
- comments({
1089
- label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL : updates.label,
1090
- placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1091
- inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1092
- }, updates.scope),
1093
- // TODO: needs scope support
1094
- bankruptcyCrossSell(),
1095
- {
1096
- $el: 'div',
1097
- if: '$get(CrossSell_Bankruptcy).value == true',
1098
- children: [
1099
- comments({
1100
- label: 'Bankruptcy or debt details:',
1101
- placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1102
- inputClass: '!t-h-16'
1103
- }, 'CrossSell:Bankruptcy')
1104
- ],
1105
- }
1106
- ],
1107
- false // nextOnEnter
1108
- )
1109
- }
1110
-
1111
1115
  function contactInfo(updates = {}) {
1112
1116
  return step(
1113
1117
  'contactInfo',
@@ -1120,7 +1124,7 @@ function contactInfo(updates = {}) {
1120
1124
  TCPAConsent(updates.scope),
1121
1125
  secureIcon()
1122
1126
  ],
1123
- false, // nextOnEnter
1127
+ { nextOnEnter: false }
1124
1128
  )
1125
1129
  }
1126
1130
 
@@ -1132,10 +1136,37 @@ function firstAndLastV2(updates = {}) {
1132
1136
  firstName(),
1133
1137
  lastName()
1134
1138
  ],
1135
- updates.nextOnEnter
1139
+ updates
1136
1140
  )
1137
1141
  }
1138
1142
 
1143
+ function commentsWithBankruptcy(updates = {}) {
1144
+ return step(
1145
+ 'commentsWithBankruptcy',
1146
+ [
1147
+ commentsStepHeadlineLegal(updates),
1148
+ comments({
1149
+ label: typeof updates.label === 'undefined' ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1150
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1151
+ inputClass: typeof updates.inputClass === 'undefined' ? '!t-h-32' : updates.inputClass,
1152
+ }, updates.scope),
1153
+ // TODO: needs scope support
1154
+ bankruptcyCrossSell(),
1155
+ {
1156
+ $el: 'div',
1157
+ if: '$get(CrossSell_Bankruptcy).value == true',
1158
+ children: [
1159
+ comments({
1160
+ label: 'Bankruptcy or debt details:',
1161
+ placeholder: 'Please describe your bankrtupcy or debt situation in a few words...',
1162
+ inputClass: '!t-h-16'
1163
+ }, 'CrossSell:Bankruptcy')
1164
+ ],
1165
+ }
1166
+ ],
1167
+ { nextOnEnter: false }
1168
+ )
1169
+ }
1139
1170
 
1140
1171
  function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1141
1172
  return step(
@@ -1153,7 +1184,7 @@ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1153
1184
  'CrossSell:Auto_and_Car_Accidents'
1154
1185
  )
1155
1186
  ],
1156
- updates.nextOnEnter
1187
+ updates
1157
1188
  )
1158
1189
  }
1159
1190
 
@@ -1172,7 +1203,7 @@ function childCustodyCrossSellQuestions(updates = {}) {
1172
1203
  'CrossSell:Child_Custody'
1173
1204
  )
1174
1205
  ],
1175
- updates.nextOnEnter
1206
+ updates
1176
1207
  )
1177
1208
  }
1178
1209
 
@@ -1191,7 +1222,7 @@ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1191
1222
  'CrossSell:Divorce_and_Separation'
1192
1223
  )
1193
1224
  ],
1194
- updates.nextOnEnter
1225
+ updates
1195
1226
  )
1196
1227
  }
1197
1228
 
@@ -1210,7 +1241,7 @@ function duiAndDWICrossSellQuestions(updates = {}) {
1210
1241
  'CrossSell:DUI_and_DWI'
1211
1242
  )
1212
1243
  ],
1213
- updates.nextOnEnter
1244
+ updates
1214
1245
  )
1215
1246
  }
1216
1247
 
@@ -1230,7 +1261,7 @@ function ssdiCrossSellQuestions(updates = {}) {
1230
1261
  'CrossSell:Social_Security_Disability_and_Insurance'
1231
1262
  )
1232
1263
  ],
1233
- updates.nextOnEnter
1264
+ updates
1234
1265
  )
1235
1266
  }
1236
1267
 
@@ -1250,7 +1281,7 @@ function personalInjuryCrossSellQuestions(updates = {}) {
1250
1281
  'CrossSell:Personal_Injury'
1251
1282
  )
1252
1283
  ],
1253
- updates.nextOnEnter
1284
+ updates
1254
1285
  )
1255
1286
  }
1256
1287
 
@@ -1269,7 +1300,7 @@ function powerOfAttorneyCrossSellQuestions(updates = {}) {
1269
1300
  'CrossSell:Power_of_Attorney'
1270
1301
  )
1271
1302
  ],
1272
- updates.nextOnEnter
1303
+ updates
1273
1304
  )
1274
1305
  }
1275
1306
 
@@ -1288,7 +1319,7 @@ function willsAndTrustsCrossSellQuestions(updates = {}) {
1288
1319
  'CrossSell:Wills_and_Trusts'
1289
1320
  )
1290
1321
  ],
1291
- updates.nextOnEnter
1322
+ updates
1292
1323
  )
1293
1324
  }
1294
1325
 
@@ -1308,7 +1339,7 @@ function workersCompensationCrossSellQuestions(updates = {}) {
1308
1339
  'CrossSell:Workers_Compensation'
1309
1340
  )
1310
1341
  ],
1311
- updates.nextOnEnter
1342
+ updates
1312
1343
  )
1313
1344
  }
1314
1345
 
@@ -1319,10 +1350,7 @@ function harassmentAndDiscriminationTOLPAndZip(updates = {}) {
1319
1350
  harassmentAndDiscriminationTOLP(),
1320
1351
  zipcode()
1321
1352
  ],
1322
- updates.nextOnEnter,
1323
- updates.nextOnInput,
1324
- updates.stepKey,
1325
- updates.nextStepMap
1353
+ updates
1326
1354
  )
1327
1355
  }
1328
1356
 
@@ -1338,21 +1366,20 @@ function harassmentAndDiscriminationTOLPQuestions(updates = {}) {
1338
1366
  NonWorkplaceDiscriminationQuestions(),
1339
1367
  NotSureOrOtherQuestions()
1340
1368
  ],
1341
- updates.nextOnEnter
1369
+ updates
1342
1370
  )
1343
1371
  }
1344
1372
 
1345
1373
  function legalCrossSells(updates = {}) {
1374
+ updates.nextOnInput = false;
1375
+ updates.stepKey = '$get(Type_Of_Legal_Problem).value';
1346
1376
  return step(
1347
1377
  'legalCrossSells',
1348
1378
  [
1349
1379
  legalCrossSellsStepHeadline(updates),
1350
1380
  legalCrossSells$1(),
1351
1381
  ],
1352
- updates.nextOnEnter,
1353
- false,
1354
- // Note: we should probably scope this stepKey to this step name
1355
- '$get(Type_Of_Legal_Problem).value'
1382
+ updates
1356
1383
  )
1357
1384
  }
1358
1385
 
@@ -1495,9 +1522,7 @@ function formProps(updates) {
1495
1522
  return props
1496
1523
  }
1497
1524
 
1498
- const metaDefaults = {
1499
- tcpaLanguage: TCPA_LANGUAGE
1500
- };
1525
+ const metaDefaults = {};
1501
1526
 
1502
1527
  function metaProps(updates) {
1503
1528
  const data = merge(
@@ -1510,7 +1535,7 @@ function metaProps(updates) {
1510
1535
  }
1511
1536
  }
1512
1537
 
1513
- function defaultMetaProps(tolps = null) {
1538
+ function defaultMetaPropsLegal(tolps = null) {
1514
1539
  let commentsPlaceholders = TOLPCommentsPlaceholders;
1515
1540
  let finalHeadlines = TOLPFinalHeadlines;
1516
1541
  let finalSubHeadlines = TOLPFinalSubHeadlines;
@@ -1520,12 +1545,13 @@ function defaultMetaProps(tolps = null) {
1520
1545
  finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
1521
1546
  }
1522
1547
  return metaProps({
1523
- defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC,
1548
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
1549
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1524
1550
  commentsPlaceholders: commentsPlaceholders,
1525
- defaultFinalHeadline: DEFAULT_FINAL_HEADLINE,
1551
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1526
1552
  finalHeadlines: finalHeadlines,
1527
- defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE,
1528
- finalSubHeadlines: finalSubHeadlines,
1553
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1554
+ finalSubHeadlines: finalSubHeadlines
1529
1555
  })
1530
1556
  }
1531
1557
 
@@ -1770,23 +1796,53 @@ const TOLPFinalSubHeadlines = {
1770
1796
  // 'Non-Workplace Discrimination': '',
1771
1797
  };
1772
1798
 
1773
-
1774
1799
  const nextStepsMapLegalLegacy = {
1775
- '*': [
1776
- 'TOLPQuestions',
1777
- 'commentsWithBankruptcy',
1778
- 'legalCrossSells',
1779
- 'firstAndLast',
1780
- 'contactInfo',
1781
- ]
1800
+ values: {
1801
+ '*': [
1802
+ 'TOLPQuestions',
1803
+ 'commentsWithBankruptcy',
1804
+ 'legalCrossSells',
1805
+ 'firstAndLast',
1806
+ 'contactInfo',
1807
+ ]
1808
+ }
1782
1809
  };
1783
1810
 
1784
- const meta = defaultMetaProps();
1811
+ const nextStepsMapLegalCrossSells = {
1812
+ values: {
1813
+ 'Legal_CrossSells': {
1814
+ 'Auto and Car Accidents': ['autoAndCarAccidentCrossSellQuestions'],
1815
+ 'Personal Injury': ['personalInjuryCrossSellQuestions'],
1816
+ 'Workers Compensation': ['workersCompensationCrossSellQuestions'],
1817
+ 'DUI and DWI': ['duiAndDWICrossSellQuestions'],
1818
+ 'Long Term Disability': ['longTermDisabilityCrossSellQuestions'],
1819
+ 'Social Security Disability and Insurance': ['ssdiCrossSellQuestions'],
1820
+ 'Bankruptcy': ['bankruptcyCrossSellQuestions'],
1821
+ 'Power of Attorney': ['powerOfAttorneyCrossSellQuestions'],
1822
+ 'Wills and Trusts': ['willsAndTrustsCrossSellQuestions'],
1823
+ 'Divorce and Separation': ['divorceAndSeparationCrossSellQuestions'],
1824
+ 'Child Custody': ['childCustodyCrossSellQuestions'],
1825
+ },
1826
+ '*': ['firstAndLast', 'contactInfo'],
1827
+ },
1828
+
1829
+ // NOTE: this assumes a certain placement of the cross sell question
1830
+ // in the form flow.
1831
+ appendSteps: ['firstAndLast', 'contactInfo'],
1832
+ matchesAllowed: 1,
1833
+ };
1834
+
1835
+ const legalCrossSellOptionMap = CROSS_SELL_OPTION_MAP_LEGAL;
1836
+
1837
+ const meta = defaultMetaPropsLegal();
1785
1838
 
1786
1839
  meta.data.dynamicSchema = [
1787
1840
  harassmentAndDiscriminationTOLPQuestions(),
1788
1841
  commentsWithBankruptcy(),
1789
- legalCrossSells(),
1842
+ legalCrossSells({
1843
+ headlineClass: '!t-text-dark',
1844
+ nextStepMap: nextStepsMapLegalCrossSells,
1845
+ }),
1790
1846
  autoAndCarAccidentCrossSellQuestions(),
1791
1847
  personalInjuryCrossSellQuestions(),
1792
1848
  workersCompensationCrossSellQuestions(),
@@ -1807,6 +1863,7 @@ const schema = [
1807
1863
  props: formProps({
1808
1864
  formId: 'harassmentAndDiscrimination',
1809
1865
  redirectMap: legalRedirectMap(),
1866
+ crossSellOptionMap: legalCrossSellOptionMap
1810
1867
  }),
1811
1868
  children: [
1812
1869
  defaultHeadline(),