mod-build 4.0.101-beta.2 → 4.1.0-beta.1

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 (115) hide show
  1. package/CHANGELOG.md +0 -4
  2. package/package.json +1 -1
  3. package/public/resources/scripts/abandonment/abandonment-a4bbb36fbc8ed64042b8.min.js +2 -0
  4. package/public/resources/scripts/abandonment/abandonment.min.js +2 -0
  5. package/public/resources/scripts/callrail/callrail-14011d73b50a928de4b4.min.js +2 -0
  6. package/public/resources/scripts/callrail/callrail.min.js +2 -0
  7. package/public/resources/scripts/footer/footer-component-46dc0d7ca6af4fc3b76b.min.js +2 -0
  8. package/public/resources/scripts/footer/footer-component.min.js +2 -0
  9. package/public/resources/scripts/geolocation/geolocation.min.js +2 -0
  10. package/public/resources/scripts/helpers/addVWOTestQueryParam.min.js +2 -0
  11. package/public/resources/scripts/helpers/addVWOTestQueryParam.min.js.map +1 -0
  12. package/public/resources/scripts/helpers/additionalOpts.min.js +2 -0
  13. package/public/resources/scripts/helpers/additionalOpts.min.js.map +1 -0
  14. package/public/resources/scripts/helpers/calls-only.min.js +2 -0
  15. package/public/resources/scripts/helpers/calls-only.min.js.map +1 -0
  16. package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js +2 -0
  17. package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js.map +1 -0
  18. package/public/resources/scripts/helpers/initNumericOnlyFields.min.js +2 -0
  19. package/public/resources/scripts/helpers/initNumericOnlyFields.min.js.map +1 -0
  20. package/public/resources/scripts/helpers/initQSForm.min.js +2 -0
  21. package/public/resources/scripts/helpers/initQSForm.min.js.map +1 -0
  22. package/public/resources/scripts/helpers/initQuadTransform.min.js +2 -0
  23. package/public/resources/scripts/helpers/initQuadTransform.min.js.map +1 -0
  24. package/public/resources/scripts/helpers/isZipCodeValid.min.js +2 -0
  25. package/public/resources/scripts/helpers/isZipCodeValid.min.js.map +1 -0
  26. package/public/resources/scripts/helpers/observeVWOVariation.min.js +2 -0
  27. package/public/resources/scripts/helpers/observeVWOVariation.min.js.map +1 -0
  28. package/public/resources/scripts/helpers/opts.min.js +2 -0
  29. package/public/resources/scripts/helpers/opts.min.js.map +1 -0
  30. package/public/resources/scripts/jornaya.hbs +35 -0
  31. package/public/resources/scripts/jornaya.html +35 -0
  32. package/public/resources/scripts/mod-alytics/modalytics-be44027508c0438f6709.min.js +2 -0
  33. package/public/resources/scripts/mod-alytics/modalytics.min.js +2 -0
  34. package/public/resources/scripts/mod-form/form/contractor-0918337caf3dfede1609.min.js +2 -0
  35. package/public/resources/scripts/mod-form/form/contractor.min.js +2 -0
  36. package/public/resources/scripts/mod-form/form/homeowner-19a121b0e596042326f4.min.js +2 -0
  37. package/public/resources/scripts/mod-form/form/homeowner.min.js +2 -0
  38. package/public/resources/scripts/mod-utils/modutils-bc275eb41af515f626ef.min.js +2 -0
  39. package/public/resources/scripts/mod-utils/modutils.min.js +2 -0
  40. package/public/resources/scripts/trusted-form.hbs +38 -0
  41. package/public/resources/scripts/trusted-form.html +38 -0
  42. package/public/resources/styles/components/abandonment/abandonment-8a673f060817db6cb7dc.min.css +1 -0
  43. package/public/resources/styles/components/abandonment/abandonment.min.css +1 -0
  44. package/public/resources/styles/components/footer/mod-footer-d233fa64b6c8297c70ec.min.css +1 -0
  45. package/public/resources/styles/components/footer/mod-footer.min.css +1 -0
  46. package/public/resources/styles/components/footer/qs-footer-926e67c28d10c729db46.min.css +1 -0
  47. package/public/resources/styles/components/footer/qs-footer.min.css +1 -0
  48. package/src/resources/data/tcpa.json +4 -0
  49. package/src/resources/templates/modals/about/index.hbs +9 -0
  50. package/src/resources/templates/modals/about/index.html +9 -0
  51. package/src/resources/templates/modals/contact-us/index.hbs +348 -0
  52. package/src/resources/templates/modals/contact-us/index.html +348 -0
  53. package/src/resources/templates/modals/e-sign-consent/index.hbs +35 -0
  54. package/src/resources/templates/modals/e-sign-consent/index.html +35 -0
  55. package/src/resources/templates/modals/faq/index.hbs +9 -0
  56. package/src/resources/templates/modals/faq/index.html +9 -0
  57. package/src/resources/templates/modals/privacy/index.hbs +237 -0
  58. package/src/resources/templates/modals/privacy/index.html +237 -0
  59. package/src/resources/templates/modals/terms/index.hbs +167 -0
  60. package/src/resources/templates/modals/terms/index.html +167 -0
  61. package/tasks/get-default-trade-questions.js +157 -121
  62. package/tasks/templates.js +2 -2
  63. /package/{gulp-tasks → archived/gulp-tasks}/add-path-subdirectories.js +0 -0
  64. /package/{gulp-tasks → archived/gulp-tasks}/build-stat.js +0 -0
  65. /package/{gulp-tasks → archived/gulp-tasks}/build.js +0 -0
  66. /package/{gulp-tasks → archived/gulp-tasks}/cache-bust.js +0 -0
  67. /package/{gulp-tasks → archived/gulp-tasks}/check-seasonal-variations.js +0 -0
  68. /package/{gulp-tasks → archived/gulp-tasks}/clean.js +0 -0
  69. /package/{gulp-tasks → archived/gulp-tasks}/combine-files.js +0 -0
  70. /package/{gulp-tasks → archived/gulp-tasks}/compile.js +0 -0
  71. /package/{gulp-tasks → archived/gulp-tasks}/copy-files-to-build-path.js +0 -0
  72. /package/{gulp-tasks → archived/gulp-tasks}/copy-fonts.js +0 -0
  73. /package/{gulp-tasks → archived/gulp-tasks}/copy-json.js +0 -0
  74. /package/{gulp-tasks → archived/gulp-tasks}/copy-resources-to-dist.js +0 -0
  75. /package/{gulp-tasks → archived/gulp-tasks}/copy-videos.js +0 -0
  76. /package/{gulp-tasks → archived/gulp-tasks}/extras.js +0 -0
  77. /package/{gulp-tasks → archived/gulp-tasks}/grab-cdn.js +0 -0
  78. /package/{gulp-tasks → archived/gulp-tasks}/grab-form-helpers.js +0 -0
  79. /package/{gulp-tasks → archived/gulp-tasks}/grab-global-images.js +0 -0
  80. /package/{gulp-tasks → archived/gulp-tasks}/grab-images.js +0 -0
  81. /package/{gulp-tasks → archived/gulp-tasks}/grab-shared-components.js +0 -0
  82. /package/{gulp-tasks → archived/gulp-tasks}/grab-shared-scripts.js +0 -0
  83. /package/{gulp-tasks → archived/gulp-tasks}/grab-theme-json.js +0 -0
  84. /package/{gulp-tasks → archived/gulp-tasks}/grab-tooltips-json.js +0 -0
  85. /package/{gulp-tasks → archived/gulp-tasks}/js-lint-husky.js +0 -0
  86. /package/{gulp-tasks → archived/gulp-tasks}/js-lint.js +0 -0
  87. /package/{gulp-tasks → archived/gulp-tasks}/minify.js +0 -0
  88. /package/{gulp-tasks → archived/gulp-tasks}/sass-lint.js +0 -0
  89. /package/{gulp-tasks → archived/gulp-tasks}/serve.js +0 -0
  90. /package/{gulp-tasks → archived/gulp-tasks}/settings.js +0 -0
  91. /package/{gulp-tasks → archived/gulp-tasks}/styles.js +0 -0
  92. /package/{gulp-tasks → archived/gulp-tasks}/tasks.js +0 -0
  93. /package/{gulp-tasks → archived/gulp-tasks}/templates.js +0 -0
  94. /package/{src → archived/src}/data/footer.js +0 -0
  95. /package/{src → archived/src}/scripts/vendor/google-tag-manager-head.js +0 -0
  96. /package/{src → archived/src}/scripts/vendor/heap-addeventproperties-identify.js +0 -0
  97. /package/{src → archived/src}/scripts/vendor/heap-tracking.js +0 -0
  98. /package/{src → archived/src}/styles/partials/_contact-us.scss +0 -0
  99. /package/{src → archived/src}/styles/partials/_google-address-autocomplete.scss +0 -0
  100. /package/{src → archived/src}/styles/partials/_mixins.scss +0 -0
  101. /package/{src → archived/src}/styles/partials/_modal-pages.scss +0 -0
  102. /package/{src → archived/src}/styles/partials/_modernize-colors.scss +0 -0
  103. /package/{src → archived/src}/styles/partials/_qs-footer.scss +0 -0
  104. /package/{src → archived/src}/styles/partials/_quote-footer-v1.scss +0 -0
  105. /package/{src → archived/src}/styles/partials/_quote-footer-v2.scss +0 -0
  106. /package/{src → archived/src}/styles/partials/_quote-footer-v3.scss +0 -0
  107. /package/{src → archived/src}/templates/_partials/scripts/deferred-styles.html +0 -0
  108. /package/{src → archived/src}/templates/_partials/scripts/heap-bundle.html +0 -0
  109. /package/{src → archived/src}/templates/_partials/scripts/heap.html +0 -0
  110. /package/{src → archived/src}/templates/_partials/scripts/utm-params.html +0 -0
  111. /package/{src → archived/src}/templates/components/qs-footer.html +0 -0
  112. /package/{src → archived/src}/templates/components/quote-footer-v1.html +0 -0
  113. /package/{src → archived/src}/templates/components/quote-footer-v2.html +0 -0
  114. /package/tasks/{addSeasonalchanges.js → add-seasonal-changes.js} +0 -0
  115. /package/tasks/{setupDevOpsTrackingId.js → setup-dev-ops-tracking-id.js} +0 -0
