@heycater/qualification-funnel 1.19.11 → 1.19.12

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.
package/dist/index.esm.js CHANGED
@@ -10214,6 +10214,20 @@ function trackStarted(context, initialStepId) {
10214
10214
  initial_step: initialStepId
10215
10215
  };
10216
10216
  captureEvent("qf_v14_started", properties);
10217
+ trackOptimeleonConversion("funnel_started");
10218
+ }
10219
+ function trackOptimeleonConversion(eventName, serviceType) {
10220
+ if (typeof window === "undefined") return;
10221
+ if (window.optimeleon) {
10222
+ try {
10223
+ window.optimeleon("track", eventName);
10224
+ if (serviceType) {
10225
+ window.optimeleon("track", `${eventName}_${serviceType}`);
10226
+ }
10227
+ } catch (error) {
10228
+ console.error("[Optimeleon] Failed to track conversion:", error);
10229
+ }
10230
+ }
10217
10231
  }
10218
10232
  function serializeAnswerValue(value) {
10219
10233
  if (value === void 0) return null;
@@ -12458,7 +12472,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
12458
12472
  var ys = arrObjKeys(obj, inspect2);
12459
12473
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
12460
12474
  var protoTag = obj instanceof Object ? "" : "null prototype";
12461
- var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
12475
+ var stringTag2 = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
12462
12476
  var constructorTag = isPlainObject2 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
12463
12477
  var tag = constructorTag + (stringTag2 || protoTag ? "[" + $join.call($concat$1.call([], stringTag2 || [], protoTag || []), ": ") + "] " : "");
12464
12478
  if (ys.length === 0) {
@@ -12483,25 +12497,25 @@ function canTrustToString(obj) {
12483
12497
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
12484
12498
  }
12485
12499
  function isArray$3(obj) {
12486
- return toStr(obj) === "[object Array]" && canTrustToString(obj);
12500
+ return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
12487
12501
  }
12488
12502
  function isDate(obj) {
12489
- return toStr(obj) === "[object Date]" && canTrustToString(obj);
12503
+ return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
12490
12504
  }
12491
12505
  function isRegExp$1(obj) {
12492
- return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
12506
+ return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
12493
12507
  }
12494
12508
  function isError(obj) {
12495
- return toStr(obj) === "[object Error]" && canTrustToString(obj);
12509
+ return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
12496
12510
  }
12497
12511
  function isString(obj) {
12498
- return toStr(obj) === "[object String]" && canTrustToString(obj);
12512
+ return toStr$1(obj) === "[object String]" && canTrustToString(obj);
12499
12513
  }
12500
12514
  function isNumber(obj) {
12501
- return toStr(obj) === "[object Number]" && canTrustToString(obj);
12515
+ return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
12502
12516
  }
12503
12517
  function isBoolean(obj) {
12504
- return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
12518
+ return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
12505
12519
  }
12506
12520
  function isSymbol(obj) {
12507
12521
  if (hasShammedSymbols) {
@@ -12537,7 +12551,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
12537
12551
  function has$4(obj, key) {
12538
12552
  return hasOwn$1.call(obj, key);
12539
12553
  }
12540
- function toStr(obj) {
12554
+ function toStr$1(obj) {
12541
12555
  return objectToString.call(obj);
12542
12556
  }
12543
12557
  function nameOf(f) {
@@ -12846,7 +12860,7 @@ var syntax = SyntaxError;
12846
12860
  var uri = URIError;
12847
12861
  var abs$1 = Math.abs;
12848
12862
  var floor$1 = Math.floor;
12849
- var max$1 = Math.max;
12863
+ var max$2 = Math.max;
12850
12864
  var min$1 = Math.min;
12851
12865
  var pow$1 = Math.pow;
12852
12866
  var round$2 = Math.round;
@@ -12975,99 +12989,78 @@ function requireObject_getPrototypeOf() {
12975
12989
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
12976
12990
  return Object_getPrototypeOf;
12977
12991
  }
12978
- var implementation;
12979
- var hasRequiredImplementation;
12980
- function requireImplementation() {
12981
- if (hasRequiredImplementation) return implementation;
12982
- hasRequiredImplementation = 1;
12983
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12984
- var toStr2 = Object.prototype.toString;
12985
- var max2 = Math.max;
12986
- var funcType = "[object Function]";
12987
- var concatty = function concatty2(a3, b2) {
12988
- var arr = [];
12989
- for (var i2 = 0; i2 < a3.length; i2 += 1) {
12990
- arr[i2] = a3[i2];
12991
- }
12992
- for (var j = 0; j < b2.length; j += 1) {
12993
- arr[j + a3.length] = b2[j];
12994
- }
12995
- return arr;
12996
- };
12997
- var slicy = function slicy2(arrLike, offset2) {
12998
- var arr = [];
12999
- for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13000
- arr[j] = arrLike[i2];
12992
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
12993
+ var toStr = Object.prototype.toString;
12994
+ var max$1 = Math.max;
12995
+ var funcType = "[object Function]";
12996
+ var concatty = function concatty2(a3, b2) {
12997
+ var arr = [];
12998
+ for (var i2 = 0; i2 < a3.length; i2 += 1) {
12999
+ arr[i2] = a3[i2];
13000
+ }
13001
+ for (var j = 0; j < b2.length; j += 1) {
13002
+ arr[j + a3.length] = b2[j];
13003
+ }
13004
+ return arr;
13005
+ };
13006
+ var slicy = function slicy2(arrLike, offset2) {
13007
+ var arr = [];
13008
+ for (var i2 = offset2, j = 0; i2 < arrLike.length; i2 += 1, j += 1) {
13009
+ arr[j] = arrLike[i2];
13010
+ }
13011
+ return arr;
13012
+ };
13013
+ var joiny = function(arr, joiner) {
13014
+ var str = "";
13015
+ for (var i2 = 0; i2 < arr.length; i2 += 1) {
13016
+ str += arr[i2];
13017
+ if (i2 + 1 < arr.length) {
13018
+ str += joiner;
13001
13019
  }
13002
- return arr;
13003
- };
13004
- var joiny = function(arr, joiner) {
13005
- var str = "";
13006
- for (var i2 = 0; i2 < arr.length; i2 += 1) {
13007
- str += arr[i2];
13008
- if (i2 + 1 < arr.length) {
13009
- str += joiner;
13020
+ }
13021
+ return str;
13022
+ };
13023
+ var implementation$1 = function bind(that) {
13024
+ var target = this;
13025
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) {
13026
+ throw new TypeError(ERROR_MESSAGE + target);
13027
+ }
13028
+ var args = slicy(arguments, 1);
13029
+ var bound;
13030
+ var binder = function() {
13031
+ if (this instanceof bound) {
13032
+ var result = target.apply(
13033
+ this,
13034
+ concatty(args, arguments)
13035
+ );
13036
+ if (Object(result) === result) {
13037
+ return result;
13010
13038
  }
13039
+ return this;
13011
13040
  }
13012
- return str;
13041
+ return target.apply(
13042
+ that,
13043
+ concatty(args, arguments)
13044
+ );
13013
13045
  };
13014
- implementation = function bind2(that) {
13015
- var target = this;
13016
- if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
13017
- throw new TypeError(ERROR_MESSAGE + target);
13018
- }
13019
- var args = slicy(arguments, 1);
13020
- var bound;
13021
- var binder = function() {
13022
- if (this instanceof bound) {
13023
- var result = target.apply(
13024
- this,
13025
- concatty(args, arguments)
13026
- );
13027
- if (Object(result) === result) {
13028
- return result;
13029
- }
13030
- return this;
13031
- }
13032
- return target.apply(
13033
- that,
13034
- concatty(args, arguments)
13035
- );
13046
+ var boundLength = max$1(0, target.length - args.length);
13047
+ var boundArgs = [];
13048
+ for (var i2 = 0; i2 < boundLength; i2++) {
13049
+ boundArgs[i2] = "$" + i2;
13050
+ }
13051
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13052
+ if (target.prototype) {
13053
+ var Empty = function Empty2() {
13036
13054
  };
13037
- var boundLength = max2(0, target.length - args.length);
13038
- var boundArgs = [];
13039
- for (var i2 = 0; i2 < boundLength; i2++) {
13040
- boundArgs[i2] = "$" + i2;
13041
- }
13042
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
13043
- if (target.prototype) {
13044
- var Empty = function Empty2() {
13045
- };
13046
- Empty.prototype = target.prototype;
13047
- bound.prototype = new Empty();
13048
- Empty.prototype = null;
13049
- }
13050
- return bound;
13051
- };
13052
- return implementation;
13053
- }
13054
- var functionBind;
13055
- var hasRequiredFunctionBind;
13056
- function requireFunctionBind() {
13057
- if (hasRequiredFunctionBind) return functionBind;
13058
- hasRequiredFunctionBind = 1;
13059
- var implementation2 = requireImplementation();
13060
- functionBind = Function.prototype.bind || implementation2;
13061
- return functionBind;
13062
- }
13063
- var functionCall;
13064
- var hasRequiredFunctionCall;
13065
- function requireFunctionCall() {
13066
- if (hasRequiredFunctionCall) return functionCall;
13067
- hasRequiredFunctionCall = 1;
13068
- functionCall = Function.prototype.call;
13069
- return functionCall;
13070
- }
13055
+ Empty.prototype = target.prototype;
13056
+ bound.prototype = new Empty();
13057
+ Empty.prototype = null;
13058
+ }
13059
+ return bound;
13060
+ };
13061
+ var implementation = implementation$1;
13062
+ var functionBind = Function.prototype.bind || implementation;
13063
+ var functionCall = Function.prototype.call;
13071
13064
  var functionApply;
13072
13065
  var hasRequiredFunctionApply;
13073
13066
  function requireFunctionApply() {
@@ -13077,14 +13070,14 @@ function requireFunctionApply() {
13077
13070
  return functionApply;
13078
13071
  }
13079
13072
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
13080
- var bind$2 = requireFunctionBind();
13073
+ var bind$2 = functionBind;
13081
13074
  var $apply$1 = requireFunctionApply();
13082
- var $call$2 = requireFunctionCall();
13075
+ var $call$2 = functionCall;
13083
13076
  var $reflectApply = reflectApply;
13084
13077
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
13085
- var bind$1 = requireFunctionBind();
13078
+ var bind$1 = functionBind;
13086
13079
  var $TypeError$4 = type;
13087
- var $call$1 = requireFunctionCall();
13080
+ var $call$1 = functionCall;
13088
13081
  var $actualApply = actualApply;
13089
13082
  var callBindApplyHelpers = function callBindBasic(args) {
13090
13083
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -13150,8 +13143,8 @@ function requireHasown() {
13150
13143
  hasRequiredHasown = 1;
13151
13144
  var call = Function.prototype.call;
13152
13145
  var $hasOwn = Object.prototype.hasOwnProperty;
13153
- var bind2 = requireFunctionBind();
13154
- hasown = bind2.call(call, $hasOwn);
13146
+ var bind3 = functionBind;
13147
+ hasown = bind3.call(call, $hasOwn);
13155
13148
  return hasown;
13156
13149
  }
13157
13150
  var undefined$1;
@@ -13165,7 +13158,7 @@ var $TypeError$3 = type;
13165
13158
  var $URIError = uri;
13166
13159
  var abs = abs$1;
13167
13160
  var floor = floor$1;
13168
- var max = max$1;
13161
+ var max = max$2;
13169
13162
  var min = min$1;
13170
13163
  var pow = pow$1;
13171
13164
  var round$1 = round$2;
@@ -13199,7 +13192,7 @@ var getProto = requireGetProto();
13199
13192
  var $ObjectGPO = requireObject_getPrototypeOf();
13200
13193
  var $ReflectGPO = requireReflect_getPrototypeOf();
13201
13194
  var $apply = requireFunctionApply();
13202
- var $call = requireFunctionCall();
13195
+ var $call = functionCall;
13203
13196
  var needsEval = {};
13204
13197
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
13205
13198
  var INTRINSICS = {
@@ -13370,13 +13363,13 @@ var LEGACY_ALIASES = {
13370
13363
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
13371
13364
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
13372
13365
  };
13373
- var bind = requireFunctionBind();
13366
+ var bind2 = functionBind;
13374
13367
  var hasOwn = requireHasown();
13375
- var $concat = bind.call($call, Array.prototype.concat);
13376
- var $spliceApply = bind.call($apply, Array.prototype.splice);
13377
- var $replace = bind.call($call, String.prototype.replace);
13378
- var $strSlice = bind.call($call, String.prototype.slice);
13379
- var $exec = bind.call($call, RegExp.prototype.exec);
13368
+ var $concat = bind2.call($call, Array.prototype.concat);
13369
+ var $spliceApply = bind2.call($apply, Array.prototype.splice);
13370
+ var $replace = bind2.call($call, String.prototype.replace);
13371
+ var $strSlice = bind2.call($call, String.prototype.slice);
13372
+ var $exec = bind2.call($call, RegExp.prototype.exec);
13380
13373
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
13381
13374
  var reEscapeChar = /\\(\\)?/g;
13382
13375
  var stringToPath = function stringToPath2(string2) {
@@ -26865,6 +26858,7 @@ function RequestForm({ header = null }) {
26865
26858
  var _a3;
26866
26859
  handleDisableCTA(true);
26867
26860
  const serviceType = (_a3 = qualification == null ? void 0 : qualification.answers) == null ? void 0 : _a3.service_type;
26861
+ trackOptimeleonConversion("funnel_form_submitted", serviceType);
26868
26862
  const isLeadOnlyFunnel = serviceType === "regular_employee_catering" || serviceType === "full_service_event";
26869
26863
  const { deliveryAddressCountry: deliveryAddressCountry2 } = values2;
26870
26864
  const isUkLead = ["United Kingdom", "Great Britain", "UK"].includes(
@@ -26878,6 +26872,7 @@ function RequestForm({ header = null }) {
26878
26872
  setShowLeadSuccess(true);
26879
26873
  trackFormSubmitted(funnelContextRef.current, { is_uk_lead: isUkLead });
26880
26874
  trackCompleted(funnelContextRef.current);
26875
+ trackOptimeleonConversion("funnel_completed", serviceType);
26881
26876
  return;
26882
26877
  } else {
26883
26878
  console.error("[HeyCater Funnel] Lead submission failed. Result:", response);
@@ -26920,6 +26915,7 @@ function RequestForm({ header = null }) {
26920
26915
  is_logged_in: !!currentUserAccount
26921
26916
  });
26922
26917
  trackCompleted(funnelContextRef.current);
26918
+ trackOptimeleonConversion("funnel_completed", serviceType);
26923
26919
  actions.setRequest(values2);
26924
26920
  redirectToCustomerAccountRequest(redirectRoute);
26925
26921
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.19.11",
3
+ "version": "1.19.12",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",