bhl-forms 0.0.79 → 0.0.81

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.
@@ -12,16 +12,17 @@ const formPropDefaults = {
12
12
  type: 'form',
13
13
  id: 'form',
14
14
  config: { validationVisibility: 'submit' },
15
- onSubmit: '$submit("https://httpbin.org/post", $prepData, $handleRedirect)',
15
+ onSubmit: '$submit("https://httpbin.org/post", $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
16
16
  plugins: '$plugins',
17
17
  actions: false,
18
18
  prepop: {
19
19
  fromURL: true
20
20
  },
21
21
  errorCodes: {
22
- 403: "An Error Occurred",
22
+ 403: { message: "An Error Occurred", abort: false },
23
23
  409: { abort: false },
24
- 429: "An Error Occurred"
24
+ 429: "An Error Occurred",
25
+ 504: { message: "An Error Occurred", abort: false },
25
26
  },
26
27
  formClass: '!t-max-w-[38rem]'
27
28
  };
@@ -101,11 +102,11 @@ function subHeadline(updates) {
101
102
  )
102
103
  }
103
104
 
104
- const privacyIconsDefault = {
105
+ const secureIconDefault = {
105
106
  $el: 'div',
106
107
  if: '$activeStep === $lastStep()',
107
108
  attrs: {
108
- class: 't-flex t-justify-center'
109
+ class: 't-flex t-justify-center t-items-center t-text-sm t-text-gray-500'
109
110
  },
110
111
  children: [
111
112
  {
@@ -113,18 +114,28 @@ const privacyIconsDefault = {
113
114
  attrs: {
114
115
  loading: 'lazy',
115
116
  alt: '',
116
- style: { border: 0 },
117
- src: 'https://d27hmee62k45vz.cloudfront.net/form-secure-privacy.png',
118
- width: '320',
119
- height: '100'
117
+ style: {
118
+ border: 0
119
+ },
120
+ width: '25',
121
+ height: '25',
122
+ src: 'https://d27hmee62k45vz.cloudfront.net/lock_icon_1.jpeg',
123
+ }
124
+ },
125
+ {
126
+ $el: 'span',
127
+ children: 'Secure & Encrypted',
128
+ attrs: {
129
+ class: 't-pl-2 t-pt-1 t-font-medium'
120
130
  }
121
131
  }
122
132
  ]
123
133
  };
124
134
 
125
- function privacyIcons(updates) {
135
+
136
+ function secureIcon(updates) {
126
137
  return merge(
127
- privacyIconsDefault,
138
+ secureIconDefault,
128
139
  updates
129
140
  )
130
141
  }
@@ -294,6 +305,163 @@ const legalAllValueOverrideMap = {
294
305
  }
295
306
  };
296
307
 
308
+
309
+ const TOLPCommentsPlaceholders = {
310
+ 'Adoption': 'Example: "I need help with adoption forms"',
311
+ 'Asbestos and Mesothelioma': 'Example: "I was exposed to asbestos at work and would like to file a claim"',
312
+ 'Auto and Car Accidents': 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
313
+ 'Bankruptcy': 'Example: "I need help filing for bankruptcy"',
314
+ 'Birth Certificate and Name Change': 'Example: "Just married and would like to change my last name"',
315
+ 'Business Lawyers': 'Example: "I need help incorporating a business" or "I would like a legal contract reviewed"',
316
+ 'Child Custody and Support': 'Example: "Need help getting custody" or "Issues with child support payments"',
317
+ 'Civil Rights and Discrimination': 'Example: "Police brutality" or "Coworker keeps harassing me"',
318
+ 'Civil Lawsuit': 'Example: "A contractor took my money and never completed the job" or "I am being sued by a neighbor"',
319
+ 'Consumer Lawyers': 'Example: "Someone committed fraud against me" or "A contractor took my money and never completed the job"',
320
+ 'Copyrights and Trademarks': 'Example: "I would like to register a trademark or copyright a name"',
321
+ 'Criminal and Felony': 'Example: "I was arrested for DUI and need legal defense" or "I am being charged with assault"',
322
+ 'Debt and Collections': 'Example: "I would like to consolidate my debt" or "A collection agency is harassing me"',
323
+ 'Divorce and Separation': 'Example: "I would like to file for an uncontested divorce"',
324
+ 'DUI and DWI': 'Example: "I was arrested for DUI and need legal defense"',
325
+ 'Elder Law': 'Example: "I would like help with Estate Planning" or "I need help with a guardianship"',
326
+ 'Employment and Workplace': 'Example: "I was injured while on the job" or "My company is discriminating against me"',
327
+ 'Expungement': 'Example: "I would like to file for an expungement and clear my record"',
328
+ 'Family Issues': 'Example: "I need help with guardianship" or "I need a simple will created"',
329
+ 'Foreclosure': 'Example: "I need help to avoid foreclosure on my house"',
330
+ 'Guardianship': 'Example: "I need help with guardianship documents"',
331
+ 'Harassment and Discrimination': 'Example: "I am being discriminated at work" or "My neighbor is harassing me"',
332
+ 'Identity Theft': 'Example: "Someone stole my identity and I need help fixing the issue"',
333
+ 'Immigration and Visas': 'Example: "I need help filing for a visa" or "Help with a green card"',
334
+ 'Insurance': 'Example: "I need help filing an insurance claim for damage to my house"',
335
+ 'Landlord and Tenant': 'Example: "I need help to fight an eviction" or "I would like a lawyer to review a rental contract"',
336
+ 'Lemon Law': 'Example: "I purchased a new vehicle that broke down already and seller will not assist"',
337
+ 'Long Term Disability': 'Example: "I was injured on the job and would like to file for benefits" or "I need help filing for disability benefits"',
338
+ 'Medical Malpractice': 'Example: "A doctor performed surgery on the wrong limb and I would like to file a lawsuit"',
339
+ 'Nursing Home Abuse': 'Example: "My mother\'s nursing home is physically abusing her"',
340
+ 'Patents and Intellectual Property': 'Example: "I would like to file for a patent" or "I need to copyright a name"',
341
+ 'Personal Injury': 'Example: "I was bit by the neighbor\'s dog" or "I fell in the icy grocery store parking lot"',
342
+ 'Power of Attorney': 'Example: "I need help with a limited or general power of attorney"',
343
+ 'Probate and Estates': 'Example: "I need help with planning for my estate" or "A family member passed without a will in place"',
344
+ 'Product Liability': 'Example: "My car battery caught on fire" or "I purchased a faulty product"',
345
+ 'Property Damage': 'Example: "The neighbor\'s tree fell on my fence" or "My car was hit in the parking lot"',
346
+ 'Real Estate': 'Example: "I need help with a quitclaim deed" or "I need a lawyer to review a purchase and sales agreement"',
347
+ 'Social Security Disability and Insurance': 'Example: "I would like help filing for disability benefits" or "I\'ve been denied for SSDI and would like to appeal"',
348
+ 'Tax and IRS': 'Example: "I need help fighting an IRS tax claim" or "I need audit defense"',
349
+ 'Traffic and Tickets': 'Example: "I need help reinstating a supsended license" or "I would like to fight a traffic ticket"',
350
+ 'Unemployment': 'Example: "I need help filing for unemployment benefits"',
351
+ 'Vaccination Injury': 'Example: "I was injured after receiving a vaccine and would like to file a lawsuit"',
352
+ 'Veteran\'s Disability': 'Example: "I would like help filing for disability benefits"',
353
+ 'Victim of a Crime': 'Example: "I was assaulted in the store" or "I am being discriminated against at work"',
354
+ 'Wills and Trusts': 'Example: "I need a simple will created" or "I would like guidance on creating a trust fund"',
355
+ 'Workers Compensation': 'Example: "I was injured at work and would like to file for workers compensation benefits"',
356
+ 'Wrongful Death': 'Example: "A family member was killed on the job and we need legal representation"',
357
+ 'Wrongful Termination': 'Example: "I was fired by my employer without cause"',
358
+ 'Not Sure or Other': 'Example: "I was involved in a car accident" or "I need help setting up power of attorney"'
359
+ };
360
+
361
+ const TOLPFinalHeadlines = {
362
+ // 'Adoption': '',
363
+ // 'Asbestos and Mesothelioma': '',
364
+ // 'Auto and Car Accidents': '',
365
+ // 'Bankruptcy': '',
366
+ // 'Birth Certificate and Name Change': '',
367
+ // 'Business Lawyers': '',
368
+ // 'Child Custody and Support': '',
369
+ // 'Civil Rights and Discrimination': '',
370
+ // 'Civil Lawsuit': '',
371
+ // 'Consumer Lawyers': '',
372
+ // 'Copyrights and Trademarks': '',
373
+ // 'Criminal and Felony': '',
374
+ // 'Debt and Collections': '',
375
+ // 'Divorce and Separation': '',
376
+ // 'DUI and DWI': '',
377
+ // 'Elder Law': '',
378
+ // 'Employment and Workplace': '',
379
+ // 'Expungement': '',
380
+ // 'Family Issues': '',
381
+ // 'Foreclosure': '',
382
+ // 'Guardianship': '',
383
+ // 'Harassment and Discrimination': '',
384
+ // 'Identity Theft': '',
385
+ // 'Immigration and Visas': '',
386
+ // 'Insurance': '',
387
+ // 'Landlord and Tenant': '',
388
+ // 'Lemon Law': '',
389
+ // 'Long Term Disability': '',
390
+ // 'Medical Malpractice': '',
391
+ // 'Nursing Home Abuse': '',
392
+ // 'Patents and Intellectual Property': '',
393
+ // 'Personal Injury': '',
394
+ // 'Power of Attorney': '',
395
+ // 'Probate and Estates': '',
396
+ // 'Product Liability': '',
397
+ // 'Property Damage': '',
398
+ // 'Real Estate': '',
399
+ // 'Social Security Disability and Insurance': '',
400
+ // 'Tax and IRS': '',
401
+ // 'Traffic and Tickets': '',
402
+ // 'Unemployment': '',
403
+ // 'Vaccination Injury': '',
404
+ // 'Veteran\'s Disability': '',
405
+ // 'Victim of a Crime': '',
406
+ // 'Wills and Trusts': '',
407
+ // 'Workers Compensation': '',
408
+ // 'Wrongful Death': '',
409
+ // 'Wrongful Termination': '',
410
+ // 'Not Sure or Other': ''
411
+ };
412
+
413
+ const TOLPFinalSubHeadlines = {
414
+ 'Adoption': 'You may benefit from speaking with an adoption professional. Please verify your contact information.',
415
+ // 'Asbestos and Mesothelioma': '',
416
+ 'Auto and Car Accidents': 'You may benefit from speaking with an accident professional. Please verify your contact information.',
417
+ 'Bankruptcy': 'You may benefit from speaking with a bankruptcy professional. Please verify your contact information.',
418
+ // 'Birth Certificate and Name Change': '',
419
+ // 'Business Lawyers': '',
420
+ // 'Child Custody and Support': '',
421
+ // 'Civil Rights and Discrimination': '',
422
+ // 'Civil Lawsuit': '',
423
+ // 'Consumer Lawyers': '',
424
+ 'Copyrights and Trademarks': 'You may benefit from speaking with a copyright and trademark professional. Please verify your contact information.',
425
+ // 'Criminal and Felony': '',
426
+ // 'Debt and Collections': '',
427
+ 'Divorce and Separation': 'You may benefit from speaking with a divorce professional. Please verify your contact information.',
428
+ 'DUI and DWI': 'You may benefit from speaking with a DUI professional. Please verify your contact information.',
429
+ 'Elder Law': 'You may benefit from speaking with an elder law professional. Please verify your contact information.',
430
+ // 'Employment and Workplace': '',
431
+ // 'Expungement': '',
432
+ // 'Family Issues': '',
433
+ 'Foreclosure': 'You may benefit from speaking with a foreclosure professional. Please verify your contact information.',
434
+ 'Guardianship': 'You may benefit from speaking with a guardianship professional. Please verify your contact information.',
435
+ // 'Harassment and Discrimination': '',
436
+ // 'Identity Theft': '',
437
+ 'Immigration and Visas': 'You may benefit from speaking with a immigration professional. Please verify your contact information.',
438
+ // 'Insurance': '',
439
+ 'Landlord and Tenant': 'You may benefit from speaking with a landlord and tenant legal professional. Please verify your contact information.',
440
+ // 'Lemon Law': '',
441
+ 'Long Term Disability': 'You may benefit from speaking with a disability legal professional. Please verify your contact information.',
442
+ 'Medical Malpractice': 'You may benefit from speaking with a malpractice professional. Please verify your contact information.',
443
+ // 'Nursing Home Abuse': '',
444
+ 'Patents and Intellectual Property': 'You may benefit from speaking with a patent professional. Please verify your contact information.',
445
+ 'Personal Injury': 'You may benefit from speaking with a personal injury professional. Please verify your contact information.',
446
+ // 'Power of Attorney': '',
447
+ 'Probate and Estates': 'You may benefit from speaking with a probate and estate professional. Please verify your contact information.',
448
+ // 'Product Liability': '',
449
+ // 'Property Damage': '',
450
+ 'Real Estate': 'You may benefit from speaking with a real estate professional. Please verify your contact information.',
451
+ 'Social Security Disability and Insurance': 'You may benefit from speaking with an SSDI professional. Please verify your contact information.',
452
+ 'Tax and IRS': 'You may benefit from speaking with a tax professional. Please verify your contact information.',
453
+ // 'Traffic and Tickets': '',
454
+ 'Unemployment': 'You may benefit from speaking with an unemployment professional. Please verify your contact information.',
455
+ // 'Vaccination Injury': '',
456
+ 'Veteran\'s Disability': 'You may benefit from speaking with a disability legal professional. Please verify your contact information.',
457
+ // 'Victim of a Crime': '',
458
+ // 'Wills and Trusts': '',
459
+ 'Workers Compensation': 'You may benefit from speaking with a workers compensation professional. Please verify your contact information.',
460
+ // 'Wrongful Death': '',
461
+ // 'Wrongful Termination': '',
462
+ // 'Not Sure or Other': ''
463
+ };
464
+
297
465
  // ------ Common Base Settings
298
466
 
299
467
  const checkbox = (updates) => {
@@ -583,10 +751,12 @@ const atFault = () => sbsYesNoRadio({
583
751
  });
584
752
 
585
753
  const bankruptcyCrossSell = () => sbsCheckbox({
586
- label: "I'd like a free consultation for bankruptcy and eliminating my debt",
754
+ label: "I'd also like a separate consultation for bankruptcy and debt elimination",
755
+ help: "Please note: you will be contacted separately by a bankruptcy expert",
587
756
  name: 'CrossSell_Bankruptcy',
588
- if: '$getVal($get(form), "Degree_Of_Interest") == "Absolutely Can\'t Afford"',
589
- validation: null
757
+ if: '$getVal($get(form), "Degree_Of_Interest") == "Absolutely Can\'t Afford" || $getVal($get(form), "Degree_Of_Interest") == "Maybe"',
758
+ validation: null,
759
+ helpClass: "!t-text-sm"
590
760
  });
591
761
 
592
762
  const bloodContentAlcholTest = () => sbsSelect({
@@ -1113,7 +1283,7 @@ const generalTOLP = (updates) => sbsSelect(merge({
1113
1283
 
1114
1284
  const haveAttorney = () => sbsYesNoRadio({
1115
1285
  name: 'Have_Attorney',
1116
- label: 'Are You Currently Working with An Attorney?'
1286
+ label: 'Are You Already Working with An Attorney?'
1117
1287
  });
1118
1288
 
1119
1289
  const haveChildren = () => sbsYesNoRadio({
@@ -2465,48 +2635,72 @@ function generalLegalTOLPAndZipV2(updates = {}) {
2465
2635
  }
2466
2636
 
2467
2637
  const DEFAULT_COMMENTS_PLACEHOLDER = 'For Example: "I\'ve been involved in an auto accident" or "I need Power of Attorney"';
2638
+ const DEFAULT_COMMENTS_PLACEHOLDER_V2 = '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
2468
2639
  const DEFAULT_COMMENTS_LABEL = 'Please briefly describe your legal issue in a few words:';
2469
2640
 
2470
- function commentsWithBankruptcy(updates = {}) {
2641
+ function commentsWithBankruptcyV2(updates = {}) {
2471
2642
  return step(
2472
2643
  'commentsWithBankruptcy',
2473
2644
  [
2645
+ {
2646
+ $el: 'h3',
2647
+ children: 'Additional Case Details',
2648
+ attrs: {
2649
+ 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-3'
2650
+ }
2651
+ },
2474
2652
  comments({
2475
2653
  label: updates.label || DEFAULT_COMMENTS_LABEL,
2476
- placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER
2654
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_V2
2477
2655
  }),
2478
2656
  bankruptcyCrossSell()
2479
2657
  ],
2480
2658
  updates.nextOnEnter
2481
2659
  )
2482
2660
  }
2661
+ const DEFAULT_FINAL_HEADLINE_V2 = 'We Found Matches For Your Case!';
2662
+ const DEFAULT_FINAL_HEADLINE_V2_b = '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
2663
+ const DEFAULT_FINAL_SUBHEADLINE_V2 = 'You may benefit from speaking with a legal professional. Please verify your contact information.';
2664
+ const DEFAULT_FINAL_SUBHEADLINE_V2_b = '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
2483
2665
 
2484
- const DEFAULT_FINAL_HEADLINE = "Based on your input, you may benefit from speaking with a legal professional. Please verify your contact information.";
2485
-
2486
- function contactInfo(updates = {}) {
2666
+ function contactInfoV2(updates = {}) {
2487
2667
  return step(
2488
2668
  'contactInfo',
2489
2669
  [
2490
2670
  {
2491
2671
  $el: 'h3',
2492
- children: updates.headline || DEFAULT_FINAL_HEADLINE,
2672
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_V2_b,
2673
+ attrs: {
2674
+ 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-3'
2675
+ }
2676
+ },
2677
+ {
2678
+ $el: 'h5',
2679
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_V2_b,
2493
2680
  attrs: {
2494
- class: 't-flex t-justify-center t-text-center t-text-lg t-font-bold t-pb-5 t-pt-0 t-px-3'
2681
+ class: 't-flex t-justify-center t-text-center !t-text-lg t-font-semibold t-pb-7 t-pt-0 t-px-3'
2495
2682
  }
2496
2683
  },
2497
2684
  email(),
2498
2685
  phone(),
2499
2686
  TCPAConsent(),
2500
- privacyIcons()
2687
+ secureIcon()
2501
2688
  ],
2502
2689
  updates.nextOnEnter
2503
2690
  )
2504
2691
  }
2505
2692
 
2506
- function firstAndLast(updates = {}) {
2693
+ function firstAndLastV2(updates = {}) {
2507
2694
  return step(
2508
2695
  'firstAndLast',
2509
2696
  [
2697
+ {
2698
+ $el: 'h3',
2699
+ children: 'Please Provide a Contact Name',
2700
+ attrs: {
2701
+ 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-3'
2702
+ }
2703
+ },
2510
2704
  firstName(),
2511
2705
  lastName()
2512
2706
  ],
@@ -2574,7 +2768,7 @@ function generalLegalTOLPQuestions(updates = {}) {
2574
2768
  questions.unshift(
2575
2769
  {
2576
2770
  $el: 'h3',
2577
- children: updates.headline || "Please Complete the Following:",
2771
+ children: updates.headline || 'Tell Us More About Your Case',
2578
2772
  attrs: {
2579
2773
  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-3'
2580
2774
  }
@@ -2588,9 +2782,7 @@ function generalLegalTOLPQuestions(updates = {}) {
2588
2782
  )
2589
2783
  }
2590
2784
 
2591
- // ------ Utilities
2592
-
2593
- const formNavigation = () => ({
2785
+ const formNavigationV2 = () => ({
2594
2786
  $el: 'div',
2595
2787
  attrs: {
2596
2788
  class: 'step-nav'
@@ -2610,7 +2802,16 @@ const formNavigation = () => ({
2610
2802
  $formkit: 'button',
2611
2803
  name: 'next_button',
2612
2804
  onClick: '$setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form)))',
2613
- children: 'Next',
2805
+ children: {
2806
+ if: '$activeStep === $firstStep()',
2807
+ then: 'Get Help',
2808
+ else: 'Next'
2809
+ },
2810
+ outerClass: {
2811
+ if: '$activeStep === $lastStep()',
2812
+ then: 't-hidden',
2813
+ else: ''
2814
+ },
2614
2815
  style: {
2615
2816
  if: '$activeStep === $lastStep()',
2616
2817
  then: 'display: none;'
@@ -2669,13 +2870,20 @@ const formDetails = () => ({
2669
2870
  });
2670
2871
 
2671
2872
  const schema = [
2672
- metaProps(),
2873
+ metaProps({
2874
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER,
2875
+ commentsPlaceholders: TOLPCommentsPlaceholders,
2876
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_V2,
2877
+ finalHeadlines: TOLPFinalHeadlines,
2878
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_V2,
2879
+ finalSubHeadlines: TOLPFinalSubHeadlines
2880
+ }),
2673
2881
  formAnchor(),
2674
2882
  {
2675
2883
  $cmp: 'FormKit',
2676
2884
  props: formProps({
2677
2885
  formId: 'generalLegalPopUnder',
2678
- onSubmit: '$submit($submitUrl, $prepData, $handleRedirect)',
2886
+ onSubmit: '$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
2679
2887
  redirectMap: legalRedirectMap(),
2680
2888
  popUnder: '/thank-you',
2681
2889
  anchorElement: 'form-anchor',
@@ -2683,11 +2891,11 @@ const schema = [
2683
2891
  }),
2684
2892
  children: [
2685
2893
  headline({
2686
- children: 'Need Legal Help? Start Here!',
2894
+ children: '$urlParam("hl", "Need Legal Help? Start Here!")',
2687
2895
  if: '$activeStep === $firstStep()'
2688
2896
  }),
2689
2897
  subHeadline({
2690
- children: 'Get Your Questions Answered Today!',
2898
+ children: '$urlParam("shl", "Our Service is Fast, Easy, and Free!")',
2691
2899
  if: '$activeStep === $firstStep()'
2692
2900
  }),
2693
2901
  ...hiddenInputs,
@@ -2699,14 +2907,14 @@ const schema = [
2699
2907
  children: [
2700
2908
  generalLegalTOLPAndZipV2(),
2701
2909
  generalLegalTOLPQuestions(),
2702
- commentsWithBankruptcy({
2910
+ commentsWithBankruptcyV2({
2703
2911
  nextOnEnter: false
2704
2912
  }),
2705
- firstAndLast(),
2706
- contactInfo({
2913
+ firstAndLastV2(),
2914
+ contactInfoV2({
2707
2915
  nextOnEnter: false
2708
2916
  }),
2709
- formNavigation(),
2917
+ formNavigationV2(),
2710
2918
  formDetails()
2711
2919
  ]
2712
2920
  }