@@ -2,7 +2,7 @@
2
2
  import merge from 'lodash.merge';
3
3
  import { defaultSettings } from '../src/data/config.js';
4
4
 
5
- export function resolveRefs(value, root = value, refChain = new Set()) {
5
+ function resolveRefs(value, root, refChain = new Set()) {
6
6
  if (value === null || typeof value !== 'object') {
7
7
  return value;
8
8
  }
@@ -33,150 +33,186 @@ export function resolveRefs(value, root = value, refChain = new Set()) {
33
33
  return resolved;
34
34
  }
35
35
 
36
- function mergeQuestionFields(fields, defaultFields, {
37
- legendAttributes,
38
- optionFieldTypes,
39
- errorMessages
40
- }) {
41
- let defaultOptions = [];
42
- let defaultLegend = {};
43
- defaultFields.forEach((defaultField) => {
44
- defaultOptions = defaultField.options;
45
- defaultLegend = defaultField.legend;
46
-
47
- if (defaultLegend && legendAttributes) {
48
- defaultLegend.attributes = {
49
- ...defaultLegend.attributes,
50
- ...legendAttributes
51
- };
52
- }
53
- });
36
+ function mergeDefaultTradeQuestionsConfigOnSteps(config, steps) {
37
+ if (!config || typeof config !== 'object') return;
54
38
 
55
- fields.forEach((field) => {
56
- if (field.legend) {
57
- field.legend = merge(defaultLegend, field.legend);
58
- } else {
59
- field.legend = defaultLegend;
60
- }
39
+ if (config.steps && typeof config.steps === 'object' && config.steps.items) {
40
+ // cloning steps to keep multiple steps: {} objects independent
41
+ const clonedSteps = JSON.parse(JSON.stringify(steps));
42
+ mergeDefaultTradeQuestionsConfig(config, clonedSteps);
43
+ }
61
44
 
62
- if (field.remove) {
63
- if (field.remove.includes('all')) {
64
- defaultOptions = [];
65
- } else {
66
- defaultOptions = defaultOptions.filter((_, index) => !field.remove.includes(index));
45
+ for (const key in config) {
46
+ if (config.hasOwnProperty(key)) {
47
+ const value = config[key];
48
+ if (typeof value === 'object' && value !== null) {
49
+ mergeDefaultTradeQuestionsConfigOnSteps(value, steps);
67
50
  }
68
51
  }
52
+ }
53
+ }
54
+
55
+ function mergeDefaultTradeQuestionsConfig(config, steps) {
56
+ if (!config || !config.steps || !config.steps.items || !Array.isArray(config.steps.items)) {
57
+ return;
58
+ }
59
+
60
+ config.steps.items.forEach((item) => {
61
+ const stepName = item.attributes.data['step-name'];
62
+ if (steps[stepName]) {
63
+ if (!item.stepContent) {
64
+ item.stepContent = {};
65
+ }
69
66
 
70
- if (field.move) {
71
- // field.move will look like [{from: 0, to: 1}]
72
- // remove the option at from and insert it at to, in listed order
73
- field.move.forEach((move) => {
74
- const fromIndex = move.from;
75
- const toIndex = move.to;
76
- const fromOption = defaultOptions.splice(fromIndex, 1);
77
- defaultOptions.splice(toIndex, 0, fromOption[0]);
67
+ if (!item.stepContent.fields) {
68
+ item.stepContent.fields = [];
69
+ }
70
+ const defaultStepFields = steps[stepName].fields;
71
+ let defaultStepOptions = [];
72
+ let defaultQuestionLegend = {};
73
+ defaultStepFields.forEach((defaultField) => {
74
+ defaultStepOptions = defaultField.options;
75
+ defaultQuestionLegend = defaultField.legend;
78
76
  });
79
- }
80
77
 
81
- if (!optionFieldTypes.includes(field.fieldType)) {
82
- return;
83
- }
78
+ item.stepContent.fields.forEach((field) => {
79
+ if (field.legend) {
80
+ field.legend = merge(defaultQuestionLegend, field.legend);
81
+ } else {
82
+ field.legend = defaultQuestionLegend;
83
+ }
84
84
 
85
- if (!field.errorMessage && errorMessages[field.fieldType]) {
86
- field.errorMessage = errorMessages[field.fieldType];
87
- }
85
+ if (field && field.remove) {
86
+ if (field.remove.includes('all')) {
87
+ defaultStepOptions = [];
88
+ } else {
89
+ defaultStepOptions = defaultStepOptions.filter((_, i) => !field.remove.includes(i));
90
+ }
91
+ }
88
92
 
89
- if (Array.isArray(field.options)) {
90
- field.options.forEach((option) => {
91
- if (typeof option.update === 'number') {
92
- if (option.attributes?.checked === false) {
93
- delete option.attributes.checked;
94
- delete defaultOptions[option.update]?.attributes?.checked;
93
+ if (field && field.move) {
94
+ // field.move will look like [{from: 0, to: 1}]
95
+ // we need to remove option at from index and insert at to index
96
+ field.move.forEach((move) => {
97
+ const fromIndex = move.from;
98
+ const toIndex = move.to;
99
+ const fromOption = defaultStepOptions.splice(fromIndex, 1);
100
+ defaultStepOptions.splice(toIndex, 0, fromOption[0]);
101
+ });
102
+ }
103
+
104
+ if (field.fieldType === 'radio' || field.fieldType === 'checkbox-group') {
105
+ if (!field.errorMessage) {
106
+ field.errorMessage = field.fieldType === 'checkbox-group' ? 'Please select at least one option.' : 'Professionals need this info to generate a quote.';
107
+ }
108
+
109
+ if (field.options && Array.isArray(field.options) && field.options.length) {
110
+ field.options.forEach((option) => {
111
+ if (typeof option.update === 'number') {
112
+ if (option.attributes && option.attributes.checked === false) {
113
+ delete option.attributes.checked;
114
+ delete defaultStepOptions[option.update].attributes.checked;
115
+ }
116
+ merge(defaultStepOptions[option.update], option);
117
+ } else {
118
+ if (typeof option.insertAt === 'number') {
119
+ defaultStepOptions.splice(option.insertAt, 0, option);
120
+ } else {
121
+ defaultStepOptions.push(option);
122
+ }
123
+ }
124
+ });
95
125
  }
96
- merge(defaultOptions[option.update], option);
97
- } else if (typeof option.insertAt === 'number') {
98
- defaultOptions.splice(option.insertAt, 0, option);
126
+ field.options = defaultStepOptions;
99
127
  } else {
100
- defaultOptions.push(option);
128
+ if (field && Array.isArray(field) && field.length) {
129
+ if (typeof field.update === 'number') {
130
+ merge(defaultStepFields[field.update], field);
131
+ } else {
132
+ if (typeof field.insertAt === 'number') {
133
+ defaultStepFields.splice(field.insertAt, 0, field);
134
+ } else {
135
+ defaultStepFields.push(field);
136
+ }
137
+ }
138
+ }
139
+
140
+ field = defaultStepFields;
101
141
  }
102
142
  });
103
- }
104
- field.options = defaultOptions;
105
- });
106
- }
107
143
 
108
- export function mergeDefaultTradeQuestionsIntoItems(items, steps, options = {}) {
109
- if (!Array.isArray(items) || !steps || typeof steps !== 'object') {
110
- return;
111
- }
144
+ // extra question block
145
+ if (item.stepContent.extraQuestionBlock) {
146
+ if (!item.stepContent.extraQuestionBlock.fields) {
147
+ item.stepContent.extraQuestionBlock.fields = [];
148
+ }
112
149
 
113
- const mergeOptions = {
114
- legendAttributes: options.legendAttributes,
115
- optionFieldTypes: options.optionFieldTypes || ['radio', 'checkbox-group'],
116
- errorMessages: {
117
- radio: 'Professionals need this info to generate a quote.',
118
- 'checkbox-group': 'Please select at least one option.',
119
- ...options.errorMessages
120
- }
121
- };
150
+ const defaultExtraQuestionFields = steps[stepName].extraQuestionBlock.fields;
151
+ let defaultExtraQuestionOptions = [];
152
+ let defaultExtraQuestionLegend = {};
153
+ defaultExtraQuestionFields.forEach((defaultExtraQuestionField) => {
154
+ defaultExtraQuestionOptions = defaultExtraQuestionField.options;
155
+ defaultExtraQuestionLegend = defaultExtraQuestionField.legend;
156
+ });
157
+ item.stepContent.extraQuestionBlock.fields.forEach((field) => {
122
158
 
123
- items.forEach((item) => {
124
- const stepName = item.attributes?.data?.['step-name'];
125
- const defaultStep = steps[stepName];
126
- if (!defaultStep) {
127
- return;
128
- }
159
+ if (field.legend) {
160
+ field.legend = merge(defaultExtraQuestionLegend, field.legend);
161
+ } else {
162
+ field.legend = defaultExtraQuestionLegend;
163
+ }
129
164
 
130
- if (!item.stepContent) {
131
- item.stepContent = {};
132
- }
133
- if (!item.stepContent.fields) {
134
- item.stepContent.fields = [];
135
- }
165
+ if (field && field.remove) {
166
+ if (field.remove.includes('all')) {
167
+ defaultExtraQuestionOptions = [];
168
+ } else {
169
+ defaultExtraQuestionOptions = defaultExtraQuestionOptions.filter((_, i) => !field.remove.includes(i));
170
+ }
171
+ }
136
172
 
137
- mergeQuestionFields(item.stepContent.fields, defaultStep.fields, mergeOptions);
173
+ if (field.fieldType === 'radio') {
174
+ if (!field.errorMessage) {
175
+ field.errorMessage = 'Professionals need this info to generate a quote.';
176
+ }
138
177
 
139
- const extraQuestionBlock = item.stepContent.extraQuestionBlock;
140
- if (extraQuestionBlock) {
141
- if (!extraQuestionBlock.fields) {
142
- extraQuestionBlock.fields = [];
178
+ if (field.options && Array.isArray(field.options) && field.options.length) {
179
+ field.options.forEach((option, optionIndex) => {
180
+ if (typeof option.update === 'number') {
181
+ if (option.attributes && option.attributes.checked === false) {
182
+ delete option.attributes.checked;
183
+ delete defaultStepOptions[option.update].attributes.checked;
184
+ }
185
+ merge(defaultExtraQuestionOptions[option.update], option);
186
+ } else {
187
+ if (typeof option.insertAt === 'number') {
188
+ defaultExtraQuestionOptions.splice(option.insertAt, 0, option);
189
+ } else {
190
+ defaultExtraQuestionOptions.push(option);
191
+ }
192
+ }
193
+ });
194
+ }
195
+ field.options = defaultExtraQuestionOptions;
196
+ } else {
197
+ if (field && Array.isArray(field) && field.length) {
198
+ if (typeof field.update === 'number') {
199
+ merge(defaultExtraQuestionFields[field.update], field);
200
+ } else {
201
+ if (typeof field.insertAt === 'number') {
202
+ defaultExtraQuestionFields.splice(field.insertAt, 0, field);
203
+ } else {
204
+ defaultExtraQuestionFields.push(field);
205
+ }
206
+ }
207
+ }
208
+ field = defaultExtraQuestionFields;
209
+ }
210
+ });
143
211
  }
144
- mergeQuestionFields(
145
- extraQuestionBlock.fields,
146
- defaultStep.extraQuestionBlock.fields,
147
- mergeOptions
148
- );
149
212
  }
150
213
  });
151
214
  }
152
215
 
153
- export function mergeDefaultTradeQuestionsConfigOnSteps(config, steps, options) {
154
- if (!config || typeof config !== 'object') return;
155
-
156
- if (config.steps && typeof config.steps === 'object' && config.steps.items) {
157
- // cloning steps to keep multiple steps: {} objects independent
158
- const clonedSteps = JSON.parse(JSON.stringify(steps));
159
- mergeDefaultTradeQuestionsConfig(config, clonedSteps, options);
160
- }
161
-
162
- for (const key in config) {
163
- if (config.hasOwnProperty(key)) {
164
- const value = config[key];
165
- if (typeof value === 'object' && value !== null) {
166
- mergeDefaultTradeQuestionsConfigOnSteps(value, steps, options);
167
- }
168
- }
169
- }
170
- }
171
-
172
- export function mergeDefaultTradeQuestionsConfig(config, steps, options) {
173
- if (!config || !config.steps || !config.steps.items || !Array.isArray(config.steps.items)) {
174
- return;
175
- }
176
-
177
- mergeDefaultTradeQuestionsIntoItems(config.steps.items, steps, options);
178
- }
179
-
180
216
  export default async function(config) {
181
217
  if (config.useStepsConfig) {
182
218
  console.log('Starting get-default-trade-questions...');
@@ -6,8 +6,8 @@ import { createRetryFetch } from '../src/scripts/retry-fetch.js';
6
6
 
7
7
  import { defaultSettings } from '../src/data/config.js';
8
8
 
9
- import setupDevOpsTrackingId from './setupDevOpsTrackingId.js';
10
- import addSeasonalchanges from './addSeasonalchanges.js';
9
+ import setupDevOpsTrackingId from './setup-dev-ops-tracking-id.js';
10
+ import addSeasonalchanges from './add-seasonal-changes.js';
11
11
 
12
12
  const fetchWithRetryDefault = createRetryFetch();
13
13
  const fetchWithRetryTcpa = createRetryFetch();
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes