bhl-forms 0.8.7 → 0.8.9

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 (114) hide show
  1. package/dist/bhl-forms.iife.js +4 -4
  2. package/dist/bhl-forms.modern.iife.js +1 -1
  3. package/dist/bhl-forms.modern.umd.js +1 -1
  4. package/dist/bhl-forms.umd.js +4 -4
  5. package/dist/forms/accidentsAndInjuries.es.js +4 -4
  6. package/dist/forms/accidentsAndInjuries.iife.js +1 -1
  7. package/dist/forms/accidentsAndInjuries.json +7 -8
  8. package/dist/forms/appraisals.es.js +1 -1
  9. package/dist/forms/appraisals.iife.js +1 -1
  10. package/dist/forms/appraisals.json +7 -8
  11. package/dist/forms/business.es.js +4 -4
  12. package/dist/forms/business.iife.js +1 -1
  13. package/dist/forms/business.json +7 -8
  14. package/dist/forms/childAndFamily.es.js +4 -4
  15. package/dist/forms/childAndFamily.iife.js +1 -1
  16. package/dist/forms/childAndFamily.json +7 -8
  17. package/dist/forms/childAndFamilySingle.es.js +11 -4
  18. package/dist/forms/childAndFamilySingle.iife.js +1 -1
  19. package/dist/forms/childAndFamilySingle.json +7 -8
  20. package/dist/forms/civilLawsuit.es.js +11 -4
  21. package/dist/forms/civilLawsuit.iife.js +1 -1
  22. package/dist/forms/civilLawsuit.json +7 -8
  23. package/dist/forms/coins.es.js +1 -1
  24. package/dist/forms/coins.iife.js +1 -1
  25. package/dist/forms/coins.json +7 -8
  26. package/dist/forms/contracts.es.js +4 -4
  27. package/dist/forms/contracts.iife.js +1 -1
  28. package/dist/forms/contracts.json +7 -8
  29. package/dist/forms/criminal.es.js +11 -4
  30. package/dist/forms/criminal.iife.js +1 -1
  31. package/dist/forms/criminal.json +7 -8
  32. package/dist/forms/divorce.es.js +11 -4
  33. package/dist/forms/divorce.iife.js +1 -1
  34. package/dist/forms/divorce.json +7 -8
  35. package/dist/forms/employmentAndWorkplace.es.js +21 -22
  36. package/dist/forms/employmentAndWorkplace.iife.js +1 -1
  37. package/dist/forms/employmentAndWorkplace.json +7 -8
  38. package/dist/forms/foreclosure.es.js +2123 -0
  39. package/dist/forms/foreclosure.iife.js +1 -0
  40. package/dist/forms/foreclosure.json +13 -0
  41. package/dist/forms/generalContractors.es.js +7 -3
  42. package/dist/forms/generalContractors.iife.js +1 -1
  43. package/dist/forms/generalContractors.json +7 -8
  44. package/dist/forms/generalHomeImprovement.es.js +13 -5
  45. package/dist/forms/generalHomeImprovement.iife.js +1 -1
  46. package/dist/forms/generalHomeImprovement.json +7 -8
  47. package/dist/forms/generalHomeImprovementThankYou.es.js +1 -1
  48. package/dist/forms/generalHomeImprovementThankYou.iife.js +1 -1
  49. package/dist/forms/generalHomeImprovementThankYou.json +7 -8
  50. package/dist/forms/generalLegal.es.js +5 -6
  51. package/dist/forms/generalLegal.iife.js +1 -1
  52. package/dist/forms/generalLegal.json +7 -8
  53. package/dist/forms/generalLegalJustAnswer.es.js +13 -7
  54. package/dist/forms/generalLegalJustAnswer.iife.js +1 -1
  55. package/dist/forms/generalLegalJustAnswer.json +7 -8
  56. package/dist/forms/generalLegalPopUnder.es.js +5 -6
  57. package/dist/forms/generalLegalPopUnder.iife.js +1 -1
  58. package/dist/forms/generalLegalPopUnder.json +7 -8
  59. package/dist/forms/generalLegalPopUnderSingle.es.js +13 -7
  60. package/dist/forms/generalLegalPopUnderSingle.iife.js +1 -1
  61. package/dist/forms/generalLegalPopUnderSingle.json +7 -8
  62. package/dist/forms/generalLegalSingle.es.js +13 -7
  63. package/dist/forms/generalLegalSingle.iife.js +1 -1
  64. package/dist/forms/generalLegalSingle.json +7 -8
  65. package/dist/forms/generalLegalThankYou.es.js +3 -4
  66. package/dist/forms/generalLegalThankYou.iife.js +1 -1
  67. package/dist/forms/generalLegalThankYou.json +7 -8
  68. package/dist/forms/generalLegalThankYouConsultation.es.js +13 -7
  69. package/dist/forms/generalLegalThankYouConsultation.iife.js +1 -1
  70. package/dist/forms/generalLegalThankYouConsultation.json +7 -8
  71. package/dist/forms/harassmentAndDiscrimination.es.js +4 -4
  72. package/dist/forms/harassmentAndDiscrimination.iife.js +1 -1
  73. package/dist/forms/harassmentAndDiscrimination.json +7 -8
  74. package/dist/forms/landlordTenant.es.js +4 -4
  75. package/dist/forms/landlordTenant.iife.js +1 -1
  76. package/dist/forms/landlordTenant.json +7 -8
  77. package/dist/forms/malpractice.es.js +4 -4
  78. package/dist/forms/malpractice.iife.js +1 -1
  79. package/dist/forms/malpractice.json +7 -8
  80. package/dist/forms/mechanics.es.js +2 -2
  81. package/dist/forms/mechanics.iife.js +1 -1
  82. package/dist/forms/mechanics.json +7 -8
  83. package/dist/forms/patentsAndIP.es.js +11 -4
  84. package/dist/forms/patentsAndIP.iife.js +1 -1
  85. package/dist/forms/patentsAndIP.json +7 -8
  86. package/dist/forms/realEstate.es.js +5 -5
  87. package/dist/forms/realEstate.iife.js +1 -1
  88. package/dist/forms/realEstate.json +7 -8
  89. package/dist/forms/repossession.es.js +4 -4
  90. package/dist/forms/repossession.iife.js +1 -1
  91. package/dist/forms/repossession.json +7 -8
  92. package/dist/forms/ssdi.es.js +2 -2
  93. package/dist/forms/ssdi.iife.js +1 -1
  94. package/dist/forms/ssdi.json +7 -8
  95. package/dist/forms/testForm.es.js +2 -2
  96. package/dist/forms/testForm.iife.js +1 -1
  97. package/dist/forms/testForm.json +7 -8
  98. package/dist/forms/testRedirects.es.js +1 -2
  99. package/dist/forms/testRedirects.iife.js +1 -1
  100. package/dist/forms/testRedirects.json +7 -8
  101. package/dist/forms/vets.es.js +1 -1
  102. package/dist/forms/vets.iife.js +1 -1
  103. package/dist/forms/vets.json +7 -8
  104. package/dist/forms/willsAndTrusts.es.js +4 -4
  105. package/dist/forms/willsAndTrusts.iife.js +1 -1
  106. package/dist/forms/willsAndTrusts.json +7 -8
  107. package/dist/forms/windows.es.js +4 -2
  108. package/dist/forms/windows.iife.js +1 -1
  109. package/dist/forms/windows.json +7 -8
  110. package/dist/forms/workersCompensation.es.js +2037 -0
  111. package/dist/forms/workersCompensation.iife.js +1 -0
  112. package/dist/forms/workersCompensation.json +13 -0
  113. package/dist/main.css +1 -1
  114. package/package.json +1 -1
