thm-p3-configurator 0.0.368 → 0.0.369

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.
@@ -59,24 +59,26 @@ const NavigationSteps = _ref => {
59
59
  selectedBranch
60
60
  }] = (0, _OrderSessionContext.useOrderSession)();
61
61
  const handleClick = _ref2 => {
62
+ var _steps$stepNumber;
62
63
  let {
63
64
  to,
64
65
  title,
65
- stepNumber
66
+ stepNumber: targetStepNumber
66
67
  } = _ref2;
67
- setStepNumber(stepNumber);
68
+ const currentStepTitle = ((_steps$stepNumber = steps[stepNumber]) === null || _steps$stepNumber === void 0 ? void 0 : _steps$stepNumber.title) || title;
68
69
  (0, _Datalayer.pushToDataLayer)({
69
70
  event: 'configurator',
70
- component: title,
71
+ component: currentStepTitle,
71
72
  element: 'progress_bar',
72
73
  action: 'click',
73
- action_value: "".concat(stepNumber + 1, ". ").concat(title),
74
+ action_value: title,
74
75
  link_url: to
75
76
  });
77
+ setStepNumber(targetStepNumber);
76
78
  onClick({
77
79
  to,
78
80
  title,
79
- stepNumber
81
+ stepNumber: targetStepNumber
80
82
  });
81
83
  };
82
84
  const currentType = currentDossierType || existingDossierType || _constants__.DOSSIER_TYPES.PlannedAppointment;
@@ -1,19 +1,23 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.promise.js");
4
+ require("core-js/modules/es.string.trim.js");
4
5
  require("core-js/modules/es.weak-map.js");
5
6
  require("core-js/modules/esnext.iterator.constructor.js");
6
7
  require("core-js/modules/esnext.iterator.every.js");
7
8
  require("core-js/modules/esnext.iterator.filter.js");
8
9
  require("core-js/modules/esnext.iterator.find.js");
10
+ require("core-js/modules/esnext.iterator.for-each.js");
9
11
  require("core-js/modules/esnext.iterator.map.js");
10
12
  require("core-js/modules/web.dom-collections.iterator.js");
11
13
  require("core-js/modules/es.weak-map.js");
14
+ require("core-js/modules/esnext.iterator.for-each.js");
12
15
  Object.defineProperty(exports, "__esModule", {
13
16
  value: true
14
17
  });
15
18
  exports.default = void 0;
16
19
  require("core-js/modules/es.promise.js");
20
+ require("core-js/modules/es.string.trim.js");
17
21
  require("core-js/modules/esnext.iterator.constructor.js");
18
22
  require("core-js/modules/esnext.iterator.every.js");
19
23
  require("core-js/modules/esnext.iterator.filter.js");
@@ -60,6 +64,49 @@ function _interopRequireWildcard(e, r) {
60
64
  }
61
65
  return n.default = e, t && t.set(e, n), n;
62
66
  }
