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/index.js","webpack://@sklik/component-spenttime/webpack/bootstrap","webpack://@sklik/component-spenttime/webpack/runtime/compat get default export","webpack://@sklik/component-spenttime/webpack/runtime/define property getters","webpack://@sklik/component-spenttime/webpack/runtime/global","webpack://@sklik/component-spenttime/webpack/runtime/hasOwnProperty shorthand","webpack://@sklik/component-spenttime/webpack/runtime/node module decorator","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/log.js","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/constants.js","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/window.js","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/url.js","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/getShouldLog.js","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/index.js","webpack://@sklik/component-spenttime/./src/modules/debug.ts","webpack://@sklik/component-spenttime/./src/constants/index.ts","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/permanent.js","webpack://@sklik/component-spenttime/./node_modules/@iva/debugger/dist/esm/status.js","webpack://@sklik/component-spenttime/./src/utils/addCustomEvent.ts","webpack://@sklik/component-spenttime/./src/modules/dot.ts","webpack://@sklik/component-spenttime/./src/modules/hit.ts","webpack://@sklik/component-spenttime/./src/modules/config/checks.ts","webpack://@sklik/component-spenttime/./src/utils/getElement.ts","webpack://@sklik/component-spenttime/./src/modules/config/config.ts","webpack://@sklik/component-spenttime/./src/utils/getDeviceType.ts","webpack://@sklik/component-spenttime/./src/classes/spenttime.class.ts","webpack://@sklik/component-spenttime/./src/utils/jsonParse.ts","webpack://@sklik/component-spenttime/./src/classes/stateSwitch.class.ts","webpack://@sklik/component-spenttime/./node_modules/throttle-debounce/esm/index.js","webpack://@sklik/component-spenttime/./src/modules/events/userActivityEvents.ts","webpack://@sklik/component-spenttime/./src/modules/events/userLoginEvents.ts","webpack://@sklik/component-spenttime/./src/modules/events/pageVisibilityEvents.ts","webpack://@sklik/component-spenttime/./src/modules/events/containerVisibilityEvents.ts","webpack://@sklik/component-spenttime/./src/modules/events/itemsVisibilityEvents.ts","webpack://@sklik/component-spenttime/./src/modules/events/containerMutationEvents.ts","webpack://@sklik/component-spenttime/./src/modules/events/index.ts","webpack://@sklik/component-spenttime/./src/modules/stateSwitch.ts","webpack://@sklik/component-spenttime/./src/modules/spenttime/measurement.ts","webpack://@sklik/component-spenttime/./src/index.ts"],"sourcesContent":["/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n // Don't return `map.set` because it's not chainable in IE 11.\n map.set(pair[0], pair[1]);\n return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n // Don't return `set.add` because it's not chainable in IE 11.\n set.add(value);\n return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array ? array.length : 0;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n Map = getNative(root, 'Map'),\n Promise = getNative(root, 'Promise'),\n Set = getNative(root, 'Set'),\n WeakMap = getNative(root, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var cache = this.__data__;\n if (cache instanceof ListCache) {\n var pairs = cache.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n return this;\n }\n cache = this.__data__ = new MapCache(pairs);\n }\n cache.set(key, value);\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n var result;\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n if (isHostObject(value)) {\n return object ? value : {};\n }\n result = initCloneObject(isFunc ? {} : value);\n if (!isDeep) {\n return copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, baseClone, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (!isArr) {\n var props = isFull ? getAllKeys(value) : keys(value);\n }\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n });\n return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var result = new buffer.constructor(buffer.length);\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = objectToString.call(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : undefined;\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return cloneMap(object, isDeep, cloneFunc);\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return cloneSet(object, isDeep, cloneFunc);\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = cloneDeep;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","__webpack_require__.nmd = function(module) {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import cloneDeep from 'lodash.clonedeep';\n/**\n * Logs message into console if proper UTM set to truthy value.\n * @param {object} - Configuration with log details.\n * @param {('log'|'warn'|'error'|'info'|'table')} [type = 'log'] - Type of console, if not specified defaults to \"log\".\n * @param {string | number} [subName] - additional service name subtype, can be used to log error code number\n * @param {unknown[]} [messages] - Data to be displayed as in console.\n */\nconst log = (config, type = 'log', subName, ...messages) => {\n const { name, fColor, bColor } = config;\n const style = `display: inline-block; color: ${fColor}; background: ${bColor}; padding: 1px 4px; border-radius: 3px;`;\n const badge = `%c${name}${subName ? ' ' + subName : ''}`;\n const messagesCopy = (messages !== null && messages !== void 0 ? messages : []).map((v) => cloneDeep(v));\n if (type === 'table' && messagesCopy.length === 1) {\n // print data in table, badge in the separate log\n console.log(badge, style);\n console.table(messagesCopy[0]);\n }\n else if (type === 'table' && messagesCopy.length === 2) {\n // print data in table, badge and message in the separate log\n console.log(badge, style, messagesCopy[0]);\n console.table(messagesCopy[1]);\n }\n else {\n // print any messages with a badge\n console[type](badge, style, ...messagesCopy);\n }\n};\nexport { log };\n","const ENABLER = 'sznivadbg';\nconst PERMANENT_ENABLER = 'sznivadbgsave';\nconst EVENT_PREFIX = 'iva_dbg_event_';\nconst DEFAULTS = {\n FCOLOR: 'white',\n BCOLOR: 'black',\n};\nexport { ENABLER, EVENT_PREFIX, DEFAULTS, PERMANENT_ENABLER };\n","import { getDebuggerRule } from './getShouldLog';\nimport { EVENT_PREFIX } from './constants';\nimport { log } from './log';\nimport { getInternalConfig } from './index';\nconst isTopLevel = (win = window) => (win.top === win.self || !!win.Cypress) && !win.frameElement;\n/**\n * Gets debugger window object from window.sznIVA.debugger, or returns undefined if it doesn't exist.\n * @returns\n */\nconst getGlobalDebuggerObject = () => { var _a; return (_a = window.sznIVA) === null || _a === void 0 ? void 0 : _a.debugger; };\n/**\n * Creates or updates debugger window object in window.sznIVA.debugger.\n * @param windowObject Object with properties to update.\n */\nconst upsertGlobalDebuggerObject = (windowObject) => {\n window.sznIVA = window.sznIVA || {};\n window.sznIVA.debugger = Object.assign(Object.assign({}, window.sznIVA.debugger), windowObject);\n};\n/**\n * Returns top frame debugger rule saved in the window object.\n */\nconst getTopFrameRule = () => { var _a; return (_a = getGlobalDebuggerObject()) === null || _a === void 0 ? void 0 : _a.topFrameRule; };\n/**\n * Handles message event from iframes requesting debugger rule.\n */\nconst handlerFromChildMessage = (event) => {\n var _a;\n if (event.source && event.data.type === `${EVENT_PREFIX}request_debug_settings`) {\n const rule = getDebuggerRule();\n event.source.postMessage({\n type: `${EVENT_PREFIX}debug_settings`,\n rule,\n }, '*');\n if (!((_a = getGlobalDebuggerObject()) === null || _a === void 0 ? void 0 : _a.iframeBridgeNotified)) {\n if (rule) {\n log(getInternalConfig(), undefined, undefined, `Top frame sends a debugger rule \"${rule}\" to iframes.`);\n }\n upsertGlobalDebuggerObject({ iframeBridgeNotified: true });\n }\n }\n};\n/**\n * Handles message event from top window containing debugger rule.\n */\nconst handlerFromTopMessage = (event) => {\n if (event.data.type === `${EVENT_PREFIX}debug_settings`) {\n upsertGlobalDebuggerObject({ topFrameRule: event.data.rule });\n }\n};\n/**\n * Init mechanism of getting current debugging rule from top window.\n */\nconst initIframeBridge = () => {\n if (isTopLevel()) {\n window.addEventListener('message', (event) => handlerFromChildMessage(event));\n }\n else {\n window.addEventListener('message', (event) => handlerFromTopMessage(event));\n window.top.postMessage({ type: `${EVENT_PREFIX}request_debug_settings` }, document.referrer || '*');\n }\n};\nexport { getInternalConfig, getTopFrameRule, getGlobalDebuggerObject, initIframeBridge, isTopLevel, upsertGlobalDebuggerObject, };\n","const getParamValue = (param) => {\n const queryString = window.location.search || '';\n const paramRegex = new RegExp(`${param}=([^&]*)`);\n const matches = queryString.match(paramRegex) || [];\n return matches.length > 1 ? matches[1] : null;\n};\nexport { getParamValue };\n","import { getGlobalDebuggerObject, getTopFrameRule, isTopLevel, upsertGlobalDebuggerObject } from './window';\nimport { ENABLER } from './constants';\nimport { getParamValue } from './url';\nimport { log } from './log';\nimport { getInternalConfig } from './index';\nconst getDebuggerRule = () => {\n var _a;\n const paramValue = getParamValue(ENABLER);\n if (paramValue) {\n return paramValue;\n }\n const topFrameRule = getTopFrameRule();\n if (topFrameRule) {\n return topFrameRule;\n }\n try {\n const localStorageRule = ((_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.getItem(ENABLER)) || '';\n if (localStorageRule) {\n return localStorageRule;\n }\n }\n catch (error) {\n log(getInternalConfig(), 'warn', undefined, JSON.stringify(error));\n }\n return '';\n};\n/**\n * Finds component name in provided string and decides whether to log based on it.\n * @param {String | null} paramValue Value of debug UTM\n * @param {*} name Name of current library\n * @return {Boolean} Should log or not\n */\nconst findNameInValue = (paramValue, name) => {\n // empty string, or any falsey\n if (!paramValue) {\n return false;\n }\n // if paramValue === \"1\" always log\n if (paramValue === '1') {\n return true;\n }\n // if paramValue contains \"!\" allowed libraries are defined by exclusion\n if (~paramValue.indexOf('!')) {\n if (~paramValue.toLowerCase().indexOf(`!${name.toLowerCase()}`)) {\n return false;\n }\n return true;\n }\n // if paramValue isn't \"1\" and contains name - should log\n if (~paramValue.toLowerCase().indexOf(name.toLowerCase())) {\n return true;\n }\n // did not fit any category - should NOT log\n return false;\n};\n/**\n * Decides whether current library should be logging.\n * @param {*} name Name of current library\n * @return {Boolean} Should log or not\n */\nconst getShouldLog = (name) => {\n var _a;\n const rule = getDebuggerRule();\n if (!((_a = getGlobalDebuggerObject()) === null || _a === void 0 ? void 0 : _a.welcomeNotified) && rule && isTopLevel()) {\n upsertGlobalDebuggerObject({ welcomeNotified: true });\n log(getInternalConfig(), 'log', undefined, '===============================================\\n' +\n ` | 🕷 DEBUGGER is set to \"${rule}\".\\n` +\n ` | Use \"1\" to let any component log or use component name[s] to filter them.\\n` +\n ` | Using \\\"!component\\\" lets log all components except those listed.\\n` +\n ` | Save the rule to local storage using GET parameter \"?sznivadbgsave=${rule}\"\\n` +\n ` | and remove it by \"?sznivadbgsave=\".\\n` +\n ` \\`=======================================================`);\n }\n return findNameInValue(rule, name);\n};\nexport { findNameInValue, getShouldLog, getDebuggerRule };\n","var __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { log } from './log';\nimport { status } from './status';\nimport { getShouldLog } from './getShouldLog';\nimport { DEFAULTS } from './constants';\nimport { initIframeBridge } from './window';\nimport { permanentEnabler } from './permanent';\n/**\n * Returns debugger Config for the debugger itself.\n * @returns Debugger Config\n */\nconst getInternalConfig = () => ({\n name: 'debugger',\n fColor: '#AAA',\n bColor: '#777',\n});\ninitIframeBridge();\n/**\n * Returns debug function based on config (name and colors)\n */\nconst debugFactory = (config) => {\n permanentEnabler();\n config = Object.assign({ fColor: DEFAULTS.FCOLOR, bColor: DEFAULTS.BCOLOR }, config);\n if (!(config && config.name && config.fColor && config.bColor)) {\n // in order not to break whomever is importing\n // return a function that can still be called\n return () => false;\n }\n const debug = (...args) => {\n const types = ['log', 'warn', 'error', 'info', 'table'];\n const argsCount = args.length;\n const shouldLog = getShouldLog(config.name);\n if (!shouldLog || argsCount === 0) {\n // nothing to log, just return shouldLog\n return shouldLog;\n }\n // debug({type: 'error', subName: '7845', message: 'Oh no', data: {...}, ...});\n // or debug({state: '...', ...})\n if (argsCount === 1 && typeof args[0] === 'object' && !Array.isArray(args[0]) && args[0] !== null) {\n const _a = args[0], { state, type, subName, message } = _a, data = __rest(_a, [\"state\", \"type\", \"subName\", \"message\"]);\n if (shouldLog) {\n const logArgs = [];\n if (message !== undefined) {\n logArgs.push(message);\n }\n if (Object.values(data).length === 1) {\n logArgs.push(data[Object.keys(data)[0]]);\n }\n else if (Object.values(data).length) {\n logArgs.push(data);\n }\n log(config, type, subName, ...logArgs);\n }\n if (state) {\n status(config, state, data);\n }\n return shouldLog;\n }\n // debug('Look what happens.');\n // debug(['someData', '...'}); anything else then object\n if (shouldLog && argsCount === 1) {\n log(config, 'log', undefined, args[0]);\n return shouldLog;\n }\n // debug('error', 'Oh no, there is an error.'); or other types, like warn, info, table...\n // debug('error', {someData: '...'});\n if (shouldLog && argsCount === 2 && ~types.indexOf(args[0])) {\n log(config, args[0], undefined, args[1]);\n return shouldLog;\n }\n // debug('Look at this data', data, [moreData, ...]);\n if (shouldLog && argsCount > 1 && !~types.indexOf(args[0])) {\n log(config, 'log', undefined, ...args);\n return shouldLog;\n }\n // debug('error', 'Oh no, there is an error, look at this data', data, [moreData, ...]);\n // debug('table', 'Look at this data', data);\n if (shouldLog && argsCount > 2 && ~types.indexOf(args[0])) {\n log(config, args[0], undefined, ...args.slice(1));\n return shouldLog;\n }\n // Some other args combination we forgot to cover? This shouldn't happen.\n log(getInternalConfig(), 'warn', undefined, 'Debugger received unknown argument combination. args:', args);\n return shouldLog;\n };\n return debug;\n};\nexport { debugFactory, getInternalConfig };\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { debugFactory } from '@iva/debugger';\nexport var DEBUG_CONFIG = {\n name: 'component-spenttime',\n bColor: '#35b5a2',\n fColor: '#fff',\n};\n// states for the debugger\nexport var DEBUG_STATES = {\n START: 'start',\n DONE: 'done',\n ERROR: 'error',\n};\n// Use the parameter ?sznivadbg=1 or ?sznivadbg=component-spenttime for debugging\nvar debug = debugFactory(DEBUG_CONFIG);\nexport var debugObject = function (obj) {\n var str = JSON.stringify(obj);\n str.replace(/\\}/g, '\\n}\\n');\n str.replace(/\\{/g, '\\n}\\n');\n debug(str);\n};\nexport var spenttimeDebug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var dateOptions = {\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n };\n var time = new Intl.DateTimeFormat('cz-CS', dateOptions).format(new Date()) + ' ';\n if (args.length === 1 && typeof args[0] === 'string') {\n debug(time + args[0]);\n return;\n }\n if (args.length === 1 && typeof args[0] === 'object') {\n var obj = args[0];\n var message = obj.message;\n debug(__assign(__assign({}, args[0]), { message: time + message }));\n return;\n }\n debug(args);\n};\n","// Action value in hit\nexport var HIT_ACTION_NAME = 'component-spenttime';\n// The time (ms) we wait for the DOT to load\nexport var DOT_WAITING_TIME = 10000;\n// Delaytime of user activity events\nexport var THROTTLE_DELAY = 1000; // 1s\n// Device type\n// eslint-disable-next-line no-shadow\nexport var DEVICE_TYPE;\n(function (DEVICE_TYPE) {\n DEVICE_TYPE[\"DESKTOP\"] = \"desktop\";\n DEVICE_TYPE[\"MOBILE\"] = \"mobile\";\n})(DEVICE_TYPE || (DEVICE_TYPE = {}));\nexport var ITEM_MONITORED_ATTRIBUTE = 'data-analytics-spent-time-item-monitored';\nexport var DEFAULT_CONFIG = {\n container: {\n // Intersection threshold of target element\n intersectionThreshold: 0.05, // 5%\n },\n mobile: {\n measuring: true,\n // User inactivity time, after which we pause the spentime calculation (the user fell asleep)\n fallAsleepTime: 15000, // (milliseconds) 15 seconds\n // User inactivity time, after which we stop counting the time spent (the user has left)\n forcedDepartureTime: 30 * 60 * 1000, // (ms) 30 minut\n },\n desktop: {\n measuring: true,\n // User inactivity time, after which we pause the spentime calculation (the user fell asleep)\n fallAsleepTime: 45000, // (milliseconds) 45 seconds\n // User inactivity time, after which we stop counting the time spent (the user has left)\n forcedDepartureTime: 30 * 60 * 1000, // (ms) 30 minut\n },\n};\nexport var DEFAULT_ITEMS_CONFIG = {\n numberOfItemsInHit: 20,\n attributeWithDopDetails: null,\n mobile: {\n // The delay time on desktop devices\n measurementStartDelay: 500, // (ms) 0.5s\n // Intersection threshold of target element in target area\n intersectionThreshold: 0.75, // 75%\n // the screen area where the user reads articles\n targetAreaHeight: 1.0, // 100%\n targetAreaWidth: 1.0, // 100%\n },\n desktop: {\n // The delay time on desktop devices\n measurementStartDelay: 1000, // (ms) 1s\n // Intersection threshold of target element in target area\n intersectionThreshold: 0.75, // 75%\n // the screen area where the user reads articles\n targetAreaHeight: 1.0, // 100%\n targetAreaWidth: 1.0, // 100%\n },\n};\n// eslint-disable-next-line no-shadow\nexport var EVENT;\n(function (EVENT) {\n EVENT[\"measurementWillNotBePerformed\"] = \"szn:spenttime:measurementWillNotBePerformed\";\n EVENT[\"waitingForDot\"] = \"szn:spenttime:waitingForDot\";\n EVENT[\"stateInited\"] = \"szn:spenttime:stateInited\";\n EVENT[\"stateRun\"] = \"szn:spenttime:stateRun\";\n EVENT[\"statePaused\"] = \"szn:spenttime:statePaused\";\n EVENT[\"stateDone\"] = \"szn:spenttime:stateDone\";\n})(EVENT || (EVENT = {}));\n// Measurement spenttime states\n// eslint-disable-next-line no-shadow\nexport var SPENTTIME_STATES;\n(function (SPENTTIME_STATES) {\n SPENTTIME_STATES[\"inited\"] = \"inited\";\n SPENTTIME_STATES[\"running\"] = \"running\";\n SPENTTIME_STATES[\"paused\"] = \"paused\";\n SPENTTIME_STATES[\"done\"] = \"done\";\n})(SPENTTIME_STATES || (SPENTTIME_STATES = {}));\n","import { getInternalConfig } from './window';\nimport { log } from './log';\nimport { ENABLER, PERMANENT_ENABLER } from './constants';\nimport { getParamValue } from './url';\n/**\n * Checking of save command in GET params and saving the value to local storage.\n */\nconst permanentEnabler = () => {\n var _a, _b, _c;\n const paramValue = getParamValue(PERMANENT_ENABLER);\n // nothing in URL\n if (paramValue === null) {\n return;\n }\n const lastValue = (_a = window.localStorage) === null || _a === void 0 ? void 0 : _a.getItem(ENABLER);\n if (\n // rule in URL is the same as the saved one (preventing console bloating)\n paramValue == lastValue ||\n // rule was already deleted\n (lastValue === null && paramValue === '')) {\n // do nothing\n return;\n }\n if (paramValue === '') {\n // blank string to remove the saved rule\n (_b = window.localStorage) === null || _b === void 0 ? void 0 : _b.removeItem(ENABLER);\n log(getInternalConfig(), undefined, undefined, 'Rule was removed from the local storage.');\n }\n else {\n // a string to save to the local storage\n (_c = window.localStorage) === null || _c === void 0 ? void 0 : _c.setItem(ENABLER, paramValue !== null && paramValue !== void 0 ? paramValue : '');\n log(getInternalConfig(), undefined, undefined, `Rule \"${paramValue}\" was saved to the local storage.`);\n }\n};\nexport { permanentEnabler };\n","import { EVENT_PREFIX } from './constants';\n/**\n * Saves current progress into window object and emits CustomEvent\n * @param {Object} config Object holding necessary constants\n * @param {('start'|'done'|'error')} state Event describing current state\n * @param {Object} data Data to be saved to window and emitted with event\n */\nconst status = (config, state, data) => {\n const { name } = config;\n const EVENT_TYPE = `${EVENT_PREFIX}${name}`;\n const detail = Object.assign({ state }, data);\n // Add to window\n window.sznIVA = window.sznIVA || {};\n window.sznIVA[name] = window.sznIVA[name] || {};\n // Overwrite data, but do not remove any properties\n Object.assign(window.sznIVA[name], detail);\n // Emit CustomEvent\n const event = new CustomEvent(EVENT_TYPE, { detail });\n window.dispatchEvent(event);\n};\nexport { status };\n","export var addEventForCypress = function (eventName, id) {\n if (id === void 0) { id = ''; }\n var detail = id ? { detail: { id: id } } : null;\n if (window.Cypress) {\n window.dispatchEvent(new CustomEvent(eventName, detail));\n }\n};\n","import { DOT_WAITING_TIME, EVENT } from '../constants';\nimport { DEBUG_STATES, spenttimeDebug as debug } from './debug';\nimport { addEventForCypress } from '../utils/addCustomEvent';\nimport { completeMeasurement } from './spenttime/measurement';\nvar dotConfigured = false;\n/**\n * Checks that the DOT is loaded and DOT was configured\n * @returns boolean status\n */\nexport var isDotConfigured = function () {\n var _a, _b;\n if (dotConfigured) {\n return true;\n }\n if ((_b = (_a = window.DOT) === null || _a === void 0 ? void 0 : _a.isConfigured) === null || _b === void 0 ? void 0 : _b.call(_a)) {\n debug('There is DOT');\n dotConfigured = true;\n return true;\n }\n else {\n return false;\n }\n};\n/**\n * Сhecks that the DOT is loaded and starts the func(funParameters)\n */\nexport var waitingForDOT = function () {\n // waiting for DOT for DOT_WAITING_TIME ms\n addEventForCypress(EVENT.waitingForDot);\n window.setTimeout(function () {\n if (isDotConfigured()) {\n dotConfigured = true;\n }\n else {\n debug({\n type: 'error',\n message: \"Error: There is no DOT or DOT is not configured. Measuring the spenttime is not possible\",\n state: DEBUG_STATES.ERROR,\n });\n completeMeasurement();\n addEventForCypress(EVENT.measurementWillNotBePerformed);\n }\n }, DOT_WAITING_TIME);\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { spenttimeDebug as debug } from './debug';\nimport { HIT_ACTION_NAME } from '../constants/index';\nimport { isDotConfigured } from './dot';\n/**\n * Object with common data to send in hit\n */\nvar commonHitData = {\n action: HIT_ACTION_NAME,\n};\nexport var getHitData = function (data) {\n return __assign(__assign({}, commonHitData), data);\n};\n/**\n * Saves common data for hit\n * @param data Object with data to hit\n */\nexport var saveHitData = function (data) {\n commonHitData = __assign(__assign({}, commonHitData), data);\n};\n/**\n * Sends hit with data to the server\n * @param data Object with data to hit\n */\nexport var sendHit = function (data) {\n var finalHitData = getHitData(data);\n if (isDotConfigured()) {\n window.DOT.hit('event', { d: __assign({}, finalHitData) });\n debug(__assign({ message: '[ HIT ] Hit was sent:' }, finalHitData));\n }\n};\n","import { getElement } from '../../utils/getElement';\n/**\n * Searches and returns for a container element\n * @param incomingElement Id (string) or selector (string) or HTMLElement\n * @returns HTMLElement or null (if the element is not found)\n */\nexport var getContainerElement = function (incomingElement) {\n var element = getElement(incomingElement);\n if (!element) {\n return null;\n }\n return element;\n};\n/**\n * Сhecks the times (fallAsleepTime and forcedDepartureTime) depending on the type of device\n * @param deviceConfig Configuration with times\n * @returns Configuration with times is correct (true) or not (false)\n */\nexport var isUserActivityTimeCorrect = function (deviceConfig) {\n return (deviceConfig.fallAsleepTime &&\n deviceConfig.fallAsleepTime > 0 &&\n deviceConfig.forcedDepartureTime &&\n deviceConfig.forcedDepartureTime > 0);\n};\n/**\n * Сhecks value of percent\n * @param num Value\n * @returns Value is correct (true) or not (false)\n */\nexport var isPercent = function (num) { return num >= 0 && num <= 1; };\n/**\n * Сhecks delay\n * @param delay Value\n * @returns Value is correct (true) or not (false)\n */\nexport var isDelayCorrect = function (delay) { return delay >= 0; };\n/**\n * Checks number of items in hit\n * @param num Value\n * @returns Value is correct (true) or not (false)\n */\nexport var isNumberOfItemsInHitCorrect = function (num) { return num >= 1; };\n/**\n * Checks selector validity\n * @param selector Selector\n * @returns Value is correct (true) or not (false)\n */\nexport var isSelectorValid = function (selector) {\n try {\n document.createDocumentFragment().querySelector(selector);\n }\n catch (_a) {\n return false;\n }\n return true;\n};\n/**\n * Checks string for an empty value\n * @param str String\n * @returns Value is not empty (true) or not (false)\n */\nexport var isNotEmptyString = function (str) { return str.trim() !== ''; };\n","/**\n * Gets an element by id or selector and checks its existence on the page\n * @param elementId The value by which we will try to find the element\n * @returns HTML element or null (if the element was not found on the page)\n */\nexport var getElement = function (elementId) {\n if (typeof elementId === 'object' && elementId.nodeType && document.body.contains(elementId)) {\n // elementId is HTMLElement\n return elementId;\n }\n if (!elementId || typeof elementId !== 'string') {\n // not an element, not a string -> nothing to return\n return null;\n }\n // search by id\n var elementById = document.getElementById(elementId);\n if (elementById) {\n return elementById;\n }\n // search by selector\n try {\n return document.querySelector(elementId);\n }\n catch (_a) {\n return null;\n }\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { DEBUG_STATES, spenttimeDebug as debug } from '../debug';\nimport { getDeviceType } from '../../utils/getDeviceType';\nimport { DEFAULT_CONFIG, DEFAULT_ITEMS_CONFIG } from '../../constants';\nimport { getContainerElement, isUserActivityTimeCorrect, isPercent, isDelayCorrect, isNumberOfItemsInHitCorrect, isSelectorValid, isNotEmptyString, } from './checks';\n/**\n * Сhecks the incoming parameters of ITEM config and if everything is fine, returns the verified ITEM configuration or null\n * @param incomingItemsConfig Object with incoming item configuration\n * @param deviceType Device type\n * @returns Object of verified item configuration\n */\nvar getVerifiedItemsConfig = function (incomingItemsConfig, deviceType) {\n if (!incomingItemsConfig ||\n !isSelectorValid(incomingItemsConfig.selector) ||\n !isNotEmptyString(incomingItemsConfig.attributeWithDopId)) {\n debug({\n type: 'warn',\n message: '[ITEMS CONF] Warning: Required parameters for measuring the spent time on items ' +\n 'are missing or incorrect. The items measurement will not be performed.',\n });\n return null;\n }\n var attributeWithDopDetails = incomingItemsConfig.attributeWithDopDetails\n ? incomingItemsConfig.attributeWithDopDetails\n : DEFAULT_ITEMS_CONFIG.attributeWithDopDetails;\n var numberOfItemsInHit = isNumberOfItemsInHitCorrect(incomingItemsConfig.numberOfItemsInHit)\n ? incomingItemsConfig.numberOfItemsInHit\n : DEFAULT_ITEMS_CONFIG.numberOfItemsInHit;\n var deviceItemsConfig = __assign(__assign({}, DEFAULT_ITEMS_CONFIG[deviceType]), incomingItemsConfig[deviceType]);\n if (!isDelayCorrect(deviceItemsConfig.measurementStartDelay)) {\n debug({\n type: 'warn',\n message: '[ITEMS CONF] Warning: items.measurementStartDelay is not correct. The items measurement will not be performed.',\n });\n return null;\n }\n if (!isPercent(deviceItemsConfig.intersectionThreshold)) {\n debug({\n type: 'warn',\n message: '[ITEMS CONF] Warning: items.intersectionThreshold is not correct. The items measurement will not be performed.',\n });\n return null;\n }\n if (!isPercent(deviceItemsConfig.targetAreaHeight) || !isPercent(deviceItemsConfig.targetAreaWidth)) {\n debug({\n type: 'warn',\n message: '[ITEMS CONF] Warning: target area size for items is not correct. The items measurement will not be performed.',\n });\n return null;\n }\n return {\n selector: incomingItemsConfig.selector,\n attributeWithDopId: incomingItemsConfig.attributeWithDopId,\n attributeWithDopDetails: attributeWithDopDetails,\n numberOfItemsInHit: numberOfItemsInHit,\n measurementStartDelay: deviceItemsConfig.measurementStartDelay,\n intersectionThreshold: deviceItemsConfig.intersectionThreshold,\n targetAreaHeight: deviceItemsConfig.targetAreaHeight,\n targetAreaWidth: deviceItemsConfig.targetAreaWidth,\n };\n};\n/**\n * Сhecks the incoming parameters of config and if everything is fine, returns the verified configuration or null\n * @param incomingElement HTMLElement or element Id or selector\n * @param incomingConfig Object with incoming configuration\n * @returns Object of verified configuration\n */\nexport var getVerifiedConfig = function (incomingElement, incomingConfig) {\n var _a, _b;\n if (incomingConfig === void 0) { incomingConfig = {}; }\n // Сhecking that the element exists\n var container = getContainerElement(incomingElement);\n if (!container) {\n debug({\n type: 'error',\n message: \"[CONF] Error: html element by \\\"\".concat(incomingElement, \"\\\" not found.\"),\n state: DEBUG_STATES.ERROR,\n });\n return null;\n }\n // Сhecking the time configuration for different devices\n var deviceType = getDeviceType();\n var deviceConfig = __assign(__assign({}, DEFAULT_CONFIG[deviceType]), incomingConfig[deviceType]);\n deviceConfig.measuring = deviceConfig.measuring && isUserActivityTimeCorrect(deviceConfig);\n if (!deviceConfig.measuring) {\n debug(__assign({ type: 'warn', message: \"[CONF] Warning: The configuration for \".concat(deviceType, \" devices is not correct or measurement is disabled for this type of device.\") }, deviceConfig));\n return null;\n }\n // Checking the intersection threshold for container element\n var intersectionThreshold = ((_a = incomingConfig.container) === null || _a === void 0 ? void 0 : _a.intersectionThreshold) || ((_b = incomingConfig.container) === null || _b === void 0 ? void 0 : _b.intersectionThreshold) === 0\n ? incomingConfig.container.intersectionThreshold\n : DEFAULT_CONFIG.container.intersectionThreshold;\n if (!isPercent(intersectionThreshold)) {\n debug({\n type: 'error',\n message: \"[CONF] Error: container.intersectionThreshold is not correct.\",\n state: DEBUG_STATES.ERROR,\n });\n return null;\n }\n // final configuration (without items configuration)\n var config = {\n fallAsleepTime: deviceConfig.fallAsleepTime,\n forcedDepartureTime: deviceConfig.forcedDepartureTime,\n device: deviceType,\n container: {\n intersectionThreshold: intersectionThreshold,\n element: container,\n },\n };\n // Cheking items configuration\n var itemsConfig = getVerifiedItemsConfig(incomingConfig.items, deviceType);\n if (itemsConfig) {\n config.items = itemsConfig;\n }\n debug(__assign({ message: 'Configuration:' }, config));\n return config;\n};\n","import { DEVICE_TYPE } from '../constants';\nexport var getDeviceType = function () {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)\n ? DEVICE_TYPE.MOBILE\n : DEVICE_TYPE.DESKTOP;\n};\n","import { spenttimeDebug as debug } from '../modules/debug';\nimport { SPENTTIME_STATES, EVENT } from '../constants';\nimport { addEventForCypress } from '../utils/addCustomEvent';\n/**\n * Сounting the spent time\n */\nvar SpenttimeHandler = /** @class */ (function () {\n /**\n * Constructor\n */\n function SpenttimeHandler(delay, id /*id only for logging and tests*/) {\n if (delay === void 0) { delay = 0; }\n if (id === void 0) { id = 'container'; }\n /**\n * Start time of the spenttime account (timestamp)\n */\n this.startTime = null;\n /**\n * Timestamp of spenttime (ms)\n */\n this.spenttime = 0;\n /**\n * Spenttime change indicator\n */\n this._wasChange = false;\n this.delay = delay;\n this.init(id);\n }\n Object.defineProperty(SpenttimeHandler.prototype, \"state\", {\n get: function () {\n return this._state;\n },\n set: function (value) {\n this._state = value;\n },\n enumerable: false,\n configurable: true\n });\n // used in the cypress\n SpenttimeHandler.prototype.getState = function () {\n return this._state;\n };\n Object.defineProperty(SpenttimeHandler.prototype, \"wasChange\", {\n get: function () {\n return this._wasChange;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * Returns the final amount of spenttime\n * @returns Spenttime (ms)\n */\n SpenttimeHandler.prototype.getSpenttime = function () {\n if (this.startTime) {\n var spenttimeWithDelay = this.spenttime + new Date().getTime() - this.startTime - this.delay;\n var finalSpenttime = spenttimeWithDelay <= 0 ? 0 : spenttimeWithDelay;\n return finalSpenttime <= 0 ? 0 : finalSpenttime;\n }\n return this.spenttime;\n };\n SpenttimeHandler.prototype.getSpenttimeInSeconds = function () {\n var finalSpenttime = this.getSpenttime();\n // milliseconds => seconds with two decimal places\n return finalSpenttime ? parseInt((finalSpenttime / 10).toString(), 10) / 100 : 0;\n };\n /**\n * Initialization\n */\n SpenttimeHandler.prototype.init = function (id /*id only for logging and tests*/) {\n if (id === void 0) { id = 'container'; }\n debug(\"INITED \\\"\".concat(id, \"\\\"\"));\n this.startTime = null;\n this.spenttime = 0;\n this._wasChange = false;\n this.state = SPENTTIME_STATES.inited;\n addEventForCypress(EVENT.stateInited, id);\n };\n /**\n * Reset\n * used after sending data to the server\n */\n SpenttimeHandler.prototype.reset = function (id /*id only for logging and tests*/) {\n if (id === void 0) { id = 'container'; }\n if (this.state === SPENTTIME_STATES.done) {\n return;\n }\n if (this.state === SPENTTIME_STATES.running) {\n this.init(id);\n this.run(id);\n }\n else {\n this.init(id);\n }\n };\n /**\n * Starting the measurement of spenttime\n */\n SpenttimeHandler.prototype.run = function (id /*id only for logging and tests*/) {\n if (id === void 0) { id = 'container'; }\n if (this.state === SPENTTIME_STATES.running || this.state === SPENTTIME_STATES.done) {\n return;\n }\n debug(\"RUN \\\"\".concat(id, \"\\\"\"));\n this.state = SPENTTIME_STATES.running;\n this._wasChange = true;\n this.startTime = new Date().getTime();\n addEventForCypress(EVENT.stateRun, id);\n };\n /**\n * Pausing the measurement of spenttime\n */\n SpenttimeHandler.prototype.pause = function (id /*id only for logging and tests*/) {\n if (id === void 0) { id = 'container'; }\n if (this.state !== SPENTTIME_STATES.running) {\n return;\n }\n debug(\"PAUSE \\\"\".concat(id, \"\\\"\"));\n this.state = SPENTTIME_STATES.paused;\n this.spenttime = this.getSpenttime();\n this.startTime = null;\n addEventForCypress(EVENT.statePaused, id);\n };\n /**\n * Completing the measurement of spenttime\n * Sending the result (time of spenttime) to the server (hit)\n */\n SpenttimeHandler.prototype.end = function () {\n if (this.state === SPENTTIME_STATES.done) {\n return;\n }\n debug('DONE');\n this.state = SPENTTIME_STATES.done;\n addEventForCypress(EVENT.stateDone);\n };\n return SpenttimeHandler;\n}());\nexport default SpenttimeHandler;\n","/**\n * checks that the string contains json\n * @param str String\n * @returns json - value is json or null\n */\nexport var jsonParse = function (str) {\n try {\n return JSON.parse(str);\n }\n catch (e) {\n return null;\n }\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { spenttimeDebug as debug } from '../modules/debug';\nimport SpenttimeHandler from './spenttime.class';\nimport { SPENTTIME_STATES } from '../constants';\nimport { sendStatistics } from '../modules/spenttime/measurement';\nimport { jsonParse } from '../utils/jsonParse';\n/**\n * Aggregator\n * All events call the methods of this class, which sets the current state\n * Based on the status, the measurement of the time spent is started, stopped, or data is sent to the server\n */\nvar StateSwitch = /** @class */ (function () {\n /**\n * Constructor\n */\n function StateSwitch(verifiedConfig) {\n this._config = verifiedConfig;\n this.containerIsVisible = false;\n this.pageIsVisible = true;\n this.userIsSleeping = false;\n this.containerSpenttime = new SpenttimeHandler();\n this.itemsState = {};\n }\n Object.defineProperty(StateSwitch.prototype, \"config\", {\n get: function () {\n return this._config;\n },\n enumerable: false,\n configurable: true\n });\n StateSwitch.prototype.getStatistics = function (reset) {\n if (reset === void 0) { reset = false; }\n // container\n var data = {\n time: this.containerSpenttime.getSpenttimeInSeconds(),\n };\n if (reset) {\n this.containerSpenttime.reset();\n }\n // items\n if (this.config.items) {\n data.items = [];\n for (var id in this.itemsState) {\n if (this.itemsState[id].spenttime.wasChange) {\n var finalSpenttime = this.itemsState[id].spenttime.getSpenttimeInSeconds();\n if (finalSpenttime > 0) {\n var itemStatistic = __assign(__assign({}, this.itemsState[id].hitData), { id: id, time: finalSpenttime });\n data.items.push(itemStatistic);\n }\n else {\n if (this.itemsState[id].spenttime.getState() !== SPENTTIME_STATES.running && reset) {\n Reflect.deleteProperty(this.itemsState, id);\n }\n }\n if (this.itemsState[id] && reset) {\n this.itemsState[id].spenttime.reset(id);\n }\n }\n }\n }\n return data;\n };\n /**\n * Starts or pauses the measurement of the spent time on the CONTAINER\n */\n StateSwitch.prototype.updateContainerSpenttimeAction = function () {\n if (this.containerIsVisible && this.pageIsVisible && !this.userIsSleeping) {\n this.containerSpenttime.run();\n }\n else {\n this.containerSpenttime.pause();\n }\n };\n StateSwitch.prototype.getState = function () {\n return {\n containerIsVisible: this.containerIsVisible,\n pageIsVisible: this.pageIsVisible,\n userIsSleeping: this.userIsSleeping,\n };\n };\n /**\n * Entry point for setting the new stat\n * @param commonState object\n */\n StateSwitch.prototype.setState = function (commonState) {\n var isChange = false;\n // State update\n if ('userIsSleeping' in commonState && this.userIsSleeping !== commonState.userIsSleeping) {\n this.userIsSleeping = commonState.userIsSleeping;\n isChange = true;\n }\n if ('containerIsVisible' in commonState && this.containerIsVisible !== commonState.containerIsVisible) {\n this.containerIsVisible = commonState.containerIsVisible;\n isChange = true;\n }\n if ('pageIsVisible' in commonState && this.pageIsVisible !== commonState.pageIsVisible) {\n this.pageIsVisible = commonState.pageIsVisible;\n isChange = true;\n }\n if (isChange) {\n this.updateContainerSpenttimeAction();\n if ('userIsSleeping' in commonState || 'pageIsVisible' in commonState) {\n this.updateAllItemsSpenttimeAction();\n }\n }\n };\n /**\n * Starts or pauses the measurement of the spent time on the ITEM\n * @param id Item id\n */\n StateSwitch.prototype.updateItemSpenttimeAction = function (id) {\n if (this.itemsState[id].isVisible && this.pageIsVisible && !this.userIsSleeping) {\n this.itemsState[id].spenttime.run(id);\n this.sendStatisticsIfEnoughItems();\n }\n else {\n this.itemsState[id].spenttime.pause(id);\n }\n };\n /**\n * Starts or pauses the measurement of the spent time on the ALL ITEMS\n */\n StateSwitch.prototype.updateAllItemsSpenttimeAction = function () {\n for (var id in this.itemsState) {\n this.updateItemSpenttimeAction(id);\n }\n };\n /**\n * This method will be called from events when the item changes visibility\n * @param id Item id\n * @param itemIsVisible The item is visible (true) or not (false)\n */\n StateSwitch.prototype.setItemState = function (id, itemIsVisible, itemElement) {\n if (itemElement === void 0) { itemElement = null; }\n if (!this.config.items) {\n return;\n }\n // new item\n if (!(id in this.itemsState)) {\n if (!itemIsVisible) {\n return;\n }\n this.itemsState[id] = {\n spenttime: new SpenttimeHandler(this.config.items.measurementStartDelay, id),\n isVisible: itemIsVisible,\n hitData: itemElement ? jsonParse(itemElement.getAttribute(this.config.items.attributeWithDopDetails)) : {},\n };\n this.updateItemSpenttimeAction(id);\n return;\n }\n // existing item\n if (this.itemsState[id].isVisible !== itemIsVisible) {\n this.itemsState[id].isVisible = itemIsVisible;\n this.updateItemSpenttimeAction(id);\n }\n };\n /**\n * Counts over how many items there was a measurement (number)\n * and sends hit if number >= config.items.numberOfItemsInHit\n */\n StateSwitch.prototype.sendStatisticsIfEnoughItems = function () {\n var number = 0;\n for (var id in this.itemsState) {\n if (this.itemsState[id].spenttime.wasChange && this.itemsState[id].spenttime.getSpenttimeInSeconds() > 0) {\n number++;\n }\n }\n debug(\"Current processed number of items: \".concat(number));\n if (number >= this.config.items.numberOfItemsInHit) {\n sendStatistics();\n }\n };\n return StateSwitch;\n}());\nexport default StateSwitch;\n","/* eslint-disable no-undefined,no-param-reassign,no-shadow */\n\n/**\n * Throttle execution of a function. Especially useful for rate limiting\n * execution of handlers on events like resize and scroll.\n *\n * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)\n * are most useful.\n * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,\n * as-is, to `callback` when the throttled-function is executed.\n * @param {object} [options] - An object to configure options.\n * @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds\n * while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed\n * one final time after the last throttled-function call. (After the throttled-function has not been called for\n * `delay` milliseconds, the internal counter is reset).\n * @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback\n * immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that\n * callback will never executed if both noLeading = true and noTrailing = true.\n * @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is\n * false (at end), schedule `callback` to execute after `delay` ms.\n *\n * @returns {Function} A new, throttled, function.\n */\nfunction throttle (delay, callback, options) {\n var _ref = options || {},\n _ref$noTrailing = _ref.noTrailing,\n noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,\n _ref$noLeading = _ref.noLeading,\n noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,\n _ref$debounceMode = _ref.debounceMode,\n debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;\n /*\n * After wrapper has stopped being called, this timeout ensures that\n * `callback` is executed at the proper times in `throttle` and `end`\n * debounce modes.\n */\n\n\n var timeoutID;\n var cancelled = false; // Keep track of the last time `callback` was executed.\n\n var lastExec = 0; // Function to clear existing timeout\n\n function clearExistingTimeout() {\n if (timeoutID) {\n clearTimeout(timeoutID);\n }\n } // Function to cancel next exec\n\n\n function cancel(options) {\n var _ref2 = options || {},\n _ref2$upcomingOnly = _ref2.upcomingOnly,\n upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;\n\n clearExistingTimeout();\n cancelled = !upcomingOnly;\n }\n /*\n * The `wrapper` function encapsulates all of the throttling / debouncing\n * functionality and when executed will limit the rate at which `callback`\n * is executed.\n */\n\n\n function wrapper() {\n for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {\n arguments_[_key] = arguments[_key];\n }\n\n var self = this;\n var elapsed = Date.now() - lastExec;\n\n if (cancelled) {\n return;\n } // Execute `callback` and update the `lastExec` timestamp.\n\n\n function exec() {\n lastExec = Date.now();\n callback.apply(self, arguments_);\n }\n /*\n * If `debounceMode` is true (at begin) this is used to clear the flag\n * to allow future `callback` executions.\n */\n\n\n function clear() {\n timeoutID = undefined;\n }\n\n if (!noLeading && debounceMode && !timeoutID) {\n /*\n * Since `wrapper` is being called for the first time and\n * `debounceMode` is true (at begin), execute `callback`\n * and noLeading != true.\n */\n exec();\n }\n\n clearExistingTimeout();\n\n if (debounceMode === undefined && elapsed > delay) {\n if (noLeading) {\n /*\n * In throttle mode with noLeading, if `delay` time has\n * been exceeded, update `lastExec` and schedule `callback`\n * to execute after `delay` ms.\n */\n lastExec = Date.now();\n\n if (!noTrailing) {\n timeoutID = setTimeout(debounceMode ? clear : exec, delay);\n }\n } else {\n /*\n * In throttle mode without noLeading, if `delay` time has been exceeded, execute\n * `callback`.\n */\n exec();\n }\n } else if (noTrailing !== true) {\n /*\n * In trailing throttle mode, since `delay` time has not been\n * exceeded, schedule `callback` to execute `delay` ms after most\n * recent execution.\n *\n * If `debounceMode` is true (at begin), schedule `clear` to execute\n * after `delay` ms.\n *\n * If `debounceMode` is false (at end), schedule `callback` to\n * execute after `delay` ms.\n */\n timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);\n }\n }\n\n wrapper.cancel = cancel; // Return the wrapper function.\n\n return wrapper;\n}\n\n/* eslint-disable no-undefined */\n/**\n * Debounce execution of a function. Debouncing, unlike throttling,\n * guarantees that a function is only executed a single time, either at the\n * very beginning of a series of calls, or at the very end.\n *\n * @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n * @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n * to `callback` when the debounced-function is executed.\n * @param {object} [options] - An object to configure options.\n * @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds\n * after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.\n * (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).\n *\n * @returns {Function} A new, debounced function.\n */\n\nfunction debounce (delay, callback, options) {\n var _ref = options || {},\n _ref$atBegin = _ref.atBegin,\n atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;\n\n return throttle(delay, callback, {\n debounceMode: atBegin !== false\n });\n}\n\nexport { debounce, throttle };\n//# sourceMappingURL=index.js.map\n","import { stateSwitch } from '../stateSwitch';\nimport { sendStatistics, completeMeasurement } from '../spenttime/measurement';\nimport { spenttimeDebug as debug } from '../debug';\nimport { throttle } from 'throttle-debounce';\nimport { THROTTLE_DELAY } from '../../constants';\n/**\n * Timer identifier of the countdown, that the user will soon fall asleep\n * (absent for some time and does not show activity)\n */\nvar timerIdUserFallsAsleep = null;\n/**\n * Timer identifier of the countdown, that the user will leave soon\n * (absent for a long time and does not show activity)\n */\nvar timerIdUserLeaves = null;\n/**\n * Starts the timer of user leaves\n * Аfter the time has expired, we believe that the user has left.\n */\nvar controlOfLeaving = function () {\n timerIdUserLeaves = window.setTimeout(function () {\n debug('[event] User leaves. Measurement will be completed');\n sendStatistics();\n completeMeasurement();\n }, stateSwitch.config.forcedDepartureTime);\n};\n/**\n * Starts the timer of user's sleep\n * Аfter the time has expired, we believe that the user has fallen asleep.\n */\nvar controlOfFallingAsleep = function () {\n timerIdUserFallsAsleep = window.setTimeout(function () {\n debug('[event] User fells asleep');\n stateSwitch.setState({ userIsSleeping: true });\n sendStatistics();\n controlOfLeaving();\n }, stateSwitch.config.fallAsleepTime);\n};\n/**\n * Clear timer \"User falls asleep\" and timer \"User leaves\"\n */\nexport var clearTimers = function () {\n if (timerIdUserFallsAsleep) {\n clearTimeout(timerIdUserFallsAsleep);\n timerIdUserFallsAsleep = null;\n }\n if (timerIdUserLeaves) {\n clearTimeout(timerIdUserLeaves);\n timerIdUserLeaves = null;\n }\n};\n/**\n * Restart timers\n */\nexport var restartTimers = function () {\n clearTimers();\n controlOfFallingAsleep();\n};\n/**\n * Throttle of activity handler\n */\nvar activity = throttle(THROTTLE_DELAY, function () {\n debug('[event] User is doing something (activity)');\n stateSwitch.setState({ userIsSleeping: false, pageIsVisible: true });\n restartTimers();\n});\n/**\n * unload event handler\n * Can set the state 'userLeaves'\n */\nvar unloadHandler = function () {\n sendStatistics();\n completeMeasurement();\n};\n/**\n * beforeunload event handler\n * Can set the state 'userLeaves'\n */\nvar beforeunloadHandler = function () {\n sendStatistics();\n completeMeasurement();\n};\n/**\n * activity ('mouseup', 'keyup', 'scroll', 'mousemove', 'touchend', 'touchmove', 'focus') event handler\n * Can set the state 'userIsSleeping'\n */\nvar activityHandler = function () {\n activity();\n};\nexport var addUserActivityListeners = function () {\n restartTimers();\n window.addEventListener('unload', unloadHandler);\n window.addEventListener('beforeunload', beforeunloadHandler);\n window.addEventListener('focus', activityHandler);\n // Catching user activity\n window.addEventListener('mouseup', activityHandler);\n window.addEventListener('mousemove', activityHandler);\n window.addEventListener('keyup', activityHandler);\n window.addEventListener('scroll', activityHandler);\n window.addEventListener('touchend', activityHandler);\n window.addEventListener('touchmove', activityHandler);\n debug('[event] User activity event listeners have been added');\n};\nexport var removeUserActivityListeners = function () {\n window.removeEventListener('unload', unloadHandler);\n window.removeEventListener('beforeunload', beforeunloadHandler);\n window.removeEventListener('focus', activityHandler);\n window.removeEventListener('mouseup', activityHandler);\n window.removeEventListener('mousemove', activityHandler);\n window.removeEventListener('keyup', activityHandler);\n window.removeEventListener('scroll', activityHandler);\n window.removeEventListener('touchend', activityHandler);\n window.removeEventListener('touchmove', activityHandler);\n clearTimers();\n debug('[event] User activity event listeners have been removed');\n};\n","import { sendStatistics } from '../spenttime/measurement';\nimport { clearTimers } from './userActivityEvents';\nimport { spenttimeDebug as debug } from '../debug';\nexport var loginHandler = function (e) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\n var changes = (_a = e.detail) === null || _a === void 0 ? void 0 : _a.changes;\n var isLoginChanged = changes.some(function (val) { return val === 'login'; });\n if (!isLoginChanged) {\n return;\n }\n var newUid = (_e = (_d = (_c = (_b = e.detail) === null || _b === void 0 ? void 0 : _b.newIdentities) === null || _c === void 0 ? void 0 : _c.login) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.uid;\n var oldUid = (_j = (_h = (_g = (_f = e.detail) === null || _f === void 0 ? void 0 : _f.oldIdentities) === null || _g === void 0 ? void 0 : _g.login) === null || _h === void 0 ? void 0 : _h.value) === null || _j === void 0 ? void 0 : _j.uid;\n debug(\"IS: New UID: \".concat(newUid, \", Old UID: \").concat(oldUid, \" \"));\n if (newUid !== oldUid) {\n debug('[event] User has been logged in a different account');\n clearTimers();\n sendStatistics();\n }\n};\nexport var addUserLoginListener = function () {\n debug('[event] User Login event listeners have been added');\n window.addEventListener('szn:identities:beforeupdate', loginHandler);\n};\nexport var removeUserLoginListener = function () {\n debug('[event] User Login event listeners have been removed');\n window.removeEventListener('szn:identities:beforeupdate', loginHandler);\n};\n","import { stateSwitch } from '../stateSwitch';\nimport { spenttimeDebug as debug } from '../debug';\nimport { restartTimers } from './userActivityEvents';\n/**\n * visibilitychange event handler\n * Can set the state 'pageIsVisible' and 'userIsSleeping'\n */\nvar visibilitychangeHandler = function () {\n debug(\"[event] Visibilitychange. User \".concat(document.hidden ? 'does not see' : 'sees', \" the page\"));\n if (document.hidden) {\n stateSwitch.setState({ pageIsVisible: false });\n }\n else {\n stateSwitch.setState({ pageIsVisible: true, userIsSleeping: false });\n restartTimers();\n }\n};\n/**\n * blur event handler\n * Can set the state 'pageIsVisible'\n */\nvar blurHandler = function () {\n debug('[event] Blur');\n stateSwitch.setState({ pageIsVisible: false });\n};\nexport var addPageVisibilityListeners = function () {\n window.addEventListener('visibilitychange', visibilitychangeHandler);\n window.addEventListener('blur', blurHandler);\n debug('[event] Page visibility event listeners have been added');\n};\nexport var removePageVisibilityListeners = function () {\n window.removeEventListener('visibilitychange', visibilitychangeHandler);\n window.removeEventListener('blur', blurHandler);\n debug('[event] Page visibility event listeners have been removed');\n};\n","import { stateSwitch } from '../stateSwitch';\nimport { spenttimeDebug as debug } from '../debug';\nimport { restartTimers } from './userActivityEvents';\nvar containerIntersectionObserver = null;\n/**\n * The handler that is executed when the visibility of the container changes\n * Can set the state 'containerIsVisible'\n * @param entries Interface of the Intersection Observer\n */\nvar containerVisibilityHandler = function (entries) {\n if (!Array.isArray(entries) || entries.length === 0) {\n return;\n }\n var isIntersecting = entries[0].isIntersecting; // only container element\n debug(\"Element is \".concat(isIntersecting ? '' : 'not ', \"visible \\\"container\\\"\"));\n stateSwitch.setState({\n containerIsVisible: isIntersecting,\n userIsSleeping: false,\n pageIsVisible: true,\n });\n if (isIntersecting) {\n restartTimers();\n }\n};\n/**\n * Adds container visibilitychange event handler\n */\nexport var addContainerVisibilityEventListener = function () {\n containerIntersectionObserver = new IntersectionObserver(containerVisibilityHandler, {\n threshold: [stateSwitch.config.container.intersectionThreshold],\n });\n debug({\n message: \"[conta]: threshold = [\".concat(stateSwitch.config.container.intersectionThreshold, \"]\"),\n });\n containerIntersectionObserver.observe(stateSwitch.config.container.element);\n debug('[event] Container visibility event listener have been added');\n};\n/**\n * Removes container visibilitychange event listener\n */\nexport var removeContainerVisibilityEventListener = function () {\n containerIntersectionObserver.unobserve(stateSwitch.config.container.element);\n containerIntersectionObserver = null;\n debug('[event] Container visibility event listener have been disabled');\n};\n","import { spenttimeDebug as debug } from '../debug';\nimport { ITEM_MONITORED_ATTRIBUTE } from '../../constants';\nimport { stateSwitch } from '../stateSwitch';\nvar itemsIntersectionObserver = null;\n/**\n * The handler that is executed when the visibility of the items changes\n * Can set the state item 'isVisible'\n * @param entries Interface of the Intersection Observer\n */\nvar itemVisibilityHandler = function (entries) {\n entries.forEach(function (_a) {\n var element = _a.target, isIntersecting = _a.isIntersecting;\n var id = element.getAttribute(stateSwitch.config.items.attributeWithDopId);\n debug({ message: \"Element is \".concat(isIntersecting ? '' : 'not ', \"visible \\\"\").concat(id, \"\\\"\") });\n stateSwitch.setItemState(id, isIntersecting, element);\n });\n};\n/**\n * Create intersection observer for items\n */\nexport var createItemsIntersectionObserver = function () {\n if (!stateSwitch.config.items) {\n return;\n }\n var getMargin = function (areaSize) { return Math.round(100 - areaSize * 100); };\n var rMargin = getMargin(stateSwitch.config.items.targetAreaWidth);\n var bMargin = getMargin(stateSwitch.config.items.targetAreaHeight);\n var formatMargin = function (margin) { return (margin > 0 ? \"-\".concat(margin, \"%\") : '0%'); };\n var rootMargin = \"0% \".concat(formatMargin(rMargin), \" \").concat(formatMargin(bMargin), \" 0%\"); //top, right, bottom, left\n itemsIntersectionObserver = new IntersectionObserver(itemVisibilityHandler, {\n rootMargin: rootMargin,\n threshold: [stateSwitch.config.items.intersectionThreshold],\n });\n debug({\n message: \"[items]: rootMargin = \\\"\".concat(rootMargin, \"\\\", threshold = [\").concat(stateSwitch.config.items.intersectionThreshold, \"]\"),\n });\n};\n/**\n * Adds items visibilitychange event handler\n */\nexport var addItemsVisibilityEventListeners = function () {\n if (!(itemsIntersectionObserver && stateSwitch.config.items)) {\n return;\n }\n //[data-analytics-spent-time-item]:not([data-analytics-spent-time-item-monitored])\n var selectorWithoutMonitoredItems = stateSwitch.config.items.selector + \":not([\".concat(ITEM_MONITORED_ATTRIBUTE, \"])\");\n var items = document.querySelectorAll(selectorWithoutMonitoredItems);\n if (items.length === 0) {\n return;\n }\n debug(\"[items] Number of tracked items: \".concat(items.length, \".\"));\n items.forEach(function (element) {\n if (element.hasAttribute(stateSwitch.config.items.attributeWithDopId)) {\n itemsIntersectionObserver.observe(element);\n element.setAttribute(ITEM_MONITORED_ATTRIBUTE, 'true');\n }\n });\n debug('[event] Items visibility event listeners have been added');\n};\n/**\n * Removes items visibilitychange event listener\n */\nexport var removeItemsVisibilityEventListeners = function () {\n var selectorMonitoredItems = stateSwitch.config.items.selector + \"[\".concat(ITEM_MONITORED_ATTRIBUTE, \"]\");\n var items = document.querySelectorAll(selectorMonitoredItems);\n items.forEach(function (element) {\n itemsIntersectionObserver.unobserve(element);\n element.removeAttribute(ITEM_MONITORED_ATTRIBUTE);\n });\n itemsIntersectionObserver = null;\n debug('[event] Items visibility event listeners have been disabled');\n};\n","import { stateSwitch } from '../stateSwitch';\nimport { addItemsVisibilityEventListeners } from './itemsVisibilityEvents';\nimport { spenttimeDebug as debug } from '../debug';\nvar containerMutationObserver = null;\n/**\n * The handler that is executed when the container has been changed\n */\nvar containerMutationHandler = function () {\n addItemsVisibilityEventListeners();\n};\n/**\n * Adds container mutation event handler\n */\nexport var addContainerMutationEventListener = function () {\n if (!('MutationObserver' in window)) {\n return;\n }\n // Create an observer instance\n containerMutationObserver = new MutationObserver(containerMutationHandler);\n // Options for the observer (which mutations to observe)\n var config = { childList: true, subtree: true };\n // Start observing the target node for configured mutations\n containerMutationObserver.observe(stateSwitch.config.container.element, config);\n debug('[event] Container mutation event listener have been added');\n};\n/**\n * Removes container mutation event listener\n */\nexport var removeContainerMutationEventListener = function () {\n if (!('MutationObserver' in window)) {\n return;\n }\n // stop observing\n containerMutationObserver.disconnect();\n containerMutationObserver = null;\n debug('[event] Container mutation event listener have been disabled');\n};\n","import { stateSwitch } from '../stateSwitch';\nimport { addUserActivityListeners, removeUserActivityListeners } from './userActivityEvents';\nimport { addUserLoginListener, removeUserLoginListener } from './userLoginEvents';\nimport { addPageVisibilityListeners, removePageVisibilityListeners } from './pageVisibilityEvents';\nimport { addContainerVisibilityEventListener, removeContainerVisibilityEventListener, } from './containerVisibilityEvents';\nimport { createItemsIntersectionObserver, addItemsVisibilityEventListeners, removeItemsVisibilityEventListeners, } from './itemsVisibilityEvents';\nimport { addContainerMutationEventListener, removeContainerMutationEventListener } from './containerMutationEvents';\n/**\n * Adds all event listeners\n */\nexport var addAllListeners = function () {\n addUserActivityListeners();\n addUserLoginListener();\n addPageVisibilityListeners();\n addContainerVisibilityEventListener();\n if (stateSwitch.config.items) {\n createItemsIntersectionObserver();\n addItemsVisibilityEventListeners();\n addContainerMutationEventListener();\n }\n};\n/**\n * Removes all dependent event listeners\n */\nexport var removeAllListeners = function () {\n if (stateSwitch.config.items) {\n removeContainerMutationEventListener();\n removeItemsVisibilityEventListeners();\n }\n removeContainerVisibilityEventListener();\n removePageVisibilityListeners();\n removeUserLoginListener();\n removeUserActivityListeners();\n};\n","import StateSwitch from '../classes/stateSwitch.class';\nimport { addAllListeners, removeAllListeners } from '../modules/events';\n// GLOBAL\nexport var stateSwitch = null;\n/**\n * Сreates a global object stateSwitch and\n * After сreates and configures all dependent event listeners\n */\nexport var createStateSwitch = function (verifiedConfig) {\n stateSwitch = new StateSwitch(verifiedConfig);\n window.sznIVA.spenttime.conf = function () { return stateSwitch.config; };\n addAllListeners();\n};\n/**\n * Remove all dependent event listeners and a global object stateSwitch\n */\nexport var removeStateSwitch = function () {\n removeAllListeners();\n window.sznIVA.spenttime.conf = function () { return null; };\n stateSwitch = null;\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { DEBUG_STATES, spenttimeDebug as debug } from '../debug';\nimport { saveHitData } from '../hit';\nimport { isDotConfigured, waitingForDOT } from '../dot';\nimport { getVerifiedConfig } from '../config/config';\nimport { stateSwitch, createStateSwitch, removeStateSwitch } from '../stateSwitch';\nimport { addEventForCypress } from '../../utils/addCustomEvent';\nimport { EVENT } from '../../constants';\nimport { sendHit } from '../../modules/hit';\n/**\n * Cleaning after measurement\n */\nexport var completeMeasurement = function () {\n addEventForCypress(EVENT.stateDone);\n removeStateSwitch();\n debug({\n message: \"The public \\\"spenttime.startMeasurement\\\" method has been completed\",\n state: DEBUG_STATES.DONE,\n });\n};\n/**\n * Sends the current collected data\n */\nexport var sendStatistics = function () {\n var statistics = stateSwitch.getStatistics(true);\n if (statistics.time === 0 && (stateSwitch.config.items ? statistics.items.length === 0 : true)) {\n return;\n }\n sendHit(statistics);\n};\n/**\n * The main method that starts all processes for measuring the spenttime by the user on the target element\n * @param element HTMLElement or element Id or selector\n * @param hitData Data to be sent to the server in hit\n * @param configuration Object with incoming configuration\n */\nexport var startMeasurement = function (element, hitData, configuration) {\n // if the measurement was previously started, then we finish it correctly\n if (stateSwitch) {\n debug({ message: 'Correct completion of the previous measurement of spenttime' });\n sendStatistics();\n completeMeasurement();\n }\n debug({\n message: 'The public \"spenttime.startMeasurement\" method was started',\n state: DEBUG_STATES.START,\n });\n debug(__assign({ message: 'Incoming parameters:' }, { element: element, hitData: hitData, configuration: configuration }));\n if (!('IntersectionObserver' in window)) {\n debug({\n message: \"It is not possible to make a measurement on this device\",\n state: DEBUG_STATES.DONE,\n });\n addEventForCypress(EVENT.measurementWillNotBePerformed);\n return;\n }\n saveHitData(hitData);\n var verifiedConfig = getVerifiedConfig(element, __assign({}, configuration));\n if (!verifiedConfig) {\n debug({\n message: \"[CONF] Measuring the spent time is not possible. The public \\\"startMeasurement\\\" function has been completed\",\n state: DEBUG_STATES.DONE,\n });\n addEventForCypress(EVENT.measurementWillNotBePerformed);\n return;\n }\n // passing the subsequent handler and its input parameters\n if (!isDotConfigured()) {\n waitingForDOT();\n }\n createStateSwitch(verifiedConfig);\n};\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport './types/globals';\nimport { spenttimeDebug as debug } from './modules/debug';\nimport { startMeasurement } from './modules/spenttime/measurement';\n/**\n * Expose to global object\n */\nvar output = {\n startMeasurement: startMeasurement,\n conf: function () { return null; },\n};\n/**\n * The main method. Initializing\n */\nvar initComponentSpenttime = function () {\n window.sznIVA = __assign(__assign({}, (window.sznIVA || {})), { spenttime: output });\n debug('window.sznIVA.spenttime added to the window-object');\n};\ninitComponentSpenttime();\nexport default output;\n"],"names":["HASH_UNDEFINED","MAX_SAFE_INTEGER","argsTag","boolTag","dateTag","funcTag","genTag","mapTag","numberTag","objectTag","promiseTag","regexpTag","setTag","stringTag","symbolTag","weakMapTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","reFlags","reIsHostCtor","reIsUint","cloneableTags","freeGlobal","g","Object","freeSelf","self","root","Function","freeExports","exports","nodeType","freeModule","module","moduleExports","addMapEntry","map","pair","set","addSetEntry","value","add","arrayReduce","array","iteratee","accumulator","initAccum","index","length","isHostObject","result","toString","e","mapToArray","Array","size","forEach","key","overArg","func","transform","arg","setToArray","uid","arrayProto","prototype","funcProto","objectProto","coreJsData","maskSrcKey","exec","keys","IE_PROTO","funcToString","hasOwnProperty","objectToString","reIsNative","RegExp","call","replace","Buffer","undefined","Symbol","Uint8Array","getPrototype","getPrototypeOf","objectCreate","create","propertyIsEnumerable","splice","nativeGetSymbols","getOwnPropertySymbols","nativeIsBuffer","isBuffer","nativeKeys","DataView","getNative","Map","Promise","Set","WeakMap","nativeCreate","dataViewCtorString","toSource","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","symbolProto","symbolValueOf","valueOf","Hash","entries","this","clear","entry","ListCache","MapCache","Stack","__data__","arrayLikeKeys","inherited","isArray","isObjectLike","isArrayLike","isArrayLikeObject","isArguments","n","baseTimes","String","skipIndexes","isIndex","push","assignValue","object","objValue","eq","assocIndexOf","baseClone","isDeep","isFull","customizer","stack","isObject","isArr","constructor","input","initCloneArray","source","copyArray","tag","getTag","isFunc","buffer","slice","copy","cloneBuffer","isPrototype","proto","initCloneObject","copyObject","getSymbols","copySymbols","baseAssign","cloneFunc","Ctor","cloneArrayBuffer","dataView","byteOffset","byteLength","cloneDataView","typedArray","cloneTypedArray","cloneMap","regexp","lastIndex","cloneRegExp","cloneSet","symbol","initCloneByTag","stacked","get","props","keysFunc","symbolsFunc","values","offset","arrayPush","baseGetAllKeys","getAllKeys","arrayEach","subValue","baseIsNative","isFunction","test","arrayBuffer","newValue","getMapData","type","data","getValue","has","pop","cache","pairs","LARGE_ARRAY_SIZE","other","ArrayBuffer","resolve","ctorString","isLength","baseKeys","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","id","loaded","__webpack_modules__","getter","__esModule","d","a","definition","o","defineProperty","enumerable","globalThis","window","obj","prop","nmd","paths","children","log","config","arguments","subName","name","fColor","bColor","style","badge","_len","messages","_key","messagesCopy","v","cloneDeep","console","table","ENABLER","EVENT_PREFIX","DEFAULTS","isTopLevel","win","top","Cypress","frameElement","getGlobalDebuggerObject","_a","sznIVA","debugger","upsertGlobalDebuggerObject","windowObject","assign","getParamValue","param","queryString","location","search","paramRegex","matches","match","getDebuggerRule","paramValue","topFrameRule","getTopFrameRule","localStorageRule","localStorage","getItem","error","getInternalConfig","JSON","stringify","__rest","s","t","p","indexOf","i","addEventListener","event","rule","postMessage","iframeBridgeNotified","handlerFromChildMessage","handlerFromTopMessage","document","referrer","DEVICE_TYPE","__assign","apply","DEBUG_STATES","debug","permanentEnabler","_b","_c","lastValue","removeItem","setItem","types","args","argsCount","shouldLog","welcomeNotified","findNameInValue","toLowerCase","getShouldLog","state","message","logArgs","status","EVENT_TYPE","detail","CustomEvent","dispatchEvent","debugFactory","spenttimeDebug","_i","time","Intl","DateTimeFormat","hour","minute","second","format","Date","EVENT","SPENTTIME_STATES","ITEM_MONITORED_ATTRIBUTE","DEFAULT_CONFIG","container","intersectionThreshold","mobile","measuring","fallAsleepTime","forcedDepartureTime","desktop","DEFAULT_ITEMS_CONFIG","numberOfItemsInHit","attributeWithDopDetails","measurementStartDelay","targetAreaHeight","targetAreaWidth","addEventForCypress","eventName","dotConfigured","isDotConfigured","DOT","isConfigured","commonHitData","action","sendHit","finalHitData","getHitData","hit","getContainerElement","incomingElement","element","elementId","body","contains","elementById","getElementById","querySelector","getElement","isPercent","num","getVerifiedItemsConfig","incomingItemsConfig","deviceType","selector","createDocumentFragment","isSelectorValid","attributeWithDopId","trim","deviceItemsConfig","getVerifiedConfig","incomingConfig","concat","navigator","userAgent","MOBILE","DESKTOP","deviceConfig","isUserActivityTimeCorrect","device","itemsConfig","items","SpenttimeHandler","delay","startTime","spenttime","_wasChange","init","_state","configurable","getState","getSpenttime","spenttimeWithDelay","getTime","finalSpenttime","getSpenttimeInSeconds","parseInt","inited","stateInited","reset","done","running","run","stateRun","pause","paused","statePaused","end","stateDone","jsonParse","str","parse","StateSwitch","verifiedConfig","_config","containerIsVisible","pageIsVisible","userIsSleeping","containerSpenttime","itemsState","getStatistics","wasChange","itemStatistic","hitData","Reflect","deleteProperty","updateContainerSpenttimeAction","setState","commonState","isChange","updateAllItemsSpenttimeAction","updateItemSpenttimeAction","isVisible","sendStatisticsIfEnoughItems","setItemState","itemIsVisible","itemElement","getAttribute","number","sendStatistics","throttle","callback","options","timeoutID","_ref","_ref$noTrailing","noTrailing","_ref$noLeading","noLeading","_ref$debounceMode","debounceMode","cancelled","lastExec","clearExistingTimeout","clearTimeout","wrapper","arguments_","elapsed","now","setTimeout","cancel","_ref2$upcomingOnly","upcomingOnly","timerIdUserFallsAsleep","timerIdUserLeaves","controlOfFallingAsleep","stateSwitch","completeMeasurement","clearTimers","restartTimers","activity","unloadHandler","beforeunloadHandler","activityHandler","loginHandler","_d","_e","_f","_g","_h","_j","changes","some","val","newUid","newIdentities","login","oldUid","oldIdentities","visibilitychangeHandler","hidden","blurHandler","containerIntersectionObserver","containerVisibilityHandler","isIntersecting","itemsIntersectionObserver","itemVisibilityHandler","target","addItemsVisibilityEventListeners","selectorWithoutMonitoredItems","querySelectorAll","hasAttribute","observe","setAttribute","containerMutationObserver","containerMutationHandler","addAllListeners","IntersectionObserver","threshold","getMargin","areaSize","Math","round","rMargin","bMargin","formatMargin","margin","rootMargin","createItemsIntersectionObserver","MutationObserver","childList","subtree","removeAllListeners","selectorMonitoredItems","disconnect","unobserve","removeAttribute","removeEventListener","conf","statistics","output","startMeasurement","configuration","measurementWillNotBePerformed","waitingForDot","createStateSwitch"],"sourceRoot":""}