@@ -0,0 +1,2123 @@
1
+ function merge() {
2
+ return Object.assign({}, ...arguments)
3
+ }
4
+
5
+ function LegalRedirectUrl() {
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
+ }
8
+
9
+ const DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL =
10
+ '$getKey($meta, "commentsPlaceholders." + $get(Type_Of_Legal_Problem).value, $meta.defaultCommentsPlaceholder)';
11
+ const DEFAULT_COMMENTS_LABEL_LEGAL = "Please briefly describe your legal issue in a few words:";
12
+ const DEFAULT_FINAL_HEADLINE_LEGAL = "Submit Your Case";
13
+ const DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL =
14
+ '$getKey($meta, "finalHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalHeadline)';
15
+ const DEFAULT_FINAL_SUBHEADLINE_LEGAL =
16
+ "You may benefit from speaking with a legal professional. Please verify your contact information.";
17
+ const DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL =
18
+ '$getKey($meta, "finalSubHeadlines." + $get(Type_Of_Legal_Problem).value, $meta.defaultFinalSubHeadline)';
19
+ const TCPA_LANGUAGE_LEGAL =
20
+ "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.";
21
+
22
+ // ------ Common Base Settings
23
+
24
+ const checkbox = (updates) => {
25
+ if (updates.name && !updates.id) {
26
+ updates.id = updates.name;
27
+ }
28
+ return merge(
29
+ {
30
+ $formkit: "checkbox",
31
+ validation: "required",
32
+ validationMessages: {
33
+ required: "Field is required",
34
+ },
35
+ },
36
+ updates
37
+ )
38
+ };
39
+
40
+ const sbsCheckbox = (updates) => {
41
+ updates.legendClass = "legend-left required";
42
+ updates.fieldsetClass = "$reset side-by-side";
43
+ updates.optionsClass = "t-pl-1";
44
+ updates.innerClass = "t-flex t-items-center";
45
+ updates.wrapperClass = "t-mb-3";
46
+ return checkbox(updates)
47
+ };
48
+
49
+ const col2Checkbox = (updates) => {
50
+ if (!updates || !updates.legendClass) {
51
+ updates.legendClass = "required";
52
+ }
53
+ updates.fieldsetClass = "$reset";
54
+ updates.optionsClass = "t-pl-8 md:t-pl-2 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
55
+ updates.innerClass = "t-items-start";
56
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
57
+ return checkbox(updates)
58
+ };
59
+
60
+ const verticalCol2Checkbox = (updates) => {
61
+ if (!updates || !updates.legendClass) {
62
+ updates.legendClass = "required t-w-[100%] t-text-center";
63
+ }
64
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col";
65
+ updates.innerClass = "t-items-start";
66
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
67
+ updates.optionClass = "t-pl-4 md:t-pl-16 md:t-min-w-[200px]";
68
+ updates.optionsClass = "t-pl-4 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
69
+ updates.messagesClass = "t-flex t-justify-center";
70
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
71
+ return checkbox(updates)
72
+ };
73
+
74
+ const radio = (updates) => {
75
+ if (updates.name && !updates.id) {
76
+ updates.id = updates.name;
77
+ }
78
+ return merge(
79
+ {
80
+ $formkit: "radio",
81
+ validation: "required",
82
+ validationMessages: {
83
+ required: "Field is required",
84
+ },
85
+ optionsClass: "t-pt-3 t-pl-1",
86
+ legendClass: "required",
87
+ },
88
+ updates
89
+ )
90
+ };
91
+
92
+ // TODO: rename
93
+ const col2RadioCenter = (updates) => {
94
+ updates.legendClass = "required t-w-[100%] t-text-center";
95
+ if (typeof updates.fieldsetClass === "undefined") {
96
+ updates.fieldsetClass = "$reset t-flex t-justify-center";
97
+ }
98
+ updates.innerClass = "t-items-start";
99
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
100
+ updates.optionClass = "t-pl-4 md:t-pl-8 md:t-min-w-[200px]";
101
+ updates.optionsClass = "t-pl-4 t-pt-3 t-grid t-grid-cols-1 md:t-grid-cols-2";
102
+ updates.messagesClass = "t-flex t-justify-center";
103
+ updates.helpClass = "t-mt-0 t-mb-4 !t-text-sm t-text-center";
104
+ return radio(updates)
105
+ };
106
+
107
+ const sbs2ColRadio = (updates) => {
108
+ updates.legendClass = "legend-left-flex md:t-max-w-[40%] required";
109
+ updates.fieldsetClass = "$reset side-by-side-flex";
110
+ updates.optionsClass = "md:t-ml-4 md:t-mt-2 t-grid t-grid-cols-1 md:t-grid-cols-2-125";
111
+ updates.innerClass = "t-flex t-items-start";
112
+ updates.wrapperClass = "$reset t-flex t-cursor-pointer t-mb-3";
113
+ return radio(updates)
114
+ };
115
+
116
+ const sbs2ItemRadio = (updates) => {
117
+ updates.legendClass = "legend-left t-pb-1 required";
118
+ updates.fieldsetClass = "$reset side-by-side t-items-center";
119
+ updates.optionsClass = "t-mt-1 t-grid t-grid-cols-1 md:t-grid-cols-2-125 t-items-center";
120
+ updates.innerClass = "t-flex t-items-center";
121
+ updates.optionClass = "t-pr-1";
122
+ return radio(updates)
123
+ };
124
+
125
+ const sbsYesNoRadio = (updates) => {
126
+ updates.options = ["Yes", "No"];
127
+ return sbs2ItemRadio(updates)
128
+ };
129
+
130
+ const verticalButtonRadio = (updates) => {
131
+ updates.legendClass = "legend-left";
132
+ updates.fieldsetClass = "$reset t-flex t-justify-center t-flex-col-reverse t-items-center";
133
+ if (typeof updates.optionsClass === "undefined") {
134
+ updates.optionsClass = "t-flex t-flex-col sm:t-flex-row t-justify-center t-my-3";
135
+ }
136
+ updates.optionClass = "radiobtn t-my-2 sm:t-my-0 t-mx-2 md:t-mx-5";
137
+ updates.wrapperClass = "$reset formkit-wrapper t-mb-0 t-flex t-items-center t-h-[100%]";
138
+ updates.labelClass = "t-font-semibold t-text-[#1e448f] t-w-[100%]";
139
+ updates.decoratorIcon = false;
140
+ updates.messagesClass = "t-flex t-justify-center";
141
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
142
+ return radio(updates)
143
+ };
144
+
145
+ const verticalYesNoRadio = (updates) => {
146
+ updates.options = ["Yes", "No"];
147
+ updates.optionsClass = "t-flex t-justify-center t-my-3";
148
+ return verticalButtonRadio(updates)
149
+ };
150
+
151
+ const select = (updates) => {
152
+ if (updates.name && !updates.id) {
153
+ updates.id = updates.name;
154
+ }
155
+ return merge(
156
+ {
157
+ $formkit: "select",
158
+ placeholder: "Please Select",
159
+ validation: "required",
160
+ validationMessages: {
161
+ required: "Field is required",
162
+ },
163
+ inputClass: "t-bg-white",
164
+ labelClass: "required",
165
+ },
166
+ updates
167
+ )
168
+ };
169
+
170
+ const sbsSelect = (updates) => {
171
+ updates.labelClass = "required";
172
+ updates.wrapperClass = "side-by-side t-items-center";
173
+ updates.innerClass = "select-height-content";
174
+ updates.helpClass = "t-mt-2.5 md:t-text-right md:t-mt-[-5px]";
175
+ return select(updates)
176
+ };
177
+
178
+ const verticalSelect = (updates) => {
179
+ updates.labelClass = "required";
180
+ updates.wrapperClass = "t-flex t-justify-center";
181
+ updates.messagesClass = "t-flex t-justify-center";
182
+ updates.inputClass = "t-min-w-[150px] t-bg-white";
183
+ updates.helpClass = "t-mt-2.5 t-text-center";
184
+ return select(updates)
185
+ };
186
+
187
+ const text = (updates) => {
188
+ if (updates.name && !updates.id) {
189
+ updates.id = updates.name;
190
+ }
191
+ return merge(
192
+ {
193
+ $formkit: "text",
194
+ validation: "required",
195
+ validationMessages: {
196
+ required: "Field is required",
197
+ },
198
+ labelClass: "required",
199
+ },
200
+ updates
201
+ )
202
+ };
203
+
204
+ const sbsText = (updates) => {
205
+ updates.wrapperClass = "side-by-side t-items-center";
206
+ return text(updates)
207
+ };
208
+
209
+ const verticalText = (updates) => {
210
+ updates.wrapperClass = "t-flex t-justify-center";
211
+ updates.messagesClass = "t-flex t-justify-center";
212
+ updates.inputClass = "t-text-center";
213
+ updates.helpClass = "t-mt-2.5 !t-text-sm t-text-center";
214
+ return text(updates)
215
+ };
216
+
217
+ const textArea = (updates) => {
218
+ if (updates.name && !updates.id) {
219
+ updates.id = updates.name;
220
+ }
221
+ return merge(
222
+ {
223
+ $formkit: "textarea",
224
+ rows: 5,
225
+ maxlength: 500,
226
+ validation: "required",
227
+ validationMessages: {
228
+ required: "Field is required",
229
+ },
230
+ innerClass: "t-max-w-xl",
231
+ labelClass: "required",
232
+ },
233
+ updates
234
+ )
235
+ };
236
+
237
+ const date = (updates) => {
238
+ if (updates.name && !updates.id) {
239
+ updates.id = updates.name;
240
+ }
241
+ return merge(
242
+ {
243
+ $formkit: "DatePicker",
244
+ validation: "required",
245
+ validationMessages: {
246
+ required: "Field is required",
247
+ },
248
+ labelClass: "required t-block t-mb-3 t-font-semibold t-text-base formkit-invalid:t-text-red-500",
249
+ innerClass:
250
+ "t-border t-border-gray-400 formkit-invalid:t-border-red-500 t-rounded t-mb-1 focus-within:t-border-blue-500",
251
+ },
252
+ updates
253
+ )
254
+ };
255
+
256
+ const sbsDate = (updates) => {
257
+ updates.wrapperClass = "side-by-side t-items-center";
258
+ return date(updates)
259
+ };
260
+
261
+ const verticalDate = (updates) => {
262
+ updates.wrapperClass = "t-flex t-justify-center";
263
+ updates.inputClass = "t-text-center";
264
+ updates.messagesClass = "t-flex t-justify-center";
265
+ return date(updates)
266
+ };
267
+
268
+ const email = (scope, vertical, updates = {}) => {
269
+ const func = vertical ? verticalText : sbsText;
270
+ const label = vertical ? updates.label : "Email Address:";
271
+ return func({
272
+ $formkit: "email",
273
+ name: scope ? scope + ":" + "Email" : "Email",
274
+ label,
275
+ placeholder: "email@domain.com",
276
+ autocomplete: "email",
277
+ "data-tf-sensitive": "false",
278
+ validation: "required|email",
279
+ validationMessages: {
280
+ required: "Email is required",
281
+ email: "Invalid Email",
282
+ },
283
+ ...updates,
284
+ })
285
+ };
286
+
287
+ const firstName = (scope, vertical, updates = {}) => {
288
+ const func = vertical ? verticalText : sbsText;
289
+ const label = vertical ? updates.label : "First Name:";
290
+ return func({
291
+ label,
292
+ placeholder: "First",
293
+ name: scope ? scope + ":" + "First_Name" : "First_Name",
294
+ autocomplete: "given-name",
295
+ validationMessages: {
296
+ required: "First Name is required",
297
+ },
298
+ ...updates,
299
+ })
300
+ };
301
+
302
+ const lastName = (scope, vertical, updates = {}) => {
303
+ const func = vertical ? verticalText : sbsText;
304
+ const label = vertical ? updates.label : "Last Name:";
305
+ return func({
306
+ label,
307
+ placeholder: "Last",
308
+ name: scope ? scope + ":" + "Last_Name" : "Last_Name",
309
+ autocomplete: "family-name",
310
+ validationMessages: {
311
+ required: "Last Name is required",
312
+ },
313
+ ...updates,
314
+ })
315
+ };
316
+
317
+ const phone = (scope, vertical, updates = {}) => {
318
+ const func = vertical ? verticalText : sbsText;
319
+ const label = vertical ? updates.label : "Phone Number:";
320
+ return func({
321
+ $formkit: "tel",
322
+ name: scope ? scope + ":" + "Primary_Phone" : "Primary_Phone",
323
+ label,
324
+ placeholder: "###-###-####",
325
+ maxlength: 12,
326
+ help: "10-digit phone number, hyphens optional",
327
+ autocomplete: "tel-national",
328
+ "data-tf-sensitive": "false",
329
+ validation: "required|matches:/^[0-9]{3}-?[0-9]{3}-?[0-9]{4}$/|valid_phone",
330
+ validationMessages: {
331
+ required: "Phone Number is required",
332
+ matches: "Invalid Phone Format, use ###-###-####",
333
+ valid_phone: "Invalid Phone Number",
334
+ },
335
+ helpClass: "t-mt-2.5 md:t-text-right md:t-mt-[-2px]",
336
+ ...updates,
337
+ })
338
+ };
339
+
340
+ const zipcode$1 = (scope, vertical, updates = {}) => {
341
+ const func = vertical ? verticalText : sbsText;
342
+ const label = vertical ? updates.label : "Zip Code:";
343
+ const help = vertical ? updates.help ?? "We try to match you with local help" : null;
344
+ return func({
345
+ label,
346
+ help,
347
+ placeholder: "#####",
348
+ name: scope ? scope + ":" + "Zip" : "Zip",
349
+ maxlength: 5,
350
+ inputmode: "numeric",
351
+ autocomplete: "postal-code",
352
+ validation: "required|matches:/^[0-9]{5}$/",
353
+ validationMessages: {
354
+ required: "Zip Code is required",
355
+ matches: "Invalid Zip Code",
356
+ },
357
+ ...updates,
358
+ })
359
+ };
360
+
361
+ const amountPaymentsPastDue$1 = (scope, vertical, updates = {}) => {
362
+ const func = vertical ? verticalSelect : sbsSelect;
363
+ const label = vertical ? updates.label : "Total Amount of Payments that are Past Due:";
364
+ return func(
365
+ merge(
366
+ {
367
+ label,
368
+ name: scope ? scope + ":" + "Amount_Payments_Past_Due" : "Amount_Payments_Past_Due",
369
+ options: [
370
+ "$0 - $499",
371
+ "$500 - $999",
372
+ "$1,000 - $2,499",
373
+ "$2,500 - $4,999",
374
+ "$5,000 - $9,999",
375
+ "$10,000 - $24,999",
376
+ "$25,000 - $49,999",
377
+ "$50,000 - $99,999",
378
+ "More than $100,000",
379
+ ],
380
+ },
381
+ updates
382
+ )
383
+ )
384
+ };
385
+
386
+ const applicantAge = (scope, vertical, updates = {}) => {
387
+ const func = vertical ? verticalText : sbsText;
388
+ const label = vertical ? updates.label : "Age of Applicant?";
389
+ const value = vertical ? updates.value ?? "50" : null;
390
+ return func(
391
+ merge({
392
+ label,
393
+ placeholder: "Age between 18 and 65",
394
+ name: scope ? scope + ":" + "Applicant_Age" : "Applicant_Age",
395
+ value,
396
+ maxlength: 2,
397
+ inputmode: "numeric",
398
+ validation: "required|min:18,max:65",
399
+ validationMessages: {
400
+ required: "Applicant Age is required",
401
+ min: "Invalid Age - must be between 18 and 65",
402
+ max: "Invalid Age - must be between 18 and 65",
403
+ },
404
+ ...updates,
405
+ })
406
+ )
407
+ };
408
+
409
+ const atFault = (scope, vertical, updates = {}) => {
410
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
411
+ const label = vertical ? updates.label : "Were You at Fault?";
412
+ return func(
413
+ merge(
414
+ {
415
+ label,
416
+ name: scope ? scope + ":" + "At_Fault" : "At_Fault",
417
+ },
418
+ updates
419
+ )
420
+ )
421
+ };
422
+
423
+ const bankruptcyCrossSell = (scope) =>
424
+ sbsCheckbox({
425
+ label: "I'd also like a consult for bankruptcy or debt elimination (optional)",
426
+ help: "Note: you will be contacted separately by a bankruptcy/debt expert",
427
+ name: scope ? scope + ":CrossSell_Bankruptcy" : "CrossSell_Bankruptcy",
428
+ id: scope ? scope + ":CrossSell_Bankruptcy" : "CrossSell_Bankruptcy",
429
+ if: '$getVal($get(form), "Type_Of_Legal_Problem") != "Bankruptcy" && ($getVal($get(form), "Degree_Of_Interest") == "Absolutely Can\'t Afford" || $getVal($get(form), "Degree_Of_Interest") == "Maybe" || $getVal($get(form), "Degree_Of_Interest") == "Probably")',
430
+ validation: null,
431
+ helpClass: "!t-text-sm",
432
+ });
433
+
434
+ const childHome = (scope, vertical, updates = {}) => {
435
+ const func = vertical ? col2RadioCenter : sbsSelect;
436
+ const label = vertical ? updates.label : "With Whom Do the Children Currently Live?";
437
+ return func(
438
+ merge(
439
+ {
440
+ label,
441
+ name: scope ? scope + ":" + "Child_Home" : "Child_Home",
442
+ options: ["Mother", "Father", "Grandparents", "Other"],
443
+ },
444
+ updates
445
+ )
446
+ )
447
+ };
448
+
449
+ const childPrimaryCaregiver = (scope, vertical, updates = {}) => {
450
+ const func = vertical ? verticalButtonRadio : sbsSelect;
451
+ const label = vertical ? updates.label : "Who is the Primary Caregiver?";
452
+ return func(
453
+ merge(
454
+ {
455
+ label,
456
+ name: scope ? scope + ":" + "Child_Primary_Caregiver" : "Child_Primary_Caregiver",
457
+ options: ["Mother", "Father", "Other"],
458
+ },
459
+ updates
460
+ )
461
+ )
462
+ };
463
+
464
+ const childRelationship = (scope, vertical, updates = {}) => {
465
+ const func = vertical ? col2RadioCenter : sbsSelect;
466
+ const label = vertical ? updates.label : "Your Relationship to Child(ren):";
467
+ return func(
468
+ merge(
469
+ {
470
+ label,
471
+ name: scope ? scope + ":" + "Child_Relationship" : "Child_Relationship",
472
+ options: ["Father", "Mother", "Grandparent", "Aunt/Uncle", "Other"],
473
+ },
474
+ updates
475
+ )
476
+ )
477
+ };
478
+
479
+ const claimStatus = (scope, vertical, updates = {}) => {
480
+ const func = vertical ? col2RadioCenter : sbsSelect;
481
+ const label = vertical ? updates.label : "Status of Claim:";
482
+ return func(
483
+ merge(
484
+ {
485
+ label,
486
+ name: scope ? scope + ":" + "Claim_Status" : "Claim_Status",
487
+ options: ["No action taken yet", "Demand for compensation made", "Lawsuit filed", "Other"],
488
+ },
489
+ updates
490
+ )
491
+ )
492
+ };
493
+
494
+ // TODO: vertical not supported yet
495
+ const comments = (scope, vertical, updates) =>
496
+ textArea(
497
+ merge(
498
+ {
499
+ name: scope ? scope + ":" + "Comments" : "Comments",
500
+ label: "Please briefly describe your situation in a few words:",
501
+ placeholder:
502
+ 'For Example: "I would like help with child support payments" or "I need help with visitation rights"',
503
+ },
504
+ updates
505
+ )
506
+ );
507
+
508
+ const degreeOfInterest$1 = (scope, vertical, updates = {}) => {
509
+ const func = vertical ? col2RadioCenter : sbsSelect;
510
+ const label = vertical ? updates.label : "How Likely Are You to Pay if Your Issue Could be Resolved?";
511
+ const help = vertical ? updates.help : "No payment necessary to speak with lawyers.";
512
+ return func(
513
+ merge(
514
+ {
515
+ name: scope ? scope + ":" + "Degree_Of_Interest" : "Degree_Of_Interest",
516
+ id: scope ? scope + ":" + "Degree_Of_Interest" : "Degree_Of_Interest",
517
+ label,
518
+ help,
519
+ options: ["Definitely", "Probably", "Maybe", "Absolutely Can't Afford"],
520
+ },
521
+ updates
522
+ )
523
+ )
524
+ };
525
+
526
+ const defaultNotice$1 = (scope, vertical, updates = {}) => {
527
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
528
+ const label = vertical ? updates.label : "Have You Received a Notice of Loan Default?";
529
+ return func(
530
+ merge(
531
+ {
532
+ name: scope ? scope + ":" + "Default_Notice" : "Default_Notice",
533
+ label,
534
+ },
535
+ updates
536
+ )
537
+ )
538
+ };
539
+
540
+ const degreeOfInterestHelp = (scope, vertical, updates = {}) =>
541
+ degreeOfInterest$1(scope, vertical, merge(updates, { help: "No payment necessary to speak with lawyers." }));
542
+
543
+ const disabilityConditionStopWork = (scope, vertical, updates = {}) => {
544
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
545
+ const label = vertical
546
+ ? updates.label
547
+ : "Do You Expect To Be Out Of Work For At Least a Year Due To Your Health?";
548
+ return func(
549
+ merge(
550
+ {
551
+ name: scope ? scope + ":" + "Disability_Condition_Stop_Work" : "Disability_Condition_Stop_Work",
552
+ label,
553
+ },
554
+ updates
555
+ )
556
+ )
557
+ };
558
+
559
+ const disabilityWorkHistory = (scope, vertical, updates = {}) => {
560
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
561
+ const label = vertical ? updates.label : "Have You Had a Full-Time Job Within the Past 5 Years?";
562
+ return func(
563
+ merge(
564
+ {
565
+ name: scope ? scope + ":" + "Disability_Work_History" : "Disability_Work_History",
566
+ label,
567
+ },
568
+ updates
569
+ )
570
+ )
571
+ };
572
+
573
+ const doctorTreatment = (scope, vertical, updates = {}) => {
574
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
575
+ const label = vertical ? updates.label : "Have You Recently Been Treated by a Doctor, Hospital or Clinic?";
576
+ return func(
577
+ merge(
578
+ {
579
+ name: scope ? scope + ":" + "Doctor_Treatment" : "Doctor_Treatment",
580
+ label,
581
+ },
582
+ updates
583
+ )
584
+ )
585
+ };
586
+
587
+ const estateLegalServicesNeeded = (scope, vertical, updates = {}) => {
588
+ const func = vertical ? col2RadioCenter : sbsSelect;
589
+ const label = vertical ? updates.label : "Legal Services Needed for Your Estate:";
590
+ return func(
591
+ merge(
592
+ {
593
+ name: scope ? scope + ":" + "Estate_Legal_Services_Needed" : "Estate_Legal_Services_Needed",
594
+ label,
595
+ options: [
596
+ "Charitable Giving",
597
+ "Contested Wills",
598
+ "Drafting Wills or Trust",
599
+ "Estate Administration",
600
+ "Asset Protection",
601
+ "Other",
602
+ ],
603
+ },
604
+ updates
605
+ )
606
+ )
607
+ };
608
+
609
+ const haveAttorney$1 = (scope, vertical, updates = {}) => {
610
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
611
+ const label = vertical ? updates.label : "Already Working with An Attorney?";
612
+ return func(
613
+ merge(
614
+ {
615
+ label,
616
+ name: scope ? scope + ":" + "Have_Attorney" : "Have_Attorney",
617
+ },
618
+ updates
619
+ )
620
+ )
621
+ };
622
+
623
+ const haveChildren = (scope, vertical, updates = {}) => {
624
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
625
+ const label = vertical ? updates.label : "Do You Have Children?";
626
+ return func(
627
+ merge(
628
+ {
629
+ name: scope ? scope + ":" + "Have_Children" : "Have_Children",
630
+ label,
631
+ },
632
+ updates
633
+ )
634
+ )
635
+ };
636
+
637
+ const incidentDate = (scope, vertical, updates = {}) => {
638
+ const func = vertical ? verticalDate : sbsDate;
639
+ const label = vertical ? updates.label : "Date of Incident:";
640
+ return func(
641
+ merge(
642
+ {
643
+ label,
644
+ name: scope ? scope + ":" + "Incident_Date" : "Incident_Date",
645
+ },
646
+ updates
647
+ )
648
+ )
649
+ };
650
+
651
+ const lawyerPaymentMethod = (scope, vertical, updates = {}) => {
652
+ const func = vertical ? col2RadioCenter : sbsSelect;
653
+ const label = vertical ? updates.label : "How Will You Pay for Legal Fees if You Hire a Lawyer?";
654
+ const help = vertical ? updates.help : "No payment necessary to start a consultation.";
655
+ const options = vertical
656
+ ? {
657
+ Cash: "Cash",
658
+ "Credit Card": "Credit Card",
659
+ Family: "Family or Friend",
660
+ Other: "Other",
661
+ }
662
+ : ["Cash", "Check", "Credit Card", "Friend", "Family", "Other"];
663
+ return func(
664
+ merge(
665
+ {
666
+ label,
667
+ help,
668
+ name: scope ? scope + ":" + "Lawyer_Payment_Method" : "Lawyer_Payment_Method",
669
+ options,
670
+ fieldsetClass: vertical ? "$reset t-flex t-flex-col t-items-center" : undefined,
671
+ },
672
+ updates
673
+ )
674
+ )
675
+ };
676
+
677
+ const legalCrossSells$1 = () =>
678
+ col2Checkbox({
679
+ id: "Legal_CrossSells",
680
+ name: "Legal_CrossSells",
681
+ help: 'Just hit "Next" if none apply',
682
+ helpClass: "t-text-center !t-text-sm",
683
+ validation: null,
684
+ options: '$getCrossSellOptions($get(form), $getVal($get(form), "Type_Of_Legal_Problem"))',
685
+ });
686
+
687
+ const loanAmount$1 = (scope, vertical, updates = {}) => {
688
+ const func = vertical ? verticalSelect : sbsSelect;
689
+ const label = vertical ? updates.label : "Total Amount of Loan?";
690
+ return func(
691
+ merge(
692
+ {
693
+ label,
694
+ name: scope ? scope + ":" + "Loan_Amount" : "Loan_Amount",
695
+ options: [
696
+ "Less than $10,000",
697
+ "$10,000 - $24,999",
698
+ "$25,000 - $49,999",
699
+ "$50,000 - $99,999",
700
+ "$100,000 - $199,999",
701
+ "$200,000 - $299,999",
702
+ "$300,000 - $399,999",
703
+ "$400,000 - $499,999",
704
+ "$500,000 - $599,999",
705
+ "More than $600,000",
706
+ ],
707
+ },
708
+ updates
709
+ )
710
+ )
711
+ };
712
+
713
+ const maritalStatus = (scope, vertical, updates = {}) => {
714
+ const func = vertical ? col2RadioCenter : sbsSelect;
715
+ const label = vertical ? updates.label : "Marital Status:";
716
+ return func(
717
+ merge(
718
+ {
719
+ label,
720
+ name: scope ? scope + ":" + "Marital_Status" : "Marital_Status",
721
+ options: [
722
+ "Unmarried, Living Together",
723
+ "Unmarried, Do Not Live Together",
724
+ "Married, Living Together",
725
+ "Separated",
726
+ "Divorced",
727
+ "Other",
728
+ ],
729
+ },
730
+ updates
731
+ )
732
+ )
733
+ };
734
+
735
+ const ownRealEstate$1 = (scope, vertical, updates = {}) => {
736
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
737
+ const label = vertical ? updates.label : "Do You Own Real Estate?";
738
+ return func(
739
+ merge(
740
+ {
741
+ name: scope ? scope + ":" + "Own_Real_Estate" : "Own_Real_Estate",
742
+ label,
743
+ },
744
+ updates
745
+ )
746
+ )
747
+ };
748
+
749
+ const primaryInjury = (scope, vertical, updates = {}) => {
750
+ const func = vertical ? col2RadioCenter : sbs2ColRadio;
751
+ const label = vertical ? updates.label : "Primary Injury:";
752
+ return func(
753
+ merge(
754
+ {
755
+ label,
756
+ name: scope ? scope + ":" + "Primary_Injury" : "Primary_Injury",
757
+ options: [
758
+ "Anxiety",
759
+ "Back or Neck Pain",
760
+ "Broken Bones",
761
+ "Cuts and Bruises",
762
+ "Headaches",
763
+ "Memory Loss",
764
+ "Loss of Limb",
765
+ "Not Sure or Other",
766
+ ],
767
+ },
768
+ updates
769
+ )
770
+ )
771
+ };
772
+
773
+ const policeReportFiled = (scope, vertical, updates = {}) => {
774
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
775
+ const label = vertical ? updates.label : "Was a Police Report Filed?";
776
+ return func(
777
+ merge(
778
+ {
779
+ name: scope ? scope + ":" + "Police_Report_Filed" : "Police_Report_Filed",
780
+ label,
781
+ },
782
+ updates
783
+ )
784
+ )
785
+ };
786
+
787
+ const roleInMatterProbate = (scope, vertical, updates = {}) => {
788
+ const func = vertical ? col2RadioCenter : sbsSelect;
789
+ const label = vertical ? updates.label : "What is Your Role in this Matter?";
790
+ return func(
791
+ merge(
792
+ {
793
+ label,
794
+ name: scope ? scope + ":" + "Role_In_Matter_Probate" : "Role_In_Matter_Probate",
795
+ options: ["Preparing My Will", "Executor", "Heir", "Other"],
796
+ },
797
+ updates
798
+ )
799
+ )
800
+ };
801
+
802
+ const socialSecurityDisabilityReceivingBenefits = (scope, vertical, updates = {}) => {
803
+ const func = vertical ? verticalYesNoRadio : sbsYesNoRadio;
804
+ const label = vertical ? updates.label : "Are You Currently Receiving Social Security Disability Benefits?";
805
+ return func(
806
+ merge(
807
+ {
808
+ name: scope
809
+ ? scope + ":" + "Social_Security_Disability_Receiving_Benefits"
810
+ : "Social_Security_Disability_Receiving_Benefits",
811
+ label,
812
+ },
813
+ updates
814
+ )
815
+ )
816
+ };
817
+
818
+ const TCPAConsent = (scope) => ({
819
+ $formkit: "checkbox",
820
+ label: "$meta.tcpaLanguage",
821
+ // Necessary to get links to work in the tcpa language
822
+ __raw__sectionsSchema: {
823
+ label: { attrs: { innerHTML: "$label" } },
824
+ },
825
+ name: scope ? scope + ":" + "TCPA_Opt_In" : "TCPA_Opt_In",
826
+ "data-tf-sensitive": "false",
827
+ validation: "required|accepted",
828
+ validationMessages: {
829
+ required: "Consent is required",
830
+ accepted: "Consent is required",
831
+ },
832
+ classes: {
833
+ label: "t-text-xs t-text-slate-500 t-font-normal !t-leading-[0.9rem]",
834
+ },
835
+ });
836
+
837
+ const typeOfAssets = (scope, vertical, updates = {}) => {
838
+ const func = vertical ? verticalCol2Checkbox : col2Checkbox;
839
+ const label = vertical ? updates.label : "Type of Assets:";
840
+ return func(
841
+ merge(
842
+ {
843
+ label,
844
+ name: scope ? scope + ":" + "Type_Of_Assets" : "Type_Of_Assets",
845
+ options: [
846
+ "Business Interests",
847
+ "Cash",
848
+ "Life Insurance Policies",
849
+ "Pensions/Retirement",
850
+ "Personal Possessions",
851
+ "Property",
852
+ "Stock/Bonds",
853
+ ],
854
+ },
855
+ updates
856
+ )
857
+ )
858
+ };
859
+
860
+ const typeOfProperty$1 = (scope, vertical, updates = {}) => {
861
+ const func = vertical ? col2RadioCenter : sbsSelect;
862
+ const label = vertical ? updates.label : "Type of Property:";
863
+ return func(
864
+ merge(
865
+ {
866
+ label,
867
+ name: scope ? scope + ":" + "Type_Of_Property" : "Type_Of_Property",
868
+ options: ["Residential", "Commercial", "Industrial", "Agricultural", "Recreational", "Other"],
869
+ },
870
+ updates
871
+ )
872
+ )
873
+ };
874
+
875
+ const valueOfAssets = (scope, vertical, updates = {}) => {
876
+ const func = vertical ? col2RadioCenter : sbsSelect;
877
+ const label = vertical ? updates.label : "Value of Your Assets?";
878
+ return func(
879
+ merge(
880
+ {
881
+ label,
882
+ name: scope ? scope + ":" + "Value_Of_Assets" : "Value_Of_Assets",
883
+ options: ["Less than 50K", "50K to 100K", "100K to 250K", "250K to 500K", "500K to 1M", "More than 1M"],
884
+ },
885
+ updates
886
+ )
887
+ )
888
+ };
889
+
890
+ // ------ Question Groups - TODO: move these go separate file groups.js
891
+
892
+ // NOTE: name must be unique within a form!
893
+ const group = (name, updates) => {
894
+ return merge(
895
+ {
896
+ $cmp: "FormKit",
897
+ props: {
898
+ type: "group",
899
+ key: name,
900
+ id: name,
901
+ name: name,
902
+ },
903
+ },
904
+ updates
905
+ )
906
+ };
907
+
908
+ const AutoAndCarAccidentsQuestions = (condition, scope) =>
909
+ group("AutoAndCarAccidentsQuestions", {
910
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Auto and Car Accidents"',
911
+ children: [
912
+ haveAttorney$1(scope),
913
+ incidentDate(scope),
914
+ atFault(scope),
915
+ primaryInjury(scope),
916
+ doctorTreatment(scope),
917
+ policeReportFiled(scope),
918
+ ],
919
+ });
920
+
921
+ const ChildCustodyQuestions = (condition, scope) =>
922
+ group("ChildCustodyQuestions", {
923
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Child Custody"',
924
+ children: [
925
+ haveAttorney$1(scope),
926
+ childRelationship(scope),
927
+ childHome(scope),
928
+ childPrimaryCaregiver(scope),
929
+ degreeOfInterest$1(scope),
930
+ lawyerPaymentMethod(scope),
931
+ ],
932
+ });
933
+
934
+ const DivorceQuestions = (condition, scope) =>
935
+ group("DivorceQuestions", {
936
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Divorce and Separation"',
937
+ children: [
938
+ haveAttorney$1(scope),
939
+ maritalStatus(scope),
940
+ haveChildren(scope),
941
+ degreeOfInterest$1(scope),
942
+ lawyerPaymentMethod(scope),
943
+ ],
944
+ });
945
+
946
+ const PersonalInjuryQuestions = (condition, scope) =>
947
+ group("PersonalInjuryQuestions", {
948
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Personal Injury"',
949
+ children: [
950
+ haveAttorney$1(scope),
951
+ incidentDate(scope),
952
+ claimStatus(scope),
953
+ atFault(scope),
954
+ primaryInjury(scope),
955
+ doctorTreatment(scope),
956
+ ],
957
+ });
958
+
959
+ const SocialSecurityDisabilityAndInsuranceQuestions = (condition, scope) =>
960
+ group("SocialSecurityDisabilityAndInsuranceQuestions", {
961
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Social Security Disability and Insurance"',
962
+ children: [
963
+ haveAttorney$1(scope),
964
+ applicantAge(scope),
965
+ disabilityConditionStopWork(scope),
966
+ disabilityWorkHistory(scope),
967
+ socialSecurityDisabilityReceivingBenefits(scope),
968
+ doctorTreatment(scope),
969
+ ],
970
+ });
971
+
972
+ const WillsAndTrustsQuestions = (condition, scope) =>
973
+ group("WillsAndTrustsQuestions", {
974
+ if: condition || '$get(Type_Of_Legal_Problem).value == "Wills and Trusts"',
975
+ children: [
976
+ haveAttorney$1(scope),
977
+ valueOfAssets(scope),
978
+ typeOfAssets(scope),
979
+ roleInMatterProbate(scope),
980
+ estateLegalServicesNeeded(scope),
981
+ degreeOfInterestHelp(scope),
982
+ ],
983
+ });
984
+
985
+ const NEXT_ON_ENTER = "$onEnter($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
986
+ const NEXT_ON_INPUT = "$onInput($setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form))))";
987
+
988
+ const isInput = (n) => {
989
+ return n.type !== "group" && n.type !== "section" && n.type !== "form" && n.$formkit !== "hidden" && !n.children
990
+ };
991
+
992
+ const findLastInput = (n) => {
993
+ if (isInput(n)) {
994
+ return n
995
+ }
996
+ for (var i = n.children.length - 1; i >= 0; i--) {
997
+ if (typeof n.children === "string") {
998
+ continue
999
+ }
1000
+ const child = n.children[i];
1001
+ if (isInput(child)) {
1002
+ return child
1003
+ }
1004
+ const res = findLastInput(child);
1005
+ if (res) {
1006
+ return res
1007
+ }
1008
+ }
1009
+ return null
1010
+ };
1011
+
1012
+ const secureIconDefault = {
1013
+ $el: "div",
1014
+ if: "$activeStep === $lastStep()",
1015
+ attrs: {
1016
+ class: "t-flex t-justify-center t-items-center t-text-sm t-text-gray-500",
1017
+ },
1018
+ children: [
1019
+ {
1020
+ $el: "img",
1021
+ attrs: {
1022
+ loading: "lazy",
1023
+ alt: "",
1024
+ style: {
1025
+ border: 0,
1026
+ },
1027
+ width: "25",
1028
+ height: "25",
1029
+ src: "https://d27hmee62k45vz.cloudfront.net/lock_icon_1.jpeg",
1030
+ },
1031
+ },
1032
+ {
1033
+ $el: "span",
1034
+ children: "Secure & Encrypted",
1035
+ attrs: {
1036
+ class: "t-pl-2 t-pt-1 t-font-medium",
1037
+ },
1038
+ },
1039
+ ],
1040
+ };
1041
+
1042
+ function secureIcon(updates) {
1043
+ return merge(secureIconDefault, updates)
1044
+ }
1045
+
1046
+ function crossSellQuestionsStepHeadline(updates) {
1047
+ return {
1048
+ $el: "h3",
1049
+ children: updates.headline || "Tell Us About Your Situation",
1050
+ attrs: {
1051
+ class: "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-blue-500 t-pb-4 t-pt-0 t-px-1",
1052
+ },
1053
+ }
1054
+ }
1055
+
1056
+ function crossSellQuestionsStepSubHeadline(updates) {
1057
+ return {
1058
+ $el: "h5",
1059
+ children: updates.subheadline || "Tell us about your situation:",
1060
+ attrs: {
1061
+ class: "t-flex t-justify-center t-text-dark t-text-center !t-text-lg t-font-semibold t-pb-4 t-pt-0 t-px-3",
1062
+ },
1063
+ }
1064
+ }
1065
+
1066
+ function verticalStepHeadline(updates) {
1067
+ return {
1068
+ $el: "h3",
1069
+ children: updates.headline || "Tell Us About Your Situation",
1070
+ attrs: {
1071
+ class:
1072
+ "t-flex t-justify-center t-text-center t-text-2xl t-font-bold t-text-dark t-pb-5 t-pt-0 t-px-1" +
1073
+ " " +
1074
+ (updates.headlineClass || ""),
1075
+ },
1076
+ }
1077
+ }
1078
+
1079
+ function verticalStepSubHeadline(updates) {
1080
+ return {
1081
+ $el: "h5",
1082
+ children: updates.subheadline || "",
1083
+ attrs: {
1084
+ class:
1085
+ "t-flex t-justify-center t-text-center !t-text-lg t-font-normal t-text-dark t-pb-5 t-pt-0 t-px-1" +
1086
+ " " +
1087
+ (updates.subheadlineClass || ""),
1088
+ },
1089
+ }
1090
+ }
1091
+
1092
+ function commentsStepHeadline(updates) {
1093
+ return {
1094
+ $el: "h3",
1095
+ children: updates.headline || "Additional Details",
1096
+ attrs: {
1097
+ class:
1098
+ "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" +
1099
+ " " +
1100
+ (updates.headlineClass || ""),
1101
+ },
1102
+ }
1103
+ }
1104
+
1105
+ function commentsStepHeadlineLegal(updates) {
1106
+ return commentsStepHeadline({
1107
+ headline: updates.headline || "Additional Case Details",
1108
+ headlineClass: updates.headlineClass,
1109
+ })
1110
+ }
1111
+
1112
+ function firstAndLastStepHeadline(updates) {
1113
+ return {
1114
+ $el: "h3",
1115
+ children: updates.headline || "Please Provide a Contact Name",
1116
+ attrs: {
1117
+ class:
1118
+ "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" +
1119
+ " " +
1120
+ (updates.headlineClass || ""),
1121
+ },
1122
+ }
1123
+ }
1124
+
1125
+ function legalCrossSellsStepHeadline(updates) {
1126
+ return {
1127
+ $el: "h3",
1128
+ children: updates.headline || "Do any of the following situations apply?",
1129
+ attrs: {
1130
+ class:
1131
+ "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" +
1132
+ " " +
1133
+ (updates.headlineClass || ""),
1134
+ },
1135
+ }
1136
+ }
1137
+
1138
+ function contactStepHeadline(updates) {
1139
+ return {
1140
+ $el: "h3",
1141
+ children: updates.headline || DEFAULT_FINAL_HEADLINE_DYNAMIC_LEGAL,
1142
+ attrs: {
1143
+ class:
1144
+ "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" +
1145
+ " " +
1146
+ (updates.headlineClass || "") +
1147
+ " f-contact-info-headline",
1148
+ },
1149
+ }
1150
+ }
1151
+
1152
+ function contactStepSubHeadline(updates) {
1153
+ return {
1154
+ $el: "h5",
1155
+ children: updates.subheadline || DEFAULT_FINAL_SUBHEADLINE_DYNAMIC_LEGAL,
1156
+ attrs: {
1157
+ class:
1158
+ "t-flex t-justify-center t-text-center !t-text-lg t-font-semibold t-pb-7 t-pt-0 t-px-3" +
1159
+ " " +
1160
+ (updates.subheadlineClass || "") +
1161
+ " f-contact-info-subheadline",
1162
+ },
1163
+ }
1164
+ }
1165
+
1166
+ const TRUSTED_FORM_JS = `(function() {
1167
+ if (window.xxTrustedFormLoaded) {
1168
+ return
1169
+ }
1170
+ var vid = '';
1171
+ if (typeof window.zar !== 'undefined') {
1172
+ vid = window.zar.getVID();
1173
+ }
1174
+ window.xxTrustedFormLoaded = true;
1175
+ var sandbox = document.location.hostname.indexOf('localhost') > -1 ? 'true' : 'false'
1176
+ var tf = document.createElement('script');
1177
+ tf.type = 'text/javascript'; tf.async = true;
1178
+ tf.src = ("https:" == document.location.protocol ? 'https' : 'http') + "://api.trustedform.com/trustedform.js?field=xxTrustedFormCertUrl&identifier=" + vid + "&ping_field=xxTrustedFormPingUrl&provideReferrer=false&invert_field_sensitivity=true&sandbox=" + sandbox + "&l=" + new Date().getTime() + Math.random();
1179
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(tf, s);
1180
+ })();`;
1181
+
1182
+ function trustedFormScript() {
1183
+ return {
1184
+ $el: "script",
1185
+ if: "$activeStep === $lastStep()",
1186
+ children: TRUSTED_FORM_JS,
1187
+ }
1188
+ }
1189
+
1190
+ const stepDefaults = (step, stepKey) => ({
1191
+ $el: "section",
1192
+ if: '$stepEnabled("' + step + '")',
1193
+ attrs: {
1194
+ hidden: '$activeStep !== "' + step + '"',
1195
+ key: stepKey ? stepKey : step,
1196
+ },
1197
+ });
1198
+
1199
+ function step(name, inputs, updates = {}) {
1200
+ const {
1201
+ nextOnEnter = true,
1202
+ nextOnInput = false,
1203
+ stepKey = undefined,
1204
+ nextStepMap = undefined,
1205
+ triggerRedirectMap = undefined,
1206
+ autoFocus = undefined,
1207
+ } = updates;
1208
+
1209
+ if (inputs && inputs.length && (nextOnEnter || nextOnInput)) {
1210
+ const lastInput = findLastInput(inputs[inputs.length - 1]);
1211
+ if (lastInput && nextOnEnter === true) {
1212
+ lastInput.onKeypress = NEXT_ON_ENTER;
1213
+ }
1214
+ if (lastInput && nextOnInput === true) {
1215
+ lastInput.onInput = NEXT_ON_INPUT;
1216
+ }
1217
+ }
1218
+
1219
+ return merge(stepDefaults(name, stepKey), {
1220
+ children: [
1221
+ {
1222
+ $formkit: "group",
1223
+ id: name,
1224
+ name: name,
1225
+ nextStepMap: nextStepMap,
1226
+ triggerRedirectMap: triggerRedirectMap,
1227
+ autoFocus: autoFocus,
1228
+ children: inputs,
1229
+ },
1230
+ ],
1231
+ })
1232
+ }
1233
+
1234
+ // Single question step
1235
+ function sqstep(name, input, defaultHeadline, updates = {}) {
1236
+ if (typeof updates.nextOnInput === "undefined") {
1237
+ updates.nextOnInput = true;
1238
+ }
1239
+
1240
+ return step(
1241
+ name,
1242
+ [
1243
+ verticalStepHeadline({
1244
+ headline: updates.headline ?? defaultHeadline,
1245
+ headlineClass: updates.headlineClass,
1246
+ }),
1247
+ ...(Array.isArray(input) ? input : [input]),
1248
+ ],
1249
+ updates
1250
+ )
1251
+ }
1252
+
1253
+ function contactInfo(updates = {}) {
1254
+ return step(
1255
+ "contactInfo",
1256
+ [
1257
+ contactStepHeadline(updates),
1258
+ contactStepSubHeadline(updates),
1259
+ trustedFormScript(),
1260
+ email(updates.scope),
1261
+ phone(updates.scope),
1262
+ TCPAConsent(updates.scope),
1263
+ secureIcon(),
1264
+ ],
1265
+ { nextOnEnter: false }
1266
+ )
1267
+ }
1268
+
1269
+ function firstAndLastV3(updates = {}) {
1270
+ return step(
1271
+ "firstAndLast",
1272
+ [
1273
+ firstAndLastStepHeadline({
1274
+ headline: updates.headline ?? "Who is looking for help?",
1275
+ headlineClass: updates.headlineClass,
1276
+ }),
1277
+ verticalStepSubHeadline({
1278
+ subheadline: updates.subheadline ?? "Note: we never share info without consent",
1279
+ subheadlineClass: "!t-text-sm !t-text-gray-500",
1280
+ }),
1281
+ firstName(updates.scope),
1282
+ lastName(updates.scope),
1283
+ ],
1284
+ updates
1285
+ )
1286
+ }
1287
+
1288
+ function zipcode(updates = {}) {
1289
+ return sqstep("zipcode", zipcode$1(updates.scope, true, updates.input), "Please verify your Zip Code", updates)
1290
+ }
1291
+
1292
+ function commentsWithBankruptcy(updates = {}) {
1293
+ return step(
1294
+ "commentsWithBankruptcy",
1295
+ [
1296
+ commentsStepHeadlineLegal(updates),
1297
+ comments(updates.scope, false, {
1298
+ label: typeof updates.label === "undefined" ? DEFAULT_COMMENTS_LABEL_LEGAL : updates.label,
1299
+ placeholder: updates.placeholder || DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1300
+ inputClass: typeof updates.inputClass === "undefined" ? "!t-h-32" : updates.inputClass,
1301
+ }),
1302
+ // TODO: needs scope support
1303
+ bankruptcyCrossSell(),
1304
+ {
1305
+ $el: "div",
1306
+ if: "$get(CrossSell_Bankruptcy).value == true",
1307
+ children: [
1308
+ comments("CrossSell:Bankruptcy", false, {
1309
+ label: "Bankruptcy or debt details:",
1310
+ placeholder: "Please describe your bankrtupcy or debt situation in a few words...",
1311
+ inputClass: "!t-h-16",
1312
+ }),
1313
+ ],
1314
+ },
1315
+ ],
1316
+ { nextOnEnter: false }
1317
+ )
1318
+ }
1319
+
1320
+ function autoAndCarAccidentCrossSellQuestions(updates = {}) {
1321
+ return step(
1322
+ "autoAndCarAccidentCrossSellQuestions",
1323
+ [
1324
+ crossSellQuestionsStepHeadline({
1325
+ headline: "You May Be Entitled To Compensation",
1326
+ }),
1327
+ crossSellQuestionsStepSubHeadline({
1328
+ subheadline: "Tell us about your accident:",
1329
+ }),
1330
+ AutoAndCarAccidentsQuestions("true", "CrossSell:Auto_and_Car_Accidents"),
1331
+ comments("CrossSell:Auto_and_Car_Accidents", false, {
1332
+ label: "Accident Description:",
1333
+ placeholder: "Please describe your accident in a few words...",
1334
+ inputClass: "!t-h-16",
1335
+ }),
1336
+ ],
1337
+ updates
1338
+ )
1339
+ }
1340
+
1341
+ function childCustodyCrossSellQuestions(updates = {}) {
1342
+ return step(
1343
+ "childCustodyCrossSellQuestions",
1344
+ [
1345
+ crossSellQuestionsStepHeadline({ headline: "Child Custody Information" }),
1346
+ ChildCustodyQuestions("true", "CrossSell:Child_Custody"),
1347
+ comments("CrossSell:Child_Custody", false, {
1348
+ label: "Description:",
1349
+ placeholder: "Please describe your situation in a few words...",
1350
+ inputClass: "!t-h-16",
1351
+ }),
1352
+ ],
1353
+ updates
1354
+ )
1355
+ }
1356
+
1357
+ function divorceAndSeparationCrossSellQuestions(updates = {}) {
1358
+ return step(
1359
+ "divorceAndSeparationCrossSellQuestions",
1360
+ [
1361
+ crossSellQuestionsStepHeadline({
1362
+ headline: "Divorce or Separation Information",
1363
+ }),
1364
+ DivorceQuestions("true", "CrossSell:Divorce_and_Separation"),
1365
+ comments("CrossSell:Divorce_and_Separation", false, {
1366
+ label: "Description:",
1367
+ placeholder: "Please describe your situation in a few words...",
1368
+ inputClass: "!t-h-16",
1369
+ }),
1370
+ ],
1371
+ updates
1372
+ )
1373
+ }
1374
+
1375
+ function ssdiCrossSellQuestions(updates = {}) {
1376
+ return step(
1377
+ "ssdiCrossSellQuestions",
1378
+ [
1379
+ crossSellQuestionsStepHeadline({
1380
+ headline: "You May Be Entitled To Benefits",
1381
+ }),
1382
+ crossSellQuestionsStepSubHeadline({
1383
+ subheadline: "Tell us about your disability:",
1384
+ }),
1385
+ SocialSecurityDisabilityAndInsuranceQuestions("true", "CrossSell:Social_Security_Disability_and_Insurance"),
1386
+ comments("CrossSell:Social_Security_Disability_and_Insurance", false, {
1387
+ label: "Description:",
1388
+ placeholder: "Please describe your situation in a few words...",
1389
+ inputClass: "!t-h-16",
1390
+ }),
1391
+ ],
1392
+ updates
1393
+ )
1394
+ }
1395
+
1396
+ function personalInjuryCrossSellQuestions(updates = {}) {
1397
+ return step(
1398
+ "personalInjuryCrossSellQuestions",
1399
+ [
1400
+ crossSellQuestionsStepHeadline({
1401
+ headline: "You May Be Entitled To Compensation",
1402
+ }),
1403
+ crossSellQuestionsStepSubHeadline({
1404
+ subheadline: "Tell us about your injury:",
1405
+ }),
1406
+ PersonalInjuryQuestions("true", "CrossSell:Personal_Injury"),
1407
+ comments("CrossSell:Personal_Injury", false, {
1408
+ label: "Injury Description:",
1409
+ placeholder: "Please describe your injury in a few words...",
1410
+ inputClass: "!t-h-16",
1411
+ }),
1412
+ ],
1413
+ updates
1414
+ )
1415
+ }
1416
+
1417
+ function willsAndTrustsCrossSellQuestions(updates = {}) {
1418
+ return step(
1419
+ "willsAndTrustsCrossSellQuestions",
1420
+ [
1421
+ crossSellQuestionsStepHeadline({ headline: "Will or Trust Information" }),
1422
+ WillsAndTrustsQuestions("true", "CrossSell:Wills_and_Trusts"),
1423
+ comments("CrossSell:Wills_and_Trusts", false, {
1424
+ label: "Description:",
1425
+ placeholder: "Please describe your situation in a few words...",
1426
+ inputClass: "!t-h-16",
1427
+ }),
1428
+ ],
1429
+ updates
1430
+ )
1431
+ }
1432
+
1433
+ function legalCrossSells(updates = {}) {
1434
+ updates.nextOnInput = false;
1435
+ updates.stepKey = "$get(Type_Of_Legal_Problem).value";
1436
+ return step("legalCrossSells", [legalCrossSellsStepHeadline(updates), legalCrossSells$1()], updates)
1437
+ }
1438
+
1439
+ function haveAttorney(updates = {}) {
1440
+ return sqstep(
1441
+ "haveAttorney",
1442
+ haveAttorney$1(updates.scope, true, updates.input),
1443
+ "Already working with an attorney?",
1444
+ updates
1445
+ )
1446
+ }
1447
+
1448
+ function degreeOfInterest(updates = {}) {
1449
+ return sqstep(
1450
+ "degreeOfInterest",
1451
+ degreeOfInterest$1(updates.scope, true, updates.input),
1452
+ "Could you pay if your issue could be resolved?",
1453
+ updates
1454
+ )
1455
+ }
1456
+
1457
+ function ownRealEstate(updates = {}) {
1458
+ return sqstep(
1459
+ "ownRealEstate",
1460
+ ownRealEstate$1(updates.scope, true, updates.input),
1461
+ "Do you own real estate?",
1462
+ updates
1463
+ )
1464
+ }
1465
+
1466
+ function typeOfProperty(updates = {}) {
1467
+ return sqstep(
1468
+ "typeOfProperty",
1469
+ typeOfProperty$1(updates.scope, true, updates.input),
1470
+ "What type of property is involved?",
1471
+ updates
1472
+ )
1473
+ }
1474
+
1475
+ function amountPaymentsPastDue(updates = {}) {
1476
+ return sqstep(
1477
+ "amountPaymentsPastDue",
1478
+ amountPaymentsPastDue$1(updates.scope, true, updates.input),
1479
+ "Total amount of payments past due:",
1480
+ updates
1481
+ )
1482
+ }
1483
+
1484
+ function loanAmount(updates = {}) {
1485
+ return sqstep("loanAmount", loanAmount$1(updates.scope, true, updates.input), "Total amount of the loan:", updates)
1486
+ }
1487
+
1488
+ function defaultNotice(updates = {}) {
1489
+ return sqstep(
1490
+ "defaultNotice",
1491
+ defaultNotice$1(updates.scope, true, updates.input),
1492
+ "Have you received a loan default notice?",
1493
+ updates
1494
+ )
1495
+ }
1496
+
1497
+ function foreclosureTOLP(updates = {}) {
1498
+ return step(
1499
+ "foreclosureTOLP",
1500
+ [
1501
+ {
1502
+ $formkit: "hidden",
1503
+ name: "Type_Of_Legal_Problem",
1504
+ id: "Type_Of_Legal_Problem",
1505
+ value: "Foreclosure",
1506
+ },
1507
+ typeOfProperty$1(updates.scope, true, updates.input),
1508
+ ],
1509
+ updates
1510
+ )
1511
+ }
1512
+
1513
+ const formNavigation = (updates = {}) => ({
1514
+ $el: "div",
1515
+ attrs: {
1516
+ class: {
1517
+ if: "$activeStep === $firstStep()",
1518
+ then: "step-nav !t-justify-center sm:!t-justify-between",
1519
+ else: "step-nav !t-justify-between",
1520
+ },
1521
+ },
1522
+ children: [
1523
+ {
1524
+ $formkit: "button",
1525
+ name: "back_button",
1526
+ onClick: "$setPreviousStep($prevStepFunc($get(form)))",
1527
+ children: "Back",
1528
+ outerClass: {
1529
+ if: "$activeStep === $firstStep()",
1530
+ then: "t-hidden sm:t-block",
1531
+ else: "",
1532
+ },
1533
+ style: {
1534
+ if: "$activeStep === $firstStep()",
1535
+ then: "display: none;",
1536
+ },
1537
+ classes: {
1538
+ input: (updates.inputClass || "") + " f-navigation-input",
1539
+ },
1540
+ },
1541
+ {
1542
+ $formkit: "button",
1543
+ name: "next_button",
1544
+ onClick: "$setNextStep($fireStepEvent($get(form)), $preStepFunc($get(form)))",
1545
+ children: {
1546
+ if: "$activeStep === $firstStep()",
1547
+ then: updates.startText || "Start",
1548
+ else: "Next",
1549
+ },
1550
+ outerClass: {
1551
+ if: "$activeStep === $lastStep()",
1552
+ then: "t-hidden",
1553
+ else: "",
1554
+ },
1555
+ style: {
1556
+ if: "$activeStep === $lastStep()",
1557
+ then: "display: none;",
1558
+ },
1559
+ classes: {
1560
+ input: (updates.inputClass || "") + " f-navigation-input",
1561
+ },
1562
+ },
1563
+ {
1564
+ $formkit: "submit",
1565
+ name: "submit_button",
1566
+ label: updates.submitLabel || "Submit",
1567
+ if: "$activeStep === $lastStep()",
1568
+ style: {
1569
+ if: "$activeStep !== $lastStep()",
1570
+ then: "display: none;",
1571
+ },
1572
+ classes: {
1573
+ input: (updates.inputClass || "") + " !t-ml-2 sm:!t-ml-auto f-navigation-input",
1574
+ },
1575
+ },
1576
+ ],
1577
+ });
1578
+
1579
+ const formDetails = () => ({
1580
+ $el: "pre",
1581
+ if: '$urlParam("fdbg", "") == 1',
1582
+ children: [
1583
+ {
1584
+ $el: "pre",
1585
+ children: "$stringify( $get(form).value )",
1586
+ attrs: {
1587
+ class: "t-text-xs",
1588
+ style: "overflow: scroll",
1589
+ },
1590
+ },
1591
+ {
1592
+ $el: "pre",
1593
+ children: ["activeStep: ", "$activeStep"],
1594
+ attrs: {
1595
+ class: "t-text-xs",
1596
+ style: "overflow: scroll",
1597
+ },
1598
+ },
1599
+ {
1600
+ $el: "pre",
1601
+ children: ["stepHistory: ", "$stepHistory"],
1602
+ attrs: {
1603
+ class: "t-text-xs",
1604
+ style: "overflow: scroll",
1605
+ },
1606
+ },
1607
+ {
1608
+ $el: "pre",
1609
+ children: ["stepQueue: ", "$stepQueue"],
1610
+ attrs: {
1611
+ class: "t-text-xs",
1612
+ style: "overflow: scroll",
1613
+ },
1614
+ },
1615
+ {
1616
+ $el: "pre",
1617
+ children: ["steps: ", "$stepKeys()"],
1618
+ attrs: {
1619
+ class: "t-text-xs",
1620
+ style: "overflow: scroll",
1621
+ },
1622
+ },
1623
+ ],
1624
+ });
1625
+
1626
+ const formPropDefaults = {
1627
+ type: "form",
1628
+ id: "form",
1629
+ config: { validationVisibility: "submit" },
1630
+ onSubmit: '$submit($submitUrl, $prepData, $handleRedirect, "text/plain; charset=UTF-8")',
1631
+ plugins: "$plugins",
1632
+ actions: false,
1633
+ anchorElement: "form-anchor",
1634
+ useLocalStorage: true,
1635
+ prepop: {
1636
+ fromURL: true,
1637
+ },
1638
+ errorCodes: {
1639
+ 403: { message: "An Error Occurred", abort: false },
1640
+ 409: { abort: false },
1641
+ 429: "An Error Occurred",
1642
+ 504: { message: "An Error Occurred", abort: false },
1643
+ },
1644
+ formClass: "!t-max-w-[40rem]",
1645
+ };
1646
+
1647
+ function filterMapByKey(obj, keyList) {
1648
+ return Object.fromEntries(Object.entries(obj).filter(([key]) => keyList.includes(key)))
1649
+ }
1650
+
1651
+ // export function filteredNextStepsMapLegal(keyList) {
1652
+ // const res = { Type_Of_Legal_Problem: filterMapByKey(nextStepsMapGeneralLegal["Type_Of_Legal_Problem"], keyList) }
1653
+ // res["*"] = nextStepsMapGeneralLegal["*"]
1654
+ // return res
1655
+ // }
1656
+
1657
+ function formProps(updates) {
1658
+ const props = merge(formPropDefaults, updates);
1659
+ if (props.formId && !props.name) {
1660
+ props.name = props.formId;
1661
+ }
1662
+ return props
1663
+ }
1664
+
1665
+ const metaDefaults = {};
1666
+
1667
+ function metaProps(updates) {
1668
+ const data = merge(metaDefaults, updates);
1669
+ return {
1670
+ type: "meta",
1671
+ data,
1672
+ }
1673
+ }
1674
+
1675
+ function defaultMetaPropsLegal(tolps = null) {
1676
+ let commentsPlaceholders = TOLPCommentsPlaceholders;
1677
+ let finalHeadlines = TOLPFinalHeadlines;
1678
+ let finalSubHeadlines = TOLPFinalSubHeadlines;
1679
+ if (tolps) {
1680
+ commentsPlaceholders = filterMapByKey(TOLPCommentsPlaceholders, tolps);
1681
+ finalHeadlines = filterMapByKey(TOLPFinalHeadlines, tolps);
1682
+ finalSubHeadlines = filterMapByKey(TOLPFinalSubHeadlines, tolps);
1683
+ }
1684
+ return metaProps({
1685
+ tcpaLanguage: TCPA_LANGUAGE_LEGAL,
1686
+ defaultCommentsPlaceholder: DEFAULT_COMMENTS_PLACEHOLDER_DYNAMIC_LEGAL,
1687
+ commentsPlaceholders: commentsPlaceholders,
1688
+ defaultFinalHeadline: DEFAULT_FINAL_HEADLINE_LEGAL,
1689
+ finalHeadlines: finalHeadlines,
1690
+ defaultFinalSubHeadline: DEFAULT_FINAL_SUBHEADLINE_LEGAL,
1691
+ finalSubHeadlines: finalSubHeadlines,
1692
+ })
1693
+ }
1694
+
1695
+ function dynamicSchemaNode(field = "Type_Of_Legal_Problem") {
1696
+ return {
1697
+ $cmp: "FormKitSchema",
1698
+ if: "$get(" + field + ").value",
1699
+ props: {
1700
+ schema: "$meta.dynamicSchema",
1701
+ data: "$buildData($meta)",
1702
+ },
1703
+ }
1704
+ }
1705
+
1706
+ const formAnchorDefaults = {
1707
+ $el: "div",
1708
+ children: [
1709
+ {
1710
+ $el: "div",
1711
+ attrs: {
1712
+ id: "form-anchor",
1713
+ class: "t-absolute",
1714
+ style: { top: "-30px", left: 0 },
1715
+ },
1716
+ },
1717
+ ],
1718
+ attrs: {
1719
+ class: "t-relative",
1720
+ },
1721
+ };
1722
+
1723
+ function formAnchor(updates) {
1724
+ return merge(formAnchorDefaults, updates)
1725
+ }
1726
+
1727
+ const progressBarDefaults = {
1728
+ $el: "div",
1729
+ attrs: {
1730
+ class: "t-mt-7 t-mb-5 t-w-full t-flex t-flex-col t-justify-center t-items-center",
1731
+ style: {
1732
+ if: "$fns.eq($activeStep, $firstStep()) || $fns.eq($activeStep, $lastStep())",
1733
+ then: "display: none",
1734
+ },
1735
+ },
1736
+ children: [
1737
+ {
1738
+ $el: "div",
1739
+ attrs: {
1740
+ class: "t-flex t-justify-center",
1741
+ },
1742
+ children: [
1743
+ {
1744
+ $el: "span",
1745
+ attrs: {
1746
+ id: "progress-bar-text",
1747
+ class: "t-text-sm t-mb-1",
1748
+ },
1749
+ children: ["0% Complete"],
1750
+ },
1751
+ ],
1752
+ },
1753
+ {
1754
+ $el: "div",
1755
+ attrs: {
1756
+ class: "t-bg-gray-100 t-w-9/12 t-rounded",
1757
+ },
1758
+ children: [
1759
+ {
1760
+ $el: "div",
1761
+ attrs: {
1762
+ id: "progress-bar",
1763
+ class:
1764
+ "t-flex t-flex-col t-justify-center t-text-center t-whitespace-nowrap t-w-[10%] t-h-1.5 t-rounded t-text-white t-bg-[#007bff]",
1765
+ style: {
1766
+ transition: "width 0.5s ease",
1767
+ },
1768
+ },
1769
+ },
1770
+ ],
1771
+ },
1772
+ ],
1773
+ };
1774
+
1775
+ function progressBar(updates) {
1776
+ return merge(progressBarDefaults, updates)
1777
+ }
1778
+
1779
+ function headlineDefaults(updates = {}) {
1780
+ return {
1781
+ $el: "h1",
1782
+ attrs: {
1783
+ class:
1784
+ "t-flex t-justify-center t-text-center t-text-[2rem] t-font-semibold t-pt-5 t-px-7 md:t-px-3" +
1785
+ " " +
1786
+ (updates.headlineClass || "") +
1787
+ " f-first-headline",
1788
+ },
1789
+ }
1790
+ }
1791
+
1792
+ function headline(updates = {}) {
1793
+ return merge(headlineDefaults(updates), updates)
1794
+ }
1795
+
1796
+ function subHeadlineDefaults(updates = {}) {
1797
+ return {
1798
+ $el: "h3",
1799
+ attrs: {
1800
+ class:
1801
+ "t-flex t-justify-center t-text-center !t-text-[1.2rem] t-font-medium t-text-blue-500 t-px-10" +
1802
+ " " +
1803
+ (updates.subheadlineClass || "") +
1804
+ " f-first-subheadline",
1805
+ },
1806
+ }
1807
+ }
1808
+
1809
+ function subHeadline(updates = {}) {
1810
+ return merge(subHeadlineDefaults(updates), updates)
1811
+ }
1812
+
1813
+ const hiddenInputsBase = [
1814
+ {
1815
+ $formkit: "hidden",
1816
+ name: "gclid",
1817
+ value: null,
1818
+ },
1819
+ {
1820
+ $formkit: "hidden",
1821
+ name: "campaignid",
1822
+ value: null,
1823
+ },
1824
+ {
1825
+ $formkit: "hidden",
1826
+ name: "s",
1827
+ value: null,
1828
+ },
1829
+ ];
1830
+
1831
+ const hiddenInputsLegal = [
1832
+ {
1833
+ $formkit: "hidden",
1834
+ name: "vertical",
1835
+ value: "Legal",
1836
+ },
1837
+ {
1838
+ $formkit: "hidden",
1839
+ name: "TCPA_Language",
1840
+ value: "$meta.tcpaLanguage",
1841
+ },
1842
+ ...hiddenInputsBase,
1843
+ ];
1844
+
1845
+ const legalRedirectMapDefaults = {
1846
+ "*": LegalRedirectUrl(),
1847
+ };
1848
+
1849
+ function legalRedirectMap(updates) {
1850
+ return merge(legalRedirectMapDefaults, updates)
1851
+ }
1852
+
1853
+ const TOLPCommentsPlaceholders = {
1854
+ Adoption: 'Example: "I need help with adoption forms"',
1855
+ "Asbestos and Mesothelioma": 'Example: "I was exposed to asbestos at work and would like to file a claim"',
1856
+ "Auto and Car Accidents":
1857
+ 'Example: "A truck crashed into my car on the highway" or "I\'ve been involved in a hit and run accident"',
1858
+ Bankruptcy: 'Example: "I need help filing for bankruptcy"',
1859
+ "Birth Certificate and Name Change": 'Example: "Just married and would like to change my last name"',
1860
+ "Business Lawyers": 'Example: "I need help incorporating a business" or "I would like a legal contract reviewed"',
1861
+ "Child Custody and Support": 'Example: "Need help getting custody" or "Issues with child support payments"',
1862
+ "Child Custody": 'Example: "Need help getting custody"',
1863
+ "Child Support": 'Example: "Issues with child support payments"',
1864
+ "Civil Rights and Discrimination": 'Example: "Police brutality" or "Coworker keeps harassing me"',
1865
+ "Civil Lawsuit":
1866
+ 'Example: "A contractor took my money and never completed the job" or "I am being sued by a neighbor"',
1867
+ "File a Lawsuit": 'Example: "A contractor took my money and never completed the job"',
1868
+ "Defend a Lawsuit": 'Example: "I am being sued by a neighbor"',
1869
+ "Consumer Lawyers":
1870
+ 'Example: "Someone committed fraud against me" or "A contractor took my money and never completed the job"',
1871
+ "Copyrights and Trademarks": 'Example: "I would like to register a trademark or copyright a name"',
1872
+ "Criminal and Felony":
1873
+ 'Example: "I was arrested for DUI and need legal defense" or "I am being charged with assault"',
1874
+ "Debt and Collections": 'Example: "I would like to consolidate my debt" or "A collection agency is harassing me"',
1875
+ "Divorce and Separation": 'Example: "I would like to file for an uncontested divorce"',
1876
+ "DUI and DWI": 'Example: "I was arrested for DUI and need legal defense"',
1877
+ "Elder Law": 'Example: "I would like help with Estate Planning" or "I need help with a guardianship"',
1878
+ "Employment and Workplace": 'Example: "I was injured while on the job" or "My company is discriminating against me"',
1879
+ Expungement: 'Example: "I would like to file for an expungement and clear my record"',
1880
+ "Family Issues": 'Example: "I need help with guardianship" or "I need a simple will created"',
1881
+ Foreclosure: 'Example: "I need help to avoid foreclosure on my house"',
1882
+ Guardianship: 'Example: "I need help with guardianship documents"',
1883
+ "Harassment and Discrimination": 'Example: "I am being discriminated at work" or "My neighbor is harassing me"',
1884
+ "Sexual Harassment": 'Example: "I am being sexually harassed by a coworker"',
1885
+ "Workplace Harassment": 'Example: "My coworker is being aggressive towards me"',
1886
+ "Non-Workplace Harassment": 'Example: "My neighbor is harassing me"',
1887
+ "Workplace Discrimination": 'Example: "I am being discriminated at work based on my age"',
1888
+ "Non-Workplace Discrimination": 'Example: "I am being discriminated against by a local official"',
1889
+ "Identity Theft": 'Example: "Someone stole my identity and I need help fixing the issue"',
1890
+ "Immigration and Visas": 'Example: "I need help filing for a visa" or "Help with a green card"',
1891
+ Insurance: 'Example: "I need help filing an insurance claim for damage to my house"',
1892
+ "Landlord and Tenant":
1893
+ 'Example: "I need help to fight an eviction" or "I would like a lawyer to review a rental contract"',
1894
+ "Lemon Law": 'Example: "I purchased a new vehicle that broke down already and seller will not assist"',
1895
+ "Long Term Disability":
1896
+ 'Example: "I was injured on the job and would like to file for benefits" or "I need help filing for disability benefits"',
1897
+ "Medical Malpractice": 'Example: "A doctor performed surgery on the wrong limb and I would like to file a lawsuit"',
1898
+ "Patents and Intellectual Property": 'Example: "I would like to file for a patent" or "I need to copyright a name"',
1899
+ "Personal Injury": 'Example: "I was bit by the neighbor\'s dog" or "I fell in the icy grocery store parking lot"',
1900
+ "Power of Attorney": 'Example: "I need help with a limited or general power of attorney"',
1901
+ "Probate and Estates":
1902
+ 'Example: "I need help with planning for my estate" or "A family member passed without a will in place"',
1903
+ "Product Liability": 'Example: "My car battery caught on fire" or "I purchased a faulty product"',
1904
+ "Property Damage": 'Example: "The neighbor\'s tree fell on my fence" or "My car was hit in the parking lot"',
1905
+ "Real Estate":
1906
+ 'Example: "I need help with a quitclaim deed" or "I need a lawyer to review a purchase and sales agreement"',
1907
+ "Social Security Disability and Insurance":
1908
+ 'Example: "I would like help filing for disability benefits" or "I\'ve been denied for SSDI and would like to appeal"',
1909
+ "Tax and IRS": 'Example: "I need help fighting an IRS tax claim" or "I need audit defense"',
1910
+ "Traffic and Tickets":
1911
+ 'Example: "I need help reinstating a supsended license" or "I would like to fight a traffic ticket"',
1912
+ Unemployment: 'Example: "I need help filing for unemployment benefits"',
1913
+ "Victim of a Crime": 'Example: "I was assaulted in the store" or "I am being discriminated against at work"',
1914
+ "Wills and Trusts": 'Example: "I need a simple will created" or "I would like guidance on creating a trust fund"',
1915
+ "Workers Compensation": 'Example: "I broke my arm at work and need help getting compensation"',
1916
+ "Wrongful Death": 'Example: "A family member was killed on the job and we need legal representation"',
1917
+ "Wrongful Termination": 'Example: "I was fired by my employer without cause"',
1918
+ "Not Sure or Other": 'Example: "I was involved in a car accident" or "I need help setting up power of attorney"',
1919
+ };
1920
+
1921
+ const TOLPFinalHeadlines = {
1922
+ // 'Adoption': '',
1923
+ };
1924
+
1925
+ const TOLPFinalSubHeadlines = {
1926
+ Adoption: "You may benefit from speaking with an adoption professional. Please verify your contact information.",
1927
+ // 'Asbestos and Mesothelioma': '',
1928
+ "Auto and Car Accidents":
1929
+ "You may benefit from speaking with an accident professional. Please verify your contact information.",
1930
+ Bankruptcy: "You may benefit from speaking with a bankruptcy professional. Please verify your contact information.",
1931
+ // 'Birth Certificate and Name Change': '',
1932
+ // 'Business Lawyers': '',
1933
+ // 'Child Custody and Support': '',
1934
+ // 'Civil Rights and Discrimination': '',
1935
+ // 'Civil Lawsuit': '',
1936
+ // 'Consumer Lawyers': '',
1937
+ "Copyrights and Trademarks":
1938
+ "You may benefit from speaking with a copyright and trademark professional. Please verify your contact information.",
1939
+ // 'Criminal and Felony': '',
1940
+ // 'Debt and Collections': '',
1941
+ "Divorce and Separation":
1942
+ "You may benefit from speaking with a divorce professional. Please verify your contact information.",
1943
+ "DUI and DWI": "You may benefit from speaking with a DUI professional. Please verify your contact information.",
1944
+ "Elder Law": "You may benefit from speaking with an elder law professional. Please verify your contact information.",
1945
+ // 'Employment and Workplace': '',
1946
+ // 'Expungement': '',
1947
+ // 'Family Issues': '',
1948
+ Foreclosure: "You may benefit from speaking with a foreclosure professional. Please verify your contact information.",
1949
+ Guardianship:
1950
+ "You may benefit from speaking with a guardianship professional. Please verify your contact information.",
1951
+ // 'Harassment and Discrimination': '',
1952
+ // 'Identity Theft': '',
1953
+ "Immigration and Visas":
1954
+ "You may benefit from speaking with a immigration professional. Please verify your contact information.",
1955
+ // 'Insurance': '',
1956
+ "Landlord and Tenant":
1957
+ "You may benefit from speaking with a landlord and tenant legal professional. Please verify your contact information.",
1958
+ // 'Lemon Law': '',
1959
+ "Long Term Disability":
1960
+ "You may benefit from speaking with a disability legal professional. Please verify your contact information.",
1961
+ "Medical Malpractice":
1962
+ "You may benefit from speaking with a malpractice professional. Please verify your contact information.",
1963
+ "Patents and Intellectual Property":
1964
+ "You may benefit from speaking with a patent professional. Please verify your contact information.",
1965
+ "Personal Injury":
1966
+ "You may benefit from speaking with a personal injury professional. Please verify your contact information.",
1967
+ // 'Power of Attorney': '',
1968
+ "Probate and Estates":
1969
+ "You may benefit from speaking with a probate and estate professional. Please verify your contact information.",
1970
+ // 'Product Liability': '',
1971
+ // 'Property Damage': '',
1972
+ "Real Estate":
1973
+ "You may benefit from speaking with a real estate professional. Please verify your contact information.",
1974
+ "Social Security Disability and Insurance":
1975
+ "You may benefit from speaking with an SSDI professional. Please verify your contact information.",
1976
+ "Tax and IRS": "You may benefit from speaking with a tax professional. Please verify your contact information.",
1977
+ // 'Traffic and Tickets': '',
1978
+ Unemployment:
1979
+ "You may benefit from speaking with an unemployment professional. Please verify your contact information.",
1980
+ // 'Victim of a Crime': '',
1981
+ // 'Wills and Trusts': '',
1982
+ "Workers Compensation":
1983
+ "You may benefit from speaking with a workers compensation professional. Please verify your contact information.",
1984
+ // 'Wrongful Death': '',
1985
+ // 'Wrongful Termination': '',
1986
+ // 'Not Sure or Other': ''
1987
+ // 'Sexual Harassment': '',
1988
+ // 'Workplace Harassment': '',
1989
+ // 'Non-Workplace Harassment': '',
1990
+ // 'Workplace Discrimination': '',
1991
+ // 'Non-Workplace Discrimination': '',
1992
+ };
1993
+
1994
+ const nextStepsLegalDefault = [
1995
+ "haveAttorney",
1996
+ "degreeOfInterest",
1997
+ "commentsWithBankruptcy",
1998
+ "zipcode",
1999
+ "legalCrossSells",
2000
+ "firstAndLast",
2001
+ "contactInfo",
2002
+ ];
2003
+
2004
+ const nextStepsMapForeclosure = {
2005
+ values: {
2006
+ // Custom because we ask typeOfProperty on s1
2007
+ "*": ["amountPaymentsPastDue", "loanAmount", "defaultNotice", "ownRealEstate", ...nextStepsLegalDefault],
2008
+ },
2009
+ };
2010
+
2011
+ const nextStepsMapLegalCrossSells = {
2012
+ values: {
2013
+ Legal_CrossSells: {
2014
+ "Auto and Car Accidents": ["autoAndCarAccidentCrossSellQuestions"],
2015
+ "Personal Injury": ["personalInjuryCrossSellQuestions"],
2016
+ "Workers Compensation": ["workersCompensationCrossSellQuestions"],
2017
+ "DUI and DWI": ["duiAndDWICrossSellQuestions"],
2018
+ "Long Term Disability": ["longTermDisabilityCrossSellQuestions"],
2019
+ "Social Security Disability and Insurance": ["ssdiCrossSellQuestions"],
2020
+ Bankruptcy: ["bankruptcyCrossSellQuestions"],
2021
+ "Power of Attorney": ["powerOfAttorneyCrossSellQuestions"],
2022
+ "Wills and Trusts": ["willsAndTrustsCrossSellQuestions"],
2023
+ "Divorce and Separation": ["divorceAndSeparationCrossSellQuestions"],
2024
+ "Child Custody": ["childCustodyCrossSellQuestions"],
2025
+ },
2026
+ "*": ["firstAndLast", "contactInfo"],
2027
+ },
2028
+
2029
+ // NOTE: this assumes a certain placement of the cross sell question
2030
+ // in the form flow.
2031
+ appendSteps: ["firstAndLast", "contactInfo"],
2032
+ matchesAllowed: 1,
2033
+ };
2034
+
2035
+ const meta = defaultMetaPropsLegal();
2036
+
2037
+ meta.data.dynamicSchema = [
2038
+ amountPaymentsPastDue(),
2039
+ defaultNotice(),
2040
+ loanAmount(),
2041
+ ownRealEstate(),
2042
+ typeOfProperty(),
2043
+ degreeOfInterest(),
2044
+ haveAttorney(),
2045
+ zipcode(),
2046
+ commentsWithBankruptcy({
2047
+ label: null,
2048
+ headline: "Please briefly describe your situation:",
2049
+ headlineClass: "!t-text-dark",
2050
+ }),
2051
+ legalCrossSells({
2052
+ headlineClass: "!t-text-dark",
2053
+ nextStepMap: nextStepsMapLegalCrossSells,
2054
+ }),
2055
+ autoAndCarAccidentCrossSellQuestions(),
2056
+ ssdiCrossSellQuestions(),
2057
+ personalInjuryCrossSellQuestions(),
2058
+ willsAndTrustsCrossSellQuestions(),
2059
+ divorceAndSeparationCrossSellQuestions(),
2060
+ childCustodyCrossSellQuestions(),
2061
+ firstAndLastV3({
2062
+ headlineClass: "!t-text-dark",
2063
+ }),
2064
+ ];
2065
+
2066
+ const schema = [
2067
+ meta,
2068
+ formAnchor(),
2069
+ {
2070
+ $cmp: "FormKit",
2071
+ props: formProps({
2072
+ formId: "foreclosure",
2073
+ redirectMap: legalRedirectMap(),
2074
+ crossSellOptionMap: {
2075
+ Foreclosure: {
2076
+ "Auto and Car Accidents": "Involved in a Car Accident",
2077
+ "Wills and Trusts": "Need a Will or Trust",
2078
+ "Personal Injury": "Personal or Workplace Injury",
2079
+ "Divorce and Separation": "Need a Divorce or Separation",
2080
+ "Child Custody": "Need help with Child Custody",
2081
+ "Social Security Disability and Insurance": "Interest in SSDI Benefits",
2082
+ },
2083
+ },
2084
+ }),
2085
+ children: [
2086
+ progressBar(),
2087
+ headline({
2088
+ children: '$urlParam("hl", "Protect Your Family Today!")',
2089
+ if: "$activeStep === $firstStep()",
2090
+ headlineClass: "!t-pt-8 !t-text-2xl",
2091
+ }),
2092
+ subHeadline({
2093
+ children: '$urlParam("shl", "What Type of Property Is Facing Foreclosure?")',
2094
+ if: "$activeStep === $firstStep()",
2095
+ }),
2096
+ ...hiddenInputsLegal,
2097
+ {
2098
+ $el: "div",
2099
+ attrs: {
2100
+ class: "form-body",
2101
+ },
2102
+ children: [
2103
+ foreclosureTOLP({
2104
+ nextOnInput: false,
2105
+ nextStepMap: nextStepsMapForeclosure,
2106
+ }),
2107
+ dynamicSchemaNode(),
2108
+ contactInfo({
2109
+ headline: "Secure Your Future Today",
2110
+ subheadline: "Attorneys Are Ready To Help",
2111
+ }),
2112
+ formNavigation({
2113
+ startText: "Get Started",
2114
+ inputClass: "!t-font-extrabold",
2115
+ }),
2116
+ formDetails(),
2117
+ ],
2118
+ },
2119
+ ],
2120
+ },
2121
+ ];
2122
+
2123
+ export { schema as default };