67
+ function ownKeys(e, r) {
68
+ var t = Object.keys(e);
69
+ if (Object.getOwnPropertySymbols) {
70
+ var o = Object.getOwnPropertySymbols(e);
71
+ r && (o = o.filter(function (r) {
72
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
73
+ })), t.push.apply(t, o);
74
+ }
75
+ return t;
76
+ }
77
+ function _objectSpread(e) {
78
+ for (var r = 1; r < arguments.length; r++) {
79
+ var t = null != arguments[r] ? arguments[r] : {};
80
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
81
+ _defineProperty(e, r, t[r]);
82
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
83
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
84
+ });
85
+ }
86
+ return e;
87
+ }
88
+ function _defineProperty(e, r, t) {
89
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
90
+ value: t,
91
+ enumerable: !0,
92
+ configurable: !0,
93
+ writable: !0
94
+ }) : e[r] = t, e;
95
+ }
96
+ function _toPropertyKey(t) {
97
+ var i = _toPrimitive(t, "string");
98
+ return "symbol" == typeof i ? i : i + "";
99
+ }
100
+ function _toPrimitive(t, r) {
101
+ if ("object" != typeof t || !t) return t;
102
+ var e = t[Symbol.toPrimitive];
103
+ if (void 0 !== e) {
104
+ var i = e.call(t, r || "default");
105
+ if ("object" != typeof i) return i;
106
+ throw new TypeError("@@toPrimitive must return a primitive value.");
107
+ }
108
+ return ("string" === r ? String : Number)(t);
109
+ }
63
110
  const ProductImage = _ref => {
64
111
  let {
65
112
  productImage
@@ -87,7 +134,8 @@ const ProductActions = _ref2 => {
87
134
  showPartStockLevel,
88
135
  setShowPartStockLevel,
89
136
  productPriceInclVat,
90
- isWebshop = false
137
+ isWebshop = false,
138
+ isLoadingPartStockLevel = false
91
139
  } = _ref2;
92
140
  return /*#__PURE__*/_react.default.createElement("div", {
93
141
  className: (0, _helpers__.withStyle)('d-flex justify-content-end')
@@ -102,11 +150,12 @@ const ProductActions = _ref2 => {
102
150
  }, isTmg ? "".concat(stockQuantity, " op voorraad") : 'Op voorraad')), /*#__PURE__*/_react.default.createElement("div", {
103
151
  className: (0, _helpers__.withStyle)('d-flex align-items-center')
104
152
  }, !isWebshop && /*#__PURE__*/_react.default.createElement(_OutlinedButton.default, {
153
+ className: showPartStockLevel ? 'active' : '',
105
154
  style: {
106
155
  marginRight: '1rem'
107
156
  },
108
157
  onClick: () => setShowPartStockLevel(!showPartStockLevel),
109
- label: "Voorkeurs voorraad"
158
+ label: isLoadingPartStockLevel ? 'Voorkeurs voorraad laden...' : showPartStockLevel ? 'Verberg voorkeurs voorraad' : 'Voorkeurs voorraad'
110
159
  }), /*#__PURE__*/_react.default.createElement(_NumericInput.default, {
111
160
  className: (0, _helpers__.withStyle)('me-2 rounded'),
112
161
  width: "100px",
@@ -129,6 +178,7 @@ const ProductCategories = _ref3 => {
129
178
  preferredPart = null,
130
179
  partStockLevels = null,
131
180
  showPartStockLevel = false,
181
+ isLoadingPartStockLevel = false,
132
182
  brandName = null,
133
183
  isWebshop = false
134
184
  } = _ref3;
@@ -140,7 +190,11 @@ const ProductCategories = _ref3 => {
140
190
  className: (0, _helpers__.withStyle)('fst-italic mb-0')
141
191
  }, /*#__PURE__*/_react.default.createElement("strong", null, "Groep:"), " ", productSubgroup), preferredPart && /*#__PURE__*/_react.default.createElement("p", {
142
192
  className: (0, _helpers__.withStyle)('fst-italic mb-0')
143
- }, /*#__PURE__*/_react.default.createElement("strong", null, "Voorkeur:"), " ", preferredPart.preferredPart), !isWebshop && showPartStockLevel && (partStockLevels === null || partStockLevels === void 0 ? void 0 : partStockLevels.status) && /*#__PURE__*/_react.default.createElement("p", {
193
+ }, /*#__PURE__*/_react.default.createElement("strong", null, "Voorkeur:"), " ", preferredPart.preferredPart), !isWebshop && showPartStockLevel && isLoadingPartStockLevel && /*#__PURE__*/_react.default.createElement("p", {
194
+ className: (0, _helpers__.withStyle)('fst-italic mb-0')
195
+ }, /*#__PURE__*/_react.default.createElement("small", null, "Voorkeurs voorraad laden...")), !isWebshop && showPartStockLevel && !isLoadingPartStockLevel && !(partStockLevels !== null && partStockLevels !== void 0 && partStockLevels.status) && /*#__PURE__*/_react.default.createElement("p", {
196
+ className: (0, _helpers__.withStyle)('fst-italic mb-0')
197
+ }, /*#__PURE__*/_react.default.createElement("small", null, "Geen voorkeurs voorraad gevonden")), !isWebshop && showPartStockLevel && !isLoadingPartStockLevel && (partStockLevels === null || partStockLevels === void 0 ? void 0 : partStockLevels.status) && /*#__PURE__*/_react.default.createElement("p", {
144
198
  className: (0, _helpers__.withStyle)('fst-italic mb-0')
145
199
  }, /*#__PURE__*/_react.default.createElement("small", {
146
200
  className: (0, _helpers__.withStyle)(partStockLevels.status === _constants__.StockStatus.OutOfStock ? 'text-danger' : partStockLevels.status === _constants__.StockStatus.InsufficientStock ? 'text-warning' : 'text-success')
@@ -177,18 +231,45 @@ const SingleOrderProductCard = _ref4 => {
177
231
  productFieldLabels
178
232
  } = (0, _queries.useProductFieldLabels)();
179
233
  const [preferredPart, setPreferredPart] = (0, _react.useState)(null);
180
- const [partStockLevels, setPartStockLevels] = (0, _react.useState)([]);
234
+ const [partStockLevels, setPartStockLevels] = (0, _react.useState)(null);
181
235
  const [showPartStockLevel, setShowPartStockLevel] = (0, _react.useState)(false);
236
+ const [isLoadingPartStockLevel, setIsLoadingPartStockLevel] = (0, _react.useState)(false);
237
+ const findPreferredPart = () => {
238
+ var _parts$find;
239
+ return (_parts$find = parts.find(part => part.isPreferred === true)) !== null && _parts$find !== void 0 ? _parts$find : parts.length === 1 ? parts[0] : null;
240
+ };
241
+ const getPreferredPartDisplayArticleNumber = part => {
242
+ var _part$preferredPart$s;
243
+ return typeof (part === null || part === void 0 ? void 0 : part.preferredPart) === 'string' ? (_part$preferredPart$s = part.preferredPart.split('|')[0]) === null || _part$preferredPart$s === void 0 ? void 0 : _part$preferredPart$s.trim() : null;
244
+ };
245
+ const getPreferredPartNumber = part => {
246
+ var _ref5, _ref6, _ref7, _part$articleNumber;
247
+ return (_ref5 = (_ref6 = (_ref7 = (_part$articleNumber = part === null || part === void 0 ? void 0 : part.articleNumber) !== null && _part$articleNumber !== void 0 ? _part$articleNumber : part === null || part === void 0 ? void 0 : part.partArticleNumber) !== null && _ref7 !== void 0 ? _ref7 : part === null || part === void 0 ? void 0 : part.preferredPartNumber) !== null && _ref6 !== void 0 ? _ref6 : part === null || part === void 0 ? void 0 : part.partNumber) !== null && _ref5 !== void 0 ? _ref5 : getPreferredPartDisplayArticleNumber(part);
248
+ };
249
+ const getPreferredPartBrandNumber = part => {
250
+ var _ref8, _ref9, _ref10, _ref11, _part$articleBrandNum;
251
+ return (_ref8 = (_ref9 = (_ref10 = (_ref11 = (_part$articleBrandNum = part === null || part === void 0 ? void 0 : part.articleBrandNumber) !== null && _part$articleBrandNum !== void 0 ? _part$articleBrandNum : part === null || part === void 0 ? void 0 : part.partArticleBrandNumber) !== null && _ref11 !== void 0 ? _ref11 : part === null || part === void 0 ? void 0 : part.preferredPartBrandNumber) !== null && _ref10 !== void 0 ? _ref10 : part === null || part === void 0 ? void 0 : part.partBrandNumber) !== null && _ref9 !== void 0 ? _ref9 : part === null || part === void 0 ? void 0 : part.brandNumber) !== null && _ref8 !== void 0 ? _ref8 : part === null || part === void 0 ? void 0 : part.partBrandId;
252
+ };
182
253
  (0, _react.useEffect)(() => {
183
254
  if (showPartStockLevel) {
184
255
  const fetchStockLevels = async () => {
185
- const preferredPart = parts.find(part => part.isPreferred === true);
186
- if (preferredPart) {
187
- const partStockLevel = await (0, _singleOrderArticles.fetchPartStockLevels)({
188
- partNumber: preferredPart.partNumber,
189
- brandNumber: preferredPart.partBrandId
190
- }, branchId, !isTmg ? formula : null);
191
- setPartStockLevels(partStockLevel);
256
+ const preferredPart = findPreferredPart();
257
+ const preferredPartNumber = getPreferredPartNumber(preferredPart);
258
+ const preferredBrandNumber = getPreferredPartBrandNumber(preferredPart);
259
+ if (preferredPartNumber) {
260
+ setIsLoadingPartStockLevel(true);
261
+ try {
262
+ const partStockLevel = await (0, _singleOrderArticles.fetchPartStockLevels)(_objectSpread({
263
+ partNumber: preferredPartNumber
264
+ }, preferredBrandNumber ? {
265
+ brandNumber: preferredBrandNumber
266
+ } : {}), branchId, !isTmg ? formula : null);
267
+ setPartStockLevels(partStockLevel);
268
+ } catch (_unused) {
269
+ setPartStockLevels(null);
270
+ } finally {
271
+ setIsLoadingPartStockLevel(false);
272
+ }
192
273
  }
193
274
  };
194
275
  fetchStockLevels();
@@ -196,23 +277,23 @@ const SingleOrderProductCard = _ref4 => {
196
277
  }, [showPartStockLevel, parts, branchId, isTmg, formula]);
197
278
  (0, _react.useEffect)(() => {
198
279
  if (parts && parts.length > 0) {
199
- const preferred = parts.find(part => part.isPreferred === true);
280
+ const preferred = findPreferredPart();
200
281
  if (preferred) {
201
282
  setPreferredPart(preferred);
202
283
  }
203
284
  }
204
285
  }, [parts]);
205
- const filteredProductSpecifications = productSpecifications.filter(_ref5 => {
286
+ const filteredProductSpecifications = productSpecifications.filter(_ref12 => {
206
287
  let {
207
288
  key,
208
289
  value
209
- } = _ref5;
290
+ } = _ref12;
210
291
  return (productFieldLabels === null || productFieldLabels === void 0 ? void 0 : productFieldLabels[key]) && (value !== 'kg' || key !== 'weight');
211
- }).map(_ref6 => {
292
+ }).map(_ref13 => {
212
293
  let {
213
294
  key,
214
295
  value
215
- } = _ref6;
296
+ } = _ref13;
216
297
  return {
217
298
  key: productFieldLabels[key],
218
299
  value
@@ -242,6 +323,7 @@ const SingleOrderProductCard = _ref4 => {
242
323
  preferredPart: preferredPart,
243
324
  partStockLevels: partStockLevels,
244
325
  showPartStockLevel: showPartStockLevel,
326
+ isLoadingPartStockLevel: isLoadingPartStockLevel,
245
327
  isWebshop: isWebshop
246
328
  }), (filteredProductSpecifications === null || filteredProductSpecifications === void 0 ? void 0 : filteredProductSpecifications.length) > 0 && /*#__PURE__*/_react.default.createElement(_ProductCardSpecifications.default, {
247
329
  specifications: filteredProductSpecifications,
@@ -263,7 +345,8 @@ const SingleOrderProductCard = _ref4 => {
263
345
  removeFromCart: removeFromCart,
264
346
  productPrice: productPrice,
265
347
  productPriceInclVat: productPriceInclVat,
266
- isWebshop: isWebshop
348
+ isWebshop: isWebshop,
349
+ isLoadingPartStockLevel: isLoadingPartStockLevel
267
350
  })))));
268
351
  };
269
352
  var _default = exports.default = SingleOrderProductCard;
@@ -238,6 +238,10 @@ const AppointmentForm = () => {
238
238
  action: 'submit',
239
239
  action_value: 'valid'
240
240
  });
241
+ (0, _Datalayer.pushToDataLayer)({
242
+ event: 'form_submit',
243
+ form_name: 'config_afspraak'
244
+ });
241
245
  } catch (ex) {
242
246
  (0, _Datalayer.pushToDataLayer)({
243
247
  event: 'form',
@@ -328,12 +332,22 @@ const AppointmentForm = () => {
328
332
  placeholder: "",
329
333
  initialValue: customer.infix,
330
334
  name: "infix",
331
- onChange: value => dispatch({
332
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
333
- payload: {
334
- infix: value
335
- }
336
- }),
335
+ onFocus: () => trackFormField('tussenvoegsel', 'focus'),
336
+ onChange: value => {
337
+ trackInput({
338
+ event: 'form',
339
+ component: 'afspraak',
340
+ element: 'text_field',
341
+ field: 'tussenvoegsel',
342
+ action: 'input'
343
+ });
344
+ dispatch({
345
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
346
+ payload: {
347
+ infix: value
348
+ }
349
+ });
350
+ },
337
351
  isRequired: false,
338
352
  form: "appointment",
339
353
  label: "Tussenvoegsel:",
@@ -342,12 +356,22 @@ const AppointmentForm = () => {
342
356
  placeholder: "",
343
357
  initialValue: customer.lastName,
344
358
  name: "lastName",
345
- onChange: value => dispatch({
346
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
347
- payload: {
348
- lastName: value
349
- }
350
- }),
359
+ onFocus: () => trackFormField('achternaam', 'focus'),
360
+ onChange: value => {
361
+ trackInput({
362
+ event: 'form',
363
+ component: 'afspraak',
364
+ element: 'text_field',
365
+ field: 'achternaam',
366
+ action: 'input'
367
+ });
368
+ dispatch({
369
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
370
+ payload: {
371
+ lastName: value
372
+ }
373
+ });
374
+ },
351
375
  isRequired: true,
352
376
  form: "appointment",
353
377
  label: "Achternaam:",
@@ -380,12 +404,22 @@ const AppointmentForm = () => {
380
404
  placeholder: "",
381
405
  initialValue: customer.phoneNumber,
382
406
  name: "phoneNumber",
383
- onChange: value => dispatch({
384
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
385
- payload: {
386
- phoneNumber: value
387
- }
388
- }),
407
+ onFocus: () => trackFormField('telefoonnummer', 'focus'),
408
+ onChange: value => {
409
+ trackInput({
410
+ event: 'form',
411
+ component: 'afspraak',
412
+ element: 'text_field',
413
+ field: 'telefoonnummer',
414
+ action: 'input'
415
+ });
416
+ dispatch({
417
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
418
+ payload: {
419
+ phoneNumber: value
420
+ }
421
+ });
422
+ },
389
423
  isRequired: true,
390
424
  form: "appointment",
391
425
  label: "Telefoonnummer:",
@@ -400,12 +434,22 @@ const AppointmentForm = () => {
400
434
  placeholder: "",
401
435
  initialValue: customer.companyName,
402
436
  name: "companyName",
403
- onChange: value => dispatch({
404
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
405
- payload: {
406
- companyName: value
407
- }
408
- }),
437
+ onFocus: () => trackFormField('bedrijfsnaam', 'focus'),
438
+ onChange: value => {
439
+ trackInput({
440
+ event: 'form',
441
+ component: 'afspraak',
442
+ element: 'text_field',
443
+ field: 'bedrijfsnaam',
444
+ action: 'input'
445
+ });
446
+ dispatch({
447
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
448
+ payload: {
449
+ companyName: value
450
+ }
451
+ });
452
+ },
409
453
  isRequired: true,
410
454
  form: "appointment",
411
455
  label: "Bedrijfsnaam:",
@@ -414,12 +458,21 @@ const AppointmentForm = () => {
414
458
  placeholder: "",
415
459
  initialValue: "",
416
460
  name: "note",
417
- onChange: value => dispatch({
418
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
419
- payload: {
420
- note: value
421
- }
422
- }),
461
+ onChange: value => {
462
+ trackInput({
463
+ event: 'form',
464
+ component: 'afspraak',
465
+ element: 'text_field',
466
+ field: 'opmerkingen',
467
+ action: 'input'
468
+ });
469
+ dispatch({
470
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
471
+ payload: {
472
+ note: value
473
+ }
474
+ });
475
+ },
423
476
  isRequired: false,
424
477
  form: "appointment",
425
478
  label: "Eventuele vragen of opmerkingen:",
@@ -433,8 +486,9 @@ const AppointmentForm = () => {
433
486
  event: 'form',
434
487
  component: 'afspraak',
435
488
  element: 'checkbox',
489
+ field: 'algemene voorwaarden',
436
490
  action: value ? 'on' : 'off',
437
- action_value: 'Ik ga akkoord met de algemene voorwaarden'
491
+ action_value: String(value)
438
492
  });
439
493
  setIsTermsAccepted(value);
440
494
  },
@@ -114,6 +114,7 @@ const exitIntentFormSchema = (0, _yup.object)({
114
114
  email: (0, _yup.string)().email(_constants__.FORM_ERROR_MESSAGES.email).required(_constants__.FORM_ERROR_MESSAGES.required),
115
115
  phoneNumber: (0, _yup.string)().required(_constants__.FORM_ERROR_MESSAGES.required)
116
116
  });
117
+ const INPUT_DEBOUNCE_MS = 500;
117
118
  const ExitIntentModal = () => {
118
119
  const {
119
120
  createQuotation,
@@ -123,6 +124,11 @@ const ExitIntentModal = () => {
123
124
  const [isOpen, setIsOpen] = (0, _react.useState)(false);
124
125
  const [errors, setErrors] = (0, _react.useState)(null);
125
126
  const hasTrackedOpenRef = (0, _react.useRef)(false);
127
+ const hasTrackedValidSubmitRef = (0, _react.useRef)(false);
128
+ const inputDebounceRefs = (0, _react.useRef)({
129
+ email: null,
130
+ phoneNumber: null
131
+ });
126
132
  const [{
127
133
  customer,
128
134
  licensePlate,
@@ -241,6 +247,13 @@ const ExitIntentModal = () => {
241
247
  action: 'submit',
242
248
  action_value: 'valid'
243
249
  });
250
+ if (!hasTrackedValidSubmitRef.current) {
251
+ hasTrackedValidSubmitRef.current = true;
252
+ (0, _Datalayer.pushToDataLayer)({
253
+ event: 'form_submit',
254
+ form_name: 'config_exitintent'
255
+ });
256
+ }
244
257
  } catch (ex) {
245
258
  (0, _Datalayer.pushToDataLayer)({
246
259
  event: 'form',
@@ -271,6 +284,8 @@ const ExitIntentModal = () => {
271
284
  return () => {
272
285
  document.body.removeEventListener('mousemove', throttledHandleMouseLeave);
273
286
  throttledHandleMouseLeave.cancel();
287
+ clearTimeout(inputDebounceRefs.current.email);
288
+ clearTimeout(inputDebounceRefs.current.phoneNumber);
274
289
  };
275
290
  }, [throttledHandleMouseLeave]);
276
291
  if (isCreateQuotationSuccess) {
@@ -298,28 +313,70 @@ const ExitIntentModal = () => {
298
313
  placeholder: "",
299
314
  initialValue: customer.email,
300
315
  name: "email",
301
- onChange: value => dispatch({
302
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_EMAIL,
303
- payload: {
304
- email: value
305
- }
306
- }),
316
+ onFocus: () => {
317
+ (0, _Datalayer.pushToDataLayer)({
318
+ event: 'form',
319
+ component: 'exit_intent',
320
+ element: 'text_field',
321
+ field: 'email',
322
+ action: 'focus'
323
+ });
324
+ },
325
+ onChange: value => {
326
+ dispatch({
327
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_EMAIL,
328
+ payload: {
329
+ email: value
330
+ }
331
+ });
332
+ clearTimeout(inputDebounceRefs.current.email);
333
+ inputDebounceRefs.current.email = setTimeout(() => {
334
+ (0, _Datalayer.pushToDataLayer)({
335
+ event: 'form',
336
+ component: 'exit_intent',
337
+ element: 'text_field',
338
+ field: 'email',
339
+ action: 'input'
340
+ });
341
+ }, INPUT_DEBOUNCE_MS);
342
+ },
307
343
  isRequired: true,
308
- form: "quotation",
344
+ form: "exit_intent",
309
345
  label: "E-mailadres:",
310
346
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['email']
311
347
  }), /*#__PURE__*/_react.default.createElement(_TextInput.default, {
312
348
  placeholder: "",
313
349
  initialValue: customer.phoneNumber,
314
350
  name: "phoneNumber",
315
- onChange: value => dispatch({
316
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
317
- payload: {
318
- phoneNumber: value
319
- }
320
- }),
351
+ onFocus: () => {
352
+ (0, _Datalayer.pushToDataLayer)({
353
+ event: 'form',
354
+ component: 'exit_intent',
355
+ element: 'text_field',
356
+ field: 'phoneNumber',
357
+ action: 'focus'
358
+ });
359
+ },
360
+ onChange: value => {
361
+ dispatch({
362
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
363
+ payload: {
364
+ phoneNumber: value
365
+ }
366
+ });
367
+ clearTimeout(inputDebounceRefs.current.phoneNumber);
368
+ inputDebounceRefs.current.phoneNumber = setTimeout(() => {
369
+ (0, _Datalayer.pushToDataLayer)({
370
+ event: 'form',
371
+ component: 'exit_intent',
372
+ element: 'text_field',
373
+ field: 'phoneNumber',
374
+ action: 'input'
375
+ });
376
+ }, INPUT_DEBOUNCE_MS);
377
+ },
321
378
  isRequired: true,
322
- form: "quotation",
379
+ form: "exit_intent",
323
380
  label: "Telefoonnummer:",
324
381
  errorMessage: errors === null || errors === void 0 ? void 0 : errors['phoneNumber']
325
382
  }), /*#__PURE__*/_react.default.createElement("div", {
@@ -131,6 +131,7 @@ const QuestionsForm = _ref => {
131
131
  executionAnswer2: '',
132
132
  durationAnswer: ''
133
133
  });
134
+ const hasFiredExtraQuestionsStepEventRef = (0, _react.useRef)(false);
134
135
 
135
136
  // Store initial options in state
136
137
  const [initialOptions, setInitialOptions] = (0, _react.useState)({
@@ -400,7 +401,14 @@ const QuestionsForm = _ref => {
400
401
  label: 'Ga terug'
401
402
  })))));
402
403
  }
403
- if (!(durationOptions !== null && durationOptions !== void 0 && durationOptions.length) && !(execution1Options !== null && execution1Options !== void 0 && execution1Options.length) && !(execution2Options !== null && execution2Options !== void 0 && execution2Options.length) && !(execution2AnswerOptions !== null && execution2AnswerOptions !== void 0 && execution2AnswerOptions.length) && !(execution1AnswerOptions !== null && execution1AnswerOptions !== void 0 && execution1AnswerOptions.length) && !(durationQuestion !== null && durationQuestion !== void 0 && durationQuestion.length)) {
404
+ const hasNoQuestions = !(durationOptions !== null && durationOptions !== void 0 && durationOptions.length) && !(execution1Options !== null && execution1Options !== void 0 && execution1Options.length) && !(execution2Options !== null && execution2Options !== void 0 && execution2Options.length) && !(execution2AnswerOptions !== null && execution2AnswerOptions !== void 0 && execution2AnswerOptions.length) && !(execution1AnswerOptions !== null && execution1AnswerOptions !== void 0 && execution1AnswerOptions.length) && !(durationQuestion !== null && durationQuestion !== void 0 && durationQuestion.length);
405
+ if (!APP_CONFIG.internal && !hasNoQuestions && !hasFiredExtraQuestionsStepEventRef.current) {
406
+ hasFiredExtraQuestionsStepEventRef.current = true;
407
+ (0, _Datalayer.pushToDataLayer)({
408
+ event: 'configurator_step_extra_questions'
409
+ });
410
+ }
411
+ if (hasNoQuestions) {
404
412
  if (!isFilter) {
405
413
  return /*#__PURE__*/_react.default.createElement(_reactRouter.Redirect, {
406
414
  to: "/configurator/trekhaakpakket"
@@ -190,6 +190,10 @@ const QuotationForm = () => {
190
190
  action: 'submit',
191
191
  action_value: 'valid'
192
192
  });
193
+ (0, _Datalayer.pushToDataLayer)({
194
+ event: 'form_submit',
195
+ form_name: 'config_offerte'
196
+ });
193
197
  await createQuotation((0, _helpers__.removeNullishProps)({
194
198
  isExitIntent: false,
195
199
  licensePlate,
@@ -316,12 +320,22 @@ const QuotationForm = () => {
316
320
  placeholder: "",
317
321
  initialValue: customer.infix,
318
322
  name: "infix",
319
- onChange: value => dispatch({
320
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
321
- payload: {
322
- infix: value
323
- }
324
- }),
323
+ onFocus: () => trackFormField('tussenvoegsel', 'focus'),
324
+ onChange: value => {
325
+ trackInput({
326
+ event: 'form',
327
+ component: 'offerte',
328
+ element: 'text_field',
329
+ field: 'tussenvoegsel',
330
+ action: 'input'
331
+ });
332
+ dispatch({
333
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_INFIX,
334
+ payload: {
335
+ infix: value
336
+ }
337
+ });
338
+ },
325
339
  isRequired: false,
326
340
  form: "quotation",
327
341
  label: "Tussenvoegsel:",
@@ -330,12 +344,22 @@ const QuotationForm = () => {
330
344
  placeholder: "",
331
345
  initialValue: customer.lastName,
332
346
  name: "lastName",
333
- onChange: value => dispatch({
334
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
335
- payload: {
336
- lastName: value
337
- }
338
- }),
347
+ onFocus: () => trackFormField('achternaam', 'focus'),
348
+ onChange: value => {
349
+ trackInput({
350
+ event: 'form',
351
+ component: 'offerte',
352
+ element: 'text_field',
353
+ field: 'achternaam',
354
+ action: 'input'
355
+ });
356
+ dispatch({
357
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_LAST_NAME,
358
+ payload: {
359
+ lastName: value
360
+ }
361
+ });
362
+ },
339
363
  isRequired: true,
340
364
  form: "quotation",
341
365
  label: "Achternaam:",
@@ -368,12 +392,22 @@ const QuotationForm = () => {
368
392
  placeholder: "",
369
393
  initialValue: customer.phoneNumber,
370
394
  name: "phoneNumber",
371
- onChange: value => dispatch({
372
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
373
- payload: {
374
- phoneNumber: value
375
- }
376
- }),
395
+ onFocus: () => trackFormField('telefoonnummer', 'focus'),
396
+ onChange: value => {
397
+ trackInput({
398
+ event: 'form',
399
+ component: 'offerte',
400
+ element: 'text_field',
401
+ field: 'telefoonnummer',
402
+ action: 'input'
403
+ });
404
+ dispatch({
405
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_PHONE_NUMBER,
406
+ payload: {
407
+ phoneNumber: value
408
+ }
409
+ });
410
+ },
377
411
  isRequired: true,
378
412
  form: "quotation",
379
413
  label: "Telefoonnummer:",
@@ -388,12 +422,22 @@ const QuotationForm = () => {
388
422
  placeholder: "",
389
423
  initialValue: customer.companyName,
390
424
  name: "companyName",
391
- onChange: value => dispatch({
392
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
393
- payload: {
394
- companyName: value
395
- }
396
- }),
425
+ onFocus: () => trackFormField('bedrijfsnaam', 'focus'),
426
+ onChange: value => {
427
+ trackInput({
428
+ event: 'form',
429
+ component: 'offerte',
430
+ element: 'text_field',
431
+ field: 'bedrijfsnaam',
432
+ action: 'input'
433
+ });
434
+ dispatch({
435
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_COMPANY_NAME,
436
+ payload: {
437
+ companyName: value
438
+ }
439
+ });
440
+ },
397
441
  isRequired: true,
398
442
  form: "quotation",
399
443
  label: "Bedrijfsnaam:",
@@ -402,12 +446,21 @@ const QuotationForm = () => {
402
446
  placeholder: "",
403
447
  initialValue: customer.note,
404
448
  name: "note",
405
- onChange: value => dispatch({
406
- type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
407
- payload: {
408
- note: value
409
- }
410
- }),
449
+ onChange: value => {
450
+ trackInput({
451
+ event: 'form',
452
+ component: 'offerte',
453
+ element: 'text_field',
454
+ field: 'opmerkingen',
455
+ action: 'input'
456
+ });
457
+ dispatch({
458
+ type: _OrderSessionContext.orderSessionActions.SET_CUSTOMER_NOTE,
459
+ payload: {
460
+ note: value
461
+ }
462
+ });
463
+ },
411
464
  isRequired: false,
412
465
  form: "quotation",
413
466
  label: "Eventuele vragen of opmerkingen:",
@@ -421,8 +474,9 @@ const QuotationForm = () => {
421
474
  event: 'form',
422
475
  component: 'offerte',
423
476
  element: 'checkbox',
477
+ field: 'algemene voorwaarden',
424
478
  action: value ? 'on' : 'off',
425
- action_value: 'Ik ga akkoord met de algemene voorwaarden'
479
+ action_value: String(value)
426
480
  });
427
481
  setIsTermsAccepted(value);
428
482
  },
@@ -212,6 +212,7 @@ const SingleOrderModalContent = _ref6 => {
212
212
  isLoadingSingleOrderBranches
213
213
  } = (0, _queries.useSingleOrderBranchesQuery)({
214
214
  branchTypeId: formula === _constants__.CONFIGURATOR_FORMULAS.TMG ? singleOrderBranchType : _constants__.VESTIGING_TYPE_ID,
215
+ formula: (0, _constants__.getConfiguratorFormulaCode)(formula),
215
216
  limit: 500,
216
217
  offset: 0
217
218
  });
@@ -1357,7 +1357,10 @@ const initializeOrderSession = function initializeOrderSession() {
1357
1357
  }
1358
1358
  return cachedSession;
1359
1359
  };
1360
- const AuthSessionRuntimeSync = () => {
1360
+ const AuthSessionRuntimeSync = _ref => {
1361
+ let {
1362
+ authMode = 'internal'
1363
+ } = _ref;
1361
1364
  const {
1362
1365
  authenticated,
1363
1366
  initialized,
@@ -1370,25 +1373,26 @@ const AuthSessionRuntimeSync = () => {
1370
1373
  const formula = (0, _FormulaContext.useFormula)();
1371
1374
  const lastSyncedContextRef = (0, _react.useRef)(null);
1372
1375
  const authRuntime = (0, _AuthRuntimeContext.useAuthRuntime)();
1376
+ const isExternalAuthMode = authMode === 'external';
1373
1377
  (0, _react.useLayoutEffect)(() => {
1374
- var _ref;
1378
+ var _ref2;
1375
1379
  if (!APP_CONFIG.internal || !initialized) {
1376
1380
  if (APP_CONFIG.internal) {
1377
1381
  authRuntime.setSessionContextReady(false);
1378
1382
  }
1379
1383
  return;
1380
1384
  }
1381
- authRuntime.setActiveBranchId((_ref = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref !== void 0 ? _ref : null);
1385
+ authRuntime.setActiveBranchId((_ref2 = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref2 !== void 0 ? _ref2 : null);
1382
1386
  }, [authRuntime, initialized, selectedBranch, branch]);
1383
1387
  (0, _react.useEffect)(() => {
1384
- var _ref2;
1388
+ var _ref3;
1385
1389
  if (!APP_CONFIG.internal || !initialized) {
1386
1390
  if (APP_CONFIG.internal) {
1387
1391
  authRuntime.setSessionContextReady(false);
1388
1392
  }
1389
1393
  return;
1390
1394
  }
1391
- const branchId = (_ref2 = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref2 !== void 0 ? _ref2 : null;
1395
+ const branchId = (_ref3 = selectedBranch !== null && selectedBranch !== void 0 ? selectedBranch : branch === null || branch === void 0 ? void 0 : branch.entityId) !== null && _ref3 !== void 0 ? _ref3 : null;
1392
1396
  if (!authenticated || !branchId || !formula) {
1393
1397
  lastSyncedContextRef.current = null;
1394
1398
  authRuntime.setSessionContextReady(false);
@@ -1404,6 +1408,11 @@ const AuthSessionRuntimeSync = () => {
1404
1408
  authRuntime.setSessionContextReady(true);
1405
1409
  return;
1406
1410
  }
1411
+ if (isExternalAuthMode) {
1412
+ lastSyncedContextRef.current = nextContextKey;
1413
+ authRuntime.setSessionContextReady(true);
1414
+ return;
1415
+ }
1407
1416
  let isCancelled = false;
1408
1417
  authRuntime.setSessionContextReady(false);
1409
1418
  _authenticatedProxyApi.authenticatedProxyApi.putSessionContext({
@@ -1422,16 +1431,16 @@ const AuthSessionRuntimeSync = () => {
1422
1431
  return () => {
1423
1432
  isCancelled = true;
1424
1433
  };
1425
- }, [authRuntime, authenticated, initialized, selectedBranch, branch, formula, module]);
1434
+ }, [authRuntime, authenticated, initialized, selectedBranch, branch, formula, module, isExternalAuthMode]);
1426
1435
  return null;
1427
1436
  };
1428
- const OrderSessionController = _ref3 => {
1437
+ const OrderSessionController = _ref4 => {
1429
1438
  let {
1430
1439
  children,
1431
1440
  authMode = 'internal',
1432
1441
  externalAuthSession = null,
1433
1442
  externalAuthRuntime = null
1434
- } = _ref3;
1443
+ } = _ref4;
1435
1444
  const isSingleOrderPage = (0, _useIsSingleOrder.default)();
1436
1445
  const isExternalAuthMode = authMode === 'external' || Boolean(externalAuthSession);
1437
1446
  const runtimeMode = isExternalAuthMode ? 'external' : 'internal';
@@ -1451,7 +1460,9 @@ const OrderSessionController = _ref3 => {
1451
1460
  }, /*#__PURE__*/_react.default.createElement(_AuthSessionContext.AuthSessionProvider, {
1452
1461
  authMode: runtimeMode,
1453
1462
  externalAuthSession: externalAuthSession
1454
- }, /*#__PURE__*/_react.default.createElement(AuthSessionRuntimeSync, null), children)));
1463
+ }, /*#__PURE__*/_react.default.createElement(AuthSessionRuntimeSync, {
1464
+ authMode: runtimeMode
1465
+ }), children)));
1455
1466
  };
1456
1467
  exports.OrderSessionController = OrderSessionController;
1457
1468
  const useOrderSession = () => {
@@ -232,7 +232,7 @@ const fetchArticlesByArticleNumbers = exports.fetchArticlesByArticleNumbers = as
232
232
  * @param {Object} parts - The parts
233
233
  */
234
234
  const fetchPartStockLevels = exports.fetchPartStockLevels = async function fetchPartStockLevels(part, branchId) {
235
- var _response$data$data;
235
+ var _response$data$data$c, _response$data$data, _response$data$data2;
236
236
  let formula = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
237
237
  const partParamsString = new URLSearchParams((0, _index.removeNullishProps)(_objectSpread(_objectSpread({
238
238
  branchId
@@ -247,7 +247,7 @@ const fetchPartStockLevels = exports.fetchPartStockLevels = async function fetch
247
247
  if (!(response !== null && response !== void 0 && response.data)) {
248
248
  throw new Error('No response from the API');
249
249
  }
250
- const stockLevel = (_response$data$data = response.data.data) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data.consumerPrices) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data[0]) === null || _response$data$data === void 0 ? void 0 : _response$data$data.stock;
250
+ const stockLevel = (_response$data$data$c = (_response$data$data = response.data.data) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data.consumerPrices) === null || _response$data$data === void 0 || (_response$data$data = _response$data$data[0]) === null || _response$data$data === void 0 ? void 0 : _response$data$data.stock) !== null && _response$data$data$c !== void 0 ? _response$data$data$c : (_response$data$data2 = response.data.data) === null || _response$data$data2 === void 0 || (_response$data$data2 = _response$data$data2.locationPrices) === null || _response$data$data2 === void 0 || (_response$data$data2 = _response$data$data2[0]) === null || _response$data$data2 === void 0 ? void 0 : _response$data$data2.stock;
251
251
  if (stockLevel) {
252
252
  return _objectSpread(_objectSpread({}, stockLevel), {}, {
253
253
  status: mapApiStockStatusToStockStatus(stockLevel.status)
@@ -271,11 +271,6 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
271
271
  let brandRecords = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
272
272
  return (_brandRecords$find = brandRecords.find(brand => brand.entityId === article.entityId)) !== null && _brandRecords$find !== void 0 ? _brandRecords$find : brandRecords.find(brand => brand.articleNumber === article.articleNumber);
273
273
  };
274
- const findPreferredPricePart = article => {
275
- var _parts$find;
276
- const parts = Array.isArray(article === null || article === void 0 ? void 0 : article.parts) ? article.parts : [];
277
- return (_parts$find = parts.find(part => (part === null || part === void 0 ? void 0 : part.isPreferred) === true)) !== null && _parts$find !== void 0 ? _parts$find : parts.length === 1 ? parts[0] : null;
278
- };
279
274
  const articleNumbers = [...new Set(articles.map(article => article.articleNumber))];
280
275
  const articleBrandQueryString = new URLSearchParams({
281
276
  articleNumbers: JSON.stringify(articleNumbers)
@@ -286,14 +281,12 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
286
281
  throw new Error('Failed to fetch the brands of the articles');
287
282
  }
288
283
  const articlesWithBrands = articles.map(article => {
289
- var _preferredPricePart$p, _ref3, _ref4, _preferredPricePart$p2, _ref5, _brandData$brandNumbe;
284
+ var _brandData$brandNumbe;
290
285
  const brandData = findBrandDataForArticle(article, brandResponse.data);
291
- const preferredPricePart = findPreferredPricePart(article);
292
- const pricingPartNumber = (_preferredPricePart$p = preferredPricePart === null || preferredPricePart === void 0 ? void 0 : preferredPricePart.partNumber) !== null && _preferredPricePart$p !== void 0 ? _preferredPricePart$p : article.articleNumber;
293
- const resolvedBrandNumber = preferredPricePart ? (_ref3 = (_ref4 = (_preferredPricePart$p2 = preferredPricePart === null || preferredPricePart === void 0 ? void 0 : preferredPricePart.partBrandId) !== null && _preferredPricePart$p2 !== void 0 ? _preferredPricePart$p2 : brandData === null || brandData === void 0 ? void 0 : brandData.preferredPartBrandNumber) !== null && _ref4 !== void 0 ? _ref4 : brandData === null || brandData === void 0 ? void 0 : brandData.brandNumber) !== null && _ref3 !== void 0 ? _ref3 : _index2.DEFAULT_ARTICLE_BRAND : (_ref5 = (_brandData$brandNumbe = brandData === null || brandData === void 0 ? void 0 : brandData.brandNumber) !== null && _brandData$brandNumbe !== void 0 ? _brandData$brandNumbe : brandData === null || brandData === void 0 ? void 0 : brandData.preferredPartBrandNumber) !== null && _ref5 !== void 0 ? _ref5 : _index2.DEFAULT_ARTICLE_BRAND;
286
+ const resolvedBrandNumber = (_brandData$brandNumbe = brandData === null || brandData === void 0 ? void 0 : brandData.brandNumber) !== null && _brandData$brandNumbe !== void 0 ? _brandData$brandNumbe : _index2.DEFAULT_ARTICLE_BRAND;
294
287
  return _objectSpread(_objectSpread({}, article), {}, {
295
288
  brand: resolvedBrandNumber,
296
- pricingPartNumber
289
+ pricingPartNumber: article.articleNumber
297
290
  });
298
291
  }).filter(article => article.brand && article.pricingPartNumber);
299
292
  const parts = [...new Map(articlesWithBrands.map(article => {
@@ -318,11 +311,11 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
318
311
  consumer: Object.fromEntries(consumerPrices.map(price => [price.partNumber, price])),
319
312
  location: Object.fromEntries(locationPrices.map(price => [price.partNumber, price]))
320
313
  };
321
- let currentArticles = articlesWithBrands.map(_ref6 => {
314
+ let currentArticles = articlesWithBrands.map(_ref3 => {
322
315
  let {
323
316
  pricingPartNumber
324
- } = _ref6,
325
- article = _objectWithoutProperties(_ref6, _excluded);
317
+ } = _ref3,
318
+ article = _objectWithoutProperties(_ref3, _excluded);
326
319
  return _objectSpread(_objectSpread({}, article), {}, {
327
320
  consumerPrices: pricesMap.consumer[pricingPartNumber],
328
321
  locationPrices: pricesMap.location[pricingPartNumber]
@@ -331,10 +324,10 @@ const enrichArticlesWithBrandsAndPrices = exports.enrichArticlesWithBrandsAndPri
331
324
  return currentArticles;
332
325
  };
333
326
  const formatModelArticle = article => {
334
- var _ref7, _article$name, _ref8, _article$description$, _article$description, _article$boldDescript, _article$boldDescript2, _article$specificatio, _article$images, _article$images2, _article$articleNumbe;
327
+ var _ref4, _article$name, _ref5, _article$description$, _article$description, _article$boldDescript, _article$boldDescript2, _article$specificatio, _article$images, _article$images2, _article$articleNumbe;
335
328
  return _objectSpread(_objectSpread({}, article), {}, {
336
- name: (_ref7 = (_article$name = article.name) !== null && _article$name !== void 0 ? _article$name : article === null || article === void 0 ? void 0 : article.title) !== null && _ref7 !== void 0 ? _ref7 : null,
337
- description: (_ref8 = (_article$description$ = article === null || article === void 0 || (_article$description = article.description) === null || _article$description === void 0 || (_article$description = _article$description.ops) === null || _article$description === void 0 || (_article$description = _article$description[0]) === null || _article$description === void 0 ? void 0 : _article$description.insert) !== null && _article$description$ !== void 0 ? _article$description$ : article === null || article === void 0 ? void 0 : article.remark) !== null && _ref8 !== void 0 ? _ref8 : null,
329
+ name: (_ref4 = (_article$name = article.name) !== null && _article$name !== void 0 ? _article$name : article === null || article === void 0 ? void 0 : article.title) !== null && _ref4 !== void 0 ? _ref4 : null,
330
+ description: (_ref5 = (_article$description$ = article === null || article === void 0 || (_article$description = article.description) === null || _article$description === void 0 || (_article$description = _article$description.ops) === null || _article$description === void 0 || (_article$description = _article$description[0]) === null || _article$description === void 0 ? void 0 : _article$description.insert) !== null && _article$description$ !== void 0 ? _article$description$ : article === null || article === void 0 ? void 0 : article.remark) !== null && _ref5 !== void 0 ? _ref5 : null,
338
331
  subTitle: (_article$boldDescript = article === null || article === void 0 || (_article$boldDescript2 = article.boldDescription) === null || _article$boldDescript2 === void 0 || (_article$boldDescript2 = _article$boldDescript2.ops) === null || _article$boldDescript2 === void 0 || (_article$boldDescript2 = _article$boldDescript2[0]) === null || _article$boldDescript2 === void 0 ? void 0 : _article$boldDescript2.insert) !== null && _article$boldDescript !== void 0 ? _article$boldDescript : null,
339
332
  specifications: Array.isArray(article === null || article === void 0 ? void 0 : article.specifications) ? article === null || article === void 0 ? void 0 : article.specifications.join(' \n ') : (_article$specificatio = article === null || article === void 0 ? void 0 : article.specifications) !== null && _article$specificatio !== void 0 ? _article$specificatio : null,
340
333
  image: article !== null && article !== void 0 && (_article$images = article.images) !== null && _article$images !== void 0 && _article$images[0] ? (0, _image.getImageFromHyper)({
@@ -349,11 +342,11 @@ const formatModelArticle = article => {
349
342
  const formatGenericArticle = article => {
350
343
  var _article$articleNumbe2, _article$type, _article$group, _article$subgroup;
351
344
  const specificationPairs = [['C2 module', article === null || article === void 0 ? void 0 : article.c2Module], ['Check control', article === null || article === void 0 ? void 0 : article.checkControl], ['Direct current', article === null || article === void 0 ? void 0 : article.directCurrent], ['Draw weight', article === null || article === void 0 ? void 0 : article.drawWeight], ['D value', article === null || article === void 0 ? void 0 : article.dValue], ['Foglight shutdown', article === null || article === void 0 ? void 0 : article.foglightShutdown], ['PDC shutdown', article === null || article === void 0 ? void 0 : article.pdcShutdown], ['Switched PSU', article === null || article === void 0 ? void 0 : article.switchedPsu], ['LED', article === null || article === void 0 ? void 0 : article.led]];
352
- const specification = specificationPairs.filter(_ref9 => {
353
- let [_, value] = _ref9;
345
+ const specification = specificationPairs.filter(_ref6 => {
346
+ let [_, value] = _ref6;
354
347
  return value;
355
- }).map(_ref10 => {
356
- let [label, value] = _ref10;
348
+ }).map(_ref7 => {
349
+ let [label, value] = _ref7;
357
350
  return "".concat(label, ": ").concat(value);
358
351
  }).join(' \n ');
359
352
  return _objectSpread(_objectSpread({}, article), {}, {
@@ -145,9 +145,9 @@ const LicensePlatePage = () => {
145
145
  }
146
146
  }, [discountCode]);
147
147
  (0, _react.useEffect)(() => {
148
- if (APP_CONFIG.internal) return;
148
+ if (APP_CONFIG.internal || activeStep !== 0) return;
149
149
  (0, _Datalayer.pushToDataLayer)({
150
- event: activeStep === 0 ? 'configurator_step_wijzig_auto' : 'configurator_step_extra_questions'
150
+ event: 'configurator_step_wijzig_auto'
151
151
  });
152
152
  }, [activeStep]);
153
153
  const Steps = (0, _react.useMemo)(() => getSteps({
@@ -121,9 +121,9 @@ const ManualSelectionPage = () => {
121
121
  }
122
122
  }, [franchiseName]);
123
123
  (0, _react.useEffect)(() => {
124
- if (APP_CONFIG.internal) return;
124
+ if (APP_CONFIG.internal || activeStep !== 0) return;
125
125
  (0, _Datalayer.pushToDataLayer)({
126
- event: activeStep === 0 ? 'configurator_step_wijzig_auto' : 'configurator_step_extra_questions'
126
+ event: 'configurator_step_wijzig_auto'
127
127
  });
128
128
  }, [activeStep]);
129
129
  const handleNext = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thm-p3-configurator",
3
- "version": "0.0.368",
3
+ "version": "0.0.369",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "author": "EnoRm.",
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _helpers__ = require("../../__helpers__");
9
- function _interopRequireDefault(e) {
10
- return e && e.__esModule ? e : {
11
- default: e
12
- };
13
- }
14
- const InlineSpinner = _ref => {
15
- let {
16
- size = '1rem',
17
- color = 'primary'
18
- } = _ref;
19
- return /*#__PURE__*/_react.default.createElement("i", {
20
- className: "fas fa-cog fa-spin ".concat((0, _helpers__.withStyle)("text-".concat(color))),
21
- style: {
22
- fontSize: size
23
- }
24
- });
25
- };
26
- var _default = exports.default = InlineSpinner;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.symbol.description.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- require("core-js/modules/es.symbol.description.js");
9
- var _react = _interopRequireDefault(require("react"));
10
- var _helpers__ = require("../../__helpers__");
11
- function _interopRequireDefault(e) {
12
- return e && e.__esModule ? e : {
13
- default: e
14
- };
15
- }
16
- const SpinnerWithText = _ref => {
17
- let {
18
- title = '',
19
- description = ''
20
- } = _ref;
21
- return /*#__PURE__*/_react.default.createElement("div", {
22
- className: (0, _helpers__.withStyle)('modal__loader')
23
- }, /*#__PURE__*/_react.default.createElement("i", {
24
- className: "fas fa-cog fa-spin ".concat((0, _helpers__.withStyle)('text-primary h3'))
25
- }), /*#__PURE__*/_react.default.createElement("h6", {
26
- className: (0, _helpers__.withStyle)('mt-1')
27
- }, title), /*#__PURE__*/_react.default.createElement("p", {
28
- className: (0, _helpers__.withStyle)('mt-1')
29
- }, description));
30
- };
31
- var _default = exports.default = SpinnerWithText;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/esnext.iterator.map.js");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = void 0;
8
- require("core-js/modules/esnext.iterator.map.js");
9
- var _react = _interopRequireDefault(require("react"));
10
- var _helpers__ = require("../__helpers__");
11
- function _interopRequireDefault(e) {
12
- return e && e.__esModule ? e : {
13
- default: e
14
- };
15
- }
16
- const USPSList = _ref => {
17
- let {
18
- usps
19
- } = _ref;
20
- return /*#__PURE__*/_react.default.createElement("ul", {
21
- className: (0, _helpers__.withStyle)('list-check mt-2')
22
- }, usps.map((uspText, index) => /*#__PURE__*/_react.default.createElement("li", {
23
- className: (0, _helpers__.withStyle)('info'),
24
- key: uspText + index
25
- }, uspText)));
26
- };
27
- var _default = exports.default = USPSList;