mod-build 4.0.102 → 4.0.103

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 (110) hide show
  1. package/package.json +2 -2
  2. package/public/resources/scripts/abandonment/abandonment-a4bbb36fbc8ed64042b8.min.js +2 -0
  3. package/public/resources/scripts/abandonment/abandonment.min.js +2 -0
  4. package/public/resources/scripts/callrail/callrail-14011d73b50a928de4b4.min.js +2 -0
  5. package/public/resources/scripts/callrail/callrail.min.js +2 -0
  6. package/public/resources/scripts/footer/footer-component-46dc0d7ca6af4fc3b76b.min.js +2 -0
  7. package/public/resources/scripts/footer/footer-component.min.js +2 -0
  8. package/public/resources/scripts/geolocation/geolocation.min.js +2 -0
  9. package/public/resources/scripts/helpers/addVWOTestQueryParam.min.js +2 -0
  10. package/public/resources/scripts/helpers/addVWOTestQueryParam.min.js.map +1 -0
  11. package/public/resources/scripts/helpers/additionalOpts.min.js +2 -0
  12. package/public/resources/scripts/helpers/additionalOpts.min.js.map +1 -0
  13. package/public/resources/scripts/helpers/calls-only.min.js +2 -0
  14. package/public/resources/scripts/helpers/calls-only.min.js.map +1 -0
  15. package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js +2 -0
  16. package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js.map +1 -0
  17. package/public/resources/scripts/helpers/initNumericOnlyFields.min.js +2 -0
  18. package/public/resources/scripts/helpers/initNumericOnlyFields.min.js.map +1 -0
  19. package/public/resources/scripts/helpers/initQSForm.min.js +2 -0
  20. package/public/resources/scripts/helpers/initQSForm.min.js.map +1 -0
  21. package/public/resources/scripts/helpers/initQuadTransform.min.js +2 -0
  22. package/public/resources/scripts/helpers/initQuadTransform.min.js.map +1 -0
  23. package/public/resources/scripts/helpers/isZipCodeValid.min.js +2 -0
  24. package/public/resources/scripts/helpers/isZipCodeValid.min.js.map +1 -0
  25. package/public/resources/scripts/helpers/observeVWOVariation.min.js +2 -0
  26. package/public/resources/scripts/helpers/observeVWOVariation.min.js.map +1 -0
  27. package/public/resources/scripts/helpers/opts.min.js +2 -0
  28. package/public/resources/scripts/helpers/opts.min.js.map +1 -0
  29. package/public/resources/scripts/jornaya.hbs +35 -0
  30. package/public/resources/scripts/jornaya.html +35 -0
  31. package/public/resources/scripts/mod-alytics/modalytics-be44027508c0438f6709.min.js +2 -0
  32. package/public/resources/scripts/mod-alytics/modalytics.min.js +2 -0
  33. package/public/resources/scripts/mod-form/form/contractor-0918337caf3dfede1609.min.js +2 -0
  34. package/public/resources/scripts/mod-form/form/contractor.min.js +2 -0
  35. package/public/resources/scripts/mod-form/form/homeowner-19a121b0e596042326f4.min.js +2 -0
  36. package/public/resources/scripts/mod-form/form/homeowner.min.js +2 -0
  37. package/public/resources/scripts/mod-utils/modutils-bc275eb41af515f626ef.min.js +2 -0
  38. package/public/resources/scripts/mod-utils/modutils.min.js +2 -0
  39. package/public/resources/scripts/trusted-form.hbs +38 -0
  40. package/public/resources/scripts/trusted-form.html +38 -0
  41. package/public/resources/styles/components/abandonment/abandonment-8a673f060817db6cb7dc.min.css +1 -0
  42. package/public/resources/styles/components/abandonment/abandonment.min.css +1 -0
  43. package/public/resources/styles/components/footer/mod-footer-d233fa64b6c8297c70ec.min.css +1 -0
  44. package/public/resources/styles/components/footer/mod-footer.min.css +1 -0
  45. package/public/resources/styles/components/footer/qs-footer-926e67c28d10c729db46.min.css +1 -0
  46. package/public/resources/styles/components/footer/qs-footer.min.css +1 -0
  47. package/src/resources/templates/modals/privacy/index.hbs +88 -89
  48. package/src/resources/templates/modals/privacy/index.html +88 -89
  49. package/src/resources/templates/modals/terms/index.hbs +8 -7
  50. package/src/resources/templates/modals/terms/index.html +8 -7
  51. package/src/scripts/globals.js +1 -3
  52. package/src/scripts/plugins.js +0 -3
  53. package/tasks/templates.js +2 -4
  54. package/gulp-tasks/add-path-subdirectories.js +0 -34
  55. package/gulp-tasks/build-stat.js +0 -9
  56. package/gulp-tasks/build.js +0 -28
  57. package/gulp-tasks/cache-bust.js +0 -19
  58. package/gulp-tasks/check-seasonal-variations.js +0 -21
  59. package/gulp-tasks/clean.js +0 -10
  60. package/gulp-tasks/combine-files.js +0 -7
  61. package/gulp-tasks/compile.js +0 -44
  62. package/gulp-tasks/copy-files-to-build-path.js +0 -8
  63. package/gulp-tasks/copy-fonts.js +0 -6
  64. package/gulp-tasks/copy-json.js +0 -6
  65. package/gulp-tasks/copy-resources-to-dist.js +0 -6
  66. package/gulp-tasks/copy-videos.js +0 -6
  67. package/gulp-tasks/extras.js +0 -22
  68. package/gulp-tasks/grab-cdn.js +0 -74
  69. package/gulp-tasks/grab-form-helpers.js +0 -55
  70. package/gulp-tasks/grab-global-images.js +0 -121
  71. package/gulp-tasks/grab-images.js +0 -79
  72. package/gulp-tasks/grab-shared-components.js +0 -46
  73. package/gulp-tasks/grab-shared-scripts.js +0 -275
  74. package/gulp-tasks/grab-theme-json.js +0 -24
  75. package/gulp-tasks/grab-tooltips-json.js +0 -33
  76. package/gulp-tasks/js-lint-husky.js +0 -35
  77. package/gulp-tasks/js-lint.js +0 -24
  78. package/gulp-tasks/minify.js +0 -131
  79. package/gulp-tasks/sass-lint.js +0 -15
  80. package/gulp-tasks/serve.js +0 -74
  81. package/gulp-tasks/settings.js +0 -22
  82. package/gulp-tasks/styles.js +0 -42
  83. package/gulp-tasks/tasks.js +0 -475
  84. package/gulp-tasks/templates.js +0 -288
  85. package/src/data/footer.js +0 -119
  86. package/src/scripts/default/additional-assets.js +0 -60
  87. package/src/scripts/default/rage-clicking.js +0 -54
  88. package/src/scripts/default/show-utility-providers.js +0 -28
  89. package/src/scripts/url-cleaner.js +0 -8
  90. package/src/scripts/vendor/google-tag-manager-head.js +0 -6
  91. package/src/scripts/vendor/heap-addeventproperties-identify.js +0 -262
  92. package/src/scripts/vendor/heap-tracking.js +0 -9
  93. package/src/styles/partials/_contact-us.scss +0 -196
  94. package/src/styles/partials/_google-address-autocomplete.scss +0 -52
  95. package/src/styles/partials/_mixins.scss +0 -39
  96. package/src/styles/partials/_modal-pages.scss +0 -125
  97. package/src/styles/partials/_modernize-colors.scss +0 -128
  98. package/src/styles/partials/_qs-footer.scss +0 -68
  99. package/src/styles/partials/_quote-footer-v1.scss +0 -79
  100. package/src/styles/partials/_quote-footer-v2.scss +0 -64
  101. package/src/styles/partials/_quote-footer-v3.scss +0 -65
  102. package/src/templates/_partials/scripts/deferred-styles.html +0 -16
  103. package/src/templates/_partials/scripts/heap-bundle.html +0 -5
  104. package/src/templates/_partials/scripts/heap.html +0 -4
  105. package/src/templates/_partials/scripts/utm-params.html +0 -9
  106. package/src/templates/components/qs-footer.html +0 -55
  107. package/src/templates/components/quote-footer-v1.html +0 -148
  108. package/src/templates/components/quote-footer-v2.html +0 -169
  109. /package/tasks/{addSeasonalchanges.js → add-seasonal-changes.js} +0 -0
  110. /package/tasks/{setupDevOpsTrackingId.js → setup-dev-ops-tracking-id.js} +0 -0
