rudder-sdk-js 1.3.4 → 1.4.3
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/index.d.ts +2 -1
- package/index.js +161 -367
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
@@ -5148,200 +5148,6 @@
|
|
5148
5148
|
return isobject(val) || Array.isArray(val) || typeof val === 'function';
|
5149
5149
|
}
|
5150
5150
|
|
5151
|
-
/*!
|
5152
|
-
* is-primitive <https://github.com/jonschlinkert/is-primitive>
|
5153
|
-
*
|
5154
|
-
* Copyright (c) 2014-present, Jon Schlinkert.
|
5155
|
-
* Released under the MIT License.
|
5156
|
-
*/
|
5157
|
-
|
5158
|
-
var isPrimitive = function isPrimitive(val) {
|
5159
|
-
if (_typeof(val) === 'object') {
|
5160
|
-
return val === null;
|
5161
|
-
}
|
5162
|
-
|
5163
|
-
return typeof val !== 'function';
|
5164
|
-
};
|
5165
|
-
|
5166
|
-
function isObjectObject(o) {
|
5167
|
-
return isobject(o) === true && Object.prototype.toString.call(o) === '[object Object]';
|
5168
|
-
}
|
5169
|
-
|
5170
|
-
var isPlainObject = function isPlainObject(o) {
|
5171
|
-
var ctor, prot;
|
5172
|
-
if (isObjectObject(o) === false) return false; // If has modified constructor
|
5173
|
-
|
5174
|
-
ctor = o.constructor;
|
5175
|
-
if (typeof ctor !== 'function') return false; // If has modified prototype
|
5176
|
-
|
5177
|
-
prot = ctor.prototype;
|
5178
|
-
if (isObjectObject(prot) === false) return false; // If constructor does not have an Object-specific method
|
5179
|
-
|
5180
|
-
if (prot.hasOwnProperty('isPrototypeOf') === false) {
|
5181
|
-
return false;
|
5182
|
-
} // Most likely a plain Object
|
5183
|
-
|
5184
|
-
|
5185
|
-
return true;
|
5186
|
-
};
|
5187
|
-
|
5188
|
-
var deleteProperty = Reflect.deleteProperty;
|
5189
|
-
|
5190
|
-
var isObject = function isObject(value) {
|
5191
|
-
return _typeof(value) === 'object' && value !== null || typeof value === 'function';
|
5192
|
-
};
|
5193
|
-
|
5194
|
-
var isUnsafeKey = function isUnsafeKey(key) {
|
5195
|
-
return key === '__proto__' || key === 'constructor' || key === 'prototype';
|
5196
|
-
};
|
5197
|
-
|
5198
|
-
var validateKey = function validateKey(key) {
|
5199
|
-
if (!isPrimitive(key)) {
|
5200
|
-
throw new TypeError('Object keys must be strings or symbols');
|
5201
|
-
}
|
5202
|
-
|
5203
|
-
if (isUnsafeKey(key)) {
|
5204
|
-
throw new Error("Cannot set unsafe key: \"".concat(key, "\""));
|
5205
|
-
}
|
5206
|
-
};
|
5207
|
-
|
5208
|
-
var toStringKey = function toStringKey(input) {
|
5209
|
-
return Array.isArray(input) ? input.flat().map(String).join(',') : input;
|
5210
|
-
};
|
5211
|
-
|
5212
|
-
var createMemoKey = function createMemoKey(input, options) {
|
5213
|
-
if (typeof input !== 'string' || !options) return input;
|
5214
|
-
var key = input + ';';
|
5215
|
-
if (options.arrays !== undefined) key += "arrays=".concat(options.arrays, ";");
|
5216
|
-
if (options.separator !== undefined) key += "separator=".concat(options.separator, ";");
|
5217
|
-
if (options.split !== undefined) key += "split=".concat(options.split, ";");
|
5218
|
-
if (options.merge !== undefined) key += "merge=".concat(options.merge, ";");
|
5219
|
-
if (options.preservePaths !== undefined) key += "preservePaths=".concat(options.preservePaths, ";");
|
5220
|
-
return key;
|
5221
|
-
};
|
5222
|
-
|
5223
|
-
var memoize = function memoize(input, options, fn) {
|
5224
|
-
var key = toStringKey(options ? createMemoKey(input, options) : input);
|
5225
|
-
validateKey(key);
|
5226
|
-
var value = setValue.cache.get(key) || fn();
|
5227
|
-
setValue.cache.set(key, value);
|
5228
|
-
return value;
|
5229
|
-
};
|
5230
|
-
|
5231
|
-
var splitString = function splitString(input) {
|
5232
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
5233
|
-
var sep = options.separator || '.';
|
5234
|
-
var preserve = sep === '/' ? false : options.preservePaths;
|
5235
|
-
|
5236
|
-
if (typeof input === 'string' && preserve !== false && /\//.test(input)) {
|
5237
|
-
return [input];
|
5238
|
-
}
|
5239
|
-
|
5240
|
-
var parts = [];
|
5241
|
-
var part = '';
|
5242
|
-
|
5243
|
-
var push = function push(part) {
|
5244
|
-
var number;
|
5245
|
-
|
5246
|
-
if (part.trim() !== '' && Number.isInteger(number = Number(part))) {
|
5247
|
-
parts.push(number);
|
5248
|
-
} else {
|
5249
|
-
parts.push(part);
|
5250
|
-
}
|
5251
|
-
};
|
5252
|
-
|
5253
|
-
for (var i = 0; i < input.length; i++) {
|
5254
|
-
var value = input[i];
|
5255
|
-
|
5256
|
-
if (value === '\\') {
|
5257
|
-
part += input[++i];
|
5258
|
-
continue;
|
5259
|
-
}
|
5260
|
-
|
5261
|
-
if (value === sep) {
|
5262
|
-
push(part);
|
5263
|
-
part = '';
|
5264
|
-
continue;
|
5265
|
-
}
|
5266
|
-
|
5267
|
-
part += value;
|
5268
|
-
}
|
5269
|
-
|
5270
|
-
if (part) {
|
5271
|
-
push(part);
|
5272
|
-
}
|
5273
|
-
|
5274
|
-
return parts;
|
5275
|
-
};
|
5276
|
-
|
5277
|
-
var split$1 = function split(input, options) {
|
5278
|
-
if (options && typeof options.split === 'function') return options.split(input);
|
5279
|
-
if (_typeof(input) === 'symbol') return [input];
|
5280
|
-
if (Array.isArray(input)) return input;
|
5281
|
-
return memoize(input, options, function () {
|
5282
|
-
return splitString(input, options);
|
5283
|
-
});
|
5284
|
-
};
|
5285
|
-
|
5286
|
-
var assignProp = function assignProp(obj, prop, value, options) {
|
5287
|
-
validateKey(prop); // Delete property when "value" is undefined
|
5288
|
-
|
5289
|
-
if (value === undefined) {
|
5290
|
-
deleteProperty(obj, prop);
|
5291
|
-
} else if (options && options.merge) {
|
5292
|
-
var merge = options.merge === 'function' ? options.merge : Object.assign; // Only merge plain objects
|
5293
|
-
|
5294
|
-
if (merge && isPlainObject(obj[prop]) && isPlainObject(value)) {
|
5295
|
-
obj[prop] = merge(obj[prop], value);
|
5296
|
-
} else {
|
5297
|
-
obj[prop] = value;
|
5298
|
-
}
|
5299
|
-
} else {
|
5300
|
-
obj[prop] = value;
|
5301
|
-
}
|
5302
|
-
|
5303
|
-
return obj;
|
5304
|
-
};
|
5305
|
-
|
5306
|
-
var setValue = function setValue(target, path, value, options) {
|
5307
|
-
if (!path || !isObject(target)) return target;
|
5308
|
-
var keys = split$1(path, options);
|
5309
|
-
var obj = target;
|
5310
|
-
|
5311
|
-
for (var i = 0; i < keys.length; i++) {
|
5312
|
-
var key = keys[i];
|
5313
|
-
var next = keys[i + 1];
|
5314
|
-
validateKey(key);
|
5315
|
-
|
5316
|
-
if (next === undefined) {
|
5317
|
-
assignProp(obj, key, value, options);
|
5318
|
-
break;
|
5319
|
-
}
|
5320
|
-
|
5321
|
-
if (typeof next === 'number' && !Array.isArray(obj[key])) {
|
5322
|
-
obj = obj[key] = [];
|
5323
|
-
continue;
|
5324
|
-
}
|
5325
|
-
|
5326
|
-
if (!isObject(obj[key])) {
|
5327
|
-
obj[key] = {};
|
5328
|
-
}
|
5329
|
-
|
5330
|
-
obj = obj[key];
|
5331
|
-
}
|
5332
|
-
|
5333
|
-
return target;
|
5334
|
-
};
|
5335
|
-
|
5336
|
-
setValue.split = split$1;
|
5337
|
-
setValue.cache = new Map();
|
5338
|
-
|
5339
|
-
setValue.clear = function () {
|
5340
|
-
setValue.cache = new Map();
|
5341
|
-
};
|
5342
|
-
|
5343
|
-
var setValue_1 = setValue;
|
5344
|
-
|
5345
5151
|
var LOG_LEVEL_INFO = 1;
|
5346
5152
|
var LOG_LEVEL_DEBUG = 2;
|
5347
5153
|
var LOG_LEVEL_WARN = 3;
|
@@ -5713,9 +5519,10 @@
|
|
5713
5519
|
PRODUCT_REVIEWED: "Product Reviewed"
|
5714
5520
|
}; // Enumeration for integrations supported
|
5715
5521
|
|
5716
|
-
var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.3
|
5522
|
+
var CONFIG_URL = "https://api.rudderlabs.com/sourceConfig/?p=npm&v=1.4.3";
|
5717
5523
|
var MAX_WAIT_FOR_INTEGRATION_LOAD = 10000;
|
5718
5524
|
var INTEGRATION_LOAD_CHECK_INTERVAL = 1000;
|
5525
|
+
var POLYFILL_URL = "https://polyfill.io/v3/polyfill.min.js?features=Array.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries";
|
5719
5526
|
/* module.exports = {
|
5720
5527
|
MessageType: MessageType,
|
5721
5528
|
ECommerceParamNames: ECommerceParamNames,
|
@@ -9066,7 +8873,7 @@
|
|
9066
8873
|
*/
|
9067
8874
|
// TODO: Move to a library
|
9068
8875
|
|
9069
|
-
var isObject
|
8876
|
+
var isObject = function isObject(value) {
|
9070
8877
|
return Boolean(value) && _typeof(value) === 'object';
|
9071
8878
|
};
|
9072
8879
|
/**
|
@@ -9080,7 +8887,7 @@
|
|
9080
8887
|
// TODO: Move to a library
|
9081
8888
|
|
9082
8889
|
|
9083
|
-
var isPlainObject
|
8890
|
+
var isPlainObject = function isPlainObject(value) {
|
9084
8891
|
return Boolean(value) && objToString$1.call(value) === '[object Object]';
|
9085
8892
|
};
|
9086
8893
|
/**
|
@@ -9119,7 +8926,7 @@
|
|
9119
8926
|
|
9120
8927
|
var deepCombiner = function deepCombiner(target, source, value, key) {
|
9121
8928
|
if (has$2.call(source, key)) {
|
9122
|
-
if (isPlainObject
|
8929
|
+
if (isPlainObject(target[key]) && isPlainObject(value)) {
|
9123
8930
|
target[key] = defaultsDeep(target[key], value);
|
9124
8931
|
} else if (target[key] === undefined) {
|
9125
8932
|
target[key] = value;
|
@@ -9143,7 +8950,7 @@
|
|
9143
8950
|
var defaultsWith = function defaultsWith(combiner, target
|
9144
8951
|
/*, ...sources */
|
9145
8952
|
) {
|
9146
|
-
if (!isObject
|
8953
|
+
if (!isObject(target)) {
|
9147
8954
|
return target;
|
9148
8955
|
}
|
9149
8956
|
|
@@ -12477,7 +12284,13 @@
|
|
12477
12284
|
});
|
12478
12285
|
objKeys.map(function (k) {
|
12479
12286
|
if (!(typeof messageContext[k] === "undefined")) {
|
12480
|
-
|
12287
|
+
if (destination) {
|
12288
|
+
destination[k] = getValue(messageContext, k);
|
12289
|
+
} else {
|
12290
|
+
destination = {
|
12291
|
+
k: getValue(messageContext, k)
|
12292
|
+
};
|
12293
|
+
}
|
12481
12294
|
}
|
12482
12295
|
});
|
12483
12296
|
}
|
@@ -12505,7 +12318,7 @@
|
|
12505
12318
|
};
|
12506
12319
|
|
12507
12320
|
if (!getValue(traitsValue, "name") && getValue(traitsValue, "firstName") && getValue(traitsValue, "lastName")) {
|
12508
|
-
|
12321
|
+
traitsValue.name = "".concat(getValue(traitsValue, "firstName"), " ").concat(getValue(traitsValue, "lastName"));
|
12509
12322
|
}
|
12510
12323
|
|
12511
12324
|
return traitsValue;
|
@@ -12515,7 +12328,7 @@
|
|
12515
12328
|
*/
|
12516
12329
|
|
12517
12330
|
|
12518
|
-
var isObject$
|
12331
|
+
var isObject$1 = function isObject(obj) {
|
12519
12332
|
return type(obj) === "object";
|
12520
12333
|
};
|
12521
12334
|
/**
|
@@ -24886,7 +24699,7 @@
|
|
24886
24699
|
}
|
24887
24700
|
|
24888
24701
|
Object.keys(payload).map(function (key) {
|
24889
|
-
if (isObject$
|
24702
|
+
if (isObject$1(payload[key])) {
|
24890
24703
|
logger.debug("cannot process, unsupported traits");
|
24891
24704
|
return;
|
24892
24705
|
}
|
@@ -24920,7 +24733,7 @@
|
|
24920
24733
|
window.clevertap.event.push("Charged", ecomProperties);
|
24921
24734
|
} else {
|
24922
24735
|
Object.keys(properties).map(function (key) {
|
24923
|
-
if (isObject$
|
24736
|
+
if (isObject$1(properties[key]) || isArray$1(properties[key])) {
|
24924
24737
|
logger.debug("cannot process, unsupported event");
|
24925
24738
|
return;
|
24926
24739
|
}
|
@@ -24952,7 +24765,7 @@
|
|
24952
24765
|
|
24953
24766
|
if (properties) {
|
24954
24767
|
Object.keys(properties).map(function (key) {
|
24955
|
-
if (isObject$
|
24768
|
+
if (isObject$1(properties[key]) || isArray$1(properties[key])) {
|
24956
24769
|
logger.debug("cannot process, unsupported event");
|
24957
24770
|
return;
|
24958
24771
|
}
|
@@ -27602,114 +27415,50 @@
|
|
27602
27415
|
return FacebookPixel;
|
27603
27416
|
}();
|
27604
27417
|
|
27605
|
-
|
27606
|
-
|
27607
|
-
|
27608
|
-
|
27609
|
-
|
27610
|
-
var LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);
|
27611
|
-
var SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');
|
27612
|
-
var NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu');
|
27613
|
-
|
27614
|
-
var preserveCamelCase = function preserveCamelCase(string, locale) {
|
27615
|
-
var isLastCharLower = false;
|
27616
|
-
var isLastCharUpper = false;
|
27617
|
-
var isLastLastCharUpper = false;
|
27618
|
-
|
27619
|
-
for (var i = 0; i < string.length; i++) {
|
27620
|
-
var character = string[i];
|
27621
|
-
|
27622
|
-
if (isLastCharLower && UPPERCASE.test(character)) {
|
27623
|
-
string = string.slice(0, i) + '-' + string.slice(i);
|
27624
|
-
isLastCharLower = false;
|
27625
|
-
isLastLastCharUpper = isLastCharUpper;
|
27626
|
-
isLastCharUpper = true;
|
27627
|
-
i++;
|
27628
|
-
} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) {
|
27629
|
-
string = string.slice(0, i - 1) + '-' + string.slice(i - 1);
|
27630
|
-
isLastLastCharUpper = isLastCharUpper;
|
27631
|
-
isLastCharUpper = false;
|
27632
|
-
isLastCharLower = true;
|
27633
|
-
} else {
|
27634
|
-
isLastCharLower = character.toLocaleLowerCase(locale) === character && character.toLocaleUpperCase(locale) !== character;
|
27635
|
-
isLastLastCharUpper = isLastCharUpper;
|
27636
|
-
isLastCharUpper = character.toLocaleUpperCase(locale) === character && character.toLocaleLowerCase(locale) !== character;
|
27418
|
+
// util function to convert the input to string type
|
27419
|
+
function convertToString(input) {
|
27420
|
+
if (input) {
|
27421
|
+
if (typeof input === "string") {
|
27422
|
+
return input;
|
27637
27423
|
}
|
27638
|
-
}
|
27639
27424
|
|
27640
|
-
|
27641
|
-
};
|
27642
|
-
|
27643
|
-
var preserveConsecutiveUppercase = function preserveConsecutiveUppercase(input) {
|
27644
|
-
LEADING_CAPITAL.lastIndex = 0;
|
27645
|
-
return input.replace(LEADING_CAPITAL, function (m1) {
|
27646
|
-
return m1.toLowerCase();
|
27647
|
-
});
|
27648
|
-
};
|
27649
|
-
|
27650
|
-
var postProcess = function postProcess(input, options) {
|
27651
|
-
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
27652
|
-
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
27653
|
-
return input.replace(SEPARATORS_AND_IDENTIFIER, function (_, identifier) {
|
27654
|
-
return identifier.toLocaleUpperCase(options.locale);
|
27655
|
-
}).replace(NUMBERS_AND_IDENTIFIER, function (m) {
|
27656
|
-
return m.toLocaleUpperCase(options.locale);
|
27657
|
-
});
|
27658
|
-
};
|
27659
|
-
|
27660
|
-
var camelCase = function camelCase(input, options) {
|
27661
|
-
if (!(typeof input === 'string' || Array.isArray(input))) {
|
27662
|
-
throw new TypeError('Expected the input to be `string | string[]`');
|
27425
|
+
return String(input);
|
27663
27426
|
}
|
27664
27427
|
|
27665
|
-
|
27666
|
-
|
27667
|
-
preserveConsecutiveUppercase: false
|
27668
|
-
}, options);
|
27669
|
-
|
27670
|
-
if (Array.isArray(input)) {
|
27671
|
-
input = input.map(function (x) {
|
27672
|
-
return x.trim();
|
27673
|
-
}).filter(function (x) {
|
27674
|
-
return x.length;
|
27675
|
-
}).join('-');
|
27676
|
-
} else {
|
27677
|
-
input = input.trim();
|
27678
|
-
}
|
27428
|
+
return "";
|
27429
|
+
} // convert string to words
|
27679
27430
|
|
27680
|
-
if (input.length === 0) {
|
27681
|
-
return '';
|
27682
|
-
}
|
27683
27431
|
|
27684
|
-
|
27685
|
-
|
27686
|
-
|
27432
|
+
function toWords(input) {
|
27433
|
+
input = convertToString(input);
|
27434
|
+
var regex = /[A-Z\xC0-\xD6\xD8-\xDE]?[a-z\xDF-\xF6\xF8-\xFF]+|[A-Z\xC0-\xD6\xD8-\xDE]+(?![a-z\xDF-\xF6\xF8-\xFF])|\d+/g;
|
27435
|
+
return input.match(regex);
|
27436
|
+
} // convert the input array to camel case
|
27687
27437
|
|
27688
|
-
var hasUpperCase = input !== input.toLocaleLowerCase(options.locale);
|
27689
27438
|
|
27690
|
-
|
27691
|
-
|
27692
|
-
}
|
27439
|
+
function toCamelCase(inputArray) {
|
27440
|
+
var result = "";
|
27693
27441
|
|
27694
|
-
|
27442
|
+
for (var i = 0, len = inputArray.length; i < len; i++) {
|
27443
|
+
var currentStr = inputArray[i];
|
27444
|
+
var tempStr = currentStr.toLowerCase();
|
27695
27445
|
|
27696
|
-
|
27697
|
-
|
27698
|
-
|
27699
|
-
|
27700
|
-
}
|
27446
|
+
if (i !== 0) {
|
27447
|
+
// convert first letter to upper case (the word is in lowercase)
|
27448
|
+
tempStr = tempStr.substr(0, 1).toUpperCase() + tempStr.substr(1);
|
27449
|
+
}
|
27701
27450
|
|
27702
|
-
|
27703
|
-
input = input.charAt(0).toLocaleUpperCase(options.locale) + input.slice(1);
|
27451
|
+
result += tempStr;
|
27704
27452
|
}
|
27705
27453
|
|
27706
|
-
return
|
27707
|
-
}
|
27454
|
+
return result;
|
27455
|
+
} // this function call all other functions
|
27708
27456
|
|
27709
|
-
var camelcase = camelCase; // TODO: Remove this for the next major release
|
27710
27457
|
|
27711
|
-
|
27712
|
-
|
27458
|
+
function camelcase(input) {
|
27459
|
+
var words = toWords(input);
|
27460
|
+
return toCamelCase(words);
|
27461
|
+
}
|
27713
27462
|
|
27714
27463
|
var Fullstory = /*#__PURE__*/function () {
|
27715
27464
|
function Fullstory(config, analytics) {
|
@@ -33419,7 +33168,7 @@
|
|
33419
33168
|
key: "isLoaded",
|
33420
33169
|
value: function isLoaded() {
|
33421
33170
|
logger.debug("===in Sentry isLoaded===");
|
33422
|
-
return !!(window.Sentry && isObject$
|
33171
|
+
return !!(window.Sentry && isObject$1(window.Sentry) && window.Sentry.setUser && window.Sentry.Integrations.RewriteFrames);
|
33423
33172
|
} // eslint-disable-next-line class-methods-use-this
|
33424
33173
|
|
33425
33174
|
}, {
|
@@ -33427,7 +33176,7 @@
|
|
33427
33176
|
value: function isReady() {
|
33428
33177
|
logger.debug("===in Sentry isReady===");
|
33429
33178
|
|
33430
|
-
if (window.Sentry && isObject$
|
33179
|
+
if (window.Sentry && isObject$1(window.Sentry) && window.Sentry.setUser && window.Sentry.Integrations.RewriteFrames) {
|
33431
33180
|
var sentryConfig = sentryInit(this.allowUrls, this.denyUrls, this.ignoreErrors, this.includePathsArray, this.customVersionProperty, this.release, this.dsn, this.debugMode, this.environment, this.serverName);
|
33432
33181
|
window.Sentry.init(sentryConfig);
|
33433
33182
|
|
@@ -33962,61 +33711,69 @@
|
|
33962
33711
|
_createClass(VWO, [{
|
33963
33712
|
key: "init",
|
33964
33713
|
value: function init() {
|
33965
|
-
|
33966
|
-
|
33967
|
-
|
33968
|
-
|
33969
|
-
|
33970
|
-
|
33971
|
-
|
33972
|
-
|
33973
|
-
var
|
33974
|
-
var
|
33975
|
-
|
33976
|
-
|
33977
|
-
|
33978
|
-
|
33979
|
-
|
33980
|
-
|
33981
|
-
|
33982
|
-
|
33983
|
-
|
33984
|
-
|
33985
|
-
|
33986
|
-
|
33714
|
+
var _this$analytics$loadO, _this$analytics$loadO2;
|
33715
|
+
|
33716
|
+
logger.debug("===In init VWO===");
|
33717
|
+
|
33718
|
+
if ((_this$analytics$loadO = this.analytics.loadOnlyIntegrations) !== null && _this$analytics$loadO !== void 0 && (_this$analytics$loadO2 = _this$analytics$loadO.VWO) !== null && _this$analytics$loadO2 !== void 0 && _this$analytics$loadO2.loadIntegration) {
|
33719
|
+
var account_id = this.accountId;
|
33720
|
+
var settings_tolerance = this.settingsTolerance;
|
33721
|
+
var _library_tolerance = this.libraryTolerance;
|
33722
|
+
var _use_existing_jquery = this.useExistingJquery;
|
33723
|
+
var isSPA = this.isSPA;
|
33724
|
+
|
33725
|
+
window._vwo_code = function () {
|
33726
|
+
var f = false;
|
33727
|
+
var d = document;
|
33728
|
+
return {
|
33729
|
+
use_existing_jquery: function use_existing_jquery() {
|
33730
|
+
return _use_existing_jquery;
|
33731
|
+
},
|
33732
|
+
library_tolerance: function library_tolerance() {
|
33733
|
+
return _library_tolerance;
|
33734
|
+
},
|
33735
|
+
finish: function finish() {
|
33736
|
+
if (!f) {
|
33737
|
+
f = true;
|
33738
|
+
var a = d.getElementById("_vis_opt_path_hides");
|
33739
|
+
if (a) a.parentNode.removeChild(a);
|
33740
|
+
}
|
33741
|
+
},
|
33742
|
+
finished: function finished() {
|
33743
|
+
return f;
|
33744
|
+
},
|
33745
|
+
load: function load(a) {
|
33746
|
+
var b = d.createElement("script");
|
33747
|
+
b.src = a;
|
33748
|
+
b.type = "text/javascript";
|
33749
|
+
b.innerText;
|
33750
|
+
|
33751
|
+
b.onerror = function () {
|
33752
|
+
_vwo_code.finish();
|
33753
|
+
};
|
33754
|
+
|
33755
|
+
d.getElementsByTagName("head")[0].appendChild(b);
|
33756
|
+
},
|
33757
|
+
init: function init() {
|
33758
|
+
var settings_timer = setTimeout("_vwo_code.finish()", settings_tolerance);
|
33759
|
+
var a = d.createElement("style");
|
33760
|
+
var b = "body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}";
|
33761
|
+
var h = d.getElementsByTagName("head")[0];
|
33762
|
+
a.setAttribute("id", "_vis_opt_path_hides");
|
33763
|
+
a.setAttribute("type", "text/css");
|
33764
|
+
if (a.styleSheet) a.styleSheet.cssText = b;else a.appendChild(d.createTextNode(b));
|
33765
|
+
h.appendChild(a);
|
33766
|
+
this.load("//dev.visualwebsiteoptimizer.com/j.php?a=".concat(account_id, "&u=").concat(encodeURIComponent(d.URL), "&r=").concat(Math.random(), "&f=").concat(+isSPA));
|
33767
|
+
return settings_timer;
|
33987
33768
|
}
|
33988
|
-
}
|
33989
|
-
|
33990
|
-
return f;
|
33991
|
-
},
|
33992
|
-
load: function load(a) {
|
33993
|
-
var b = d.createElement("script");
|
33994
|
-
b.src = a;
|
33995
|
-
b.type = "text/javascript";
|
33996
|
-
b.innerText;
|
33997
|
-
|
33998
|
-
b.onerror = function () {
|
33999
|
-
_vwo_code.finish();
|
34000
|
-
};
|
33769
|
+
};
|
33770
|
+
}();
|
34001
33771
|
|
34002
|
-
|
34003
|
-
|
34004
|
-
|
34005
|
-
|
34006
|
-
var a = d.createElement("style");
|
34007
|
-
var b = "body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}";
|
34008
|
-
var h = d.getElementsByTagName("head")[0];
|
34009
|
-
a.setAttribute("id", "_vis_opt_path_hides");
|
34010
|
-
a.setAttribute("type", "text/css");
|
34011
|
-
if (a.styleSheet) a.styleSheet.cssText = b;else a.appendChild(d.createTextNode(b));
|
34012
|
-
h.appendChild(a);
|
34013
|
-
this.load("//dev.visualwebsiteoptimizer.com/j.php?a=".concat(account_id, "&u=").concat(encodeURIComponent(d.URL), "&r=").concat(Math.random(), "&f=").concat(+isSPA));
|
34014
|
-
return settings_timer;
|
34015
|
-
}
|
34016
|
-
};
|
34017
|
-
}();
|
33772
|
+
window._vwo_settings_timer = window._vwo_code.init();
|
33773
|
+
} else {
|
33774
|
+
logger.debug("===[VWO]loadIntegration flag is disabled===");
|
33775
|
+
} // Send track or iddentify when
|
34018
33776
|
|
34019
|
-
window._vwo_settings_timer = window._vwo_code.init(); // Send track or iddentify when
|
34020
33777
|
|
34021
33778
|
if (this.sendExperimentTrack || this.experimentViewedIdentify) {
|
34022
33779
|
this.experimentViewed();
|
@@ -34067,12 +33824,13 @@
|
|
34067
33824
|
}
|
34068
33825
|
}, {
|
34069
33826
|
key: "identify",
|
34070
|
-
value: function identify(
|
34071
|
-
logger.debug("method not supported");
|
33827
|
+
value: function identify() {
|
33828
|
+
logger.debug("[VWO] identify:: method not supported");
|
34072
33829
|
}
|
34073
33830
|
}, {
|
34074
33831
|
key: "track",
|
34075
33832
|
value: function track(rudderElement) {
|
33833
|
+
logger.debug("===In VWO track===");
|
34076
33834
|
var eventName = rudderElement.message.event;
|
34077
33835
|
|
34078
33836
|
if (eventName === "Order Completed") {
|
@@ -34084,17 +33842,19 @@
|
|
34084
33842
|
}
|
34085
33843
|
}, {
|
34086
33844
|
key: "page",
|
34087
|
-
value: function page(
|
34088
|
-
logger.debug("method not supported");
|
33845
|
+
value: function page() {
|
33846
|
+
logger.debug("[VWO] page:: method not supported");
|
34089
33847
|
}
|
34090
33848
|
}, {
|
34091
33849
|
key: "isLoaded",
|
34092
33850
|
value: function isLoaded() {
|
33851
|
+
logger.debug("===In isLoaded VWO===");
|
34093
33852
|
return !!window._vwo_code;
|
34094
33853
|
}
|
34095
33854
|
}, {
|
34096
33855
|
key: "isReady",
|
34097
33856
|
value: function isReady() {
|
33857
|
+
logger.debug("===In isReady VWO===");
|
34098
33858
|
return !!window._vwo_code;
|
34099
33859
|
}
|
34100
33860
|
}]);
|
@@ -34472,7 +34232,7 @@
|
|
34472
34232
|
this.build = "1.0.0";
|
34473
34233
|
this.name = "RudderLabs JavaScript SDK";
|
34474
34234
|
this.namespace = "com.rudderlabs.javascript";
|
34475
|
-
this.version = "1.3
|
34235
|
+
this.version = "1.4.3";
|
34476
34236
|
});
|
34477
34237
|
|
34478
34238
|
// Library information class
|
@@ -34480,7 +34240,7 @@
|
|
34480
34240
|
_classCallCheck(this, RudderLibraryInfo);
|
34481
34241
|
|
34482
34242
|
this.name = "RudderLabs JavaScript SDK";
|
34483
|
-
this.version = "1.3
|
34243
|
+
this.version = "1.4.3";
|
34484
34244
|
}); // Operating System information class
|
34485
34245
|
|
34486
34246
|
|
@@ -36389,7 +36149,7 @@
|
|
36389
36149
|
};
|
36390
36150
|
var payload = JSON.stringify(data, this.replacer);
|
36391
36151
|
var blob = new Blob([payload], {
|
36392
|
-
type: "
|
36152
|
+
type: "text/plain"
|
36393
36153
|
});
|
36394
36154
|
var isPushed = navigator.sendBeacon("".concat(this.url, "?writeKey=").concat(this.writekey), blob);
|
36395
36155
|
|
@@ -36447,7 +36207,7 @@
|
|
36447
36207
|
var queueOptions = {};
|
36448
36208
|
var targetUrl = url.slice(-1) === "/" ? url.slice(0, -1) : url;
|
36449
36209
|
|
36450
|
-
if (options && options.useBeacon) {
|
36210
|
+
if (options && options.useBeacon && navigator.sendBeacon) {
|
36451
36211
|
if (options && options.beaconQueueOptions && options.beaconQueueOptions != null && _typeof(options.beaconQueueOptions) === "object") {
|
36452
36212
|
queueOptions = options.beaconQueueOptions;
|
36453
36213
|
}
|
@@ -36455,6 +36215,10 @@
|
|
36455
36215
|
targetUrl = "".concat(targetUrl, "/beacon/v1/batch");
|
36456
36216
|
this.queue = new BeaconQueue();
|
36457
36217
|
} else {
|
36218
|
+
if (options && options.useBeacon) {
|
36219
|
+
logger.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR");
|
36220
|
+
}
|
36221
|
+
|
36458
36222
|
if (options && options.queueOptions && options.queueOptions != null && _typeof(options.queueOptions) === "object") {
|
36459
36223
|
queueOptions = options.queueOptions;
|
36460
36224
|
}
|
@@ -38106,20 +37870,19 @@
|
|
38106
37870
|
return true;
|
38107
37871
|
}
|
38108
37872
|
/**
|
38109
|
-
*
|
38110
|
-
*
|
37873
|
+
* Load after polyfills are loaded
|
38111
37874
|
* @param {*} writeKey
|
38112
|
-
* @
|
37875
|
+
* @param {*} serverUrl
|
37876
|
+
* @param {*} options
|
37877
|
+
* @returns
|
38113
37878
|
*/
|
38114
37879
|
|
38115
37880
|
}, {
|
38116
|
-
key: "
|
38117
|
-
value: function
|
37881
|
+
key: "loadAfterPolyfill",
|
37882
|
+
value: function loadAfterPolyfill(writeKey, serverUrl, options) {
|
38118
37883
|
var _this4 = this;
|
38119
37884
|
|
38120
|
-
logger.debug("inside load ");
|
38121
37885
|
if (options && options.cookieConsentManager) this.cookieConsentOptions = lodash_clonedeep(options.cookieConsentManager);
|
38122
|
-
if (this.loaded) return;
|
38123
37886
|
var configUrl = CONFIG_URL;
|
38124
37887
|
|
38125
37888
|
if (!this.isValidWriteKey(writeKey) || !this.isValidServerUrl(serverUrl)) {
|
@@ -38244,6 +38007,37 @@
|
|
38244
38007
|
|
38245
38008
|
processDataInAnalyticsArray(this);
|
38246
38009
|
}
|
38010
|
+
/**
|
38011
|
+
* Call control pane to get client configs
|
38012
|
+
*
|
38013
|
+
* @param {*} writeKey
|
38014
|
+
* @memberof Analytics
|
38015
|
+
*/
|
38016
|
+
|
38017
|
+
}, {
|
38018
|
+
key: "load",
|
38019
|
+
value: function load(writeKey, serverUrl, options) {
|
38020
|
+
// logger.debug("inside load ");
|
38021
|
+
if (this.loaded) return; // check if the below features are available in the browser or not
|
38022
|
+
// If not present dynamically load from the polyfill cdn
|
38023
|
+
|
38024
|
+
if (!String.prototype.endsWith || !String.prototype.startsWith || !String.prototype.includes || !Array.prototype.find || !Array.prototype.includes || !Promise || !Object.entries) {
|
38025
|
+
ScriptLoader("polyfill", POLYFILL_URL);
|
38026
|
+
var self = this;
|
38027
|
+
var interval = setInterval(function () {
|
38028
|
+
// check if the polyfill is loaded
|
38029
|
+
if (window.hasOwnProperty("polyfill")) {
|
38030
|
+
clearInterval(interval);
|
38031
|
+
self.loadAfterPolyfill(writeKey, serverUrl, options);
|
38032
|
+
}
|
38033
|
+
}, 100);
|
38034
|
+
setTimeout(function () {
|
38035
|
+
clearInterval(interval);
|
38036
|
+
}, MAX_WAIT_FOR_INTEGRATION_LOAD);
|
38037
|
+
} else {
|
38038
|
+
this.loadAfterPolyfill(writeKey, serverUrl, options);
|
38039
|
+
}
|
38040
|
+
}
|
38247
38041
|
}, {
|
38248
38042
|
key: "ready",
|
38249
38043
|
value: function ready(callback) {
|