@ada-support/embed2 1.0.59 → 1.0.60

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.
@@ -1,3 +1,3 @@
1
- import { StoreMutations } from "common/types/index";
1
+ import type { StoreMutations } from "common/types";
2
2
  declare const mutations: StoreMutations;
3
3
  export default mutations;
@@ -8788,7 +8788,7 @@ var client = new error_tracker_BrowserClient({
8788
8788
  return event;
8789
8789
  },
8790
8790
  environment: "production",
8791
- release: "1.0.59-1ff8966",
8791
+ release: "1.0.60-8beb5c8",
8792
8792
  sampleRate: 0.25,
8793
8793
  autoSessionTracking: false,
8794
8794
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -9488,7 +9488,7 @@ function getEmbedURL(_ref) {
9488
9488
  polyfillVersionString = "legacy";
9489
9489
  }
9490
9490
 
9491
- return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "1ff8966", "/index.html");
9491
+ return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "8beb5c8", "/index.html");
9492
9492
  }
9493
9493
  /**
9494
9494
  * Generate the Chat / API URL
@@ -11687,7 +11687,7 @@ var ChatFrame = /*#__PURE__*/function (_Component) {
11687
11687
  this.bindChatEventHandlers();
11688
11688
  this.handleScrollLock(); // We use this log to track number of chat impressions (times when users see chat iFrame render first time).
11689
11689
 
11690
- (0,services_logger/* log */.c)("Chat frame mount", {
11690
+ (0,services_logger/* log */.cM)("Chat frame mount", {
11691
11691
  handle: handle,
11692
11692
  embedSettings: adaSettings
11693
11693
  }); // Delay to allow inline css animation to work.
@@ -13466,7 +13466,7 @@ var Container = /*#__PURE__*/function (_Component) {
13466
13466
  newClient = new Client(clientResponse.client);
13467
13467
 
13468
13468
  if (!newClient.features.chat_ui_v2) {
13469
- (0,services_logger/* log */.c)("Clients on old UI", {
13469
+ (0,services_logger/* log */.cM)("Clients on old UI", {
13470
13470
  clientHandle: newClient.handle
13471
13471
  });
13472
13472
  }
@@ -14368,7 +14368,7 @@ window.__AdaEmbedConstructor = Embed;
14368
14368
  /* harmony export */ });
14369
14369
  var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(97|(9[8-9]|\\d{3,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(15|(1[6-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(96|(9[7-9]|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
14370
14370
  var isProduction = "production" === "production";
14371
- var embed2Version = "1ff8966";
14371
+ var embed2Version = "8beb5c8";
14372
14372
 
14373
14373
  /***/ }),
14374
14374
 
@@ -14625,8 +14625,9 @@ function httpRequest(obj) {
14625
14625
 
14626
14626
  "use strict";
14627
14627
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14628
- /* harmony export */ "c": function() { return /* binding */ log; }
14628
+ /* harmony export */ "cM": function() { return /* binding */ log; }
14629
14629
  /* harmony export */ });
14630
+ /* unused harmony exports DEFAULT_LOG_SAMPLE_RATE, shouldLog */
14630
14631
  /* harmony import */ var _babel_runtime_corejs3_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2149);
14631
14632
  /* harmony import */ var _babel_runtime_corejs3_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3938);
14632
14633
  /* harmony import */ var _babel_runtime_corejs3_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3109);
@@ -14647,7 +14648,9 @@ function httpRequest(obj) {
14647
14648
  /* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_properties__WEBPACK_IMPORTED_MODULE_8__);
14648
14649
  /* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(3978);
14649
14650
  /* harmony import */ var _babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_corejs3_core_js_stable_object_define_property__WEBPACK_IMPORTED_MODULE_9__);
14650
- /* harmony import */ var common_helpers_http__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(9392);
14651
+ /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(773);
14652
+ /* harmony import */ var lodash_memoize__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(lodash_memoize__WEBPACK_IMPORTED_MODULE_11__);
14653
+ /* harmony import */ var common_helpers_http__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9392);
14651
14654
 
14652
14655
 
14653
14656
 
@@ -14665,23 +14668,23 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
14665
14668
 
14666
14669
 
14667
14670
 
14671
+
14668
14672
  var DEFAULT_LOG_SAMPLE_RATE = 0.01; // 1% of logs will go through
14669
14673
 
14670
14674
  var DD_BASE_URL = "https://browser-http-intake.logs.datadoghq.com/v1/input/";
14671
- var DD_TOKEN = "pubfe23baedd2ea322bebb5ed2020fa2fa1";
14675
+ var DD_TOKEN = "pubfe23baedd2ea322bebb5ed2020fa2fa1"; // We need memoization to ensure consistency of logs
14672
14676
 
14673
- var shouldLog = function shouldLog(sampleRate) {
14674
- if (!DD_TOKEN || sampleRate !== undefined && sampleRate <= 0) {
14677
+ var shouldLog = lodash_memoize__WEBPACK_IMPORTED_MODULE_11___default()(function (sampleRate) {
14678
+ if (!DD_TOKEN || sampleRate === 0) {
14675
14679
  return false;
14676
14680
  }
14677
14681
 
14678
14682
  return Math.random() < (sampleRate || DEFAULT_LOG_SAMPLE_RATE);
14679
- };
14683
+ });
14680
14684
  /**
14681
14685
  * Sends log to Datadog
14682
14686
  */
14683
14687
 
14684
-
14685
14688
  function log(_x, _x2, _x3) {
14686
14689
  return _log.apply(this, arguments);
14687
14690
  }
@@ -14701,18 +14704,19 @@ function _log() {
14701
14704
 
14702
14705
  case 2:
14703
14706
  _context.next = 4;
14704
- return (0,common_helpers_http__WEBPACK_IMPORTED_MODULE_11__/* ["default"] */ .Z)({
14707
+ return (0,common_helpers_http__WEBPACK_IMPORTED_MODULE_12__/* ["default"] */ .Z)({
14705
14708
  url: "".concat(DD_BASE_URL).concat(DD_TOKEN, "?ddsource=browser&ddtags=version:1.5.0"),
14706
14709
  method: "POST",
14707
14710
  body: _babel_runtime_corejs3_core_js_stable_json_stringify__WEBPACK_IMPORTED_MODULE_10___default()(_objectSpread(_objectSpread({
14708
14711
  message: message
14709
14712
  }, extra), {}, {
14713
+ sampleRate: (options === null || options === void 0 ? void 0 : options.sampleRate) || DEFAULT_LOG_SAMPLE_RATE,
14710
14714
  service: "embed",
14711
14715
  env: "production",
14712
14716
  embedVersion: 2,
14713
- version: "1.0.59",
14717
+ version: "1.0.60",
14714
14718
  isNpm: true,
14715
- commitHash: "1ff8966"
14719
+ commitHash: "8beb5c8"
14716
14720
  }))
14717
14721
  });
14718
14722
 
@@ -23723,6 +23727,689 @@ function toNumber(value) {
23723
23727
  module.exports = debounce;
23724
23728
 
23725
23729
 
23730
+ /***/ }),
23731
+
23732
+ /***/ 773:
23733
+ /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
23734
+
23735
+ /**
23736
+ * lodash (Custom Build) <https://lodash.com/>
23737
+ * Build: `lodash modularize exports="npm" -o ./`
23738
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
23739
+ * Released under MIT license <https://lodash.com/license>
23740
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
23741
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
23742
+ */
23743
+
23744
+ /** Used as the `TypeError` message for "Functions" methods. */
23745
+ var FUNC_ERROR_TEXT = 'Expected a function';
23746
+
23747
+ /** Used to stand-in for `undefined` hash values. */
23748
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
23749
+
23750
+ /** `Object#toString` result references. */
23751
+ var funcTag = '[object Function]',
23752
+ genTag = '[object GeneratorFunction]';
23753
+
23754
+ /**
23755
+ * Used to match `RegExp`
23756
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
23757
+ */
23758
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
23759
+
23760
+ /** Used to detect host constructors (Safari). */
23761
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
23762
+
23763
+ /** Detect free variable `global` from Node.js. */
23764
+ var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
23765
+
23766
+ /** Detect free variable `self`. */
23767
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
23768
+
23769
+ /** Used as a reference to the global object. */
23770
+ var root = freeGlobal || freeSelf || Function('return this')();
23771
+
23772
+ /**
23773
+ * Gets the value at `key` of `object`.
23774
+ *
23775
+ * @private
23776
+ * @param {Object} [object] The object to query.
23777
+ * @param {string} key The key of the property to get.
23778
+ * @returns {*} Returns the property value.
23779
+ */
23780
+ function getValue(object, key) {
23781
+ return object == null ? undefined : object[key];
23782
+ }
23783
+
23784
+ /**
23785
+ * Checks if `value` is a host object in IE < 9.
23786
+ *
23787
+ * @private
23788
+ * @param {*} value The value to check.
23789
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
23790
+ */
23791
+ function isHostObject(value) {
23792
+ // Many host objects are `Object` objects that can coerce to strings
23793
+ // despite having improperly defined `toString` methods.
23794
+ var result = false;
23795
+ if (value != null && typeof value.toString != 'function') {
23796
+ try {
23797
+ result = !!(value + '');
23798
+ } catch (e) {}
23799
+ }
23800
+ return result;
23801
+ }
23802
+
23803
+ /** Used for built-in method references. */
23804
+ var arrayProto = Array.prototype,
23805
+ funcProto = Function.prototype,
23806
+ objectProto = Object.prototype;
23807
+
23808
+ /** Used to detect overreaching core-js shims. */
23809
+ var coreJsData = root['__core-js_shared__'];
23810
+
23811
+ /** Used to detect methods masquerading as native. */
23812
+ var maskSrcKey = (function() {
23813
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
23814
+ return uid ? ('Symbol(src)_1.' + uid) : '';
23815
+ }());
23816
+
23817
+ /** Used to resolve the decompiled source of functions. */
23818
+ var funcToString = funcProto.toString;
23819
+
23820
+ /** Used to check objects for own properties. */
23821
+ var hasOwnProperty = objectProto.hasOwnProperty;
23822
+
23823
+ /**
23824
+ * Used to resolve the
23825
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
23826
+ * of values.
23827
+ */
23828
+ var objectToString = objectProto.toString;
23829
+
23830
+ /** Used to detect if a method is native. */
23831
+ var reIsNative = RegExp('^' +
23832
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
23833
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
23834
+ );
23835
+
23836
+ /** Built-in value references. */
23837
+ var splice = arrayProto.splice;
23838
+
23839
+ /* Built-in method references that are verified to be native. */
23840
+ var Map = getNative(root, 'Map'),
23841
+ nativeCreate = getNative(Object, 'create');
23842
+
23843
+ /**
23844
+ * Creates a hash object.
23845
+ *
23846
+ * @private
23847
+ * @constructor
23848
+ * @param {Array} [entries] The key-value pairs to cache.
23849
+ */
23850
+ function Hash(entries) {
23851
+ var index = -1,
23852
+ length = entries ? entries.length : 0;
23853
+
23854
+ this.clear();
23855
+ while (++index < length) {
23856
+ var entry = entries[index];
23857
+ this.set(entry[0], entry[1]);
23858
+ }
23859
+ }
23860
+
23861
+ /**
23862
+ * Removes all key-value entries from the hash.
23863
+ *
23864
+ * @private
23865
+ * @name clear
23866
+ * @memberOf Hash
23867
+ */
23868
+ function hashClear() {
23869
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
23870
+ }
23871
+
23872
+ /**
23873
+ * Removes `key` and its value from the hash.
23874
+ *
23875
+ * @private
23876
+ * @name delete
23877
+ * @memberOf Hash
23878
+ * @param {Object} hash The hash to modify.
23879
+ * @param {string} key The key of the value to remove.
23880
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
23881
+ */
23882
+ function hashDelete(key) {
23883
+ return this.has(key) && delete this.__data__[key];
23884
+ }
23885
+
23886
+ /**
23887
+ * Gets the hash value for `key`.
23888
+ *
23889
+ * @private
23890
+ * @name get
23891
+ * @memberOf Hash
23892
+ * @param {string} key The key of the value to get.
23893
+ * @returns {*} Returns the entry value.
23894
+ */
23895
+ function hashGet(key) {
23896
+ var data = this.__data__;
23897
+ if (nativeCreate) {
23898
+ var result = data[key];
23899
+ return result === HASH_UNDEFINED ? undefined : result;
23900
+ }
23901
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
23902
+ }
23903
+
23904
+ /**
23905
+ * Checks if a hash value for `key` exists.
23906
+ *
23907
+ * @private
23908
+ * @name has
23909
+ * @memberOf Hash
23910
+ * @param {string} key The key of the entry to check.
23911
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
23912
+ */
23913
+ function hashHas(key) {
23914
+ var data = this.__data__;
23915
+ return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
23916
+ }
23917
+
23918
+ /**
23919
+ * Sets the hash `key` to `value`.
23920
+ *
23921
+ * @private
23922
+ * @name set
23923
+ * @memberOf Hash
23924
+ * @param {string} key The key of the value to set.
23925
+ * @param {*} value The value to set.
23926
+ * @returns {Object} Returns the hash instance.
23927
+ */
23928
+ function hashSet(key, value) {
23929
+ var data = this.__data__;
23930
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
23931
+ return this;
23932
+ }
23933
+
23934
+ // Add methods to `Hash`.
23935
+ Hash.prototype.clear = hashClear;
23936
+ Hash.prototype['delete'] = hashDelete;
23937
+ Hash.prototype.get = hashGet;
23938
+ Hash.prototype.has = hashHas;
23939
+ Hash.prototype.set = hashSet;
23940
+
23941
+ /**
23942
+ * Creates an list cache object.
23943
+ *
23944
+ * @private
23945
+ * @constructor
23946
+ * @param {Array} [entries] The key-value pairs to cache.
23947
+ */
23948
+ function ListCache(entries) {
23949
+ var index = -1,
23950
+ length = entries ? entries.length : 0;
23951
+
23952
+ this.clear();
23953
+ while (++index < length) {
23954
+ var entry = entries[index];
23955
+ this.set(entry[0], entry[1]);
23956
+ }
23957
+ }
23958
+
23959
+ /**
23960
+ * Removes all key-value entries from the list cache.
23961
+ *
23962
+ * @private
23963
+ * @name clear
23964
+ * @memberOf ListCache
23965
+ */
23966
+ function listCacheClear() {
23967
+ this.__data__ = [];
23968
+ }
23969
+
23970
+ /**
23971
+ * Removes `key` and its value from the list cache.
23972
+ *
23973
+ * @private
23974
+ * @name delete
23975
+ * @memberOf ListCache
23976
+ * @param {string} key The key of the value to remove.
23977
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
23978
+ */
23979
+ function listCacheDelete(key) {
23980
+ var data = this.__data__,
23981
+ index = assocIndexOf(data, key);
23982
+
23983
+ if (index < 0) {
23984
+ return false;
23985
+ }
23986
+ var lastIndex = data.length - 1;
23987
+ if (index == lastIndex) {
23988
+ data.pop();
23989
+ } else {
23990
+ splice.call(data, index, 1);
23991
+ }
23992
+ return true;
23993
+ }
23994
+
23995
+ /**
23996
+ * Gets the list cache value for `key`.
23997
+ *
23998
+ * @private
23999
+ * @name get
24000
+ * @memberOf ListCache
24001
+ * @param {string} key The key of the value to get.
24002
+ * @returns {*} Returns the entry value.
24003
+ */
24004
+ function listCacheGet(key) {
24005
+ var data = this.__data__,
24006
+ index = assocIndexOf(data, key);
24007
+
24008
+ return index < 0 ? undefined : data[index][1];
24009
+ }
24010
+
24011
+ /**
24012
+ * Checks if a list cache value for `key` exists.
24013
+ *
24014
+ * @private
24015
+ * @name has
24016
+ * @memberOf ListCache
24017
+ * @param {string} key The key of the entry to check.
24018
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
24019
+ */
24020
+ function listCacheHas(key) {
24021
+ return assocIndexOf(this.__data__, key) > -1;
24022
+ }
24023
+
24024
+ /**
24025
+ * Sets the list cache `key` to `value`.
24026
+ *
24027
+ * @private
24028
+ * @name set
24029
+ * @memberOf ListCache
24030
+ * @param {string} key The key of the value to set.
24031
+ * @param {*} value The value to set.
24032
+ * @returns {Object} Returns the list cache instance.
24033
+ */
24034
+ function listCacheSet(key, value) {
24035
+ var data = this.__data__,
24036
+ index = assocIndexOf(data, key);
24037
+
24038
+ if (index < 0) {
24039
+ data.push([key, value]);
24040
+ } else {
24041
+ data[index][1] = value;
24042
+ }
24043
+ return this;
24044
+ }
24045
+
24046
+ // Add methods to `ListCache`.
24047
+ ListCache.prototype.clear = listCacheClear;
24048
+ ListCache.prototype['delete'] = listCacheDelete;
24049
+ ListCache.prototype.get = listCacheGet;
24050
+ ListCache.prototype.has = listCacheHas;
24051
+ ListCache.prototype.set = listCacheSet;
24052
+
24053
+ /**
24054
+ * Creates a map cache object to store key-value pairs.
24055
+ *
24056
+ * @private
24057
+ * @constructor
24058
+ * @param {Array} [entries] The key-value pairs to cache.
24059
+ */
24060
+ function MapCache(entries) {
24061
+ var index = -1,
24062
+ length = entries ? entries.length : 0;
24063
+
24064
+ this.clear();
24065
+ while (++index < length) {
24066
+ var entry = entries[index];
24067
+ this.set(entry[0], entry[1]);
24068
+ }
24069
+ }
24070
+
24071
+ /**
24072
+ * Removes all key-value entries from the map.
24073
+ *
24074
+ * @private
24075
+ * @name clear
24076
+ * @memberOf MapCache
24077
+ */
24078
+ function mapCacheClear() {
24079
+ this.__data__ = {
24080
+ 'hash': new Hash,
24081
+ 'map': new (Map || ListCache),
24082
+ 'string': new Hash
24083
+ };
24084
+ }
24085
+
24086
+ /**
24087
+ * Removes `key` and its value from the map.
24088
+ *
24089
+ * @private
24090
+ * @name delete
24091
+ * @memberOf MapCache
24092
+ * @param {string} key The key of the value to remove.
24093
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
24094
+ */
24095
+ function mapCacheDelete(key) {
24096
+ return getMapData(this, key)['delete'](key);
24097
+ }
24098
+
24099
+ /**
24100
+ * Gets the map value for `key`.
24101
+ *
24102
+ * @private
24103
+ * @name get
24104
+ * @memberOf MapCache
24105
+ * @param {string} key The key of the value to get.
24106
+ * @returns {*} Returns the entry value.
24107
+ */
24108
+ function mapCacheGet(key) {
24109
+ return getMapData(this, key).get(key);
24110
+ }
24111
+
24112
+ /**
24113
+ * Checks if a map value for `key` exists.
24114
+ *
24115
+ * @private
24116
+ * @name has
24117
+ * @memberOf MapCache
24118
+ * @param {string} key The key of the entry to check.
24119
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
24120
+ */
24121
+ function mapCacheHas(key) {
24122
+ return getMapData(this, key).has(key);
24123
+ }
24124
+
24125
+ /**
24126
+ * Sets the map `key` to `value`.
24127
+ *
24128
+ * @private
24129
+ * @name set
24130
+ * @memberOf MapCache
24131
+ * @param {string} key The key of the value to set.
24132
+ * @param {*} value The value to set.
24133
+ * @returns {Object} Returns the map cache instance.
24134
+ */
24135
+ function mapCacheSet(key, value) {
24136
+ getMapData(this, key).set(key, value);
24137
+ return this;
24138
+ }
24139
+
24140
+ // Add methods to `MapCache`.
24141
+ MapCache.prototype.clear = mapCacheClear;
24142
+ MapCache.prototype['delete'] = mapCacheDelete;
24143
+ MapCache.prototype.get = mapCacheGet;
24144
+ MapCache.prototype.has = mapCacheHas;
24145
+ MapCache.prototype.set = mapCacheSet;
24146
+
24147
+ /**
24148
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
24149
+ *
24150
+ * @private
24151
+ * @param {Array} array The array to inspect.
24152
+ * @param {*} key The key to search for.
24153
+ * @returns {number} Returns the index of the matched value, else `-1`.
24154
+ */
24155
+ function assocIndexOf(array, key) {
24156
+ var length = array.length;
24157
+ while (length--) {
24158
+ if (eq(array[length][0], key)) {
24159
+ return length;
24160
+ }
24161
+ }
24162
+ return -1;
24163
+ }
24164
+
24165
+ /**
24166
+ * The base implementation of `_.isNative` without bad shim checks.
24167
+ *
24168
+ * @private
24169
+ * @param {*} value The value to check.
24170
+ * @returns {boolean} Returns `true` if `value` is a native function,
24171
+ * else `false`.
24172
+ */
24173
+ function baseIsNative(value) {
24174
+ if (!isObject(value) || isMasked(value)) {
24175
+ return false;
24176
+ }
24177
+ var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
24178
+ return pattern.test(toSource(value));
24179
+ }
24180
+
24181
+ /**
24182
+ * Gets the data for `map`.
24183
+ *
24184
+ * @private
24185
+ * @param {Object} map The map to query.
24186
+ * @param {string} key The reference key.
24187
+ * @returns {*} Returns the map data.
24188
+ */
24189
+ function getMapData(map, key) {
24190
+ var data = map.__data__;
24191
+ return isKeyable(key)
24192
+ ? data[typeof key == 'string' ? 'string' : 'hash']
24193
+ : data.map;
24194
+ }
24195
+
24196
+ /**
24197
+ * Gets the native function at `key` of `object`.
24198
+ *
24199
+ * @private
24200
+ * @param {Object} object The object to query.
24201
+ * @param {string} key The key of the method to get.
24202
+ * @returns {*} Returns the function if it's native, else `undefined`.
24203
+ */
24204
+ function getNative(object, key) {
24205
+ var value = getValue(object, key);
24206
+ return baseIsNative(value) ? value : undefined;
24207
+ }
24208
+
24209
+ /**
24210
+ * Checks if `value` is suitable for use as unique object key.
24211
+ *
24212
+ * @private
24213
+ * @param {*} value The value to check.
24214
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
24215
+ */
24216
+ function isKeyable(value) {
24217
+ var type = typeof value;
24218
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
24219
+ ? (value !== '__proto__')
24220
+ : (value === null);
24221
+ }
24222
+
24223
+ /**
24224
+ * Checks if `func` has its source masked.
24225
+ *
24226
+ * @private
24227
+ * @param {Function} func The function to check.
24228
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
24229
+ */
24230
+ function isMasked(func) {
24231
+ return !!maskSrcKey && (maskSrcKey in func);
24232
+ }
24233
+
24234
+ /**
24235
+ * Converts `func` to its source code.
24236
+ *
24237
+ * @private
24238
+ * @param {Function} func The function to process.
24239
+ * @returns {string} Returns the source code.
24240
+ */
24241
+ function toSource(func) {
24242
+ if (func != null) {
24243
+ try {
24244
+ return funcToString.call(func);
24245
+ } catch (e) {}
24246
+ try {
24247
+ return (func + '');
24248
+ } catch (e) {}
24249
+ }
24250
+ return '';
24251
+ }
24252
+
24253
+ /**
24254
+ * Creates a function that memoizes the result of `func`. If `resolver` is
24255
+ * provided, it determines the cache key for storing the result based on the
24256
+ * arguments provided to the memoized function. By default, the first argument
24257
+ * provided to the memoized function is used as the map cache key. The `func`
24258
+ * is invoked with the `this` binding of the memoized function.
24259
+ *
24260
+ * **Note:** The cache is exposed as the `cache` property on the memoized
24261
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
24262
+ * constructor with one whose instances implement the
24263
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
24264
+ * method interface of `delete`, `get`, `has`, and `set`.
24265
+ *
24266
+ * @static
24267
+ * @memberOf _
24268
+ * @since 0.1.0
24269
+ * @category Function
24270
+ * @param {Function} func The function to have its output memoized.
24271
+ * @param {Function} [resolver] The function to resolve the cache key.
24272
+ * @returns {Function} Returns the new memoized function.
24273
+ * @example
24274
+ *
24275
+ * var object = { 'a': 1, 'b': 2 };
24276
+ * var other = { 'c': 3, 'd': 4 };
24277
+ *
24278
+ * var values = _.memoize(_.values);
24279
+ * values(object);
24280
+ * // => [1, 2]
24281
+ *
24282
+ * values(other);
24283
+ * // => [3, 4]
24284
+ *
24285
+ * object.a = 2;
24286
+ * values(object);
24287
+ * // => [1, 2]
24288
+ *
24289
+ * // Modify the result cache.
24290
+ * values.cache.set(object, ['a', 'b']);
24291
+ * values(object);
24292
+ * // => ['a', 'b']
24293
+ *
24294
+ * // Replace `_.memoize.Cache`.
24295
+ * _.memoize.Cache = WeakMap;
24296
+ */
24297
+ function memoize(func, resolver) {
24298
+ if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
24299
+ throw new TypeError(FUNC_ERROR_TEXT);
24300
+ }
24301
+ var memoized = function() {
24302
+ var args = arguments,
24303
+ key = resolver ? resolver.apply(this, args) : args[0],
24304
+ cache = memoized.cache;
24305
+
24306
+ if (cache.has(key)) {
24307
+ return cache.get(key);
24308
+ }
24309
+ var result = func.apply(this, args);
24310
+ memoized.cache = cache.set(key, result);
24311
+ return result;
24312
+ };
24313
+ memoized.cache = new (memoize.Cache || MapCache);
24314
+ return memoized;
24315
+ }
24316
+
24317
+ // Assign cache to `_.memoize`.
24318
+ memoize.Cache = MapCache;
24319
+
24320
+ /**
24321
+ * Performs a
24322
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
24323
+ * comparison between two values to determine if they are equivalent.
24324
+ *
24325
+ * @static
24326
+ * @memberOf _
24327
+ * @since 4.0.0
24328
+ * @category Lang
24329
+ * @param {*} value The value to compare.
24330
+ * @param {*} other The other value to compare.
24331
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
24332
+ * @example
24333
+ *
24334
+ * var object = { 'a': 1 };
24335
+ * var other = { 'a': 1 };
24336
+ *
24337
+ * _.eq(object, object);
24338
+ * // => true
24339
+ *
24340
+ * _.eq(object, other);
24341
+ * // => false
24342
+ *
24343
+ * _.eq('a', 'a');
24344
+ * // => true
24345
+ *
24346
+ * _.eq('a', Object('a'));
24347
+ * // => false
24348
+ *
24349
+ * _.eq(NaN, NaN);
24350
+ * // => true
24351
+ */
24352
+ function eq(value, other) {
24353
+ return value === other || (value !== value && other !== other);
24354
+ }
24355
+
24356
+ /**
24357
+ * Checks if `value` is classified as a `Function` object.
24358
+ *
24359
+ * @static
24360
+ * @memberOf _
24361
+ * @since 0.1.0
24362
+ * @category Lang
24363
+ * @param {*} value The value to check.
24364
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
24365
+ * @example
24366
+ *
24367
+ * _.isFunction(_);
24368
+ * // => true
24369
+ *
24370
+ * _.isFunction(/abc/);
24371
+ * // => false
24372
+ */
24373
+ function isFunction(value) {
24374
+ // The use of `Object#toString` avoids issues with the `typeof` operator
24375
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
24376
+ var tag = isObject(value) ? objectToString.call(value) : '';
24377
+ return tag == funcTag || tag == genTag;
24378
+ }
24379
+
24380
+ /**
24381
+ * Checks if `value` is the
24382
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
24383
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
24384
+ *
24385
+ * @static
24386
+ * @memberOf _
24387
+ * @since 0.1.0
24388
+ * @category Lang
24389
+ * @param {*} value The value to check.
24390
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
24391
+ * @example
24392
+ *
24393
+ * _.isObject({});
24394
+ * // => true
24395
+ *
24396
+ * _.isObject([1, 2, 3]);
24397
+ * // => true
24398
+ *
24399
+ * _.isObject(_.noop);
24400
+ * // => true
24401
+ *
24402
+ * _.isObject(null);
24403
+ * // => false
24404
+ */
24405
+ function isObject(value) {
24406
+ var type = typeof value;
24407
+ return !!value && (type == 'object' || type == 'function');
24408
+ }
24409
+
24410
+ module.exports = memoize;
24411
+
24412
+
23726
24413
  /***/ }),
23727
24414
 
23728
24415
  /***/ 5666:
@@ -24970,7 +25657,7 @@ function _loadEmbed() {
24970
25657
  polyfillVersionString = "legacy";
24971
25658
  }
24972
25659
 
24973
- embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "1ff8966", "/index.js");
25660
+ embedScriptSource = concat_default()(_context16 = concat_default()(_context17 = "".concat(host, "/embed/")).call(_context17, polyfillVersionString, "/client/")).call(_context16, "8beb5c8", "/index.js");
24974
25661
  }
24975
25662
 
24976
25663
  clientScriptExists = Boolean( true || // The client script is bundled with npm module
@@ -25093,7 +25780,7 @@ function createEmbedObject() {
25093
25780
  embed = null;
25094
25781
  });
25095
25782
  startEmbedResolve();
25096
- (0,logger/* log */.c)("Embed start", {
25783
+ (0,logger/* log */.cM)("Embed start", {
25097
25784
  handle: adaSettings.handle,
25098
25785
  embedSettings: adaSettings,
25099
25786
  hostPage: window.location.href
@@ -1,3 +1,6 @@
1
+ /// <reference types="lodash" />
2
+ export declare const DEFAULT_LOG_SAMPLE_RATE = 0.01;
3
+ export declare const shouldLog: ((sampleRate?: number) => boolean) & import("lodash").MemoizedFunction;
1
4
  /**
2
5
  * Sends log to Datadog
3
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.0.59",
3
+ "version": "1.0.60",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index.d.ts",
@@ -10,7 +10,7 @@
10
10
  "build:modern": "NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
11
11
  "build:npm-types": "tsc --project tsconfig.npm.json --declaration --outDir dist/npm-entry --emitDeclarationOnly --allowJs false --checkJs false",
12
12
  "build:npm": "./npm-build.sh",
13
- "lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings 80",
13
+ "lint": "tsc --noEmit --strict false && ./node_modules/.bin/eslint --report-unused-disable-directives --ext .js,.jsx,.ts,.tsx . --max-warnings 77",
14
14
  "lint:fix": "yarn lint --fix",
15
15
  "deploy-legacy": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=legacy npx webpack --config webpack.prod.ts",
16
16
  "deploy-modern": "TS_NODE_PROJECT=wp.tsconfig.json NODE_ENV=production BROWSERSLIST_ENV=modern npx webpack --config webpack.prod.ts",
@@ -59,6 +59,7 @@
59
59
  "@types/jest": "^27.0.2",
60
60
  "@types/json-stable-stringify": "^1.0.33",
61
61
  "@types/lodash.debounce": "^4.0.6",
62
+ "@types/lodash.memoize": "^4.1.6",
62
63
  "@types/node": "^16.7.1",
63
64
  "@types/uniqid": "^5.3.2",
64
65
  "@types/webpack": "^5.28.0",
@@ -108,6 +109,7 @@
108
109
  "html-webpack-plugin": "^5.5.0",
109
110
  "json-stable-stringify": "^1.0.1",
110
111
  "lodash.debounce": "^4.0.8",
112
+ "lodash.memoize": "^4.1.2",
111
113
  "preact": "10.4.5",
112
114
  "typescript": "^4.5.5",
113
115
  "uniqid": "^5.3.0",