@@ -1,288 +0,0 @@
1
- /* globals Promise */
2
- var merge = require('lodash.merge');
3
- var request = require('request');
4
-
5
- module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
6
- // Merge site's data with shared data
7
- /* eslint brace-style: 0 */
8
- const { isLocal, nodeEnv, buildPath } = siteSettings;
9
- const { isWhiteLabel } = siteData;
10
-
11
- var commonData = require('../src/data/common.js');
12
-
13
- var assetsPath = isLocal ? '/temp/assets' : 'https://' + nodeEnv + '/quote/resources/assets';
14
- assetsPath = isWhiteLabel ? '' : assetsPath;
15
-
16
- var qsFooterData = require('../src/data/components/qs-footer.js');
17
- var quoteFooterData = require('../src/data/components/quote-footer.js');
18
-
19
- // Checking for seasonal variations in the template.js + updating content
20
- var checkSeasonalVariations = require('./check-seasonal-variations.js');
21
- const activeSeason = checkSeasonalVariations();
22
- if (activeSeason.length !== 0) {
23
- if (siteData.seasonalVariations) {
24
- activeSeason.forEach(season => {
25
- if (season in siteData.seasonalVariations) {
26
- siteData = merge(siteData, siteData.seasonalVariations[season]);
27
- }
28
- });
29
- }
30
- }
31
-
32
- var templatesData = Object.assign(commonData(), qsFooterData(siteData), quoteFooterData(siteData), siteData, { isLocal, nodeEnv, assetsPath, buildPath });
33
-
34
- // This is helper function to evaluate JS expressions
35
- // in Handlebars, e.g. for conditions
36
- var handlebarsX = function(expression, context) {
37
- var result = (function() {
38
- try {
39
- return eval(expression);
40
- }
41
- catch (e) {
42
- console.warn(
43
- '• Expression: {{x \'' + expression + '\'}}\n'
44
- + '• JS-Error: ', e, '\n'
45
- + '• Context: ',
46
- context
47
- );
48
- }
49
- }).call(context);
50
-
51
- return result;
52
- };
53
-
54
- // Support helper functions
55
- var handlebarsHelpers = [
56
- // Run any js line
57
- {
58
- name: 'x',
59
- fn: function(expression, options) {
60
- return handlebarsX(expression, this, options);
61
- }
62
- },
63
- // Run any js line and check if it is true
64
- {
65
- name: 'xif',
66
- fn: function(expression, options) {
67
- return handlebarsX(expression, this, options) ? options.fn(this) : options.inverse(this);
68
- }
69
- },
70
- // Reverse array
71
- {
72
- name: 'reverseArray',
73
- fn: function(expression) {
74
- expression.reverse();
75
- }
76
- },
77
- // Check if one var equals to another
78
- {
79
- name: 'equals',
80
- fn: function(v1, v2, block) {
81
- if (v1 === v2) {
82
- return block.fn(this);
83
- }
84
- }
85
- },
86
- // Convert string to uppercase
87
- {
88
- name: 'uppercase',
89
- fn: function(expression) {
90
- return 'string' === typeof expression ? expression.toUpperCase() : '';
91
- }
92
- },
93
- // Convert deferred styles string to links
94
- {
95
- name: 'deferredStyles',
96
- fn: function(str) {
97
- var urls = str.split(';'),
98
- links = [];
99
-
100
- urls.forEach(function(url) {
101
- links.push('<link href="' + url + '" rel="stylesheet" type="text/css" />');
102
- });
103
-
104
- return links.join('');
105
- }
106
- },
107
- // Format Phone number like type1 : xxx-xxx-xxxx OR type2 : (xxx) xxx-xxxx
108
- {
109
- name: 'formatPhoneNo',
110
- fn: function(expression, type) {
111
- var mask = /(\d{3})(\d{3})(\d{,4})?/;
112
- if (type === 'type1') {
113
- newValues = '$1-$2-$3';
114
- } else {
115
- newValues = '($1) $2-$3';
116
- }
117
- return expression.replace(mask, newValues);
118
- }
119
- },
120
- // It will take the json object & variable name to assign the object & return it in the script tag
121
- {
122
- name: 'jsonVarScriptTag',
123
- fn: function(json, variable) {
124
- var check = (typeof json === 'object') && (typeof variable === 'string' && variable);
125
- return check ? '<script>' + 'var ' + variable + '=' + JSON.stringify(json) + '</script>' : '';
126
- }
127
- },
128
- // It will take & return json object
129
- {
130
- name: 'json',
131
- fn: function(json) {
132
- return JSON.stringify(json);
133
- }
134
- },
135
- // Adding increment of 1 to value
136
- {
137
- name: 'inc',
138
- fn: function(index) {
139
- index++;
140
- return index;
141
- }
142
- },
143
- // Loop to go through and add each attribute defined in the attributes: {} object
144
- {
145
- name: 'addAttributes',
146
- fn: function(obj) {
147
- var output = '';
148
- var ignoreKeys = Array.prototype.slice.call(arguments, 1, -1);
149
-
150
- for (var key in obj.attributes) {
151
- if (ignoreKeys.indexOf(key) === -1) {
152
- if (typeof obj.attributes[key] !== 'object') {
153
- output += key + '="' + obj.attributes[key] + '" ';
154
- } else if (key === 'data') {
155
- for (var dataKey in obj.attributes[key]) {
156
- output += 'data-' + dataKey + '="' + obj.attributes[key][dataKey] + '" ';
157
- }
158
- } else if (key === 'aria') {
159
- for (var ariaKey in obj.attributes[key]) {
160
- output += 'aria-' + ariaKey + '="' + obj.attributes[key][ariaKey] + '" ';
161
- }
162
- }
163
- }
164
- }
165
- return output.trim();
166
- }
167
- }
168
- ];
169
-
170
- var mergeDefaultFormFieldConfig = function(steps, defaultConfig) {
171
- if (!steps.items) {
172
- console.error('No items[ ] found in steps{}!');
173
- return steps;
174
- }
175
- if (templatesData.siteData && templatesData.siteData.useAccessibleConfig) {
176
- steps.items.forEach(item => {
177
- if (item.stepContent.fields) {
178
- item.stepContent.fields = item.stepContent.fields.map(field => {
179
- if (field.attributes && field.attributes.name && defaultConfig[field.attributes.name]) {
180
- field = merge(defaultConfig[field.attributes.name], field);
181
- }
182
- return field;
183
- });
184
- }
185
- });
186
- } else {
187
- steps.items.forEach(item => {
188
- if (item.fields) {
189
- item.fields = item.fields.map(field => {
190
- if (field.name && defaultConfig[field.name]) {
191
- field = Object.assign(defaultConfig[field.name], field);
192
- }
193
- return field;
194
- });
195
- }
196
- });
197
- }
198
-
199
- return steps;
200
- };
201
-
202
- var getDefaultFormFieldConfig = async function(folder) {
203
- console.time('Finished fetch-default-form-config after');
204
- console.log('Starting fetch-default-form-config: ');
205
- await new Promise((resolve) => {
206
- request(`https://${siteSettings.nodeEnv}/quote/resources/mod-site/${folder}/steps/defaultFormFieldConfig.json`, async function(_err, xhr, response) {
207
- if (xhr.statusCode !== 200) {
208
- throw new Error(`${xhr.statusCode}: Error while fetching ${folder}/defaultFormFieldConfig.json`);
209
- }
210
-
211
- const defaultConfig = await JSON.parse(response);
212
-
213
- if (templatesData.steps) {
214
- templatesData.steps = await mergeDefaultFormFieldConfig(templatesData.steps, defaultConfig);
215
- }
216
- if (templatesData.qsSteps) {
217
- templatesData.qsSteps = await mergeDefaultFormFieldConfig(templatesData.qsSteps, defaultConfig);
218
- }
219
- if (templatesData.modSteps) {
220
- templatesData.modSteps = await mergeDefaultFormFieldConfig(templatesData.modSteps, defaultConfig);
221
- }
222
-
223
- templatesData.defaultConfigCompleted = true;
224
-
225
- resolve();
226
- });
227
- });
228
- console.timeEnd('Finished fetch-default-form-config after');
229
- };
230
-
231
- var fetchTcpaFromSitegenie = async function() {
232
- const company = templatesData.company_name;
233
- const website = templatesData.website_name;
234
- const c_level = templatesData.cLevel ? templatesData.cLevel : 'default';
235
- const affiliateKey = templatesData.affiliateKey ? templatesData.affiliateKey : 0;
236
- const service = templatesData.service ? templatesData.service.toLowerCase().replace(' ', '_') : templatesData.primary_trade.toLowerCase().replace(' ', '_');
237
- const apiEnv = 'https://' + (templatesData.nodeEnv === 'modernize.com' ? 'hs.leadpost.net/' : 'hsleadpost1.quinstage.com/');
238
- const url = `${apiEnv}coreg/getTCPAConsent?website=${website}&service=${service}&affiliateKey=${affiliateKey}&c_level=${c_level}`;
239
- console.time('Finished fetch-tcpa-from-sitegenie after');
240
- console.log('Starting fetch-tcpa-from-sitegenie: ',url);
241
- await new Promise(function(resolve) {
242
- request(url, async function(_err, xhr, response) {
243
- if (xhr.statusCode !== 200) {
244
- throw new Error(`${xhr.statusCode}: Error while fetching TCPA`);
245
- }
246
- const responseJson = await JSON.parse(response);
247
- let finalTCPA = await (company === 'Modernize' || templatesData.useModernizeInTCPA) ? responseJson.tcpa.replace(/QuinStreet/g, 'Modernize') : responseJson.tcpa;
248
- const removeInlineStyleRegex = / style="[^"]*"/g;
249
- finalTCPA = finalTCPA.replace(removeInlineStyleRegex, '');
250
- templatesData.tcpaText = await finalTCPA;
251
-
252
- resolve();
253
- });
254
- });
255
- console.timeEnd('Finished fetch-tcpa-from-sitegenie after');
256
- };
257
-
258
- return async function() {
259
- if (Object.keys(siteData).length > 0) {
260
- if (!templatesData.doNotUseDefaultFieldConfig && !templatesData.defaultConfigCompleted) {
261
- if (templatesData.siteData && templatesData.siteData.useAccessibleConfig) {
262
- await getDefaultFormFieldConfig('accessible-components');
263
- } else {
264
- await getDefaultFormFieldConfig('shared-components');
265
- }
266
- }
267
-
268
- if (!templatesData.tcpaText && templatesData.primary_trade) {
269
- await fetchTcpaFromSitegenie();
270
- }
271
- }
272
-
273
- return new Promise(function(resolve) {
274
- return gulp.src([
275
- siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/**/*.html',
276
- '!' + siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/_partials/**/*.html'
277
- ])
278
- .pipe(gulpPlugins.handlebarsFileInclude(templatesData, {
279
- maxRecursion: siteData.fileIncludeMaxRecursion ? siteData.fileIncludeMaxRecursion : 500,
280
- handlebarsHelpers: handlebarsHelpers
281
- }))
282
- .pipe(gulp.dest(siteSettings.tmpFolder))
283
- .on('finish', function() {
284
- resolve();
285
- });
286
- });
287
- };
288
- };
@@ -1,119 +0,0 @@
1
- /* contains data for qs-footer and quote-footer */
2
- export default function(siteData) {
3
- const { isQSPage } = siteData;
4
-
5
- let trade = '';
6
- if (siteData?.contractor_trade) {
7
- trade = `&trade=${siteData.contractor_trade}`;
8
- } else if (siteData?.primary_trade) {
9
- trade = `&trade=${siteData.primary_trade.replace(/[\s]+|_/g, '-').toLowerCase()}`;
10
- }
11
-
12
- const footerKey = isQSPage ? 'qsFooterData' : 'quoteFooterData';
13
-
14
- const qsLinks = [
15
- {
16
- name: 'About',
17
- url: '/about/',
18
- modal: true,
19
- company: true
20
- },
21
- {
22
- name: 'Privacy Notice',
23
- url: '/privacy/',
24
- modal: true
25
- },
26
- {
27
- name: 'Affiliates',
28
- url: 'https://modernize.com/contact?publisher',
29
- modal: false
30
- },
31
- {
32
- name: 'Terms of Use',
33
- url: '/terms/',
34
- modal: true
35
- },
36
- {
37
- name: 'Contact Us',
38
- url: '/contact-us/',
39
- modal: true
40
- },
41
- {
42
- name: 'California - Do not sell my info',
43
- url: 'https://privacy-central.securiti.ai/#/dsr/983cfd4b-c36a-4601-89e9-b651e5a05708',
44
- modal: false
45
- }
46
- ]
47
-
48
- const quoteLinks = [
49
- {
50
- url: 'about',
51
- text: 'About Us',
52
- modal: true
53
- },
54
- {
55
- url: 'terms',
56
- text: 'Terms of Use',
57
- modal: true
58
- },
59
- {
60
- url: 'privacy',
61
- text: 'Privacy Policy',
62
- modal: true
63
- },
64
- {
65
- url: 'https://modernize.com/contact?publisher',
66
- text: 'I\'m a publisher',
67
- modal: false,
68
- target: '_blank'
69
- }
70
- ]
71
-
72
- const quoteSpecific = {
73
- capchaDisclosure: {
74
- text: 'This site is protected by reCAPTCHA and the Google',
75
- privacy: {
76
- text: 'Privacy Policy',
77
- url: 'https://policies.google.com/privacy'
78
- },
79
- terms: {
80
- text: 'Terms&nbsp;of&nbsp;Service',
81
- url: 'https://policies.google.com/terms'
82
- }
83
- },
84
- privacyLinks: [
85
- {
86
- text: 'California&nbsp;Privacy',
87
- anchor: 'ccpa',
88
- modal: true
89
- },
90
- {
91
- text: 'New&nbsp;York&nbsp;Privacy',
92
- anchor: 'nyna',
93
- modal: true
94
- },
95
- {
96
- text: 'Do&nbsp;Not&nbsp;Sell&nbsp;My&nbsp;Personal&nbsp;Information',
97
- anchor: 'uspi',
98
- modal: true
99
- }
100
- ],
101
- }
102
-
103
- const data = {
104
- [footerKey]: {
105
- links: [
106
- isQSPage ? qsLinks : quoteLinks,
107
- ],
108
- copyright: `${isQSPage ? 'QuinStreet, Inc.' : ''} All&nbsp;Rights&nbsp;Reserved.`,
109
- contractor: {
110
- text: 'Are you a contractor?',
111
- linkText: 'Join Our Contractor Network',
112
- link: 'https://modernize.com/pro/register/leads/?utm_campaign=quinstreet-referral' + trade
113
- },
114
- ...isQSPage ? null : quoteSpecific,
115
- }
116
- }
117
-
118
- return data;
119
- }
@@ -1,60 +0,0 @@
1
- function createScript(asset, location = 'head', env = 'qa.modernize.com') {
2
- const { src, isLocal, localSrc, useModCdn, defer, async } = asset;
3
- const script = document.createElement('script');
4
- script.src = (isLocal ? localSrc : (useModCdn ? `https://${env}/${src}` : src));
5
- script.async = async;
6
- script.defer = defer;
7
- location === 'head' ? document.head.appendChild(script) : document.body.appendChild(script);
8
- }
9
-
10
- function createStyle(asset, location = 'head', env = 'qa.modernize.com') {
11
- const { src, isLocal, localSrc, useModCdn } = asset;
12
- const link = document.createElement('link');
13
- link.rel = 'stylesheet';
14
- link.href = (isLocal ? localSrc : (useModCdn ? `https://${env}/${src}` : src));
15
- location === 'head' ? document.head.appendChild(link) : document.body.appendChild(link);
16
- }
17
-
18
- export const loadAdditionalAssets = (config) => {
19
- const { page, nodeEnv } = config;
20
- const { additionalAssets: headAdditionalAssets } = page.headConfig;
21
- const { additionalAssets: footAdditionalAssets } = page.footAssetsConfig
22
-
23
- if (headAdditionalAssets) {
24
- const { afterBegin, beforeEnd } = headAdditionalAssets;
25
-
26
- if (afterBegin || beforeEnd) {
27
- let additionalHeadAssets = [];
28
- if (afterBegin) {
29
- additionalHeadAssets.push(...afterBegin);
30
- }
31
- if (beforeEnd) {
32
- additionalHeadAssets.push(...beforeEnd);
33
- }
34
-
35
- additionalHeadAssets.forEach((asset) => {
36
- const { type } = asset;
37
- if (type === 'script') {
38
- createScript(asset, 'head', nodeEnv);
39
- }
40
-
41
- if (type === 'style') {
42
- createStyle(asset, 'head', nodeEnv);
43
- }
44
- });
45
- }
46
- }
47
-
48
- if (footAdditionalAssets) {
49
- footAdditionalAssets.forEach((asset) => {
50
- const { type } = asset;
51
- if (type === 'script') {
52
- createScript(asset, 'body', nodeEnv);
53
- }
54
-
55
- if (type === 'style') {
56
- createStyle(asset, 'body', nodeEnv);
57
- }
58
- });
59
- }
60
- }
@@ -1,54 +0,0 @@
1
- export const preventRageClicks = (steps = '.step', swiperEl = '.swiper') => {
2
- const $allButtons = document.querySelectorAll('button');
3
- const $steps = document.querySelectorAll(steps);
4
- const swiper = document.querySelector(swiperEl).swiper;
5
- const $formContainer = document.querySelector('.hero__form-container');
6
-
7
- if ($allButtons && swiper && $steps) {
8
- let isTransitionStart = false;
9
- let clickHandler = (e) => {
10
- e.preventDefault();
11
- e.stopPropagation();
12
- };
13
-
14
- swiper.on('slideChange', () => {
15
- isTransitionStart = true;
16
- if ($formContainer) {
17
- $formContainer.style.overflow = 'hidden';
18
- }
19
-
20
- $allButtons.forEach((button) => {
21
- button.addEventListener('click', clickHandler);
22
- button.disabled = true;
23
- });
24
- });
25
-
26
- swiper.on('slideChangeTransitionEnd', () => {
27
- if ($formContainer) {
28
- $formContainer.style.overflow = 'initial';
29
- }
30
- if (isTransitionStart) {
31
- isTransitionStart = false;
32
-
33
- $allButtons.forEach((button) => {
34
- button.disabled = false;
35
- button.removeEventListener('click', clickHandler);
36
- });
37
-
38
- $steps.forEach((step) => {
39
- step.classList.remove(window.modForm.opts.stepActiveCls);
40
- });
41
-
42
- document
43
- .querySelector(`${steps}.swiper-slide-active`)
44
- .classList.add(window.modForm.opts.stepActiveCls);
45
-
46
- document
47
- .querySelector(`${steps}.step[aria-hidden="false"]`)
48
- .focus({ preventScroll: true });
49
-
50
- swiper.update();
51
- }
52
- });
53
- }
54
- };
@@ -1,28 +0,0 @@
1
- export const showUtilityProviders = (utilityProviders, skipStep) => {
2
- let oldUtilProviders = '';
3
- const utilityProviderWrapper = document.querySelector('[name="UtilityProvider"]');
4
-
5
- if (JSON.stringify(utilityProviders) === JSON.stringify(oldUtilProviders)) {
6
- return;
7
- }
8
-
9
- utilityProviderWrapper.innerHTML = '';
10
- oldUtilProviders = utilityProviders;
11
-
12
- const defaultOption = document.createElement('option');
13
- defaultOption.value = '';
14
- defaultOption.textContent = 'Select an option';
15
- utilityProviderWrapper.appendChild(defaultOption);
16
-
17
- utilityProviders.forEach(function (utilityProvider, i) {
18
- const utilityProviderName = utilityProvider.name;
19
-
20
- const option = document.createElement('option');
21
- option.textContent = utilityProviderName;
22
- if (i === 0 && skipStep) {
23
- option.selected = true;
24
- }
25
-
26
- utilityProviderWrapper.appendChild(option);
27
- });
28
- };
@@ -1,8 +0,0 @@
1
- // On page load if hash has an ampersand all text after is removed, if there's a hash with only 'q + number' format we replace history without hash
2
- let hash = window.location.hash;
3
- if (hash.indexOf('&') > -1) {
4
- window.location.hash = hash = hash.split('&')[0];
5
- }
6
- if (/^#q\d$/.test(hash)) {
7
- history.replaceState(null, '', window.location.href.split('#')[0]);
8
- }
@@ -1,6 +0,0 @@
1
- var gtm_container_ID = (window.isQSPage && '{{qs_gtm_container_ID}}'.length > 0) ? '{{qs_gtm_container_ID}}' : '{{gtm_container_ID}}';
2
- (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
3
- new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
4
- j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
5
- 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
6
- })(window,document,'script','dataLayer',gtm_container_ID);